[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/digikam
From:       Andi Clemens <andi.clemens () gmx ! net>
Date:       2009-10-25 12:52:00
Message-ID: 1256475120.906458.15514.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1040051 by aclemens:

Use "Do not ask again" option for permanent delete as well.
This is a global setting, not only true for lighttable.

CCBUG:210907

 M  +19 -5     digikam/albumsettings.cpp  
 M  +3 -0      digikam/albumsettings.h  
 M  +35 -10    libs/dialogs/deletedialog.cpp  
 M  +3 -2      libs/dialogs/deletedialog.h  
 M  +17 -15    utilities/setup/setupmisc.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumsettings.cpp #1040050:1040051
@@ -67,6 +67,7 @@
     // file ops settings
     bool                                useTrash;
     bool                                showTrashDeleteDialog;
+    bool                                showPermanentDeleteDialog;
     // metadata setting
     bool                                sidebarApplyDirectly;
     // database setting
@@ -221,6 +222,7 @@
     d->showSplash                   = true;
     d->useTrash                     = true;
     d->showTrashDeleteDialog        = true;
+    d->showPermanentDeleteDialog    = true;
     d->sidebarApplyDirectly         = false;
 
     d->iconShowName                 = false;
@@ -393,11 +395,12 @@
 
     group = config->group("General Settings");
 
-    d->showSplash            = group.readEntry("Show Splash", true);
-    d->useTrash              = group.readEntry("Use Trash", true);
-    d->showTrashDeleteDialog = group.readEntry("Show Trash Delete Dialog", true);
-    d->sidebarApplyDirectly  = group.readEntry("Apply Sidebar Changes Directly", \
                false);
-    d->scanAtStart           = group.readEntry("Scan At Start", true);
+    d->showSplash                = group.readEntry("Show Splash", true);
+    d->useTrash                  = group.readEntry("Use Trash", true);
+    d->showTrashDeleteDialog     = group.readEntry("Show Trash Delete Dialog", \
true); +    d->showPermanentDeleteDialog = group.readEntry("Show Permanent Delete \
Dialog", true); +    d->sidebarApplyDirectly      = group.readEntry("Apply Sidebar \
Changes Directly", false); +    d->scanAtStart               = group.readEntry("Scan \
At Start", true);  
     // ---------------------------------------------------------------------
 
@@ -509,6 +512,7 @@
     group.writeEntry("Show Splash", d->showSplash);
     group.writeEntry("Use Trash", d->useTrash);
     group.writeEntry("Show Trash Delete Dialog", d->showTrashDeleteDialog);
+    group.writeEntry("Show Permanent Delete Dialog", d->showPermanentDeleteDialog);
     group.writeEntry("Apply Sidebar Changes Directly", d->sidebarApplyDirectly);
     group.writeEntry("Scan At Start", d->scanAtStart);
 
@@ -1223,6 +1227,16 @@
     return d->showTrashDeleteDialog;
 }
 
