SF.net SVN: fclient:[778] trunk/fclient/src/fclient/impl
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-27 11:50:08
|
Revision: 778
http://fclient.svn.sourceforge.net/fclient/?rev=778&view=rev
Author: jUrner
Date: 2008-07-27 11:50:16 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/ViewBrowser.py
Added Paths:
-----------
trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_DlgDownloadKeyToDisk.py
Added: trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py (rev 0)
+++ trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 11:50:16 UTC (rev 778)
@@ -0,0 +1,79 @@
+from __future__ import absolute_import
+if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below
+ import os; __path__ = [os.path.dirname(__file__)]
+
+import os
+from PyQt4 import QtCore, QtGui
+
+from . import config
+from .lib.compactpath.qt4 import pathlabelwrap
+
+
+from .tpls.Ui_DlgDownloadKeyToDiskTpl import Ui_DlgDownloadKeyToDisk
+#**********************************************************************************
+#
+#**********************************************************************************
+class DownloadKeyToDiskDlg(QtGui.QDialog, Ui_DlgDownloadKeyToDisk):
+
+ IdLabelKey = 'labelKey'
+ IdEdDownloadFileName = 'edDownloadFileName'
+ IdBtChooseDownloadFileName = 'btChooseDownloadFileName'
+
+
+ def __init__(self, parent=None, fcpKey=None):
+ QtGui.QDialog.__init__(self, parent)
+
+ self.setupUi(self)
+ self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Download key..'))
+
+ self._filePath = None
+ self._fcpKey = fcpKey
+
+ self.pathLabelWrap = pathlabelwrap.PathLabelWrap(
+ self.labelKey,
+ fpath=unicode(self.labelKey.text()),
+ path_module=config.CompactPathFcpKeyModule
+ )
+ self.connect(self.btChooseDownloadFileName, QtCore.SIGNAL('clicked()'), self.onChooseDownloadFileName)
+
+ # find out fileName to dl key to
+ fileName = config.guessFileNameFromKey(fcpKey)
+ if fileName is None:
+ fileName = self.trUtf8('UNKNOWN')
+ self._filePath = os.path.join(unicode(config.settings.value('DownloadDir')), unicode(fileName))
+ self.edDownloadFileName.setText(self._filePath)
+ if self._fcpKey is not None:
+ self.pathLabelWrap.setPath(self._fcpKey.toString())
+
+ def filePath(self):
+ return self._filePath
+
+ def onChooseDownloadFileName(self):
+ filePath = QtGui.QFileDialog.getSaveFileName(
+ self,
+ config.FclientAppName + self.trUtf8(' - Save key To..'),
+ self.edDownloadFileName.text(),
+ )
+ if filePath:
+ self._filePath = filePath
+ self.edDownloadFileName.setText(filePath)
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
+if __name__ == '__main__':
+ import sys
+
+ class DummyKey(object):
+ KeyType = 'USK@'
+ def __init__(self): self.key = 'USG@qweqqweqwe'
+ def toString(self): return self.key
+
+ app = QtGui.QApplication(sys.argv)
+ w = DownloadKeyToDiskDlg(None, fcpKey=DummyKey())
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
+
Deleted: trunk/fclient/src/fclient/impl/Ui_DlgDownloadKeyToDisk.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_DlgDownloadKeyToDisk.py 2008-07-27 11:48:52 UTC (rev 777)
+++ trunk/fclient/src/fclient/impl/Ui_DlgDownloadKeyToDisk.py 2008-07-27 11:50:16 UTC (rev 778)
@@ -1,79 +0,0 @@
-from __future__ import absolute_import
-if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below
- import os; __path__ = [os.path.dirname(__file__)]
-
-import os
-from PyQt4 import QtCore, QtGui
-
-from . import config
-from .lib.compactpath.qt4 import pathlabelwrap
-
-
-from .tpls.Ui_DlgDownloadKeyToDiskTpl import Ui_DlgDownloadKeyToDisk
-#**********************************************************************************
-#
-#**********************************************************************************
-class DownloadKeyToDiskDlg(QtGui.QDialog, Ui_DlgDownloadKeyToDisk):
-
- IdLabelKey = 'labelKey'
- IdEdDownloadFileName = 'edDownloadFileName'
- IdBtChooseDownloadFileName = 'btChooseDownloadFileName'
-
-
- def __init__(self, parent=None, fcpKey=None):
- QtGui.QDialog.__init__(self, parent)
-
- self.setupUi(self)
- self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Download key..'))
-
- self._filePath = None
- self._fcpKey = fcpKey
-
- self.pathLabelWrap = pathlabelwrap.PathLabelWrap(
- self.labelKey,
- fpath=unicode(self.labelKey.text()),
- path_module=config.CompactPathFcpKeyModule
- )
- self.connect(self.btChooseDownloadFileName, QtCore.SIGNAL('clicked()'), self.onChooseDownloadFileName)
-
- # find out fileName to dl key to
- fileName = config.guessFileNameFromKey(fcpKey)
- if fileName is None:
- fileName = self.trUtf8('UNKNOWN')
- self._filePath = os.path.join(unicode(config.settings.value('DownloadDir')), unicode(fileName))
- self.edDownloadFileName.setText(self._filePath)
- if self._fcpKey is not None:
- self.pathLabelWrap.setPath(self._fcpKey.toString())
-
- def filePath(self):
- return self._filePath
-
- def onChooseDownloadFileName(self):
- filePath = QtGui.QFileDialog.getSaveFileName(
- self,
- config.FclientAppName + self.trUtf8(' - Save key To..'),
- self.edDownloadFileName.text(),
- )
- if filePath:
- self._filePath = filePath
- self.edDownloadFileName.setText(filePath)
-
-
-#**********************************************************************************
-#
-#**********************************************************************************
-if __name__ == '__main__':
- import sys
-
- class DummyKey(object):
- KeyType = 'USK@'
- def __init__(self): self.key = 'USG@qweqqweqwe'
- def toString(self): return self.key
-
- app = QtGui.QApplication(sys.argv)
- w = DownloadKeyToDiskDlg(None, fcpKey=DummyKey())
- w.show()
- res = app.exec_()
- sys.exit(res)
-
-
Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:48:52 UTC (rev 777)
+++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:50:16 UTC (rev 778)
@@ -41,7 +41,7 @@
from .lib.compactpath.qt4 import pathlabelwrap
from . import Ui_DlgPropsBrowserObject
-from . import Ui_DlgDownloadKeyToDisk
+from . import DlgDownloadKeyToDisk
from .tpls.Ui_ViewBrowserWidgetTpl import Ui_ViewBrowserWidget
#*****************************************************************************************
#
@@ -543,7 +543,7 @@
"""
fcpKey = config.qStringToFcpKey(QtCore.QString(qUrl.encodedPath()))
if fcpKey is not None:
- dlg = Ui_DlgDownloadKeyToDisk.DownloadKeyToDiskDlg(self, fcpKey=fcpKey)
+ dlg = DlgDownloadKeyToDisk.DownloadKeyToDiskDlg(self, fcpKey=fcpKey)
if dlg.exec_() == dlg.Accepted:
filePath = dlg.filePath()
downloadsWidget = config.ObjectRegistry.get(config.IdViewCDownloadsWidget, None)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|