diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-05 18:05:52 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-05 18:05:52 -0400 |
commit | 3abcf4962ad472dd5db6f231e94c5727537c4a1f (patch) | |
tree | c3b5106b6f7d3c13735018a4dd47bfcd60f42223 | |
parent | add quit and clear shortcuts to calculator (diff) | |
download | lumina-3abcf4962ad472dd5db6f231e94c5727537c4a1f.tar.gz lumina-3abcf4962ad472dd5db6f231e94c5727537c4a1f.tar.bz2 lumina-3abcf4962ad472dd5db6f231e94c5727537c4a1f.zip |
Commit some adjustments to the auto-extract functionality.
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/MainUI.cpp | 17 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/MainUI.h | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp index e365ef54..bc0c4d8f 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp @@ -73,7 +73,8 @@ void MainUI::LoadArguments(QStringList args){ bool autoExtract = false; for(int i=0; i<args.length(); i++){ if(args[i]=="--burn-img"){ burnIMG = true; continue; } - if(args[i]=="--ax"){ autoExtract = true; i++; + if(args[i]=="--ax"){ autoExtract = true; continue; } + /*i++; QFileInfo filename(args[i]); QDir filedir = filename.canonicalPath(); QString newdir = filename.completeBaseName(); @@ -96,14 +97,15 @@ void MainUI::LoadArguments(QStringList args){ qDebug () << "MAINUI - Extraction should have started"; } //now quit - QCoreApplication::quit(); + //QCoreApplication::quit(); return; - } + }*/ if(QFile::exists(args[i])){ ui->label_progress->setText(tr("Opening Archive...")); BACKEND->loadFile(args[i]); ui->actionUSB_Image->setEnabled(args[i].simplified().endsWith(".img")); if(burnIMG){ BurnImgToUSB(); } //Go ahead and launch the burn dialog right away + else if(autoExtract){ QTimer::singleShot(2000, this, SLOT(autoextractFiles())); } break; } } @@ -266,13 +268,14 @@ void MainUI::extractFiles(){ } void MainUI::autoextractFiles(){ -// QString dir = QFileDialog::getExistingDirectory(this, tr("Extract Into Directory"), QDir::homePath() ); -// if(dir.isEmpty()){ return; } + QString dir = BACKEND->currentFile().section("/",0,-2); //parent directory of the archive + //QFileDialog::getExistingDirectory(this, tr("Extract Into Directory"), QDir::homePath() ); + if(dir.isEmpty()){ return; } //add in a delay in case i'm hitting a race condition - qDebug() << "void MainUI::autoextractFiles() has started"; + /*qDebug() << "void MainUI::autoextractFiles() has started"; QTime waitTime= QTime::currentTime().addSecs(2); while (QTime::currentTime() < waitTime) - QCoreApplication::processEvents(QEventLoop::AllEvents, 100); + QCoreApplication::processEvents(QEventLoop::AllEvents, 100);*/ ui->label_progress->setText(tr("Extracting...")); BACKEND->startExtract(dir, true); // QApplication::quit(); diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.h b/src-qt5/desktop-utils/lumina-archiver/MainUI.h index 78e5d499..e37ae1cb 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.h +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.h @@ -25,7 +25,7 @@ public: void LoadArguments(QStringList); void loadIcons(); - QString newdir, dir; + //QString newdir, dir; private: Ui::MainUI *ui; |