diff options
author | Weblate <noreply@weblate.org> | 2017-08-17 18:48:13 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-08-17 18:48:13 +0000 |
commit | 0e90665da788209184b031cf7f183ca917fae92c (patch) | |
tree | c276b16fb7f189200a26716ea8cc5f0cdcf45677 /src-qt5/desktop-utils | |
parent | Translated using Weblate (Catalan) (diff) | |
parent | Small changes to lumina-open: (diff) | |
download | lumina-0e90665da788209184b031cf7f183ca917fae92c.tar.gz lumina-0e90665da788209184b031cf7f183ca917fae92c.tar.bz2 lumina-0e90665da788209184b031cf7f183ca917fae92c.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils')
4 files changed, 31 insertions, 14 deletions
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"/> |