From 9cb7af0a7e507e73c8da7caf02930c52f3a8c58b Mon Sep 17 00:00:00 2001 From: q5sys Date: Mon, 4 Sep 2017 20:18:44 -0400 Subject: add prototype for auto-archival in file manager --- src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index 3790d145..c102a32e 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -241,6 +241,7 @@ void DirWidget::createShortcuts(){ kPaste= new QShortcut(QKeySequence(QKeySequence::Paste),this); kRename= new QShortcut(QKeySequence(Qt::Key_F2),this); kExtract= new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_E), this); + //kArchive= new QShortcut(QKeySequence(Qt::CTRL+Qt::Key_R), this); kFav= new QShortcut(QKeySequence(Qt::Key_F3),this); kDel= new QShortcut(QKeySequence(QKeySequence::Delete),this); kOpSS= new QShortcut(QKeySequence(Qt::Key_F6),this); @@ -257,6 +258,7 @@ void DirWidget::createShortcuts(){ connect(kPaste, SIGNAL(activated()), this, SLOT(pasteFiles()) ); connect(kRename, SIGNAL(activated()), this, SLOT(renameFiles()) ); connect(kExtract, SIGNAL(activated()), this, SLOT(autoExtractFiles()) ); + //connect(kArchive, SIGNAL(activated()), this, SLOT(autoArchiveFiles()) ); connect(kFav, SIGNAL(activated()), this, SLOT(favoriteFiles()) ); connect(kDel, SIGNAL(activated()), this, SLOT(removeFiles()) ); connect(kOpSS, SIGNAL(activated()), this, SLOT(openInSlideshow()) ); @@ -552,7 +554,9 @@ void DirWidget::UpdateContextMenu(){ contextMenu->addAction(LXDG::findIcon("edit-cut",""), tr("Cut Selection"), this, SLOT(cutFiles()), kCut->key() )->setEnabled(canmodify); contextMenu->addAction(LXDG::findIcon("edit-copy",""), tr("Copy Selection"), this, SLOT(copyFiles()), kCopy->key() )->setEnabled(canmodify); if(LUtils::isValidBinary("lumina-archiver") && sel.length() ==1){ contextMenu->addAction(LXDG::findIcon("archive",""), tr("Auto-Extract"), this, SLOT(autoExtractFiles()), kExtract->key() )->setEnabled(canmodify); } - } + //if(LUtils::isValidBinary("lumina-archiver") && sel.length() ==1){ contextMenu->addAction(LXDG::findIcon("archive",""), tr("Auto-Archive"), this, SLOT(autoArchiveFiles()), kArchive->key() )->setEnabled(canmodify); } + + } if( QApplication::clipboard()->mimeData()->hasFormat("x-special/lumina-copied-files") ){ contextMenu->addAction(LXDG::findIcon("edit-paste",""), tr("Paste"), this, SLOT(pasteFiles()), QKeySequence(Qt::CTRL+Qt::Key_V) )->setEnabled(canmodify); } @@ -890,6 +894,12 @@ void DirWidget::autoExtractFiles(){ pExtract->start(runline);*/ } +void DirWidget::autoArchiveFiles(){ + QStringList files = currentBrowser()->currentSelection(); + qDebug() << "Starting auto-archival:" << files; + ExternalProcess::launch("lumina-archiver", QStringList() << "--aa" << files); +} + //==================== // PROTECTED //==================== -- cgit From eb200e2d004a0d2c848f8fe4778f84f2a4aaffcf Mon Sep 17 00:00:00 2001 From: q5sys Date: Mon, 4 Sep 2017 20:19:52 -0400 Subject: clean out some older unused code comments --- .../desktop-utils/lumina-fm/widgets/DirWidget2.cpp | 36 ---------------------- 1 file changed, 36 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index c102a32e..07549297 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -739,36 +739,6 @@ void DirWidget::createNewXDGEntry(){ // - Selected FILE operations -//---------------------------------------------------// -/* -QStringList DirWidget::getPreferredApplications(){ - QStringList out; - //First list all the applications registered for that same mimetype - QString mime = fileEXT; - out << LXDG::findAvailableAppsForMime(mime); - - //Now search the internal settings for that extension and find any applications last used - QStringList keys = settings->allKeys(); - for(int i=0; ivalue(keys[i]).toString().split(":::"); - qDebug() << "Found Files:" << keys[i] << files; - bool cleaned = false; - for(int j=0; jsetValue(keys[i], files.join(":::")); } //update the registry - if(!out.isEmpty()){ break; } //already found files - } - } - //Make sure we don't have any duplicates before we return the list - out.removeDuplicates(); - return out; -} - */ - //---------------------------------------------------// void DirWidget::cutFiles(){ QStringList sel = currentBrowser()->currentSelection(); @@ -886,12 +856,6 @@ void DirWidget::autoExtractFiles(){ QStringList files = currentBrowser()->currentSelection(); qDebug() << "Starting auto-extract:" << files; ExternalProcess::launch("lumina-archiver", QStringList() << "--ax" << files); - /*ExternalProcess *pExtract= new ExternalProcess(this); - QString program = "lumina-archiver --ax "; - QStringList files = currentBrowser()->currentSelection(); - for(int i=0; istart(runline);*/ } void DirWidget::autoArchiveFiles(){ -- cgit From bb2dd721fca94d102b531b569e7af9bc211aeca1 Mon Sep 17 00:00:00 2001 From: q5sys Date: Mon, 4 Sep 2017 20:20:27 -0400 Subject: comment out method until its finished --- src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index 07549297..78759aa2 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -858,11 +858,13 @@ void DirWidget::autoExtractFiles(){ ExternalProcess::launch("lumina-archiver", QStringList() << "--ax" << files); } -void DirWidget::autoArchiveFiles(){ +/* + * void DirWidget::autoArchiveFiles(){ QStringList files = currentBrowser()->currentSelection(); qDebug() << "Starting auto-archival:" << files; ExternalProcess::launch("lumina-archiver", QStringList() << "--aa" << files); } +*/ //==================== // PROTECTED -- cgit From 2c3ebcb7558125e112ed08b76e50da8d7a3fc60b Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Thu, 7 Sep 2017 18:05:30 -0400 Subject: Fixed bug with lumina-fm editing default configuration file as root --- src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp') diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index 78759aa2..8273d09c 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -28,7 +28,7 @@ #define DEBUG 0 -DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){ +DirWidget::DirWidget(QString objID, QSettings *settings, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){ ui->setupUi(this); //load the designer file ID = objID; //Assemble the toolbar for the widget @@ -54,6 +54,7 @@ DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new U toolbar->addAction(ui->actionDualColumn); columnActionGroup->addAction(ui->actionDualColumn); toolbar->addAction(ui->actionMenu); + this->settings = settings; //Add the browser widgets RCBW = 0; //right column browser is unavailable initially BW = new BrowserWidget("", this); @@ -340,8 +341,7 @@ void DirWidget::on_tool_zoom_in_clicked(){ size += 16; setThumbnailSize(size); //Now Save the size value as the default for next time - QSettings SET("lumina-desktop","lumina-fm"); - SET.setValue("iconsize", size); + settings->setValue("iconsize", size); } void DirWidget::on_tool_zoom_out_clicked(){ @@ -350,8 +350,7 @@ void DirWidget::on_tool_zoom_out_clicked(){ size -= 16; setThumbnailSize(size); //Now Save the size value as the default for next time - QSettings SET("lumina-desktop","lumina-fm"); - SET.setValue("iconsize", size); + settings->setValue("iconsize", size); } // -- Top Snapshot Buttons -- cgit