Added code to save the position of the download manager window.

Mon, 11 Oct 2010 09:36:44 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 11 Oct 2010 09:36:44 +0200
changeset 669
d405dc3e2ed6
parent 668
b0061a6f7484
child 670
bb833c4bcf28

Added code to save the position of the download manager window.

Helpviewer/Download/DownloadManager.py file | annotate | diff | comparison | revisions
Preferences/__init__.py file | annotate | diff | comparison | revisions
--- a/Helpviewer/Download/DownloadManager.py	Sun Oct 10 21:12:43 2010 +0200
+++ b/Helpviewer/Download/DownloadManager.py	Mon Oct 11 09:36:44 2010 +0200
@@ -234,6 +234,7 @@
         
         Preferences.setHelp("DownloadManagerRemovePolicy", self.__removePolicy)
         Preferences.setHelp("DownloadManagerSize", self.size())
+        Preferences.setHelp("DownloadManagerPosition", self.pos())
         if self.__removePolicy == DownloadManager.RemoveExit:
             return
         
@@ -253,6 +254,9 @@
         size = Preferences.getHelp("DownloadManagerSize")
         if size.isValid():
             self.resize(size)
+        pos = Preferences.getHelp("DownloadManagerPosition")
+        self.move(pos)
+        
         downloads = Preferences.getHelp("DownloadManagerDownloads")
         for download in downloads:
             if not download[0].isEmpty() and \
--- a/Preferences/__init__.py	Sun Oct 10 21:12:43 2010 +0200
+++ b/Preferences/__init__.py	Mon Oct 11 09:36:44 2010 +0200
@@ -586,6 +586,7 @@
         "ShowPreview" : True, 
         "DownloadManagerRemovePolicy" : 0,      # never delete downloads
         "DownloadManagerSize" : QtCore.QSize(400, 300), 
+        "DownloadManagerPosition" : QtCore.QPoint(), 
         "DownloadManagerDownloads" : [], 
     }
     
@@ -1810,8 +1811,6 @@
     elif key in ["AdBlockSubscriptions"]:
         return toList(prefClass.settings.value("Help/" + key, 
             prefClass.helpDefaults[key]))
-    elif key in ["DownloadManagerSize"]:
-        return prefClass.settings.value("Help/" + key, prefClass.helpDefaults[key])
     else:
         return prefClass.settings.value("Help/" + key, prefClass.helpDefaults[key])
     

eric ide

mercurial