fclient-commit Mailing List for fclient (Page 7)
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-30 22:12:42
|
Revision: 820 http://fclient.svn.sourceforge.net/fclient/?rev=820&view=rev Author: jUrner Date: 2008-07-30 22:12:50 +0000 (Wed, 30 Jul 2008) Log Message: ----------- add support for css Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-30 10:49:43 UTC (rev 819) +++ trunk/fclient/src/fclient/fclient.py 2008-07-30 22:12:50 UTC (rev 820) @@ -30,9 +30,18 @@ ##self.userData.activateWindow() pass - def main(): + # parse commandline options + userHasStyleSheet = False + for arg in sys.argv: + arg = arg.lower() + if arg.startswith('-stylesheet=') or arg.startswith('-stylesheet '): + userHasStyleSheet = True + if not userHasStyleSheet: # use our own + sys.argv.append('-stylesheet=%s' % config.FcDefaultStyleSheet) + + # start single application server singleApp = SingleApp( host=config.fcSettings.value('SingleAppHost'), port=config.fcSettings.value('SingleAppPort'), @@ -51,6 +60,7 @@ dlg.exec_() else: + # start gui app = QtGui.QApplication(sys.argv) mainWindow = MainWindow() singleApp.userData = mainWindow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-30 10:49:35
|
Revision: 819 http://fclient.svn.sourceforge.net/fclient/?rev=819&view=rev Author: jUrner Date: 2008-07-30 10:49:43 +0000 (Wed, 30 Jul 2008) Log Message: ----------- add single application ckeck on startup ++ error dlg ++ prefs page Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py trunk/fclient/src/fclient/impl/Prefs.py trunk/fclient/src/fclient/impl/config.py Added Paths: ----------- trunk/fclient/src/fclient/impl/DlgSingleAppError.py trunk/fclient/src/fclient/impl/PrefsSingleApp.py trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-30 10:47:21 UTC (rev 818) +++ trunk/fclient/src/fclient/fclient.py 2008-07-30 10:49:43 UTC (rev 819) @@ -6,33 +6,67 @@ import sys from PyQt4 import QtGui +from .impl import config +from .impl.lib.qt4ex import singleapp + from .impl.MainWindow import MainWindow from .impl.View import ViewWidget from .impl.ViewBrowser import ViewBrowserWidget from .impl.ViewConnection import ViewConnectionWidget from .impl.ViewDownloads import ViewDownloadsWidget from .impl.ViewLogger import ViewLoggerWidget + +from .impl.DlgSingleAppError import DlgSingleAppError #************************************************************* # #************************************************************* +class SingleApp(singleapp.SingleApp): + + def onOtherAppIsStarting(self): + #TODO: looks like no way to bring the window to the foreground + # the calls do not work on x11. may work on windows though + # + ##QtGui.QApplication.instance().setActiveWindow(self.userData) + ##self.userData.activateWindow() + pass + + def main(): - app = QtGui.QApplication(sys.argv) - mainWindow = MainWindow() - viewWidget = ViewWidget(mainWindow) - mainWindow.setCentralWidget(viewWidget) - - viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) - viewWidget.addTopViews( - ViewConnectionWidget(mainWindow), - ViewBrowserWidget(mainWindow), - ViewDownloadsWidget(mainWindow), - ) - - - mainWindow.show() - res = app.exec_() - sys.exit(res) + singleApp = SingleApp( + host=config.fcSettings.value('SingleAppHost'), + port=config.fcSettings.value('SingleAppPort'), + magicToSend='{80a21244-c2ff-4afd-b8a2-c3b93b99332f}', + magicToRespond='{2e86f6f1-0707-415d-bfe6-6d485603a98c}' + ) + try: + singleApp.start() + except singleapp.ErrorOtherAppIsRunning: + print 'looks like another %s application is already running' % config.FcAppName + print 'exit' + sys.exit(5) + except singleapp.ErrorCanNotConnect: + app = QtGui.QApplication(sys.argv) + dlg = DlgSingleAppError() + dlg.exec_() + + else: + app = QtGui.QApplication(sys.argv) + mainWindow = MainWindow() + singleApp.userData = mainWindow + + viewWidget = ViewWidget(mainWindow) + mainWindow.setCentralWidget(viewWidget) + viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) + viewWidget.addTopViews( + ViewConnectionWidget(mainWindow), + ViewBrowserWidget(mainWindow), + ViewDownloadsWidget(mainWindow), + ) + + mainWindow.show() + res = app.exec_() + sys.exit(res) #********************************************************************************** # Added: trunk/fclient/src/fclient/impl/DlgSingleAppError.py =================================================================== --- trunk/fclient/src/fclient/impl/DlgSingleAppError.py (rev 0) +++ trunk/fclient/src/fclient/impl/DlgSingleAppError.py 2008-07-30 10:49:43 UTC (rev 819) @@ -0,0 +1,133 @@ +#*************************************************************************************** +#TODO: +# x. error icon +# +#************************************************************************************* + +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_DlgSingleAppErrorTpl import Ui_DlgSingleAppError +#********************************************************************************** +# +#********************************************************************************** +class Settings(config.SettingsBase): + _key_ = 'DlgSingleAppError' + _settings_ = ( + ('Geometry', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), + ('SplitterPos', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), + ) + + +#********************************************************************************** +# +#********************************************************************************** +class DlgSingleAppError(QtGui.QDialog, Ui_DlgSingleAppError): + + IdTextEdit = 'textEdit' + IdEdHost = 'edHost' + IdSpinPort = 'spinPort' + IdSplitter = 'splitter' + + + def __init__(self, parent=None, fcpKey=None): + QtGui.QDialog.__init__(self, parent) + + self.setupUi(self) + self.fcSettings = Settings(self).restore() + + # setup dialog + self.restoreGeometry(self.fcSettings.value('Geometry')) + self.setWindowTitle(config.FcAppName + self.trUtf8(' - Error starting up')) + + + # setup host / port + edHost = self.controlById(self.IdEdHost) + edHost.setText(config.fcSettings.value('SingleAppHost')) + + spinPort = self.controlById(self.IdSpinPort) + spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable + spinPort.setValue(config.fcSettings.value('SingleAppPort')) + + + # setup text edit + ed = self.controlById(self.IdTextEdit) + text = self.trUtf8('<b>%1 could not be started!</b>').arg(config.FcAppName) + ed.insertHtml(text) + ed.insertHtml('<br><br>') + text = self.trUtf8('%1 could not establish a socket connection needed to enshure only one application is running at a time. Possible reasons are:').arg(config.FcAppName) + ed.insertHtml(text) + + text = '''<ol> + <li>%s</li> + <li>%s</li> + + </ol> + ''' % ( + self.trUtf8('Your firewall blocks the connection. Adjust your firewall to allow the connection as shown to the left.'), + self.trUtf8('Another application may already use host and port as shown. Adjust host and port to your needs. In most cases setting port to an arbitrary (high) number should do the job.'), + + ) + ed.insertHtml(text) + cursor = ed.textCursor() + cursor.movePosition(cursor.Start, cursor.MoveAnchor) + ed.setTextCursor(cursor) + + # setup splitter + splitter = self.controlById(self.IdSplitter) + splitter.restoreState(self.fcSettings.value('SplitterPos')) + self.connect(splitter, QtCore.SIGNAL('splitterMoved(int, int)'), self.onSplitterMoved) + + ############################## + ## methods + ############################## + def controlById(self, idControl): + return getattr(self, idControl) + + ############################## + ## overwritten methods + ############################## + def accept(self): + edHost = self.controlById(self.IdEdHost) + spinPort = self.controlById(self.IdSpinPort) + config.fcSettings.setValues( + SingleAppHost=edHost.text(), + SingleAppPort=spinPort.value(), + ) + + + self.done(self.Accepted) + + ############################## + ## overwritten events + ############################## + def hideEvent(self, event): + self.fcSettings.setValues(Geometry=self.saveGeometry()) + + ############################## + ## event handlers + ############################## + def onSplitterMoved(self, pos, index): + splitter = self.controlById(self.IdSplitter) + self.fcSettings.setValues(SplitterPos=splitter.saveState()) + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = DlgSingleAppError() + w.show() + res = app.exec_() + sys.exit(res) + + Modified: trunk/fclient/src/fclient/impl/Prefs.py =================================================================== --- trunk/fclient/src/fclient/impl/Prefs.py 2008-07-30 10:47:21 UTC (rev 818) +++ trunk/fclient/src/fclient/impl/Prefs.py 2008-07-30 10:49:43 UTC (rev 819) @@ -10,6 +10,7 @@ from .PrefsGlobal import PrefsPageGlobal from .PrefsBrowserWidget import PrefsPageBrowser from .PrefsConnectionWidget import PrefsPageConnectionExpertSettings +from .PrefsSingleApp import PrefsPageSingleApp #********************************************************************************** # #********************************************************************************** @@ -55,7 +56,10 @@ pages = PrefsPageRoot()( PrefsPageGlobal(), - PrefsPageConnectionExpertSettings(), + PrefsPageConnectionExpertSettings() + ( + PrefsPageSingleApp(), + ), PrefsPageBrowser(), ) Added: trunk/fclient/src/fclient/impl/PrefsSingleApp.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsSingleApp.py (rev 0) +++ trunk/fclient/src/fclient/impl/PrefsSingleApp.py 2008-07-30 10:49:43 UTC (rev 819) @@ -0,0 +1,104 @@ + + +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/Fc1510172 . 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 .lib.qt4ex.lib import settings + +from .tpls.Ui_PrefsSingleAppTpl import Ui_PrefsSingleApp +#********************************************************************************** +# +#********************************************************************************** +class PrefsSingleApp(QtGui.QWidget, Ui_PrefsSingleApp): + + IdEdHost = 'edHost' + IdSpinPort = 'spinPort' + + def __init__(self, parent=None, page=None): + QtGui.QWidget.__init__(self, parent) + + self.setupUi(self) + + self.fcSettingsControler = settings.SettingsControler(config.fcSettings, parent=self) + if page is not None: + page.connect(self.fcSettingsControler, QtCore.SIGNAL('isDirty(bool)'), page.setDirty) + + self.fcSettingsControler.addLineEdit( + self.controlById(self.IdEdHost), + 'SingleAppHost', + ) + + spinPort = self.controlById(self.IdSpinPort) + spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable + self.fcSettingsControler.addSpinBox( + spinPort, + 'SingleAppPort', + ) + + + def controlById(self, idControl): + return getattr(self, idControl) + + def doApply(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.apply() + return False + + def doRestoreDefaults(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.restoreDefaults() + return False + +#*********************************************************************** +# +#*********************************************************************** +class PrefsPageSingleApp(dlgpreferences.Page): + + UUID = '{9b76279c-46da-4fbe-9c02-a62fc843d6fc}' + + def __init__(self): + dlgpreferences.Page.__init__(self, self.UUID) + self._widget = None + + def displayName(self): + return self.trUtf8('Single application') + + def canApply(self): return True + def canHelp(self): return False + def canRestoreDefaults(self): return True + + def doApply(self): + self._widget.doApply() + return True + + def doRestoreDefaults(self): + self._widget.doRestoreDefaults() + return True + + def setVisible(self, parent, flag): + createdNew = False + if flag and self._widget is None: + createdNew = True + self._widget = PrefsSingleApp(parent=parent, page=self) + self._widget.setVisible(flag) + return (createdNew, self._widget) + +#*********************************************************************** +# +#*********************************************************************** +if __name__ == '__main__': + from PyQt4 import QtGui + import sys + + app = QtGui.QApplication(sys.argv) + w = PrefsSingleApp(None) + w.show() + res = app.exec_() + sys.exit(res) + Modified: trunk/fclient/src/fclient/impl/config.py =================================================================== --- trunk/fclient/src/fclient/impl/config.py 2008-07-30 10:47:21 UTC (rev 818) +++ trunk/fclient/src/fclient/impl/config.py 2008-07-30 10:49:43 UTC (rev 819) @@ -101,6 +101,9 @@ class Settings(SettingsBase): _key_ = 'ConfigSettings' _settings_ = ( + ('SingleAppHost', 'String', QtCore.QString('localhost'), SettingScopeExpert), + ('SingleAppPort', 'UInt', 45663, SettingScopeExpert), + ('SettingsDir', 'String', QtCore.QString(FcSettingsDir), SettingScopeUser), # if not None, settings are stored locally in the app folder ('SettingsAllUsers', 'Bool', False, SettingScopeUser), # store settings for all users? ('IconTheme', 'String', 'crystal', SettingScopeUser), #TODO: global icon theme? Added: trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui 2008-07-30 10:49:43 UTC (rev 819) @@ -0,0 +1,125 @@ +<ui version="4.0" > + <class>DlgSingleAppError</class> + <widget class="QDialog" name="DlgSingleAppError" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>410</width> + <height>277</height> + </rect> + </property> + <property name="windowTitle" > + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <widget class="QSplitter" name="splitter" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <widget class="QTextEdit" name="textEdit" /> + <widget class="QWidget" name="" > + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string><b>Host: </b></string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edHost" /> + </item> + <item> + <widget class="QLabel" name="label_3" > + <property name="text" > + <string><b>Port: </b></string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinPort" /> + </item> + </layout> + </item> + <item> + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </widget> + </item> + <item row="1" column="0" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + <zorder>textEdit</zorder> + <zorder>line</zorder> + <zorder>buttonBox</zorder> + <zorder>textEdit</zorder> + <zorder>textEdit</zorder> + <zorder>splitter</zorder> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>DlgSingleAppError</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>DlgSingleAppError</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/PrefsSingleAppTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-07-30 10:49:43 UTC (rev 819) @@ -0,0 +1,86 @@ +<ui version="4.0" > + <class>PrefsSingleApp</class> + <widget class="QWidget" name="PrefsSingleApp" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>533</width> + <height>399</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" colspan="2" > + <widget class="QLabel" name="label" > + <property name="text" > + <string>The gui uses a socket connection to enshure only one instance is running at a time. Use the boxes below to adjust host and port of the connection to your needs.</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::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item row="1" column="0" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QLabel" name="label_2" > + <property name="text" > + <string><b>Single application host: </b></string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edHost" /> + </item> + <item> + <widget class="QLabel" name="label_3" > + <property name="text" > + <string><b>Single application port: </b></string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinPort" /> + </item> + </layout> + </item> + <item row="1" column="1" > + <spacer name="horizontalSpacer" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>251</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0" > + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>218</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> Added: trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgSingleAppErrorTpl.py 2008-07-30 10:49:43 UTC (rev 819) @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/DlgSingleAppErrorTpl.ui' +# +# Created: Wed Jul 30 11:43:40 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_DlgSingleAppError(object): + def setupUi(self, DlgSingleAppError): + DlgSingleAppError.setObjectName("DlgSingleAppError") + DlgSingleAppError.resize(410, 277) + self.gridLayout = QtGui.QGridLayout(DlgSingleAppError) + self.gridLayout.setObjectName("gridLayout") + self.splitter = QtGui.QSplitter(DlgSingleAppError) + self.splitter.setOrientation(QtCore.Qt.Horizontal) + self.splitter.setObjectName("splitter") + self.textEdit = QtGui.QTextEdit(self.splitter) + self.textEdit.setObjectName("textEdit") + self.widget = QtGui.QWidget(self.splitter) + self.widget.setObjectName("widget") + self.verticalLayout_2 = QtGui.QVBoxLayout(self.widget) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.label = QtGui.QLabel(self.widget) + self.label.setObjectName("label") + self.verticalLayout.addWidget(self.label) + self.edHost = QtGui.QLineEdit(self.widget) + self.edHost.setObjectName("edHost") + self.verticalLayout.addWidget(self.edHost) + self.label_3 = QtGui.QLabel(self.widget) + self.label_3.setObjectName("label_3") + self.verticalLayout.addWidget(self.label_3) + self.spinPort = QtGui.QSpinBox(self.widget) + self.spinPort.setObjectName("spinPort") + self.verticalLayout.addWidget(self.spinPort) + self.verticalLayout_2.addLayout(self.verticalLayout) + spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.verticalLayout_2.addItem(spacerItem) + self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1) + self.line = QtGui.QFrame(DlgSingleAppError) + self.line.setFrameShape(QtGui.QFrame.HLine) + self.line.setFrameShadow(QtGui.QFrame.Sunken) + self.line.setObjectName("line") + self.gridLayout.addWidget(self.line, 1, 0, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(DlgSingleAppError) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 1) + + self.retranslateUi(DlgSingleAppError) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DlgSingleAppError.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), DlgSingleAppError.reject) + QtCore.QMetaObject.connectSlotsByName(DlgSingleAppError) + + def retranslateUi(self, DlgSingleAppError): + DlgSingleAppError.setWindowTitle(QtGui.QApplication.translate("DlgSingleAppError", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("DlgSingleAppError", "<b>Host: </b>", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("DlgSingleAppError", "<b>Port: </b>", None, QtGui.QApplication.UnicodeUTF8)) + + +if __name__ == "__main__": + import sys + app = QtGui.QApplication(sys.argv) + DlgSingleAppError = QtGui.QDialog() + ui = Ui_DlgSingleAppError() + ui.setupUi(DlgSingleAppError) + DlgSingleAppError.show() + sys.exit(app.exec_()) + Added: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py 2008-07-30 10:49:43 UTC (rev 819) @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/PrefsSingleAppTpl.ui' +# +# Created: Wed Jul 30 12:28: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_PrefsSingleApp(object): + def setupUi(self, PrefsSingleApp): + PrefsSingleApp.setObjectName("PrefsSingleApp") + PrefsSingleApp.resize(533, 399) + self.gridLayout = QtGui.QGridLayout(PrefsSingleApp) + self.gridLayout.setObjectName("gridLayout") + self.label = QtGui.QLabel(PrefsSingleApp) + self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label.setWordWrap(True) + self.label.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 2) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.label_2 = QtGui.QLabel(PrefsSingleApp) + self.label_2.setObjectName("label_2") + self.verticalLayout.addWidget(self.label_2) + self.edHost = QtGui.QLineEdit(PrefsSingleApp) + self.edHost.setObjectName("edHost") + self.verticalLayout.addWidget(self.edHost) + self.label_3 = QtGui.QLabel(PrefsSingleApp) + self.label_3.setObjectName("label_3") + self.verticalLayout.addWidget(self.label_3) + self.spinPort = QtGui.QSpinBox(PrefsSingleApp) + self.spinPort.setObjectName("spinPort") + self.verticalLayout.addWidget(self.spinPort) + self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1) + spacerItem = QtGui.QSpacerItem(251, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 1, 1, 1, 1) + spacerItem1 = QtGui.QSpacerItem(20, 218, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout.addItem(spacerItem1, 2, 0, 1, 1) + + self.retranslateUi(PrefsSingleApp) + QtCore.QMetaObject.connectSlotsByName(PrefsSingleApp) + + def retranslateUi(self, PrefsSingleApp): + PrefsSingleApp.setWindowTitle(QtGui.QApplication.translate("PrefsSingleApp", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("PrefsSingleApp", "The gui uses a socket connection to enshure only one instance is running at a time. Use the boxes below to adjust host and port of the connection to your needs.", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("PrefsSingleApp", "<b>Single application host: </b>", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("PrefsSingleApp", "<b>Single application port: </b>", None, QtGui.QApplication.UnicodeUTF8)) + + +if __name__ == "__main__": + import sys + app = QtGui.QApplication(sys.argv) + PrefsSingleApp = QtGui.QWidget() + ui = Ui_PrefsSingleApp() + ui.setupUi(PrefsSingleApp) + PrefsSingleApp.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-30 10:47:12
|
Revision: 818 http://fclient.svn.sourceforge.net/fclient/?rev=818&view=rev Author: jUrner Date: 2008-07-30 10:47:21 +0000 (Wed, 30 Jul 2008) Log Message: ----------- add a module to control single application stuff Added Paths: ----------- trunk/fclient/src/fclient/impl/lib/qt4ex/singleapp.py Added: trunk/fclient/src/fclient/impl/lib/qt4ex/singleapp.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/qt4ex/singleapp.py (rev 0) +++ trunk/fclient/src/fclient/impl/lib/qt4ex/singleapp.py 2008-07-30 10:47:21 UTC (rev 818) @@ -0,0 +1,106 @@ +"""making resonably shure only one appliaction is running at a time""" + + +import socket +import thread +#********************************************************************** +# +#********************************************************************** +class ErrorCanNotConnect(Exception): + """exception raised in cace SignleApp can not connect to the socket or something unexpected happens in the communication""" + +class ErrorOtherAppIsRunning(Exception): + """exception raised when SingleApp detects another application is already running""" + + +class SingleApp(object): + """Class doing its best to enshure only one instance of an application + is running at the same time + + @note: the class uses a socket to exchange data in between applications. firewalls + (...) may not like this. + @note: a carefuly chosen magic string to exchange may help to reduce the chance + of accidential collisions with other applications + @note: race conditions? yes + """ + + def __init__(self, host=None, port=None, magicToSend=None, magicToRespond=None, userData=None): + """ + @param host: host to establish the connection to + @param port: port to use for the connection + @param magicToSend: magic string a client should send to the server + @param magicToRespond: magic string the server should send in response + @param userData: any data you want to associate to the SignleApp object + """ + + if host is None or port is None or magicToSend is None or magicToRespond is None: + raise ValueError('All keyword arguments except userData are mandatory. This is just for better looks') + self.host = host + self.port = port + self.magicToSend = magicToSend + self.magicToRespond = magicToRespond + self.isServerRunning = False + self.socket = None + self.userData = userData + + + def _runServer(self): + # start server and listen to incoming connections + while True: + self.socket.listen(1) + conn, addr = self.socket.accept() + # NOTE: my best guess here is that we can not loop here to make shure we + # get some data. mybe the other end of the pipe plays dead + data = conn.recv(len(self.magicToSend)) + if data == self.magicToSend: + self.onOtherAppIsStarting() + conn.send(self.magicToRespond) + conn.close() + self.socket.close() + self.socket = None + self.isServerRunning = False + + + def start(self): + """starts SingleApp + + @raise ErrorCanNotConnect: + @raise ErrorOtherAppIsRunning: + """ + # try to bind socket as server + self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + try: + self.socket.bind((self.host, self.port)) + except socket.error, details: + # assume address is already in use, try to connect to it + try: + self.socket.connect((self.host, self.port)) + except socket.error, details: + # ups, neither way works. we give up here + raise ErrorCanNotConnect(details) + try: + # try to find out who is serving + self.socket.settimeout(0.5) + self.socket.sendall(self.magicToSend) + # NOTE: my best guess here is that we can not loop here to make shure we + # get some data. mybe the other end of the pipe plays dead + data = self.socket.recv(len(self.magicToRespond)) + if data == self.magicToRespond: + raise ErrorOtherAppIsRunning() + except socket.timeout: + raise ErrorCanNotConnect(details) + finally: + self.socket.close() + self.socket = None + else: + self.isServerRunning = True + thread.start_new_thread(self._runServer, ()) + + def onOtherAppIsStarting(self): + """called when another application using the same magic string is conncting to our server""" + print 'another app of the same kind is connecting to us' + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-29 11:45:07
|
Revision: 817 http://fclient.svn.sourceforge.net/fclient/?rev=817&view=rev Author: jUrner Date: 2008-07-29 11:45:16 +0000 (Tue, 29 Jul 2008) Log Message: ----------- more work on dls. requests can be removed 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-29 11:44:21 UTC (rev 816) +++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-29 11:45:16 UTC (rev 817) @@ -18,10 +18,12 @@ # 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 +# 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 +# x. it may take a while untill the final DataFound message arrives when a request is % completed. feedback would be nice +# x. DataFound for a request the file has been removed by the user. no idea what happens. have to test this #************************************************************************************************************** from __future__ import absolute_import if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below @@ -33,6 +35,7 @@ from . import config from .lib import fcp2 from .lib.fcp2.lib import pmstruct +from .lib.qt4ex import treewidgetwrap from . import DlgDownloadKeyToDisk from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget @@ -92,7 +95,7 @@ def setVisible(self, flag): if self.menuBar is not None: for menu in self.menus: - menu.children()[0].setVisible(flag) + menu.children()[0].setEnabled(flag) #if self.statusBar is not None: # self.progress.setVisible(flag) # self.labelStatus.setVisible(flag) @@ -119,8 +122,14 @@ name='ActionDownloadKeyToDisk', text=self.trUtf8('Download &key...'), trigger=parent.onDownloadKey, - ) - + ) + self.action( + name='ActionRemoveSelectedRequests', + text=self.trUtf8('Remove'), + trigger=parent.onRemoveSelectedRequests, + isEnabled=False, + ) + #********************************************************************************** # #********************************************************************************** @@ -183,20 +192,6 @@ #********************************************************************************** # #********************************************************************************** -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' @@ -222,14 +217,12 @@ (config.fcpClient.events.RequestModified, self.onFcpRequestModified), (config.fcpClient.events.RequestProgress, self.onFcpRequestProgress), (config.fcpClient.events.RequestStarted, self.onFcpRequestStarted), + (config.fcpClient.events.RequestRemoved, self.onFcpRequestRemoved), ) config.fcpClient.events += self.fcpEvents self.fcHeadeLabels = {} self.fcpRequests = {} - #XXX - self.foo = False - ############################ ## private methods ############################ @@ -251,28 +244,43 @@ ## ############################ def retranslateUi(self, parent): + Ui_ViewDownloadsWidget.retranslateUi(self, parent) + tree = self.controlById(self.IdTree) 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())]) - - + tree.setHeaderLabels([i[1] for i in sorted(self.fcHeadeLabels.items())]) + def closeEvent(self): self.viewClose() - - + def hideEvent(self, event): self.fcGlobalFeedback.setVisible(False) def showEvent(self, event): self.fcGlobalFeedback.setVisible(True) + if not self._isCreated: + self._isCreated = True + + # setup tree + tree = self.controlById(self.IdTree) + tree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) + tree.setSelectionMode(tree.ExtendedSelection) + tree.setUniformRowHeights(True) + self.connect(tree, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onTreeCustomContextMenuRequested) + self.connect(tree, QtCore.SIGNAL('itemSelectionChanged() '), self.onTreeItemSelectionChanged) def viewClose(self): config.fcpClient.events -= self.fcpEvents - + ######################################### + ## methods + ######################################### + def controlById(idGlobalFeedback, idControl): + return getattr(idGlobalFeedback, idControl) + def downloadFile(self, fcpKey, fileName, **kws): """""" fileName = unicode(fileName) @@ -288,14 +296,7 @@ menu.addAction(self.fcActions['ActionDownloadKeyToDisk']) return menu - ######################################### - ## methods - ######################################### - def controlById(idGlobalFeedback, idControl): - return getattr(idGlobalFeedback, idControl) - - ######################################### ## event handlers ######################################### def onDownloadKey(self, action): @@ -308,20 +309,41 @@ handleFilenameCollision=True, ) + + def onRemoveSelectedRequests(self, action): + tree = self.controlById(self.IdTree) + for item in tree.selectedItems(): + parent = item.parent() + if parent is None: + parent = tree.invisibleRootItem() + it = treewidgetwrap.TreeWidgetIterator(parent) + it.next() + for tmp_item in it: + config.fcpClient.removeRequest(tmp_item.fcpIdentifier) + del self.fcpRequests[tmp_item.fcpIdentifier] + parent.removeChild(item) + + + def onTreeCustomContextMenuRequested(self, pt): + tree = self.controlById(self.IdTree) + pt = tree.viewport().mapToGlobal(pt) + + menu = QtGui.QMenu(self) + menu.addAction(self.fcActions['ActionRemoveSelectedRequests']) + + menu.exec_(pt) + + def onTreeItemSelectionChanged(self): + tree = self.controlById(self.IdTree) + hasSelectedItems = tree.selectionModel().hasSelection() + + self.fcActions['ActionRemoveSelectedRequests'].setEnabled(hasSelectedItems) + ######################################### ## 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.fcSettings.value('DownloadDir') - fpath = os.path.join(unicode(directory), unicode(fileName)) - self.downloadFile(key, fpath) + pass def onFcpRequestCompleted(self, fcpEvent, fcpRequest): @@ -365,6 +387,9 @@ progressBar.setValue(fcpRequest['ProgressSucceeded']) + def onFcpRequestRemoved(self, fcpEvent, fcpRequest): + pass + def onFcpRequestStarted(self, fcpEvent, fcpRequest): if fcpRequest['RequestStatus'] & fcp2.ConstRequestStatus.Restored: try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-29 11:44:12
|
Revision: 816 http://fclient.svn.sourceforge.net/fclient/?rev=816&view=rev Author: jUrner Date: 2008-07-29 11:44:21 +0000 (Tue, 29 Jul 2008) Log Message: ----------- disable global menus instead of hiding them.. Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewConnection.py Modified: trunk/fclient/src/fclient/impl/ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-29 11:42:59 UTC (rev 815) +++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-29 11:44:21 UTC (rev 816) @@ -57,7 +57,7 @@ def setVisible(self, flag): for menu in self.menus: - menu.children()[0].setVisible(flag) + menu.children()[0].setEnabled(flag) if self.label1 is not None: self.label1.setVisible(flag) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-29 11:42:50
|
Revision: 815 http://fclient.svn.sourceforge.net/fclient/?rev=815&view=rev Author: jUrner Date: 2008-07-29 11:42:59 +0000 (Tue, 29 Jul 2008) Log Message: ----------- combed over find box 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-29 11:41:57 UTC (rev 814) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-29 11:42:59 UTC (rev 815) @@ -25,6 +25,9 @@ # 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 # x. when loading a page, until fproxy reacts reload is enabled instead of stop. hitting reloading will trigger an error +# x. icons on find bar push button text tio the side. no idea +# x. on find action, give feedback when no matching text was found on page +# some shortcuts for actions are still missing #****************************************************************************************** """ @@ -193,7 +196,7 @@ def setVisible(self, flag): if self.menuBar is not None: for menu in self.menus: - menu.children()[0].setVisible(flag) + menu.children()[0].setEnabled(flag) if self.statusBar is not None: self.progress.setVisible(flag) self.labelStatus.setVisible(flag) @@ -266,11 +269,13 @@ iconSize = parent.fcSettings.value('IconSize') iconTheme = parent.fcSettings.value('IconTheme') + #TODO: shortcut self.action( name='ActionCloseCurrentTab', text=self.trUtf8('Close ¤t tab'), trigger=parent.onCloseCurrentTab, ) + #TODO: shortcut self.action( # context menu only name='ActionCloseBrowserUnderMouse', text=self.trUtf8('&Close tab'), @@ -281,11 +286,13 @@ text=self.trUtf8('Close &all tabs'), trigger=parent.onCloseAllTabs, ) + #TODO: shortcut self.action( name='ActionOpenNewTab', text=self.trUtf8('Open &new tab'), trigger=parent.onOpenNewTab, ) + #TODO: shortcut self.action( name='ActionGoToFProxy', text=self.trUtf8('Go to f&Proxy homepage'), @@ -294,8 +301,10 @@ self.action( name='ActionGoToHomePage', text=self.trUtf8('Go to &homepage'), + shortcut=QtGui.QKeySequence(self.trUtf8('Alt+Home')), trigger=parent.onGoToHomePage, ) + #TODO: shortcut self.action( name='ActionObjectProperties', text=self.trUtf8('Properties..'), @@ -304,11 +313,13 @@ self.action( name='ActionZoomIn', text=self.trUtf8('Zoom in'), + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.ZoomIn), trigger=parent.onZoomIn, ) self.action( name='ActionZoomOut', text=self.trUtf8('Zoom out'), + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.ZoomOut), trigger=parent.onZoomOut, ) @@ -318,6 +329,7 @@ text=self.trUtf8('Back'), trigger=None, isEnabled=False, + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.Back), icon=config.fcResources.getIcon('back', iconSize, iconTheme=iconTheme), userData=(None, None), ) @@ -326,6 +338,7 @@ text=self.trUtf8('Forward'), trigger=None, isEnabled=False, + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.Forward), icon=config.fcResources.getIcon('forward', iconSize, iconTheme=iconTheme), userData=(None, None), ) @@ -334,6 +347,7 @@ text=self.trUtf8('Reload'), trigger=None, isEnabled=False, + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.Refresh), icon=config.fcResources.getIcon('reload_page', iconSize, iconTheme=iconTheme), userData=(None, None), ) @@ -342,10 +356,10 @@ text=self.trUtf8('Stop'), trigger=None, isEnabled=False, + shortcut=QtGui.QKeySequence(self.trUtf8('Esc')), icon=config.fcResources.getIcon('stop', iconSize, iconTheme=iconTheme), userData=(None, None), ) - self.action( name='ActionBackIsClose', text=self.trUtf8('Back is close'), @@ -353,15 +367,30 @@ trigger=None, ) - # search actions + # find actions self.action( - parent=parent, - name='ActionSearch', - text=self.trUtf8('Search'), - shortcut=QtGui.QKeySequence(self.trUtf8('Ctrl+F')), - trigger=parent.onSearch, + name='ActionFind', + text=self.trUtf8('Find'), + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.Find), + trigger=parent.onFind, ) + self.action( + name='ActionFindNext', + text=self.trUtf8('Find next'), + isEnabled=False, + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.FindNext), + trigger=parent.onFindNext, + ) + self.action( + name='ActionFindPrevious', + text=self.trUtf8('Find previous'), + isEnabled=False, + shortcut=QtGui.QKeySequence(QtGui.QKeySequence.FindPrevious), + trigger=parent.onFindPrevious, + ) + + def intertwineBrowserActions(self, browser=None): """intertwines Browser actions with BrowserWidget actions @note: call everytime the current browser changes @@ -428,11 +457,11 @@ IdBtReload = 'btReload' IdBtStop = 'btStop' - IdFrameSearch = 'frameSearch' - IdEdSearch = 'edSearch' - IdBtSearchUpwards = 'btSearchUpwards' - IdBtSearchDownwards = 'btSearchDownwards' - IdCkSearchCaseSensitive = 'ckSearchCaseSensitive' + IdFrameFind = 'frameFind' + IdEdFind = 'edFind' + IdBtFindPrevious = 'btFindPrevious' + IdBtFindNext= 'btFindNext' + IdCkFindCaseSensitive = 'ckFindCaseSensitive' ForcedMinBrowserTabText = 5 # forced minimum number of chars on browser tabBar @@ -450,6 +479,10 @@ self.fcViewObject = BrowserWidgetViewObject(self) self.fcGlobalFeedback = BrowserWidgetGlobalFeedback(self, idGlobalFeedback) + # setup + iconSize = self.fcSettings.value('IconSize') + iconTheme = self.fcSettings.value('IconTheme') + # setup tab bar tabWidget = self.controlById(self.IdTabBrowsers) tabWidget.clear() @@ -468,14 +501,17 @@ self.controlById(self.IdBtStop).setDefaultAction(self.fcActions['ActionStop']) # setupp search bar - bt = self.controlById(self.IdBtSearchUpwards) - self.connect(bt, QtCore.SIGNAL('clicked()'), self.onSearchUpwards) - bt = self.controlById(self.IdBtSearchDownwards) - self.connect(bt, QtCore.SIGNAL('clicked()'), self.onSearchDownwards) - ed = self.controlById(self.IdEdSearch) - self.connect(ed, QtCore.SIGNAL('returnPressed()'), self.onSearchDownwards) - frameSearch = self.controlById(self.IdFrameSearch) - frameSearch.setVisible(False) + bt = self.controlById(self.IdBtFindPrevious) + self.connect(bt, QtCore.SIGNAL('clicked()'), self.fcActions['ActionFindPrevious'].trigger) + bt.setIcon(config.fcResources.getIcon('arrow_up',iconSize, iconTheme=iconTheme)) + bt = self.controlById(self.IdBtFindNext) + bt.setIcon(config.fcResources.getIcon('arrow_down', iconSize, iconTheme=iconTheme)) + self.connect(bt, QtCore.SIGNAL('clicked()'), self.fcActions['ActionFindNext'].trigger) + ed = self.controlById(self.IdEdFind) + self.connect(ed, QtCore.SIGNAL('returnPressed()'), self.fcActions['ActionFindNext'].trigger) + self.connect(ed, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFindTextChanged) + frameFind = self.controlById(self.IdFrameFind) + frameFind.setVisible(False) ######################################### ## private methods @@ -661,6 +697,10 @@ #TODO: rework. we need more then one menu def populateMenu(self, menu): + menu.addAction(self.fcActions['ActionBack']) + menu.addAction(self.fcActions['ActionForward']) + menu.addAction(self.fcActions['ActionReload']) + menu.addAction(self.fcActions['ActionStop']) menu.addAction(self.fcActions['ActionGoToFProxy']) menu.addAction(self.fcActions['ActionGoToHomePage']) menu.addAction(self.fcActions['ActionCloseCurrentTab']) @@ -668,7 +708,9 @@ menu.addAction(self.fcActions['ActionOpenNewTab']) menu.addAction(self.fcActions['ActionZoomIn']) menu.addAction(self.fcActions['ActionZoomOut']) - menu.addAction(self.fcActions['ActionSearch']) + menu.addAction(self.fcActions['ActionFind']) + menu.addAction(self.fcActions['ActionFindNext']) + menu.addAction(self.fcActions['ActionFindPrevious']) return menu ######################################### @@ -869,6 +911,11 @@ tabWidget.removeTab(i) self.fcActions.intertwineBrowserActions(self.currentBrowser()) + def onEdFindTextChanged(self, text): + self.fcActions['ActionFindNext'].setEnabled(bool(text)) + self.fcActions['ActionFindPrevious'].setEnabled(bool(text)) + + #TODO: open in new tab option? def onGoToFProxy(self, action): url = QtCore.QUrl() @@ -907,27 +954,37 @@ if browser is not None and act is browser.pageAction(browser.page().Back): self._adjustBackIsClose() - def onSearch(self, action): - frameSearch = self.controlById(self.IdFrameSearch) - frameSearch.setVisible(not frameSearch.isVisible()) + def onFind(self, action): + frameFind = self.controlById(self.IdFrameFind) + ed = self.controlById(self.IdEdFind) + #ed.setText('fooBar') - def onSearchDownwards(self): + frameFind.setVisible(not frameFind.isVisible()) + #self.fcActions['ActionFindNext'].setEnabled() + #self.fcActions['ActionFindPrevious'].setEnabled() + if frameFind.isVisible(): + ed.setFocus(QtCore.Qt.OtherFocusReason) + ed.selectAll() + + #TODO: give feedback when no matching text was found + def onFindNext(self): browser = self.currentBrowser() if browser is not None: page = browser.page() - ed = self.controlById(self.IdEdSearch) - ck = self.controlById(self.IdCkSearchCaseSensitive) + ed = self.controlById(self.IdEdFind) + ck = self.controlById(self.IdCkFindCaseSensitive) flags = page.FindWrapsAroundDocument if ck.checkState() == QtCore.Qt.Checked: flags |= page.FindCaseSensitively - browser.findText(ed.text(), flags) + if not browser.findText(ed.text(), flags): + pass - def onSearchUpwards(self): + def onFindPrevious(self): browser = self.currentBrowser() if browser is not None: page = browser.page() - ed = self.controlById(self.IdEdSearch) - ck = self.controlById(self.IdCkSearchCaseSensitive) + ed = self.controlById(self.IdEdFind) + ck = self.controlById(self.IdCkFindCaseSensitive) flags = page.FindWrapsAroundDocument | page.FindBackward if ck.checkState() == QtCore.Qt.Checked: flags |= page.FindCaseSensitively This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-29 11:41:50
|
Revision: 814 http://fclient.svn.sourceforge.net/fclient/?rev=814&view=rev Author: jUrner Date: 2008-07-29 11:41:57 +0000 (Tue, 29 Jul 2008) Log Message: ----------- ... Modified Paths: -------------- trunk/fclient/src/fclient/impl/tpls/Ui_ViewBrowserWidgetTpl.py Modified: trunk/fclient/src/fclient/impl/tpls/Ui_ViewBrowserWidgetTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_ViewBrowserWidgetTpl.py 2008-07-29 11:41:46 UTC (rev 813) +++ trunk/fclient/src/fclient/impl/tpls/Ui_ViewBrowserWidgetTpl.py 2008-07-29 11:41:57 UTC (rev 814) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewBrowserWidgetTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui' # -# Created: Sat Jul 26 00:36:50 2008 +# Created: Tue Jul 29 12:29:18 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -61,38 +61,43 @@ self.tabBrowsers = QtGui.QTabWidget(ViewBrowserWidget) self.tabBrowsers.setObjectName("tabBrowsers") self.tab = QtGui.QWidget() - self.tab.setGeometry(QtCore.QRect(0, 0, 688, 654)) + self.tab.setGeometry(QtCore.QRect(0, 0, 688, 672)) self.tab.setObjectName("tab") self.tabBrowsers.addTab(self.tab, "") self.gridLayout_4.addWidget(self.tabBrowsers, 1, 0, 1, 1) - self.frameSearch = QtGui.QFrame(ViewBrowserWidget) - self.frameSearch.setFrameShape(QtGui.QFrame.StyledPanel) - self.frameSearch.setFrameShadow(QtGui.QFrame.Raised) - self.frameSearch.setObjectName("frameSearch") - self.gridLayout_3 = QtGui.QGridLayout(self.frameSearch) + self.frameFind = QtGui.QFrame(ViewBrowserWidget) + self.frameFind.setFrameShape(QtGui.QFrame.StyledPanel) + self.frameFind.setFrameShadow(QtGui.QFrame.Raised) + self.frameFind.setObjectName("frameFind") + self.gridLayout_3 = QtGui.QGridLayout(self.frameFind) + self.gridLayout_3.setMargin(0) + self.gridLayout_3.setSpacing(0) self.gridLayout_3.setObjectName("gridLayout_3") self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setSpacing(6) self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.label = QtGui.QLabel(self.frameSearch) + self.label = QtGui.QLabel(self.frameFind) self.label.setObjectName("label") self.horizontalLayout_2.addWidget(self.label) - self.edSearch = QtGui.QLineEdit(self.frameSearch) - self.edSearch.setDragEnabled(True) - self.edSearch.setObjectName("edSearch") - self.horizontalLayout_2.addWidget(self.edSearch) - self.btSearchDownwards = QtGui.QPushButton(self.frameSearch) - self.btSearchDownwards.setObjectName("btSearchDownwards") - self.horizontalLayout_2.addWidget(self.btSearchDownwards) - self.btSearchUpwards = QtGui.QPushButton(self.frameSearch) - self.btSearchUpwards.setObjectName("btSearchUpwards") - self.horizontalLayout_2.addWidget(self.btSearchUpwards) - self.ckSearchCaseSensitive = QtGui.QCheckBox(self.frameSearch) - self.ckSearchCaseSensitive.setObjectName("ckSearchCaseSensitive") - self.horizontalLayout_2.addWidget(self.ckSearchCaseSensitive) + self.edFind = QtGui.QLineEdit(self.frameFind) + self.edFind.setDragEnabled(True) + self.edFind.setObjectName("edFind") + self.horizontalLayout_2.addWidget(self.edFind) + self.btFindNext = QtGui.QPushButton(self.frameFind) + self.btFindNext.setFlat(False) + self.btFindNext.setObjectName("btFindNext") + self.horizontalLayout_2.addWidget(self.btFindNext) + self.btFindPrevious = QtGui.QPushButton(self.frameFind) + self.btFindPrevious.setFlat(False) + self.btFindPrevious.setObjectName("btFindPrevious") + self.horizontalLayout_2.addWidget(self.btFindPrevious) + self.ckFindCaseSensitive = QtGui.QCheckBox(self.frameFind) + self.ckFindCaseSensitive.setObjectName("ckFindCaseSensitive") + self.horizontalLayout_2.addWidget(self.ckFindCaseSensitive) spacerItem = QtGui.QSpacerItem(48, 25, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout_2.addItem(spacerItem) self.gridLayout_3.addLayout(self.horizontalLayout_2, 0, 0, 1, 1) - self.gridLayout_4.addWidget(self.frameSearch, 2, 0, 1, 1) + self.gridLayout_4.addWidget(self.frameFind, 2, 0, 1, 1) self.retranslateUi(ViewBrowserWidget) self.tabBrowsers.setCurrentIndex(0) @@ -105,10 +110,10 @@ self.btReload.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Reload", None, QtGui.QApplication.UnicodeUTF8)) self.btStop.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Stop", None, QtGui.QApplication.UnicodeUTF8)) self.tabBrowsers.setTabText(self.tabBrowsers.indexOf(self.tab), QtGui.QApplication.translate("ViewBrowserWidget", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Search:", None, QtGui.QApplication.UnicodeUTF8)) - self.btSearchDownwards.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Down", None, QtGui.QApplication.UnicodeUTF8)) - self.btSearchUpwards.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Up", None, QtGui.QApplication.UnicodeUTF8)) - self.ckSearchCaseSensitive.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Case sensitive", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Find:", None, QtGui.QApplication.UnicodeUTF8)) + self.btFindNext.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Next", None, QtGui.QApplication.UnicodeUTF8)) + self.btFindPrevious.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Previous", None, QtGui.QApplication.UnicodeUTF8)) + self.ckFindCaseSensitive.setText(QtGui.QApplication.translate("ViewBrowserWidget", "Case sensitive", 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-29 11:41:37
|
Revision: 813 http://fclient.svn.sourceforge.net/fclient/?rev=813&view=rev Author: jUrner Date: 2008-07-29 11:41:46 +0000 (Tue, 29 Jul 2008) Log Message: ----------- ... Modified Paths: -------------- trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui Modified: trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui 2008-07-29 11:41:34 UTC (rev 812) +++ trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui 2008-07-29 11:41:46 UTC (rev 813) @@ -115,7 +115,7 @@ <x>0</x> <y>0</y> <width>688</width> - <height>654</height> + <height>672</height> </rect> </property> <attribute name="title" > @@ -125,7 +125,7 @@ </widget> </item> <item row="2" column="0" > - <widget class="QFrame" name="frameSearch" > + <widget class="QFrame" name="frameFind" > <property name="frameShape" > <enum>QFrame::StyledPanel</enum> </property> @@ -133,38 +133,53 @@ <enum>QFrame::Raised</enum> </property> <layout class="QGridLayout" name="gridLayout_3" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>0</number> + </property> <item row="0" column="0" > <layout class="QHBoxLayout" name="horizontalLayout_2" > + <property name="spacing" > + <number>6</number> + </property> <item> <widget class="QLabel" name="label" > <property name="text" > - <string>Search:</string> + <string>Find:</string> </property> </widget> </item> <item> - <widget class="QLineEdit" name="edSearch" > + <widget class="QLineEdit" name="edFind" > <property name="dragEnabled" > <bool>true</bool> </property> </widget> </item> <item> - <widget class="QPushButton" name="btSearchDownwards" > + <widget class="QPushButton" name="btFindNext" > <property name="text" > - <string>Down</string> + <string>Next</string> </property> + <property name="flat" > + <bool>false</bool> + </property> </widget> </item> <item> - <widget class="QPushButton" name="btSearchUpwards" > + <widget class="QPushButton" name="btFindPrevious" > <property name="text" > - <string>Up</string> + <string>Previous</string> </property> + <property name="flat" > + <bool>false</bool> + </property> </widget> </item> <item> - <widget class="QCheckBox" name="ckSearchCaseSensitive" > + <widget class="QCheckBox" name="ckFindCaseSensitive" > <property name="text" > <string>Case sensitive</string> </property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-29 11:41:25
|
Revision: 812 http://fclient.svn.sourceforge.net/fclient/?rev=812&view=rev Author: jUrner Date: 2008-07-29 11:41:34 +0000 (Tue, 29 Jul 2008) Log Message: ----------- some new icons Added Paths: ----------- trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/arrow_down.png trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/arrow_up.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/arrow_down.png trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/arrow_up.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/arrow_down.png trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/arrow_up.png Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/arrow_down.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/16x16/arrow_up.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/arrow_down.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/32x32/arrow_up.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/arrow_down.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/impl/res/icons/crystal/48x48/arrow_up.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-29 11:40:47
|
Revision: 811 http://fclient.svn.sourceforge.net/fclient/?rev=811&view=rev Author: jUrner Date: 2008-07-29 11:40:56 +0000 (Tue, 29 Jul 2008) Log Message: ----------- parent is parent is parent Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/actions.py Modified: trunk/fclient/src/fclient/impl/lib/qt4ex/lib/actions.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/actions.py 2008-07-28 20:06:32 UTC (rev 810) +++ trunk/fclient/src/fclient/impl/lib/qt4ex/lib/actions.py 2008-07-29 11:40:56 UTC (rev 811) @@ -17,7 +17,6 @@ def setUserData(self, data): self._userData = data - #****************************************************************************** # #****************************************************************************** @@ -45,10 +44,12 @@ ): """ """ + if parent is None: + parent = self.parent() if group is None: - group = QtGui.QActionGroup(self.parent()) + group = QtGui.QActionGroup(parent) self._dummyGroups.append(group) #TODO: is this necessary? - act = Action(text, group, userData=userData) + act = Action(text, parent, userData=userData) group.addAction(act) group.setExclusive(False) if trigger is not None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 20:06:23
|
Revision: 810 http://fclient.svn.sourceforge.net/fclient/?rev=810&view=rev Author: jUrner Date: 2008-07-28 20:06:32 +0000 (Mon, 28 Jul 2008) Log Message: ----------- and another todo.. 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-28 20:00:43 UTC (rev 809) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-28 20:06:32 UTC (rev 810) @@ -1,6 +1,6 @@ #****************************************************************************************** #TODO: -# x. someday. maybe. reimpl to browse via fcp. +# x. someday. maybe. reimpl to browse via fcp # x. page history is cleared if we get an error on loading a page. reimpl page history? # x. back-is-close like behaviour # x. backand forward buttons suck somehow. sometimes fwd is enabled even if no fwd is available. reimpl page history? @@ -24,6 +24,7 @@ # 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 +# x. when loading a page, until fproxy reacts reload is enabled instead of stop. hitting reloading will trigger an error #****************************************************************************************** """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 20:00:40
|
Revision: 809 http://fclient.svn.sourceforge.net/fclient/?rev=809&view=rev Author: jUrner Date: 2008-07-28 20:00:43 +0000 (Mon, 28 Jul 2008) Log Message: ----------- naming Modified Paths: -------------- trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py trunk/fclient/src/fclient/impl/MainWindow.py trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py trunk/fclient/src/fclient/impl/PrefsGlobal.py trunk/fclient/src/fclient/impl/ViewBrowser.py trunk/fclient/src/fclient/impl/ViewConnection.py trunk/fclient/src/fclient/impl/ViewDownloads.py trunk/fclient/src/fclient/impl/config.py Modified: trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py =================================================================== --- trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/DlgDownloadKeyToDisk.py 2008-07-28 20:00:43 UTC (rev 809) @@ -41,7 +41,7 @@ QtGui.QDialog.__init__(self, parent) self.setupUi(self) - self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Download key..')) + self.setWindowTitle(config.FcAppName + self.trUtf8(' - Download key..')) self.fcSettings = Settings(self).restore() self._fileName = None @@ -63,7 +63,7 @@ # setup directory editbox ed = self.controlById(self.IdEdDirectory) - ed.setText(unicode(config.settings.value('DownloadDir'))) + ed.setText(unicode(config.fcSettings.value('DownloadDir'))) bt = self.controlById(self.IdBtChooseDirectory) self.connect(bt, QtCore.SIGNAL('clicked()'), self.onChooseDirectory) @@ -122,7 +122,7 @@ edDirectory = self.controlById(self.IdEdDirectory) directory = QtGui.QFileDialog.getExistingDirectory( self, - config.FclientAppName + self.trUtf8(' - Download key to..'), + config.FcAppName + self.trUtf8(' - Download key to..'), edDirectory.text(), ) if directory: Modified: trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py =================================================================== --- trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/DlgPropsBrowserObject.py 2008-07-28 20:00:43 UTC (rev 809) @@ -35,7 +35,7 @@ QtGui.QDialog.__init__(self, parent) self.setupUi(self) - self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties')) + self.setWindowTitle(config.FcAppName + self.trUtf8(' - Properties')) if hitTestResult is not None: Modified: trunk/fclient/src/fclient/impl/MainWindow.py =================================================================== --- trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-28 20:00:43 UTC (rev 809) @@ -1,5 +1,5 @@ from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below +if __name__ == '__main__': # see --> http://bugs.Fc.org/issue1510172 . works only current dir and below import os; __path__ = [os.path.dirname(__file__)] import logging @@ -62,13 +62,13 @@ self.menuApplication = QtGui.QMenu(self.trUtf8('&Application'), self) self.addMenu(self.menuApplication) - self.menuApplication.addAction(parent.fclientActions['ActionPreferences']) - self.menuApplication.addAction(parent.fclientActions['ActionExit']) + self.menuApplication.addAction(parent.fcActions['ActionPreferences']) + self.menuApplication.addAction(parent.fcActions['ActionExit']) self.menuHelp = QtGui.QMenu(self.trUtf8('&Help'), self) self.addMenu(self.menuHelp) - self.menuHelp.addAction(parent.fclientActions['ActionAbout']) - self.menuHelp.addAction(parent.fclientActions['ActionHelp']) + self.menuHelp.addAction(parent.fcActions['ActionAbout']) + self.menuHelp.addAction(parent.fcActions['ActionHelp']) def addViewMenu(self, menu): @@ -97,18 +97,18 @@ self.setupUi(self) config.ObjectRegistry.register(self) - self.fclientSettings = Settings().restore() - self.fclientActions = Actions(self) + self.fcSettings = Settings().restore() + self.fcActions = Actions(self) self.setMenuBar(MenuBar(self)) self.setStatusBar(StatusBar(self)) - self.restoreGeometry(self.fclientSettings.value('Geometry')) + self.restoreGeometry(self.fcSettings.value('Geometry')) ################################################## ## events ################################################## def closeEvent(self, event): - self.fclientSettings.setValues(Geometry=self.saveGeometry()) + self.fcSettings.setValues(Geometry=self.saveGeometry()) def showEvent(self, event): @@ -134,14 +134,14 @@ dlg = dlgabout.DlgAbout( self, ##state=self.guiSettings['DlgAboutState'], - caption=config.FclientAppName + ' - ' + self.trUtf8('About'), - appName=config.FclientAppName, - description=self.trUtf8('a freenet client written in python and Qt4'), - version=config.FclientVersion, - author=config.FclientAuthor, - licence=config.FclientLicence, - copyright=config.FclientCopyright, - homepage=config.FclientHomepage + caption=config.FcAppName + ' - ' + self.trUtf8('About'), + appName=config.FcAppName, + description=self.trUtf8('a freenet client written in Fc and Qt4'), + version=config.FcVersion, + author=config.FcAuthor, + licence=config.FcLicence, + copyright=config.FcCopyright, + homepage=config.FcHomepage ) dlg.exec_() #self.guiSettings['DlgAboutState'] = dlg.saveState() Modified: trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-28 20:00:43 UTC (rev 809) @@ -9,7 +9,7 @@ #****************************************************************************** from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below +if __name__ == '__main__': # see --> http://bugs.Fc.org/issue1510172 . works only current dir and below import os; __path__ = [os.path.dirname(__file__)] @@ -35,7 +35,7 @@ QtGui.QWidget.__init__(self, parent) self.setupUi(self) - self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings')) + self.setWindowTitle(config.FcAppName + self.trUtf8(' - Connection expert settings')) self.fcSettingsControler = None # Modified: trunk/fclient/src/fclient/impl/PrefsGlobal.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-28 20:00:43 UTC (rev 809) @@ -1,6 +1,6 @@ from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below +if __name__ == '__main__': # see --> http://bugs.python.org/Fc1510172 . works only current dir and below import os; __path__ = [os.path.dirname(__file__)] @@ -73,7 +73,7 @@ ed = self.controlById(self.IdEdSettingsDir) directory = QtGui.QFileDialog.getExistingDirectory( self, - config.FclientAppName + self.trUtf8(' - Select settings directory..'), + config.FcAppName + self.trUtf8(' - Select settings directory..'), ed.text(), ) if directory: @@ -83,7 +83,7 @@ ed = self.controlById(self.IdEdDownloadDir) directory = QtGui.QFileDialog.getExistingDirectory( self, - config.FclientAppName + self.trUtf8(' - Select download directory..'), + config.FcAppName + self.trUtf8(' - Select download directory..'), ed.text(), ) if directory: Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-28 20:00:43 UTC (rev 809) @@ -33,6 +33,7 @@ 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, QtWebKit from . import config @@ -316,7 +317,7 @@ text=self.trUtf8('Back'), trigger=None, isEnabled=False, - icon=config.resources.getIcon('back', iconSize, iconTheme=iconTheme), + icon=config.fcResources.getIcon('back', iconSize, iconTheme=iconTheme), userData=(None, None), ) self.action( @@ -324,7 +325,7 @@ text=self.trUtf8('Forward'), trigger=None, isEnabled=False, - icon=config.resources.getIcon('forward', iconSize, iconTheme=iconTheme), + icon=config.fcResources.getIcon('forward', iconSize, iconTheme=iconTheme), userData=(None, None), ) self.action( @@ -332,7 +333,7 @@ text=self.trUtf8('Reload'), trigger=None, isEnabled=False, - icon=config.resources.getIcon('reload_page', iconSize, iconTheme=iconTheme), + icon=config.fcResources.getIcon('reload_page', iconSize, iconTheme=iconTheme), userData=(None, None), ) self.action( @@ -340,14 +341,14 @@ text=self.trUtf8('Stop'), trigger=None, isEnabled=False, - icon=config.resources.getIcon('stop', iconSize, iconTheme=iconTheme), + icon=config.fcResources.getIcon('stop', iconSize, iconTheme=iconTheme), userData=(None, None), ) self.action( name='ActionBackIsClose', text=self.trUtf8('Back is close'), - icon=config.resources.getIcon('button_cancel', iconSize, iconTheme=iconTheme), + icon=config.fcResources.getIcon('button_cancel', iconSize, iconTheme=iconTheme), trigger=None, ) @@ -513,8 +514,8 @@ # thow a dialog box at the user to select a filename # ..qt seems to place the filename part as suggestion into the filename box. so try it - caption = config.FclientAppName + self.trUtf8(' - Save Image To..') - directory = unicode(config.settings.value('DownloadDir')) + caption = config.FcAppName + self.trUtf8(' - Save Image To..') + directory = unicode(config.fcSettings.value('DownloadDir')) fileName = unicode(config.guessFileNameFromKey(key, default=QtCore.QString(''))) if directory and fileName: Modified: trunk/fclient/src/fclient/impl/ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-28 20:00:43 UTC (rev 809) @@ -66,7 +66,7 @@ _key_ = config.IdViewConnectionWidget _settings_ = ( ('FcpAutoConnect', 'Bool', True, config.SettingScopeUser), - ('FcpConnectionName', 'String', config.FclientConnectionName, config.SettingScopeExpert), + ('FcpConnectionName', 'String', config.FcConnectionName, config.SettingScopeExpert), ('FcpConnectionHost', 'String', fcp2.Client.DefaultFcpHost, config.SettingScopeUser), ('FcpConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort, config.SettingScopeUser), ('FcpConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert), Modified: trunk/fclient/src/fclient/impl/ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/ViewDownloads.py 2008-07-28 20:00:43 UTC (rev 809) @@ -319,7 +319,7 @@ # 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') + directory = config.fcSettings.value('DownloadDir') fpath = os.path.join(unicode(directory), unicode(fileName)) self.downloadFile(key, fpath) Modified: trunk/fclient/src/fclient/impl/config.py =================================================================== --- trunk/fclient/src/fclient/impl/config.py 2008-07-28 19:46:24 UTC (rev 808) +++ trunk/fclient/src/fclient/impl/config.py 2008-07-28 20:00:43 UTC (rev 809) @@ -13,23 +13,23 @@ #********************************************************************************** # #********************************************************************************** -FclientOrgName = 'fclient' -FclientAppName = 'fclient' -FclientVersion = '0.1.0' -FclientAuthor = 'Juergen Urner' -FclientLicence = 'MIT' -FclientCopyright = '(c) 2008 Juergen Urner' -FclientHomepage = 'http://fclient.sourceforge.net/' -FclientConnectionName = QtCore.QString(FclientAppName + '{08625b10-2b44-4689-b1bf-8baf208b9641}') +FcOrgName = 'fclient' +FcAppName = 'fclient' +FcVersion = '0.1.0' +FcAuthor = 'Juergen Urner' +FcLicence = 'MIT' +FcCopyright = '(c) 2008 Juergen Urner' +FcHomepage = 'http://fclient.sourceforge.net/' +FcConnectionName = QtCore.QString(FcAppName + '{08625b10-2b44-4689-b1bf-8baf208b9641}') _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')) +FcImplDir = QtCore.QString(_implDir) +FcDir = QtCore.QString(_fclientDir) +FcDocDir = QtCore.QString(os.path.join(_fclientDir, 'doc')) +FcDownloadDir = QtCore.QString(os.path.join(_fclientDir, 'downloads')) +FcResDir = QtCore.QString(os.path.join(_implDir, 'res')) +FcSettingsDir = QtCore.QString(os.path.join(_fclientDir, 'settings')) del _implDir, _fclientDir #********************************************************************************** # looks like QObject.findChild() does not always work. docs mention troubles @@ -93,7 +93,7 @@ scope = QtCore.QSettings.SystemScope if self._config_settings_.value('SettingsAllUsers'): scope = QtCore.QSettings.UserScope - settings = QtCore.QSettings(format, scope, FclientOrgName, FclientAppName, self.parent()) + settings = QtCore.QSettings(format, scope, FcOrgName, FcAppName, self.parent()) settings.setFallbacksEnabled(False) return settings @@ -101,10 +101,10 @@ class Settings(SettingsBase): _key_ = 'ConfigSettings' _settings_ = ( - ('SettingsDir', 'String', QtCore.QString(FclientSettingsDir), SettingScopeUser), # if not None, settings are stored locally in the app folder + ('SettingsDir', 'String', QtCore.QString(FcSettingsDir), SettingScopeUser), # if not None, settings are stored locally in the app folder ('SettingsAllUsers', 'Bool', False, SettingScopeUser), # store settings for all users? - ('IconTheme', 'String', 'crystal', SettingScopeUser), - ('DownloadDir', 'String', FclientDownloadDir, SettingScopeUser), + ('IconTheme', 'String', 'crystal', SettingScopeUser), #TODO: global icon theme? + ('DownloadDir', 'String', FcDownloadDir, SettingScopeUser), ) SettingsBase._config_settings_ = Settings() @@ -112,8 +112,8 @@ # #********************************************************************************** fcpClient = fcp2.Client() # global fcp client -settings = Settings(None).restore() # global settings class -resources = resources.Resources([FclientResDir, ], ) # access to global resources +fcSettings = Settings(None).restore() # global settings class +fcResources = resources.Resources([FcResDir, ], ) # access to global resources #********************************************************************************** # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 19:46:14
|
Revision: 808 http://fclient.svn.sourceforge.net/fclient/?rev=808&view=rev Author: jUrner Date: 2008-07-28 19:46:24 +0000 (Mon, 28 Jul 2008) Log Message: ----------- ups, apply and restore handlers where not implemented Modified Paths: -------------- trunk/fclient/src/fclient/impl/PrefsGlobal.py Modified: trunk/fclient/src/fclient/impl/PrefsGlobal.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-28 19:27:17 UTC (rev 807) +++ trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-28 19:46:24 UTC (rev 808) @@ -30,7 +30,7 @@ self.setupUi(self) - self.fcSettingsControler = settings.SettingsControler(config.settings, parent=self) + self.fcSettingsControler = settings.SettingsControler(config.fcSettings, parent=self) if page is not None: page.connect(self.fcSettingsControler, QtCore.SIGNAL('isDirty(bool)'), page.setDirty) @@ -107,6 +107,14 @@ def canHelp(self): return False def canRestoreDefaults(self): return True + def doApply(self): + self._widget.doApply() + return True + + def doRestoreDefaults(self): + self._widget.doRestoreDefaults() + return True + def setVisible(self, parent, flag): createdNew = False if flag and self._widget is None: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 19:27:08
|
Revision: 807 http://fclient.svn.sourceforge.net/fclient/?rev=807&view=rev Author: jUrner Date: 2008-07-28 19:27:17 +0000 (Mon, 28 Jul 2008) Log Message: ----------- combed over prefs dialog Modified Paths: -------------- trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py Modified: trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-28 19:27:07 UTC (rev 806) +++ trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-28 19:27:17 UTC (rev 807) @@ -92,8 +92,7 @@ def canApply(self): return True def canHelp(self): return False - def canRestoreDefaults(self): - return True + def canRestoreDefaults(self): return True def doApply(self): self._widget.doApply() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 19:26:57
|
Revision: 806 http://fclient.svn.sourceforge.net/fclient/?rev=806&view=rev Author: jUrner Date: 2008-07-28 19:27:07 +0000 (Mon, 28 Jul 2008) Log Message: ----------- combed over prefs dialog Modified Paths: -------------- trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py Modified: trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py 2008-07-28 19:26:47 UTC (rev 805) +++ trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py 2008-07-28 19:27:07 UTC (rev 806) @@ -8,7 +8,9 @@ from . import config from .lib.qt4ex import dlgpreferences +from .lib.qt4ex.lib import settings + from .tpls.Ui_PrefsBrowserWidgetTpl import Ui_PrefsBrowserWidget #********************************************************************************** # @@ -23,46 +25,61 @@ IdCkBackIsClose = 'ckBackIsClose' IdCkAutoLoadImages = 'ckAutoLoadImages' - def __init__(self, parent): + def __init__(self, parent=None, page=None): 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) - + browserWidget = config.ObjectRegistry.get(config.IdViewBrowserWidget, None) + if browserWidget is None: + self.setEnabled(False) + else: + self.fcSettingsControler = settings.SettingsControler(browserWidget.fcSettings, parent=self) + if page is not None: + page.connect(self.fcSettingsControler, QtCore.SIGNAL('isDirty(bool)'), page.setDirty) + + self.fcSettingsControler.addLineEdit( + self.controlById(self.IdEdHomePage), + 'HomePage', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkOpenAddressBarInNewTab), + 'OpenAddressBarInNewTab', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkOpenBookmarksInNewTab), + 'OpenBookmarksInNewTab', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkOpenLinksInNewTab), + 'OpenLinksInNewTab', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkOpenHomePageOnNewTabCreated), + 'OpenHomePageOnNewTabCreated', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkBackIsClose), + 'BackIsClose', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkAutoLoadImages), + 'AutoLoadImages', + ) + 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, - ) - - + def doApply(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.apply() + return False + + def doRestoreDefaults(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.restoreDefaults() + return False + #*********************************************************************** # #*********************************************************************** @@ -79,20 +96,26 @@ def canApply(self): return True def canHelp(self): return False + def canRestoreDefaults(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 = PrefsBrowserWidget(parent=parent, page=self) self._widget.setVisible(flag) return (createdNew, self._widget) def doApply(self): - self._widget.apply() + self._widget.doApply() return True + def doRestoreDefaults(self): + self._widget.doRestoreDefaults() + return True + + #*********************************************************************** # #*********************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 19:26:39
|
Revision: 805 http://fclient.svn.sourceforge.net/fclient/?rev=805&view=rev Author: jUrner Date: 2008-07-28 19:26:47 +0000 (Mon, 28 Jul 2008) Log Message: ----------- combed over prefs dialog. most settings are now present (untested) Modified Paths: -------------- trunk/fclient/src/fclient/impl/PrefsGlobal.py trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py Modified: trunk/fclient/src/fclient/impl/PrefsGlobal.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-28 19:25:47 UTC (rev 804) +++ trunk/fclient/src/fclient/impl/PrefsGlobal.py 2008-07-28 19:26:47 UTC (rev 805) @@ -4,10 +4,11 @@ import os; __path__ = [os.path.dirname(__file__)] -from PyQt4 import QtGui +from PyQt4 import QtCore, QtGui from . import config from .lib.qt4ex import dlgpreferences +from .lib.qt4ex.lib import settings from .tpls.Ui_PrefsGlobalWidgetTpl import Ui_PrefsGlobalWidget #********************************************************************************** @@ -15,10 +16,79 @@ #********************************************************************************** class PrefsGlobalWidget(QtGui.QWidget, Ui_PrefsGlobalWidget): - def __init__(self, parent): + IdEdSettingsDir = 'edSettingsDir' + IdBtSelectSettingsDir = 'btSelectSettingsDir' + + IdCkSettingsAllUsers = 'ckSettingsAllUsers' + + IdEdDownloadDir = 'edDownloadDir' + IdBtSelectDownloadDir = 'btSelectDownloadDir' + + + def __init__(self, parent=None, page=None): QtGui.QWidget.__init__(self, parent) + self.setupUi(self) + self.fcSettingsControler = settings.SettingsControler(config.settings, parent=self) + if page is not None: + page.connect(self.fcSettingsControler, QtCore.SIGNAL('isDirty(bool)'), page.setDirty) + + self.fcSettingsControler.addLineEdit( + self.controlById(self.IdEdSettingsDir), + 'SettingsDir', + ) + self.fcSettingsControler.addCheckBox( + self.controlById(self.IdCkSettingsAllUsers), + 'SettingsAllUsers', + ) + self.fcSettingsControler.addLineEdit( + self.controlById(self.IdEdDownloadDir), + 'DownloadDir', + ) + + bt = self.controlById(self.IdBtSelectSettingsDir) + self.connect(bt, QtCore.SIGNAL('clicked()'), self.onBtSelectSettingsDirClicked) + bt = self.controlById(self.IdBtSelectDownloadDir) + self.connect(bt, QtCore.SIGNAL('clicked()'), self.onBtSelectDownloadDirClicked) + + + def controlById(self, idControl): + return getattr(self, idControl) + + def doApply(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.apply() + return False + + def doRestoreDefaults(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.restoreDefaults() + return False + + ##################### + ## event handlers + ##################### + def onBtSelectSettingsDirClicked(self): + ed = self.controlById(self.IdEdSettingsDir) + directory = QtGui.QFileDialog.getExistingDirectory( + self, + config.FclientAppName + self.trUtf8(' - Select settings directory..'), + ed.text(), + ) + if directory: + ed.setText(directory) + + def onBtSelectDownloadDirClicked(self): + ed = self.controlById(self.IdEdDownloadDir) + directory = QtGui.QFileDialog.getExistingDirectory( + self, + config.FclientAppName + self.trUtf8(' - Select download directory..'), + ed.text(), + ) + if directory: + ed.setText(directory) + #*********************************************************************** # #*********************************************************************** @@ -29,24 +99,22 @@ 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 canHelp(self): return False + def canRestoreDefaults(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 = PrefsGlobalWidget(parent=parent, page=self) self._widget.setVisible(flag) return (createdNew, self._widget) - - #*********************************************************************** # #*********************************************************************** Modified: trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui 2008-07-28 19:25:47 UTC (rev 804) +++ trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui 2008-07-28 19:26:47 UTC (rev 805) @@ -6,37 +6,80 @@ <x>0</x> <y>0</y> <width>465</width> - <height>247</height> + <height>269</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> - <layout class="QGridLayout" > + <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > <widget class="QLabel" name="label" > <property name="text" > - <string>Specify directory to store settings to. If unchecked, settings are stored in an os dependend location.</string> + <string>Specify directory to store settings to.Leave empty to store settings in a location your os feels best with</string> </property> <property name="wordWrap" > <bool>true</bool> </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> </widget> </item> <item row="1" column="0" > <layout class="QHBoxLayout" > <item> - <widget class="QCheckBox" name="ckStoreSettingsLocally" > + <widget class="QLineEdit" name="edSettingsDir" /> + </item> + <item> + <widget class="QPushButton" name="btSelectSettingsDir" > <property name="text" > - <string/> + <string>...</string> </property> </widget> </item> + </layout> + </item> + <item row="2" column="0" > + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>If no path for settings is specified, store settings only for the the current user or for all users?</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QCheckBox" name="ckSettingsAllUsers" > + <property name="text" > + <string>Store settings for all users</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>Default directory to store downloads to </string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item row="5" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout" > <item> - <widget class="QLineEdit" name="edStoreSettingsLocally" /> + <widget class="QLineEdit" name="edDownloadDir" /> </item> <item> - <widget class="QPushButton" name="btStoreSettingsLocally" > + <widget class="QPushButton" name="btSelectDownloadDir" > <property name="text" > <string>...</string> </property> @@ -44,15 +87,15 @@ </item> </layout> </item> - <item row="2" column="0" > - <spacer> + <item row="6" column="0" > + <spacer name="verticalSpacer" > <property name="orientation" > <enum>Qt::Vertical</enum> </property> - <property name="sizeHint" > + <property name="sizeHint" stdset="0" > <size> <width>20</width> - <height>40</height> + <height>38</height> </size> </property> </spacer> Modified: trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py 2008-07-28 19:25:47 UTC (rev 804) +++ trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py 2008-07-28 19:26:47 UTC (rev 805) @@ -2,7 +2,7 @@ # 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 +# Created: Mon Jul 28 21:19:19 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,35 +12,59 @@ class Ui_PrefsGlobalWidget(object): def setupUi(self, PrefsGlobalWidget): PrefsGlobalWidget.setObjectName("PrefsGlobalWidget") - PrefsGlobalWidget.resize(465, 247) - self.gridlayout = QtGui.QGridLayout(PrefsGlobalWidget) - self.gridlayout.setObjectName("gridlayout") + PrefsGlobalWidget.resize(465, 269) + self.gridLayout = QtGui.QGridLayout(PrefsGlobalWidget) + self.gridLayout.setObjectName("gridLayout") self.label = QtGui.QLabel(PrefsGlobalWidget) self.label.setWordWrap(True) + self.label.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) self.label.setObjectName("label") - self.gridlayout.addWidget(self.label, 0, 0, 1, 1) + 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.edSettingsDir = QtGui.QLineEdit(PrefsGlobalWidget) + self.edSettingsDir.setObjectName("edSettingsDir") + self.hboxlayout.addWidget(self.edSettingsDir) + self.btSelectSettingsDir = QtGui.QPushButton(PrefsGlobalWidget) + self.btSelectSettingsDir.setObjectName("btSelectSettingsDir") + self.hboxlayout.addWidget(self.btSelectSettingsDir) + self.gridLayout.addLayout(self.hboxlayout, 1, 0, 1, 1) + self.label_2 = QtGui.QLabel(PrefsGlobalWidget) + self.label_2.setWordWrap(True) + self.label_2.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) + self.ckSettingsAllUsers = QtGui.QCheckBox(PrefsGlobalWidget) + self.ckSettingsAllUsers.setObjectName("ckSettingsAllUsers") + self.gridLayout.addWidget(self.ckSettingsAllUsers, 3, 0, 1, 1) + self.label_3 = QtGui.QLabel(PrefsGlobalWidget) + self.label_3.setWordWrap(True) + self.label_3.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.edDownloadDir = QtGui.QLineEdit(PrefsGlobalWidget) + self.edDownloadDir.setObjectName("edDownloadDir") + self.horizontalLayout.addWidget(self.edDownloadDir) + self.btSelectDownloadDir = QtGui.QPushButton(PrefsGlobalWidget) + self.btSelectDownloadDir.setObjectName("btSelectDownloadDir") + self.horizontalLayout.addWidget(self.btSelectDownloadDir) + self.gridLayout.addLayout(self.horizontalLayout, 5, 0, 1, 1) + spacerItem = QtGui.QSpacerItem(20, 38, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout.addItem(spacerItem, 6, 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)) + self.label.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "Specify directory to store settings to.Leave empty to store settings in a location your os feels best with", None, QtGui.QApplication.UnicodeUTF8)) + self.btSelectSettingsDir.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "...", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "If no path for settings is specified, store settings only for the the current user or for all users?", None, QtGui.QApplication.UnicodeUTF8)) + self.ckSettingsAllUsers.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "Store settings for all users", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "Default directory to store downloads to ", None, QtGui.QApplication.UnicodeUTF8)) + self.btSelectDownloadDir.setText(QtGui.QApplication.translate("PrefsGlobalWidget", "...", 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-28 19:25:39
|
Revision: 804 http://fclient.svn.sourceforge.net/fclient/?rev=804&view=rev Author: jUrner Date: 2008-07-28 19:25:47 +0000 (Mon, 28 Jul 2008) Log Message: ----------- comb over ..apply button is now global Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py Modified: trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-07-28 19:25:01 UTC (rev 803) +++ trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-07-28 19:25:47 UTC (rev 804) @@ -9,16 +9,15 @@ # page.initialize() # page.setVisible(flag) # -# x. apply and resoreDefaults behaviour is not well designed -# apply: aply changes on all pages. isDirty is for all pages -# restoreDfaults: restore defaults of the current page -# x. should restoreDefaults be disabled when already restored? +# x. appply button is global for all pages. if one page is dorty, apply is enabled for all pages +# maybe add a notification to allow for feedback? # x. docs are outdated -# x. UUID is probably not a good idea. use objectName() instead +# x. UUID is maybe not a good idea. maybe use objectName() instead +# x. maybe call close on all pages to allow for cleanup +# x. maybe weakref this thingy +# x. user hits apply then hits cancel. can't tell from the top of my head ...should we undo changes? # #******************************************************************************* - - """Preferences dialog""" from __future__ import absolute_import if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below @@ -270,6 +269,7 @@ self.lastSelectedPage = None self.pageContainer = pageContainer self.pages = pages + self.dirtyPages = [] # buttons handld by the controler self.buttonBoxButtons = { @@ -281,12 +281,10 @@ } # page depandend buttons of the button box self.buttonBoxOptionalButtons = ( - QtGui.QDialogButtonBox.Apply, QtGui.QDialogButtonBox.Help, QtGui.QDialogButtonBox.RestoreDefaults, ) - # dump sections and pages to tree if pages is not None: @@ -318,14 +316,23 @@ self.onStandardButtonClicked ) self.adjustStandardButtons(None) + buttonApply = self.buttonBox.button(QtGui.QDialogButtonBox.Apply) + buttonApply.setEnabled(False) + ################################################ ## slots ################################################ - def onPageDirtyChanged(self, flag): + def onPageDirtyChanged(self, isDirty): + page = self.sender() + if page in self.dirtyPages: + if not isDirty: + self.dirtyPages.remove(page) + else: + if isDirty: + self.dirtyPages.append(page) bt = self.buttonBox.button(QtGui.QDialogButtonBox.Apply) - if bt.isVisible(): - bt.setEnabled(flag) + bt.setEnabled(bool(self.dirtyPages)) def onStandardButtonClicked(self, button): @@ -337,21 +344,26 @@ standardButtonName = self.buttonBoxButtons.get(standardButton, None) if standardButtonName == 'Ok': # handled on DlgPreferences.accept() return - if standardButtonName is not None: + elif standardButtonName == 'Apply': + for page in self.pages.walk(): + if page.isDirty(): + methodName = self.PrefixCapabilityApply + standardButtonName + method = getattr(page, methodName, None) + if method is None: + raise valueError('Pages must provide a "%s" method' % methodName) + if method(): + page.setDirty(False) + elif standardButtonName is not None: methodName = self.PrefixCapabilityApply + standardButtonName method = getattr(page, methodName, None) if method is None: raise valueError('Pages must provide a "%s" method' % methodName) - if method(): - if standardButton == QtGui.QDialogButtonBox.Apply: - page.setDirty(False) - - + method() + ################################################## ## methods ################################################## def adjustStandardButtons(self, page): - for standardButton in self.buttonBoxOptionalButtons: bt = self.buttonBox.button(standardButton) if bt is None: @@ -370,14 +382,7 @@ bt.setEnabled(flag) bt.setVisible(flag) - # enable Apply button if necessary - if flag and standardButton == QtGui.QDialogButtonBox.Apply: - method = getattr(page, self.MethodNameIsDirty, None) - if method is None: - raise valueError('Pages must prvide a "%s" method' % self.MethodNameIsDirty) - bt.setEnabled(method()) - - + def close(self): """Close the controler @note: make shure to call this method on exit to apply outstanding changes @@ -389,6 +394,7 @@ if method is None: raise ValueError('Pages must provide a "%s" method' % self.MethodNameApply) method() + del self.dirtyPages[:] def currentPage(self): @@ -668,13 +674,11 @@ state = cPickle.loads(state) assert isinstance(state, dict) except Exception, d: - print Exception, d return False else: try: self.restoreGeometry(state.get('geometry', None)) except Exception, d: - print 2 return False try: self.controlById(self.IdSplitter).restoreState(state.get('splitter', None)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-28 19:24:52
|
Revision: 803 http://fclient.svn.sourceforge.net/fclient/?rev=803&view=rev Author: jUrner Date: 2008-07-28 19:25:01 +0000 (Mon, 28 Jul 2008) Log Message: ----------- allow adding checkboxes to settings controller Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py Modified: trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py 2008-07-28 12:28:30 UTC (rev 802) +++ trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py 2008-07-28 19:25:01 UTC (rev 803) @@ -395,6 +395,10 @@ #********************************************************************************** # #********************************************************************************** +#TODO: +# +# x. maybe weakref this thingy +#*********************************************************************************** class SettingsControler(QtCore.QObject): """associates widgets to settings and automatically adjusts settings according to widget signals @@ -424,6 +428,12 @@ ######################### ## methods ######################### + def addCheckBox(self, checkBox, settingName): + """adds a (two state for a boolean setting) checkbox to the controler""" + self.objects[checkBox] = settingName + checkBox.setCheckState(QtCore.Qt.Checked if self.settings.value(settingName) else QtCore.Qt.Unchecked) + self.connect(checkBox, QtCore.SIGNAL('stateChanged(int)'), self.onCheckBoxStateChanged) + def addLineEdit(self, lineEdit, settingName): """adds a QLineEdit as controler for the specified setting""" self.objects[lineEdit] = settingName @@ -444,6 +454,9 @@ value = obj.text() elif isinstance(obj, QtGui.QSpinBox): value = obj.value() + elif isinstance(obj, QtGui.QCheckBox): + value = obj.checkState() == QtCore.Qt.Checked + settings[settingName] = value del self.dirtyObjects[:] @@ -451,6 +464,11 @@ self.emit(QtCore.SIGNAL('isDirty(bool)'), False) return True + def close(self): + """closes the controller and clears all references""" + del self.dirtyObjects[:] + self.objects = {} + def restoreDefaults(self): """resores the default settings and updates the values of the controlled widgets accordingly""" for obj, settingName in self.objects.items(): @@ -459,6 +477,8 @@ obj.setText(value) elif isinstance(obj, QtGui.QSpinBox): obj.setValue(value) + elif isinstance(obj, QtGui.QCheckBox): + obj.setCheckState(QtCore.Qt.Checked if value else QtCore.Qt.Unchecked) del self.dirtyObjects[:] self.emit(QtCore.SIGNAL('isDirty(bool)'), False) @@ -467,6 +487,17 @@ ######################### ## event handlers ######################### + def onCheckBoxStateChanged(self, state): + checkBox = self.sender() + settingName = self.objects[checkBox] + if (checkBox.checkState() == QtCore.Qt.Checked) == self.settings.value(settingName): + if checkBox in self.dirtyObjects: + self.dirtyObjects.remove(checkBox) + else: + if checkBox not in self.dirtyObjects: + self.dirtyObjects.append(checkBox) + self.emit(QtCore.SIGNAL('isDirty(bool)'), bool(self.dirtyObjects)) + def onLineEditTextChanged(self, text): lineEdit = self.sender() settingName = self.objects[lineEdit] 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:28:21
|
Revision: 802 http://fclient.svn.sourceforge.net/fclient/?rev=802&view=rev Author: jUrner Date: 2008-07-28 12:28:30 +0000 (Mon, 28 Jul 2008) Log Message: ----------- developement goes on in fclient.lib.fcp Removed Paths: ------------- trunk/fcp2/ 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:21:43
|
Revision: 801 http://fclient.svn.sourceforge.net/fclient/?rev=801&view=rev Author: jUrner Date: 2008-07-28 12:21:52 +0000 (Mon, 28 Jul 2008) Log Message: ----------- auto adjust widgets to settings Modified Paths: -------------- trunk/fclient/src/fclient/impl/ViewConnection.py Modified: trunk/fclient/src/fclient/impl/ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-28 12:20:45 UTC (rev 800) +++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-28 12:21:52 UTC (rev 801) @@ -65,11 +65,45 @@ class Settings(config.SettingsBase): _key_ = config.IdViewConnectionWidget _settings_ = ( + ('FcpAutoConnect', 'Bool', True, config.SettingScopeUser), + ('FcpConnectionName', 'String', config.FclientConnectionName, config.SettingScopeExpert), + ('FcpConnectionHost', 'String', fcp2.Client.DefaultFcpHost, config.SettingScopeUser), + ('FcpConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort, config.SettingScopeUser), ('FcpConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert), ('FcpConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), ('FcpPollTimerTimeout', 'UInt', 200, config.SettingScopeExpert), + + ('FproxyConnectionHost', 'String','127.0.0.1', config.SettingScopeUser), + ('FproxyConnectionPort', 'UInt', 8888, config.SettingScopeUser), ) + + def setValues(self, **kws): + config.SettingsBase.setValues(self, **kws) + parent = self.parent() + + # set fcp connection params + if 'FcpConnectionHost' in kws: + edHost = parent.controlById(parent.IdEdFcpConnectionHost) + edHost.setText(self.value('FcpConnectionHost')) + + if 'FcpConnectionPort' in kws: + spinPort = parent.controlById(parent.IdFcpSpinFcpConnectionPort) + spinPort.setValue(self.value('FcpConnectionPort')) + + if 'FcpAutoConnect' in kws: + ck = parent.controlById(parent.IdCkFcpAutoConnect) + ck.setChecked(self.value('FcpAutoConnect')) + + # set fproxy connection params + if 'FproxyConnectionHost' in kws: + edHost = parent.controlById(parent.IdEdFproxyConnectionHost) + edHost.setText(self.value('FproxyConnectionHost')) + + if 'FproxyConnectionPort' in kws: + spinPort = parent.controlById(parent.IdFproxySpinConnectionPort) + spinPort.setValue(self.value('FproxyConnectionPort')) + class ConnectionViewObject(config.ViewObject): def __init__(self, parent): @@ -91,7 +125,7 @@ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) def start(self, settings): - config.fcpClient.setConnectionName(config.settings.value('FcpConnectionName')) + config.fcpClient.setConnectionName(settings.value('FcpConnectionName')) self.fcpIterConnect = config.fcpClient.iterConnect( duration=settings.value('FcpConnectionTimerMaxDuration'), timeout=0 @@ -134,7 +168,7 @@ class ViewConnectionWidget(QtGui.QWidget, Ui_ViewConnectionWidget): IdBtConnect = 'btConnect' - IdEdFcpFcpConnectionHost = 'edFcpConnectionHost' + IdEdFcpConnectionHost = 'edFcpConnectionHost' IdFcpSpinFcpConnectionPort = 'spinFcpConnectionPort' IdCkFcpAutoConnect = 'ckFcpAutoConnect' @@ -144,8 +178,15 @@ def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): QtGui.QWidget.__init__(self, parent) + self.setupUi(self) + + self._isCreated = False + config.ObjectRegistry.register(self) + self.fcSettings = Settings(self).restore() + self.fcActions = Actions(self) + self.fcViewObject = ConnectionViewObject(self) + self.fcGlobalFeedback = GlobalFeedback(self,idGlobalFeedback) - self._isCreated = False self._connectionTimer = ConnectionTimer(self) self._pollTimer = PollTimer(self) self._fcpEventonrs = ( @@ -154,26 +195,26 @@ ) config.fcpClient.events += self._fcpEventonrs self._mainWindowMenus = () - - - self.setupUi(self) - config.ObjectRegistry.register(self) - self.fcSettings = Settings().restore() - self.fcActions = Actions(self) - self.fcViewObject = ConnectionViewObject(self) - self.fcGlobalFeedback = GlobalFeedback(self,idGlobalFeedback) - - + ######################################### ## methods ######################################### + def connected(self): + return self.controlById(self.IdBtConnect).isChecked() + def controlById(self, idControl): return getattr(self, idControl) - def populateMenu(self, menu): return menu - + + def setConnected(self, flag): + bt = self.controlById(self.IdBtConnect) + if (bt.isChecked() and not flag) or (not bt.isChecked() and flag): + bt.click() + return True + return False + ######################################### ## view methods ######################################### @@ -189,36 +230,33 @@ def hideEvent(self, event): self.fcGlobalFeedback.setVisible(False) - def showEvent(self, event): self.fcGlobalFeedback.setVisible(True) if self._isCreated: return self._isCreated = True + + # setup fcp host / port / name - edHost = self.controlById(self.IdEdFcpFcpConnectionHost) - edHost.setText(config.settings.value('FcpConnectionHost')) + edHost = self.controlById(self.IdEdFcpConnectionHost) self.connect(edHost, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionHostChanged) spinPort = self.controlById(self.IdFcpSpinFcpConnectionPort) spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable - spinPort.setValue(config.settings.value('FcpConnectionPort')) self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFcpConnectionPortChanged) - doAutoConnect = config.settings.value('FcpAutoConnect') + doAutoConnect = self.fcSettings.value('FcpAutoConnect') ck = self.controlById(self.IdCkFcpAutoConnect) ck.setChecked(doAutoConnect) self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged) # setup fproxy host / port edHost = self.controlById(self.IdEdFproxyConnectionHost) - edHost.setText(config.settings.value('FproxyConnectionHost')) self.connect(edHost, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFproxyConnectionHostChanged) spinPort = self.controlById(self.IdFproxySpinConnectionPort) spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable - spinPort.setValue(config.settings.value('FproxyConnectionPort')) self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFproxyConnectionPortChanged) bt = self.controlById(self.IdBtConnect) @@ -232,7 +270,7 @@ def retranslateUi(self, w): Ui_ViewConnectionWidget.retranslateUi(self, w) bt = self.controlById(self.IdBtConnect) - bt.setText(self.trUtf8('Disconnect') if bt.isChecked() else self.trUtf8('Connect')) + bt.setText(self.trUtf8('Disconnect') if self.connected() else self.trUtf8('Connect')) ######################################### @@ -253,21 +291,20 @@ def onCkFcpAutoConnectStateChanged(self, state): - config.settings.setValues(FcpAutoConnect=state == QtCore.Qt.Checked) + self.fcSettings.setValues(FcpAutoConnect=state == QtCore.Qt.Checked) def onEdFcpConnectionHostChanged(self, text): - config.settings.setValues(FcpConnectionHost=text) + self.fcSettings.setValues(FcpConnectionHost=text) def onSpinFcpConnectionPortChanged(self, value): - config.settings.setValues(FcpConnectionPort=value) + self.fcSettings.setValues(FcpConnectionPort=value) def onEdFproxyConnectionHostChanged(self, text): - config.settings.setValues(FproxyConnectionHost=text) + self.fcSettings.setValues(FproxyConnectionHost=text) def onSpinFproxyConnectionPortChanged(self, value): - config.settings.setValues(FproxyConnectionPort=value) + self.fcSettings.setValues(FproxyConnectionPort=value) - ######################################### ## fcp event onrs ######################################### 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:20:35
|
Revision: 800 http://fclient.svn.sourceforge.net/fclient/?rev=800&view=rev Author: jUrner Date: 2008-07-28 12:20:45 +0000 (Mon, 28 Jul 2008) Log Message: ----------- some fixes related to movin connection settings backto connection widget 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-28 12:19:49 UTC (rev 799) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-28 12:20:45 UTC (rev 800) @@ -237,15 +237,18 @@ ) def setValues(self, **kws): + config.SettingsBase.setValues(self, **kws) + autoLoadImages = kws.get('AutoLoadImages', None) if autoLoadImages is not None: browserWidget = self.parent() tabWidget = browserWidget.controlById(browserWidget.IdTabBrowsers) for i in xrange(tabWidget.count()): browser = tabWidget.widget(i) - settings = browser.settings() - settings.setAttribute(settings.AutoLoadImages, autoLoadImages) - config.SettingsBase.setValues(self, **kws) + if hasattr(browser, 'settings'): # QTabWidget may return a Null QWidget + settings = browser.settings() + settings.setAttribute(settings.AutoLoadImages, autoLoadImages) + #backIsClose = kws.get('BackIsClose', None) #if backIsClose is not None: @@ -437,6 +440,7 @@ self.setupUi(self) config.ObjectRegistry.register(self) + self._isCreated = False self._initialConfigDataArrived = False self.fcSettings = BrowserWidgetSettings(self).restore() @@ -471,10 +475,6 @@ frameSearch = self.controlById(self.IdFrameSearch) frameSearch.setVisible(False) - # fire up a new broser to make a start - self.newBrowser(title=self.trUtf8('Waiting for fproxy')) - self.fcActions['ActionGoToHomePage'].trigger() - ######################################### ## private methods ######################################### @@ -587,10 +587,14 @@ if browser is None: return False + connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None) + if connectionWidget is None: + raise ValueError('No connection widget found') + # load url url.setScheme('http') - url.setHost(config.settings.value('FproxyConnectionHost')) - url.setPort(config.settings.value('FproxyConnectionPort')) + url.setHost(connectionWidget.fcSettings.value('FproxyConnectionHost')) + url.setPort(connectionWidget.fcSettings.value('FproxyConnectionPort')) tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Loading'))) addressBar.setText(url.toString()) lastBrowserState = browser.userData() @@ -676,6 +680,11 @@ def showEvent(self, event): self.fcGlobalFeedback.setVisible(True) + if not self._isCreated: + self._isCreated = True + # fire up a new broser to make a start + self.newBrowser(title=self.trUtf8('Waiting for fproxy')) + self.fcActions['ActionGoToHomePage'].trigger() def viewClose(self): pass 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:19:40
|
Revision: 799 http://fclient.svn.sourceforge.net/fclient/?rev=799&view=rev Author: jUrner Date: 2008-07-28 12:19:49 +0000 (Mon, 28 Jul 2008) Log Message: ----------- reworkes prefs page to use new settings controller Modified Paths: -------------- trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py Modified: trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-28 12:19:10 UTC (rev 798) +++ trunk/fclient/src/fclient/impl/PrefsConnectionWidget.py 2008-07-28 12:19:49 UTC (rev 799) @@ -1,4 +1,12 @@ - +""" +""" +#******************************************************************************* +#TODO: +# +# x. should we reconnect when the user changes the fcp connection name? +# +# +#****************************************************************************** from __future__ import absolute_import if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below @@ -9,6 +17,7 @@ from . import config from .lib.qt4ex import dlgpreferences +from .lib.qt4ex.lib import settings from .tpls.Ui_PrefsConnectionExpertSettingsTpl import Ui_PrefsConnectionExpertSettings #********************************************************************************** @@ -21,39 +30,52 @@ IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout' IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout' - def __init__(self, parent=None): + + def __init__(self, parent=None, page=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) - + self.fcSettingsControler = None + + # 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)) - - - - + if connectionWidget is None: + self.setEnabled(False) + else: + self.fcSettingsControler = settings.SettingsControler(connectionWidget.fcSettings, parent=self) + if page is not None: + page.connect(self.fcSettingsControler, QtCore.SIGNAL('isDirty(bool)'), page.setDirty) + self.fcSettingsControler.addLineEdit( + self.controlById(self.IdEdFcpConnectionName), + 'FcpConnectionName', + ) + self.fcSettingsControler.addSpinBox( + self.controlById(self.IdSpinFcpConnectionTimerMaxDuration), + 'FcpConnectionTimerMaxDuration', + ) + self.fcSettingsControler.addSpinBox( + self.controlById(self.IdSpinConnectionTimerTimeout), + 'FcpConnectionTimerTimeout', + ) + self.fcSettingsControler.addSpinBox( + self.controlById(self.IdSpinFcpPollTimerTimeout), + 'FcpPollTimerTimeout', + ) + def controlById(self, idControl): return getattr(self, idControl) - - def onEdFcpConnectionNameChanged(self, text): - config.settings.setValues(FcpConnectionName=text) + def doApply(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.apply() + return False + def doRestoreDefaults(self): + if self.fcSettingsControler is not None: + return self.fcSettingsControler.restoreDefaults() + return False + #*********************************************************************** # #*********************************************************************** @@ -64,19 +86,29 @@ 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 canHelp(self): return False + def canRestoreDefaults(self): + return True + def doApply(self): + self._widget.doApply() + return True + + def doRestoreDefaults(self): + self._widget.doRestoreDefaults() + return True + def setVisible(self, parent, flag): createdNew = False if flag and self._widget is None: createdNew = True - self._widget = PrefsConnectionExpertSettingsWidget(parent) + self._widget = PrefsConnectionExpertSettingsWidget(parent, page=self) + self.connect(self._widget, QtCore.SIGNAL('setDirty(bool)'), self.setDirty) self._widget.setVisible(flag) return (createdNew, self._widget) 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:19:03
|
Revision: 798 http://fclient.svn.sourceforge.net/fclient/?rev=798&view=rev Author: jUrner Date: 2008-07-28 12:19:10 +0000 (Mon, 28 Jul 2008) Log Message: ----------- adjust to recent changes Modified Paths: -------------- trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py Modified: trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py =================================================================== --- trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py 2008-07-28 12:18:41 UTC (rev 797) +++ trunk/fclient/src/fclient/impl/PrefsBrowserWidget.py 2008-07-28 12:19:10 UTC (rev 798) @@ -73,13 +73,12 @@ 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 canHelp(self): return False def setVisible(self, parent, flag): createdNew = False @@ -94,10 +93,6 @@ self._widget.apply() return True - def doOk(self): - return True - - #*********************************************************************** # #*********************************************************************** 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:18:34
|
Revision: 797 http://fclient.svn.sourceforge.net/fclient/?rev=797&view=rev Author: jUrner Date: 2008-07-28 12:18:41 +0000 (Mon, 28 Jul 2008) Log Message: ----------- added a controler to associate widgets to settings Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py Modified: trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py 2008-07-28 12:18:20 UTC (rev 796) +++ trunk/fclient/src/fclient/impl/lib/qt4ex/lib/settings.py 2008-07-28 12:18:41 UTC (rev 797) @@ -166,6 +166,7 @@ """ settings = self.settingsObject() settings.beginGroup(self._key_) + mySettings = {} try: for name in self._settingsOrder: typeSetting = self.type(name) @@ -181,10 +182,12 @@ obj, ok = tools.castVariant(v, typeSetting) else: obj, ok = getattr(self, 'to' + typeSetting)(settings, name, v) - self._settingsDict[name].value = obj if ok else self.default(name) + mySettings[name] = obj if ok else self.default(name) + #self._settingsDict[name].value = obj if ok else self.default(name) finally: settings.endGroup() self.finalizeSettingsObject(settings) + self.setValues(**mySettings) return self @@ -389,5 +392,100 @@ return string, True return None, False +#********************************************************************************** +# +#********************************************************************************** +class SettingsControler(QtCore.QObject): + """associates widgets to settings and automatically adjusts settings according to widget signals + + @signal: isDirty(bool) . emitted when the dirty status of the controler changes + + + sample:: + class MySettings(qt4ex.lib.settings.SettingsBase): + _key_ = 'MySettingsKey' + _settings_ = ( + ('MySetting1', 'Bool', QtCore.QString('MyDefaultValue')), + ) + + mySettings = MySettings() + myControler = SettingsControler(mySettings) + myControler.addLineEdit(myLineEdit, 'MySetting1') + + myObject.connect(myControler, QtCore.SIGNAL('isDirty(bool)', myObject.whatever) + + """ + def __init__(self, settings, parent=None): + QtCore.QObject.__init__(self, parent) + self.dirtyObjects = [] + self.objects = {} + self.settings = settings + + ######################### + ## methods + ######################### + def addLineEdit(self, lineEdit, settingName): + """adds a QLineEdit as controler for the specified setting""" + self.objects[lineEdit] = settingName + lineEdit.setText(self.settings.value(settingName)) + self.connect(lineEdit, QtCore.SIGNAL('textChanged(const QString &)'), self.onLineEditTextChanged) + def addSpinBox(self, spinBox, settingName): + """adds a QSpinBox as controler for the specified setting""" + self.objects[spinBox] = settingName + spinBox.setValue(self.settings.value(settingName)) + self.connect(spinBox, QtCore.SIGNAL('valueChanged(int)'), self.onSpinBoxValueChanged) + + def apply(self): + """applies the values of the controled widgets to the settings object""" + settings = {} + for obj, settingName in self.objects.items(): + if isinstance(obj, QtGui.QLineEdit): + value = obj.text() + elif isinstance(obj, QtGui.QSpinBox): + value = obj.value() + settings[settingName] = value + + del self.dirtyObjects[:] + self.settings.setValues(**settings) + self.emit(QtCore.SIGNAL('isDirty(bool)'), False) + return True + + def restoreDefaults(self): + """resores the default settings and updates the values of the controlled widgets accordingly""" + for obj, settingName in self.objects.items(): + value = self.settings.default(settingName) + if isinstance(obj, QtGui.QLineEdit): + obj.setText(value) + elif isinstance(obj, QtGui.QSpinBox): + obj.setValue(value) + + del self.dirtyObjects[:] + self.emit(QtCore.SIGNAL('isDirty(bool)'), False) + return True + + ######################### + ## event handlers + ######################### + def onLineEditTextChanged(self, text): + lineEdit = self.sender() + settingName = self.objects[lineEdit] + if lineEdit.text() == self.settings.value(settingName): + if lineEdit in self.dirtyObjects: + self.dirtyObjects.remove(lineEdit) + else: + if lineEdit not in self.dirtyObjects: + self.dirtyObjects.append(lineEdit) + self.emit(QtCore.SIGNAL('isDirty(bool)'), bool(self.dirtyObjects)) + + def onSpinBoxValueChanged(self, n): + spinBox= self.sender() + settingName = self.objects[spinBox] + if spinBox.value() == self.settings.value(settingName): + if spinBox in self.dirtyObjects: + self.dirtyObjects.remove(spinBox) + else: + if spinBox not in self.dirtyObjects: + self.dirtyObjects.append(spinBox) + self.emit(QtCore.SIGNAL('isDirty(bool)'), bool(self.dirtyObjects)) \ 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-28 12:18:13
|
Revision: 796 http://fclient.svn.sourceforge.net/fclient/?rev=796&view=rev Author: jUrner Date: 2008-07-28 12:18:20 +0000 (Mon, 28 Jul 2008) Log Message: ----------- some fixes. dlg still needs rework Modified Paths: -------------- trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py Modified: trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py =================================================================== --- trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-07-28 12:17:35 UTC (rev 795) +++ trunk/fclient/src/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-07-28 12:18:20 UTC (rev 796) @@ -1,8 +1,4 @@ -"""Preferences dialog""" -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__)] - +#**************************************************************************** # TODO: # # x. how to set some reasonable initial size? Mabe split the page population @@ -13,8 +9,20 @@ # page.initialize() # page.setVisible(flag) # +# x. apply and resoreDefaults behaviour is not well designed +# apply: aply changes on all pages. isDirty is for all pages +# restoreDfaults: restore defaults of the current page +# x. should restoreDefaults be disabled when already restored? +# x. docs are outdated +# x. UUID is probably not a good idea. use objectName() instead +# +#******************************************************************************* +"""Preferences dialog""" +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, os import cPickle @@ -74,7 +82,6 @@ 'children': [], 'isDirty': False, 'lastSelectedChildPage': None, - 'parent': None, 'userData': None, 'uuid': uuid, } @@ -84,7 +91,7 @@ children = self._pageData['children'] for i in others: children.append(i) - i._pageData['parent'] = self + i.setParent(self) return self def canApply(self): @@ -121,12 +128,6 @@ """ return True - def doOk(self): - """Should apply changes - @return: True on success, False otherwise - """ - return True - def doRestoreDefaults(self): """Should restore defaults @return: True on success, False otherwise @@ -143,6 +144,11 @@ """Should return a flag indicating if the page has unsaved changes""" return self._pageData['isDirty'] + #TODO: looks shitty + def isRoot(self): + """""" + return not isinstance(self.parent(), self.__class__) + def lastSelectedChildPage(self): """Returns the uuid of the most recently selected child page of the current page""" return self._pageData['lastSelectedChildPage'] @@ -154,10 +160,6 @@ if page.uuid() == uuid: return page - def parent(self): - """Returns the parent page of the page""" - return self._pageData['parent'] - def setDirty(self, flag): """Sets or clears the dirty flag""" self._pageData['isDirty'] = bool(flag) @@ -231,7 +233,7 @@ MethodNameApply = 'doApply' - def __init__(self, ui, cb, pageContainer, buttonBox, maxPageDepth=None, pages=None): + def __init__(self, parent, cb, pageContainer, buttonBox, maxPageDepth=None, pages=None): """ @param ui: (QDialog) parent @param cb: callback @@ -260,7 +262,7 @@ return = will be passed in the next call of PageAdd to all emidiate child pages """ - QtCore.QObject.__init__(self, ui) + QtCore.QObject.__init__(self, parent) self.buttonBox = buttonBox self.cb = cb @@ -268,8 +270,7 @@ self.lastSelectedPage = None self.pageContainer = pageContainer self.pages = pages - self.ui = ui - + # buttons handld by the controler self.buttonBoxButtons = { QtGui.QDialogButtonBox.Apply: 'Apply', @@ -288,10 +289,11 @@ # dump sections and pages to tree if pages is not None: - + # drop root item enum = iter(pages.walk(report=True)) flag, root = enum.next() + root.setParent(self) # dump items parent = self.cb(self.PageQueryParent, None, None) @@ -316,9 +318,7 @@ self.onStandardButtonClicked ) self.adjustStandardButtons(None) - - - + ################################################ ## slots ################################################ @@ -332,14 +332,16 @@ if self.lastSelectedPage is None: return - page = self.lastSelectedPage[0] + page = self.currentPage() standardButton = self.buttonBox.standardButton(button) standardButtonName = self.buttonBoxButtons.get(standardButton, None) + if standardButtonName == 'Ok': # handled on DlgPreferences.accept() + return if standardButtonName is not None: methodName = self.PrefixCapabilityApply + standardButtonName method = getattr(page, methodName, None) if method is None: - raise valueError('Pages must prvide a "%s" method' % methodName) + raise valueError('Pages must provide a "%s" method' % methodName) if method(): if standardButton == QtGui.QDialogButtonBox.Apply: page.setDirty(False) @@ -389,7 +391,6 @@ method() - def currentPage(self): """Returns the currently displayed page or None""" if self.lastSelectedPage is not None: @@ -433,7 +434,7 @@ ) # inform parent about changes - if page.parent() is not None: + if not page.isRoot(): page.parent().setLastSelectedChildPage(page.uuid()) # enshure enough space is available for the widget @@ -713,6 +714,8 @@ while True: out.prepend(page.displayName() + '/') #out.append(page.displayName()) + if page.isRoot(): + break page = page.parent() if page.parent() is None: break @@ -777,8 +780,7 @@ def __init__(self, *args): Page.__init__(self, *args) self._widget = None - self.setDirty(True) - + def displayName(self): return self.uuid() def canApply(self): return True def canHelp(self): return True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |