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

List:       kde-commits
Subject:    KDE/kdeutils/ark
From:       Raphael Kubo da Costa <kubito () gmail ! com>
Date:       2010-01-08 4:46:29
Message-ID: 1262925989.781845.24177.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1071450 by rkcosta:

Make it possible to close Ark after a successful extraction.

A future improvement could be hiding the option if in batch
extraction mode.

Patch written by Matthew Leach, thanks a lot!

CCMAIL: matthew@theleachfamily.co.uk
FEATURE: 135112

 M  +1 -0      app/mainwindow.cpp  
 M  +4 -0      kerfuffle/ark.kcfg  
 M  +12 -0     kerfuffle/extractiondialog.cpp  
 M  +2 -0      kerfuffle/extractiondialog.h  
 M  +9 -2      kerfuffle/extractiondialog.ui  
 M  +4 -0      part/part.cpp  
 M  +1 -0      part/part.h  


--- trunk/KDE/kdeutils/ark/app/mainwindow.cpp #1071449:1071450
@@ -133,6 +133,7 @@
 
     connect(m_part, SIGNAL(busy()), this, SLOT(updateActions()));
     connect(m_part, SIGNAL(ready()), this, SLOT(updateActions()));
+    connect(m_part, SIGNAL(quit()), this, SLOT(quit()));
 
     return true;
 }
--- trunk/KDE/kdeutils/ark/kerfuffle/ark.kcfg #1071449:1071450
@@ -9,6 +9,10 @@
 			<label>Open destination folder after extraction</label>
 			<default>false</default>
 		</entry>
+		<entry name="closeAfterExtraction" type="Bool">
+			<label>Close Ark after extraction</label>
+			<default>false</default>
+		</entry>
 		<entry name="preservePaths" type="Bool">
 			<label>Preserve paths when extracting</label>
 			<default>true</default>
--- trunk/KDE/kdeutils/ark/kerfuffle/extractiondialog.cpp #1071449:1071450
@@ -76,6 +76,7 @@
 void ExtractionDialog::loadSettings()
 {
     setOpenDestinationFolderAfterExtraction(ArkSettings::openDestinationFolderAfterExtraction());
+    setCloseAfterExtraction(ArkSettings::closeAfterExtraction());
     setPreservePaths(ArkSettings::preservePaths());
 }
 
@@ -191,6 +192,11 @@
     m_ui->openFolderCheckBox->setChecked(value);
 }
 
+void ExtractionDialog::setCloseAfterExtraction(bool value)
+{
+  m_ui->closeAfterExtraction->setChecked(value);
+}
+
 void ExtractionDialog::setPreservePaths(bool value)
 {
     m_ui->preservePaths->setChecked(value);
@@ -206,6 +212,11 @@
     return m_ui->openFolderCheckBox->isChecked();
 }
 
+bool ExtractionDialog::closeAfterExtraction() const
+{
+    return m_ui->closeAfterExtraction->isChecked();
+}
+
 KUrl ExtractionDialog::destinationDirectory() const
 {
     if (extractToSubfolder()) {
@@ -218,6 +229,7 @@
 void ExtractionDialog::writeSettings()
 {
     ArkSettings::setOpenDestinationFolderAfterExtraction(openDestinationAfterExtraction());
+    ArkSettings::setCloseAfterExtraction(closeAfterExtraction());
     ArkSettings::setPreservePaths(preservePaths());
     ArkSettings::self()->writeConfig();
 }
--- trunk/KDE/kdeutils/ark/kerfuffle/extractiondialog.h #1071449:1071450
@@ -49,10 +49,12 @@
     void setPreservePaths(bool);
     void batchModeOption();
     void setOpenDestinationFolderAfterExtraction(bool);
+    void setCloseAfterExtraction(bool);
     void setAutoSubfolder(bool value);
 
     bool extractAllFiles() const;
     bool openDestinationAfterExtraction() const;
+    bool closeAfterExtraction() const;
     bool extractToSubfolder() const;
     bool autoSubfolders() const;
     bool preservePaths() const;
--- trunk/KDE/kdeutils/ark/kerfuffle/extractiondialog.ui #1071449:1071450
@@ -112,7 +112,7 @@
       <string>Options</string>
      </property>
      <layout class="QGridLayout" name="gridLayout" >
-      <item row="5" column="0" >
+      <item row="6" column="0" >
        <spacer name="verticalSpacer" >
         <property name="orientation" >
          <enum>Qt::Vertical</enum>
@@ -133,13 +133,20 @@
        </widget>
       </item>
       <item row="3" column="0" >
+       <widget class="QCheckBox" name="closeAfterExtraction" >
+        <property name="text" >
+         <string>Close &amp;Ark after extraction</string>
+        </property>
+       </widget>
+      </item>
+      <item row="4" column="0" >
        <widget class="QCheckBox" name="preservePaths" >
         <property name="text" >
          <string>&amp;Preserve paths when extracting</string>
         </property>
        </widget>
       </item>
-      <item row="4" column="0" >
+      <item row="5" column="0" >
        <widget class="QCheckBox" name="autoSubfolders" >
         <property name="text" >
          <string>&amp;Automatically create subfolders</string>
--- trunk/KDE/kdeutils/ark/part/part.cpp #1071449:1071450
@@ -635,6 +635,10 @@
 
             KRun::runUrl(destinationFolder, "inode/directory", widget());
         }
+
+        if (ArkSettings::closeAfterExtraction()) {
+           emit quit();
+        }
     }
 }
 
--- trunk/KDE/kdeutils/ark/part/part.h #1071449:1071450
@@ -90,6 +90,7 @@
 signals:
     void busy();
     void ready();
+    void quit();
 
 private:
     void setupView();
[prev in list] [next in list] [prev in thread] [next in thread] 

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