+void AlbumSettings::setShowPermanentDeleteDialog(bool val)
+{
+    d->showPermanentDeleteDialog = val;
+}
+
+bool AlbumSettings::getShowPermanentDeleteDialog() const
+{
+    return d->showPermanentDeleteDialog;
+}
+
 void AlbumSettings::setApplySidebarChangesDirectly(bool val)
 {
     d->sidebarApplyDirectly= val;
--- trunk/extragear/graphics/digikam/digikam/albumsettings.h #1040050:1040051
@@ -286,6 +286,9 @@
     void    setShowTrashDeleteDialog(bool val);
     bool    getShowTrashDeleteDialog() const;
 
+    void    setShowPermanentDeleteDialog(bool val);
+    bool    getShowPermanentDeleteDialog() const;
+
     void    setApplySidebarChangesDirectly(bool val);
     bool    getApplySidebarChangesDirectly() const;
 
--- trunk/extragear/graphics/digikam/libs/dialogs/deletedialog.cpp #1040050:1040051
@@ -116,10 +116,6 @@
 
     m_doNotShowAgain = new QCheckBox(m_checkBoxStack);
     m_doNotShowAgain->setGeometry(QRect(0, 0, 100, 30));
-    m_doNotShowAgain->setToolTip(i18n("If checked, this dialog will no longer be \
                shown, and files will "
-                                      "be directly moved to the Trash."));
-    m_doNotShowAgain->setWhatsThis(i18n("If this box is checked, this dialog will no \
                longer be shown, "
-                                        "and files will be directly moved to the \
Trash."));  m_doNotShowAgain->setText(i18n("Do not &ask again"));
 
     QVBoxLayout *vbox = new QVBoxLayout(this);
@@ -174,6 +170,22 @@
 
 void DeleteWidget::updateText()
 {
+    // set "do not ask again checkbox text
+    if (m_deleteMode == DeleteDialogMode::DeletePermanently)
+    {
+        m_doNotShowAgain->setToolTip(i18n("If checked, this dialog will no longer be \
shown, and files will " +                "be directly and permanently deleted."));
+        m_doNotShowAgain->setWhatsThis(i18n("If this box is checked, this dialog \
will no longer be shown, " +                "and files will be directly and \
permanently deleted.")); +    }
+    else
+    {
+        m_doNotShowAgain->setToolTip(i18n("If checked, this dialog will no longer be \
shown, and files will " +                "be directly moved to the Trash."));
+        m_doNotShowAgain->setWhatsThis(i18n("If this box is checked, this dialog \
will no longer be shown, " +                "and files will be directly moved to the \
Trash.")); +    }
+
     switch (m_listMode)
     {
         case DeleteDialogMode::Files:
@@ -192,9 +204,9 @@
                 m_deleteText->setText(i18n("These items will be moved to Trash."));
                 m_warningIcon->setPixmap(KIconLoader::global()->loadIcon("user-trash-full",
                
                                          KIconLoader::Desktop, \
KIconLoader::SizeLarge)); +                m_numFiles->setText(i18np("<b>1</b> file \
selected.", "<b>%1</b> files selected.", +                        \
m_fileList->count()));  }
-            m_numFiles->setText(i18np("<b>1</b> file selected.", "<b>%1</b> files \
                selected.",
-                                      m_fileList->count()));
             break;
         }
         case DeleteDialogMode::Albums:
@@ -253,7 +265,8 @@
 DeleteDialog::DeleteDialog(QWidget *parent)
             : KDialog(parent),
               m_saveShouldDeleteUserPreference(true),
-              m_saveDoNotShowAgain(false),
+              m_saveDoNotShowAgainTrash(false),
+              m_saveDoNotShowAgainPermanent(false),
               m_trashGuiItem(i18n("&Move to Trash"), "user-trash-full")
 {
     setButtons(User1 | Cancel);
@@ -288,6 +301,11 @@
         if (!AlbumSettings::instance()->getShowTrashDeleteDialog())
             return true;
     }
+    else if (deleteMode == DeleteDialogMode::NoChoiceDeletePermanently)
+    {
+        if (!AlbumSettings::instance()->getShowPermanentDeleteDialog())
+            return true;
+    }
     return exec() == QDialog::Accepted;
 }
 
@@ -305,11 +323,16 @@
     {
         settings->setUseTrash(!shouldDelete());
     }
-    if (m_saveDoNotShowAgain)
+    if (m_saveDoNotShowAgainTrash)
     {
         kDebug(digiKamAreaCode) << "setShowTrashDeleteDialog " << \
                !m_widget->m_doNotShowAgain->isChecked();
         settings->setShowTrashDeleteDialog(!m_widget->m_doNotShowAgain->isChecked());
  }
+    if (m_saveDoNotShowAgainPermanent)
+    {
+        kDebug(digiKamAreaCode) << "setShowPermanentDeleteDialog " << \
!m_widget->m_doNotShowAgain->isChecked(); +        \
settings->setShowPermanentDeleteDialog(!m_widget->m_doNotShowAgain->isChecked()); +   \
}  
     settings->saveSettings();
 
@@ -338,13 +361,15 @@
             // access the widget directly, signals will be fired to DeleteDialog and \
DeleteWidget  m_widget->m_shouldDelete->setChecked(false);
             m_widget->m_checkBoxStack->setCurrentWidget(m_widget->m_doNotShowAgain);
-            m_saveDoNotShowAgain = true;
+            m_saveDoNotShowAgainTrash = true;
             break;
         }
         case DeleteDialogMode::NoChoiceDeletePermanently:
         {
             m_widget->m_shouldDelete->setChecked(true);
-            m_widget->m_checkBoxStack->hide();
+            m_widget->m_checkBoxStack->setCurrentWidget(m_widget->m_doNotShowAgain);
+            m_saveDoNotShowAgainPermanent = true;
+//            m_widget->m_checkBoxStack->hide();
             break;
         }
         case DeleteDialogMode::UserPreference:
