SF.net SVN: fclient:[791] trunk/fclient/src/fclient/impl/ DlgDownloadKeyToDisk.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-27 21:02:43
|
Revision: 791
http://fclient.svn.sourceforge.net/fclient/?rev=791&view=rev
Author: jUrner
Date: 2008-07-27 21:02:52 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
can not deal with invalid keys ++ save / restore geometry
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
Modified: trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 20:57:12 UTC (rev 790)
+++ trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 21:02:52 UTC (rev 791)
@@ -19,6 +19,16 @@
#**********************************************************************************
#
#**********************************************************************************
+class Settings(config.SettingsBase):
+ _key_ = 'DlgDownloadKeyToDisk'
+ _settings_ = (
+ ('Geometry', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate),
+ )
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
class DlgDownloadKeyToDisk(QtGui.QDialog, Ui_DlgDownloadKeyToDisk):
IdEdKey = 'edKey'
@@ -32,6 +42,7 @@
self.setupUi(self)
self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Download key..'))
+ self.fcSettings = Settings(self).restore()
self._fileName = None
self._fcpKey = fcpKey
@@ -56,6 +67,9 @@
bt = self.controlById(self.IdBtChooseDirectory)
self.connect(bt, QtCore.SIGNAL('clicked()'), self.onChooseDirectory)
+
+ self.restoreGeometry(self.fcSettings.value('Geometry'))
+
##############################
## methods
##############################
@@ -82,16 +96,8 @@
try:
self._fcpKey = fcp2.Key(key)
except fcp2.ErrorKey:
- result = QtGui.QMessageBox.warning(self,
- self.windowTitle(),
- 'Looks like the key entered is not valid. \nProceed anyways?',
- QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
- )
- if result == QtGui.QMessageBox.Yes:
- self._fcpKey = fcp2.KeyAny(key)
- else:
- return
-
+ return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Looks like the key entered is not valid')
+
fileName = edFileName.text()
if fileName.isEmpty():
return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a filename for the key')
@@ -104,6 +110,12 @@
self.done(self.Accepted)
##############################
+ ## overwritten events
+ ##############################
+ def hideEvent(self, event):
+ self.fcSettings.setValues(Geometry=self.saveGeometry())
+
+ ##############################
## event handlers
##############################
def onChooseDirectory(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|