[Apt-offline-devel] [SCM] Offline APT Package Manager branch, apt-offline-qt, updated. v0.9.9-110-gdeef88f

Abhishek Mishra ideamonk at gmail.com
Sat Aug 21 15:40:13 UTC 2010


The following commit has been merged in the apt-offline-qt branch:
commit 9dbf3c3443b779c7ada32e40c3b98297710c7381
Author: Abhishek Mishra <ideamonk at gmail.com>
Date:   Fri Aug 20 08:59:41 2010 +0530

    added enable/disable of action buttons on install

diff --git a/apt_offline_gui/AptOfflineQtCommon.py b/apt_offline_gui/AptOfflineQtCommon.py
index 246d38d..a086e3f 100644
--- a/apt_offline_gui/AptOfflineQtCommon.py
+++ b/apt_offline_gui/AptOfflineQtCommon.py
@@ -2,6 +2,7 @@
 
 styles = {
             'red': "<span style='color:red;'>#</span>",
+            'orange': "<span style='color:orange;'>#</span>",
             'green': "<span style='color:green;'>#</span>",
             'green_fin': "<span style='color:green;font-weight:bold;'>#</span>"
         }
diff --git a/apt_offline_gui/AptOfflineQtInstall.py b/apt_offline_gui/AptOfflineQtInstall.py
index f716aa4..300f234 100644
--- a/apt_offline_gui/AptOfflineQtInstall.py
+++ b/apt_offline_gui/AptOfflineQtInstall.py
@@ -29,8 +29,22 @@ class Worker(QtCore.QThread):
     def write(self, text):
         # redirects console output to our consoleOutputHolder
         # extract chinese whisper from text
-        self.emit (QtCore.SIGNAL('output(QString)'), text)
-        return
+        if ('.deb' in text and 'synced' in text):
+            try:
+                text = guicommon.style("Package : ",'orange') + guicommon.style(text.split("/")[-1],'green_fin')
+            except:
+                pass
+            self.emit (QtCore.SIGNAL('output(QString)'), text)
+        if ('apt/lists' in text):
+            try:
+                # this part is always done on a linux system so we can hardcode / for a while
+                text = guicommon.style("Update : ",'orange') + guicommon.style(text.split("/")[-1],'green_fin')
+            except:
+                # let the text be original otherwise
+                pass
+            self.emit (QtCore.SIGNAL('output(QString)'), text)
+        else:
+            self.emit (QtCore.SIGNAL('output(QString)'), guicommon.style(text,'red'))
 
     def flush(self):
         ''' nothing to do :D '''
@@ -87,6 +101,7 @@ class AptOfflineQtInstall(QtGui.QDialog):
         args = InstallerArgs(filename=self.filepath, progress_bar=self.ui.statusProgressBar, progress_label=self.ui.progressStatusDescription )
 
         self.worker.setArgs (args)
+        self.disableActions()
         self.worker.start()
 
     def popupDirectoryDialog(self):
@@ -114,6 +129,17 @@ class AptOfflineQtInstall(QtGui.QDialog):
         # TODO: implement progress here
         return
 
+    def disableActions(self):
+        self.ui.cancelButton.setEnabled(False)
+        self.ui.startInstallButton.setEnabled(False)
+        self.ui.browseFilePathButton.setEnabled(False)
+        self.ui.zipFilePath.setEnabled(False)
+
+    def enableActions(self):
+        self.ui.cancelButton.setEnabled(True)
+        self.ui.startInstallButton.setEnabled(True)
+        self.ui.browseFilePathButton.setEnabled(True)
+        self.ui.zipFilePath.setEnabled(True)
 
 if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)

-- 
Offline APT Package Manager



More information about the Apt-offline-devel mailing list