--- trunk/extragear/graphics/digikam/libs/dialogs/deletedialog.h #1040050:1040051
@@ -62,7 +62,7 @@
     enum DeleteMode
     {
         NoChoiceTrash,             // "Do not show again" checkbox, does not show if \
                config entry is set
-        NoChoiceDeletePermanently, // No checkbox
+        NoChoiceDeletePermanently, // same as above
         UserPreference,            // Checkbox to toggle trash/permanent, preset to \
                user's last preference
         UseTrash,                  // same checkbox as above, preset to trash
         DeletePermanently          // same checkbox as above, preset to permanent
@@ -152,7 +152,8 @@
 private:
 
     bool          m_saveShouldDeleteUserPreference;
-    bool          m_saveDoNotShowAgain;
+    bool          m_saveDoNotShowAgainTrash;
+    bool          m_saveDoNotShowAgainPermanent;
 
     KGuiItem      m_trashGuiItem;
 
--- trunk/extragear/graphics/digikam/utilities/setup/setupmisc.cpp #1040050:1040051
@@ -51,18 +51,20 @@
 
     SetupMiscPriv()
     {
-        showSplashCheck            = 0;
-        showTrashDeleteDialogCheck = 0;
-        sidebarApplyDirectlyCheck  = 0;
-        scanAtStart                = 0;
-        sidebarTypeLabel           = 0;
-        sidebarType                = 0;
+        showSplashCheck                = 0;
+        showTrashDeleteDialogCheck     = 0;
+        showPermanentDeleteDialogCheck = 0;
+        sidebarApplyDirectlyCheck      = 0;
+        scanAtStart                    = 0;
+        sidebarTypeLabel               = 0;
+        sidebarType                    = 0;
     }
 
     QLabel*    sidebarTypeLabel;
 
     QCheckBox* showSplashCheck;
     QCheckBox* showTrashDeleteDialogCheck;
+    QCheckBox* showPermanentDeleteDialogCheck;
     QCheckBox* sidebarApplyDirectlyCheck;
     QCheckBox* scanAtStart;
 
@@ -78,16 +80,13 @@
     setWidgetResizable(true);
     viewport()->setAutoFillBackground(false);
 
-    QVBoxLayout *layout           = new QVBoxLayout(panel);
+    QVBoxLayout *layout               = new QVBoxLayout(panel);
+    d->showTrashDeleteDialogCheck     = new QCheckBox(i18n("Confirm when moving \
items to the &trash."), panel); +    d->showPermanentDeleteDialogCheck = new \
QCheckBox(i18n("Confirm when permanently deleting items."), panel); +    \
d->sidebarApplyDirectlyCheck      = new QCheckBox(i18n("Do not confirm when applying \
changes in the &right sidebar."), panel); +    d->showSplashCheck                = \
new QCheckBox(i18n("&Show splash screen at startup."), panel); +    d->scanAtStart    \
= new QCheckBox(i18n("&Scan for new items at startup (makes startup slower.)"), \
panel);  
-    d->showTrashDeleteDialogCheck = new QCheckBox(i18n("Confirm when moving items to \
                the &trash."), panel);
-
-    d->sidebarApplyDirectlyCheck  = new QCheckBox(i18n("Do not confirm when applying \
                changes in the &right sidebar."), panel);
-
-    d->showSplashCheck            = new QCheckBox(i18n("&Show splash screen at \
                startup."), panel);
-
-    d->scanAtStart                = new QCheckBox(i18n("&Scan for new items at \
                startup (makes startup slower.)"), panel);
-
     KHBox *hbox         = new KHBox(panel);
     d->sidebarTypeLabel = new QLabel(i18n("Sidebar tab title:"), hbox);
     d->sidebarType      = new KComboBox(hbox);
@@ -100,6 +99,7 @@
     layout->setMargin(KDialog::spacingHint());
     layout->setSpacing(KDialog::spacingHint());
     layout->addWidget(d->showTrashDeleteDialogCheck);
+    layout->addWidget(d->showPermanentDeleteDialogCheck);
     layout->addWidget(d->sidebarApplyDirectlyCheck);
     layout->addWidget(d->showSplashCheck);
     layout->addWidget(d->scanAtStart);
@@ -121,6 +121,7 @@
 
     settings->setShowSplashScreen(d->showSplashCheck->isChecked());
     settings->setShowTrashDeleteDialog(d->showTrashDeleteDialogCheck->isChecked());
+    settings->setShowPermanentDeleteDialog(d->showPermanentDeleteDialogCheck->isChecked());
                
     settings->setApplySidebarChangesDirectly(d->sidebarApplyDirectlyCheck->isChecked());
  settings->setScanAtStart(d->scanAtStart->isChecked());
     settings->setSidebarTitleStyle(d->sidebarType->currentIndex() == 0 ? \
KMultiTabBar::VSNET : KMultiTabBar::KDEV3ICON); @@ -133,6 +134,7 @@
 
     d->showSplashCheck->setChecked(settings->getShowSplashScreen());
     d->showTrashDeleteDialogCheck->setChecked(settings->getShowTrashDeleteDialog());
+    d->showPermanentDeleteDialogCheck->setChecked(settings->getShowPermanentDeleteDialog());
                
     d->sidebarApplyDirectlyCheck->setChecked(settings->getApplySidebarChangesDirectly());
  d->scanAtStart->setChecked(settings->getScanAtStart());
     d->sidebarType->setCurrentIndex(settings->getSidebarTitleStyle() == \
KMultiTabBar::VSNET ? 0 : 1);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic