diff options
author | Ken Moore <ken@ixsystems.com> | 2018-03-21 14:10:48 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-03-21 14:10:48 -0400 |
commit | f71b705ac5e676f0d1f2c1fa75c7bd789d59ceec (patch) | |
tree | 45f458f590a15cdba4c85c486409b97b3e2d17b7 /src-qt5 | |
parent | Fix up the RSS reader. (diff) | |
download | lumina-f71b705ac5e676f0d1f2c1fa75c7bd789d59ceec.tar.gz lumina-f71b705ac5e676f0d1f2c1fa75c7bd789d59ceec.tar.bz2 lumina-f71b705ac5e676f0d1f2c1fa75c7bd789d59ceec.zip |
Add a "Verify File Delete" view option to lumina-fm
When checked (default) it will prompt about filesystem deletions.
When unchecked, it will not prompt and just delete the items.
Diffstat (limited to 'src-qt5')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.cpp | 17 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.h | 3 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/MainUI.ui | 20 |
3 files changed, 30 insertions, 10 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index 8455e3aa..b2f976d2 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -302,7 +302,7 @@ void MainUI::loadSettings(){ on_actionShow_Thumbnails_triggered(); //make sure to update models too //ui->actionView_showDirTreePane->setChecked( settings->value("showdirtree", false).toBool()); //on_actionView_showDirTreePane_triggered(); //make sure to update the models too - + ui->actionVerify_File_Delete->setChecked( settings->value("showdeleteprompt", true).toBool()); //ui->actionShow_Action_Buttons->setChecked(settings->value("showactions", true).toBool() ); //on_actionShow_Action_Buttons_triggered(); //make sure to update the UI //ui->actionShow_Thumbnails->setChecked( settings->value("showthumbnails", true).toBool() ); @@ -472,6 +472,11 @@ void MainUI::on_actionView_Hidden_Files_triggered(){ } +void MainUI::on_actionVerify_File_Delete_triggered(){ +//Now save this setting for later + settings->setValue("showdeleteprompt", ui->actionView_Hidden_Files->isChecked()); +} + void MainUI::treeWidgetWidthChanged(float percent){ //NOTE: Percent needs to be between 0-75 if(percent > 75){ percent = 75; } @@ -922,10 +927,12 @@ void MainUI::RemoveFiles(QStringList list){ } //Verify permanent removal of file/dir - QMessageBox dlgQ(QMessageBox::Question, tr("Verify Removal"), tr("WARNING: This will permanently delete the file(s) from the system!")+"\n"+tr("Are you sure you want to continue?"), QMessageBox::Yes | QMessageBox::No, this); - dlgQ.setDetailedText(tr("Items to be removed:")+"\n\n"+names.join("\n")); - dlgQ.exec(); - if(dlgQ.result() != QMessageBox::Yes){ return; } //cancelled + if(ui->actionVerify_File_Delete->isChecked()){ + QMessageBox dlgQ(QMessageBox::Question, tr("Verify Removal"), tr("WARNING: This will permanently delete the file(s) from the system!")+"\n"+tr("Are you sure you want to continue?"), QMessageBox::Yes | QMessageBox::No, this); + dlgQ.setDetailedText(tr("Items to be removed:")+"\n\n"+names.join("\n")); + dlgQ.exec(); + if(dlgQ.result() != QMessageBox::Yes){ return; } //cancelled + } //Now remove the file/dir qDebug() << " - Delete: "<<paths; diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.h b/src-qt5/desktop-utils/lumina-fm/MainUI.h index b17ec690..9eed250d 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.h +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.h @@ -129,7 +129,8 @@ private slots: void on_actionDelete_Selection_triggered();*/ void on_actionRefresh_triggered(); void on_actionView_Hidden_Files_triggered(); - //void on_actionView_showDirTreePane_triggered(); + void on_actionVerify_File_Delete_triggered(); + //void on_actionView_showDirTreePane_triggered(); //void on_actionShow_Action_Buttons_triggered(); void treeWidgetWidthChanged(float percent); void on_actionShow_Thumbnails_triggered(); diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.ui b/src-qt5/desktop-utils/lumina-fm/MainUI.ui index 5f067786..32ccd659 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>567</width> - <height>415</height> + <height>417</height> </rect> </property> <property name="windowTitle"> @@ -69,7 +69,7 @@ <x>0</x> <y>0</y> <width>567</width> - <height>161</height> + <height>137</height> </rect> </property> <layout class="QHBoxLayout" name="BrowserLayout"> @@ -116,7 +116,7 @@ <x>0</x> <y>0</y> <width>567</width> - <height>28</height> + <height>38</height> </rect> </property> <widget class="QMenu" name="menuFile"> @@ -145,9 +145,10 @@ </widget> <addaction name="actionRefresh"/> <addaction name="separator"/> + <addaction name="actionShow_Thumbnails"/> <addaction name="actionView_Hidden_Files"/> + <addaction name="actionVerify_File_Delete"/> <addaction name="separator"/> - <addaction name="actionShow_Thumbnails"/> <addaction name="menuView_Mode"/> </widget> <widget class="QMenu" name="menuBookmarks"> @@ -451,6 +452,17 @@ <string>Open as Root</string> </property> </action> + <action name="actionVerify_File_Delete"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="text"> + <string>Verify File Delete</string> + </property> + </action> </widget> <resources/> <connections/> |