fclient-commit Mailing List for fclient (Page 8)
Status: Pre-Alpha
Brought to you by:
jurner
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(23) |
Nov
(54) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(17) |
Feb
(209) |
Mar
(63) |
Apr
(31) |
May
(7) |
Jun
(39) |
Jul
(390) |
Aug
(122) |
Sep
(6) |
Oct
|
Nov
|
Dec
|
|
From: <jU...@us...> - 2008-07-28 12:17:25
|
Revision: 795
http://fclient.svn.sourceforge.net/fclient/?rev=795&view=rev
Author: jUrner
Date: 2008-07-28 12:17:35 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
move connection settings back to connection widget
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/config.py
Modified: trunk/fclient/src/fclient/impl/config.py
===================================================================
--- trunk/fclient/src/fclient/impl/config.py 2008-07-28 12:15:06 UTC (rev 794)
+++ trunk/fclient/src/fclient/impl/config.py 2008-07-28 12:17:35 UTC (rev 795)
@@ -105,13 +105,6 @@
('SettingsAllUsers', 'Bool', False, SettingScopeUser), # store settings for all users?
('IconTheme', 'String', 'crystal', SettingScopeUser),
('DownloadDir', 'String', FclientDownloadDir, SettingScopeUser),
-
- ('FcpAutoConnect', 'Bool', True, SettingScopeUser),
- ('FcpConnectionName', 'String', FclientConnectionName, SettingScopeExpert), #TODO: not implemented
- ('FcpConnectionHost', 'String', fcp2.Client.DefaultFcpHost, SettingScopeUser),
- ('FcpConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort, SettingScopeUser),
- ('FproxyConnectionHost', 'String','127.0.0.1', SettingScopeUser),
- ('FproxyConnectionPort', 'UInt', 8888, SettingScopeUser),
)
SettingsBase._config_settings_ = Settings()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-28 12:15:00
|
Revision: 794
http://fclient.svn.sourceforge.net/fclient/?rev=794&view=rev
Author: jUrner
Date: 2008-07-28 12:15:06 +0000 (Mon, 28 Jul 2008)
Log Message:
-----------
no longer needed
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py
Deleted: trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py 2008-07-27 21:53:19 UTC (rev 793)
+++ trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py 2008-07-28 12:15:06 UTC (rev 794)
@@ -1,73 +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__)]
-
-from PyQt4 import QtCore, QtGui
-
-from . import config
-
-from .tpls.Ui_DlgConnectionExpertSettingsTpl import Ui_DlgConnectionExpertSettings
-#**********************************************************************************
-#
-#**********************************************************************************
-class DlgConnectionExpertSettings(QtGui.QDialog, Ui_DlgConnectionExpertSettings ):
-
- IdEdFcpConnectionName = 'edFcpConnectionName'
- IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration'
- IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout'
- IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout'
-
- def __init__(self, parent=None):
- QtGui.QDialog.__init__(self, parent)
-
- self.setupUi(self)
- self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings'))
-
- edName = self.controlById(self.IdEdFcpConnectionName)
- edName.setText(config.settings.value('FcpConnectionName'))
- self.connect(edName, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionNameChanged)
-
- connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None)
- spins = (
- (self.IdSpinFcpConnectionTimerMaxDuration, 'FcpConnectionTimerMaxDuration'),
- (self.IdSpinConnectionTimerTimeout, 'FcpConnectionTimerTimeout'),
- (self.IdSpinFcpPollTimerTimeout, 'FcpPollTimerTimeout'),
- )
- for idControl, settingName in spins:
- spin = self.controlById(idControl)
- if connectionWidget is None:
- spin.setEnabled(False)
- else:
- spin.setValue(connectionWidget.fcSettings.value(settingName))
-
-
-
-
- def controlById(self, idControl):
- return getattr(self, idControl)
-
-
- def onEdFcpConnectionNameChanged(self, text):
- config.settings.setValues(FcpConnectionName=text)
-
-
-
-#**********************************************************************************
-#
-#**********************************************************************************
-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 = ConnectionExpertSettingsDlg(None)
- w.show()
- res = app.exec_()
- sys.exit(res)
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 21:53:10
|
Revision: 793
http://fclient.svn.sourceforge.net/fclient/?rev=793&view=rev
Author: jUrner
Date: 2008-07-27 21:53:19 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
have to copy strings for in place operations
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/lib/qt4ex/lib/tools.py
Modified: trunk/fclient/src/fclient/impl/lib/qt4ex/lib/tools.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/tools.py 2008-07-27 21:33:28 UTC (rev 792)
+++ trunk/fclient/src/fclient/impl/lib/qt4ex/lib/tools.py 2008-07-27 21:53:19 UTC (rev 793)
@@ -110,9 +110,13 @@
def truncateString(n, qString, ellipsis):
"""truncates a string from the right
@param n: size to truncate the string to
- @param qString: string to truncate
+ @param qString: (QString) string to truncate
@param ellispsis: (QString) ellipsis to be used for replacement chars
+ @return: (QString) truncated string
"""
+ qString = QtCore.QString(qString)
+ ellipsis = QtCore.QString(ellipsis)
+
if qString.count() <= n:
return qString
ellipsis = QtCore.QString(ellipsis)
@@ -124,4 +128,6 @@
n = 0
qString.truncate(n)
return qString + ellipsis
-
\ No newline at end of file
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 21:33:19
|
Revision: 792
http://fclient.svn.sourceforge.net/fclient/?rev=792&view=rev
Author: jUrner
Date: 2008-07-27 21:33:28 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
tab text was not updated on load complete
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/ViewBrowser.py
Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 21:02:52 UTC (rev 791)
+++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 21:33:28 UTC (rev 792)
@@ -740,8 +740,8 @@
lastBrowserState.progress = Browser.MaxProgress
if ok:
lastBrowserState.statusMessage = self.trUtf8('Complete')
- if lastBrowserState.title.isEmpty():
- tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Complete')))
+ title = self.trUtf8('Complete') if lastBrowserState.title.isEmpty() else lastBrowserState.title
+ tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(title))
if browser == self.currentBrowser():
self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage)
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jU...@us...> - 2008-07-27 20:57:04
|
Revision: 790
http://fclient.svn.sourceforge.net/fclient/?rev=790&view=rev
Author: jUrner
Date: 2008-07-27 20:57:12 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
revert laszt checkin. we can not deal with invalid keys. wait for bug reports..
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py
trunk/fclient/src/fclient/impl/lib/fcp2/key.py
Modified: trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py 2008-07-27 20:05:32 UTC (rev 789)
+++ trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py 2008-07-27 20:57:12 UTC (rev 790)
@@ -22,7 +22,7 @@
ConstRequestModified, ConstRequestStatus, ConstPutMultiple, ConstReturnType,
ConstTimeDeltaPostfix, ConstUploadFrom, ConstVerbosity, Error, ErrorIOBroken, ErrorIOClosed,
ErrorIOConnectFailed, ErrorIOTimeout, ErrorMessageParse, FcpFalse, FcpTrue)
-from .key import (ErrorKey, Key, KeyAny, KeyCHK, KeyKSK, KeySSK, KeyTypesAll, KeyUSK, TypeKey, base64UrlsaveDecode, keyNormkey)
+from .key import (ErrorKey, Key, KeyCHK, KeyKSK, KeySSK, KeyTypesAll, KeyUSK, TypeKey, base64UrlsaveDecode, keyNormkey)
from .message import (MessagesAll, MsgAddPeer, MsgAllData, MsgClientDisconnected, MsgClientGet, MsgClientHello,
MsgClientPut, MsgClientPutComplexDir, MsgClientPutDiskDir, MsgClientSocketDied,
MsgClientSocketTimeout, MsgCloseConnectionDuplicateClientName, MsgConfigData, MsgDataFound,
Modified: trunk/fclient/src/fclient/impl/lib/fcp2/key.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/fcp2/key.py 2008-07-27 20:05:32 UTC (rev 789)
+++ trunk/fclient/src/fclient/impl/lib/fcp2/key.py 2008-07-27 20:57:12 UTC (rev 790)
@@ -134,20 +134,6 @@
raise NotImplementedError()
-class KeyAny(object):
- """key object that may contain any string, wether it is a vlaid key or not
- """
- def __init__(self, string):
- self.string = string
-
- def toString(self):
- return self.string
-
- @classmethod
- def fromString(clss, string):
- self.key = string
-
-
class KeyCHK(_KeyBase):
""""""
_key_pattern_ = '''
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 20:05:24
|
Revision: 789
http://fclient.svn.sourceforge.net/fclient/?rev=789&view=rev
Author: jUrner
Date: 2008-07-27 20:05:32 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
reworked SaveKeyToDisk ++ add to dls widget
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
trunk/fclient/src/fclient/impl/ViewBrowser.py
trunk/fclient/src/fclient/impl/ViewDownloads.py
trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui
trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py
Modified: trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 20:02:55 UTC (rev 788)
+++ trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 20:05:32 UTC (rev 789)
@@ -1,3 +1,10 @@
+#***************************************************************************************
+#TODO:
+# x. have to inject (..whatebver) a checkbox into msg box invalid key warning <x don't show this message again>
+# x. save dialog pos/size on exit
+#
+#*************************************************************************************
+
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__)]
@@ -6,18 +13,18 @@
from PyQt4 import QtCore, QtGui
from . import config
-from .lib.compactpath.qt4 import pathlabelwrap
+from .lib import fcp2
-
from .tpls.Ui_DlgDownloadKeyToDiskTpl import Ui_DlgDownloadKeyToDisk
#**********************************************************************************
#
#**********************************************************************************
class DlgDownloadKeyToDisk(QtGui.QDialog, Ui_DlgDownloadKeyToDisk):
- IdLabelKey = 'labelKey'
- IdEdDownloadFileName = 'edDownloadFileName'
- IdBtChooseDownloadFileName = 'btChooseDownloadFileName'
+ IdEdKey = 'edKey'
+ IdEdFileName = 'edFileName'
+ IdEdDirectory = 'edDirectory'
+ IdBtChooseDirectory = 'btChooseDirectory'
def __init__(self, parent=None, fcpKey=None):
@@ -26,52 +33,100 @@
self.setupUi(self)
self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Download key..'))
- self._filePath = None
+ self._fileName = 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)
+ # setup key editbox
+ ed = self.controlById(self.IdEdKey)
+ if fcpKey is not None:
+ ed.setText(fcpKey.toString())
+
+ # setup filename editbox
+ ed = self.controlById(self.IdEdFileName)
+ if fcpKey is not None:
+ # find out fileName to dl key to
+ fileName = config.guessFileNameFromKey(self._fcpKey)
+ if fileName is None:
+ fileName = self.trUtf8('UNKNOWN')
+ ed.setText(fileName)
+
+ # setup directory editbox
+ ed = self.controlById(self.IdEdDirectory)
+ ed.setText(unicode(config.settings.value('DownloadDir')))
+ bt = self.controlById(self.IdBtChooseDirectory)
+ self.connect(bt, QtCore.SIGNAL('clicked()'), self.onChooseDirectory)
- # 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
+ ##############################
+ ## methods
+ ##############################
+ def controlById(self, idControl):
+ return getattr(self, idControl)
- def onChooseDownloadFileName(self):
- filePath = QtGui.QFileDialog.getSaveFileName(
+ def fileName(self):
+ return self._fileName
+
+ def fcpKey(self):
+ return self._fcpKey
+
+ ##############################
+ ## overwritten methods
+ ##############################
+ def accept(self):
+ edKey = self.controlById(self.IdEdKey)
+ edFileName = self.controlById(self.IdEdFileName)
+ edDirectory = self.controlById(self.IdEdDirectory)
+
+ key = unicode(edKey.text())
+ if not key:
+ return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a key to download')
+ 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
+
+ fileName = edFileName.text()
+ if fileName.isEmpty():
+ return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a filename for the key')
+
+ directory = edDirectory.text()
+ if directory.isEmpty():
+ return QtGui.QMessageBox.critical(self, self.windowTitle(), 'Please enter a directory under wich to save the key')
+
+ self._fileName = os.path.join(unicode(directory), unicode(fileName))
+ self.done(self.Accepted)
+
+ ##############################
+ ## event handlers
+ ##############################
+ def onChooseDirectory(self):
+ edDirectory = self.controlById(self.IdEdDirectory)
+ directory = QtGui.QFileDialog.getExistingDirectory(
self,
- config.FclientAppName + self.trUtf8(' - Save key To..'),
- self.edDownloadFileName.text(),
+ config.FclientAppName + self.trUtf8(' - Download key to..'),
+ edDirectory.text(),
)
- if filePath:
- self._filePath = filePath
- self.edDownloadFileName.setText(filePath)
-
-
+ if directory:
+ edDirectory.setText(directory)
+
#**********************************************************************************
#
#**********************************************************************************
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 = DlgDownloadKeyToDisk(
+ #None,
+ fcpKey=fcp2.KeyKSK('foo.txt')
+ )
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 20:02:55 UTC (rev 788)
+++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 20:05:32 UTC (rev 789)
@@ -23,6 +23,7 @@
# x. browser settings - QWebSettings
# x. shortcuts
# x. user staring gui for first time. maybe we should not connext untill the user connects explicitely
+# x. looks like on error loading page reload does not work
#******************************************************************************************
"""
@@ -545,16 +546,15 @@
if fcpKey is not None:
dlg = DlgDownloadKeyToDisk.DlgDownloadKeyToDisk(self, fcpKey=fcpKey)
if dlg.exec_() == dlg.Accepted:
- filePath = dlg.filePath()
+ fileName = dlg.fileName()
downloadsWidget = config.ObjectRegistry.get(config.IdViewCDownloadsWidget, None)
if downloadsWidget is None:
raise ValueError('no downloads widget found')
downloadsWidget.downloadFile(
fcpKey,
- filePath,
+ fileName,
persistence=fcp2.ConstPersistence.Forever,
handleFilenameCollision=True,
-
)
return True
return False
Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 20:02:55 UTC (rev 788)
+++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 20:05:32 UTC (rev 789)
@@ -33,6 +33,7 @@
from . import config
from .lib import fcp2
from .lib.fcp2.lib import pmstruct
+from . import DlgDownloadKeyToDisk
from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget
#**********************************************************************************
@@ -47,8 +48,81 @@
self.displayName=self.trUtf8('Downloads')
self.icon=QtGui.QIcon()
+
+
#**********************************************************************************
#
+#**********************************************************************************
+class DownloadsWidgetGlobalFeedback(config.GlobalFeedbackBase):
+ """wrapper for global statusbar widgets, menus"""
+
+ def __init__(self, parent, idGlobalFeedback):
+ config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback)
+
+ # menus
+ self.menus = []
+ if self.menuBar is not None and hasattr(parent, 'fcViewObject'):
+ menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar)
+ parent.populateMenu(menu)
+ self.menus.append(menu)
+ self.menuBar.addViewMenu(menu)
+
+ # status bar widgets
+ self.labelStatus = None
+ self.progress = None
+ self.labelFeedbackWrap = None
+ #if self.statusBar is not None:
+ # self.labelStatus = QtGui.QLabel(QtCore.QString(), self.statusBar)
+ # self.statusBar.addWidget(self.labelStatus)
+ #
+ # self.progress = QtGui.QProgressBar(self.statusBar)
+ # self.progress.setRange(0, Browser.MaxProgress)
+ # self.progress.setValue(0)
+ # self.statusBar.addWidget(self.progress)
+ #
+ # label = QtGui.QLabel(self.statusBar)
+ # label.setFrameStyle(QtGui.QLabel.Sunken | QtGui.QLabel.Box)
+ # self.labelFeedbackWrap = pathlabelwrap.PathLabelWrap(
+ # label,
+ # path_module=config.CompactPathFcpKeyModule,
+ # )
+ # self.statusBar.addWidget(self.labelFeedbackWrap.label, 1)
+
+
+ def setVisible(self, flag):
+ if self.menuBar is not None:
+ for menu in self.menus:
+ menu.children()[0].setVisible(flag)
+ #if self.statusBar is not None:
+ # self.progress.setVisible(flag)
+ # self.labelStatus.setVisible(flag)
+ # self.labelFeedbackWrap.label.setVisible(flag)
+
+ #def setProgress(self, n):
+ # if self.progress is not None:
+ # self.progress.setValue(n)
+
+ #def setStatusMessage(self, qString):
+ # if self.labelStatus is not None:
+ # self.labelStatus.setText(qString)
+
+ #def setFeedback(self, qString):
+ # if self.labelFeedbackWrap is not None:
+ # self.labelFeedbackWrap.setPath(unicode(qString))
+
+class DownloadsWidgetActions(config.ActionsBase):
+
+ def __init__(self, parent):
+ config.ActionsBase.__init__(self, parent)
+
+ self.action(
+ name='ActionDownloadKeyToDisk',
+ text=self.trUtf8('Download &key...'),
+ trigger=parent.onDownloadKey,
+ )
+
+#**********************************************************************************
+#
#**********************************************************************************
class PersistentRequestData(pmstruct.PMStruct):
_fields_ = (
@@ -138,8 +212,9 @@
self.setupUi(self)
config.ObjectRegistry.register(self)
-
+ self.fcActions = DownloadsWidgetActions(self)
self.fcViewObject = DownloadsViewObject(self)
+ self.fcGlobalFeedback = DownloadsWidgetGlobalFeedback(self, idGlobalFeedback)
self.fcpEvents = (
(config.fcpClient.events.ConfigData, self.onFcpConfigData),
(config.fcpClient.events.RequestCompleted, self.onFcpRequestCompleted),
@@ -188,6 +263,12 @@
self.viewClose()
+ def hideEvent(self, event):
+ self.fcGlobalFeedback.setVisible(False)
+
+ def showEvent(self, event):
+ self.fcGlobalFeedback.setVisible(True)
+
def viewClose(self):
config.fcpClient.events -= self.fcpEvents
@@ -201,10 +282,12 @@
persistentUserData=PersistentRequestData(ClientName=unicode(self.objectName())).dump(),
**kws
)
- item = self._createItemFromFcpRequest(config.fcpClient.getRequest(cpIdentifier))
+ item = self._createItemFromFcpRequest(config.fcpClient.getRequest(fcpIdentifier))
+ def populateMenu(self, menu):
+ menu.addAction(self.fcActions['ActionDownloadKeyToDisk'])
+ return menu
-
#########################################
## methods
@@ -213,6 +296,19 @@
return getattr(idGlobalFeedback, idControl)
#########################################
+ ## event handlers
+ #########################################
+ def onDownloadKey(self, action):
+ dlg = DlgDownloadKeyToDisk.DlgDownloadKeyToDisk(self, fcpKey=None)
+ if dlg.exec_() == dlg.Accepted:
+ self.downloadFile(
+ dlg.fcpKey(),
+ dlg.fileName(),
+ persistence=fcp2.ConstPersistence.Forever,
+ handleFilenameCollision=True,
+ )
+
+ #########################################
## fcp event handlers
#########################################
def onFcpConfigData(self, fcpEvent, fcpRequest):
Modified: trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-27 20:02:55 UTC (rev 788)
+++ trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-27 20:05:32 UTC (rev 789)
@@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>431</width>
- <height>175</height>
+ <height>243</height>
</rect>
</property>
<property name="windowTitle" >
@@ -18,43 +18,45 @@
<item>
<widget class="QLabel" name="label" >
<property name="text" >
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Key:</span></p></body></html></string>
+ <string><b>Key:</b></string>
</property>
</widget>
</item>
<item>
- <widget class="QLabel" name="labelKey" >
+ <widget class="QLineEdit" name="edKey" >
+ <property name="dragEnabled" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
<property name="text" >
- <string>USK@qwweqweqweqwe.../foo</string>
+ <string><b>File name:</b></string>
</property>
</widget>
</item>
<item>
+ <widget class="QLineEdit" name="edFileName" />
+ </item>
+ <item>
<widget class="QLabel" name="label_2" >
<property name="text" >
- <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Download to:</span></p></body></html></string>
+ <string><b>Directory:</b></string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
- <widget class="QLineEdit" name="edDownloadFileName" >
+ <widget class="QLineEdit" name="edDirectory" >
<property name="dragEnabled" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
- <widget class="QPushButton" name="btChooseDownloadFileName" >
+ <widget class="QPushButton" name="btChooseDirectory" >
<property name="text" >
<string>...</string>
</property>
Modified: trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py 2008-07-27 20:02:55 UTC (rev 788)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py 2008-07-27 20:05:32 UTC (rev 789)
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/DlgDownloadKeyToDiskTpl.ui'
+# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui'
#
-# Created: Thu Jul 24 10:12:00 2008
+# Created: Sun Jul 27 21:01:10 2008
# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
#
# WARNING! All changes made in this file will be lost!
@@ -12,7 +12,7 @@
class Ui_DlgDownloadKeyToDisk(object):
def setupUi(self, DlgDownloadKeyToDisk):
DlgDownloadKeyToDisk.setObjectName("DlgDownloadKeyToDisk")
- DlgDownloadKeyToDisk.resize(431, 175)
+ DlgDownloadKeyToDisk.resize(431, 243)
self.gridLayout = QtGui.QGridLayout(DlgDownloadKeyToDisk)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout = QtGui.QVBoxLayout()
@@ -20,21 +20,28 @@
self.label = QtGui.QLabel(DlgDownloadKeyToDisk)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
- self.labelKey = QtGui.QLabel(DlgDownloadKeyToDisk)
- self.labelKey.setObjectName("labelKey")
- self.verticalLayout.addWidget(self.labelKey)
+ self.edKey = QtGui.QLineEdit(DlgDownloadKeyToDisk)
+ self.edKey.setDragEnabled(True)
+ self.edKey.setObjectName("edKey")
+ self.verticalLayout.addWidget(self.edKey)
+ self.label_3 = QtGui.QLabel(DlgDownloadKeyToDisk)
+ self.label_3.setObjectName("label_3")
+ self.verticalLayout.addWidget(self.label_3)
+ self.edFileName = QtGui.QLineEdit(DlgDownloadKeyToDisk)
+ self.edFileName.setObjectName("edFileName")
+ self.verticalLayout.addWidget(self.edFileName)
self.label_2 = QtGui.QLabel(DlgDownloadKeyToDisk)
self.label_2.setObjectName("label_2")
self.verticalLayout.addWidget(self.label_2)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
- self.edDownloadFileName = QtGui.QLineEdit(DlgDownloadKeyToDisk)
- self.edDownloadFileName.setDragEnabled(True)
- self.edDownloadFileName.setObjectName("edDownloadFileName")
- self.horizontalLayout.addWidget(self.edDownloadFileName)
- self.btChooseDownloadFileName = QtGui.QPushButton(DlgDownloadKeyToDisk)
- self.btChooseDownloadFileName.setObjectName("btChooseDownloadFileName")
- self.horizontalLayout.addWidget(self.btChooseDownloadFileName)
+ self.edDirectory = QtGui.QLineEdit(DlgDownloadKeyToDisk)
+ self.edDirectory.setDragEnabled(True)
+ self.edDirectory.setObjectName("edDirectory")
+ self.horizontalLayout.addWidget(self.edDirectory)
+ self.btChooseDirectory = QtGui.QPushButton(DlgDownloadKeyToDisk)
+ self.btChooseDirectory.setObjectName("btChooseDirectory")
+ self.horizontalLayout.addWidget(self.btChooseDirectory)
self.verticalLayout.addLayout(self.horizontalLayout)
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
spacerItem = QtGui.QSpacerItem(20, 15, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
@@ -57,18 +64,10 @@
def retranslateUi(self, DlgDownloadKeyToDisk):
DlgDownloadKeyToDisk.setWindowTitle(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
-"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
-"p, li { white-space: pre-wrap; }\n"
-"</style></head><body style=\" font-family:\'Sans Serif\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
-"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Key:</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
- self.labelKey.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "USK@qwweqweqweqwe.../foo", None, QtGui.QApplication.UnicodeUTF8))
- self.label_2.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
-"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
-"p, li { white-space: pre-wrap; }\n"
-"</style></head><body style=\" font-family:\'Sans Serif\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
-"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Download to:</span></p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
- self.btChooseDownloadFileName.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "...", None, QtGui.QApplication.UnicodeUTF8))
+ self.label.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<b>Key:</b>", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_3.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<b>File name:</b>", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_2.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "<b>Directory:</b>", None, QtGui.QApplication.UnicodeUTF8))
+ self.btChooseDirectory.setText(QtGui.QApplication.translate("DlgDownloadKeyToDisk", "...", None, QtGui.QApplication.UnicodeUTF8))
if __name__ == "__main__":
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 20:02:45
|
Revision: 788
http://fclient.svn.sourceforge.net/fclient/?rev=788&view=rev
Author: jUrner
Date: 2008-07-27 20:02:55 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
add wrappe for any type of key
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py
Modified: trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py 2008-07-27 20:02:39 UTC (rev 787)
+++ trunk/fclient/src/fclient/impl/lib/fcp2/__init__.py 2008-07-27 20:02:55 UTC (rev 788)
@@ -22,7 +22,7 @@
ConstRequestModified, ConstRequestStatus, ConstPutMultiple, ConstReturnType,
ConstTimeDeltaPostfix, ConstUploadFrom, ConstVerbosity, Error, ErrorIOBroken, ErrorIOClosed,
ErrorIOConnectFailed, ErrorIOTimeout, ErrorMessageParse, FcpFalse, FcpTrue)
-from .key import (ErrorKey, Key, KeyCHK, KeyKSK, KeySSK, KeyTypesAll, KeyUSK, TypeKey, base64UrlsaveDecode, keyNormkey)
+from .key import (ErrorKey, Key, KeyAny, KeyCHK, KeyKSK, KeySSK, KeyTypesAll, KeyUSK, TypeKey, base64UrlsaveDecode, keyNormkey)
from .message import (MessagesAll, MsgAddPeer, MsgAllData, MsgClientDisconnected, MsgClientGet, MsgClientHello,
MsgClientPut, MsgClientPutComplexDir, MsgClientPutDiskDir, MsgClientSocketDied,
MsgClientSocketTimeout, MsgCloseConnectionDuplicateClientName, MsgConfigData, MsgDataFound,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 20:02:29
|
Revision: 787
http://fclient.svn.sourceforge.net/fclient/?rev=787&view=rev
Author: jUrner
Date: 2008-07-27 20:02:39 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
add wrappe for any type of key
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/lib/fcp2/key.py
Modified: trunk/fclient/src/fclient/impl/lib/fcp2/key.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/fcp2/key.py 2008-07-27 18:20:55 UTC (rev 786)
+++ trunk/fclient/src/fclient/impl/lib/fcp2/key.py 2008-07-27 20:02:39 UTC (rev 787)
@@ -134,6 +134,19 @@
raise NotImplementedError()
+class KeyAny(object):
+ """key object that may contain any string, wether it is a vlaid key or not
+ """
+ def __init__(self, string):
+ self.string = string
+
+ def toString(self):
+ return self.string
+
+ @classmethod
+ def fromString(clss, string):
+ self.key = string
+
class KeyCHK(_KeyBase):
""""""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 18:20:46
|
Revision: 786
http://fclient.svn.sourceforge.net/fclient/?rev=786&view=rev
Author: jUrner
Date: 2008-07-27 18:20:55 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
move connection expert settings to prefs dialog
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/Prefs.py
trunk/fclient/src/fclient/impl/ViewConnection.py
trunk/fclient/src/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py
trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui
Added Paths:
-----------
trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py
trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui
trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui
trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py
Modified: trunk/fclient/src/fclient/impl/Prefs.py
===================================================================
--- trunk/fclient/src/fclient/impl/Prefs.py 2008-07-27 13:13:29 UTC (rev 785)
+++ trunk/fclient/src/fclient/impl/Prefs.py 2008-07-27 18:20:55 UTC (rev 786)
@@ -9,6 +9,7 @@
from .lib.qt4ex import dlgpreferences
from .PrefsGlobal import PrefsPageGlobal
from .PrefsBrowserWidget import PrefsPageBrowser
+from .PrefsConnectionWidget import PrefsPageConnectionExpertSettings
#**********************************************************************************
#
#**********************************************************************************
@@ -54,9 +55,9 @@
pages = PrefsPageRoot()(
PrefsPageGlobal(),
+ PrefsPageConnectionExpertSettings(),
PrefsPageBrowser(),
-
- )
+ )
dlgpreferences.DlgPreferencesFlatTree.__init__(self,
parent,
Added: trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py
===================================================================
--- trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py (rev 0)
+++ trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-27 18:20:55 UTC (rev 786)
@@ -0,0 +1,97 @@
+
+
+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__)]
+
+
+from PyQt4 import QtCore, QtGui
+
+from . import config
+from .lib.qt4ex import dlgpreferences
+
+from .tpls.Ui_PrefsConnectionExpertSettingsTpl import Ui_PrefsConnectionExpertSettings
+#**********************************************************************************
+#
+#**********************************************************************************
+class PrefsConnectionExpertSettingsWidget(QtGui.QWidget, Ui_PrefsConnectionExpertSettings):
+
+ IdEdFcpConnectionName = 'edFcpConnectionName'
+ IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration'
+ IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout'
+ IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout'
+
+ def __init__(self, parent=None):
+ QtGui.QWidget.__init__(self, parent)
+
+ self.setupUi(self)
+ self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings'))
+
+ edName = self.controlById(self.IdEdFcpConnectionName)
+ edName.setText(config.settings.value('FcpConnectionName'))
+ self.connect(edName, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionNameChanged)
+
+ connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None)
+ spins = (
+ (self.IdSpinFcpConnectionTimerMaxDuration, 'FcpConnectionTimerMaxDuration'),
+ (self.IdSpinConnectionTimerTimeout, 'FcpConnectionTimerTimeout'),
+ (self.IdSpinFcpPollTimerTimeout, 'FcpPollTimerTimeout'),
+ )
+ for idControl, settingName in spins:
+ spin = self.controlById(idControl)
+ if connectionWidget is None:
+ spin.setEnabled(False)
+ else:
+ spin.setValue(connectionWidget.fcSettings.value(settingName))
+
+
+
+
+ def controlById(self, idControl):
+ return getattr(self, idControl)
+
+
+ def onEdFcpConnectionNameChanged(self, text):
+ config.settings.setValues(FcpConnectionName=text)
+
+#***********************************************************************
+#
+#***********************************************************************
+class PrefsPageConnectionExpertSettings(dlgpreferences.Page):
+
+ UUID = '{{98c7efcb-5636-4bf5-8192-10e7ccb09314}'
+
+ def __init__(self):
+ dlgpreferences.Page.__init__(self, self.UUID)
+ self._widget = None
+ self.setDirty(True)
+
+ def displayName(self):
+ return self.trUtf8('Connection')
+
+ def canApply(self): return True
+ def canHelp(self): return True
+
+ def setVisible(self, parent, flag):
+ createdNew = False
+ if flag and self._widget is None:
+ createdNew = True
+ self._widget = PrefsConnectionExpertSettingsWidget(parent)
+ self._widget.setVisible(flag)
+ return (createdNew, self._widget)
+
+
+
+#***********************************************************************
+#
+#***********************************************************************
+if __name__ == '__main__':
+ from PyQt4 import QtGui
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = PrefsConnectionExpertSettingsWidget(None)
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
Modified: trunk/fclient/src/fclient/impl/ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 13:13:29 UTC (rev 785)
+++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 18:20:55 UTC (rev 786)
@@ -27,7 +27,6 @@
from . import config
from .lib import fcp2
-from .DlgConnectionExpertSettings import DlgConnectionExpertSettings
from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget
#**********************************************************************************
@@ -138,7 +137,6 @@
IdEdFcpFcpConnectionHost = 'edFcpConnectionHost'
IdFcpSpinFcpConnectionPort = 'spinFcpConnectionPort'
IdCkFcpAutoConnect = 'ckFcpAutoConnect'
- IdBtFcpConnectionMore = 'btFcpConnectionMore'
IdEdFproxyConnectionHost = 'edFproxyConnectionHost'
IdFproxySpinConnectionPort = 'spinFproxyConnectionPort'
@@ -166,7 +164,6 @@
self.fcGlobalFeedback = GlobalFeedback(self,idGlobalFeedback)
-
#########################################
## methods
#########################################
@@ -213,10 +210,7 @@
ck = self.controlById(self.IdCkFcpAutoConnect)
ck.setChecked(doAutoConnect)
self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged)
-
- bt = self.controlById(self.IdBtFcpConnectionMore)
- self.connect(bt, QtCore.SIGNAL('clicked()'), self.onBtFcpConnectionMoreClicked)
-
+
# setup fproxy host / port
edHost = self.controlById(self.IdEdFproxyConnectionHost)
edHost.setText(config.settings.value('FproxyConnectionHost'))
@@ -267,11 +261,6 @@
def onSpinFcpConnectionPortChanged(self, value):
config.settings.setValues(FcpConnectionPort=value)
- def onBtFcpConnectionMoreClicked(self):
- dlg = DlgConnectionExpertSettings(self)
- if dlg.exec_() == dlg.Accepted:
- pass
-
def onEdFproxyConnectionHostChanged(self, text):
config.settings.setValues(FproxyConnectionHost=text)
Deleted: trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui 2008-07-27 13:13:29 UTC (rev 785)
+++ trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui 2008-07-27 18:20:55 UTC (rev 786)
@@ -1,287 +0,0 @@
-<ui version="4.0" >
- <class>DlgConnectionExpertSettings</class>
- <widget class="QDialog" name="DlgConnectionExpertSettings" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>392</width>
- <height>589</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Dialog</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2" >
- <item row="0" column="0" >
- <widget class="QTabWidget" name="tabWidget" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="currentIndex" >
- <number>0</number>
- </property>
- <widget class="QWidget" name="tab" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>370</width>
- <height>472</height>
- </rect>
- </property>
- <attribute name="title" >
- <string>Fcp connection</string>
- </attribute>
- <layout class="QGridLayout" name="gridLayout" >
- <item row="0" column="0" >
- <layout class="QVBoxLayout" name="verticalLayout" >
- <property name="spacing" >
- <number>0</number>
- </property>
- <item>
- <widget class="QLabel" name="label_5" >
- <property name="text" >
- <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <property name="wordWrap" >
- <bool>true</bool>
- </property>
- <property name="textInteractionFlags" >
- <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="label" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Connection name:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="edFcpConnectionName" />
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label_6" >
- <property name="text" >
- <string>How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down</string>
- </property>
- <property name="wordWrap" >
- <bool>true</bool>
- </property>
- <property name="textInteractionFlags" >
- <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_2" >
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_3" >
- <item>
- <widget class="QLabel" name="label_3" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Connect duration:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_4" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Connect timeout:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2" >
- <item>
- <widget class="QSpinBox" name="spinFcpConnectionTimerMaxDuration" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="suffix" >
- <string> seconds</string>
- </property>
- <property name="maximum" >
- <number>999</number>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="spinConnectionTimerTimeout" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="suffix" >
- <string> miliseconds</string>
- </property>
- <property name="maximum" >
- <number>99999</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label_7" >
- <property name="text" >
- <string>How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down.
-</string>
- </property>
- <property name="wordWrap" >
- <bool>true</bool>
- </property>
- <property name="textInteractionFlags" >
- <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_3" >
- <item>
- <widget class="QLabel" name="label_2" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Poll frequency: </string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="spinFcpPollTimerTimeout" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="suffix" >
- <string> miliseconds</string>
- </property>
- <property name="maximum" >
- <number>99999</number>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item row="1" column="0" >
- <spacer name="verticalSpacer" >
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0" >
- <size>
- <width>98</width>
- <height>15</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0" >
- <widget class="Line" name="line" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>DlgConnectionExpertSettings</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel" >
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>DlgConnectionExpertSettings</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel" >
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
Added: trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui (rev 0)
+++ trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui 2008-07-27 18:20:55 UTC (rev 786)
@@ -0,0 +1,243 @@
+<ui version="4.0" >
+ <class>PrefsConnectionExpertSettings</class>
+ <widget class="QWidget" name="PrefsConnectionExpertSettings" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>505</width>
+ <height>524</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>501</width>
+ <height>472</height>
+ </rect>
+ </property>
+ <attribute name="title" >
+ <string>Fcp connection</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <property name="spacing" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Connection name:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="edFcpConnectionName" />
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_6" >
+ <property name="text" >
+ <string>How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3" >
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Connect duration: </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Connect timeout:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QSpinBox" name="spinFcpConnectionTimerMaxDuration" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="suffix" >
+ <string> seconds</string>
+ </property>
+ <property name="maximum" >
+ <number>999</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinConnectionTimerTimeout" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="suffix" >
+ <string> miliseconds</string>
+ </property>
+ <property name="maximum" >
+ <number>99999</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_7" >
+ <property name="text" >
+ <string>How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down.
+</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Poll frequency: </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinFcpPollTimerTimeout" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="suffix" >
+ <string> miliseconds</string>
+ </property>
+ <property name="maximum" >
+ <number>99999</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>502</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Deleted: trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py 2008-07-27 13:13:29 UTC (rev 785)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py 2008-07-27 18:20:55 UTC (rev 786)
@@ -1,173 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui'
-#
-# Created: Sat Jul 26 13:40:11 2008
-# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-class Ui_DlgConnectionExpertSettings(object):
- def setupUi(self, DlgConnectionExpertSettings):
- DlgConnectionExpertSettings.setObjectName("DlgConnectionExpertSettings")
- DlgConnectionExpertSettings.resize(392, 589)
- self.gridLayout_2 = QtGui.QGridLayout(DlgConnectionExpertSettings)
- self.gridLayout_2.setObjectName("gridLayout_2")
- self.tabWidget = QtGui.QTabWidget(DlgConnectionExpertSettings)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
- self.tabWidget.setSizePolicy(sizePolicy)
- self.tabWidget.setObjectName("tabWidget")
- self.tab = QtGui.QWidget()
- self.tab.setGeometry(QtCore.QRect(0, 0, 370, 472))
- self.tab.setObjectName("tab")
- self.gridLayout = QtGui.QGridLayout(self.tab)
- self.gridLayout.setObjectName("gridLayout")
- self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setSpacing(0)
- self.verticalLayout.setObjectName("verticalLayout")
- self.label_5 = QtGui.QLabel(self.tab)
- self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.label_5.setWordWrap(True)
- self.label_5.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard)
- self.label_5.setObjectName("label_5")
- self.verticalLayout.addWidget(self.label_5)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setSpacing(6)
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.label = QtGui.QLabel(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
- self.label.setSizePolicy(sizePolicy)
- self.label.setObjectName("label")
- self.horizontalLayout.addWidget(self.label)
- self.edFcpConnectionName = QtGui.QLineEdit(self.tab)
- self.edFcpConnectionName.setObjectName("edFcpConnectionName")
- self.horizontalLayout.addWidget(self.edFcpConnectionName)
- self.verticalLayout.addLayout(self.horizontalLayout)
- self.label_6 = QtGui.QLabel(self.tab)
- self.label_6.setWordWrap(True)
- self.label_6.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard)
- self.label_6.setObjectName("label_6")
- self.verticalLayout.addWidget(self.label_6)
- self.horizontalLayout_2 = QtGui.QHBoxLayout()
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.verticalLayout_3 = QtGui.QVBoxLayout()
- self.verticalLayout_3.setObjectName("verticalLayout_3")
- self.label_3 = QtGui.QLabel(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
- self.label_3.setSizePolicy(sizePolicy)
- self.label_3.setObjectName("label_3")
- self.verticalLayout_3.addWidget(self.label_3)
- self.label_4 = QtGui.QLabel(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
- self.label_4.setSizePolicy(sizePolicy)
- self.label_4.setObjectName("label_4")
- self.verticalLayout_3.addWidget(self.label_4)
- self.horizontalLayout_2.addLayout(self.verticalLayout_3)
- self.verticalLayout_2 = QtGui.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- self.spinFcpConnectionTimerMaxDuration = QtGui.QSpinBox(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.spinFcpConnectionTimerMaxDuration.sizePolicy().hasHeightForWidth())
- self.spinFcpConnectionTimerMaxDuration.setSizePolicy(sizePolicy)
- self.spinFcpConnectionTimerMaxDuration.setMaximum(999)
- self.spinFcpConnectionTimerMaxDuration.setObjectName("spinFcpConnectionTimerMaxDuration")
- self.verticalLayout_2.addWidget(self.spinFcpConnectionTimerMaxDuration)
- self.spinConnectionTimerTimeout = QtGui.QSpinBox(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.spinConnectionTimerTimeout.sizePolicy().hasHeightForWidth())
- self.spinConnectionTimerTimeout.setSizePolicy(sizePolicy)
- self.spinConnectionTimerTimeout.setMaximum(99999)
- self.spinConnectionTimerTimeout.setObjectName("spinConnectionTimerTimeout")
- self.verticalLayout_2.addWidget(self.spinConnectionTimerTimeout)
- self.horizontalLayout_2.addLayout(self.verticalLayout_2)
- self.verticalLayout.addLayout(self.horizontalLayout_2)
- self.label_7 = QtGui.QLabel(self.tab)
- self.label_7.setWordWrap(True)
- self.label_7.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard)
- self.label_7.setObjectName("label_7")
- self.verticalLayout.addWidget(self.label_7)
- self.horizontalLayout_3 = QtGui.QHBoxLayout()
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
- self.label_2 = QtGui.QLabel(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
- self.label_2.setSizePolicy(sizePolicy)
- self.label_2.setObjectName("label_2")
- self.horizontalLayout_3.addWidget(self.label_2)
- self.spinFcpPollTimerTimeout = QtGui.QSpinBox(self.tab)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.spinFcpPollTimerTimeout.sizePolicy().hasHeightForWidth())
- self.spinFcpPollTimerTimeout.setSizePolicy(sizePolicy)
- self.spinFcpPollTimerTimeout.setMaximum(99999)
- self.spinFcpPollTimerTimeout.setObjectName("spinFcpPollTimerTimeout")
- self.horizontalLayout_3.addWidget(self.spinFcpPollTimerTimeout)
- self.verticalLayout.addLayout(self.horizontalLayout_3)
- self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
- self.tabWidget.addTab(self.tab, "")
- self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1)
- spacerItem = QtGui.QSpacerItem(98, 15, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1)
- self.line = QtGui.QFrame(DlgConnectionExpertSettings)
- self.line.setFrameShape(QtGui.QFrame.HLine)
- self.line.setFrameShadow(QtGui.QFrame.Sunken)
- self.line.setObjectName("line")
- self.gridLayout_2.addWidget(self.line, 2, 0, 1, 1)
- self.buttonBox = QtGui.QDialogButtonBox(DlgConnectionExpertSettings)
- self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
- self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Reset)
- self.buttonBox.setObjectName("buttonBox")
- self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1)
-
- self.retranslateUi(DlgConnectionExpertSettings)
- self.tabWidget.setCurrentIndex(0)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DlgConnectionExpertSettings.accept)
- QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), DlgConnectionExpertSettings.reject)
- QtCore.QMetaObject.connectSlotsByName(DlgConnectionExpertSettings)
-
- def retranslateUi(self, DlgConnectionExpertSettings):
- DlgConnectionExpertSettings.setWindowTitle(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
- self.label_5.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Connection name:", None, QtGui.QApplication.UnicodeUTF8))
- self.label_6.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down", None, QtGui.QApplication.UnicodeUTF8))
- self.label_3.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Connect duration:", None, QtGui.QApplication.UnicodeUTF8))
- self.label_4.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Connect timeout:", None, QtGui.QApplication.UnicodeUTF8))
- self.spinFcpConnectionTimerMaxDuration.setSuffix(QtGui.QApplication.translate("DlgConnectionExpertSettings", " seconds", None, QtGui.QApplication.UnicodeUTF8))
- self.spinConnectionTimerTimeout.setSuffix(QtGui.QApplication.translate("DlgConnectionExpertSettings", " miliseconds", None, QtGui.QApplication.UnicodeUTF8))
- self.label_7.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down.\n"
-"", None, QtGui.QApplication.UnicodeUTF8))
- self.label_2.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Poll frequency: ", None, QtGui.QApplication.UnicodeUTF8))
- self.spinFcpPollTimerTimeout.setSuffix(QtGui.QApplication.translate("DlgConnectionExpertSettings", " miliseconds", None, QtGui.QApplication.UnicodeUTF8))
- self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("DlgConnectionExpertSettings", "Fcp connection", None, QtGui.QApplication.UnicodeUTF8))
-
-
-if __name__ == "__main__":
- import sys
- app = QtGui.QApplication(sys.argv)
- DlgConnectionExpertSettings = QtGui.QDialog()
- ui = Ui_DlgConnectionExpertSettings()
- ui.setupUi(DlgConnectionExpertSettings)
- DlgConnectionExpertSettings.show()
- sys.exit(app.exec_())
-
Added: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py (rev 0)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsConnectionExpertSettingsTpl.py 2008-07-27 18:20:55 UTC (rev 786)
@@ -0,0 +1,163 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsConnectionExpertSettingsTpl.ui'
+#
+# Created: Sun Jul 27 20:12:51 2008
+# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_PrefsConnectionExpertSettings(object):
+ def setupUi(self, PrefsConnectionExpertSettings):
+ PrefsConnectionExpertSettings.setObjectName("PrefsConnectionExpertSettings")
+ PrefsConnectionExpertSettings.resize(505, 524)
+ self.gridLayout_2 = QtGui.QGridLayout(PrefsConnectionExpertSettings)
+ self.gridLayout_2.setMargin(0)
+ self.gridLayout_2.setSpacing(0)
+ self.gridLayout_2.setObjectName("gridLayout_2")
+ self.tabWidget = QtGui.QTabWidget(PrefsConnectionExpertSettings)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
+ self.tabWidget.setSizePolicy(sizePolicy)
+ self.tabWidget.setObjectName("tabWidget")
+ self.tab = QtGui.QWidget()
+ self.tab.setGeometry(QtCore.QRect(0, 0, 501, 472))
+ self.tab.setObjectName("tab")
+ self.gridLayout = QtGui.QGridLayout(self.tab)
+ self.gridLayout.setObjectName("gridLayout")
+ self.verticalLayout = QtGui.QVBoxLayout()
+ self.verticalLayout.setSpacing(0)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.label_5 = QtGui.QLabel(self.tab)
+ self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
+ self.label_5.setWordWrap(True)
+ self.label_5.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard)
+ self.label_5.setObjectName("label_5")
+ self.verticalLayout.addWidget(self.label_5)
+ self.horizontalLayout = QtGui.QHBoxLayout()
+ self.horizontalLayout.setSpacing(6)
+ self.horizontalLayout.setObjectName("horizontalLayout")
+ self.label = QtGui.QLabel(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
+ self.label.setSizePolicy(sizePolicy)
+ self.label.setObjectName("label")
+ self.horizontalLayout.addWidget(self.label)
+ self.edFcpConnectionName = QtGui.QLineEdit(self.tab)
+ self.edFcpConnectionName.setObjectName("edFcpConnectionName")
+ self.horizontalLayout.addWidget(self.edFcpConnectionName)
+ self.verticalLayout.addLayout(self.horizontalLayout)
+ self.label_6 = QtGui.QLabel(self.tab)
+ self.label_6.setWordWrap(True)
+ self.label_6.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard)
+ self.label_6.setObjectName("label_6")
+ self.verticalLayout.addWidget(self.label_6)
+ self.horizontalLayout_2 = QtGui.QHBoxLayout()
+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.verticalLayout_3 = QtGui.QVBoxLayout()
+ self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.label_3 = QtGui.QLabel(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
+ self.label_3.setSizePolicy(sizePolicy)
+ self.label_3.setObjectName("label_3")
+ self.verticalLayout_3.addWidget(self.label_3)
+ self.label_4 = QtGui.QLabel(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
+ self.label_4.setSizePolicy(sizePolicy)
+ self.label_4.setObjectName("label_4")
+ self.verticalLayout_3.addWidget(self.label_4)
+ self.horizontalLayout_2.addLayout(self.verticalLayout_3)
+ self.verticalLayout_2 = QtGui.QVBoxLayout()
+ self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.spinFcpConnectionTimerMaxDuration = QtGui.QSpinBox(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.spinFcpConnectionTimerMaxDuration.sizePolicy().hasHeightForWidth())
+ self.spinFcpConnectionTimerMaxDuration.setSizePolicy(sizePolicy)
+ self.spinFcpConnectionTimerMaxDuration.setMaximum(999)
+ self.spinFcpConnectionTimerMaxDuration.setObjectName("spinFcpConnectionTimerMaxDuration")
+ self.verticalLayout_2.addWidget(self.spinFcpConnectionTimerMaxDuration)
+ self.spinConnectionTimerTimeout = QtGui.QSpinBox(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.spinConnectionTimerTimeout.sizePolicy().hasHeightForWidth())
+ self.spinConnectionTimerTimeout.setSizePolicy(sizePolicy)
+ self.spinConnectionTimerTimeout.setMaximum(99999)
+ self.spinConnectionTimerTimeout.setObjectName("spinConnectionTimerTimeout")
+ self.verticalLayout_2.addWidget(self.spinConnectionTimerTimeout)
+ self.horizontalLayout_2.addLayout(self.verticalLayout_2)
+ self.verticalLayout.addLayout(self.horizontalLayout_2)
+ self.label_7 = QtGui.QLabel(self.tab)
+ self.label_7.setWordWrap(True)
+ self.label_7.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard)
+ self.label_7.setObjectName("label_7")
+ self.verticalLayout.addWidget(self.label_7)
+ self.horizontalLayout_3 = QtGui.QHBoxLayout()
+ self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+ self.label_2 = QtGui.QLabel(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
+ self.label_2.setSizePolicy(sizePolicy)
+ self.label_2.setObjectName("label_2")
+ self.horizontalLayout_3.addWidget(self.label_2)
+ self.spinFcpPollTimerTimeout = QtGui.QSpinBox(self.tab)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.spinFcpPollTimerTimeout.sizePolicy().hasHeightForWidth())
+ self.spinFcpPollTimerTimeout.setSizePolicy(sizePolicy)
+ self.spinFcpPollTimerTimeout.setMaximum(99999)
+ self.spinFcpPollTimerTimeout.setObjectName("spinFcpPollTimerTimeout")
+ self.horizontalLayout_3.addWidget(self.spinFcpPollTimerTimeout)
+ self.verticalLayout.addLayout(self.horizontalLayout_3)
+ self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
+ self.tabWidget.addTab(self.tab, "")
+ self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1)
+ spacerItem = QtGui.QSpacerItem(502, 21, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+ self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1)
+
+ self.retranslateUi(PrefsConnectionExpertSettings)
+ self.tabWidget.setCurrentIndex(0)
+ QtCore.QMetaObject.connectSlotsByName(PrefsConnectionExpertSettings)
+
+ def retranslateUi(self, PrefsConnectionExpertSettings):
+ PrefsConnectionExpertSettings.setWindowTitle(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Form", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_5.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests", None, QtGui.QApplication.UnicodeUTF8))
+ self.label.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Connection name:", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_6.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_3.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Connect duration: ", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_4.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Connect timeout:", None, QtGui.QApplication.UnicodeUTF8))
+ self.spinFcpConnectionTimerMaxDuration.setSuffix(QtGui.QApplication.translate("PrefsConnectionExpertSettings", " seconds", None, QtGui.QApplication.UnicodeUTF8))
+ self.spinConnectionTimerTimeout.setSuffix(QtGui.QApplication.translate("PrefsConnectionExpertSettings", " miliseconds", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_7.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down.\n"
+"", None, QtGui.QApplication.UnicodeUTF8))
+ self.label_2.setText(QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Poll frequency: ", None, QtGui.QApplication.UnicodeUTF8))
+ self.spinFcpPollTimerTimeout.setSuffix(QtGui.QApplication.translate("PrefsConnectionExpertSettings", " miliseconds", None, QtGui.QApplication.UnicodeUTF8))
+ self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("PrefsConnectionExpertSettings", "Fcp connection", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtGui.QApplication(sys.argv)
+ PrefsConnectionExpertSettings = QtGui.QWidget()
+ ui = Ui_PrefsConnectionExpertSettings()
+ ui.setupUi(PrefsConnectionExpertSettings)
+ PrefsConnectionExpertSettings.show()
+ sys.exit(app.exec_())
+
Modified: trunk/fclient/src/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-27 13:13:29 UTC (rev 785)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-27 18:20:55 UTC (rev 786)
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui'
+# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui'
#
-# Created: Sat Jul 26 13:12:11 2008
+# Created: Sun Jul 27 20:14:51 2008
# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
#
# WARNING! All changes made in this file will be lost!
@@ -44,23 +44,20 @@
self.line.setFrameShape(QtGui.QFrame.VLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName("line")
- self.gridLayout.addWidget(self.line, 1, 1, 6, 1)
+ self.gridLayout.addWidget(self.line, 1, 1, 5, 1)
spacerItem = QtGui.QSpacerItem(229, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 1, 2, 1, 1)
self.ckFcpAutoConnect = QtGui.QCheckBox(ViewConnectionWidget)
self.ckFcpAutoConnect.setObjectName("ckFcpAutoConnect")
self.gridLayout.addWidget(self.ckFcpAutoConnect, 2, 0, 1, 1)
- self.btFcpConnectionMore = QtGui.QPushButton(ViewConnectionWidget)
- self.btFcpConnectionMore.setObjectName("btFcpConnectionMore")
- self.gridLayout.addWidget(self.btFcpConnectionMore, 3, 0, 1, 1)
self.line_2 = QtGui.QFrame(ViewConnectionWidget)
self.line_2.setFrameShape(QtGui.QFrame.HLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName("line_2")
- self.gridLayout.addWidget(self.line_2, 4, 0, 1, 1)
+ self.gridLayout.addWidget(self.line_2, 3, 0, 1, 1)
self.label_6 = QtGui.QLabel(ViewConnectionWidget)
self.label_6.setObjectName("label_6")
- self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1)
+ self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)
self.verticalLayout_5 = QtGui.QVBoxLayout()
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.horizontalLayout_2 = QtGui.QHBoxLayout()
@@ -85,14 +82,14 @@
self.verticalLayout_2.addWidget(self.spinFproxyConnectionPort)
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
self.verticalLayout_5.addLayout(self.horizontalLayout_2)
- self.gridLayout.addLayout(self.verticalLayout_5, 6, 0, 1, 1)
+ self.gridLayout.addLayout(self.verticalLayout_5, 5, 0, 1, 1)
spacerItem1 = QtGui.QSpacerItem(20, 97, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.gridLayout.addItem(spacerItem1, 7, 0, 1, 1)
+ self.gridLayout.addItem(spacerItem1, 6, 0, 1, 1)
self.btConnect = QtGui.QPushButton(ViewConnectionWidget)
self.btConnect.setCheckable(True)
self.btConnect.setAutoExclusive(False)
self.btConnect.setObjectName("btConnect")
- self.gridLayout.addWidget(self.btConnect, 8, 0, 1, 3)
+ self.gridLayout.addWidget(self.btConnect, 7, 0, 1, 3)
self.retranslateUi(ViewConnectionWidget)
QtCore.QMetaObject.connectSlotsByName(ViewConnectionWidget)
@@ -103,7 +100,6 @@
self.label.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8))
self.ckFcpAutoConnect.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Auto Connect", None, QtGui.QApplication.UnicodeUTF8))
- self.btFcpConnectionMore.setText(QtGui.QApplication.translate("ViewConnectionWidget", "More..", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("ViewConnectionWidget", "<b>Fproxy connection</b>", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8))
Modified: trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui 2008-07-27 13:13:29 UTC (rev 785)
+++ trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui 2008-07-27 18:20:55 UTC (rev 786)
@@ -56,7 +56,7 @@
</item>
</layout>
</item>
- <item rowspan="6" row="1" column="1" >
+ <item rowspan="5" row="1" column="1" >
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -84,27 +84,20 @@
</widget>
</item>
<item row="3" column="0" >
- <widget class="QPushButton" name="btFcpConnectionMore" >
- <property name="text" >
- <string>More..</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0" >
<widget class="Line" name="line_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
- <item row="5" column="0" >
+ <item row="4" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string><b>Fproxy connection</b></string>
</property>
</widget>
</item>
- <item row="6" column="0" >
+ <item row="5" column="0" >
<layout class="QVBoxLayout" name="verticalLayout_5" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
@@ -144,7 +137,7 @@
</item>
</layout>
</item>
- <item row="7" column="0" >
+ <item row="6" column="0" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
@@ -157,7 +150,7 @@
</property>
</spacer>
</item>
- <item row="8" column="0" colspan="3" >
+ <item row="7" column="0" colspan="3" >
<widget class="QPushButton" name="btConnect" >
<property name="text" >
<string>Connect</string>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 13:13:20
|
Revision: 785
http://fclient.svn.sourceforge.net/fclient/?rev=785&view=rev
Author: jUrner
Date: 2008-07-27 13:13:29 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
no colon in connection name
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/config.py
Modified: trunk/fclient/src/fclient/impl/config.py
===================================================================
--- trunk/fclient/src/fclient/impl/config.py 2008-07-27 13:12:49 UTC (rev 784)
+++ trunk/fclient/src/fclient/impl/config.py 2008-07-27 13:13:29 UTC (rev 785)
@@ -20,7 +20,7 @@
FclientLicence = 'MIT'
FclientCopyright = '(c) 2008 Juergen Urner'
FclientHomepage = 'http://fclient.sourceforge.net/'
-FclientConnectionName = QtCore.QString(FclientAppName + ':{08625b10-2b44-4689-b1bf-8baf208b9641}')
+FclientConnectionName = QtCore.QString(FclientAppName + '{08625b10-2b44-4689-b1bf-8baf208b9641}')
_implDir = os.path.dirname(os.path.abspath(__file__))
_fclientDir = os.path.dirname(_implDir)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 13:12:39
|
Revision: 784
http://fclient.svn.sourceforge.net/fclient/?rev=784&view=rev
Author: jUrner
Date: 2008-07-27 13:12:49 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
requests are restored now
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/ViewDownloads.py
Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 13:12:04 UTC (rev 783)
+++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 13:12:49 UTC (rev 784)
@@ -32,6 +32,7 @@
from . import config
from .lib import fcp2
+from .lib.fcp2.lib import pmstruct
from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget
#**********************************************************************************
@@ -49,6 +50,14 @@
#**********************************************************************************
#
#**********************************************************************************
+class PersistentRequestData(pmstruct.PMStruct):
+ _fields_ = (
+ ('ClientName', pmstruct.STRING),
+ )
+
+#**********************************************************************************
+#
+#**********************************************************************************
# from: network/torrent/mainwindow.cpp
# TorrentViewDelegate is used to draw the progress bars.
class DownloadTreeDelegate(QtGui.QItemDelegate):
@@ -146,7 +155,26 @@
#XXX
self.foo = False
-
+ ############################
+ ## private methods
+ ############################
+ def _createItemFromFcpRequest(self, fcpRequest):
+ item= TreeItem(fcpRequest['Identifier'], self.tree)
+ item.setData(
+ self.HeaderIndexName,
+ QtCore.Qt.DisplayRole,
+ QtCore.QVariant(os.path.basename(fcpRequest['Filename']))
+ )
+
+ progressBar = QtGui.QProgressBar(self)
+ progressBar.setRange(0, 0)
+ self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar)
+ self.fcpRequests[fcpRequest['Identifier']] = item
+ return item
+
+ ############################
+ ##
+ ############################
def retranslateUi(self, parent):
self.fcHeadeLabels = {
self.HeaderIndexName: self.trUtf8('Name'),
@@ -158,8 +186,8 @@
def closeEvent(self):
self.viewClose()
-
+
def viewClose(self):
config.fcpClient.events -= self.fcpEvents
@@ -167,19 +195,15 @@
def downloadFile(self, fcpKey, fileName, **kws):
""""""
fileName = unicode(fileName)
- fcpIdentifier = config.fcpClient.getFile(fcpKey, fileName, **kws)
- item= TreeItem(fcpIdentifier, self.tree)
+ fcpIdentifier = config.fcpClient.getFile(
+ fcpKey,
+ fileName,
+ persistentUserData=PersistentRequestData(ClientName=unicode(self.objectName())).dump(),
+ **kws
+ )
+ item = self._createItemFromFcpRequest(config.fcpClient.getRequest(cpIdentifier))
- item.setData(
- self.HeaderIndexName,
- QtCore.Qt.DisplayRole,
- QtCore.QVariant(os.path.basename(fileName))
- )
- progressBar = QtGui.QProgressBar(self)
- progressBar.setRange(0, 0)
- self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar)
- self.fcpRequests[fcpIdentifier] = item
#########################################
@@ -208,6 +232,7 @@
item = self.fcpRequests.get(fcpRequest['Identifier'], None)
if item is not None:
progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress)
+ progressBar.setRange(0, 1)
progressBar.setValue(progressBar.maximum())
def onFcpRequestFailed(self, fcpEvent, fcpRequest):
@@ -245,9 +270,16 @@
def onFcpRequestStarted(self, fcpEvent, fcpRequest):
- pass
-
-
+ if fcpRequest['RequestStatus'] & fcp2.ConstRequestStatus.Restored:
+ try:
+ requestData = PersistentRequestData.load(fcpRequest['PersistentUserData'])
+ except pmstruct.PMStructError:
+ pass
+ else:
+ if requestData.get('ClientName', None) == self.objectName():
+ item = self._createItemFromFcpRequest(fcpRequest)
+
+
#**********************************************************************************
#
#**********************************************************************************
@@ -260,13 +292,13 @@
app = QtGui.QApplication(sys.argv)
- mainWindow = Ui_MainWindow.MainWindow()
- viewWidget = Ui_View.ViewWidget(mainWindow)
+ mainWindow = MainWindow.MainWindow()
+ viewWidget = View.ViewWidget(mainWindow)
mainWindow.setCentralWidget(viewWidget)
viewWidget.addTopViews(
- Ui_ViewConnection.ViewConnectionWidget(None),
+ ViewConnection.ViewConnectionWidget(None),
ViewDownloadsWidget(None),
)
viewWidget.addBottomViews(ViewLogger.ViewLoggerWidget(None))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 13:11:55
|
Revision: 783
http://fclient.svn.sourceforge.net/fclient/?rev=783&view=rev
Author: jUrner
Date: 2008-07-27 13:12:04 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
add get() method
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py
Modified: trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py
===================================================================
--- trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py 2008-07-27 12:11:44 UTC (rev 782)
+++ trunk/fclient/src/fclient/impl/lib/fcp2/lib/pmstruct.py 2008-07-27 13:12:04 UTC (rev 783)
@@ -122,6 +122,12 @@
raise ValueError('no such field: %r' % kws.keys()[0])
+ def get(self, name, default=None):
+ try:
+ return self[name]
+ except KeyError:
+ return default
+
def __getitem__(self, name):
return self.values[name]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 12:11:35
|
Revision: 782
http://fclient.svn.sourceforge.net/fclient/?rev=782&view=rev
Author: jUrner
Date: 2008-07-27 12:11:44 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py
trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py
trunk/fclient/src/fclient/impl/ViewBrowser.py
trunk/fclient/src/fclient/impl/ViewConnection.py
Modified: trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py 2008-07-27 12:03:57 UTC (rev 781)
+++ trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py 2008-07-27 12:11:44 UTC (rev 782)
@@ -11,7 +11,7 @@
#**********************************************************************************
#
#**********************************************************************************
-class ConnectionExpertSettingsDlg(QtGui.QDialog, Ui_DlgConnectionExpertSettings ):
+class DlgConnectionExpertSettings(QtGui.QDialog, Ui_DlgConnectionExpertSettings ):
IdEdFcpConnectionName = 'edFcpConnectionName'
IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration'
Modified: trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 12:03:57 UTC (rev 781)
+++ trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-27 12:11:44 UTC (rev 782)
@@ -13,7 +13,7 @@
#**********************************************************************************
#
#**********************************************************************************
-class DownloadKeyToDiskDlg(QtGui.QDialog, Ui_DlgDownloadKeyToDisk):
+class DlgDownloadKeyToDisk(QtGui.QDialog, Ui_DlgDownloadKeyToDisk):
IdLabelKey = 'labelKey'
IdEdDownloadFileName = 'edDownloadFileName'
Modified: trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py 2008-07-27 12:03:57 UTC (rev 781)
+++ trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py 2008-07-27 12:11:44 UTC (rev 782)
@@ -21,7 +21,7 @@
#**********************************************************************************
#
#**********************************************************************************
-class PropsBrowserObjectDlg(QtGui.QDialog, Ui_DlgPropsBrowserObject):
+class DlgPropsBrowserObject(QtGui.QDialog, Ui_DlgPropsBrowserObject):
IdLabelType = 'labelType'
IdLabelTitle = 'labelTitle'
Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 12:03:57 UTC (rev 781)
+++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 12:11:44 UTC (rev 782)
@@ -543,7 +543,7 @@
"""
fcpKey = config.qStringToFcpKey(QtCore.QString(qUrl.encodedPath()))
if fcpKey is not None:
- dlg = DlgDownloadKeyToDisk.DownloadKeyToDiskDlg(self, fcpKey=fcpKey)
+ dlg = DlgDownloadKeyToDisk.DlgDownloadKeyToDisk(self, fcpKey=fcpKey)
if dlg.exec_() == dlg.Accepted:
filePath = dlg.filePath()
downloadsWidget = config.ObjectRegistry.get(config.IdViewCDownloadsWidget, None)
@@ -727,7 +727,7 @@
elif action == browser.pageAction(page.DownloadLinkToDisk):
self._downloadKeyToDisk(hitTestResult.linkUrl())
elif action == self.fcActions['ActionObjectProperties']:
- dlg = DlgPropsBrowserObject.PropsBrowserObjectDlg(self, hitTestResult=hitTestResult)
+ dlg = DlgPropsBrowserObject.DlgPropsBrowserObject(self, hitTestResult=hitTestResult)
if dlg.exec_() == dlg.Accepted:
pass
Modified: trunk/fclient/src/fclient/impl/ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 12:03:57 UTC (rev 781)
+++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 12:11:44 UTC (rev 782)
@@ -27,7 +27,7 @@
from . import config
from .lib import fcp2
-from .DlgConnectionExpertSettings import ConnectionExpertSettingsDlg
+from .DlgConnectionExpertSettings import DlgConnectionExpertSettings
from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget
#**********************************************************************************
@@ -268,7 +268,7 @@
config.settings.setValues(FcpConnectionPort=value)
def onBtFcpConnectionMoreClicked(self):
- dlg = ConnectionExpertSettingsDlg(self)
+ dlg = DlgConnectionExpertSettings(self)
if dlg.exec_() == dlg.Accepted:
pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 12:03:48
|
Revision: 781
http://fclient.svn.sourceforge.net/fclient/?rev=781&view=rev
Author: jUrner
Date: 2008-07-27 12:03:57 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
new package structure
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/downloads/
trunk/fclient/src/fclient/impl/settings/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 12:02:33
|
Revision: 780
http://fclient.svn.sourceforge.net/fclient/?rev=780&view=rev
Author: jUrner
Date: 2008-07-27 12:02:42 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
new package structure
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/config.py
Added Paths:
-----------
trunk/fclient/src/fclient/doc/
trunk/fclient/src/fclient/downloads/
trunk/fclient/src/fclient/settings/
Modified: trunk/fclient/src/fclient/impl/config.py
===================================================================
--- trunk/fclient/src/fclient/impl/config.py 2008-07-27 11:51:54 UTC (rev 779)
+++ trunk/fclient/src/fclient/impl/config.py 2008-07-27 12:02:42 UTC (rev 780)
@@ -22,14 +22,15 @@
FclientHomepage = 'http://fclient.sourceforge.net/'
FclientConnectionName = QtCore.QString(FclientAppName + ':{08625b10-2b44-4689-b1bf-8baf208b9641}')
-_ = os.path.dirname(os.path.abspath(__file__))
-FclientDir = QtCore.QString(_)
-FclientDocDir = QtCore.QString(os.path.join(_, 'doc'))
-FclientDownloadDir = QtCore.QString(os.path.join(_, 'downloads'))
-FclientResDir = QtCore.QString(os.path.join(_, 'res'))
-FclientSettingsDir = QtCore.QString(os.path.join(_, 'settings'))
-del _
-
+_implDir = os.path.dirname(os.path.abspath(__file__))
+_fclientDir = os.path.dirname(_implDir)
+FclientImplDir = QtCore.QString(_implDir)
+FclientDir = QtCore.QString(_fclientDir)
+FclientDocDir = QtCore.QString(os.path.join(_fclientDir, 'doc'))
+FclientDownloadDir = QtCore.QString(os.path.join(_fclientDir, 'downloads'))
+FclientResDir = QtCore.QString(os.path.join(_implDir, 'res'))
+FclientSettingsDir = QtCore.QString(os.path.join(_fclientDir, 'settings'))
+del _implDir, _fclientDir
#**********************************************************************************
# looks like QObject.findChild() does not always work. docs mention troubles
# with MSVC 6 where you should use qFindChild(). can not test this. so keep
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:51:45
|
Revision: 779
http://fclient.svn.sourceforge.net/fclient/?rev=779&view=rev
Author: jUrner
Date: 2008-07-27 11:51:54 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/ViewBrowser.py
Added Paths:
-----------
trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_DlgPropsBrowserObject.py
Added: trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py (rev 0)
+++ trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py 2008-07-27 11:51:54 UTC (rev 779)
@@ -0,0 +1,69 @@
+#*********************************************************************
+#TODO:
+# just a sketch so far
+#
+# x. link and image url are not selectable
+#
+#
+#**********************************************************************
+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 posixpath
+from PyQt4 import QtGui
+
+from . import config
+from .lib.compactpath.qt4 import pathlabelwrap
+from .lib.qt4ex.lib import tools as qtools
+
+from .tpls.Ui_DlgPropsBrowserObjectTpl import Ui_DlgPropsBrowserObject
+#**********************************************************************************
+#
+#**********************************************************************************
+class PropsBrowserObjectDlg(QtGui.QDialog, Ui_DlgPropsBrowserObject):
+
+ IdLabelType = 'labelType'
+ IdLabelTitle = 'labelTitle'
+ IdLabelName = 'labelName'
+ IdLabelLinkUrl = 'labelLinkUrl'
+ IdLabelImageUrl = 'labelImageUrl'
+
+ MaxText = 80
+
+ def __init__(self, parent, browser=None, hitTestResult=None):
+ QtGui.QDialog.__init__(self, parent)
+
+ self.setupUi(self)
+ self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties'))
+
+ if hitTestResult is not None:
+
+ if not hitTestResult.linkUrl().isEmpty():
+ labelLinkUrl = self.controlById(self.IdLabelLinkUrl)
+ self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=config.CompactPathFcpKeyModule)
+ self.wrapLinkUrl.setPath(unicode(hitTestResult.linkUrl().toString()))
+ if not hitTestResult.imageUrl().isEmpty():
+ labelImageUrl = self.controlById(self.IdLabelImageUrl)
+ self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=config.CompactPathFcpKeyModule)
+ self.wrapImageUrl.setPath(unicode(hitTestResult.imageUrl().toString()))
+
+ ellipsis = self.trUtf8('..')
+ self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkTitle().toString(), ellipsis))
+ self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkText(), ellipsis))
+
+ def controlById(self, idControl):
+ return getattr(self, idControl)
+
+#**********************************************************************************
+#
+#**********************************************************************************
+if __name__ == '__main__':
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = PropsBrowserObjectDlg(None)
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
Deleted: trunk/fclient/src/fclient/impl/Ui_DlgPropsBrowserObject.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_DlgPropsBrowserObject.py 2008-07-27 11:50:16 UTC (rev 778)
+++ trunk/fclient/src/fclient/impl/Ui_DlgPropsBrowserObject.py 2008-07-27 11:51:54 UTC (rev 779)
@@ -1,69 +0,0 @@
-#*********************************************************************
-#TODO:
-# just a sketch so far
-#
-# x. link and image url are not selectable
-#
-#
-#**********************************************************************
-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 posixpath
-from PyQt4 import QtGui
-
-from . import config
-from .lib.compactpath.qt4 import pathlabelwrap
-from .lib.qt4ex.lib import tools as qtools
-
-from .tpls.Ui_DlgPropsBrowserObjectTpl import Ui_DlgPropsBrowserObject
-#**********************************************************************************
-#
-#**********************************************************************************
-class PropsBrowserObjectDlg(QtGui.QDialog, Ui_DlgPropsBrowserObject):
-
- IdLabelType = 'labelType'
- IdLabelTitle = 'labelTitle'
- IdLabelName = 'labelName'
- IdLabelLinkUrl = 'labelLinkUrl'
- IdLabelImageUrl = 'labelImageUrl'
-
- MaxText = 80
-
- def __init__(self, parent, browser=None, hitTestResult=None):
- QtGui.QDialog.__init__(self, parent)
-
- self.setupUi(self)
- self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties'))
-
- if hitTestResult is not None:
-
- if not hitTestResult.linkUrl().isEmpty():
- labelLinkUrl = self.controlById(self.IdLabelLinkUrl)
- self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=config.CompactPathFcpKeyModule)
- self.wrapLinkUrl.setPath(unicode(hitTestResult.linkUrl().toString()))
- if not hitTestResult.imageUrl().isEmpty():
- labelImageUrl = self.controlById(self.IdLabelImageUrl)
- self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=config.CompactPathFcpKeyModule)
- self.wrapImageUrl.setPath(unicode(hitTestResult.imageUrl().toString()))
-
- ellipsis = self.trUtf8('..')
- self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkTitle().toString(), ellipsis))
- self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkText(), ellipsis))
-
- def controlById(self, idControl):
- return getattr(self, idControl)
-
-#**********************************************************************************
-#
-#**********************************************************************************
-if __name__ == '__main__':
- import sys
-
- app = QtGui.QApplication(sys.argv)
- w = PropsBrowserObjectDlg(None)
- 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:50:16 UTC (rev 778)
+++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:51:54 UTC (rev 779)
@@ -40,7 +40,7 @@
from .lib.qt4ex.lib import tools as qtools
from .lib.compactpath.qt4 import pathlabelwrap
-from . import Ui_DlgPropsBrowserObject
+from . import DlgPropsBrowserObject
from . import DlgDownloadKeyToDisk
from .tpls.Ui_ViewBrowserWidgetTpl import Ui_ViewBrowserWidget
#*****************************************************************************************
@@ -727,7 +727,7 @@
elif action == browser.pageAction(page.DownloadLinkToDisk):
self._downloadKeyToDisk(hitTestResult.linkUrl())
elif action == self.fcActions['ActionObjectProperties']:
- dlg = Ui_DlgPropsBrowserObject.PropsBrowserObjectDlg(self, hitTestResult=hitTestResult)
+ dlg = DlgPropsBrowserObject.PropsBrowserObjectDlg(self, hitTestResult=hitTestResult)
if dlg.exec_() == dlg.Accepted:
pass
@@ -974,7 +974,7 @@
#**********************************************************************************
if __name__ == '__main__':
import sys
- from .Ui_ViewLogger import ViewLoggerWidget
+ from .ViewLogger import ViewLoggerWidget
from .MainWindow import MainWindow
from .View import ViewWidget
from .ViewConnection import ViewConnectionWidget
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <jU...@us...> - 2008-07-27 11:48:43
|
Revision: 777
http://fclient.svn.sourceforge.net/fclient/?rev=777&view=rev
Author: jUrner
Date: 2008-07-27 11:48:52 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/ViewConnection.py
Added Paths:
-----------
trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_DlgConnectionExpertSettings.py
Added: trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py
===================================================================
--- trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py (rev 0)
+++ trunk/fclient/src/fclient/impl/DlgConnectionExpertSettings.py 2008-07-27 11:48:52 UTC (rev 777)
@@ -0,0 +1,73 @@
+
+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__)]
+
+from PyQt4 import QtCore, QtGui
+
+from . import config
+
+from .tpls.Ui_DlgConnectionExpertSettingsTpl import Ui_DlgConnectionExpertSettings
+#**********************************************************************************
+#
+#**********************************************************************************
+class ConnectionExpertSettingsDlg(QtGui.QDialog, Ui_DlgConnectionExpertSettings ):
+
+ IdEdFcpConnectionName = 'edFcpConnectionName'
+ IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration'
+ IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout'
+ IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout'
+
+ def __init__(self, parent=None):
+ QtGui.QDialog.__init__(self, parent)
+
+ self.setupUi(self)
+ self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings'))
+
+ edName = self.controlById(self.IdEdFcpConnectionName)
+ edName.setText(config.settings.value('FcpConnectionName'))
+ self.connect(edName, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionNameChanged)
+
+ connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None)
+ spins = (
+ (self.IdSpinFcpConnectionTimerMaxDuration, 'FcpConnectionTimerMaxDuration'),
+ (self.IdSpinConnectionTimerTimeout, 'FcpConnectionTimerTimeout'),
+ (self.IdSpinFcpPollTimerTimeout, 'FcpPollTimerTimeout'),
+ )
+ for idControl, settingName in spins:
+ spin = self.controlById(idControl)
+ if connectionWidget is None:
+ spin.setEnabled(False)
+ else:
+ spin.setValue(connectionWidget.fcSettings.value(settingName))
+
+
+
+
+ def controlById(self, idControl):
+ return getattr(self, idControl)
+
+
+ def onEdFcpConnectionNameChanged(self, text):
+ config.settings.setValues(FcpConnectionName=text)
+
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
+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 = ConnectionExpertSettingsDlg(None)
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
+
Deleted: trunk/fclient/src/fclient/impl/Ui_DlgConnectionExpertSettings.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_DlgConnectionExpertSettings.py 2008-07-27 11:45:55 UTC (rev 776)
+++ trunk/fclient/src/fclient/impl/Ui_DlgConnectionExpertSettings.py 2008-07-27 11:48:52 UTC (rev 777)
@@ -1,73 +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__)]
-
-from PyQt4 import QtCore, QtGui
-
-from . import config
-
-from .tpls.Ui_DlgConnectionExpertSettingsTpl import Ui_DlgConnectionExpertSettings
-#**********************************************************************************
-#
-#**********************************************************************************
-class ConnectionExpertSettingsDlg(QtGui.QDialog, Ui_DlgConnectionExpertSettings ):
-
- IdEdFcpConnectionName = 'edFcpConnectionName'
- IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration'
- IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout'
- IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout'
-
- def __init__(self, parent=None):
- QtGui.QDialog.__init__(self, parent)
-
- self.setupUi(self)
- self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings'))
-
- edName = self.controlById(self.IdEdFcpConnectionName)
- edName.setText(config.settings.value('FcpConnectionName'))
- self.connect(edName, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionNameChanged)
-
- connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None)
- spins = (
- (self.IdSpinFcpConnectionTimerMaxDuration, 'FcpConnectionTimerMaxDuration'),
- (self.IdSpinConnectionTimerTimeout, 'FcpConnectionTimerTimeout'),
- (self.IdSpinFcpPollTimerTimeout, 'FcpPollTimerTimeout'),
- )
- for idControl, settingName in spins:
- spin = self.controlById(idControl)
- if connectionWidget is None:
- spin.setEnabled(False)
- else:
- spin.setValue(connectionWidget.fcSettings.value(settingName))
-
-
-
-
- def controlById(self, idControl):
- return getattr(self, idControl)
-
-
- def onEdFcpConnectionNameChanged(self, text):
- config.settings.setValues(FcpConnectionName=text)
-
-
-
-#**********************************************************************************
-#
-#**********************************************************************************
-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 = ConnectionExpertSettingsDlg(None)
- w.show()
- res = app.exec_()
- sys.exit(res)
-
-
Modified: trunk/fclient/src/fclient/impl/ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 11:45:55 UTC (rev 776)
+++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 11:48:52 UTC (rev 777)
@@ -27,7 +27,7 @@
from . import config
from .lib import fcp2
-from .Ui_DlgConnectionExpertSettings import ConnectionExpertSettingsDlg
+from .DlgConnectionExpertSettings import ConnectionExpertSettingsDlg
from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget
#**********************************************************************************
@@ -298,9 +298,9 @@
from . import View, ViewLogger
app = QtGui.QApplication(sys.argv)
- w = Ui_View.ViewWidget(None)
+ w = View.ViewWidget(None)
w.addTopViews(ViewConnectionWidget(None))
- w.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None))
+ w.addBottomViews(ViewLogger.ViewLoggerWidget(None))
w.show()
res = app.exec_()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:45:46
|
Revision: 776
http://fclient.svn.sourceforge.net/fclient/?rev=776&view=rev
Author: jUrner
Date: 2008-07-27 11:45:55 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/MainWindow.py
Added Paths:
-----------
trunk/fclient/src/fclient/impl/Prefs.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_Prefs.py
Modified: trunk/fclient/src/fclient/impl/MainWindow.py
===================================================================
--- trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-27 11:42:47 UTC (rev 775)
+++ trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-27 11:45:55 UTC (rev 776)
@@ -9,7 +9,7 @@
from PyQt4 import QtCore, QtGui
from . import config
-from . import Ui_Prefs
+from . import Prefs
from .lib.qt4ex import dlgabout
from .tpls.Ui_MainWindowTpl import Ui_MainWindow
@@ -120,7 +120,7 @@
## event onrs
##################################################
def onActPreferencesTriggered(self):
- dlg = Ui_Prefs.PrefsDlg(self)
+ dlg = Prefs.PrefsDlg(self)
if dlg.exec_() == dlg.Accepted:
pass
Added: trunk/fclient/src/fclient/impl/Prefs.py
===================================================================
--- trunk/fclient/src/fclient/impl/Prefs.py (rev 0)
+++ trunk/fclient/src/fclient/impl/Prefs.py 2008-07-27 11:45:55 UTC (rev 776)
@@ -0,0 +1,91 @@
+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__)]
+
+
+from PyQt4 import QtGui
+
+from . import config
+from .lib.qt4ex import dlgpreferences
+from .PrefsGlobal import PrefsPageGlobal
+from .PrefsBrowserWidget import PrefsPageBrowser
+#**********************************************************************************
+#
+#**********************************************************************************
+class Settings(config.SettingsBase):
+ _key_ = config.IdViewBrowserWidget
+ _settings_ = (
+ ('DlgState', 'String', '', config.SettingScopePrivate),
+ )
+
+
+#***********************************************************************
+#
+#***********************************************************************
+class PrefsPageRoot(dlgpreferences.Page):
+
+ UUID = '{a61e2758-4c66-11dd-a3e6-8814a37cbeed}'
+
+ def __init__(self):
+ dlgpreferences.Page.__init__(self, self.UUID)
+ self._widget = None
+ self.setDirty(True)
+
+ def displayName(self):
+ return QtGui.QApplication.translate("PreferencesGlobal", 'All', None, QtGui.QApplication.UnicodeUTF8)
+
+ def canApply(self): return False
+ def canHelp(self): return False
+
+ def setVisible(self, parent, flag):
+ createdNew = False
+ if flag and self._widget is None:
+ createdNew = True
+ self._widget = QtGui.QWidget(parent)
+ self._widget.setVisible(flag)
+ return (createdNew, self._widget)
+
+#**********************************************************************************
+#
+#**********************************************************************************
+class PrefsDlg(dlgpreferences.DlgPreferencesFlatTree):
+
+ def __init__(self, parent):
+
+ pages = PrefsPageRoot()(
+ PrefsPageGlobal(),
+ PrefsPageBrowser(),
+
+ )
+
+ dlgpreferences.DlgPreferencesFlatTree.__init__(self,
+ parent,
+ pages=pages,
+ startPage=PrefsPageGlobal.UUID,
+ )
+ self.fcSettings = Settings(self).restore()
+
+
+ def showEvent(self, event):
+ self.restoreState(self.fcSettings.value('DlgState'))
+
+ def hideEvent(self, event):
+ self.fcSettings.setValues(DlgState=self.saveState())
+
+ def closeEvent(self, event):
+ pass
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
+if __name__ == '__main__':
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = PrefsDlg(None)
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
+
Deleted: trunk/fclient/src/fclient/impl/Ui_Prefs.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_Prefs.py 2008-07-27 11:42:47 UTC (rev 775)
+++ trunk/fclient/src/fclient/impl/Ui_Prefs.py 2008-07-27 11:45:55 UTC (rev 776)
@@ -1,91 +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__)]
-
-
-from PyQt4 import QtGui
-
-from . import config
-from .lib.qt4ex import dlgpreferences
-from .PrefsGlobal import PrefsPageGlobal
-from .PrefsBrowserWidget import PrefsPageBrowser
-#**********************************************************************************
-#
-#**********************************************************************************
-class Settings(config.SettingsBase):
- _key_ = config.IdViewBrowserWidget
- _settings_ = (
- ('DlgState', 'String', '', config.SettingScopePrivate),
- )
-
-
-#***********************************************************************
-#
-#***********************************************************************
-class PrefsPageRoot(dlgpreferences.Page):
-
- UUID = '{a61e2758-4c66-11dd-a3e6-8814a37cbeed}'
-
- def __init__(self):
- dlgpreferences.Page.__init__(self, self.UUID)
- self._widget = None
- self.setDirty(True)
-
- def displayName(self):
- return QtGui.QApplication.translate("PreferencesGlobal", 'All', None, QtGui.QApplication.UnicodeUTF8)
-
- def canApply(self): return False
- def canHelp(self): return False
-
- def setVisible(self, parent, flag):
- createdNew = False
- if flag and self._widget is None:
- createdNew = True
- self._widget = QtGui.QWidget(parent)
- self._widget.setVisible(flag)
- return (createdNew, self._widget)
-
-#**********************************************************************************
-#
-#**********************************************************************************
-class PrefsDlg(dlgpreferences.DlgPreferencesFlatTree):
-
- def __init__(self, parent):
-
- pages = PrefsPageRoot()(
- PrefsPageGlobal(),
- PrefsPageBrowser(),
-
- )
-
- dlgpreferences.DlgPreferencesFlatTree.__init__(self,
- parent,
- pages=pages,
- startPage=PrefsPageGlobal.UUID,
- )
- self.fcSettings = Settings(self).restore()
-
-
- def showEvent(self, event):
- self.restoreState(self.fcSettings.value('DlgState'))
-
- def hideEvent(self, event):
- self.fcSettings.setValues(DlgState=self.saveState())
-
- def closeEvent(self, event):
- pass
-
-
-#**********************************************************************************
-#
-#**********************************************************************************
-if __name__ == '__main__':
- import sys
-
- app = QtGui.QApplication(sys.argv)
- w = PrefsDlg(None)
- w.show()
- res = app.exec_()
- sys.exit(res)
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:42:38
|
Revision: 775
http://fclient.svn.sourceforge.net/fclient/?rev=775&view=rev
Author: jUrner
Date: 2008-07-27 11:42:47 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/impl/Ui_Prefs.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_PrefsBrowserWidget.py
trunk/fclient/src/fclient/impl/Ui_PrefsGlobal.py
Modified: trunk/fclient/src/fclient/impl/Ui_Prefs.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_Prefs.py 2008-07-27 11:42:16 UTC (rev 774)
+++ trunk/fclient/src/fclient/impl/Ui_Prefs.py 2008-07-27 11:42:47 UTC (rev 775)
@@ -7,8 +7,8 @@
from . import config
from .lib.qt4ex import dlgpreferences
-from .Ui_PrefsGlobal import PrefsPageGlobal
-from .Ui_PrefsBrowserWidget import PrefsPageBrowser
+from .PrefsGlobal import PrefsPageGlobal
+from .PrefsBrowserWidget import PrefsPageBrowser
#**********************************************************************************
#
#**********************************************************************************
Deleted: trunk/fclient/src/fclient/impl/Ui_PrefsBrowserWidget.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_PrefsBrowserWidget.py 2008-07-27 11:42:16 UTC (rev 774)
+++ trunk/fclient/src/fclient/impl/Ui_PrefsBrowserWidget.py 2008-07-27 11:42:47 UTC (rev 775)
@@ -1,113 +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__)]
-
-
-from PyQt4 import QtCore, QtGui
-
-from . import config
-from .lib.qt4ex import dlgpreferences
-
-from .tpls.Ui_PrefsBrowserWidgetTpl import Ui_PrefsBrowserWidget
-#**********************************************************************************
-#
-#**********************************************************************************
-class PrefsBrowserWidget(QtGui.QWidget, Ui_PrefsBrowserWidget):
-
- IdEdHomePage = 'edHomePage'
- IdCkOpenAddressBarInNewTab = 'ckOpenAddressBarInNewTab'
- IdCkOpenBookmarksInNewTab = 'ckOpenBookmarksInNewTab'
- IdCkOpenLinksInNewTab = 'ckOpenLinksInNewTab'
- IdCkOpenHomePageOnNewTabCreated = 'ckOpenHomePageOnNewTabCreated'
- IdCkBackIsClose = 'ckBackIsClose'
- IdCkAutoLoadImages = 'ckAutoLoadImages'
-
- def __init__(self, parent):
- QtGui.QWidget.__init__(self, parent)
- self.setupUi(self)
-
- browser = config.ObjectRegistry.get(config.IdViewBrowserWidget, None)
- self.setEnabled(browser is not None)
- if browser is not None:
- self.controlById(self.IdEdHomePage).setText(browser.fcSettings.value('HomePage'))
- ck = self.controlById(self.IdCkOpenAddressBarInNewTab)
- ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenAddressBarInNewTab') else QtCore.Qt.Unchecked)
- ck = self.controlById(self.IdCkOpenBookmarksInNewTab)
- ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenBookmarksInNewTab') else QtCore.Qt.Unchecked)
- ck = self.controlById(self.IdCkOpenLinksInNewTab)
- ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenLinksInNewTab') else QtCore.Qt.Unchecked)
- ck = self.controlById(self.IdCkOpenHomePageOnNewTabCreated)
- ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenHomePageOnNewTabCreated') else QtCore.Qt.Unchecked)
- ck = self.controlById(self.IdCkBackIsClose)
- ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('BackIsClose') else QtCore.Qt.Unchecked)
- ck = self.controlById(self.IdCkAutoLoadImages)
- ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('AutoLoadImages') else QtCore.Qt.Unchecked)
-
- def controlById(self, idControl):
- return getattr(self, idControl)
-
- def apply(self):
- browser = config.ObjectRegistry.get(config.IdViewBrowserWidget, None)
- if browser is not None:
- edHomePage = self.controlById(self.IdEdHomePage)
-
- browser.fcSettings.setValues(
- HomePage=edHomePage.text(),
- OpenAddressBarInNewTab=self.controlById(self.IdCkOpenAddressBarInNewTab).checkState() == QtCore.Qt.Checked,
- OpenBookmarksInNewTab=self.controlById(self.IdCkOpenBookmarksInNewTab).checkState() == QtCore.Qt.Checked,
- OpenLinksInNewTab=self.controlById(self.IdCkOpenLinksInNewTab).checkState() == QtCore.Qt.Checked,
- OpenHomePageOnNewTabCreated=self.controlById(self.IdCkOpenHomePageOnNewTabCreated).checkState() == QtCore.Qt.Checked,
- BackIsClose=self.controlById(self.IdCkBackIsClose).checkState() == QtCore.Qt.Checked,
- AutoLoadImages=self.controlById(self.IdCkAutoLoadImages).checkState() == QtCore.Qt.Checked,
- )
-
-
-#***********************************************************************
-#
-#***********************************************************************
-class PrefsPageBrowser(dlgpreferences.Page):
-
- UUID = '{c85e63a8-6806-435a-81ce-f4b46872246f}'
-
- def __init__(self):
- dlgpreferences.Page.__init__(self, self.UUID)
- self._widget = None
- self.setDirty(True)
-
- def displayName(self):
- return self.trUtf8('Browser')
-
- def canApply(self): return True
- def canHelp(self): return True
-
- def setVisible(self, parent, flag):
- createdNew = False
- if flag and self._widget is None:
- createdNew = True
- self._widget = PrefsBrowserWidget(parent)
- self._widget.setVisible(flag)
- return (createdNew, self._widget)
-
-
- def doApply(self):
- self._widget.apply()
- return True
-
- def doOk(self):
- return True
-
-
-#***********************************************************************
-#
-#***********************************************************************
-if __name__ == '__main__':
- from PyQt4 import QtGui
- import sys
-
- app = QtGui.QApplication(sys.argv)
- w = PrefsBrowserWidget(None)
- w.show()
- res = app.exec_()
- sys.exit(res)
-
Deleted: trunk/fclient/src/fclient/impl/Ui_PrefsGlobal.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_PrefsGlobal.py 2008-07-27 11:42:16 UTC (rev 774)
+++ trunk/fclient/src/fclient/impl/Ui_PrefsGlobal.py 2008-07-27 11:42:47 UTC (rev 775)
@@ -1,62 +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__)]
-
-
-from PyQt4 import QtGui
-
-from . import config
-from .lib.qt4ex import dlgpreferences
-
-from .tpls.Ui_PrefsGlobalWidgetTpl import Ui_PrefsGlobalWidget
-#**********************************************************************************
-#
-#**********************************************************************************
-class PrefsGlobalWidget(QtGui.QWidget, Ui_PrefsGlobalWidget):
-
- def __init__(self, parent):
- QtGui.QWidget.__init__(self, parent)
- self.setupUi(self)
-
-#***********************************************************************
-#
-#***********************************************************************
-class PrefsPageGlobal(dlgpreferences.Page):
-
- UUID = '{ba654bd8-4c63-11dd-b8b1-a11c9b5c3981}'
-
- def __init__(self):
- dlgpreferences.Page.__init__(self, self.UUID)
- self._widget = None
- self.setDirty(True)
-
- def displayName(self):
- return self.trUtf8('Global')
-
- def canApply(self): return True
- def canHelp(self): return True
-
- def setVisible(self, parent, flag):
- createdNew = False
- if flag and self._widget is None:
- createdNew = True
- self._widget = PrefsGlobalWidget(parent)
- self._widget.setVisible(flag)
- return (createdNew, self._widget)
-
-
-
-#***********************************************************************
-#
-#***********************************************************************
-if __name__ == '__main__':
- from PyQt4 import QtGui
- import sys
-
- app = QtGui.QApplication(sys.argv)
- w = PrefsGlobalWidget(None)
- w.show()
- res = app.exec_()
- sys.exit(res)
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:42:07
|
Revision: 774
http://fclient.svn.sourceforge.net/fclient/?rev=774&view=rev
Author: jUrner
Date: 2008-07-27 11:42:16 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
ups
Added Paths:
-----------
trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py
trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py
Added: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py (rev 0)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py 2008-07-27 11:42:16 UTC (rev 774)
@@ -0,0 +1,96 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui'
+#
+# Created: Sun Jul 27 13:41:50 2008
+# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_PrefsBrowserWidget(object):
+ def setupUi(self, PrefsBrowserWidget):
+ PrefsBrowserWidget.setObjectName("PrefsBrowserWidget")
+ PrefsBrowserWidget.resize(532, 186)
+ self.gridLayout_3 = QtGui.QGridLayout(PrefsBrowserWidget)
+ self.gridLayout_3.setObjectName("gridLayout_3")
+ self.horizontalLayout_2 = QtGui.QHBoxLayout()
+ self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+ self.label = QtGui.QLabel(PrefsBrowserWidget)
+ self.label.setObjectName("label")
+ self.horizontalLayout_2.addWidget(self.label)
+ self.edHomePage = QtGui.QLineEdit(PrefsBrowserWidget)
+ self.edHomePage.setDragEnabled(True)
+ self.edHomePage.setObjectName("edHomePage")
+ self.horizontalLayout_2.addWidget(self.edHomePage)
+ self.gridLayout_3.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
+ self.horizontalLayout = QtGui.QHBoxLayout()
+ self.horizontalLayout.setObjectName("horizontalLayout")
+ self.groupBox = QtGui.QGroupBox(PrefsBrowserWidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
+ self.groupBox.setSizePolicy(sizePolicy)
+ self.groupBox.setObjectName("groupBox")
+ self.gridLayout = QtGui.QGridLayout(self.groupBox)
+ self.gridLayout.setObjectName("gridLayout")
+ self.ckOpenLinksInNewTab = QtGui.QCheckBox(self.groupBox)
+ self.ckOpenLinksInNewTab.setObjectName("ckOpenLinksInNewTab")
+ self.gridLayout.addWidget(self.ckOpenLinksInNewTab, 0, 0, 1, 1)
+ self.ckOpenBookmarksInNewTab = QtGui.QCheckBox(self.groupBox)
+ self.ckOpenBookmarksInNewTab.setObjectName("ckOpenBookmarksInNewTab")
+ self.gridLayout.addWidget(self.ckOpenBookmarksInNewTab, 4, 0, 1, 1)
+ self.ckOpenAddressBarInNewTab = QtGui.QCheckBox(self.groupBox)
+ self.ckOpenAddressBarInNewTab.setObjectName("ckOpenAddressBarInNewTab")
+ self.gridLayout.addWidget(self.ckOpenAddressBarInNewTab, 1, 0, 1, 1)
+ self.horizontalLayout.addWidget(self.groupBox)
+ self.groupBox_2 = QtGui.QGroupBox(PrefsBrowserWidget)
+ sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
+ self.groupBox_2.setSizePolicy(sizePolicy)
+ self.groupBox_2.setObjectName("groupBox_2")
+ self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2)
+ self.gridLayout_2.setObjectName("gridLayout_2")
+ self.ckOpenHomePageOnNewTabCreated = QtGui.QCheckBox(self.groupBox_2)
+ self.ckOpenHomePageOnNewTabCreated.setObjectName("ckOpenHomePageOnNewTabCreated")
+ self.gridLayout_2.addWidget(self.ckOpenHomePageOnNewTabCreated, 0, 0, 1, 1)
+ self.ckBackIsClose = QtGui.QCheckBox(self.groupBox_2)
+ self.ckBackIsClose.setObjectName("ckBackIsClose")
+ self.gridLayout_2.addWidget(self.ckBackIsClose, 1, 0, 1, 1)
+ self.ckAutoLoadImages = QtGui.QCheckBox(self.groupBox_2)
+ self.ckAutoLoadImages.setObjectName("ckAutoLoadImages")
+ self.gridLayout_2.addWidget(self.ckAutoLoadImages, 2, 0, 1, 1)
+ self.horizontalLayout.addWidget(self.groupBox_2)
+ self.gridLayout_3.addLayout(self.horizontalLayout, 1, 0, 1, 1)
+ spacerItem = QtGui.QSpacerItem(20, 297, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+ self.gridLayout_3.addItem(spacerItem, 2, 0, 1, 1)
+
+ self.retranslateUi(PrefsBrowserWidget)
+ QtCore.QMetaObject.connectSlotsByName(PrefsBrowserWidget)
+
+ def retranslateUi(self, PrefsBrowserWidget):
+ PrefsBrowserWidget.setWindowTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Form", None, QtGui.QApplication.UnicodeUTF8))
+ self.label.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Homepage:", None, QtGui.QApplication.UnicodeUTF8))
+ self.groupBox.setTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Open in new tab", None, QtGui.QApplication.UnicodeUTF8))
+ self.ckOpenLinksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Links", None, QtGui.QApplication.UnicodeUTF8))
+ self.ckOpenBookmarksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Bookmarks", None, QtGui.QApplication.UnicodeUTF8))
+ self.ckOpenAddressBarInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Address bar", None, QtGui.QApplication.UnicodeUTF8))
+ self.groupBox_2.setTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Others", None, QtGui.QApplication.UnicodeUTF8))
+ self.ckOpenHomePageOnNewTabCreated.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Open home page when a new tab is created", None, QtGui.QApplication.UnicodeUTF8))
+ self.ckBackIsClose.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Back is close", None, QtGui.QApplication.UnicodeUTF8))
+ self.ckAutoLoadImages.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Auto load images", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtGui.QApplication(sys.argv)
+ PrefsBrowserWidget = QtGui.QWidget()
+ ui = Ui_PrefsBrowserWidget()
+ ui.setupUi(PrefsBrowserWidget)
+ PrefsBrowserWidget.show()
+ sys.exit(app.exec_())
+
Added: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py (rev 0)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py 2008-07-27 11:42:16 UTC (rev 774)
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui'
+#
+# Created: Sun Jul 27 13:41:35 2008
+# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_PrefsGlobalWidget(object):
+ def setupUi(self, PrefsGlobalWidget):
+ PrefsGlobalWidget.setObjectName("PrefsGlobalWidget")
+ PrefsGlobalWidget.resize(465, 247)
+ self.gridlayout = QtGui.QGridLayout(PrefsGlobalWidget)
+ self.gridlayout.setObjectName("gridlayout")
+ self.label = QtGui.QLabel(PrefsGlobalWidget)
+ self.label.setWordWrap(True)
+ self.label.setObjectName("label")
+ self.gridlayout.addWidget(self.label, 0, 0, 1, 1)
+ self.hboxlayout = QtGui.QHBoxLayout()
+ self.hboxlayout.setObjectName("hboxlayout")
+ self.ckStoreSettingsLocally = QtGui.QCheckBox(PrefsGlobalWidget)
+ self.ckStoreSettingsLocally.setObjectName("ckStoreSettingsLocally")
+ self.hboxlayout.addWidget(self.ckStoreSettingsLocally)
+ self.edStoreSettingsLocally = QtGui.QLineEdit(PrefsGlobalWidget)
+ self.edStoreSettingsLocally.setObjectName("edStoreSettingsLocally")
+ self.hboxlayout.addWidget(self.edStoreSettingsLocally)
+ self.btStoreSettingsLocally = QtGui.QPushButton(PrefsGlobalWidget)
+ self.btStoreSettingsLocally.setObjectName("btStoreSettingsLocally")
+ self.hboxlayout.addWidget(self.btStoreSettingsLocally)
+ self.gridlayout.addLayout(self.hboxlayout, 1, 0, 1, 1)
+ spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
+ self.gridlayout.addItem(spacerItem, 2, 0, 1, 1)
+
+ self.retranslateUi(PrefsGlobalWidget)
+ QtCore.QMetaObject.connectSlotsByName(PrefsGlobalWidget)
+
+ def retranslateUi(self, PrefsGlobalWidget):
+ PrefsGlobalWidget.setWindowTitle(QtGui.QApplication.translate("PrefsGlobalWidget", "Form", None, QtGui.QApplication.UnicodeUTF8))
+ self.label.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "Specify directory to store settings to. If unchecked, settings are stored in an os dependend location.", None, QtGui.QApplication.UnicodeUTF8))
+ self.btStoreSettingsLocally.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "...", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtGui.QApplication(sys.argv)
+ PrefsGlobalWidget = QtGui.QWidget()
+ ui = Ui_PrefsGlobalWidget()
+ ui.setupUi(PrefsGlobalWidget)
+ PrefsGlobalWidget.show()
+ sys.exit(app.exec_())
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:40:27
|
Revision: 773
http://fclient.svn.sourceforge.net/fclient/?rev=773&view=rev
Author: jUrner
Date: 2008-07-27 11:40:36 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Added Paths:
-----------
trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py
trunk/fclient/src/fclient/impl/PrefsGlobal.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py
trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py
Added: trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py
===================================================================
--- trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py (rev 0)
+++ trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py 2008-07-27 11:40:36 UTC (rev 773)
@@ -0,0 +1,113 @@
+
+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__)]
+
+
+from PyQt4 import QtCore, QtGui
+
+from . import config
+from .lib.qt4ex import dlgpreferences
+
+from .tpls.Ui_PrefsBrowserWidgetTpl import Ui_PrefsBrowserWidget
+#**********************************************************************************
+#
+#**********************************************************************************
+class PrefsBrowserWidget(QtGui.QWidget, Ui_PrefsBrowserWidget):
+
+ IdEdHomePage = 'edHomePage'
+ IdCkOpenAddressBarInNewTab = 'ckOpenAddressBarInNewTab'
+ IdCkOpenBookmarksInNewTab = 'ckOpenBookmarksInNewTab'
+ IdCkOpenLinksInNewTab = 'ckOpenLinksInNewTab'
+ IdCkOpenHomePageOnNewTabCreated = 'ckOpenHomePageOnNewTabCreated'
+ IdCkBackIsClose = 'ckBackIsClose'
+ IdCkAutoLoadImages = 'ckAutoLoadImages'
+
+ def __init__(self, parent):
+ QtGui.QWidget.__init__(self, parent)
+ self.setupUi(self)
+
+ browser = config.ObjectRegistry.get(config.IdViewBrowserWidget, None)
+ self.setEnabled(browser is not None)
+ if browser is not None:
+ self.controlById(self.IdEdHomePage).setText(browser.fcSettings.value('HomePage'))
+ ck = self.controlById(self.IdCkOpenAddressBarInNewTab)
+ ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenAddressBarInNewTab') else QtCore.Qt.Unchecked)
+ ck = self.controlById(self.IdCkOpenBookmarksInNewTab)
+ ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenBookmarksInNewTab') else QtCore.Qt.Unchecked)
+ ck = self.controlById(self.IdCkOpenLinksInNewTab)
+ ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenLinksInNewTab') else QtCore.Qt.Unchecked)
+ ck = self.controlById(self.IdCkOpenHomePageOnNewTabCreated)
+ ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenHomePageOnNewTabCreated') else QtCore.Qt.Unchecked)
+ ck = self.controlById(self.IdCkBackIsClose)
+ ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('BackIsClose') else QtCore.Qt.Unchecked)
+ ck = self.controlById(self.IdCkAutoLoadImages)
+ ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('AutoLoadImages') else QtCore.Qt.Unchecked)
+
+ def controlById(self, idControl):
+ return getattr(self, idControl)
+
+ def apply(self):
+ browser = config.ObjectRegistry.get(config.IdViewBrowserWidget, None)
+ if browser is not None:
+ edHomePage = self.controlById(self.IdEdHomePage)
+
+ browser.fcSettings.setValues(
+ HomePage=edHomePage.text(),
+ OpenAddressBarInNewTab=self.controlById(self.IdCkOpenAddressBarInNewTab).checkState() == QtCore.Qt.Checked,
+ OpenBookmarksInNewTab=self.controlById(self.IdCkOpenBookmarksInNewTab).checkState() == QtCore.Qt.Checked,
+ OpenLinksInNewTab=self.controlById(self.IdCkOpenLinksInNewTab).checkState() == QtCore.Qt.Checked,
+ OpenHomePageOnNewTabCreated=self.controlById(self.IdCkOpenHomePageOnNewTabCreated).checkState() == QtCore.Qt.Checked,
+ BackIsClose=self.controlById(self.IdCkBackIsClose).checkState() == QtCore.Qt.Checked,
+ AutoLoadImages=self.controlById(self.IdCkAutoLoadImages).checkState() == QtCore.Qt.Checked,
+ )
+
+
+#***********************************************************************
+#
+#***********************************************************************
+class PrefsPageBrowser(dlgpreferences.Page):
+
+ UUID = '{c85e63a8-6806-435a-81ce-f4b46872246f}'
+
+ def __init__(self):
+ dlgpreferences.Page.__init__(self, self.UUID)
+ self._widget = None
+ self.setDirty(True)
+
+ def displayName(self):
+ return self.trUtf8('Browser')
+
+ def canApply(self): return True
+ def canHelp(self): return True
+
+ def setVisible(self, parent, flag):
+ createdNew = False
+ if flag and self._widget is None:
+ createdNew = True
+ self._widget = PrefsBrowserWidget(parent)
+ self._widget.setVisible(flag)
+ return (createdNew, self._widget)
+
+
+ def doApply(self):
+ self._widget.apply()
+ return True
+
+ def doOk(self):
+ return True
+
+
+#***********************************************************************
+#
+#***********************************************************************
+if __name__ == '__main__':
+ from PyQt4 import QtGui
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = PrefsBrowserWidget(None)
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
Added: trunk/fclient/src/fclient/impl/PrefsGlobal.py
===================================================================
--- trunk/fclient/src/fclient/impl/PrefsGlobal.py (rev 0)
+++ trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-27 11:40:36 UTC (rev 773)
@@ -0,0 +1,62 @@
+
+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__)]
+
+
+from PyQt4 import QtGui
+
+from . import config
+from .lib.qt4ex import dlgpreferences
+
+from .tpls.Ui_PrefsGlobalWidgetTpl import Ui_PrefsGlobalWidget
+#**********************************************************************************
+#
+#**********************************************************************************
+class PrefsGlobalWidget(QtGui.QWidget, Ui_PrefsGlobalWidget):
+
+ def __init__(self, parent):
+ QtGui.QWidget.__init__(self, parent)
+ self.setupUi(self)
+
+#***********************************************************************
+#
+#***********************************************************************
+class PrefsPageGlobal(dlgpreferences.Page):
+
+ UUID = '{ba654bd8-4c63-11dd-b8b1-a11c9b5c3981}'
+
+ def __init__(self):
+ dlgpreferences.Page.__init__(self, self.UUID)
+ self._widget = None
+ self.setDirty(True)
+
+ def displayName(self):
+ return self.trUtf8('Global')
+
+ def canApply(self): return True
+ def canHelp(self): return True
+
+ def setVisible(self, parent, flag):
+ createdNew = False
+ if flag and self._widget is None:
+ createdNew = True
+ self._widget = PrefsGlobalWidget(parent)
+ self._widget.setVisible(flag)
+ return (createdNew, self._widget)
+
+
+
+#***********************************************************************
+#
+#***********************************************************************
+if __name__ == '__main__':
+ from PyQt4 import QtGui
+ import sys
+
+ app = QtGui.QApplication(sys.argv)
+ w = PrefsGlobalWidget(None)
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
Deleted: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py 2008-07-27 11:37:58 UTC (rev 772)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py 2008-07-27 11:40:36 UTC (rev 773)
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/PrefsBrowserWidgetTpl.ui'
-#
-# Created: Fri Jul 25 10:02:49 2008
-# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-class Ui_PrefsBrowserWidget(object):
- def setupUi(self, PrefsBrowserWidget):
- PrefsBrowserWidget.setObjectName("PrefsBrowserWidget")
- PrefsBrowserWidget.resize(532, 186)
- self.gridLayout_3 = QtGui.QGridLayout(PrefsBrowserWidget)
- self.gridLayout_3.setObjectName("gridLayout_3")
- self.horizontalLayout_2 = QtGui.QHBoxLayout()
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.label = QtGui.QLabel(PrefsBrowserWidget)
- self.label.setObjectName("label")
- self.horizontalLayout_2.addWidget(self.label)
- self.edHomePage = QtGui.QLineEdit(PrefsBrowserWidget)
- self.edHomePage.setDragEnabled(True)
- self.edHomePage.setObjectName("edHomePage")
- self.horizontalLayout_2.addWidget(self.edHomePage)
- self.gridLayout_3.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.groupBox = QtGui.QGroupBox(PrefsBrowserWidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
- self.groupBox.setSizePolicy(sizePolicy)
- self.groupBox.setObjectName("groupBox")
- self.gridLayout = QtGui.QGridLayout(self.groupBox)
- self.gridLayout.setObjectName("gridLayout")
- self.ckOpenLinksInNewTab = QtGui.QCheckBox(self.groupBox)
- self.ckOpenLinksInNewTab.setObjectName("ckOpenLinksInNewTab")
- self.gridLayout.addWidget(self.ckOpenLinksInNewTab, 0, 0, 1, 1)
- self.ckOpenBookmarksInNewTab = QtGui.QCheckBox(self.groupBox)
- self.ckOpenBookmarksInNewTab.setObjectName("ckOpenBookmarksInNewTab")
- self.gridLayout.addWidget(self.ckOpenBookmarksInNewTab, 4, 0, 1, 1)
- self.ckOpenAddressBarInNewTab = QtGui.QCheckBox(self.groupBox)
- self.ckOpenAddressBarInNewTab.setObjectName("ckOpenAddressBarInNewTab")
- self.gridLayout.addWidget(self.ckOpenAddressBarInNewTab, 1, 0, 1, 1)
- self.horizontalLayout.addWidget(self.groupBox)
- self.groupBox_2 = QtGui.QGroupBox(PrefsBrowserWidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
- self.groupBox_2.setSizePolicy(sizePolicy)
- self.groupBox_2.setObjectName("groupBox_2")
- self.gridLayout_2 = QtGui.QGridLayout(self.groupBox_2)
- self.gridLayout_2.setObjectName("gridLayout_2")
- self.ckOpenHomePageOnNewTabCreated = QtGui.QCheckBox(self.groupBox_2)
- self.ckOpenHomePageOnNewTabCreated.setObjectName("ckOpenHomePageOnNewTabCreated")
- self.gridLayout_2.addWidget(self.ckOpenHomePageOnNewTabCreated, 0, 0, 1, 1)
- self.ckBackIsClose = QtGui.QCheckBox(self.groupBox_2)
- self.ckBackIsClose.setObjectName("ckBackIsClose")
- self.gridLayout_2.addWidget(self.ckBackIsClose, 1, 0, 1, 1)
- self.ckAutoLoadImages = QtGui.QCheckBox(self.groupBox_2)
- self.ckAutoLoadImages.setObjectName("ckAutoLoadImages")
- self.gridLayout_2.addWidget(self.ckAutoLoadImages, 2, 0, 1, 1)
- self.horizontalLayout.addWidget(self.groupBox_2)
- self.gridLayout_3.addLayout(self.horizontalLayout, 1, 0, 1, 1)
- spacerItem = QtGui.QSpacerItem(20, 297, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.gridLayout_3.addItem(spacerItem, 2, 0, 1, 1)
-
- self.retranslateUi(PrefsBrowserWidget)
- QtCore.QMetaObject.connectSlotsByName(PrefsBrowserWidget)
-
- def retranslateUi(self, PrefsBrowserWidget):
- PrefsBrowserWidget.setWindowTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Homepage:", None, QtGui.QApplication.UnicodeUTF8))
- self.groupBox.setTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Open in new tab", None, QtGui.QApplication.UnicodeUTF8))
- self.ckOpenLinksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Links", None, QtGui.QApplication.UnicodeUTF8))
- self.ckOpenBookmarksInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Bookmarks", None, QtGui.QApplication.UnicodeUTF8))
- self.ckOpenAddressBarInNewTab.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Address bar", None, QtGui.QApplication.UnicodeUTF8))
- self.groupBox_2.setTitle(QtGui.QApplication.translate("PrefsBrowserWidget", "Others", None, QtGui.QApplication.UnicodeUTF8))
- self.ckOpenHomePageOnNewTabCreated.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Open home page when a new tab is created", None, QtGui.QApplication.UnicodeUTF8))
- self.ckBackIsClose.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Back is close", None, QtGui.QApplication.UnicodeUTF8))
- self.ckAutoLoadImages.setText(QtGui.QApplication.translate("PrefsBrowserWidget", "Auto load images", None, QtGui.QApplication.UnicodeUTF8))
-
-
-if __name__ == "__main__":
- import sys
- app = QtGui.QApplication(sys.argv)
- PrefsBrowserWidget = QtGui.QWidget()
- ui = Ui_PrefsBrowserWidget()
- ui.setupUi(PrefsBrowserWidget)
- PrefsBrowserWidget.show()
- sys.exit(app.exec_())
-
Deleted: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py
===================================================================
--- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py 2008-07-27 11:37:58 UTC (rev 772)
+++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py 2008-07-27 11:40:36 UTC (rev 773)
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/PrefsGlobalWidgetTpl.ui'
-#
-# Created: Tue Jul 8 17:51:29 2008
-# by: PyQt4 UI code generator 4.3.3
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-class Ui_PrefsGlobalWidget(object):
- def setupUi(self, PrefsGlobalWidget):
- PrefsGlobalWidget.setObjectName("PrefsGlobalWidget")
- PrefsGlobalWidget.resize(QtCore.QSize(QtCore.QRect(0,0,465,247).size()).expandedTo(PrefsGlobalWidget.minimumSizeHint()))
-
- self.gridlayout = QtGui.QGridLayout(PrefsGlobalWidget)
- self.gridlayout.setObjectName("gridlayout")
-
- self.label = QtGui.QLabel(PrefsGlobalWidget)
- self.label.setWordWrap(True)
- self.label.setObjectName("label")
- self.gridlayout.addWidget(self.label,0,0,1,1)
-
- self.hboxlayout = QtGui.QHBoxLayout()
- self.hboxlayout.setObjectName("hboxlayout")
-
- self.ckStoreSettingsLocally = QtGui.QCheckBox(PrefsGlobalWidget)
- self.ckStoreSettingsLocally.setObjectName("ckStoreSettingsLocally")
- self.hboxlayout.addWidget(self.ckStoreSettingsLocally)
-
- self.edStoreSettingsLocally = QtGui.QLineEdit(PrefsGlobalWidget)
- self.edStoreSettingsLocally.setObjectName("edStoreSettingsLocally")
- self.hboxlayout.addWidget(self.edStoreSettingsLocally)
-
- self.btStoreSettingsLocally = QtGui.QPushButton(PrefsGlobalWidget)
- self.btStoreSettingsLocally.setObjectName("btStoreSettingsLocally")
- self.hboxlayout.addWidget(self.btStoreSettingsLocally)
- self.gridlayout.addLayout(self.hboxlayout,1,0,1,1)
-
- spacerItem = QtGui.QSpacerItem(20,40,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding)
- self.gridlayout.addItem(spacerItem,2,0,1,1)
-
- self.retranslateUi(PrefsGlobalWidget)
- QtCore.QMetaObject.connectSlotsByName(PrefsGlobalWidget)
-
- def retranslateUi(self, PrefsGlobalWidget):
- PrefsGlobalWidget.setWindowTitle(QtGui.QApplication.translate("PrefsGlobalWidget", "Form", None, QtGui.QApplication.UnicodeUTF8))
- self.label.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "Specify directory to store settings to. If unchecked, settings are stored in an os dependend location.", None, QtGui.QApplication.UnicodeUTF8))
- self.btStoreSettingsLocally.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "...", None, QtGui.QApplication.UnicodeUTF8))
-
-
-
-if __name__ == "__main__":
- import sys
- app = QtGui.QApplication(sys.argv)
- PrefsGlobalWidget = QtGui.QWidget()
- ui = Ui_PrefsGlobalWidget()
- ui.setupUi(PrefsGlobalWidget)
- PrefsGlobalWidget.show()
- sys.exit(app.exec_())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:37:49
|
Revision: 772
http://fclient.svn.sourceforge.net/fclient/?rev=772&view=rev
Author: jUrner
Date: 2008-07-27 11:37:58 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/fclient.py
trunk/fclient/src/fclient/impl/ViewConnection.py
trunk/fclient/src/fclient/impl/ViewDownloads.py
Added Paths:
-----------
trunk/fclient/src/fclient/impl/ViewLogger.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_ViewLogger.py
Modified: trunk/fclient/src/fclient/fclient.py
===================================================================
--- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:36:07 UTC (rev 771)
+++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:37:58 UTC (rev 772)
@@ -11,7 +11,7 @@
from .impl.ViewBrowser import ViewBrowserWidget
from .impl.ViewConnection import ViewConnectionWidget
from .impl.ViewDownloads import ViewDownloadsWidget
-from .impl.Ui_ViewLogger import ViewLoggerWidget
+from .impl.ViewLogger import ViewLoggerWidget
#*************************************************************
#
#*************************************************************
Deleted: trunk/fclient/src/fclient/impl/Ui_ViewLogger.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_ViewLogger.py 2008-07-27 11:36:07 UTC (rev 771)
+++ trunk/fclient/src/fclient/impl/Ui_ViewLogger.py 2008-07-27 11:37:58 UTC (rev 772)
@@ -1,276 +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 sys
-import logging
-
-from PyQt4 import QtCore, QtGui
-
-from . import config
-from .lib import fcp2
-
-from .tpls.Ui_ViewLoggerWidgetTpl import Ui_ViewLoggerWidget
-#**********************************************************************************
-#
-#**********************************************************************************
-class Actions(config.ActionsBase):
-
- PrefixVerbosity = 'ActionVerbosity'
-
- def __init__(self, parent):
- config.ActionsBase.__init__(self, parent)
-
- # for ease of use verbosities are mapped to verbosity actions like this: PrefixVerbosity + Verbosity
- self.action(
- name='ActionLoggerClear',
- text=self.trUtf8('C&lear'),
- trigger=parent.onActionLoggerClear,
- )
-
- groupVerbosity = self.group(
- name='GroupVerbosity',
- trigger=parent.onGroupVerbosityTriggered,
- isExclusive=True,
- )
- self.action(
- name='ActionVerbosityInfo',
- text=self.trUtf8('Info'),
- group=groupVerbosity,
- trigger=None,
- isCheckable=True,
- userData=fcp2.ConstDebugVerbosity.Info,
- )
- self.action(
- name='ActionVerbosityMessage',
- text=self.trUtf8('Message'),
- group=groupVerbosity,
- trigger=None,
- isCheckable=True,
- userData=fcp2.ConstDebugVerbosity.Message,
- )
- self.action(
- name='ActionVerbosityDebug',
- text=self.trUtf8('Debug'),
- group=groupVerbosity,
- trigger=None,
- isCheckable=True,
- userData=fcp2.ConstDebugVerbosity.Debug,
- )
- self.action(
- name='ActionVerbosityChatty',
- text=self.trUtf8('Chatty'),
- group=groupVerbosity,
- trigger=None,
- isCheckable=True,
- userData=fcp2.ConstDebugVerbosity.Chatty,
- )
-
-
-class GlobalFeedback(config.GlobalFeedbackBase):
- """wrapper for global statusbar widgets, menus"""
-
- def __init__(self, parent, idGlobalFeedback):
- config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback)
-
- # menus
- self.menus = []
- if self.menuBar is not None and hasattr(parent, 'fcViewObject'):
- menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar)
- parent.populateMenu(menu)
- self.menus.append(menu)
- self.menuBar.addViewMenu(menu)
-
- # status bar widgets
- self.label1 = None
- #if self.statusBar is not None:
- # self.label1 = QtGui.QLabel('foo here', self.statusBar)
-
- def setVisible(self, flag):
- for menu in self.menus:
- menu.children()[0].setVisible(flag)
- if self.label1 is not None:
- self.label1.setVisible(flag)
-
-
-class Settings(config.SettingsBase):
-
- PrefixVerbosityColorFg = 'ColorFgVerbosity'
-
- _key_ = config.IdViewLoggerWidget
- _settings_ = (
- ('MaxLines', 'UInt', 1000, config.SettingScopeUser),
- ('Verbosity', 'PyString', 'Info', config.SettingScopePrivate),
-
- #TODO: Chatty does not seem to work. check in fcp2.client
- ('ColorFgVerbosityCRITICAL', 'QColor', QtGui.QColor('red'), config.SettingScopeUser),
- ('ColorFgVerbosityERROR', 'QColor', QtGui.QColor('red'), config.SettingScopeUser),
- ('ColorFgVerbosityWARNING', 'QColor', QtGui.QColor('red'), config.SettingScopeUser),
- ('ColorFgVerbosityINFO', 'QColor', QtGui.QColor('black'), config.SettingScopeUser),
- ('ColorFgVerbosityMESSAGE', 'QColor', QtGui.QColor('blue'), config.SettingScopeUser),
- ('ColorFgVerbosityDEBUG', 'QColor', QtGui.QColor('slategray'), config.SettingScopeUser),
- ('ColorFgVerbosityCHATTY', 'QColor', QtGui.QColor('lightslategray'), config.SettingScopeUser),
- )
-
-
-class LoggerViewObject(config.ViewObject):
-
- def __init__(self, parent):
- config.ViewObject. __init__(self, parent)
-
- self.name=parent.objectName()
- self.displayName=self.trUtf8('Logger')
- self.icon=QtGui.QIcon()
-
-
-#***********************************************************************
-#
-#***********************************************************************
-class MyLoggingHandler(logging.Handler):
-
- def __init__(self, cb, *args, **kwargs):
- logging.Handler.__init__(self, *args, **kwargs)
- self.cb = cb
-
- def emit(self, record):
- self.cb(record)
-
-#***********************************************************************
-#
-#***********************************************************************
-class ViewLoggerWidget(QtGui.QWidget, Ui_ViewLoggerWidget):
-
- IdEdLogger = 'edLogger'
-
-
- def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
- QtGui.QWidget.__init__(self, parent)
- self._isCreated = False
- self._mainWindowMenus = {} #TODO: wrap along with toolbars to a handy class MainWindowStuff
-
- self.setupUi(self)
- config.ObjectRegistry.register(self)
-
- self.fcActions = Actions(self)
- self.fcSettings = Settings(self).restore()
- self.fcViewObject = LoggerViewObject(self)
- self.fcGlobalFeedback = GlobalFeedback(self, idGlobalFeedback)
-
-
- # setup editbox
- #NOTE: do not move to showEvent(). we want to be up and alive as soon as possible to catch logs
- ed = self.controlById(self.IdEdLogger)
- ed.document().setMaximumBlockCount(self.fcSettings.value('MaxLines'))
- ed.contextMenuEvent = self.loggerContextMenuEvent
- self.connect(ed, QtCore.SIGNAL('textChanged()'), self.onLoggerTextChanged)
-
- # setup logger
- self.loggingHandler = MyLoggingHandler(self.addRecord)
- logging.getLogger('').addHandler(self.loggingHandler)
-
- # setup actions
- verbosity = self.fcSettings.value('Verbosity').title()
- action = self.fcActions.get(self.fcActions.PrefixVerbosity + verbosity, None)
- if action is None:
- verbosity = self.fcSettings.restoreDefaults('Verbosity')['Verbosity']
- action = self.fcActions.get(self.fcActions.PrefixVerbosity + verbosity, None)
- if action is None:
- raise ValueError('default verbosity action "%s" not found. WTF?' % self.actions.PrefixVerbosity + verbosity)
- action.trigger()
-
- #########################################
- ## methods
- #########################################
- def addRecord(self, record):
- """adds a logging record"""
-
- ed = self.controlById(self.IdEdLogger)
- fmt = ed.currentCharFormat()
- colorFg = self.fcSettings.value(self.fcSettings.PrefixVerbosityColorFg + record.levelname)
- fmt.setForeground(QtGui.QBrush(colorFg))
- ed.setCurrentCharFormat(fmt)
-
- text = '%s:%s:%s' % (record.levelname, record.name, record.getMessage())
- ed.appendPlainText(text)
-
-
- def controlById(self, idControl):
- return getattr(self, idControl)
-
-
- def populateMenu(self, menu):
- menu.addAction(self.fcActions['ActionLoggerClear'])
- subMenu = menu.addMenu(self.trUtf8('Verbosity'))
- subMenu.addActions(self.fcActions['GroupVerbosity'].actions())
- return menu
-
- #########################################
- ##view methods
- #########################################
- def viewClose(self):
- pass
-
- def viewDisplayName(self):
- return self.trUtf8('Logger')
-
- def viewIcon(self):
- return QtGui.QIcon()
-
- def viewName(self):
- return self.objectName()
-
- #########################################
- ## overwritten events
- #########################################
- def loggerContextMenuEvent(self, event):
- """customize context menu of the logger QTextEdit"""
- ed = self.controlById(self.IdEdLogger)
- menu = ed.createStandardContextMenu()
- self.populateMenu(menu)
- menu.exec_(event.globalPos())
-
-
- def hideEvent(self, event):
- self.fcGlobalFeedback.setVisible(False)
-
-
- def showEvent(self, event):
- self.fcGlobalFeedback.setVisible(True)
- if self._isCreated:
- return
- self._isCreated = True
-
- #########################################
- ## event onrs
- #########################################
- def onActionLoggerClear(self, action):
- self.controlById(self.IdEdLogger).clear()
-
-
- def onGroupVerbosityTriggered(self, action):
- nameVerbosity = action.objectName()[len(self.fcActions.PrefixVerbosity):]
- self.fcSettings.setValues(Verbosity=nameVerbosity)
- logging.getLogger().setLevel(action.userData())
-
-
- def onLoggerTextChanged(self):
- ed = self.controlById(self.IdEdLogger)
- self.fcActions['ActionLoggerClear'].setEnabled(not ed.document().isEmpty())
-
-#**********************************************************************************
-#
-#**********************************************************************************
-if __name__ == '__main__':
- import sys
- from . import Ui_ViewLogger
-
- app = QtGui.QApplication(sys.argv)
- w = ViewLoggerWidget(None)
-
- w.show()
- res = app.exec_()
- sys.exit(res)
-
-
-
Modified: trunk/fclient/src/fclient/impl/ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 11:36:07 UTC (rev 771)
+++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 11:37:58 UTC (rev 772)
@@ -295,7 +295,7 @@
#**********************************************************************************
if __name__ == '__main__':
import sys
- from . import View, Ui_ViewLogger
+ from . import View, ViewLogger
app = QtGui.QApplication(sys.argv)
w = Ui_View.ViewWidget(None)
Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 11:36:07 UTC (rev 771)
+++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 11:37:58 UTC (rev 772)
@@ -255,7 +255,7 @@
import sys
from . import View
from . import ViewConnection
- from . import Ui_ViewLogger
+ from . import ViewLogger
from . import MainWindow
app = QtGui.QApplication(sys.argv)
@@ -269,7 +269,7 @@
Ui_ViewConnection.ViewConnectionWidget(None),
ViewDownloadsWidget(None),
)
- viewWidget.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None))
+ viewWidget.addBottomViews(ViewLogger.ViewLoggerWidget(None))
mainWindow.show()
res = app.exec_()
Added: trunk/fclient/src/fclient/impl/ViewLogger.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewLogger.py (rev 0)
+++ trunk/fclient/src/fclient/impl/ViewLogger.py 2008-07-27 11:37:58 UTC (rev 772)
@@ -0,0 +1,276 @@
+
+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 sys
+import logging
+
+from PyQt4 import QtCore, QtGui
+
+from . import config
+from .lib import fcp2
+
+from .tpls.Ui_ViewLoggerWidgetTpl import Ui_ViewLoggerWidget
+#**********************************************************************************
+#
+#**********************************************************************************
+class Actions(config.ActionsBase):
+
+ PrefixVerbosity = 'ActionVerbosity'
+
+ def __init__(self, parent):
+ config.ActionsBase.__init__(self, parent)
+
+ # for ease of use verbosities are mapped to verbosity actions like this: PrefixVerbosity + Verbosity
+ self.action(
+ name='ActionLoggerClear',
+ text=self.trUtf8('C&lear'),
+ trigger=parent.onActionLoggerClear,
+ )
+
+ groupVerbosity = self.group(
+ name='GroupVerbosity',
+ trigger=parent.onGroupVerbosityTriggered,
+ isExclusive=True,
+ )
+ self.action(
+ name='ActionVerbosityInfo',
+ text=self.trUtf8('Info'),
+ group=groupVerbosity,
+ trigger=None,
+ isCheckable=True,
+ userData=fcp2.ConstDebugVerbosity.Info,
+ )
+ self.action(
+ name='ActionVerbosityMessage',
+ text=self.trUtf8('Message'),
+ group=groupVerbosity,
+ trigger=None,
+ isCheckable=True,
+ userData=fcp2.ConstDebugVerbosity.Message,
+ )
+ self.action(
+ name='ActionVerbosityDebug',
+ text=self.trUtf8('Debug'),
+ group=groupVerbosity,
+ trigger=None,
+ isCheckable=True,
+ userData=fcp2.ConstDebugVerbosity.Debug,
+ )
+ self.action(
+ name='ActionVerbosityChatty',
+ text=self.trUtf8('Chatty'),
+ group=groupVerbosity,
+ trigger=None,
+ isCheckable=True,
+ userData=fcp2.ConstDebugVerbosity.Chatty,
+ )
+
+
+class GlobalFeedback(config.GlobalFeedbackBase):
+ """wrapper for global statusbar widgets, menus"""
+
+ def __init__(self, parent, idGlobalFeedback):
+ config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback)
+
+ # menus
+ self.menus = []
+ if self.menuBar is not None and hasattr(parent, 'fcViewObject'):
+ menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar)
+ parent.populateMenu(menu)
+ self.menus.append(menu)
+ self.menuBar.addViewMenu(menu)
+
+ # status bar widgets
+ self.label1 = None
+ #if self.statusBar is not None:
+ # self.label1 = QtGui.QLabel('foo here', self.statusBar)
+
+ def setVisible(self, flag):
+ for menu in self.menus:
+ menu.children()[0].setVisible(flag)
+ if self.label1 is not None:
+ self.label1.setVisible(flag)
+
+
+class Settings(config.SettingsBase):
+
+ PrefixVerbosityColorFg = 'ColorFgVerbosity'
+
+ _key_ = config.IdViewLoggerWidget
+ _settings_ = (
+ ('MaxLines', 'UInt', 1000, config.SettingScopeUser),
+ ('Verbosity', 'PyString', 'Info', config.SettingScopePrivate),
+
+ #TODO: Chatty does not seem to work. check in fcp2.client
+ ('ColorFgVerbosityCRITICAL', 'QColor', QtGui.QColor('red'), config.SettingScopeUser),
+ ('ColorFgVerbosityERROR', 'QColor', QtGui.QColor('red'), config.SettingScopeUser),
+ ('ColorFgVerbosityWARNING', 'QColor', QtGui.QColor('red'), config.SettingScopeUser),
+ ('ColorFgVerbosityINFO', 'QColor', QtGui.QColor('black'), config.SettingScopeUser),
+ ('ColorFgVerbosityMESSAGE', 'QColor', QtGui.QColor('blue'), config.SettingScopeUser),
+ ('ColorFgVerbosityDEBUG', 'QColor', QtGui.QColor('slategray'), config.SettingScopeUser),
+ ('ColorFgVerbosityCHATTY', 'QColor', QtGui.QColor('lightslategray'), config.SettingScopeUser),
+ )
+
+
+class LoggerViewObject(config.ViewObject):
+
+ def __init__(self, parent):
+ config.ViewObject. __init__(self, parent)
+
+ self.name=parent.objectName()
+ self.displayName=self.trUtf8('Logger')
+ self.icon=QtGui.QIcon()
+
+
+#***********************************************************************
+#
+#***********************************************************************
+class MyLoggingHandler(logging.Handler):
+
+ def __init__(self, cb, *args, **kwargs):
+ logging.Handler.__init__(self, *args, **kwargs)
+ self.cb = cb
+
+ def emit(self, record):
+ self.cb(record)
+
+#***********************************************************************
+#
+#***********************************************************************
+class ViewLoggerWidget(QtGui.QWidget, Ui_ViewLoggerWidget):
+
+ IdEdLogger = 'edLogger'
+
+
+ def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
+ QtGui.QWidget.__init__(self, parent)
+ self._isCreated = False
+ self._mainWindowMenus = {} #TODO: wrap along with toolbars to a handy class MainWindowStuff
+
+ self.setupUi(self)
+ config.ObjectRegistry.register(self)
+
+ self.fcActions = Actions(self)
+ self.fcSettings = Settings(self).restore()
+ self.fcViewObject = LoggerViewObject(self)
+ self.fcGlobalFeedback = GlobalFeedback(self, idGlobalFeedback)
+
+
+ # setup editbox
+ #NOTE: do not move to showEvent(). we want to be up and alive as soon as possible to catch logs
+ ed = self.controlById(self.IdEdLogger)
+ ed.document().setMaximumBlockCount(self.fcSettings.value('MaxLines'))
+ ed.contextMenuEvent = self.loggerContextMenuEvent
+ self.connect(ed, QtCore.SIGNAL('textChanged()'), self.onLoggerTextChanged)
+
+ # setup logger
+ self.loggingHandler = MyLoggingHandler(self.addRecord)
+ logging.getLogger('').addHandler(self.loggingHandler)
+
+ # setup actions
+ verbosity = self.fcSettings.value('Verbosity').title()
+ action = self.fcActions.get(self.fcActions.PrefixVerbosity + verbosity, None)
+ if action is None:
+ verbosity = self.fcSettings.restoreDefaults('Verbosity')['Verbosity']
+ action = self.fcActions.get(self.fcActions.PrefixVerbosity + verbosity, None)
+ if action is None:
+ raise ValueError('default verbosity action "%s" not found. WTF?' % self.actions.PrefixVerbosity + verbosity)
+ action.trigger()
+
+ #########################################
+ ## methods
+ #########################################
+ def addRecord(self, record):
+ """adds a logging record"""
+
+ ed = self.controlById(self.IdEdLogger)
+ fmt = ed.currentCharFormat()
+ colorFg = self.fcSettings.value(self.fcSettings.PrefixVerbosityColorFg + record.levelname)
+ fmt.setForeground(QtGui.QBrush(colorFg))
+ ed.setCurrentCharFormat(fmt)
+
+ text = '%s:%s:%s' % (record.levelname, record.name, record.getMessage())
+ ed.appendPlainText(text)
+
+
+ def controlById(self, idControl):
+ return getattr(self, idControl)
+
+
+ def populateMenu(self, menu):
+ menu.addAction(self.fcActions['ActionLoggerClear'])
+ subMenu = menu.addMenu(self.trUtf8('Verbosity'))
+ subMenu.addActions(self.fcActions['GroupVerbosity'].actions())
+ return menu
+
+ #########################################
+ ##view methods
+ #########################################
+ def viewClose(self):
+ pass
+
+ def viewDisplayName(self):
+ return self.trUtf8('Logger')
+
+ def viewIcon(self):
+ return QtGui.QIcon()
+
+ def viewName(self):
+ return self.objectName()
+
+ #########################################
+ ## overwritten events
+ #########################################
+ def loggerContextMenuEvent(self, event):
+ """customize context menu of the logger QTextEdit"""
+ ed = self.controlById(self.IdEdLogger)
+ menu = ed.createStandardContextMenu()
+ self.populateMenu(menu)
+ menu.exec_(event.globalPos())
+
+
+ def hideEvent(self, event):
+ self.fcGlobalFeedback.setVisible(False)
+
+
+ def showEvent(self, event):
+ self.fcGlobalFeedback.setVisible(True)
+ if self._isCreated:
+ return
+ self._isCreated = True
+
+ #########################################
+ ## event onrs
+ #########################################
+ def onActionLoggerClear(self, action):
+ self.controlById(self.IdEdLogger).clear()
+
+
+ def onGroupVerbosityTriggered(self, action):
+ nameVerbosity = action.objectName()[len(self.fcActions.PrefixVerbosity):]
+ self.fcSettings.setValues(Verbosity=nameVerbosity)
+ logging.getLogger().setLevel(action.userData())
+
+
+ def onLoggerTextChanged(self):
+ ed = self.controlById(self.IdEdLogger)
+ self.fcActions['ActionLoggerClear'].setEnabled(not ed.document().isEmpty())
+
+#**********************************************************************************
+#
+#**********************************************************************************
+if __name__ == '__main__':
+ import sys
+ from . import Ui_ViewLogger
+
+ app = QtGui.QApplication(sys.argv)
+ w = ViewLoggerWidget(None)
+
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-27 11:35:59
|
Revision: 771
http://fclient.svn.sourceforge.net/fclient/?rev=771&view=rev
Author: jUrner
Date: 2008-07-27 11:36:07 +0000 (Sun, 27 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/fclient.py
trunk/fclient/src/fclient/impl/ViewBrowser.py
Added Paths:
-----------
trunk/fclient/src/fclient/impl/ViewDownloads.py
Removed Paths:
-------------
trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py
Modified: trunk/fclient/src/fclient/fclient.py
===================================================================
--- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:34:40 UTC (rev 770)
+++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:36:07 UTC (rev 771)
@@ -10,7 +10,7 @@
from .impl.View import ViewWidget
from .impl.ViewBrowser import ViewBrowserWidget
from .impl.ViewConnection import ViewConnectionWidget
-from .impl.Ui_ViewDownloads import ViewDownloadsWidget
+from .impl.ViewDownloads import ViewDownloadsWidget
from .impl.Ui_ViewLogger import ViewLoggerWidget
#*************************************************************
#
Deleted: trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py
===================================================================
--- trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:34:40 UTC (rev 770)
+++ trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:36:07 UTC (rev 771)
@@ -1,276 +0,0 @@
-""""""
-
-#**************************************************************************************************************
-#TODO:
-#
-# x. prtty tricky to get dls right when the node or client may disconnect unexpectedly
-# problem: dls that we send and that have not reached the node
-# problem: what to do when the user wants to quit and we still have dls to push to the node
-#
-# solution would require keeping track of all requests
-# a. keep identifiers of requests that reached the node (have to do it anyways)
-# b. keep track of requests ahead of sending them to the node (feels not too good doubeling downloads.dat.gz)
-#
-# best idea seems to be to ignore the problem
-# 1. wait till (if ever) freenet devels fdrop node keeping track of client requests
-#
-# 2. a box thrown to the user (x. do not show this message again) to inform him about pendings
-# should be enough. maybe along with a separate widget or some separate color code for pendings
-#
-# x. performance
-# start with a standard model and improve it over time. no need to set any hard
-# limits. the user will find out by himself how many dls his machine can handle.
-# have to be carefrul though when adding dls, like from a *.frdx to provide appropriate
-# warnings
-#**************************************************************************************************************
-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 import fcp2
-
-from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget
-#**********************************************************************************
-#
-#**********************************************************************************
-class DownloadsViewObject(config.ViewObject):
-
- def __init__(self, parent):
- config.ViewObject. __init__(self, parent)
-
- self.name=parent.objectName()
- self.displayName=self.trUtf8('Downloads')
- self.icon=QtGui.QIcon()
-
-#**********************************************************************************
-#
-#**********************************************************************************
-# from: network/torrent/mainwindow.cpp
-# TorrentViewDelegate is used to draw the progress bars.
-class DownloadTreeDelegate(QtGui.QItemDelegate):
-
- def __init__(self, parent):
- QtGui.QItemDelegate.__init__(self, parent)
-
- def paint(self, painter, option, index):
- if index.column() != self.parent().HeaderIndexProgress:
- return QtGui.QItemDelegate.paint(self, painter, option, index)
-
- application = QtGui.QApplication.instance()
- fcpRequest = self.parent().fcRequests.itemFromIndex(index.row()).fcpRequest
- progress = fcpRequest['ProgressSucceeeded']
- required = fcpRequest['ProgressRequired']
-
- # Set up a QprogressbarOptionProgressBar to precisely mimic the
- # environment of a progress bar.
- progressBarOption = QtGui.QStyleOptionProgressBar()
- progressBarOption.state = QtGui.QStyle.State_Enabled
- progressBarOption.direction = application.layoutDirection()
- progressBarOption.rect = option.rect
- progressBarOption.fontMetrics = application.fontMetrics()
- progressBarOption.minimum = 0
- progressBarOption.maximum = fcpRequest['ProgressRequired']
- progressBarOption.textAlignment = QtCore.Qt.AlignCenter
- progressBarOption.textVisible = True
-
- # Set the progress and text values of the style option.
- progressBarOption.progress = progress
- if required:
- progressBarOption.text = '%s%%' % round(progress * 100 / required, 2)
- else:
- progressBarOption.text = '0%'
-
- # Draw the progress bar onto the view.
- application.style().drawControl(QtGui.QStyle.CE_ProgressBar, progressBarOption, painter)
-
-#**********************************************************************************
-#
-#**********************************************************************************
-class TreeItem(QtGui.QTreeWidgetItem):
-
- def __init__(self, fcpIdentifier, *params):
- QtGui.QTreeWidgetItem.__init__(self, *params)
- self.fcpIdentifier = fcpIdentifier
-
-
-#**********************************************************************************
-#
-#**********************************************************************************
-class Requests(object):
-
- def __init__(self):
- self.identifiers = []
- self.items = []
-
- def addRequest(self, identifier, item):
- self.identifiers.append(identifier)
- self.items.append(item)
-
- def itemFromIndex(self, index):
- return self.items[index]
-
-
-class ViewDownloadsWidget(QtGui.QWidget, Ui_ViewDownloadsWidget):
-
- IdTree = 'tree'
-
-
- HeaderIndexName = 0
- HeaderIndexFoo = 1
- HeaderIndexProgress = 2
-
- def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
- QtGui.QWidget.__init__(self, parent)
- self._isCreated = False
-
- self.setupUi(self)
- config.ObjectRegistry.register(self)
-
- self.fcViewObject = DownloadsViewObject(self)
- self.fcpEvents = (
- (config.fcpClient.events.ConfigData, self.onFcpConfigData),
- (config.fcpClient.events.RequestCompleted, self.onFcpRequestCompleted),
- (config.fcpClient.events.RequestFailed, self.onFcpRequestFailed),
- (config.fcpClient.events.RequestModified, self.onFcpRequestModified),
- (config.fcpClient.events.RequestProgress, self.onFcpRequestProgress),
- (config.fcpClient.events.RequestStarted, self.onFcpRequestStarted),
- )
- config.fcpClient.events += self.fcpEvents
- self.fcHeadeLabels = {}
- self.fcpRequests = {}
-
- #XXX
- self.foo = False
-
-
- def retranslateUi(self, parent):
- self.fcHeadeLabels = {
- self.HeaderIndexName: self.trUtf8('Name'),
- self.HeaderIndexFoo: self.trUtf8('Foo'),
- self.HeaderIndexProgress: self.trUtf8('Progress'),
- }
- self.tree.setHeaderLabels([i[1] for i in sorted(self.fcHeadeLabels.items())])
-
-
- def closeEvent(self):
- self.viewClose()
-
-
- def viewClose(self):
- config.fcpClient.events -= self.fcpEvents
-
-
- def downloadFile(self, fcpKey, fileName, **kws):
- """"""
- fileName = unicode(fileName)
- fcpIdentifier = config.fcpClient.getFile(fcpKey, fileName, **kws)
- item= TreeItem(fcpIdentifier, self.tree)
-
- item.setData(
- self.HeaderIndexName,
- QtCore.Qt.DisplayRole,
- QtCore.QVariant(os.path.basename(fileName))
- )
-
- progressBar = QtGui.QProgressBar(self)
- progressBar.setRange(0, 0)
- self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar)
- self.fcpRequests[fcpIdentifier] = item
-
-
- #########################################
- ## methods
- #########################################
- def controlById(idGlobalFeedback, idControl):
- return getattr(idGlobalFeedback, idControl)
-
- #########################################
- ## fcp event handlers
- #########################################
- def onFcpConfigData(self, fcpEvent, fcpRequest):
- if not self.foo:
- self.foo = True
-
- return
- # for testing: dl some frost.zip
- key = fcp2.Key('CHK@tJ0qyIr8dwvYKoSkmR1N-soABstL0RjgiYqQm3Gtv8g,Pqj7jpPUBzRgnVTaA3fEw6gE8QHcJsTwA4liL9FZ-Fg,AAIC--8/frost-04-Mar-2008.zip')
- fileName = config.guessFileNameFromKey(key, default=self.trUtf8('Unknown.file'))
- directory = config.settings.value('DownloadDir')
- fpath = os.path.join(unicode(directory), unicode(fileName))
- self.downloadFile(key, fpath)
-
-
- def onFcpRequestCompleted(self, fcpEvent, fcpRequest):
- item = self.fcpRequests.get(fcpRequest['Identifier'], None)
- if item is not None:
- progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress)
- progressBar.setValue(progressBar.maximum())
-
- def onFcpRequestFailed(self, fcpEvent, fcpRequest):
- pass
-
-
- #TODO: not tested
- def onFcpRequestModified(self, fcpEvent, fcpRequest):
- if fcp2.ConstRequestModified.Identifier in fcpRequest['Modified']:
- newFcpIdentifier = fcpRequest['Identifier']
- oldFcpIdentifier = fcpRequest['Modified'][fcp2.ConstRequestModified.Identifier]
- item = self.fcpRequests.get(oldFcpIdentifier, None)
- if item is not None:
- del self.fcpRequests[oldFcpIdentifier]
- self.fcpRequests[newFcpIdentifier] = item
- item.fcpIdentifier = newFcpIdentifier
-
- if fcp2.ConstRequestModified.Filename in fcpRequest['Modified']:
- item = self.fcpRequests.get(fcpRequest['Identifier'], None)
- if item is not None:
- item.setData(
- self.HeaderIndexName,
- QtCore.Qt.DisplayRole,
- QtCore.QVariant(os.path.basename(fcpRequest['Filename']))
- )
-
-
- def onFcpRequestProgress(self, fcpEvent, fcpRequest):
- item = self.fcpRequests.get(fcpRequest['Identifier'], None)
- if item is not None:
- progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress)
-
- progressBar.setRange(0, fcpRequest['ProgressRequired'])
- progressBar.setValue(fcpRequest['ProgressSucceeded'])
-
-
- def onFcpRequestStarted(self, fcpEvent, fcpRequest):
- pass
-
-
-#**********************************************************************************
-#
-#**********************************************************************************
-if __name__ == '__main__':
- import sys
- from . import View
- from . import ViewConnection
- from . import Ui_ViewLogger
- from . import MainWindow
-
- app = QtGui.QApplication(sys.argv)
-
- mainWindow = Ui_MainWindow.MainWindow()
- viewWidget = Ui_View.ViewWidget(mainWindow)
- mainWindow.setCentralWidget(viewWidget)
-
-
- viewWidget.addTopViews(
- Ui_ViewConnection.ViewConnectionWidget(None),
- ViewDownloadsWidget(None),
- )
- viewWidget.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None))
-
- mainWindow.show()
- res = app.exec_()
- sys.exit(res)
\ No newline at end of file
Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:34:40 UTC (rev 770)
+++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:36:07 UTC (rev 771)
@@ -978,7 +978,7 @@
from .MainWindow import MainWindow
from .View import ViewWidget
from .ViewConnection import ViewConnectionWidget
- from .Ui_ViewDownloads import ViewDownloadsWidget
+ from .ViewDownloads import ViewDownloadsWidget
app = QtGui.QApplication(sys.argv)
Added: trunk/fclient/src/fclient/impl/ViewDownloads.py
===================================================================
--- trunk/fclient/src/fclient/impl/ViewDownloads.py (rev 0)
+++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-27 11:36:07 UTC (rev 771)
@@ -0,0 +1,276 @@
+""""""
+
+#**************************************************************************************************************
+#TODO:
+#
+# x. prtty tricky to get dls right when the node or client may disconnect unexpectedly
+# problem: dls that we send and that have not reached the node
+# problem: what to do when the user wants to quit and we still have dls to push to the node
+#
+# solution would require keeping track of all requests
+# a. keep identifiers of requests that reached the node (have to do it anyways)
+# b. keep track of requests ahead of sending them to the node (feels not too good doubeling downloads.dat.gz)
+#
+# best idea seems to be to ignore the problem
+# 1. wait till (if ever) freenet devels fdrop node keeping track of client requests
+#
+# 2. a box thrown to the user (x. do not show this message again) to inform him about pendings
+# should be enough. maybe along with a separate widget or some separate color code for pendings
+#
+# x. performance
+# start with a standard model and improve it over time. no need to set any hard
+# limits. the user will find out by himself how many dls his machine can handle.
+# have to be carefrul though when adding dls, like from a *.frdx to provide appropriate
+# warnings
+#**************************************************************************************************************
+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 import fcp2
+
+from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget
+#**********************************************************************************
+#
+#**********************************************************************************
+class DownloadsViewObject(config.ViewObject):
+
+ def __init__(self, parent):
+ config.ViewObject. __init__(self, parent)
+
+ self.name=parent.objectName()
+ self.displayName=self.trUtf8('Downloads')
+ self.icon=QtGui.QIcon()
+
+#**********************************************************************************
+#
+#**********************************************************************************
+# from: network/torrent/mainwindow.cpp
+# TorrentViewDelegate is used to draw the progress bars.
+class DownloadTreeDelegate(QtGui.QItemDelegate):
+
+ def __init__(self, parent):
+ QtGui.QItemDelegate.__init__(self, parent)
+
+ def paint(self, painter, option, index):
+ if index.column() != self.parent().HeaderIndexProgress:
+ return QtGui.QItemDelegate.paint(self, painter, option, index)
+
+ application = QtGui.QApplication.instance()
+ fcpRequest = self.parent().fcRequests.itemFromIndex(index.row()).fcpRequest
+ progress = fcpRequest['ProgressSucceeeded']
+ required = fcpRequest['ProgressRequired']
+
+ # Set up a QprogressbarOptionProgressBar to precisely mimic the
+ # environment of a progress bar.
+ progressBarOption = QtGui.QStyleOptionProgressBar()
+ progressBarOption.state = QtGui.QStyle.State_Enabled
+ progressBarOption.direction = application.layoutDirection()
+ progressBarOption.rect = option.rect
+ progressBarOption.fontMetrics = application.fontMetrics()
+ progressBarOption.minimum = 0
+ progressBarOption.maximum = fcpRequest['ProgressRequired']
+ progressBarOption.textAlignment = QtCore.Qt.AlignCenter
+ progressBarOption.textVisible = True
+
+ # Set the progress and text values of the style option.
+ progressBarOption.progress = progress
+ if required:
+ progressBarOption.text = '%s%%' % round(progress * 100 / required, 2)
+ else:
+ progressBarOption.text = '0%'
+
+ # Draw the progress bar onto the view.
+ application.style().drawControl(QtGui.QStyle.CE_ProgressBar, progressBarOption, painter)
+
+#**********************************************************************************
+#
+#**********************************************************************************
+class TreeItem(QtGui.QTreeWidgetItem):
+
+ def __init__(self, fcpIdentifier, *params):
+ QtGui.QTreeWidgetItem.__init__(self, *params)
+ self.fcpIdentifier = fcpIdentifier
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
+class Requests(object):
+
+ def __init__(self):
+ self.identifiers = []
+ self.items = []
+
+ def addRequest(self, identifier, item):
+ self.identifiers.append(identifier)
+ self.items.append(item)
+
+ def itemFromIndex(self, index):
+ return self.items[index]
+
+
+class ViewDownloadsWidget(QtGui.QWidget, Ui_ViewDownloadsWidget):
+
+ IdTree = 'tree'
+
+
+ HeaderIndexName = 0
+ HeaderIndexFoo = 1
+ HeaderIndexProgress = 2
+
+ def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
+ QtGui.QWidget.__init__(self, parent)
+ self._isCreated = False
+
+ self.setupUi(self)
+ config.ObjectRegistry.register(self)
+
+ self.fcViewObject = DownloadsViewObject(self)
+ self.fcpEvents = (
+ (config.fcpClient.events.ConfigData, self.onFcpConfigData),
+ (config.fcpClient.events.RequestCompleted, self.onFcpRequestCompleted),
+ (config.fcpClient.events.RequestFailed, self.onFcpRequestFailed),
+ (config.fcpClient.events.RequestModified, self.onFcpRequestModified),
+ (config.fcpClient.events.RequestProgress, self.onFcpRequestProgress),
+ (config.fcpClient.events.RequestStarted, self.onFcpRequestStarted),
+ )
+ config.fcpClient.events += self.fcpEvents
+ self.fcHeadeLabels = {}
+ self.fcpRequests = {}
+
+ #XXX
+ self.foo = False
+
+
+ def retranslateUi(self, parent):
+ self.fcHeadeLabels = {
+ self.HeaderIndexName: self.trUtf8('Name'),
+ self.HeaderIndexFoo: self.trUtf8('Foo'),
+ self.HeaderIndexProgress: self.trUtf8('Progress'),
+ }
+ self.tree.setHeaderLabels([i[1] for i in sorted(self.fcHeadeLabels.items())])
+
+
+ def closeEvent(self):
+ self.viewClose()
+
+
+ def viewClose(self):
+ config.fcpClient.events -= self.fcpEvents
+
+
+ def downloadFile(self, fcpKey, fileName, **kws):
+ """"""
+ fileName = unicode(fileName)
+ fcpIdentifier = config.fcpClient.getFile(fcpKey, fileName, **kws)
+ item= TreeItem(fcpIdentifier, self.tree)
+
+ item.setData(
+ self.HeaderIndexName,
+ QtCore.Qt.DisplayRole,
+ QtCore.QVariant(os.path.basename(fileName))
+ )
+
+ progressBar = QtGui.QProgressBar(self)
+ progressBar.setRange(0, 0)
+ self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar)
+ self.fcpRequests[fcpIdentifier] = item
+
+
+ #########################################
+ ## methods
+ #########################################
+ def controlById(idGlobalFeedback, idControl):
+ return getattr(idGlobalFeedback, idControl)
+
+ #########################################
+ ## fcp event handlers
+ #########################################
+ def onFcpConfigData(self, fcpEvent, fcpRequest):
+ if not self.foo:
+ self.foo = True
+
+ return
+ # for testing: dl some frost.zip
+ key = fcp2.Key('CHK@tJ0qyIr8dwvYKoSkmR1N-soABstL0RjgiYqQm3Gtv8g,Pqj7jpPUBzRgnVTaA3fEw6gE8QHcJsTwA4liL9FZ-Fg,AAIC--8/frost-04-Mar-2008.zip')
+ fileName = config.guessFileNameFromKey(key, default=self.trUtf8('Unknown.file'))
+ directory = config.settings.value('DownloadDir')
+ fpath = os.path.join(unicode(directory), unicode(fileName))
+ self.downloadFile(key, fpath)
+
+
+ def onFcpRequestCompleted(self, fcpEvent, fcpRequest):
+ item = self.fcpRequests.get(fcpRequest['Identifier'], None)
+ if item is not None:
+ progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress)
+ progressBar.setValue(progressBar.maximum())
+
+ def onFcpRequestFailed(self, fcpEvent, fcpRequest):
+ pass
+
+
+ #TODO: not tested
+ def onFcpRequestModified(self, fcpEvent, fcpRequest):
+ if fcp2.ConstRequestModified.Identifier in fcpRequest['Modified']:
+ newFcpIdentifier = fcpRequest['Identifier']
+ oldFcpIdentifier = fcpRequest['Modified'][fcp2.ConstRequestModified.Identifier]
+ item = self.fcpRequests.get(oldFcpIdentifier, None)
+ if item is not None:
+ del self.fcpRequests[oldFcpIdentifier]
+ self.fcpRequests[newFcpIdentifier] = item
+ item.fcpIdentifier = newFcpIdentifier
+
+ if fcp2.ConstRequestModified.Filename in fcpRequest['Modified']:
+ item = self.fcpRequests.get(fcpRequest['Identifier'], None)
+ if item is not None:
+ item.setData(
+ self.HeaderIndexName,
+ QtCore.Qt.DisplayRole,
+ QtCore.QVariant(os.path.basename(fcpRequest['Filename']))
+ )
+
+
+ def onFcpRequestProgress(self, fcpEvent, fcpRequest):
+ item = self.fcpRequests.get(fcpRequest['Identifier'], None)
+ if item is not None:
+ progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress)
+
+ progressBar.setRange(0, fcpRequest['ProgressRequired'])
+ progressBar.setValue(fcpRequest['ProgressSucceeded'])
+
+
+ def onFcpRequestStarted(self, fcpEvent, fcpRequest):
+ pass
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
+if __name__ == '__main__':
+ import sys
+ from . import View
+ from . import ViewConnection
+ from . import Ui_ViewLogger
+ from . import MainWindow
+
+ app = QtGui.QApplication(sys.argv)
+
+ mainWindow = Ui_MainWindow.MainWindow()
+ viewWidget = Ui_View.ViewWidget(mainWindow)
+ mainWindow.setCentralWidget(viewWidget)
+
+
+ viewWidget.addTopViews(
+ Ui_ViewConnection.ViewConnectionWidget(None),
+ ViewDownloadsWidget(None),
+ )
+ viewWidget.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None))
+
+ mainWindow.show()
+ res = app.exec_()
+ sys.exit(res)
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|