diff options
-rw-r--r-- | src-qt5/core/lumina-open/main.cpp | 18 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/MainUI.cpp | 10 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp | 27 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-archiver/TarBackend.h | 2 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/i18n/l-screenshot_cs.ts | 6 |
5 files changed, 40 insertions, 23 deletions
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp index d421b5b6..72d09f42 100644 --- a/src-qt5/core/lumina-open/main.cpp +++ b/src-qt5/core/lumina-open/main.cpp @@ -88,9 +88,9 @@ void LaunchAutoStart(){ QString cmd = xdgapps[i]->getDesktopExec(); if(cmd.contains("%")){cmd = cmd.remove("%U").remove("%u").remove("%F").remove("%f").remove("%i").remove("%c").remove("%k").simplified(); } //Now run the command - if(!cmd.isEmpty()){ + if(!cmd.isEmpty()){ qDebug() << " - Auto-Starting File:" << xdgapps[i]->filePath; - QProcess::startDetached(cmd); + QProcess::startDetached(cmd); } } //make sure we clean up all the xdgapps structures @@ -103,7 +103,7 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS if(extension=="mimetype"){ //qDebug() << "inFile:" << inFile; QStringList matches = LXDG::findAppMimeForFile(inFile, true).split("::::"); //allow multiple matches - //qDebug() << "Matches:" << matches; + qDebug() << "Mimetype Matches:" << matches; for(int i=0; i<matches.length(); i++){ defApp = LXDG::findDefaultAppForMime(matches[i]); //qDebug() << "MimeType:" << matches[i] << defApp; @@ -111,7 +111,7 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS else if(i+1==matches.length()){ extension = matches[0]; } } }else{ defApp = LFileDialog::getDefaultApp(extension); } - //qDebug() << "extension:" << extension << "defApp:" << defApp; + qDebug() << "Mimetype:" << extension << "defApp:" << defApp; if( !defApp.isEmpty() && !showDLG ){ if(defApp.endsWith(".desktop")){ XDGDesktop DF(defApp); @@ -159,10 +159,10 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS if(!w.appPath.isEmpty()){ path = w.appPath; } //Just do the default application registration here for now // might move it to the runtime phase later after seeing that the app has successfully started - if(w.setDefault){ + if(w.setDefault){ if(!w.appFile.isEmpty()){ LFileDialog::setDefaultApp(extension, w.appFile); } else{ LFileDialog::setDefaultApp(extension, w.appExec); } - }else{ LFileDialog::setDefaultApp(extension, ""); } + } //Now return the resulting application command return w.appExec; } @@ -234,7 +234,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat bool isFile=false; bool isUrl=false; QString extension; //Quick check/replacement for the URL syntax of a file - if(inFile.startsWith("file://")){ inFile.remove(0,7); } + if(inFile.startsWith("file://")){ inFile = QUrl(inFile).toLocalFile(); } //change from URL to file format for a local file //First make sure this is not a binary name first QString bin = inFile.section(" ",0,0).simplified(); if(LUtils::isValidBinary(bin) && !bin.endsWith(".desktop") && !QFileInfo(inFile).isDir() ){isFile=true; } @@ -317,10 +317,10 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat } } //Now assemble the exec string (replace file/url field codes as necessary) - if(useInputFile){ + if(useInputFile){ args = inFile; //just to keep them distinct internally // NOTE: lumina-open is only designed for a single input file, - // so no need to distinguish between the list codes (uppercase) + // so no need to distinguish between the list codes (uppercase) // and the single-file codes (lowercase) //Special "inFile" format replacements for input codes if( (cmd.contains("%f") || cmd.contains("%F") ) ){ diff --git a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp index 2dae90a4..afead9af 100644 --- a/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/MainUI.cpp @@ -196,8 +196,8 @@ QString MainUI::OpenFileTypes(){ void MainUI::NewArchive(){ QString file = QFileDialog::getSaveFileName(this, tr("Create Archive"), QDir::homePath(), CreateFileTypes() ); if(file.isEmpty()){ return; } - if(QFile::exists(file)){ - if( !QFile::remove(file) ){ QMessageBox::warning(this, tr("Error"), QString(tr("Could not overwrite file:"))+"\n"+file); } + if(QFile::exists(file)){ + if( !QFile::remove(file) ){ QMessageBox::warning(this, tr("Error"), QString(tr("Could not overwrite file:"))+"\n"+file); } } ui->label_progress->setText(""); //just clear it (this action is instant) BACKEND->loadFile(file); @@ -267,6 +267,12 @@ void MainUI::extractSelection(){ void MainUI::ViewFile(QTreeWidgetItem *it){ if(it->childCount()>0){ return; } //directory - not viewable + /*QString newfile = QDir::tempPath()+"/"+it->whatsThis(0).section("/",-1); + if(QFile::exists(newfile)){ + if(QMessageBox::Yes != QMessageBox::question(this, tr("File exists"), tr("A temporary file with the same name already exists, do you want to overwrite it?")+"\n\n"+newfile, QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ){ + return; //cancelled + } + }*/ ui->label_progress->setText(tr("Extracting...")); BACKEND->startViewFile(it->whatsThis(0)); } diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp index c0d3b03e..9fe735a3 100644 --- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.cpp @@ -8,6 +8,8 @@ #include <QFile> #include <QDir> #include <QDebug> +#include <QDateTime> +#include <QCoreApplication> Backend::Backend(QObject *parent) : QObject(parent){ //Setup the backend process @@ -38,8 +40,8 @@ void Backend::loadFile(QString path){ } bool Backend::canModify(){ - static QStringList validEXT; - if( validEXT.isEmpty() ){ + static QStringList validEXT; + if( validEXT.isEmpty() ){ validEXT << ".zip" << ".tar.gz" << ".tgz" << ".tar.xz" << ".txz" << ".tar.bz" << ".tbz" << ".tar.bz2" << ".tbz2" << ".tar" \ << ".tar.lzma" << ".tlz" << ".cpio" << ".pax" << ".ar" << ".shar" << ".7z"; } @@ -95,16 +97,16 @@ void Backend::startAdd(QStringList paths){ QStringList args; args << "-c" << "-a"; args << flags; - //Now setup the parent dir + //Now setup the parent dir QString parent = paths[0].section("/",0,-2); - for(int i=0; i<paths.length(); i++){ - paths[i] = paths[i].section(parent,1,-1); + for(int i=0; i<paths.length(); i++){ + paths[i] = paths[i].section(parent,1,-1); if(paths[i].startsWith("/")){ paths[i].remove(0,1); } } args << "-C" << parent; args << paths; if(QFile::exists(filepath)){ //append to existing - args.replaceInStrings(filepath, tmpfilepath); + args.replaceInStrings(filepath, tmpfilepath); args<< "@"+filepath; } STARTING=true; @@ -151,11 +153,20 @@ void Backend::startExtract(QString path, bool overwrite, QStringList files){ void Backend::startViewFile(QString path){ QStringList args; + QString newfilename = QDateTime::currentDateTime().toString("yyyyMMddhhmmss")+"-"+path.section("/",-1); args << "-x"; - args << flags <<"--include" << path <<"--strip-components" << QString::number(path.count("/")) << "-C" << QDir::tempPath(); + //args << flags <<"--include" << path <<"--strip-components" << QString::number(path.count("/")) << "-C" << QDir::tempPath(); + args << flags <<"--include" << path <<"--to-stdout"; STARTING=true; //qDebug() << "Starting command:" << "tar" << args; - PROC.start("tar", args); + emit ProcessStarting(); + QProcess tmpProc; + tmpProc.setStandardOutputFile(newfilename); + tmpProc.start("tar",args); + while(!tmpProc.waitForFinished(500)){ QCoreApplication::processEvents(); } + emit ProcessFinished(tmpProc.exitCode()==0, ""); + QProcess::startDetached("xdg-open", QStringList() << newfilename); + //PROC.start("tar", args); } //=============== diff --git a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h index 3eb4eb53..dd08361c 100644 --- a/src-qt5/desktop-utils/lumina-archiver/TarBackend.h +++ b/src-qt5/desktop-utils/lumina-archiver/TarBackend.h @@ -22,7 +22,7 @@ public: //Listing routines QString currentFile(); - bool isWorking(); //is this currently still making changes? + bool isWorking(); //is this currently still making changes? //Contents listing QStringList heirarchy(); //returns all the file paths within the archive diff --git a/src-qt5/desktop-utils/lumina-screenshot/i18n/l-screenshot_cs.ts b/src-qt5/desktop-utils/lumina-screenshot/i18n/l-screenshot_cs.ts index 331d54fd..be930e36 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/i18n/l-screenshot_cs.ts +++ b/src-qt5/desktop-utils/lumina-screenshot/i18n/l-screenshot_cs.ts @@ -184,17 +184,17 @@ <message> <location filename="../MainUI.cpp" line="329"/> <source>Save</source> - <translation type="unfinished"></translation> + <translation>Uložit</translation> </message> <message> <location filename="../MainUI.cpp" line="330"/> <source>Discard</source> - <translation type="unfinished"></translation> + <translation>Zahodit</translation> </message> <message> <location filename="../MainUI.cpp" line="331"/> <source>Cancel</source> - <translation type="unfinished"></translation> + <translation>Storno</translation> </message> <message> <location filename="../MainUI.ui" line="543"/> |