fclient-commit Mailing List for fclient (Page 9)
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-27 11:34:31
|
Revision: 770 http://fclient.svn.sourceforge.net/fclient/?rev=770&view=rev Author: jUrner Date: 2008-07-27 11:34:40 +0000 (Sun, 27 Jul 2008) Log Message: ----------- naming Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py trunk/fclient/src/fclient/impl/ViewBrowser.py Added Paths: ----------- trunk/fclient/src/fclient/impl/ViewConnection.py Removed Paths: ------------- trunk/fclient/src/fclient/impl/Ui_ViewConnection.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:32:55 UTC (rev 769) +++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:34:40 UTC (rev 770) @@ -9,7 +9,7 @@ from .impl.MainWindow import MainWindow from .impl.View import ViewWidget from .impl.ViewBrowser import ViewBrowserWidget -from .impl.Ui_ViewConnection import ViewConnectionWidget +from .impl.ViewConnection import ViewConnectionWidget from .impl.Ui_ViewDownloads import ViewDownloadsWidget from .impl.Ui_ViewLogger import ViewLoggerWidget #************************************************************* Deleted: trunk/fclient/src/fclient/impl/Ui_ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewConnection.py 2008-07-27 11:32:55 UTC (rev 769) +++ trunk/fclient/src/fclient/impl/Ui_ViewConnection.py 2008-07-27 11:34:40 UTC (rev 770) @@ -1,310 +0,0 @@ -#********************************************************************* -#TODO: -# x. setting fcp connection params currently won't reset connection. how to handle? -# -# -#********************************************************************* - - - -#********************************************************************* -#NOTES: -# -# current handling is: -# 1. connect to fcp client -# 2. query config -# -# all listebners interested in fcp client should take arrival of config -# as signal to start doing whatever -# -#********************************************************************* - -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -from PyQt4 import QtCore, QtGui - -from . import config -from .lib import fcp2 -from .Ui_DlgConnectionExpertSettings import ConnectionExpertSettingsDlg - -from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget -#********************************************************************************** -# -#********************************************************************************** -class Actions(config.ActionsBase): - pass - - -class GlobalFeedback(config.GlobalFeedbackBase): - """wrapper for global statusbar widgets, menus""" - - def __init__(self, parent,idGlobalFeedback): - config.GlobalFeedbackBase.__init__(self, parent,idGlobalFeedback) - - # menus - self.menus = [] - if self.menuBar is not None and hasattr(parent, 'fcViewObject'): - menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) - parent.populateMenu(menu) - self.menus.append(menu) - self.menuBar.addViewMenu(menu) - - # status bar widgets - self.label1 = None - #if self.statusBar is not None: - # self.label1 = QtGui.QLabel('foo here', self.statusBar) - - def setVisible(self, flag): - for menu in self.menus: - menu.children()[0].setVisible(flag) - if self.label1 is not None: - self.label1.setVisible(flag) - - -class Settings(config.SettingsBase): - _key_ = config.IdViewConnectionWidget - _settings_ = ( - ('FcpConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert), - ('FcpConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), - ('FcpPollTimerTimeout', 'UInt', 200, config.SettingScopeExpert), - ) - -class ConnectionViewObject(config.ViewObject): - - def __init__(self, parent): - config.ViewObject. __init__(self, parent) - - self.name=parent.objectName() - self.displayName=self.trUtf8('Connection') - self.icon=QtGui.QIcon() - - -#********************************************************************************** -# -#********************************************************************************** -class ConnectionTimer(QtCore.QTimer): - - def __init__(self,parent): - QtCore.QTimer.__init__(self, parent) - self.fcpIterConnect = None - self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) - - def start(self, settings): - config.fcpClient.setConnectionName(config.settings.value('FcpConnectionName')) - self.fcpIterConnect = config.fcpClient.iterConnect( - duration=settings.value('FcpConnectionTimerMaxDuration'), - timeout=0 - ) - if not self.onNext(): - QtCore.QTimer.start(self, settings.value('FcpConnectionTimerTimeout')) - - def onNext(self): - try: - result = self.fcpIterConnect.next() - except StopIteration: - self.stop() - else: - if result is not None: - self.stop() - # 1st thing todo after connect is to query the config from the node so all - # listeners right away so not everyone has to query it so. needs more details - # or joins the gui later.. feel free to query again - config.fcpClient.getConfig() - return True - return False - - -class PollTimer(QtCore.QTimer): - - def __init__(self,parent): - QtCore.QTimer.__init__(self, parent) - self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) - - def start(self, settings): - QtCore.QTimer.start(self, settings.value('FcpPollTimerTimeout')) - - def onNext(self): - if config.fcpClient.isConnected(): - result = config.fcpClient.next() - -#*********************************************************************** -# -#*********************************************************************** -class ViewConnectionWidget(QtGui.QWidget, Ui_ViewConnectionWidget): - - IdBtConnect = 'btConnect' - IdEdFcpFcpConnectionHost = 'edFcpConnectionHost' - IdFcpSpinFcpConnectionPort = 'spinFcpConnectionPort' - IdCkFcpAutoConnect = 'ckFcpAutoConnect' - IdBtFcpConnectionMore = 'btFcpConnectionMore' - - IdEdFproxyConnectionHost = 'edFproxyConnectionHost' - IdFproxySpinConnectionPort = 'spinFproxyConnectionPort' - - - def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): - QtGui.QWidget.__init__(self, parent) - - self._isCreated = False - self._connectionTimer = ConnectionTimer(self) - self._pollTimer = PollTimer(self) - self._fcpEventonrs = ( - (config.fcpClient.events.ClientConnected, self.onFcpClientConected), - (config.fcpClient.events.ClientDisconnected, self.onFcpClientDisconected), - ) - 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 controlById(self, idControl): - return getattr(self, idControl) - - - def populateMenu(self, menu): - return menu - - ######################################### - ## view methods - ######################################### - def viewClose(self): - config.fcpClient.events -= self._fcpEventonrs - - ######################################### - ## overwritten events - ######################################### - def closeEvent(self, event): - self.viewClose() - - 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')) - 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') - ck = self.controlById(self.IdCkFcpAutoConnect) - ck.setChecked(doAutoConnect) - self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged) - - bt = self.controlById(self.IdBtFcpConnectionMore) - self.connect(bt, QtCore.SIGNAL('clicked()'), self.onBtFcpConnectionMoreClicked) - - # setup fproxy host / port - edHost = self.controlById(self.IdEdFproxyConnectionHost) - edHost.setText(config.settings.value('FproxyConnectionHost')) - 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) - self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.onBtConnectClicked) - if doAutoConnect: - self.controlById(self.IdBtConnect).click() - - ######################################## - ## overwritten methods - ######################################### - 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')) - - - ######################################### - ## event onrs - ######################################### - def onBtConnectClicked(self, isChecked): - bt = self.controlById(self.IdBtConnect) - bt.setText(self.trUtf8('Disconnect') if isChecked else self.trUtf8('Connect')) - if isChecked: - if config.fcpClient.isConnected(): - config.fcpClient.close() - self._connectionTimer.start(self.fcSettings) - else: - self._connectionTimer.stop() - if config.fcpClient.isConnected(): - self._pollTimer.stop() - config.fcpClient.close() - - - def onCkFcpAutoConnectStateChanged(self, state): - config.settings.setValues(FcpAutoConnect=state == QtCore.Qt.Checked) - - def onEdFcpConnectionHostChanged(self, text): - config.settings.setValues(FcpConnectionHost=text) - - def onSpinFcpConnectionPortChanged(self, value): - config.settings.setValues(FcpConnectionPort=value) - - def onBtFcpConnectionMoreClicked(self): - dlg = ConnectionExpertSettingsDlg(self) - if dlg.exec_() == dlg.Accepted: - pass - - def onEdFproxyConnectionHostChanged(self, text): - config.settings.setValues(FproxyConnectionHost=text) - - def onSpinFproxyConnectionPortChanged(self, value): - config.settings.setValues(FproxyConnectionPort=value) - - - ######################################### - ## fcp event onrs - ######################################### - def onFcpClientDisconected(self, event, msg): - bt = self.controlById(self.IdBtConnect) - if bt.isChecked(): - bt.click() - - def onFcpClientConected(self, event, msg): - self._pollTimer.start(self.fcSettings) - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - from . import View, Ui_ViewLogger - - app = QtGui.QApplication(sys.argv) - w = Ui_View.ViewWidget(None) - w.addTopViews(ViewConnectionWidget(None)) - w.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None)) - - w.show() - res = app.exec_() - sys.exit(res) - - - Modified: trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:32:55 UTC (rev 769) +++ trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:34:40 UTC (rev 770) @@ -254,7 +254,7 @@ if __name__ == '__main__': import sys from . import View - from . import Ui_ViewConnection + from . import ViewConnection from . import Ui_ViewLogger from . import MainWindow Modified: trunk/fclient/src/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:32:55 UTC (rev 769) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:34:40 UTC (rev 770) @@ -977,7 +977,7 @@ from .Ui_ViewLogger import ViewLoggerWidget from .MainWindow import MainWindow from .View import ViewWidget - from .Ui_ViewConnection import ViewConnectionWidget + from .ViewConnection import ViewConnectionWidget from .Ui_ViewDownloads import ViewDownloadsWidget app = QtGui.QApplication(sys.argv) Added: trunk/fclient/src/fclient/impl/ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewConnection.py (rev 0) +++ trunk/fclient/src/fclient/impl/ViewConnection.py 2008-07-27 11:34:40 UTC (rev 770) @@ -0,0 +1,310 @@ +#********************************************************************* +#TODO: +# x. setting fcp connection params currently won't reset connection. how to handle? +# +# +#********************************************************************* + + + +#********************************************************************* +#NOTES: +# +# current handling is: +# 1. connect to fcp client +# 2. query config +# +# all listebners interested in fcp client should take arrival of config +# as signal to start doing whatever +# +#********************************************************************* + +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +from PyQt4 import QtCore, QtGui + +from . import config +from .lib import fcp2 +from .Ui_DlgConnectionExpertSettings import ConnectionExpertSettingsDlg + +from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget +#********************************************************************************** +# +#********************************************************************************** +class Actions(config.ActionsBase): + pass + + +class GlobalFeedback(config.GlobalFeedbackBase): + """wrapper for global statusbar widgets, menus""" + + def __init__(self, parent,idGlobalFeedback): + config.GlobalFeedbackBase.__init__(self, parent,idGlobalFeedback) + + # menus + self.menus = [] + if self.menuBar is not None and hasattr(parent, 'fcViewObject'): + menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) + parent.populateMenu(menu) + self.menus.append(menu) + self.menuBar.addViewMenu(menu) + + # status bar widgets + self.label1 = None + #if self.statusBar is not None: + # self.label1 = QtGui.QLabel('foo here', self.statusBar) + + def setVisible(self, flag): + for menu in self.menus: + menu.children()[0].setVisible(flag) + if self.label1 is not None: + self.label1.setVisible(flag) + + +class Settings(config.SettingsBase): + _key_ = config.IdViewConnectionWidget + _settings_ = ( + ('FcpConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert), + ('FcpConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), + ('FcpPollTimerTimeout', 'UInt', 200, config.SettingScopeExpert), + ) + +class ConnectionViewObject(config.ViewObject): + + def __init__(self, parent): + config.ViewObject. __init__(self, parent) + + self.name=parent.objectName() + self.displayName=self.trUtf8('Connection') + self.icon=QtGui.QIcon() + + +#********************************************************************************** +# +#********************************************************************************** +class ConnectionTimer(QtCore.QTimer): + + def __init__(self,parent): + QtCore.QTimer.__init__(self, parent) + self.fcpIterConnect = None + self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) + + def start(self, settings): + config.fcpClient.setConnectionName(config.settings.value('FcpConnectionName')) + self.fcpIterConnect = config.fcpClient.iterConnect( + duration=settings.value('FcpConnectionTimerMaxDuration'), + timeout=0 + ) + if not self.onNext(): + QtCore.QTimer.start(self, settings.value('FcpConnectionTimerTimeout')) + + def onNext(self): + try: + result = self.fcpIterConnect.next() + except StopIteration: + self.stop() + else: + if result is not None: + self.stop() + # 1st thing todo after connect is to query the config from the node so all + # listeners right away so not everyone has to query it so. needs more details + # or joins the gui later.. feel free to query again + config.fcpClient.getConfig() + return True + return False + + +class PollTimer(QtCore.QTimer): + + def __init__(self,parent): + QtCore.QTimer.__init__(self, parent) + self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) + + def start(self, settings): + QtCore.QTimer.start(self, settings.value('FcpPollTimerTimeout')) + + def onNext(self): + if config.fcpClient.isConnected(): + result = config.fcpClient.next() + +#*********************************************************************** +# +#*********************************************************************** +class ViewConnectionWidget(QtGui.QWidget, Ui_ViewConnectionWidget): + + IdBtConnect = 'btConnect' + IdEdFcpFcpConnectionHost = 'edFcpConnectionHost' + IdFcpSpinFcpConnectionPort = 'spinFcpConnectionPort' + IdCkFcpAutoConnect = 'ckFcpAutoConnect' + IdBtFcpConnectionMore = 'btFcpConnectionMore' + + IdEdFproxyConnectionHost = 'edFproxyConnectionHost' + IdFproxySpinConnectionPort = 'spinFproxyConnectionPort' + + + def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): + QtGui.QWidget.__init__(self, parent) + + self._isCreated = False + self._connectionTimer = ConnectionTimer(self) + self._pollTimer = PollTimer(self) + self._fcpEventonrs = ( + (config.fcpClient.events.ClientConnected, self.onFcpClientConected), + (config.fcpClient.events.ClientDisconnected, self.onFcpClientDisconected), + ) + 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 controlById(self, idControl): + return getattr(self, idControl) + + + def populateMenu(self, menu): + return menu + + ######################################### + ## view methods + ######################################### + def viewClose(self): + config.fcpClient.events -= self._fcpEventonrs + + ######################################### + ## overwritten events + ######################################### + def closeEvent(self, event): + self.viewClose() + + 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')) + 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') + ck = self.controlById(self.IdCkFcpAutoConnect) + ck.setChecked(doAutoConnect) + self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged) + + bt = self.controlById(self.IdBtFcpConnectionMore) + self.connect(bt, QtCore.SIGNAL('clicked()'), self.onBtFcpConnectionMoreClicked) + + # setup fproxy host / port + edHost = self.controlById(self.IdEdFproxyConnectionHost) + edHost.setText(config.settings.value('FproxyConnectionHost')) + 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) + self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.onBtConnectClicked) + if doAutoConnect: + self.controlById(self.IdBtConnect).click() + + ######################################## + ## overwritten methods + ######################################### + 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')) + + + ######################################### + ## event onrs + ######################################### + def onBtConnectClicked(self, isChecked): + bt = self.controlById(self.IdBtConnect) + bt.setText(self.trUtf8('Disconnect') if isChecked else self.trUtf8('Connect')) + if isChecked: + if config.fcpClient.isConnected(): + config.fcpClient.close() + self._connectionTimer.start(self.fcSettings) + else: + self._connectionTimer.stop() + if config.fcpClient.isConnected(): + self._pollTimer.stop() + config.fcpClient.close() + + + def onCkFcpAutoConnectStateChanged(self, state): + config.settings.setValues(FcpAutoConnect=state == QtCore.Qt.Checked) + + def onEdFcpConnectionHostChanged(self, text): + config.settings.setValues(FcpConnectionHost=text) + + def onSpinFcpConnectionPortChanged(self, value): + config.settings.setValues(FcpConnectionPort=value) + + def onBtFcpConnectionMoreClicked(self): + dlg = ConnectionExpertSettingsDlg(self) + if dlg.exec_() == dlg.Accepted: + pass + + def onEdFproxyConnectionHostChanged(self, text): + config.settings.setValues(FproxyConnectionHost=text) + + def onSpinFproxyConnectionPortChanged(self, value): + config.settings.setValues(FproxyConnectionPort=value) + + + ######################################### + ## fcp event onrs + ######################################### + def onFcpClientDisconected(self, event, msg): + bt = self.controlById(self.IdBtConnect) + if bt.isChecked(): + bt.click() + + def onFcpClientConected(self, event, msg): + self._pollTimer.start(self.fcSettings) + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + from . import View, Ui_ViewLogger + + app = QtGui.QApplication(sys.argv) + w = Ui_View.ViewWidget(None) + w.addTopViews(ViewConnectionWidget(None)) + w.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None)) + + w.show() + res = app.exec_() + sys.exit(res) + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:32:45
|
Revision: 769 http://fclient.svn.sourceforge.net/fclient/?rev=769&view=rev Author: jUrner Date: 2008-07-27 11:32:55 +0000 (Sun, 27 Jul 2008) Log Message: ----------- naming Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py Added Paths: ----------- trunk/fclient/src/fclient/impl/ViewBrowser.py Removed Paths: ------------- trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:31:20 UTC (rev 768) +++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:32:55 UTC (rev 769) @@ -8,7 +8,7 @@ from .impl.MainWindow import MainWindow from .impl.View import ViewWidget -from .impl.Ui_ViewBrowser import ViewBrowserWidget +from .impl.ViewBrowser import ViewBrowserWidget from .impl.Ui_ViewConnection import ViewConnectionWidget from .impl.Ui_ViewDownloads import ViewDownloadsWidget from .impl.Ui_ViewLogger import ViewLoggerWidget Deleted: trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py 2008-07-27 11:31:20 UTC (rev 768) +++ trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py 2008-07-27 11:32:55 UTC (rev 769) @@ -1,1030 +0,0 @@ -#****************************************************************************************** -#TODO: -# 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? -# x. save page to disk -# x. download. idea is to add dls to global download widget and mark them (some color code) as new content. -# alt would be to to do it firefox like in a separate widget. maybe an option to adjust if browser dls should be -# persistent or not -# x. tool buttons do not adjust their size to icon size. maybe it is some global setting via qt-config -# x. fProxy is a bit tight-lipped when it comes to feedback. no idea -# x. give feedback on tabs about load / finisched / error. maybe some color code. wait for new QTabWidget features (qt4.5) -# x. close button on tabs. wait for new QTabWidget features (qt4.5) -# x. page actions: CopyImageToClipboard, -# x. when mouse pointer is over an opend image a magnifier cursor appears. no idea how this is handled -# x. open new tab on tab bar double click. IIRC looks like no way before qt4.5. tabBars are not stretched to fit in qt4.4 -# x. global feedback on statusbar flickers. reason: first label is holds arbitrary length text -# x. fproxy. "force browser to dl" should we dl it in downloads or store emidiately? no idea -# x. visiting plugins via fproxy does not work -# x. real toolbars -# x. remove host/port from urls? -# x. browser settings - QWebSettings -# x. shortcuts -# x. user staring gui for first time. maybe we should not connext untill the user connects explicitely -#****************************************************************************************** -""" - -@newfield signal: signal, signals -""" -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -from PyQt4 import QtCore, QtGui, QtWebKit - -from . import config - -from .lib import fcp2 -from .lib.qt4ex.lib import tools as qtools -from .lib.compactpath.qt4 import pathlabelwrap - -from . import Ui_DlgPropsBrowserObject -from . import Ui_DlgDownloadKeyToDisk -from .tpls.Ui_ViewBrowserWidgetTpl import Ui_ViewBrowserWidget -#***************************************************************************************** -# -#***************************************************************************************** -class Page(QtWebKit.QWebPage): - def __init__(self, parent): - QtWebKit.QWebPage.__init__(self, parent) - - #def acceptNavigationRequest(self, frame, request, typeRequest): - # return True - -#***************************************************************************************** -# -#***************************************************************************************** -class Browser(QtWebKit.QWebView): - """ browser customized for freenet - """ - - MaxProgress = 100 - - def __init__(self, parent=None, userData=None): - QtWebKit.QWebView.__init__(self, parent) - - page = Page(self) - self.setPage(page) - - #NOTE: we store last progress made to set busy cursor accordingly - self._lastProgress = 0 - self._userData = userData - - # connect actions - self.connect(self, QtCore.SIGNAL('loadStarted()'), self.onLoadStarted) - self.connect(self, QtCore.SIGNAL('loadProgress(int)'), self.onLoadProgress) - self.connect(self, QtCore.SIGNAL('loadFinished(bool)'), self.onLoadFinished) - self.connect(self.pageAction(QtWebKit.QWebPage.Stop), QtCore.SIGNAL('triggered()'), self.onActionStopTriggered) - - ################################ - ## methods - ################################ - #def createWindow(self, typeWindow): - # pass - - def load(self, url): - self._lastProgress = 0 - return QtWebKit.QWebView.load(self, url) - - def setLastStatusMessage(self, qString): - self._lastStatusMessage = qString - - def setUrl(self, url): - return self.load(url) - - def setContents(self, *args): - """sets the contents of the browser without changing its url""" - self._lastProgress = 0 - return QtWebKit.QWebView.setContents(self, *args) - - def setHtml(self, *args): - """sets the contents of the browser without changing its url""" - self._lastProgress = 0 - return QtWebKit.QWebView.setHtm(self, *args) - - def setPage(self, page): - """sets the contents of the browser without changing its url""" - self._lastProgress = 0 - return QtWebKit.QWebView.setPage(self, page) - - def setUserData(self, userData): - self._userData = userData - - def mouseMoveEvent(self, event): - if self._lastProgress < self.MaxProgress: - self.setCursor(QtCore.Qt.BusyCursor) - else: - QtWebKit.QWebView.mouseMoveEvent(self, event) - - def userData(self): - return self._userData - - ############################### - ## event handlers - ############################### - def onActionStopTriggered(self): - # check wich cursor to set cos we may have busy cursor set - pt = self.mapFromGlobal(self.cursor().pos()) #TODO: self.mapFromGlobal(self.viewPort().cursor().pos()) ?? - frame = self.page().currentFrame() - hitTest = frame.hitTestContent(pt) - #if not hitTest.isNull(): #TODO: looks like hitTest.isNull() alwas returns True - if hitTest.linkUrl().isValid(): - self.setCursor(QtCore.Qt.PointingHandCursor) - else: - self.setCursor(QtCore.Qt.ArrowCursor) - - def onLoadStarted(self): - self._lastProgress = 0 - - def onLoadProgress(self, n): - self._lastProgress = n - - def onLoadFinished(self): - self._lastProgress = self.MaxProgress - self.onActionStopTriggered() - - def onPageDownloadRequested(self, networkRequest): - self.emit(QtCore.SIGNAL('downloadRequested(const QNetworkRequest &)'), networkRequest) - -#********************************************************************************** -# -#********************************************************************************** -class BrowserWidgetGlobalFeedback(config.GlobalFeedbackBase): - """wrapper for global statusbar widgets, menus""" - - def __init__(self, parent, idGlobalFeedback): - config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) - - # menus - self.menus = [] - if self.menuBar is not None and hasattr(parent, 'fcViewObject'): - menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) - parent.populateMenu(menu) - self.menus.append(menu) - self.menuBar.addViewMenu(menu) - - # status bar widgets - self.labelStatus = None - self.progress = None - self.labelFeedbackWrap = None - if self.statusBar is not None: - self.labelStatus = QtGui.QLabel(QtCore.QString(), self.statusBar) - self.statusBar.addWidget(self.labelStatus) - - self.progress = QtGui.QProgressBar(self.statusBar) - self.progress.setRange(0, Browser.MaxProgress) - self.progress.setValue(0) - self.statusBar.addWidget(self.progress) - - label = QtGui.QLabel(self.statusBar) - label.setFrameStyle(QtGui.QLabel.Sunken | QtGui.QLabel.Box) - self.labelFeedbackWrap = pathlabelwrap.PathLabelWrap( - label, - path_module=config.CompactPathFcpKeyModule, - ) - self.statusBar.addWidget(self.labelFeedbackWrap.label, 1) - - - def setVisible(self, flag): - if self.menuBar is not None: - for menu in self.menus: - menu.children()[0].setVisible(flag) - if self.statusBar is not None: - self.progress.setVisible(flag) - self.labelStatus.setVisible(flag) - self.labelFeedbackWrap.label.setVisible(flag) - - def setProgress(self, n): - if self.progress is not None: - self.progress.setValue(n) - - def setStatusMessage(self, qString): - if self.labelStatus is not None: - self.labelStatus.setText(qString) - - def setFeedback(self, qString): - if self.labelFeedbackWrap is not None: - self.labelFeedbackWrap.setPath(unicode(qString)) - - -class BrowserWidgetViewObject(config.ViewObject): - - def __init__(self, parent): - config.ViewObject. __init__(self, parent) - - self.name=parent.objectName() - self.displayName=self.trUtf8('Browser') - self.icon=QtGui.QIcon() - - -class BrowserWidgetSettings(config.SettingsBase): - _key_ = config.IdViewBrowserWidget - _settings_ = ( - ('OpenLinksInNewTab', 'Bool', False, config.SettingScopeUser), - ('OpenAddressBarInNewTab', 'Bool', False, config.SettingScopeUser), - ('OpenBookmarksInNewTab', 'Bool', False, config.SettingScopeUser), - ('OpenHomePageOnNewTabCreated', 'Bool', False, config.SettingScopeUser), - ('BackIsClose', 'Bool', False, config.SettingScopeUser), #TODO: not implemented - ('HomePage', 'String', QtCore.QString(), config.SettingScopeUser), - ('IconSize', 'UInt', 32, config.SettingScopeUser), - ('IconTheme', 'String', QtCore.QString('crystal'), config.SettingScopeUser), - ('AutoLoadImages', 'Bool', True, config.SettingScopeUser), #TODO: not yet implemented - ('MaxTabText', 'UInt', 20, config.SettingScopeUser), #NOTE: make shure Max >= Min and Max and Min > 0 - ('MinTabText', 'UInt', 7, config.SettingScopeUser), - ) - - def 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) - - #backIsClose = kws.get('BackIsClose', None) - #if backIsClose is not None: - # self.parent()._adjustBackIsClose() - - - -class BrowserWidgetActions(config.ActionsBase): - - def __init__(self, parent): - config.ActionsBase.__init__(self, parent) - - iconSize = parent.fcSettings.value('IconSize') - iconTheme = parent.fcSettings.value('IconTheme') - - self.action( - name='ActionCloseCurrentTab', - text=self.trUtf8('Close ¤t tab'), - trigger=parent.onCloseCurrentTab, - ) - self.action( # context menu only - name='ActionCloseBrowserUnderMouse', - text=self.trUtf8('&Close tab'), - trigger=None, - ) - self.action( - name='ActionCloseAllTabs', - text=self.trUtf8('Close &all tabs'), - trigger=parent.onCloseAllTabs, - ) - self.action( - name='ActionOpenNewTab', - text=self.trUtf8('Open &new tab'), - trigger=parent.onOpenNewTab, - ) - self.action( - name='ActionGoToFProxy', - text=self.trUtf8('Go to f&Proxy homepage'), - trigger=parent.onGoToFProxy, - ) - self.action( - name='ActionGoToHomePage', - text=self.trUtf8('Go to &homepage'), - trigger=parent.onGoToHomePage, - ) - self.action( - name='ActionObjectProperties', - text=self.trUtf8('Properties..'), - trigger=None, - ) - self.action( - name='ActionZoomIn', - text=self.trUtf8('Zoom in'), - trigger=parent.onZoomIn, - ) - self.action( - name='ActionZoomOut', - text=self.trUtf8('Zoom out'), - trigger=parent.onZoomOut, - ) - - # default browser actions - self.action( - name='ActionBack', - text=self.trUtf8('Back'), - trigger=None, - isEnabled=False, - icon=config.resources.getIcon('back', iconSize, iconTheme=iconTheme), - userData=(None, None), - ) - self.action( - name='ActionForward', - text=self.trUtf8('Forward'), - trigger=None, - isEnabled=False, - icon=config.resources.getIcon('forward', iconSize, iconTheme=iconTheme), - userData=(None, None), - ) - self.action( - name='ActionReload', - text=self.trUtf8('Reload'), - trigger=None, - isEnabled=False, - icon=config.resources.getIcon('reload_page', iconSize, iconTheme=iconTheme), - userData=(None, None), - ) - self.action( - name='ActionStop', - text=self.trUtf8('Stop'), - trigger=None, - isEnabled=False, - icon=config.resources.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), - trigger=None, - ) - - # search actions - self.action( - parent=parent, - name='ActionSearch', - text=self.trUtf8('Search'), - shortcut=QtGui.QKeySequence(self.trUtf8('Ctrl+F')), - trigger=parent.onSearch, - ) - - def intertwineBrowserActions(self, browser=None): - """intertwines Browser actions with BrowserWidget actions - @note: call everytime the current browser changes - """ - actions = ( - ('ActionBack', QtWebKit.QWebPage.Back), - ('ActionForward', QtWebKit.QWebPage.Forward), - ('ActionReload', QtWebKit.QWebPage.Reload), - ('ActionStop', QtWebKit.QWebPage.Stop), - ) - for actionName, pageAction in actions: - myPageAction = self[actionName] - newPageAction = None if browser is None else browser.pageAction(pageAction) - oldPageAction, cb = myPageAction.userData() - - if oldPageAction is not None: - myPageAction.disconnect(oldPageAction, QtCore.SIGNAL('changed()'), cb) - oldPageAction.disconnect(myPageAction, QtCore.SIGNAL('triggered()'), oldPageAction.trigger) - - if newPageAction is None: - myPageAction.setUserData((None, None)) - myPageAction.setEnabled(False) - else: - def onActionChanged(browser=browser, myPageAction=myPageAction, browserPageAction=newPageAction): - myPageAction.setEnabled(browserPageAction.isEnabled()) - - myPageAction.setEnabled(newPageAction.isEnabled()) - myPageAction.setUserData((newPageAction, onActionChanged)) - myPageAction.connect(newPageAction, QtCore.SIGNAL('changed()'), onActionChanged) - newPageAction.connect(myPageAction, QtCore.SIGNAL('triggered()'), newPageAction.trigger) - - -class LastBrowserState(object): - """records the last known state browser""" - - __slots__ = ('icon', 'progress', 'statusMessage', 'title', 'url') - - def __init__(self, icon=None, progress=0, statusMessage=None, title=None, url=None): - self.progress = 0 - self.icon = tCore.QIcon() if icon is None else icon - self.statusMessage = QtCore.QString() if statusMessage is None else statusMessage - self.title = QtCore.QString() if title is None else title - #NOTE: opening a browser in a new tab may take a while to load. - # self.url() will return '' untill the page is found, so we handle - # it ourself and keep track of the last known url in self._lastUrl - # to give feedback to the user on the navbar. downside is we have - # to reimplement contextMenuEvent() :-( - self.url = QtCore.QUrl() if url is None else url - -#********************************************************************************** -# -#********************************************************************************** -#TODO: strip host:port on address bar? -#TODO: rename home page to start page -class ViewBrowserWidget(QtGui.QWidget, Ui_ViewBrowserWidget): - - IdTabBrowsers = 'tabBrowsers' - IdFrameTools = 'frameTools' - IdFrameAddressBar = 'frameAddressBar' - IdEdAddressBar = 'edAddressBar' - - IdBtBack = 'btBack' - IdBtForward = 'btForward' - IdBtReload = 'btReload' - IdBtStop = 'btStop' - - IdFrameSearch = 'frameSearch' - IdEdSearch = 'edSearch' - IdBtSearchUpwards = 'btSearchUpwards' - IdBtSearchDownwards = 'btSearchDownwards' - IdCkSearchCaseSensitive = 'ckSearchCaseSensitive' - - ForcedMinBrowserTabText = 5 # forced minimum number of chars on browser tabBar - - def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): - QtGui.QWidget.__init__(self, parent) - - self.setupUi(self) - config.ObjectRegistry.register(self) - - self._initialConfigDataArrived = False - - self.fcSettings = BrowserWidgetSettings(self).restore() - self.fcActions = BrowserWidgetActions(self) - self.fcViewObject = BrowserWidgetViewObject(self) - self.fcGlobalFeedback = BrowserWidgetGlobalFeedback(self, idGlobalFeedback) - - # setup tab bar - tabWidget = self.controlById(self.IdTabBrowsers) - tabWidget.clear() - tabWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - self.connect(tabWidget, QtCore.SIGNAL('currentChanged(int)'), self.onTabCurrentChanged) - self.connect(tabWidget, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onTabContextMenuEvent) - - # setup addressbar - addressbar = self.controlById(self.IdEdAddressBar) - self.connect(addressbar, QtCore.SIGNAL('returnPressed()'), self.onNavBarReturnPressed) - - # setup tool buttons - self.controlById(self.IdBtBack).setDefaultAction(self.fcActions['ActionBack']) - self.controlById(self.IdBtForward).setDefaultAction(self.fcActions['ActionForward']) - self.controlById(self.IdBtReload).setDefaultAction(self.fcActions['ActionReload']) - 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) - - # fire up a new broser to make a start - self.newBrowser(title=self.trUtf8('Waiting for fproxy')) - self.fcActions['ActionGoToHomePage'].trigger() - - ######################################### - ## private methods - ######################################### - #NOTE: to reduce flicker set min size to max size - def _adjustTabText(self, qString): - maxTabText = self.fcSettings.value('MaxTabText') - minTabText = self.fcSettings.value('MinTabText') - ellipsis = self.trUtf8('..') - - if minTabText < self.ForcedMinBrowserTabText: - minTabText = self.ForcedMinBrowserTabText - self.fcSettings.setValues(MinTabText=minTabText) - if maxTabText < self.ForcedMinBrowserTabText: - maxTabText = self.ForcedMinBrowserTabText - self.fcSettings.setValues(MaxTabText=maxTabText) - if minTabText > maxTabText: - minTabText = maxTabText - self.fcSettings.setValues(MinTabText=maxTabText) - - if qString.count() < minTabText: - qString = qString.append('\x20' * (minTabText - qString.count())) - else: - if maxTabText < self.ForcedMinBrowserTabText: - maxTabText = sminTabText - qString = qtools.truncateString(maxTabText, qString, ellipsis) - return qString - - def _downloadImageToDisk(self, hitTestResult): - px = hitTestResult.pixmap() - if px.isNull(): - return False - - key = config.qStringToFcpKey(hitTestResult.imageUrl().toString()) - if key is None: - return False - - # 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')) - fileName = unicode(config.guessFileNameFromKey(key, default=QtCore.QString(''))) - - if directory and fileName: - directory = os.path.join(directory, fileName) - elif not directory: - directory = fileName - filePath = QtGui.QFileDialog.getSaveFileName(self, caption, directory) - - if filePath: - filePath= unicode(filePath) - if os.path.exists(filePath): - try: - os.remove(filePath) - except Exception, details: - QtGui.QMessageBox.critical( - self, - caption, - self.trUtf8('Could not remove file'), #NOTE: no details please, may contain arbitrary lenght filepath - ) - return False - px.save(filePath) - return True - - def _downloadKeyToDisk(self, qUrl): - """ - @return: (bool) False if the key in the url is invalid, True otherwise - """ - fcpKey = config.qStringToFcpKey(QtCore.QString(qUrl.encodedPath())) - if fcpKey is not None: - dlg = Ui_DlgDownloadKeyToDisk.DownloadKeyToDiskDlg(self, fcpKey=fcpKey) - if dlg.exec_() == dlg.Accepted: - filePath = dlg.filePath() - downloadsWidget = config.ObjectRegistry.get(config.IdViewCDownloadsWidget, None) - if downloadsWidget is None: - raise ValueError('no downloads widget found') - downloadsWidget.downloadFile( - fcpKey, - filePath, - persistence=fcp2.ConstPersistence.Forever, - handleFilenameCollision=True, - - ) - return True - return False - - ######################################### - ## methods - ######################################### - def controlById(self, idControl): - return getattr(self, idControl) - - def currentBrowser(self): - """returns the current browser or None""" - tabWidget = self.controlById(self.IdTabBrowsers) - return tabWidget.currentWidget() - - def load(self, url, force=False, browser=None): - """loads an url in the current browser. if there is no current browser, a new browser is created - @param force: (bool) if True, a new browser is opend if there is no browser available - @param browser: browser to load the url in or None to use the current browser - @return: (bool) - """ - browser = self.currentBrowser() if browser is None else browser - tabWidget = self.controlById(self.IdTabBrowsers) - addressBar = self.controlById(self.IdEdAddressBar) - url = QtCore.QUrl(url) - - # check if we have a browser at hand - if force and browser is None: - browser = self.newBrowser() - if browser is None: - return False - - # load url - url.setScheme('http') - url.setHost(config.settings.value('FproxyConnectionHost')) - url.setPort(config.settings.value('FproxyConnectionPort')) - tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Loading'))) - addressBar.setText(url.toString()) - lastBrowserState = browser.userData() - lastBrowserState.url = url - browser.load(url) - return True - - def newBrowser(self, title=''): - """opens a browser in a new tab""" - tabWidget = self.controlById(self.IdTabBrowsers) - browser = Browser(self) - page = browser.page() - settings = browser.settings() - title = QtCore.QString(title) - - # attatch browser state information - lastBrowserState = LastBrowserState( - icon=browser.icon(), - statusMessage=self.trUtf8('Waiting'), - ) - browser.setUserData(lastBrowserState) - - # customize browser - browser.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - settings.setAttribute(settings.DeveloperExtrasEnabled, False) - settings.setAttribute(settings.JavaEnabled, False) - settings.setAttribute(settings.JavascriptEnabled, False) - settings.setAttribute(settings.JavascriptCanOpenWindows, False) - settings.setAttribute(settings.JavascriptCanAccessClipboard, False) - settings.setAttribute(settings.PluginsEnabled, False) - settings.setAttribute(settings.AutoLoadImages, self.fcSettings.value('AutoLoadImages')) - - # connect browser signals - self.connect(browser, QtCore.SIGNAL('loadStarted()'), self.onBrowserLoadStarted) - self.connect(browser, QtCore.SIGNAL('loadProgress(int)'), self.onBrowserLoadProgress) - self.connect(browser, QtCore.SIGNAL('loadFinished(bool)'), self.onBrowserLoadFinished) - self.connect(browser, QtCore.SIGNAL('iconChanged()'), self.onBrowserIconChanged) - self.connect(browser, QtCore.SIGNAL('statusBarMessage(const QString &)'), self.onBrowserStatusBarMessage) - self.connect(browser, QtCore.SIGNAL('titleChanged(const QString &)'), self.onBrowserTitleChanged) - self.connect(browser, QtCore.SIGNAL('urlChanged(const QUrl &)'), self.onBrowserUrlChanged) - self.connect(browser, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onBrowserCustomContextMenuRequested) - self.connect(browser, QtCore.SIGNAL('linkClicked(const QUrl &)'), self.onBrowserLinkClicked) - - # adjust browser actions - act = browser.pageAction(page.OpenLinkInNewWindow) - act.setText(self.trUtf8('Open page in new tab')) - act = browser.pageAction(page.OpenImageInNewWindow) - act.setText(self.trUtf8('Open image in new tab')) - act = browser.pageAction(page.OpenFrameInNewWindow) - act.setText(self.trUtf8('Open frame in new tab')) - - # customize page - page.setLinkDelegationPolicy(page.DelegateAllLinks) - - # connect page signals - self.connect(page, QtCore.SIGNAL('linkHovered(const QString &, const QString &, const QString &)'), self.onPageLinkHovered) - - tabWidget.addTab(browser, self._adjustTabText(title)) - if tabWidget.currentWidget() == browser: - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - return browser - - #TODO: rework. we need more then one menu - def populateMenu(self, menu): - menu.addAction(self.fcActions['ActionGoToFProxy']) - menu.addAction(self.fcActions['ActionGoToHomePage']) - menu.addAction(self.fcActions['ActionCloseCurrentTab']) - menu.addAction(self.fcActions['ActionCloseAllTabs']) - menu.addAction(self.fcActions['ActionOpenNewTab']) - menu.addAction(self.fcActions['ActionZoomIn']) - menu.addAction(self.fcActions['ActionZoomOut']) - menu.addAction(self.fcActions['ActionSearch']) - return menu - - ######################################### - ## overwritten events - ######################################### - def closeEvent(self): - self.viewClose() - - def hideEvent(self, event): - self.fcGlobalFeedback.setVisible(False) - - def showEvent(self, event): - self.fcGlobalFeedback.setVisible(True) - - def viewClose(self): - pass - - ######################################### - ## event handlers - ######################################### - #TODO: actions need some comb over - def onBrowserCustomContextMenuRequested(self, pt): - browser = self.sender() - frame = browser.page().currentFrame() - page = browser.page() - hitTestResult = frame.hitTestContent(pt) - - #if not hitTest.isNull(): #TODO: looks like hitTest.isNull() alwas returns True - - menu = QtGui.QMenu() - - menu.addAction(browser.pageAction(page.OpenLink)) - menu.addAction(browser.pageAction(page.OpenLinkInNewWindow)) - menu.addAction(browser.pageAction(page.CopyLinkToClipboard)) - menu.addAction(browser.pageAction(page.DownloadLinkToDisk)) - - menu.addSeparator() - menu.addAction(browser.pageAction(page.OpenImageInNewWindow)) - menu.addAction(browser.pageAction(page.CopyImageToClipboard)) - menu.addAction(browser.pageAction(page.DownloadImageToDisk)) - - menu.addSeparator() - menu.addAction(browser.pageAction(page.OpenFrameInNewWindow)) - - menu.addSeparator() - menu.addAction(browser.pageAction(page.Copy)) - menu.addAction(self.fcActions['ActionObjectProperties']) - - action = menu.exec_(pt) - - if action == browser.pageAction(page.OpenLinkInNewWindow): - browser = self.newBrowser(title=self.trUtf8('Loading')) - self.load(hitTestResult.linkUrl(), browser=browser) - elif action == browser.pageAction(page.OpenImageInNewWindow): - browser = self.newBrowser(title=self.trUtf8('Loading')) - self.load(hitTestResult.imageUrl(), browser=browser) - elif action == browser.pageAction(page.OpenFrameInNewWindow): - browser = self.newBrowser(title=self.trUtf8('Loading')) - self.load(hitTestResult.frame().url(), browser=browser) - elif action == browser.pageAction(page.DownloadImageToDisk): - self._downloadImageToDisk(hitTestResult) - elif action == browser.pageAction(page.DownloadLinkToDisk): - self._downloadKeyToDisk(hitTestResult.linkUrl()) - elif action == self.fcActions['ActionObjectProperties']: - dlg = Ui_DlgPropsBrowserObject.PropsBrowserObjectDlg(self, hitTestResult=hitTestResult) - if dlg.exec_() == dlg.Accepted: - pass - - #TODO: nav buttons seem to get confused on error - def onBrowserLoadFinished(self, ok): - browser = self.sender() - lastBrowserState = browser.userData() - tabWidget = self.controlById(self.IdTabBrowsers) - - lastBrowserState.progress = Browser.MaxProgress - if ok: - lastBrowserState.statusMessage = self.trUtf8('Complete') - if lastBrowserState.title.isEmpty(): - tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Complete'))) - if browser == self.currentBrowser(): - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - else: - # something went wrong. most likely fProxy can not be reached - lastBrowserState.statusMessage = self.trUtf8('Error') - tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Error'))) - if browser == self.currentBrowser(): - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - - settings = browser.settings() - settings.setAttribute(settings.JavascriptEnabled, True) - try: - p = ( - '<h3>%s</h3>' % self.trUtf8('Error: request failed'), - self.trUtf8('Possible reasons:'), - '<ul>', - '<li>', - self.trUtf8('fProxy can not be reached. check if fproxy is running and check your node config if fproxy host and port are set'), - '</li>', - '<li>', - self.trUtf8('maybe your os can not deal with ipv6 addresses. make shure fProxy is reachable via an ipv4 address'), - '</li>', - '<li>', - self.trUtf8('there is no problem. try it again..'), - '</li>', - '</ul>' - ) - p = ''.join([unicode(i) for i in p]) - browser.page().mainFrame().evaluateJavaScript('document.write("<div>%s</div>");' % p) - finally: - settings.setAttribute(settings.JavascriptEnabled, False) - - def onBrowserIconChanged(self, qIcon): - browser = self.sender() - qIcon = QtCore.QIcon(qIcon) # copy it - qt nukes it on return - - lastBrowserState = browser.userData() - if not qIcon.isNull(): - lastBrowserState = qIcon - self.tabWidget.setTabIcon(i, lastBrowserState.icon) - - def onBrowserLoadProgress(self, n): - browser = self.sender() - lastBrowserState = browser.userData() - - lastBrowserState.progress = n - if self.sender() == self.currentBrowser(): - self.fcGlobalFeedback.setProgress(n) - - def onBrowserLinkClicked(self, qUrl): - browser = self.sender() - qUrl = QtCore.QUrl(qUrl) - query = unicode(qUrl.encodedQuery()) - - if query.lower() == 'forcedownload': - if not self._downloadKeyToDisk(qUrl): - self.fcGlobalFeedback.setFeedback(self.trUtf8('Invalid key!')) - else: # assume fproxy is doing the right thing - if self.fcSettings.value('OpenLinksInNewTab'): - browser = self.newBrowser(title=self.trUtf8('Loading')) - self.load(qUrl, browser=browser) - - def onBrowserLoadStarted(self): - browser = self.sender() - lastBrowserState = browser.userData() - tabWidget = self.controlById(self.IdTabBrowsers) - - lastBrowserState.statusMessage = self.trUtf8('Loading') - tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Loading'))) - if browser == self.currentBrowser(): - self.fcGlobalFeedback.setProgress(0) - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - - def onBrowserStatusBarMessage(self, qString): - browser = self.sender() - qString = QtCore.QString(qString) # copy it - qt nukes it on return - - lastBrowserState = browser.userData() - if not qString.isEmpty(): - lastBrowserState.statusMessage = qString - if browser == self.currentBrowser(): - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - - def onBrowserTitleChanged(self, qString): - browser = self.sender() - qString = QtCore.QString(qString) # copy it - qt nukes it on return - maxTabText = self.fcSettings.value('MaxTabText') - tabWidget = self.controlById(self.IdTabBrowsers) - lastBrowserState = browser.userData() - if not qString.isEmpty(): - lastBrowserState.title = qString - tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText( lastBrowserState.title)) - - def onBrowserUrlChanged(self, qUrl): - browser = self.sender() - qUrl = QtCore.QUrl(qUrl) # copy it - qt nukes it on return - - lastBrowserState = browser.userData() - if qUrl.isValid(): - lastBrowserState.url = qUrl - addressbar = self.controlById(self.IdEdAddressBar) - addressbar.setText(lastBrowserState.url.toString()) - - def onCloseAllTabs(self, action): - # have to do it by hand to reset [BackIsClose] - tabWidget = self.controlById(self.IdTabBrowsers) - tabWidget.clear() - self.fcActions.intertwineBrowserActions(self.currentBrowser()) - - def onCloseCurrentTab(self, action): - tabWidget = self.controlById(self.IdTabBrowsers) - i = tabWidget.currentIndex() - if i > -1: - tabWidget.removeTab(i) - self.fcActions.intertwineBrowserActions(self.currentBrowser()) - - #TODO: open in new tab option? - def onGoToFProxy(self, action): - url = QtCore.QUrl() - self.load(url, force=True) - - #TODO: open in new tab option? - def onGoToHomePage(self, action): - home = self.fcSettings.value('HomePage') - qUrl = QtCore.QUrl(home) - self.load(qUrl, force=True) - - def onNavBarReturnPressed(self): - text = self.controlById(self.IdEdAddressBar).text() - if text.isEmpty(): - return - qUrl = QtCore.QUrl(text) - browser = self.currentBrowser() - if browser is None or self.fcSettings.value('OpenAddressBarInNewTab'): - browser = self.newBrowser(title=self.trUtf8('Loading')) - self.load(qUrl, browser=browser) - - #TODO: we get no load progress feedback here? - #TODO: more choices for page to load - def onOpenNewTab(self, action): - browser = self.newBrowser(title=self.trUtf8('Empty')) - if self.fcSettings.value('OpenHomePageOnNewTabCreated'): - homePage = self.fcSettings.value('HomePage') - self.load(QtCore.QUrl(homePage), browser=browser) - - def onPageLinkHovered(self, link, title, textContent): - self.fcGlobalFeedback.setFeedback(QtCore.QString(link)) - - def onPageActionBackChanged(self): - act = self.sender() - browser = self.currentBrowser() - 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 onSearchDownwards(self): - browser = self.currentBrowser() - if browser is not None: - page = browser.page() - ed = self.controlById(self.IdEdSearch) - ck = self.controlById(self.IdCkSearchCaseSensitive) - flags = page.FindWrapsAroundDocument - if ck.checkState() == QtCore.Qt.Checked: - flags |= page.FindCaseSensitively - browser.findText(ed.text(), flags) - - def onSearchUpwards(self): - browser = self.currentBrowser() - if browser is not None: - page = browser.page() - ed = self.controlById(self.IdEdSearch) - ck = self.controlById(self.IdCkSearchCaseSensitive) - flags = page.FindWrapsAroundDocument | page.FindBackward - if ck.checkState() == QtCore.Qt.Checked: - flags |= page.FindCaseSensitively - browser.findText(ed.text(), flags) - - def onTabContextMenuEvent(self, pt): - menu = QtGui.QMenu() - tabWidget = self.controlById(self.IdTabBrowsers) - pt = tabWidget.mapToGlobal(pt) - pt2 = tabWidget.tabBar().mapFromGlobal(pt) - i = tabWidget.tabBar().tabAt(pt2) - # setup menu - actCloseBrowserUnderMouse = self.fcActions['ActionCloseBrowserUnderMouse'] - actCloseBrowserUnderMouse.setEnabled(i >-1) - menu.addAction(actCloseBrowserUnderMouse) - menu.addAction(self.fcActions['ActionCloseAllTabs']) - act = menu.exec_(pt) - if act == actCloseBrowserUnderMouse: - tabWidget.removeTab(i) - self.fcActions.intertwineBrowserActions(self.currentBrowser()) - - def onTabCurrentChanged(self, i): - tabWidget = self.controlById(self.IdTabBrowsers) - browser = tabWidget.widget(i) - - self.fcActions.intertwineBrowserActions(browser) - if browser is not None: - lastBrowserState = browser.userData() - addressBar = self.controlById(self.IdEdAddressBar) - - # update status info - addressBar.setText(lastBrowserState.url.toString()) - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - self.fcGlobalFeedback.setProgress(lastBrowserState.progress) - - #TODO: enable/disable, but no view gives non feedback on max/min zoom - def onZoomIn(self, action): - browser = self.currentBrowser() - if browser is not None: - oldMultiplier = browser.textSizeMultiplier() - browser.setTextSizeMultiplier(browser.textSizeMultiplier() + 0.2) - if browser.textSizeMultiplier() <= oldMultiplier: - menu.addAction(self.fcActions['ActionZoomIn']).setEnabled(False) - - def onZoomOut(self, action): - browser = self.currentBrowser() - if browser is not None: - oldMultiplier = browser.textSizeMultiplier() - browser.setTextSizeMultiplier(browser.textSizeMultiplier() - 0.2) - if browser.textSizeMultiplier() >= oldMultiplier: - menu.addAction(self.fcActions['ActionZoomOut']).setEnabled(False) - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - from .Ui_ViewLogger import ViewLoggerWidget - from .MainWindow import MainWindow - from .View import ViewWidget - from .Ui_ViewConnection import ViewConnectionWidget - from .Ui_ViewDownloads import ViewDownloadsWidget - - app = QtGui.QApplication(sys.argv) - - mainWindow = MainWindow() - viewWidget = ViewWidget(mainWindow) - mainWindow.setCentralWidget(viewWidget) - - browserWidget = ViewBrowserWidget(mainWindow) - viewWidget.addTopViews( - ViewConnectionWidget(mainWindow), - browserWidget, - ViewDownloadsWidget(mainWindow), - ) - viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) - - mainWindow.show() - res = app.exec_() - sys.exit(res) - -#********************************************************************************** -# -#********************************************************************************** -## looks we could serve pages via fcp, bypassing fproxy -## no reason to do so.. -## -##class NetworkAccessManager(QtNetwork.QNetworkAccessManager): -## -## def __init__(self, parent): -## QtNetwork.QNetworkAccessManager.__init__(self, parent) -## -## def createRequest(self, operation, request, outgoingData): -## print 'createRequest', request.url() -## reply = QtNetwork.QNetworkAccessManager.createRequest(self, operation, request, outgoingData) -## #TODO: implement QNetworkReply() -## return reply -## -## -##class Browser(QtWebKit.QWebView): -## -##def __init__(self, browserWidget): -## QtWebKit.QWebView.__init__(self, browserWidget) -## -## self.nam = NetworkAccessManager(self) -## self.page().setNetworkAccessManager(self.nam) -## -#********************************************************************************** -# -#********************************************************************************** - \ No newline at end of file Added: trunk/fclient/src/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/ViewBrowser.py (rev 0) +++ trunk/fclient/src/fclient/impl/ViewBrowser.py 2008-07-27 11:32:55 UTC (rev 769) @@ -0,0 +1,1030 @@ +#****************************************************************************************** +#TODO: +# 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? +# x. save page to disk +# x. download. idea is to add dls to global download widget and mark them (some color code) as new content. +# alt would be to to do it firefox like in a separate widget. maybe an option to adjust if browser dls should be +# persistent or not +# x. tool buttons do not adjust their size to icon size. maybe it is some global setting via qt-config +# x. fProxy is a bit tight-lipped when it comes to feedback. no idea +# x. give feedback on tabs about load / finisched / error. maybe some color code. wait for new QTabWidget features (qt4.5) +# x. close button on tabs. wait for new QTabWidget features (qt4.5) +# x. page actions: CopyImageToClipboard, +# x. when mouse pointer is over an opend image a magnifier cursor appears. no idea how this is handled +# x. open new tab on tab bar double click. IIRC looks like no way before qt4.5. tabBars are not stretched to fit in qt4.4 +# x. global feedback on statusbar flickers. reason: first label is holds arbitrary length text +# x. fproxy. "force browser to dl" should we dl it in downloads or store emidiately? no idea +# x. visiting plugins via fproxy does not work +# x. real toolbars +# x. remove host/port from urls? +# x. browser settings - QWebSettings +# x. shortcuts +# x. user staring gui for first time. maybe we should not connext untill the user connects explicitely +#****************************************************************************************** +""" + +@newfield signal: signal, signals +""" +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +from PyQt4 import QtCore, QtGui, QtWebKit + +from . import config + +from .lib import fcp2 +from .lib.qt4ex.lib import tools as qtools +from .lib.compactpath.qt4 import pathlabelwrap + +from . import Ui_DlgPropsBrowserObject +from . import Ui_DlgDownloadKeyToDisk +from .tpls.Ui_ViewBrowserWidgetTpl import Ui_ViewBrowserWidget +#***************************************************************************************** +# +#***************************************************************************************** +class Page(QtWebKit.QWebPage): + def __init__(self, parent): + QtWebKit.QWebPage.__init__(self, parent) + + #def acceptNavigationRequest(self, frame, request, typeRequest): + # return True + +#***************************************************************************************** +# +#***************************************************************************************** +class Browser(QtWebKit.QWebView): + """ browser customized for freenet + """ + + MaxProgress = 100 + + def __init__(self, parent=None, userData=None): + QtWebKit.QWebView.__init__(self, parent) + + page = Page(self) + self.setPage(page) + + #NOTE: we store last progress made to set busy cursor accordingly + self._lastProgress = 0 + self._userData = userData + + # connect actions + self.connect(self, QtCore.SIGNAL('loadStarted()'), self.onLoadStarted) + self.connect(self, QtCore.SIGNAL('loadProgress(int)'), self.onLoadProgress) + self.connect(self, QtCore.SIGNAL('loadFinished(bool)'), self.onLoadFinished) + self.connect(self.pageAction(QtWebKit.QWebPage.Stop), QtCore.SIGNAL('triggered()'), self.onActionStopTriggered) + + ################################ + ## methods + ################################ + #def createWindow(self, typeWindow): + # pass + + def load(self, url): + self._lastProgress = 0 + return QtWebKit.QWebView.load(self, url) + + def setLastStatusMessage(self, qString): + self._lastStatusMessage = qString + + def setUrl(self, url): + return self.load(url) + + def setContents(self, *args): + """sets the contents of the browser without changing its url""" + self._lastProgress = 0 + return QtWebKit.QWebView.setContents(self, *args) + + def setHtml(self, *args): + """sets the contents of the browser without changing its url""" + self._lastProgress = 0 + return QtWebKit.QWebView.setHtm(self, *args) + + def setPage(self, page): + """sets the contents of the browser without changing its url""" + self._lastProgress = 0 + return QtWebKit.QWebView.setPage(self, page) + + def setUserData(self, userData): + self._userData = userData + + def mouseMoveEvent(self, event): + if self._lastProgress < self.MaxProgress: + self.setCursor(QtCore.Qt.BusyCursor) + else: + QtWebKit.QWebView.mouseMoveEvent(self, event) + + def userData(self): + return self._userData + + ############################### + ## event handlers + ############################### + def onActionStopTriggered(self): + # check wich cursor to set cos we may have busy cursor set + pt = self.mapFromGlobal(self.cursor().pos()) #TODO: self.mapFromGlobal(self.viewPort().cursor().pos()) ?? + frame = self.page().currentFrame() + hitTest = frame.hitTestContent(pt) + #if not hitTest.isNull(): #TODO: looks like hitTest.isNull() alwas returns True + if hitTest.linkUrl().isValid(): + self.setCursor(QtCore.Qt.PointingHandCursor) + else: + self.setCursor(QtCore.Qt.ArrowCursor) + + def onLoadStarted(self): + self._lastProgress = 0 + + def onLoadProgress(self, n): + self._lastProgress = n + + def onLoadFinished(self): + self._lastProgress = self.MaxProgress + self.onActionStopTriggered() + + def onPageDownloadRequested(self, networkRequest): + self.emit(QtCore.SIGNAL('downloadRequested(const QNetworkRequest &)'), networkRequest) + +#********************************************************************************** +# +#********************************************************************************** +class BrowserWidgetGlobalFeedback(config.GlobalFeedbackBase): + """wrapper for global statusbar widgets, menus""" + + def __init__(self, parent, idGlobalFeedback): + config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) + + # menus + self.menus = [] + if self.menuBar is not None and hasattr(parent, 'fcViewObject'): + menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) + parent.populateMenu(menu) + self.menus.append(menu) + self.menuBar.addViewMenu(menu) + + # status bar widgets + self.labelStatus = None + self.progress = None + self.labelFeedbackWrap = None + if self.statusBar is not None: + self.labelStatus = QtGui.QLabel(QtCore.QString(), self.statusBar) + self.statusBar.addWidget(self.labelStatus) + + self.progress = QtGui.QProgressBar(self.statusBar) + self.progress.setRange(0, Browser.MaxProgress) + self.progress.setValue(0) + self.statusBar.addWidget(self.progress) + + label = QtGui.QLabel(self.statusBar) + label.setFrameStyle(QtGui.QLabel.Sunken | QtGui.QLabel.Box) + self.labelFeedbackWrap = pathlabelwrap.PathLabelWrap( + label, + path_module=config.CompactPathFcpKeyModule, + ) + self.statusBar.addWidget(self.labelFeedbackWrap.label, 1) + + + def setVisible(self, flag): + if self.menuBar is not None: + for menu in self.menus: + menu.children()[0].setVisible(flag) + if self.statusBar is not None: + self.progress.setVisible(flag) + self.labelStatus.setVisible(flag) + self.labelFeedbackWrap.label.setVisible(flag) + + def setProgress(self, n): + if self.progress is not None: + self.progress.setValue(n) + + def setStatusMessage(self, qString): + if self.labelStatus is not None: + self.labelStatus.setText(qString) + + def setFeedback(self, qString): + if self.labelFeedbackWrap is not None: + self.labelFeedbackWrap.setPath(unicode(qString)) + + +class BrowserWidgetViewObject(config.ViewObject): + + def __init__(self, parent): + config.ViewObject. __init__(self, parent) + + self.name=parent.objectName() + self.displayName=self.trUtf8('Browser') + self.icon=QtGui.QIcon() + + +class BrowserWidgetSettings(config.SettingsBase): + _key_ = config.IdViewBrowserWidget + _settings_ = ( + ('OpenLinksInNewTab', 'Bool', False, config.SettingScopeUser), + ('OpenAddressBarInNewTab', 'Bool', False, config.SettingScopeUser), + ('OpenBookmarksInNewTab', 'Bool', False, config.SettingScopeUser), + ('OpenHomePageOnNewTabCreated', 'Bool', False, config.SettingScopeUser), + ('BackIsClose', 'Bool', False, config.SettingScopeUser), #TODO: not implemented + ('HomePage', 'String', QtCore.QString(), config.SettingScopeUser), + ('IconSize', 'UInt', 32, config.SettingScopeUser), + ('IconTheme', 'String', QtCore.QString('crystal'), config.SettingScopeUser), + ('AutoLoadImages', 'Bool', True, config.SettingScopeUser), #TODO: not yet implemented + ('MaxTabText', 'UInt', 20, config.SettingScopeUser), #NOTE: make shure Max >= Min and Max and Min > 0 + ('MinTabText', 'UInt', 7, config.SettingScopeUser), + ) + + def 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) + + #backIsClose = kws.get('BackIsClose', None) + #if backIsClose is not None: + # self.parent()._adjustBackIsClose() + + + +class BrowserWidgetActions(config.ActionsBase): + + def __init__(self, parent): + config.ActionsBase.__init__(self, parent) + + iconSize = parent.fcSettings.value('IconSize') + iconTheme = parent.fcSettings.value('IconTheme') + + self.action( + name='ActionCloseCurrentTab', + text=self.trUtf8('Close ¤t tab'), + trigger=parent.onCloseCurrentTab, + ) + self.action( # context menu only + name='ActionCloseBrowserUnderMouse', + text=self.trUtf8('&Close tab'), + trigger=None, + ) + self.action( + name='ActionCloseAllTabs', + text=self.trUtf8('Close &all tabs'), + trigger=parent.onCloseAllTabs, + ) + self.action( + name='ActionOpenNewTab', + text=self.trUtf8('Open &new tab'), + trigger=parent.onOpenNewTab, + ) + self.action( + name='ActionGoToFProxy', + text=self.trUtf8('Go to f&Proxy homepage'), + trigger=parent.onGoToFProxy, + ) + self.action( + name='ActionGoToHomePage', + text=self.trUtf8('Go to &homepage'), + trigger=parent.onGoToHomePage, + ) + self.action( + name='ActionObjectProperties', + text=self.trUtf8('Properties..'), + trigger=None, + ) + self.action( + name='ActionZoomIn', + text=self.trUtf8('Zoom in'), + trigger=parent.onZoomIn, + ) + self.action( + name='ActionZoomOut', + text=self.trUtf8('Zoom out'), + trigger=parent.onZoomOut, + ) + + # default browser actions + self.action( + name='ActionBack', + text=self.trUtf8('Back'), + trigger=None, + isEnabled=False, + icon=config.resources.getIcon('back', iconSize, iconTheme=iconTheme), + userData=(None, None), + ) + self.action( + name='ActionForward', + text=self.trUtf8('Forward'), + trigger=None, + isEnabled=False, + icon=config.resources.getIcon('forward', iconSize, iconTheme=iconTheme), + userData=(None, None), + ) + self.action( + name='ActionReload', + text=self.trUtf8('Reload'), + trigger=None, + isEnabled=False, + icon=config.resources.getIcon('reload_page', iconSize, iconTheme=iconTheme), + userData=(None, None), + ) + self.action( + name='ActionStop', + text=self.trUtf8('Stop'), + trigger=None, + isEnabled=False, + icon=config.resources.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), + trigger=None, + ) + + # search actions + self.action( + parent=parent, + name='ActionSearch', + text=self.trUtf8('Search'), + shortcut=QtGui.QKeySequence(self.trUtf8('Ctrl+F')), + trigger=parent.onSearch, + ) + + def intertwineBrowserActions(self, browser=None): + """intertwines Browser actions with BrowserWidget actions + @note: call everytime the current browser changes + """ + actions = ( + ('ActionBack', QtWebKit.QWebPage.Back), + ('ActionForward', QtWebKit.QWebPage.Forward), + ('ActionReload', QtWebKit.QWebPage.Reload), + ('ActionStop', QtWebKit.QWebPage.Stop), + ) + for actionName, pageAction in actions: + myPageAction = self[actionName] + newPageAction = None if browser is None else browser.pageAction(pageAction) + oldPageAction, cb = myPageAction.userData() + + if oldPageAction is not None: + myPageAction.disconnect(oldPageAction, QtCore.SIGNAL('changed()'), cb) + oldPageAction.disconnect(myPageAction, QtCore.SIGNAL('triggered()'), oldPageAction.trigger) + + if newPageAction is None: + myPageAction.setUserData((None, None)) + myPageAction.setEnabled(False) + else: + def onActionChanged(browser=browser, myPageAction=myPageAction, browserPageAction=newPageAction): + myPageAction.setEnabled(browserPageAction.isEnabled()) + + myPageAction.setEnabled(newPageAction.isEnabled()) + myPageAction.setUserData((newPageAction, onActionChanged)) + myPageAction.connect(newPageAction, QtCore.SIGNAL('changed()'), onActionChanged) + newPageAction.connect(myPageAction, QtCore.SIGNAL('triggered()'), newPageAction.trigger) + + +class LastBrowserState(object): + """records the last known state browser""" + + __slots__ = ('icon', 'progress', 'statusMessage', 'title', 'url') + + def __init__(self, icon=None, progress=0, statusMessage=None, title=None, url=None): + self.progress = 0 + self.icon = tCore.QIcon() if icon is None else icon + self.statusMessage = QtCore.QString() if statusMessage is None else statusMessage + self.title = QtCore.QString() if title is None else title + #NOTE: opening a browser in a new tab may take a while to load. + # self.url() will return '' untill the page is found, so we handle + # it ourself and keep track of the last known url in self._lastUrl + # to give feedback to the user on the navbar. downside is we have + # to reimplement contextMenuEvent() :-( + self.url = QtCore.QUrl() if url is None else url + +#********************************************************************************** +# +#********************************************************************************** +#TODO: strip host:port on address bar? +#TODO: rename home page to start page +class ViewBrowserWidget(QtGui.QWidget, Ui_ViewBrowserWidget): + + IdTabBrowsers = 'tabBrowsers' + IdFrameTools = 'frameTools' + IdFrameAddressBar = 'frameAddressBar' + IdEdAddressBar = 'edAddressBar' + + IdBtBack = 'btBack' + IdBtForward = 'btForward' + IdBtReload = 'btReload' + IdBtStop = 'btStop' + + IdFrameSearch = 'frameSearch' + IdEdSearch = 'edSearch' + IdBtSearchUpwards = 'btSearchUpwards' + IdBtSearchDownwards = 'btSearchDownwards' + IdCkSearchCaseSensitive = 'ckSearchCaseSensitive' + + ForcedMinBrowserTabText = 5 # forced minimum number of chars on browser tabBar + + def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): + QtGui.QWidget.__init__(self, parent) + + self.setupUi(self) + config.ObjectRegistry.register(self) + + self._initialConfigDataArrived = False + + self.fcSettings = BrowserWidgetSettings(self).restore() + self.fcActions = BrowserWidgetActions(self) + self.fcViewObject = BrowserWidgetViewObject(self) + self.fcGlobalFeedback = BrowserWidgetGlobalFeedback(self, idGlobalFeedback) + + # setup tab bar + tabWidget = self.controlById(self.IdTabBrowsers) + tabWidget.clear() + tabWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) + self.connect(tabWidget, QtCore.SIGNAL('currentChanged(int)'), self.onTabCurrentChanged) + self.connect(tabWidget, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onTabContextMenuEvent) + + # setup addressbar + addressbar = self.controlById(self.IdEdAddressBar) + self.connect(addressbar, QtCore.SIGNAL('returnPressed()'), self.onNavBarReturnPressed) + + # setup tool buttons + self.controlById(self.IdBtBack).setDefaultAction(self.fcActions['ActionBack']) + self.controlById(self.IdBtForward).setDefaultAction(self.fcActions['ActionForward']) + self.controlById(self.IdBtReload).setDefaultAction(self.fcActions['ActionReload']) + 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) + + # fire up a new broser to make a start + self.newBrowser(title=self.trUtf8('Waiting for fproxy')) + self.fcActions['ActionGoToHomePage'].trigger() + + ######################################### + ## private methods + ######################################### + #NOTE: to reduce flicker set min size to max size + def _adjustTabText(self, qString): + maxTabText = self.fcSettings.value('MaxTabText') + minTabText = self.fcSettings.value('MinTabText') + ellipsis = self.trUtf8('..') + + if minTabText < self.ForcedMinBrowserTabText: + minTabText = self.ForcedMinBrowserTabText + self.fcSettings.setValues(MinTabText=minTabText) + if maxTabText < self.ForcedMinBrowserTabText: + maxTabText = self.ForcedMinBrowserTabText + self.fcSettings.setValues(MaxTabText=maxTabText) + if minTabText > maxTabText: + minTabText = maxTabText + self.fcSettings.setValues(MinTabText=maxTabText) + + if qString.count() < minTabText: + qString = qString.append('\x20' * (minTabText - qString.count())) + else: + if maxTabText < self.ForcedMinBrowserTabText: + maxTabText = sminTabText + qString = qtools.truncateString(maxTabText, qString, ellipsis) + return qString + + def _downloadImageToDisk(self, hitTestResult): + px = hitTestResult.pixmap() + if px.isNull(): + return False + + key = config.qStringToFcpKey(hitTestResult.imageUrl().toString()) + if key is None: + return False + + # 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')) + fileName = unicode(config.guessFileNameFromKey(key, default=QtCore.QString(''))) + + if directory and fileName: + directory = os.path.join(directory, fileName) + elif not directory: + directory = fileName + filePath = QtGui.QFileDialog.getSaveFileName(self, caption, directory) + + if filePath: + filePath= unicode(filePath) + if os.path.exists(filePath): + try: + os.remove(filePath) + except Exception, details: + QtGui.QMessageBox.critical( + self, + caption, + self.trUtf8('Could not remove file'), #NOTE: no details please, may contain arbitrary lenght filepath + ) + return False + px.save(filePath) + return True + + def _downloadKeyToDisk(self, qUrl): + """ + @return: (bool) False if the key in the url is invalid, True otherwise + """ + fcpKey = config.qStringToFcpKe... [truncated message content] |
From: <jU...@us...> - 2008-07-27 11:31:12
|
Revision: 768 http://fclient.svn.sourceforge.net/fclient/?rev=768&view=rev Author: jUrner Date: 2008-07-27 11:31:20 +0000 (Sun, 27 Jul 2008) Log Message: ----------- naming Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py trunk/fclient/src/fclient/impl/MainWindow.py trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py trunk/fclient/src/fclient/impl/Ui_ViewConnection.py trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py Added Paths: ----------- trunk/fclient/src/fclient/impl/View.py Removed Paths: ------------- trunk/fclient/src/fclient/impl/Ui_View.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:29:02 UTC (rev 767) +++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:31:20 UTC (rev 768) @@ -7,7 +7,7 @@ from PyQt4 import QtGui from .impl.MainWindow import MainWindow -from .impl.Ui_View import ViewWidget +from .impl.View import ViewWidget from .impl.Ui_ViewBrowser import ViewBrowserWidget from .impl.Ui_ViewConnection import ViewConnectionWidget from .impl.Ui_ViewDownloads import ViewDownloadsWidget Modified: trunk/fclient/src/fclient/impl/MainWindow.py =================================================================== --- trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-27 11:29:02 UTC (rev 767) +++ trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-27 11:31:20 UTC (rev 768) @@ -10,7 +10,6 @@ from . import config from . import Ui_Prefs -from . import Ui_View from .lib.qt4ex import dlgabout from .tpls.Ui_MainWindowTpl import Ui_MainWindow Deleted: trunk/fclient/src/fclient/impl/Ui_View.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_View.py 2008-07-27 11:29:02 UTC (rev 767) +++ trunk/fclient/src/fclient/impl/Ui_View.py 2008-07-27 11:31:20 UTC (rev 768) @@ -1,277 +0,0 @@ -#FIXES -#*************************************************************************** -# [0001] -# -# QTabWidget.closeEvent() does not seem to propagate close events -# to child widgets -# -# -#*************************************************************************** -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - - -from PyQt4 import QtCore, QtGui - - -from . import config -from .lib import fcp2 -from .tpls.Ui_ViewWidgetTpl import Ui_ViewWidget -#********************************************************************************** -# -#********************************************************************************** -class Actions(config.ActionsBase): - - def __init__(self, parent): - config.ActionsBase.__init__(self, parent) - - self.action( - name='ActionShowTopTabBar', - text=self.trUtf8('Show top &tabs'), - trigger=parent.onActionShowTabsTop, - isCheckable=True, - isChecked=True, - ) - - -class GlobalFeedback(config.GlobalFeedbackBase): - """wrapper for global statusbar widgets, menus""" - - def __init__(self, parent, idGlobalFeedback): - config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) - - # menus - self.menus = [] - if self.menuBar is not None and hasattr(parent, 'fcViewObject'): - menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) - parent.populateMenu(menu) - self.menus.append(menu) - self.menuBar.addViewMenu(menu) - - def setVisible(self, flag): - for menu in self.menus: - menu.children()[0].setVisible(flag) - - - -class Settings(config.SettingsBase): - _key_ = config.IdViewWidget - _settings_ = ( - ('LastViewTop', 'String', '', config.SettingScopePrivate), - ('LastViewBottom', 'String', '', config.SettingScopePrivate), - ('SplitterPos', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), - ('ShowTopTabBar', 'Bool', True, config.SettingScopePrivate), - - ) - - -class ViewObject(config.ViewObject): - - def __init__(self, parent): - config.ViewObject. __init__(self, parent) - - self.name=parent.objectName() - self.displayName=self.trUtf8('View') - self.icon=QtGui.QIcon() - -#*********************************************************************** -# -#*********************************************************************** -class ViewWidget(QtGui.QWidget, Ui_ViewWidget): - - IdSplitter = 'Splitter' - IdTabTop = 'tabTop' - IdTabBottom = 'tabBottom' - - - def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): - QtGui.QWidget.__init__(self, parent) - - self._isCreated = False - - self.views = {} - - self.setupUi(self) - config.ObjectRegistry.register(self) - self.fcActions = Actions(self) - self.fcSettings = Settings().restore() - self.fcViewObject = ViewObject(self) - self.fcGlobalFeedback = GlobalFeedback(self, idGlobalFeedback) - - # setup tab widgets - tabWidgetTop = self.controlById(self.IdTabTop) - tabWidgetTop.removeTab(0) - tabWidgetBottom = self.controlById(self.IdTabBottom) - tabWidgetBottom.removeTab(0) - - # setup splitter - splitter = self.controlById(self.IdSplitter) - splitter.restoreState(self.fcSettings.value('SplitterPos')) - self.connect(splitter, QtCore.SIGNAL('splitterMoved(int, int)'), self.onSplitterMoved) - - # setup actions - showTopTabBar = self.fcSettings.value('ShowTopTabBar') - self.fcActions['ActionShowTopTabBar'].setChecked(showTopTabBar) - tabWidgetTop.tabBar().setVisible(showTopTabBar) - - - - def controlById(self, idControl): - return getattr(self, idControl) - - - def _addViews(self, toTop, *views): - tabWidget = self.controlById(self.IdTabTop) if toTop else self.controlById(self.IdTabBottom) - for view in views: - name = view.fcViewObject.name - if not name: - raise ValueError('view must have a name') - if name in self.views: - raise ValueError('view with that name is already present: %s' % name) - view.setParent(tabWidget) - i = tabWidget.addTab(view, view.fcViewObject.icon, view.fcViewObject.displayName) - self.views[name] = (tabWidget, view) - - #tab.tabBar().setVisible(tab.count() > 1) - - - def addBottomViews(self, *views): - return self._addViews(False, *views) - - - def addTopViews(self, *views): - return self._addViews(True, *views) - - - def populateMenu(self, menu): - menu.addAction(self.fcActions['ActionShowTopTabBar']) - return menu - - - - def setCurrentView(self, name): - result = self.views.get(name, None) - if result is not None: - tab, view = result - tab.setCurrentWidget(view) - return True - return False - - - def viewFromName(self, name): - result = self.views.get(name, None) - if result is not None: - return result[1] - return None - - ######################################################### - ## - ######################################################### - def hideEvent(self, event): - self.fcGlobalFeedback.setVisible(False) - - - def showEvent(self, event): - self.fcGlobalFeedback.setVisible(True) - - - ######################################################### - ## - ######################################################### - def closeEvent(self, event): - for tab, view in self.views.values(): - view.viewClose() - - - def showEvent(self, event): - if self._isCreated: - return - self._isCreated = True - - # restore current views - tabWidgetTop = self.controlById(self.IdTabTop) - lastName = self.fcSettings.value('LastViewTop') - self.setCurrentView(lastName) - - tabWidgetBottom = self.controlById(self.IdTabBottom) - lastName = self.fcSettings.value('LastViewBottom') - self.setCurrentView(lastName) - - # finally connect... not to overwrite settings - self.connect(tabWidgetTop, QtCore.SIGNAL('currentChanged(int)'), self.onTabTopCurrentChanged) - self.connect(tabWidgetBottom, QtCore.SIGNAL('currentChanged(int)'), self.onTabBottomCurrentChanged) - - ######################################################### - ## - ######################################################### - def onActionShowTabsTop(self, action): - tabWidgetTop = self.controlById(self.IdTabTop) - tabWidgetTop.tabBar().setVisible(action.isChecked()) - self.fcSettings.setValues(ShowTopTabBar=action.isChecked()) - - - def onSplitterMoved(self, pos, index): - splitter = self.controlById(self.IdSplitter) - self.fcSettings.setValues(SplitterPos=splitter.saveState()) - - - def onTabTopCurrentChanged(self, index): - tabWidget = self.controlById(self.IdTabTop) - view = tabWidget.currentWidget() - self.fcSettings.setValues(LastViewTop=view.fcViewObject.name) - - - def onTabBottomCurrentChanged(self, index): - tab = self.controlById(self.IdTabBottom) - view = tab.currentWidget() - self.fcSettings.setValues(LastViewBottom=view.fcViewObject.name) - -#********************************************************************************** -# -#********************************************************************************** -#NOTE: to self. no need to register views to config.ObjectRegistry. they are just -# opaque objects private to ViewWidget -class View(object): - """base class for views ond by L{ViewWidget}""" - - def __init__(self): - raise NotImplemetedError() - - def viewClose(self): - """called when the view is about to be closed""" - - def viewDisplayName(self): - """should return the user visible name of the view - @return: (QString) - """ - raise NotImplemetedError() - - - def viewIcon(self): - """should return the icon associated to the view - @return: (QIcon) - """ - raise NotImplemetedError() - - def viewName(self): - """should return the internally used id of the view - @return: (str) id - """ - raise NotImplemetedError() - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = ViewWidget(None) - w.show() - res = app.exec_() - sys.exit(res) - - - - Modified: trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py 2008-07-27 11:29:02 UTC (rev 767) +++ trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py 2008-07-27 11:31:20 UTC (rev 768) @@ -976,7 +976,7 @@ import sys from .Ui_ViewLogger import ViewLoggerWidget from .MainWindow import MainWindow - from .Ui_View import ViewWidget + from .View import ViewWidget from .Ui_ViewConnection import ViewConnectionWidget from .Ui_ViewDownloads import ViewDownloadsWidget Modified: trunk/fclient/src/fclient/impl/Ui_ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewConnection.py 2008-07-27 11:29:02 UTC (rev 767) +++ trunk/fclient/src/fclient/impl/Ui_ViewConnection.py 2008-07-27 11:31:20 UTC (rev 768) @@ -295,7 +295,7 @@ #********************************************************************************** if __name__ == '__main__': import sys - from . import Ui_View, Ui_ViewLogger + from . import View, Ui_ViewLogger app = QtGui.QApplication(sys.argv) w = Ui_View.ViewWidget(None) Modified: trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:29:02 UTC (rev 767) +++ trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:31:20 UTC (rev 768) @@ -253,7 +253,7 @@ #********************************************************************************** if __name__ == '__main__': import sys - from . import Ui_View + from . import View from . import Ui_ViewConnection from . import Ui_ViewLogger from . import MainWindow Added: trunk/fclient/src/fclient/impl/View.py =================================================================== --- trunk/fclient/src/fclient/impl/View.py (rev 0) +++ trunk/fclient/src/fclient/impl/View.py 2008-07-27 11:31:20 UTC (rev 768) @@ -0,0 +1,277 @@ +#FIXES +#*************************************************************************** +# [0001] +# +# QTabWidget.closeEvent() does not seem to propagate close events +# to child widgets +# +# +#*************************************************************************** +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + + +from PyQt4 import QtCore, QtGui + + +from . import config +from .lib import fcp2 +from .tpls.Ui_ViewWidgetTpl import Ui_ViewWidget +#********************************************************************************** +# +#********************************************************************************** +class Actions(config.ActionsBase): + + def __init__(self, parent): + config.ActionsBase.__init__(self, parent) + + self.action( + name='ActionShowTopTabBar', + text=self.trUtf8('Show top &tabs'), + trigger=parent.onActionShowTabsTop, + isCheckable=True, + isChecked=True, + ) + + +class GlobalFeedback(config.GlobalFeedbackBase): + """wrapper for global statusbar widgets, menus""" + + def __init__(self, parent, idGlobalFeedback): + config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) + + # menus + self.menus = [] + if self.menuBar is not None and hasattr(parent, 'fcViewObject'): + menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) + parent.populateMenu(menu) + self.menus.append(menu) + self.menuBar.addViewMenu(menu) + + def setVisible(self, flag): + for menu in self.menus: + menu.children()[0].setVisible(flag) + + + +class Settings(config.SettingsBase): + _key_ = config.IdViewWidget + _settings_ = ( + ('LastViewTop', 'String', '', config.SettingScopePrivate), + ('LastViewBottom', 'String', '', config.SettingScopePrivate), + ('SplitterPos', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), + ('ShowTopTabBar', 'Bool', True, config.SettingScopePrivate), + + ) + + +class ViewObject(config.ViewObject): + + def __init__(self, parent): + config.ViewObject. __init__(self, parent) + + self.name=parent.objectName() + self.displayName=self.trUtf8('View') + self.icon=QtGui.QIcon() + +#*********************************************************************** +# +#*********************************************************************** +class ViewWidget(QtGui.QWidget, Ui_ViewWidget): + + IdSplitter = 'Splitter' + IdTabTop = 'tabTop' + IdTabBottom = 'tabBottom' + + + def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): + QtGui.QWidget.__init__(self, parent) + + self._isCreated = False + + self.views = {} + + self.setupUi(self) + config.ObjectRegistry.register(self) + self.fcActions = Actions(self) + self.fcSettings = Settings().restore() + self.fcViewObject = ViewObject(self) + self.fcGlobalFeedback = GlobalFeedback(self, idGlobalFeedback) + + # setup tab widgets + tabWidgetTop = self.controlById(self.IdTabTop) + tabWidgetTop.removeTab(0) + tabWidgetBottom = self.controlById(self.IdTabBottom) + tabWidgetBottom.removeTab(0) + + # setup splitter + splitter = self.controlById(self.IdSplitter) + splitter.restoreState(self.fcSettings.value('SplitterPos')) + self.connect(splitter, QtCore.SIGNAL('splitterMoved(int, int)'), self.onSplitterMoved) + + # setup actions + showTopTabBar = self.fcSettings.value('ShowTopTabBar') + self.fcActions['ActionShowTopTabBar'].setChecked(showTopTabBar) + tabWidgetTop.tabBar().setVisible(showTopTabBar) + + + + def controlById(self, idControl): + return getattr(self, idControl) + + + def _addViews(self, toTop, *views): + tabWidget = self.controlById(self.IdTabTop) if toTop else self.controlById(self.IdTabBottom) + for view in views: + name = view.fcViewObject.name + if not name: + raise ValueError('view must have a name') + if name in self.views: + raise ValueError('view with that name is already present: %s' % name) + view.setParent(tabWidget) + i = tabWidget.addTab(view, view.fcViewObject.icon, view.fcViewObject.displayName) + self.views[name] = (tabWidget, view) + + #tab.tabBar().setVisible(tab.count() > 1) + + + def addBottomViews(self, *views): + return self._addViews(False, *views) + + + def addTopViews(self, *views): + return self._addViews(True, *views) + + + def populateMenu(self, menu): + menu.addAction(self.fcActions['ActionShowTopTabBar']) + return menu + + + + def setCurrentView(self, name): + result = self.views.get(name, None) + if result is not None: + tab, view = result + tab.setCurrentWidget(view) + return True + return False + + + def viewFromName(self, name): + result = self.views.get(name, None) + if result is not None: + return result[1] + return None + + ######################################################### + ## + ######################################################### + def hideEvent(self, event): + self.fcGlobalFeedback.setVisible(False) + + + def showEvent(self, event): + self.fcGlobalFeedback.setVisible(True) + + + ######################################################### + ## + ######################################################### + def closeEvent(self, event): + for tab, view in self.views.values(): + view.viewClose() + + + def showEvent(self, event): + if self._isCreated: + return + self._isCreated = True + + # restore current views + tabWidgetTop = self.controlById(self.IdTabTop) + lastName = self.fcSettings.value('LastViewTop') + self.setCurrentView(lastName) + + tabWidgetBottom = self.controlById(self.IdTabBottom) + lastName = self.fcSettings.value('LastViewBottom') + self.setCurrentView(lastName) + + # finally connect... not to overwrite settings + self.connect(tabWidgetTop, QtCore.SIGNAL('currentChanged(int)'), self.onTabTopCurrentChanged) + self.connect(tabWidgetBottom, QtCore.SIGNAL('currentChanged(int)'), self.onTabBottomCurrentChanged) + + ######################################################### + ## + ######################################################### + def onActionShowTabsTop(self, action): + tabWidgetTop = self.controlById(self.IdTabTop) + tabWidgetTop.tabBar().setVisible(action.isChecked()) + self.fcSettings.setValues(ShowTopTabBar=action.isChecked()) + + + def onSplitterMoved(self, pos, index): + splitter = self.controlById(self.IdSplitter) + self.fcSettings.setValues(SplitterPos=splitter.saveState()) + + + def onTabTopCurrentChanged(self, index): + tabWidget = self.controlById(self.IdTabTop) + view = tabWidget.currentWidget() + self.fcSettings.setValues(LastViewTop=view.fcViewObject.name) + + + def onTabBottomCurrentChanged(self, index): + tab = self.controlById(self.IdTabBottom) + view = tab.currentWidget() + self.fcSettings.setValues(LastViewBottom=view.fcViewObject.name) + +#********************************************************************************** +# +#********************************************************************************** +#NOTE: to self. no need to register views to config.ObjectRegistry. they are just +# opaque objects private to ViewWidget +class View(object): + """base class for views ond by L{ViewWidget}""" + + def __init__(self): + raise NotImplemetedError() + + def viewClose(self): + """called when the view is about to be closed""" + + def viewDisplayName(self): + """should return the user visible name of the view + @return: (QString) + """ + raise NotImplemetedError() + + + def viewIcon(self): + """should return the icon associated to the view + @return: (QIcon) + """ + raise NotImplemetedError() + + def viewName(self): + """should return the internally used id of the view + @return: (str) id + """ + raise NotImplemetedError() + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = ViewWidget(None) + w.show() + res = app.exec_() + sys.exit(res) + + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:28:53
|
Revision: 767 http://fclient.svn.sourceforge.net/fclient/?rev=767&view=rev Author: jUrner Date: 2008-07-27 11:29:02 +0000 (Sun, 27 Jul 2008) Log Message: ----------- no longer needed Removed Paths: ------------- trunk/fclient/src/fclient/impl/Ui_MainWindow.py Deleted: trunk/fclient/src/fclient/impl/Ui_MainWindow.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_MainWindow.py 2008-07-27 11:27:22 UTC (rev 766) +++ trunk/fclient/src/fclient/impl/Ui_MainWindow.py 2008-07-27 11:29:02 UTC (rev 767) @@ -1,160 +0,0 @@ -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -import logging -import sys -logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) - -from PyQt4 import QtCore, QtGui - -from . import config -from . import Ui_Prefs -from . import Ui_View -from .lib.qt4ex import dlgabout - -from .tpls.Ui_MainWindowTpl import Ui_MainWindow -#********************************************************************************** -# -#********************************************************************************** -class Settings(config.SettingsBase): - - _key_ = config.IdMainWindow - _settings_ = ( - ('Geometry', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), - ) - - -class Actions(config.ActionsBase): - - def __init__(self, parent): - config.ActionsBase.__init__(self, parent) - - self.action( - name='ActionPreferences', - text=self.trUtf8('&Preferences...'), - trigger=parent.onActPreferencesTriggered, - ) - self.action( - name='ActionExit', - text=self.trUtf8('E&xit'), - trigger=parent.onActExitTriggered, - ) - self.action( - name='ActionAbout', - text=self.trUtf8('A&bout...'), - trigger=parent.onActAboutTriggered, - ) - self.action( - name='ActionHelp', - text=self.trUtf8('&Help...'), - trigger=parent.onActHelpTriggered, - ) - -#********************************************************************************** -# -#********************************************************************************** -class MenuBar(QtGui.QMenuBar): - - def __init__(self, parent): - QtGui.QMenuBar.__init__(self, parent) - self.setObjectName('MenuBar') - #config.ObjectRegistry.register(self) - - 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.menuHelp = QtGui.QMenu(self.trUtf8('&Help'), self) - self.addMenu(self.menuHelp) - self.menuHelp.addAction(parent.fclientActions['ActionAbout']) - self.menuHelp.addAction(parent.fclientActions['ActionHelp']) - - - def addViewMenu(self, menu): - self.insertMenu(self.menuHelp.children()[0], menu) - return menu - - - -class StatusBar(QtGui.QStatusBar): - - def __init__(self, parent): - QtGui.QStatusBar.__init__(self, parent) - self.setObjectName('StatusBar') - #config.ObjectRegistry.register(self) - parent.setStatusBar(self) - -#********************************************************************************** -# -#********************************************************************************** -class MainWindow(QtGui.QMainWindow, Ui_MainWindow): - - def __init__(self, parent=None): - QtGui.QMainWindow.__init__(self, parent) - self._isCreated = False - - self.setupUi(self) - config.ObjectRegistry.register(self) - - self.fclientSettings = Settings().restore() - self.fclientActions = Actions(self) - self.setMenuBar(MenuBar(self)) - self.setStatusBar(StatusBar(self)) - - self.restoreGeometry(self.fclientSettings.value('Geometry')) - - ################################################## - ## events - ################################################## - def closeEvent(self, event): - self.fclientSettings.setValues(Geometry=self.saveGeometry()) - - - def showEvent(self, event): - if self._isCreated: - return - self._isCreated = True - - ################################################## - ## event onrs - ################################################## - def onActPreferencesTriggered(self): - dlg = Ui_Prefs.PrefsDlg(self) - if dlg.exec_() == dlg.Accepted: - pass - - def onActExitTriggered(self): - self.close() - - def onActHelpTriggered(self): - pass - - def onActAboutTriggered(self): - 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 - ) - dlg.exec_() - #self.guiSettings['DlgAboutState'] = dlg.saveState() - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = MainWindow(None) - w.show() - res = app.exec_() - sys.exit(res) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:27:13
|
Revision: 766 http://fclient.svn.sourceforge.net/fclient/?rev=766&view=rev Author: jUrner Date: 2008-07-27 11:27:22 +0000 (Sun, 27 Jul 2008) Log Message: ----------- naming Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py Added Paths: ----------- trunk/fclient/src/fclient/impl/MainWindow.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:23:45 UTC (rev 765) +++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:27:22 UTC (rev 766) @@ -6,7 +6,7 @@ import sys from PyQt4 import QtGui -from .impl.Ui_MainWindow import MainWindow +from .impl.MainWindow import MainWindow from .impl.Ui_View import ViewWidget from .impl.Ui_ViewBrowser import ViewBrowserWidget from .impl.Ui_ViewConnection import ViewConnectionWidget Added: trunk/fclient/src/fclient/impl/MainWindow.py =================================================================== --- trunk/fclient/src/fclient/impl/MainWindow.py (rev 0) +++ trunk/fclient/src/fclient/impl/MainWindow.py 2008-07-27 11:27:22 UTC (rev 766) @@ -0,0 +1,160 @@ +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 logging +import sys +logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) + +from PyQt4 import QtCore, QtGui + +from . import config +from . import Ui_Prefs +from . import Ui_View +from .lib.qt4ex import dlgabout + +from .tpls.Ui_MainWindowTpl import Ui_MainWindow +#********************************************************************************** +# +#********************************************************************************** +class Settings(config.SettingsBase): + + _key_ = config.IdMainWindow + _settings_ = ( + ('Geometry', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), + ) + + +class Actions(config.ActionsBase): + + def __init__(self, parent): + config.ActionsBase.__init__(self, parent) + + self.action( + name='ActionPreferences', + text=self.trUtf8('&Preferences...'), + trigger=parent.onActPreferencesTriggered, + ) + self.action( + name='ActionExit', + text=self.trUtf8('E&xit'), + trigger=parent.onActExitTriggered, + ) + self.action( + name='ActionAbout', + text=self.trUtf8('A&bout...'), + trigger=parent.onActAboutTriggered, + ) + self.action( + name='ActionHelp', + text=self.trUtf8('&Help...'), + trigger=parent.onActHelpTriggered, + ) + +#********************************************************************************** +# +#********************************************************************************** +class MenuBar(QtGui.QMenuBar): + + def __init__(self, parent): + QtGui.QMenuBar.__init__(self, parent) + self.setObjectName('MenuBar') + #config.ObjectRegistry.register(self) + + 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.menuHelp = QtGui.QMenu(self.trUtf8('&Help'), self) + self.addMenu(self.menuHelp) + self.menuHelp.addAction(parent.fclientActions['ActionAbout']) + self.menuHelp.addAction(parent.fclientActions['ActionHelp']) + + + def addViewMenu(self, menu): + self.insertMenu(self.menuHelp.children()[0], menu) + return menu + + + +class StatusBar(QtGui.QStatusBar): + + def __init__(self, parent): + QtGui.QStatusBar.__init__(self, parent) + self.setObjectName('StatusBar') + #config.ObjectRegistry.register(self) + parent.setStatusBar(self) + +#********************************************************************************** +# +#********************************************************************************** +class MainWindow(QtGui.QMainWindow, Ui_MainWindow): + + def __init__(self, parent=None): + QtGui.QMainWindow.__init__(self, parent) + self._isCreated = False + + self.setupUi(self) + config.ObjectRegistry.register(self) + + self.fclientSettings = Settings().restore() + self.fclientActions = Actions(self) + self.setMenuBar(MenuBar(self)) + self.setStatusBar(StatusBar(self)) + + self.restoreGeometry(self.fclientSettings.value('Geometry')) + + ################################################## + ## events + ################################################## + def closeEvent(self, event): + self.fclientSettings.setValues(Geometry=self.saveGeometry()) + + + def showEvent(self, event): + if self._isCreated: + return + self._isCreated = True + + ################################################## + ## event onrs + ################################################## + def onActPreferencesTriggered(self): + dlg = Ui_Prefs.PrefsDlg(self) + if dlg.exec_() == dlg.Accepted: + pass + + def onActExitTriggered(self): + self.close() + + def onActHelpTriggered(self): + pass + + def onActAboutTriggered(self): + 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 + ) + dlg.exec_() + #self.guiSettings['DlgAboutState'] = dlg.saveState() + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + + app = QtGui.QApplication(sys.argv) + w = MainWindow(None) + w.show() + res = app.exec_() + sys.exit(res) \ No newline at end of file Modified: trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py 2008-07-27 11:23:45 UTC (rev 765) +++ trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py 2008-07-27 11:27:22 UTC (rev 766) @@ -975,7 +975,7 @@ if __name__ == '__main__': import sys from .Ui_ViewLogger import ViewLoggerWidget - from .Ui_MainWindow import MainWindow + from .MainWindow import MainWindow from .Ui_View import ViewWidget from .Ui_ViewConnection import ViewConnectionWidget from .Ui_ViewDownloads import ViewDownloadsWidget Modified: trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py =================================================================== --- trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:23:45 UTC (rev 765) +++ trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py 2008-07-27 11:27:22 UTC (rev 766) @@ -256,7 +256,7 @@ from . import Ui_View from . import Ui_ViewConnection from . import Ui_ViewLogger - from . import Ui_MainWindow + from . import MainWindow app = QtGui.QApplication(sys.argv) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:23:36
|
Revision: 765 http://fclient.svn.sourceforge.net/fclient/?rev=765&view=rev Author: jUrner Date: 2008-07-27 11:23:45 +0000 (Sun, 27 Jul 2008) Log Message: ----------- adjust imports Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:22:45 UTC (rev 764) +++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:23:45 UTC (rev 765) @@ -6,12 +6,12 @@ import sys from PyQt4 import QtGui -from .Ui_MainWindow import MainWindow -from .Ui_View import ViewWidget -from .Ui_ViewBrowser import ViewBrowserWidget -from .Ui_ViewConnection import ViewConnectionWidget -from .Ui_ViewDownloads import ViewDownloadsWidget -from .Ui_ViewLogger import ViewLoggerWidget +from .impl.Ui_MainWindow import MainWindow +from .impl.Ui_View import ViewWidget +from .impl.Ui_ViewBrowser import ViewBrowserWidget +from .impl.Ui_ViewConnection import ViewConnectionWidget +from .impl.Ui_ViewDownloads import ViewDownloadsWidget +from .impl.Ui_ViewLogger import ViewLoggerWidget #************************************************************* # #************************************************************* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:22:37
|
Revision: 764 http://fclient.svn.sourceforge.net/fclient/?rev=764&view=rev Author: jUrner Date: 2008-07-27 11:22:45 +0000 (Sun, 27 Jul 2008) Log Message: ----------- new package structure Added Paths: ----------- trunk/fclient/src/fclient/impl/Ui_DlgConnectionExpertSettings.py trunk/fclient/src/fclient/impl/Ui_DlgDownloadKeyToDisk.py trunk/fclient/src/fclient/impl/Ui_DlgPropsBrowserObject.py trunk/fclient/src/fclient/impl/Ui_MainWindow.py trunk/fclient/src/fclient/impl/Ui_Prefs.py trunk/fclient/src/fclient/impl/Ui_PrefsBrowserWidget.py trunk/fclient/src/fclient/impl/Ui_PrefsGlobal.py trunk/fclient/src/fclient/impl/Ui_View.py trunk/fclient/src/fclient/impl/Ui_ViewBrowser.py trunk/fclient/src/fclient/impl/Ui_ViewConnection.py trunk/fclient/src/fclient/impl/Ui_ViewDownloads.py trunk/fclient/src/fclient/impl/Ui_ViewLogger.py trunk/fclient/src/fclient/impl/__init__.py trunk/fclient/src/fclient/impl/config.py Removed Paths: ------------- trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py trunk/fclient/src/fclient/Ui_MainWindow.py trunk/fclient/src/fclient/Ui_Prefs.py trunk/fclient/src/fclient/Ui_PrefsBrowserWidget.py trunk/fclient/src/fclient/Ui_PrefsGlobal.py trunk/fclient/src/fclient/Ui_View.py trunk/fclient/src/fclient/Ui_ViewBrowser.py trunk/fclient/src/fclient/Ui_ViewConnection.py trunk/fclient/src/fclient/Ui_ViewDownloads.py trunk/fclient/src/fclient/Ui_ViewLogger.py trunk/fclient/src/fclient/__init__.py trunk/fclient/src/fclient/config.py Deleted: trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,73 +0,0 @@ - -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -from PyQt4 import QtCore, QtGui - -from . import config - -from .tpls.Ui_DlgConnectionExpertSettingsTpl import Ui_DlgConnectionExpertSettings -#********************************************************************************** -# -#********************************************************************************** -class ConnectionExpertSettingsDlg(QtGui.QDialog, Ui_DlgConnectionExpertSettings ): - - IdEdFcpConnectionName = 'edFcpConnectionName' - IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration' - IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout' - IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout' - - def __init__(self, parent=None): - QtGui.QDialog.__init__(self, parent) - - self.setupUi(self) - self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings')) - - edName = self.controlById(self.IdEdFcpConnectionName) - edName.setText(config.settings.value('FcpConnectionName')) - self.connect(edName, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionNameChanged) - - connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None) - spins = ( - (self.IdSpinFcpConnectionTimerMaxDuration, 'FcpConnectionTimerMaxDuration'), - (self.IdSpinConnectionTimerTimeout, 'FcpConnectionTimerTimeout'), - (self.IdSpinFcpPollTimerTimeout, 'FcpPollTimerTimeout'), - ) - for idControl, settingName in spins: - spin = self.controlById(idControl) - if connectionWidget is None: - spin.setEnabled(False) - else: - spin.setValue(connectionWidget.fcSettings.value(settingName)) - - - - - def controlById(self, idControl): - return getattr(self, idControl) - - - def onEdFcpConnectionNameChanged(self, text): - config.settings.setValues(FcpConnectionName=text) - - - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - class DummyKey(object): - KeyType = 'USK@' - def __init__(self): self.key = 'USG@qweqqweqwe' - def toString(self): return self.key - - app = QtGui.QApplication(sys.argv) - w = ConnectionExpertSettingsDlg(None) - w.show() - res = app.exec_() - sys.exit(res) - - Deleted: trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,79 +0,0 @@ -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -import os -from PyQt4 import QtCore, QtGui - -from . import config -from .lib.compactpath.qt4 import pathlabelwrap - - -from .tpls.Ui_DlgDownloadKeyToDiskTpl import Ui_DlgDownloadKeyToDisk -#********************************************************************************** -# -#********************************************************************************** -class DownloadKeyToDiskDlg(QtGui.QDialog, Ui_DlgDownloadKeyToDisk): - - IdLabelKey = 'labelKey' - IdEdDownloadFileName = 'edDownloadFileName' - IdBtChooseDownloadFileName = 'btChooseDownloadFileName' - - - def __init__(self, parent=None, fcpKey=None): - QtGui.QDialog.__init__(self, parent) - - self.setupUi(self) - self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Download key..')) - - self._filePath = None - self._fcpKey = fcpKey - - self.pathLabelWrap = pathlabelwrap.PathLabelWrap( - self.labelKey, - fpath=unicode(self.labelKey.text()), - path_module=config.CompactPathFcpKeyModule - ) - self.connect(self.btChooseDownloadFileName, QtCore.SIGNAL('clicked()'), self.onChooseDownloadFileName) - - # find out fileName to dl key to - fileName = config.guessFileNameFromKey(fcpKey) - if fileName is None: - fileName = self.trUtf8('UNKNOWN') - self._filePath = os.path.join(unicode(config.settings.value('DownloadDir')), unicode(fileName)) - self.edDownloadFileName.setText(self._filePath) - if self._fcpKey is not None: - self.pathLabelWrap.setPath(self._fcpKey.toString()) - - def filePath(self): - return self._filePath - - def onChooseDownloadFileName(self): - filePath = QtGui.QFileDialog.getSaveFileName( - self, - config.FclientAppName + self.trUtf8(' - Save key To..'), - self.edDownloadFileName.text(), - ) - if filePath: - self._filePath = filePath - self.edDownloadFileName.setText(filePath) - - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - class DummyKey(object): - KeyType = 'USK@' - def __init__(self): self.key = 'USG@qweqqweqwe' - def toString(self): return self.key - - app = QtGui.QApplication(sys.argv) - w = DownloadKeyToDiskDlg(None, fcpKey=DummyKey()) - w.show() - res = app.exec_() - sys.exit(res) - - Deleted: trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,69 +0,0 @@ -#********************************************************************* -#TODO: -# just a sketch so far -# -# x. link and image url are not selectable -# -# -#********************************************************************** -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -import posixpath -from PyQt4 import QtGui - -from . import config -from .lib.compactpath.qt4 import pathlabelwrap -from .lib.qt4ex.lib import tools as qtools - -from .tpls.Ui_DlgPropsBrowserObjectTpl import Ui_DlgPropsBrowserObject -#********************************************************************************** -# -#********************************************************************************** -class PropsBrowserObjectDlg(QtGui.QDialog, Ui_DlgPropsBrowserObject): - - IdLabelType = 'labelType' - IdLabelTitle = 'labelTitle' - IdLabelName = 'labelName' - IdLabelLinkUrl = 'labelLinkUrl' - IdLabelImageUrl = 'labelImageUrl' - - MaxText = 80 - - def __init__(self, parent, browser=None, hitTestResult=None): - QtGui.QDialog.__init__(self, parent) - - self.setupUi(self) - self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties')) - - if hitTestResult is not None: - - if not hitTestResult.linkUrl().isEmpty(): - labelLinkUrl = self.controlById(self.IdLabelLinkUrl) - self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=config.CompactPathFcpKeyModule) - self.wrapLinkUrl.setPath(unicode(hitTestResult.linkUrl().toString())) - if not hitTestResult.imageUrl().isEmpty(): - labelImageUrl = self.controlById(self.IdLabelImageUrl) - self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=config.CompactPathFcpKeyModule) - self.wrapImageUrl.setPath(unicode(hitTestResult.imageUrl().toString())) - - ellipsis = self.trUtf8('..') - self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkTitle().toString(), ellipsis)) - self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkText(), ellipsis)) - - def controlById(self, idControl): - return getattr(self, idControl) - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = PropsBrowserObjectDlg(None) - w.show() - res = app.exec_() - sys.exit(res) - Deleted: trunk/fclient/src/fclient/Ui_MainWindow.py =================================================================== --- trunk/fclient/src/fclient/Ui_MainWindow.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_MainWindow.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,160 +0,0 @@ -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -import logging -import sys -logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) - -from PyQt4 import QtCore, QtGui - -from . import config -from . import Ui_Prefs -from . import Ui_View -from .lib.qt4ex import dlgabout - -from .tpls.Ui_MainWindowTpl import Ui_MainWindow -#********************************************************************************** -# -#********************************************************************************** -class Settings(config.SettingsBase): - - _key_ = config.IdMainWindow - _settings_ = ( - ('Geometry', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), - ) - - -class Actions(config.ActionsBase): - - def __init__(self, parent): - config.ActionsBase.__init__(self, parent) - - self.action( - name='ActionPreferences', - text=self.trUtf8('&Preferences...'), - trigger=parent.onActPreferencesTriggered, - ) - self.action( - name='ActionExit', - text=self.trUtf8('E&xit'), - trigger=parent.onActExitTriggered, - ) - self.action( - name='ActionAbout', - text=self.trUtf8('A&bout...'), - trigger=parent.onActAboutTriggered, - ) - self.action( - name='ActionHelp', - text=self.trUtf8('&Help...'), - trigger=parent.onActHelpTriggered, - ) - -#********************************************************************************** -# -#********************************************************************************** -class MenuBar(QtGui.QMenuBar): - - def __init__(self, parent): - QtGui.QMenuBar.__init__(self, parent) - self.setObjectName('MenuBar') - #config.ObjectRegistry.register(self) - - 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.menuHelp = QtGui.QMenu(self.trUtf8('&Help'), self) - self.addMenu(self.menuHelp) - self.menuHelp.addAction(parent.fclientActions['ActionAbout']) - self.menuHelp.addAction(parent.fclientActions['ActionHelp']) - - - def addViewMenu(self, menu): - self.insertMenu(self.menuHelp.children()[0], menu) - return menu - - - -class StatusBar(QtGui.QStatusBar): - - def __init__(self, parent): - QtGui.QStatusBar.__init__(self, parent) - self.setObjectName('StatusBar') - #config.ObjectRegistry.register(self) - parent.setStatusBar(self) - -#********************************************************************************** -# -#********************************************************************************** -class MainWindow(QtGui.QMainWindow, Ui_MainWindow): - - def __init__(self, parent=None): - QtGui.QMainWindow.__init__(self, parent) - self._isCreated = False - - self.setupUi(self) - config.ObjectRegistry.register(self) - - self.fclientSettings = Settings().restore() - self.fclientActions = Actions(self) - self.setMenuBar(MenuBar(self)) - self.setStatusBar(StatusBar(self)) - - self.restoreGeometry(self.fclientSettings.value('Geometry')) - - ################################################## - ## events - ################################################## - def closeEvent(self, event): - self.fclientSettings.setValues(Geometry=self.saveGeometry()) - - - def showEvent(self, event): - if self._isCreated: - return - self._isCreated = True - - ################################################## - ## event onrs - ################################################## - def onActPreferencesTriggered(self): - dlg = Ui_Prefs.PrefsDlg(self) - if dlg.exec_() == dlg.Accepted: - pass - - def onActExitTriggered(self): - self.close() - - def onActHelpTriggered(self): - pass - - def onActAboutTriggered(self): - 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 - ) - dlg.exec_() - #self.guiSettings['DlgAboutState'] = dlg.saveState() - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = MainWindow(None) - w.show() - res = app.exec_() - sys.exit(res) \ No newline at end of file Deleted: trunk/fclient/src/fclient/Ui_Prefs.py =================================================================== --- trunk/fclient/src/fclient/Ui_Prefs.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_Prefs.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,91 +0,0 @@ -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - - -from PyQt4 import QtGui - -from . import config -from .lib.qt4ex import dlgpreferences -from .Ui_PrefsGlobal import PrefsPageGlobal -from .Ui_PrefsBrowserWidget import PrefsPageBrowser -#********************************************************************************** -# -#********************************************************************************** -class Settings(config.SettingsBase): - _key_ = config.IdViewBrowserWidget - _settings_ = ( - ('DlgState', 'String', '', config.SettingScopePrivate), - ) - - -#*********************************************************************** -# -#*********************************************************************** -class PrefsPageRoot(dlgpreferences.Page): - - UUID = '{a61e2758-4c66-11dd-a3e6-8814a37cbeed}' - - def __init__(self): - dlgpreferences.Page.__init__(self, self.UUID) - self._widget = None - self.setDirty(True) - - def displayName(self): - return QtGui.QApplication.translate("PreferencesGlobal", 'All', None, QtGui.QApplication.UnicodeUTF8) - - def canApply(self): return False - def canHelp(self): return False - - def setVisible(self, parent, flag): - createdNew = False - if flag and self._widget is None: - createdNew = True - self._widget = QtGui.QWidget(parent) - self._widget.setVisible(flag) - return (createdNew, self._widget) - -#********************************************************************************** -# -#********************************************************************************** -class PrefsDlg(dlgpreferences.DlgPreferencesFlatTree): - - def __init__(self, parent): - - pages = PrefsPageRoot()( - PrefsPageGlobal(), - PrefsPageBrowser(), - - ) - - dlgpreferences.DlgPreferencesFlatTree.__init__(self, - parent, - pages=pages, - startPage=PrefsPageGlobal.UUID, - ) - self.fcSettings = Settings(self).restore() - - - def showEvent(self, event): - self.restoreState(self.fcSettings.value('DlgState')) - - def hideEvent(self, event): - self.fcSettings.setValues(DlgState=self.saveState()) - - def closeEvent(self, event): - pass - - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = PrefsDlg(None) - w.show() - res = app.exec_() - sys.exit(res) - - Deleted: trunk/fclient/src/fclient/Ui_PrefsBrowserWidget.py =================================================================== --- trunk/fclient/src/fclient/Ui_PrefsBrowserWidget.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_PrefsBrowserWidget.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,113 +0,0 @@ - -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - - -from PyQt4 import QtCore, QtGui - -from . import config -from .lib.qt4ex import dlgpreferences - -from .tpls.Ui_PrefsBrowserWidgetTpl import Ui_PrefsBrowserWidget -#********************************************************************************** -# -#********************************************************************************** -class PrefsBrowserWidget(QtGui.QWidget, Ui_PrefsBrowserWidget): - - IdEdHomePage = 'edHomePage' - IdCkOpenAddressBarInNewTab = 'ckOpenAddressBarInNewTab' - IdCkOpenBookmarksInNewTab = 'ckOpenBookmarksInNewTab' - IdCkOpenLinksInNewTab = 'ckOpenLinksInNewTab' - IdCkOpenHomePageOnNewTabCreated = 'ckOpenHomePageOnNewTabCreated' - IdCkBackIsClose = 'ckBackIsClose' - IdCkAutoLoadImages = 'ckAutoLoadImages' - - def __init__(self, parent): - QtGui.QWidget.__init__(self, parent) - self.setupUi(self) - - browser = config.ObjectRegistry.get(config.IdViewBrowserWidget, None) - self.setEnabled(browser is not None) - if browser is not None: - self.controlById(self.IdEdHomePage).setText(browser.fcSettings.value('HomePage')) - ck = self.controlById(self.IdCkOpenAddressBarInNewTab) - ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenAddressBarInNewTab') else QtCore.Qt.Unchecked) - ck = self.controlById(self.IdCkOpenBookmarksInNewTab) - ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenBookmarksInNewTab') else QtCore.Qt.Unchecked) - ck = self.controlById(self.IdCkOpenLinksInNewTab) - ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenLinksInNewTab') else QtCore.Qt.Unchecked) - ck = self.controlById(self.IdCkOpenHomePageOnNewTabCreated) - ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('OpenHomePageOnNewTabCreated') else QtCore.Qt.Unchecked) - ck = self.controlById(self.IdCkBackIsClose) - ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('BackIsClose') else QtCore.Qt.Unchecked) - ck = self.controlById(self.IdCkAutoLoadImages) - ck.setCheckState(QtCore.Qt.Checked if browser.fcSettings.value('AutoLoadImages') else QtCore.Qt.Unchecked) - - def controlById(self, idControl): - return getattr(self, idControl) - - def apply(self): - browser = config.ObjectRegistry.get(config.IdViewBrowserWidget, None) - if browser is not None: - edHomePage = self.controlById(self.IdEdHomePage) - - browser.fcSettings.setValues( - HomePage=edHomePage.text(), - OpenAddressBarInNewTab=self.controlById(self.IdCkOpenAddressBarInNewTab).checkState() == QtCore.Qt.Checked, - OpenBookmarksInNewTab=self.controlById(self.IdCkOpenBookmarksInNewTab).checkState() == QtCore.Qt.Checked, - OpenLinksInNewTab=self.controlById(self.IdCkOpenLinksInNewTab).checkState() == QtCore.Qt.Checked, - OpenHomePageOnNewTabCreated=self.controlById(self.IdCkOpenHomePageOnNewTabCreated).checkState() == QtCore.Qt.Checked, - BackIsClose=self.controlById(self.IdCkBackIsClose).checkState() == QtCore.Qt.Checked, - AutoLoadImages=self.controlById(self.IdCkAutoLoadImages).checkState() == QtCore.Qt.Checked, - ) - - -#*********************************************************************** -# -#*********************************************************************** -class PrefsPageBrowser(dlgpreferences.Page): - - UUID = '{c85e63a8-6806-435a-81ce-f4b46872246f}' - - def __init__(self): - dlgpreferences.Page.__init__(self, self.UUID) - self._widget = None - self.setDirty(True) - - def displayName(self): - return self.trUtf8('Browser') - - def canApply(self): return True - def canHelp(self): return True - - def setVisible(self, parent, flag): - createdNew = False - if flag and self._widget is None: - createdNew = True - self._widget = PrefsBrowserWidget(parent) - self._widget.setVisible(flag) - return (createdNew, self._widget) - - - def doApply(self): - self._widget.apply() - return True - - def doOk(self): - return True - - -#*********************************************************************** -# -#*********************************************************************** -if __name__ == '__main__': - from PyQt4 import QtGui - import sys - - app = QtGui.QApplication(sys.argv) - w = PrefsBrowserWidget(None) - w.show() - res = app.exec_() - sys.exit(res) - Deleted: trunk/fclient/src/fclient/Ui_PrefsGlobal.py =================================================================== --- trunk/fclient/src/fclient/Ui_PrefsGlobal.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_PrefsGlobal.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,62 +0,0 @@ - -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - - -from PyQt4 import QtGui - -from . import config -from .lib.qt4ex import dlgpreferences - -from .tpls.Ui_PrefsGlobalWidgetTpl import Ui_PrefsGlobalWidget -#********************************************************************************** -# -#********************************************************************************** -class PrefsGlobalWidget(QtGui.QWidget, Ui_PrefsGlobalWidget): - - def __init__(self, parent): - QtGui.QWidget.__init__(self, parent) - self.setupUi(self) - -#*********************************************************************** -# -#*********************************************************************** -class PrefsPageGlobal(dlgpreferences.Page): - - UUID = '{ba654bd8-4c63-11dd-b8b1-a11c9b5c3981}' - - def __init__(self): - dlgpreferences.Page.__init__(self, self.UUID) - self._widget = None - self.setDirty(True) - - def displayName(self): - return self.trUtf8('Global') - - def canApply(self): return True - def canHelp(self): return True - - def setVisible(self, parent, flag): - createdNew = False - if flag and self._widget is None: - createdNew = True - self._widget = PrefsGlobalWidget(parent) - self._widget.setVisible(flag) - return (createdNew, self._widget) - - - -#*********************************************************************** -# -#*********************************************************************** -if __name__ == '__main__': - from PyQt4 import QtGui - import sys - - app = QtGui.QApplication(sys.argv) - w = PrefsGlobalWidget(None) - w.show() - res = app.exec_() - sys.exit(res) - Deleted: trunk/fclient/src/fclient/Ui_View.py =================================================================== --- trunk/fclient/src/fclient/Ui_View.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_View.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,277 +0,0 @@ -#FIXES -#*************************************************************************** -# [0001] -# -# QTabWidget.closeEvent() does not seem to propagate close events -# to child widgets -# -# -#*************************************************************************** -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - - -from PyQt4 import QtCore, QtGui - - -from . import config -from .lib import fcp2 -from .tpls.Ui_ViewWidgetTpl import Ui_ViewWidget -#********************************************************************************** -# -#********************************************************************************** -class Actions(config.ActionsBase): - - def __init__(self, parent): - config.ActionsBase.__init__(self, parent) - - self.action( - name='ActionShowTopTabBar', - text=self.trUtf8('Show top &tabs'), - trigger=parent.onActionShowTabsTop, - isCheckable=True, - isChecked=True, - ) - - -class GlobalFeedback(config.GlobalFeedbackBase): - """wrapper for global statusbar widgets, menus""" - - def __init__(self, parent, idGlobalFeedback): - config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) - - # menus - self.menus = [] - if self.menuBar is not None and hasattr(parent, 'fcViewObject'): - menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) - parent.populateMenu(menu) - self.menus.append(menu) - self.menuBar.addViewMenu(menu) - - def setVisible(self, flag): - for menu in self.menus: - menu.children()[0].setVisible(flag) - - - -class Settings(config.SettingsBase): - _key_ = config.IdViewWidget - _settings_ = ( - ('LastViewTop', 'String', '', config.SettingScopePrivate), - ('LastViewBottom', 'String', '', config.SettingScopePrivate), - ('SplitterPos', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), - ('ShowTopTabBar', 'Bool', True, config.SettingScopePrivate), - - ) - - -class ViewObject(config.ViewObject): - - def __init__(self, parent): - config.ViewObject. __init__(self, parent) - - self.name=parent.objectName() - self.displayName=self.trUtf8('View') - self.icon=QtGui.QIcon() - -#*********************************************************************** -# -#*********************************************************************** -class ViewWidget(QtGui.QWidget, Ui_ViewWidget): - - IdSplitter = 'Splitter' - IdTabTop = 'tabTop' - IdTabBottom = 'tabBottom' - - - def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): - QtGui.QWidget.__init__(self, parent) - - self._isCreated = False - - self.views = {} - - self.setupUi(self) - config.ObjectRegistry.register(self) - self.fcActions = Actions(self) - self.fcSettings = Settings().restore() - self.fcViewObject = ViewObject(self) - self.fcGlobalFeedback = GlobalFeedback(self, idGlobalFeedback) - - # setup tab widgets - tabWidgetTop = self.controlById(self.IdTabTop) - tabWidgetTop.removeTab(0) - tabWidgetBottom = self.controlById(self.IdTabBottom) - tabWidgetBottom.removeTab(0) - - # setup splitter - splitter = self.controlById(self.IdSplitter) - splitter.restoreState(self.fcSettings.value('SplitterPos')) - self.connect(splitter, QtCore.SIGNAL('splitterMoved(int, int)'), self.onSplitterMoved) - - # setup actions - showTopTabBar = self.fcSettings.value('ShowTopTabBar') - self.fcActions['ActionShowTopTabBar'].setChecked(showTopTabBar) - tabWidgetTop.tabBar().setVisible(showTopTabBar) - - - - def controlById(self, idControl): - return getattr(self, idControl) - - - def _addViews(self, toTop, *views): - tabWidget = self.controlById(self.IdTabTop) if toTop else self.controlById(self.IdTabBottom) - for view in views: - name = view.fcViewObject.name - if not name: - raise ValueError('view must have a name') - if name in self.views: - raise ValueError('view with that name is already present: %s' % name) - view.setParent(tabWidget) - i = tabWidget.addTab(view, view.fcViewObject.icon, view.fcViewObject.displayName) - self.views[name] = (tabWidget, view) - - #tab.tabBar().setVisible(tab.count() > 1) - - - def addBottomViews(self, *views): - return self._addViews(False, *views) - - - def addTopViews(self, *views): - return self._addViews(True, *views) - - - def populateMenu(self, menu): - menu.addAction(self.fcActions['ActionShowTopTabBar']) - return menu - - - - def setCurrentView(self, name): - result = self.views.get(name, None) - if result is not None: - tab, view = result - tab.setCurrentWidget(view) - return True - return False - - - def viewFromName(self, name): - result = self.views.get(name, None) - if result is not None: - return result[1] - return None - - ######################################################### - ## - ######################################################### - def hideEvent(self, event): - self.fcGlobalFeedback.setVisible(False) - - - def showEvent(self, event): - self.fcGlobalFeedback.setVisible(True) - - - ######################################################### - ## - ######################################################### - def closeEvent(self, event): - for tab, view in self.views.values(): - view.viewClose() - - - def showEvent(self, event): - if self._isCreated: - return - self._isCreated = True - - # restore current views - tabWidgetTop = self.controlById(self.IdTabTop) - lastName = self.fcSettings.value('LastViewTop') - self.setCurrentView(lastName) - - tabWidgetBottom = self.controlById(self.IdTabBottom) - lastName = self.fcSettings.value('LastViewBottom') - self.setCurrentView(lastName) - - # finally connect... not to overwrite settings - self.connect(tabWidgetTop, QtCore.SIGNAL('currentChanged(int)'), self.onTabTopCurrentChanged) - self.connect(tabWidgetBottom, QtCore.SIGNAL('currentChanged(int)'), self.onTabBottomCurrentChanged) - - ######################################################### - ## - ######################################################### - def onActionShowTabsTop(self, action): - tabWidgetTop = self.controlById(self.IdTabTop) - tabWidgetTop.tabBar().setVisible(action.isChecked()) - self.fcSettings.setValues(ShowTopTabBar=action.isChecked()) - - - def onSplitterMoved(self, pos, index): - splitter = self.controlById(self.IdSplitter) - self.fcSettings.setValues(SplitterPos=splitter.saveState()) - - - def onTabTopCurrentChanged(self, index): - tabWidget = self.controlById(self.IdTabTop) - view = tabWidget.currentWidget() - self.fcSettings.setValues(LastViewTop=view.fcViewObject.name) - - - def onTabBottomCurrentChanged(self, index): - tab = self.controlById(self.IdTabBottom) - view = tab.currentWidget() - self.fcSettings.setValues(LastViewBottom=view.fcViewObject.name) - -#********************************************************************************** -# -#********************************************************************************** -#NOTE: to self. no need to register views to config.ObjectRegistry. they are just -# opaque objects private to ViewWidget -class View(object): - """base class for views ond by L{ViewWidget}""" - - def __init__(self): - raise NotImplemetedError() - - def viewClose(self): - """called when the view is about to be closed""" - - def viewDisplayName(self): - """should return the user visible name of the view - @return: (QString) - """ - raise NotImplemetedError() - - - def viewIcon(self): - """should return the icon associated to the view - @return: (QIcon) - """ - raise NotImplemetedError() - - def viewName(self): - """should return the internally used id of the view - @return: (str) id - """ - raise NotImplemetedError() - -#********************************************************************************** -# -#********************************************************************************** -if __name__ == '__main__': - import sys - - app = QtGui.QApplication(sys.argv) - w = ViewWidget(None) - w.show() - res = app.exec_() - sys.exit(res) - - - - Deleted: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-27 11:20:49 UTC (rev 763) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-27 11:22:45 UTC (rev 764) @@ -1,1030 +0,0 @@ -#****************************************************************************************** -#TODO: -# 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? -# x. save page to disk -# x. download. idea is to add dls to global download widget and mark them (some color code) as new content. -# alt would be to to do it firefox like in a separate widget. maybe an option to adjust if browser dls should be -# persistent or not -# x. tool buttons do not adjust their size to icon size. maybe it is some global setting via qt-config -# x. fProxy is a bit tight-lipped when it comes to feedback. no idea -# x. give feedback on tabs about load / finisched / error. maybe some color code. wait for new QTabWidget features (qt4.5) -# x. close button on tabs. wait for new QTabWidget features (qt4.5) -# x. page actions: CopyImageToClipboard, -# x. when mouse pointer is over an opend image a magnifier cursor appears. no idea how this is handled -# x. open new tab on tab bar double click. IIRC looks like no way before qt4.5. tabBars are not stretched to fit in qt4.4 -# x. global feedback on statusbar flickers. reason: first label is holds arbitrary length text -# x. fproxy. "force browser to dl" should we dl it in downloads or store emidiately? no idea -# x. visiting plugins via fproxy does not work -# x. real toolbars -# x. remove host/port from urls? -# x. browser settings - QWebSettings -# x. shortcuts -# x. user staring gui for first time. maybe we should not connext untill the user connects explicitely -#****************************************************************************************** -""" - -@newfield signal: signal, signals -""" -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] - -from PyQt4 import QtCore, QtGui, QtWebKit - -from . import config - -from .lib import fcp2 -from .lib.qt4ex.lib import tools as qtools -from .lib.compactpath.qt4 import pathlabelwrap - -from . import Ui_DlgPropsBrowserObject -from . import Ui_DlgDownloadKeyToDisk -from .tpls.Ui_ViewBrowserWidgetTpl import Ui_ViewBrowserWidget -#***************************************************************************************** -# -#***************************************************************************************** -class Page(QtWebKit.QWebPage): - def __init__(self, parent): - QtWebKit.QWebPage.__init__(self, parent) - - #def acceptNavigationRequest(self, frame, request, typeRequest): - # return True - -#***************************************************************************************** -# -#***************************************************************************************** -class Browser(QtWebKit.QWebView): - """ browser customized for freenet - """ - - MaxProgress = 100 - - def __init__(self, parent=None, userData=None): - QtWebKit.QWebView.__init__(self, parent) - - page = Page(self) - self.setPage(page) - - #NOTE: we store last progress made to set busy cursor accordingly - self._lastProgress = 0 - self._userData = userData - - # connect actions - self.connect(self, QtCore.SIGNAL('loadStarted()'), self.onLoadStarted) - self.connect(self, QtCore.SIGNAL('loadProgress(int)'), self.onLoadProgress) - self.connect(self, QtCore.SIGNAL('loadFinished(bool)'), self.onLoadFinished) - self.connect(self.pageAction(QtWebKit.QWebPage.Stop), QtCore.SIGNAL('triggered()'), self.onActionStopTriggered) - - ################################ - ## methods - ################################ - #def createWindow(self, typeWindow): - # pass - - def load(self, url): - self._lastProgress = 0 - return QtWebKit.QWebView.load(self, url) - - def setLastStatusMessage(self, qString): - self._lastStatusMessage = qString - - def setUrl(self, url): - return self.load(url) - - def setContents(self, *args): - """sets the contents of the browser without changing its url""" - self._lastProgress = 0 - return QtWebKit.QWebView.setContents(self, *args) - - def setHtml(self, *args): - """sets the contents of the browser without changing its url""" - self._lastProgress = 0 - return QtWebKit.QWebView.setHtm(self, *args) - - def setPage(self, page): - """sets the contents of the browser without changing its url""" - self._lastProgress = 0 - return QtWebKit.QWebView.setPage(self, page) - - def setUserData(self, userData): - self._userData = userData - - def mouseMoveEvent(self, event): - if self._lastProgress < self.MaxProgress: - self.setCursor(QtCore.Qt.BusyCursor) - else: - QtWebKit.QWebView.mouseMoveEvent(self, event) - - def userData(self): - return self._userData - - ############################### - ## event handlers - ############################### - def onActionStopTriggered(self): - # check wich cursor to set cos we may have busy cursor set - pt = self.mapFromGlobal(self.cursor().pos()) #TODO: self.mapFromGlobal(self.viewPort().cursor().pos()) ?? - frame = self.page().currentFrame() - hitTest = frame.hitTestContent(pt) - #if not hitTest.isNull(): #TODO: looks like hitTest.isNull() alwas returns True - if hitTest.linkUrl().isValid(): - self.setCursor(QtCore.Qt.PointingHandCursor) - else: - self.setCursor(QtCore.Qt.ArrowCursor) - - def onLoadStarted(self): - self._lastProgress = 0 - - def onLoadProgress(self, n): - self._lastProgress = n - - def onLoadFinished(self): - self._lastProgress = self.MaxProgress - self.onActionStopTriggered() - - def onPageDownloadRequested(self, networkRequest): - self.emit(QtCore.SIGNAL('downloadRequested(const QNetworkRequest &)'), networkRequest) - -#********************************************************************************** -# -#********************************************************************************** -class BrowserWidgetGlobalFeedback(config.GlobalFeedbackBase): - """wrapper for global statusbar widgets, menus""" - - def __init__(self, parent, idGlobalFeedback): - config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) - - # menus - self.menus = [] - if self.menuBar is not None and hasattr(parent, 'fcViewObject'): - menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) - parent.populateMenu(menu) - self.menus.append(menu) - self.menuBar.addViewMenu(menu) - - # status bar widgets - self.labelStatus = None - self.progress = None - self.labelFeedbackWrap = None - if self.statusBar is not None: - self.labelStatus = QtGui.QLabel(QtCore.QString(), self.statusBar) - self.statusBar.addWidget(self.labelStatus) - - self.progress = QtGui.QProgressBar(self.statusBar) - self.progress.setRange(0, Browser.MaxProgress) - self.progress.setValue(0) - self.statusBar.addWidget(self.progress) - - label = QtGui.QLabel(self.statusBar) - label.setFrameStyle(QtGui.QLabel.Sunken | QtGui.QLabel.Box) - self.labelFeedbackWrap = pathlabelwrap.PathLabelWrap( - label, - path_module=config.CompactPathFcpKeyModule, - ) - self.statusBar.addWidget(self.labelFeedbackWrap.label, 1) - - - def setVisible(self, flag): - if self.menuBar is not None: - for menu in self.menus: - menu.children()[0].setVisible(flag) - if self.statusBar is not None: - self.progress.setVisible(flag) - self.labelStatus.setVisible(flag) - self.labelFeedbackWrap.label.setVisible(flag) - - def setProgress(self, n): - if self.progress is not None: - self.progress.setValue(n) - - def setStatusMessage(self, qString): - if self.labelStatus is not None: - self.labelStatus.setText(qString) - - def setFeedback(self, qString): - if self.labelFeedbackWrap is not None: - self.labelFeedbackWrap.setPath(unicode(qString)) - - -class BrowserWidgetViewObject(config.ViewObject): - - def __init__(self, parent): - config.ViewObject. __init__(self, parent) - - self.name=parent.objectName() - self.displayName=self.trUtf8('Browser') - self.icon=QtGui.QIcon() - - -class BrowserWidgetSettings(config.SettingsBase): - _key_ = config.IdViewBrowserWidget - _settings_ = ( - ('OpenLinksInNewTab', 'Bool', False, config.SettingScopeUser), - ('OpenAddressBarInNewTab', 'Bool', False, config.SettingScopeUser), - ('OpenBookmarksInNewTab', 'Bool', False, config.SettingScopeUser), - ('OpenHomePageOnNewTabCreated', 'Bool', False, config.SettingScopeUser), - ('BackIsClose', 'Bool', False, config.SettingScopeUser), #TODO: not implemented - ('HomePage', 'String', QtCore.QString(), config.SettingScopeUser), - ('IconSize', 'UInt', 32, config.SettingScopeUser), - ('IconTheme', 'String', QtCore.QString('crystal'), config.SettingScopeUser), - ('AutoLoadImages', 'Bool', True, config.SettingScopeUser), #TODO: not yet implemented - ('MaxTabText', 'UInt', 20, config.SettingScopeUser), #NOTE: make shure Max >= Min and Max and Min > 0 - ('MinTabText', 'UInt', 7, config.SettingScopeUser), - ) - - def 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) - - #backIsClose = kws.get('BackIsClose', None) - #if backIsClose is not None: - # self.parent()._adjustBackIsClose() - - - -class BrowserWidgetActions(config.ActionsBase): - - def __init__(self, parent): - config.ActionsBase.__init__(self, parent) - - iconSize = parent.fcSettings.value('IconSize') - iconTheme = parent.fcSettings.value('IconTheme') - - self.action( - name='ActionCloseCurrentTab', - text=self.trUtf8('Close ¤t tab'), - trigger=parent.onCloseCurrentTab, - ) - self.action( # context menu only - name='ActionCloseBrowserUnderMouse', - text=self.trUtf8('&Close tab'), - trigger=None, - ) - self.action( - name='ActionCloseAllTabs', - text=self.trUtf8('Close &all tabs'), - trigger=parent.onCloseAllTabs, - ) - self.action( - name='ActionOpenNewTab', - text=self.trUtf8('Open &new tab'), - trigger=parent.onOpenNewTab, - ) - self.action( - name='ActionGoToFProxy', - text=self.trUtf8('Go to f&Proxy homepage'), - trigger=parent.onGoToFProxy, - ) - self.action( - name='ActionGoToHomePage', - text=self.trUtf8('Go to &homepage'), - trigger=parent.onGoToHomePage, - ) - self.action( - name='ActionObjectProperties', - text=self.trUtf8('Properties..'), - trigger=None, - ) - self.action( - name='ActionZoomIn', - text=self.trUtf8('Zoom in'), - trigger=parent.onZoomIn, - ) - self.action( - name='ActionZoomOut', - text=self.trUtf8('Zoom out'), - trigger=parent.onZoomOut, - ) - - # default browser actions - self.action( - name='ActionBack', - text=self.trUtf8('Back'), - trigger=None, - isEnabled=False, - icon=config.resources.getIcon('back', iconSize, iconTheme=iconTheme), - userData=(None, None), - ) - self.action( - name='ActionForward', - text=self.trUtf8('Forward'), - trigger=None, - isEnabled=False, - icon=config.resources.getIcon('forward', iconSize, iconTheme=iconTheme), - userData=(None, None), - ) - self.action( - name='ActionReload', - text=self.trUtf8('Reload'), - trigger=None, - isEnabled=False, - icon=config.resources.getIcon('reload_page', iconSize, iconTheme=iconTheme), - userData=(None, None), - ) - self.action( - name='ActionStop', - text=self.trUtf8('Stop'), - trigger=None, - isEnabled=False, - icon=config.resources.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), - trigger=None, - ) - - # search actions - self.action( - parent=parent, - name='ActionSearch', - text=self.trUtf8('Search'), - shortcut=QtGui.QKeySequence(self.trUtf8('Ctrl+F')), - trigger=parent.onSearch, - ) - - def intertwineBrowserActions(self, browser=None): - """intertwines Browser actions with BrowserWidget actions - @note: call everytime the current browser changes - """ - actions = ( - ('ActionBack', QtWebKit.QWebPage.Back), - ('ActionForward', QtWebKit.QWebPage.Forward), - ('ActionReload', QtWebKit.QWebPage.Reload), - ('ActionStop', QtWebKit.QWebPage.Stop), - ) - for actionName, pageAction in actions: - myPageAction = self[actionName] - newPageAction = None if browser is None else browser.pageAction(pageAction) - oldPageAction, cb = myPageAction.userData() - - if oldPageAction is not None: - myPageAction.disconnect(oldPageAction, QtCore.SIGNAL('changed()'), cb) - oldPageAction.disconnect(myPageAction, QtCore.SIGNAL('triggered()'), oldPageAction.trigger) - - if newPageAction is None: - myPageAction.setUserData((None, None)) - myPageAction.setEnabled(False) - else: - def onActionChanged(browser=browser, myPageAction=myPageAction, browserPageAction=newPageAction): - myPageAction.setEnabled(browserPageAction.isEnabled()) - - myPageAction.setEnabled(newPageAction.isEnabled()) - myPageAction.setUserData((newPageAction, onActionChanged)) - myPageAction.connect(newPageAction, QtCore.SIGNAL('changed()'), onActionChanged) - newPageAction.connect(myPageAction, QtCore.SIGNAL('triggered()'), newPageAction.trigger) - - -class LastBrowserState(object): - """records the last known state browser""" - - __slots__ = ('icon', 'progress', 'statusMessage', 'title', 'url') - - def __init__(self, icon=None, progress=0, statusMessage=None, title=None, url=None): - self.progress = 0 - self.icon = tCore.QIcon() if icon is None else icon - self.statusMessage = QtCore.QString() if statusMessage is None else statusMessage - self.title = QtCore.QString() if title is None else title - #NOTE: opening a browser in a new tab may take a while to load. - # self.url() will return '' untill the page is found, so we handle - # it ourself and keep track of the last known url in self._lastUrl - # to give feedback to the user on the navbar. downside is we have - # to reimplement contextMenuEvent() :-( - self.url = QtCore.QUrl() if url is None else url - -#********************************************************************************** -# -#********************************************************************************** -#TODO: strip host:port on address bar? -#TODO: rename home page to start page -class ViewBrowserWidget(QtGui.QWidget, Ui_ViewBrowserWidget): - - IdTabBrowsers = 'tabBrowsers' - IdFrameTools = 'frameTools' - IdFrameAddressBar = 'frameAddressBar' - IdEdAddressBar = 'edAddressBar' - - IdBtBack = 'btBack' - IdBtForward = 'btForward' - IdBtReload = 'btReload' - IdBtStop = 'btStop' - - IdFrameSearch = 'frameSearch' - IdEdSearch = 'edSearch' - IdBtSearchUpwards = 'btSearchUpwards' - IdBtSearchDownwards = 'btSearchDownwards' - IdCkSearchCaseSensitive = 'ckSearchCaseSensitive' - - ForcedMinBrowserTabText = 5 # forced minimum number of chars on browser tabBar - - def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): - QtGui.QWidget.__init__(self, parent) - - self.setupUi(self) - config.ObjectRegistry.register(self) - - self._initialConfigDataArrived = False - - self.fcSettings = BrowserWidgetSettings(self).restore() - self.fcActions = BrowserWidgetActions(self) - self.fcViewObject = BrowserWidgetViewObject(self) - self.fcGlobalFeedback = BrowserWidgetGlobalFeedback(self, idGlobalFeedback) - - # setup tab bar - tabWidget = self.controlById(self.IdTabBrowsers) - tabWidget.clear() - tabWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - self.connect(tabWidget, QtCore.SIGNAL('currentChanged(int)'), self.onTabCurrentChanged) - self.connect(tabWidget, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onTabContextMenuEvent) - - # setup addressbar - addressbar = self.controlById(self.IdEdAddressBar) - self.connect(addressbar, QtCore.SIGNAL('returnPressed()'), self.onNavBarReturnPressed) - - # setup tool buttons - self.controlById(self.IdBtBack).setDefaultAction(self.fcActions['ActionBack']) - self.controlById(self.IdBtForward).setDefaultAction(self.fcActions['ActionForward']) - self.controlById(self.IdBtReload).setDefaultAction(self.fcActions['ActionReload']) - 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) - - # fire up a new broser to make a start - self.newBrowser(title=self.trUtf8('Waiting for fproxy')) - self.fcActions['ActionGoToHomePage'].trigger() - - ######################################### - ## private methods - ######################################### - #NOTE: to reduce flicker set min size to max size - def _adjustTabText(self, qString): - maxTabText = self.fcSettings.value('MaxTabText') - minTabText = self.fcSettings.value('MinTabText') - ellipsis = self.trUtf8('..') - - if minTabText < self.ForcedMinBrowserTabText: - minTabText = self.ForcedMinBrowserTabText - self.fcSettings.setValues(MinTabText=minTabText) - if maxTabText < self.ForcedMinBrowserTabText: - maxTabText = self.ForcedMinBrowserTabText - self.fcSettings.setValues(MaxTabText=maxTabText) - if minTabText > maxTabText: - minTabText = maxTabText - self.fcSettings.setValues(MinTabText=maxTabText) - - if qString.count() < minTabText: - qString = qString.append('\x20' * (minTabText - qString.count())) - else: - if maxTabText < self.ForcedMinBrowserTabText: - maxTabText = sminTabText - qString = qtools.truncateString(maxTabText, qString, ellipsis) - return qString - - def _downloadImageToDisk(self, hitTestResult): - px = hitTestResult.pixmap() - if px.isNull(): - return False - - key = config.qStringToFcpKey(hitTestResult.imageUrl().toString()) - if key is None: - return False - - # 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')) - fileName = unicode(config.guessFileNameFromKey(key, default=QtCore.QString(''))) - - if directory and fileName: - directory = os.path.join(directory, fileName) - elif not directory: - directory = fileName - filePath = QtGui.QFileDialog.getSaveFileName(self, caption, directory) - - if filePath: - filePath= unicode(filePath) - if os.path.exists(filePath): - try: - os.remove(filePath) - except Exception, details: - QtGui.QMessageBox.critical( - self, - caption, - self.trUtf8('Could not remove file'), #NOTE: no details please, may contain arbitrary lenght filepath - ) - return False - px.save(filePath) - return True - - def _downloadKeyToDisk(self, qUrl): - """ - @return: (bool) False if the key in the url is invalid, True otherwise - """ - fcpKey = config.qStringToFcpKey(QtCore.QString(qUrl.encodedPath())) - if fcpKey is not None: - dlg = Ui_DlgDownloadKeyToDisk.DownloadKeyToDiskDlg(self, fcpKey=fcpKey) - if dlg.exec_() == dlg.Accepted: - filePath = dlg.filePath() - downloadsWidget = config.ObjectRegistry.get(config.IdViewCDownloadsWidget, None) - if downloadsWidget is None: - raise ValueError('no downloads widget found') - downloadsWidget.downloadFile( - fcpKey, - filePath, - persistence=fcp2.ConstPersistence.Forever, - handleFilenameCollision=True, - - ) - return True - return False - - ######################################### - ## methods - ######################################### - def controlById(self, idControl): - return getattr(self, idControl) - - def currentBrowser(self): - """returns the current browser or None""" - tabWidget = self.controlById(self.IdTabBrowsers) - return tabWidget.currentWidget() - - def load(self, url, force=False, browser=None): - """loads an url in the current browser. if there is no current browser, a new browser is created - @param force: (bool) if True, a new browser is opend if there is no browser available - @param browser: browser to load the url in or None to use the current browser - @return: (bool) - """ - browser = self.currentBrowser() if browser is None else browser - tabWidget = self.controlById(self.IdTabBrowsers) - addressBar = self.controlById(self.IdEdAddressBar) - url = QtCore.QUrl(url) - - # check if we have a browser at hand - if force and browser is None: - browser = self.newBrowser() - if browser is None: - return False - - # load url - url.setScheme('http') - url.setHost(config.settings.value('FproxyConnectionHost')) - url.setPort(config.settings.value('FproxyConnectionPort')) - tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Loading'))) - addressBar.setText(url.toString()) - lastBrowserState = browser.userData() - lastBrowserState.url = url - browser.load(url) - return True - - def newBrowser(self, title=''): - """opens a browser in a new tab""" - tabWidget = self.controlById(self.IdTabBrowsers) - browser = Browser(self) - page = browser.page() - settings = browser.settings() - title = QtCore.QString(title) - - # attatch browser state information - lastBrowserState = LastBrowserState( - icon=browser.icon(), - statusMessage=self.trUtf8('Waiting'), - ) - browser.setUserData(lastBrowserState) - - # customize browser - browser.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - settings.setAttribute(settings.DeveloperExtrasEnabled, False) - settings.setAttribute(settings.JavaEnabled, False) - settings.setAttribute(settings.JavascriptEnabled, False) - settings.setAttribute(settings.JavascriptCanOpenWindows, False) - settings.setAttribute(settings.JavascriptCanAccessClipboard, False) - settings.setAttribute(settings.PluginsEnabled, False) - settings.setAttribute(settings.AutoLoadImages, self.fcSettings.value('AutoLoadImages')) - - # connect browser signals - self.connect(browser, QtCore.SIGNAL('loadStarted()'), self.onBrowserLoadStarted) - self.connect(browser, QtCore.SIGNAL('loadProgress(int)'), self.onBrowserLoadProgress) - self.connect(browser, QtCore.SIGNAL('loadFinished(bool)'), self.onBrowserLoadFinished) - self.connect(browser, QtCore.SIGNAL('iconChanged()'), self.onBrowserIconChanged) - self.connect(browser, QtCore.SIGNAL('statusBarMessage(const QString &)'), self.onBrowserStatusBarMessage) - self.connect(browser, QtCore.SIGNAL('titleChanged(const QString &)'), self.onBrowserTitleChanged) - self.connect(browser, QtCore.SIGNAL('urlChanged(const QUrl &)'), self.onBrowserUrlChanged) - self.connect(browser, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onBrowserCustomContextMenuRequested) - self.connect(browser, QtCore.SIGNAL('linkClicked(const QUrl &)'), self.onBrowserLinkClicked) - - # adjust browser actions - act = browser.pageAction(page.OpenLinkInNewWindow) - act.setText(self.trUtf8('Open page in new tab')) - act = browser.pageAction(page.OpenImageInNewWindow) - act.setText(self.trUtf8('Open image in new tab')) - act = browser.pageAction(page.OpenFrameInNewWindow) - act.setText(self.trUtf8('Open frame in new tab')) - - # customize page - page.setLinkDelegationPolicy(page.DelegateAllLinks) - - # connect page signals - self.connect(page, QtCore.SIGNAL('linkHovered(const QString &, const QString &, const QString &)'), self.onPageLinkHovered) - - tabWidget.addTab(browser, self._adjustTabText(title)) - if tabWidget.currentWidget() == browser: - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) - return browser - - #TODO: rework. we need more then one menu - def populateMenu(self, menu): - menu.addAction(self.fcActions['ActionGoToFProxy']) - menu.addAction(self.fcActions['ActionGoToHomePage']) - menu.addAction(self.fcActions['ActionCloseCurrentTab']) - menu.addAction(self.fcActions['ActionCloseAllTabs']) - menu.addAction(self.fcActions['ActionOpenNewTab']) - menu.addAction(self.fcActions['ActionZoomIn']) - menu.addAction(self.fcActions['ActionZoomOut']) - menu.addAction(self.fcActions['ActionSearch']) - return menu - - ######################################### - ## overwritten events - ######################################### - def closeEvent(self): - self.viewClose() - - def hideEvent(self, event): - self.fcGlobalFeedback.setVisible(False) - - def showEvent(self, event): - self.fcGlobalFeedback.setVisible(True) - - def viewClose(self): - pass - - ######################################### - ## event handlers - ######################################### - #TODO: actions need some comb over - def onBrowserCustomContextMenuRequested(self, pt): - browser = self.sender() - frame = browser.page().currentFrame() - page = browser.page() - hitTestResult = frame.hitTestContent(pt) - - #if not hitTest.isNull(): #TODO: looks like hitTest.isNull() alwas returns True - - menu = QtGui.QMenu() - - menu.addAction(browser.pageAction(page.OpenLink)) - menu.addAction(browser.pageAction(page.OpenLinkInNewWindow)) - menu.addAction(browser.pageAction(page.CopyLinkToClipboard)) - menu.addAction(browser.pageAction(page.DownloadLinkToDisk)) - - menu.addSeparator() - menu.addAction(browser.pageAction(page.OpenImageInNewWindow)) - menu.addAction(browser.pageAction(page.CopyImageToClipboard)) - menu.addAction(browser.pageAction(page.Downl... [truncated message content] |
From: <jU...@us...> - 2008-07-27 11:20:45
|
Revision: 763 http://fclient.svn.sourceforge.net/fclient/?rev=763&view=rev Author: jUrner Date: 2008-07-27 11:20:49 +0000 (Sun, 27 Jul 2008) Log Message: ----------- new package structure Added Paths: ----------- trunk/fclient/src/fclient/impl/downloads/ trunk/fclient/src/fclient/impl/lib/ trunk/fclient/src/fclient/impl/lib/__init__.py trunk/fclient/src/fclient/impl/lib/compactpath/ trunk/fclient/src/fclient/impl/lib/fcp2/ trunk/fclient/src/fclient/impl/lib/qt4ex/ trunk/fclient/src/fclient/impl/res/ trunk/fclient/src/fclient/impl/res/icons/ trunk/fclient/src/fclient/impl/settings/ trunk/fclient/src/fclient/impl/tpls/ trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_MainWindowTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewBrowserWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewDownloadsWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewLoggerWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewDownloadsWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewLoggerWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/__init__.py Removed Paths: ------------- trunk/fclient/src/fclient/downloads/ trunk/fclient/src/fclient/impl/lib/__init__.py trunk/fclient/src/fclient/impl/lib/compactpath/ trunk/fclient/src/fclient/impl/lib/fcp2/ trunk/fclient/src/fclient/impl/lib/qt4ex/ trunk/fclient/src/fclient/impl/res/icons/ trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/Ui_DlgDownloadKeyToDiskTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_DlgPropsBrowserObjectTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_MainWindowTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_PrefsBrowserWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_PrefsGlobalWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewBrowserWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewConnectionWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewDownloadsWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewLoggerWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/Ui_ViewWidgetTpl.py trunk/fclient/src/fclient/impl/tpls/ViewBrowserWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewConnectionWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewDownloadsWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewLoggerWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/ViewWidgetTpl.ui trunk/fclient/src/fclient/impl/tpls/__init__.py trunk/fclient/src/fclient/lib/ trunk/fclient/src/fclient/res/ trunk/fclient/src/fclient/settings/ trunk/fclient/src/fclient/tpls/ Deleted: trunk/fclient/src/fclient/impl/lib/__init__.py =================================================================== --- trunk/fclient/src/fclient/lib/__init__.py 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/impl/lib/__init__.py 2008-07-27 11:20:49 UTC (rev 763) @@ -1 +0,0 @@ - Copied: trunk/fclient/src/fclient/impl/lib/__init__.py (from rev 762, trunk/fclient/src/fclient/lib/__init__.py) =================================================================== --- trunk/fclient/src/fclient/impl/lib/__init__.py (rev 0) +++ trunk/fclient/src/fclient/impl/lib/__init__.py 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1 @@ + Copied: trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui (from rev 762, trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/DlgConnectionExpertSettingsTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,287 @@ +<ui version="4.0" > + <class>DlgConnectionExpertSettings</class> + <widget class="QDialog" name="DlgConnectionExpertSettings" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>392</width> + <height>589</height> + </rect> + </property> + <property name="windowTitle" > + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout_2" > + <item row="0" column="0" > + <widget class="QTabWidget" name="tabWidget" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex" > + <number>0</number> + </property> + <widget class="QWidget" name="tab" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>370</width> + <height>472</height> + </rect> + </property> + <attribute name="title" > + <string>Fcp connection</string> + </attribute> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <layout class="QVBoxLayout" name="verticalLayout" > + <property name="spacing" > + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests</string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" > + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connection name:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edFcpConnectionName" /> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <layout class="QVBoxLayout" name="verticalLayout_3" > + <item> + <widget class="QLabel" name="label_3" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connect duration:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_4" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connect timeout:</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QSpinBox" name="spinFcpConnectionTimerMaxDuration" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> seconds</string> + </property> + <property name="maximum" > + <number>999</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinConnectionTimerTimeout" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> miliseconds</string> + </property> + <property name="maximum" > + <number>99999</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down. +</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="QLabel" name="label_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Poll frequency: </string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinFcpPollTimerTimeout" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> miliseconds</string> + </property> + <property name="maximum" > + <number>99999</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + </item> + <item row="1" column="0" > + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>98</width> + <height>15</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>DlgConnectionExpertSettings</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel" > + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>DlgConnectionExpertSettings</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel" > + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> Deleted: trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -1,134 +0,0 @@ -<ui version="4.0" > - <class>DlgDownloadKeyToDisk</class> - <widget class="QDialog" name="DlgDownloadKeyToDisk" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>431</width> - <height>175</height> - </rect> - </property> - <property name="windowTitle" > - <string>Dialog</string> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Key:</span></p></body></html></string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelKey" > - <property name="text" > - <string>USK@qwweqweqweqwe.../foo</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_2" > - <property name="text" > - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Download to:</span></p></body></html></string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="QLineEdit" name="edDownloadFileName" > - <property name="dragEnabled" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="btChooseDownloadFileName" > - <property name="text" > - <string>...</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item row="1" column="0" > - <spacer name="verticalSpacer" > - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>20</width> - <height>15</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" > - <widget class="Line" name="line" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>DlgDownloadKeyToDisk</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>DlgDownloadKeyToDisk</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> Copied: trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui (from rev 762, trunk/fclient/src/fclient/tpls/DlgDownloadKeyToDiskTpl.ui) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/DlgDownloadKeyToDiskTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,134 @@ +<ui version="4.0" > + <class>DlgDownloadKeyToDisk</class> + <widget class="QDialog" name="DlgDownloadKeyToDisk" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>431</width> + <height>175</height> + </rect> + </property> + <property name="windowTitle" > + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Key:</span></p></body></html></string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelKey" > + <property name="text" > + <string>USK@qwweqweqweqwe.../foo</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_2" > + <property name="text" > + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Download to:</span></p></body></html></string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="QLineEdit" name="edDownloadFileName" > + <property name="dragEnabled" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btChooseDownloadFileName" > + <property name="text" > + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item row="1" column="0" > + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>15</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>DlgDownloadKeyToDisk</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>DlgDownloadKeyToDisk</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> Deleted: trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -1,247 +0,0 @@ -<ui version="4.0" > - <class>DlgPropsBrowserObject</class> - <widget class="QDialog" name="DlgPropsBrowserObject" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>420</width> - <height>307</height> - </rect> - </property> - <property name="windowTitle" > - <string>Dialog</string> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QLabel" name="label" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string><b>Type:</b></string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labeType" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - <property name="textInteractionFlags" > - <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string><b>Title:</b></string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelTitle" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - <property name="textInteractionFlags" > - <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_99" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string><b>Name:</b></string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelName" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - <property name="textInteractionFlags" > - <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_4" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string><b>LinkUrl:</b></string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelLinkUrl" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - <property name="textInteractionFlags" > - <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_5" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string><b>ImageUrl:</b></string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelImageUrl" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - <property name="textInteractionFlags" > - <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <spacer name="verticalSpacer" > - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0" > - <size> - <width>397</width> - <height>17</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" > - <widget class="Line" name="line" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="3" column="0" > - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>DlgPropsBrowserObject</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>DlgPropsBrowserObject</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> Copied: trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui (from rev 762, trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,247 @@ +<ui version="4.0" > + <class>DlgPropsBrowserObject</class> + <widget class="QDialog" name="DlgPropsBrowserObject" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>420</width> + <height>307</height> + </rect> + </property> + <property name="windowTitle" > + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QLabel" name="label" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>Type:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labeType" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>Title:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelTitle" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_99" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>Name:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelName" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_4" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>LinkUrl:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelLinkUrl" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>ImageUrl:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelImageUrl" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + </layout> + </item> + <item row="1" column="0" > + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>397</width> + <height>17</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>DlgPropsBrowserObject</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>DlgPropsBrowserObject</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> Deleted: trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/MainWindowTpl.ui 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -1,69 +0,0 @@ -<ui version="4.0" > - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>600</height> - </rect> - </property> - <property name="windowTitle" > - <string>MainWindow</string> - </property> - <widget class="QWidget" name="centralwidget" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>577</height> - </rect> - </property> - </widget> - <widget class="QStatusBar" name="statusbar" > - <property name="geometry" > - <rect> - <x>0</x> - <y>577</y> - <width>800</width> - <height>23</height> - </rect> - </property> - </widget> - <action name="action_Preferences" > - <property name="text" > - <string>_Preferences</string> - </property> - </action> - <action name="actPreferences" > - <property name="text" > - <string>&Preferences..</string> - </property> - </action> - <action name="actExit" > - <property name="text" > - <string>E&xit</string> - </property> - </action> - <action name="actHelp" > - <property name="text" > - <string>&Help..</string> - </property> - <property name="toolTip" > - <string>Help</string> - </property> - </action> - <action name="actAbout" > - <property name="text" > - <string>A&bout..</string> - </property> - <property name="iconText" > - <string>About</string> - </property> - </action> - </widget> - <resources/> - <connections/> -</ui> Copied: trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui (from rev 762, trunk/fclient/src/fclient/tpls/MainWindowTpl.ui) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/MainWindowTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,69 @@ +<ui version="4.0" > + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle" > + <string>MainWindow</string> + </property> + <widget class="QWidget" name="centralwidget" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>577</height> + </rect> + </property> + </widget> + <widget class="QStatusBar" name="statusbar" > + <property name="geometry" > + <rect> + <x>0</x> + <y>577</y> + <width>800</width> + <height>23</height> + </rect> + </property> + </widget> + <action name="action_Preferences" > + <property name="text" > + <string>_Preferences</string> + </property> + </action> + <action name="actPreferences" > + <property name="text" > + <string>&Preferences..</string> + </property> + </action> + <action name="actExit" > + <property name="text" > + <string>E&xit</string> + </property> + </action> + <action name="actHelp" > + <property name="text" > + <string>&Help..</string> + </property> + <property name="toolTip" > + <string>Help</string> + </property> + </action> + <action name="actAbout" > + <property name="text" > + <string>A&bout..</string> + </property> + <property name="iconText" > + <string>About</string> + </property> + </action> + </widget> + <resources/> + <connections/> +</ui> Deleted: trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/PrefsBrowserWidgetTpl.ui 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -1,127 +0,0 @@ -<ui version="4.0" > - <class>PrefsBrowserWidget</class> - <widget class="QWidget" name="PrefsBrowserWidget" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>532</width> - <height>186</height> - </rect> - </property> - <property name="windowTitle" > - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout_3" > - <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string>Homepage:</string> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="edHomePage" > - <property name="dragEnabled" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <widget class="QGroupBox" name="groupBox" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title" > - <string>Open in new tab</string> - </property> - <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" > - <widget class="QCheckBox" name="ckOpenLinksInNewTab" > - <property name="text" > - <string>Links</string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QCheckBox" name="ckOpenBookmarksInNewTab" > - <property name="text" > - <string>Bookmarks</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QCheckBox" name="ckOpenAddressBarInNewTab" > - <property name="text" > - <string>Address bar</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title" > - <string>Others</string> - </property> - <layout class="QGridLayout" name="gridLayout_2" > - <item row="0" column="0" > - <widget class="QCheckBox" name="ckOpenHomePageOnNewTabCreated" > - <property name="text" > - <string>Open home page when a new tab is created</string> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QCheckBox" name="ckBackIsClose" > - <property name="text" > - <string>Back is close</string> - </property> - </widget> - </item> - <item row="2" column="0" > - <widget class="QCheckBox" name="ckAutoLoadImages" > - <property name="text" > - <string>Auto load images</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </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>297</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> Copied: trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui (from rev 762, trunk/fclient/src/fclient/tpls/PrefsBrowserWidgetTpl.ui) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/PrefsBrowserWidgetTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,127 @@ +<ui version="4.0" > + <class>PrefsBrowserWidget</class> + <widget class="QWidget" name="PrefsBrowserWidget" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>532</width> + <height>186</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QGridLayout" name="gridLayout_3" > + <item row="0" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string>Homepage:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edHomePage" > + <property name="dragEnabled" > + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </item> + <item row="1" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Open in new tab</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <widget class="QCheckBox" name="ckOpenLinksInNewTab" > + <property name="text" > + <string>Links</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="QCheckBox" name="ckOpenBookmarksInNewTab" > + <property name="text" > + <string>Bookmarks</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QCheckBox" name="ckOpenAddressBarInNewTab" > + <property name="text" > + <string>Address bar</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>Others</string> + </property> + <layout class="QGridLayout" name="gridLayout_2" > + <item row="0" column="0" > + <widget class="QCheckBox" name="ckOpenHomePageOnNewTabCreated" > + <property name="text" > + <string>Open home page when a new tab is created</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QCheckBox" name="ckBackIsClose" > + <property name="text" > + <string>Back is close</string> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QCheckBox" name="ckAutoLoadImages" > + <property name="text" > + <string>Auto load images</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </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>297</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> Deleted: trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/PrefsGlobalWidgetTpl.ui 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -1,64 +0,0 @@ -<ui version="4.0" > - <class>PrefsGlobalWidget</class> - <widget class="QWidget" name="PrefsGlobalWidget" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>465</width> - <height>247</height> - </rect> - </property> - <property name="windowTitle" > - <string>Form</string> - </property> - <layout class="QGridLayout" > - <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> - </property> - <property name="wordWrap" > - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="0" > - <layout class="QHBoxLayout" > - <item> - <widget class="QCheckBox" name="ckStoreSettingsLocally" > - <property name="text" > - <string/> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="edStoreSettingsLocally" /> - </item> - <item> - <widget class="QPushButton" name="btStoreSettingsLocally" > - <property name="text" > - <string>...</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> Copied: trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui (from rev 762, trunk/fclient/src/fclient/tpls/PrefsGlobalWidgetTpl.ui) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/PrefsGlobalWidgetTpl.ui 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,64 @@ +<ui version="4.0" > + <class>PrefsGlobalWidget</class> + <widget class="QWidget" name="PrefsGlobalWidget" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>465</width> + <height>247</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QGridLayout" > + <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> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="0" > + <layout class="QHBoxLayout" > + <item> + <widget class="QCheckBox" name="ckStoreSettingsLocally" > + <property name="text" > + <string/> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edStoreSettingsLocally" /> + </item> + <item> + <widget class="QPushButton" name="btStoreSettingsLocally" > + <property name="text" > + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="2" column="0" > + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> Copied: trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py (from rev 762, trunk/fclient/src/fclient/tpls/Ui_DlgConnectionExpertSettingsTpl.py) =================================================================== --- trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py (rev 0) +++ trunk/fclient/src/fclient/impl/tpls/Ui_DlgConnectionExpertSettingsTpl.py 2008-07-27 11:20:49 UTC (rev 763) @@ -0,0 +1,173 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui' +# +# Created: Sat Jul 26 13:40:11 2008 +# by: PyQt4 UI code generator 4.4.3-snapshot-20080705 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_DlgConnectionExpertSettings(object): + def setupUi(self, DlgConnectionExpertSettings): + DlgConnectionExpertSettings.setObjectName("DlgConnectionExpertSettings") + DlgConnectionExpertSettings.resize(392, 589) + self.gridLayout_2 = QtGui.QGridLayout(DlgConnectionExpertSettings) + self.gridLayout_2.setObjectName("gridLayout_2") + self.tabWidget = QtGui.QTabWidget(DlgConnectionExpertSettings) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) + self.tabWidget.setSizePolicy(sizePolicy) + self.tabWidget.setObjectName("tabWidget") + self.tab = QtGui.QWidget() + self.tab.setGeometry(QtCore.QRect(0, 0, 370, 472)) + self.tab.setObjectName("tab") + self.gridLayout = QtGui.QGridLayout(self.tab) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setSpacing(0) + self.verticalLayout.setObjectName("verticalLayout") + self.label_5 = QtGui.QLabel(self.tab) + self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label_5.setWordWrap(True) + self.label_5.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) + self.label_5.setObjectName("label_5") + self.verticalLayout.addWidget(self.label_5) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setSpacing(6) + self.horizontalLayout.setObjectName("horizontalLayout") + self.label = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.edFcpConnectionName = QtGui.QLineEdit(self.tab) + self.edFcpConnectionName.setObjectName("edFcpConnectionName") + self.horizontalLayout.addWidget(self.edFcpConnectionName) + self.verticalLayout.addLayout(self.horizontalLayout) + self.label_6 = QtGui.QLabel(self.tab) + self.label_6.setWordWrap(True) + self.label_6.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) + self.label_6.setObjectName("label_6") + self.verticalLayout.addWidget(self.label_6) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.verticalLayout_3 = QtGui.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.label_3 = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) + self.label_3.setSizePolicy(sizePolicy) + s... [truncated message content] |
From: <jU...@us...> - 2008-07-27 11:16:47
|
Revision: 762 http://fclient.svn.sourceforge.net/fclient/?rev=762&view=rev Author: jUrner Date: 2008-07-27 11:16:55 +0000 (Sun, 27 Jul 2008) Log Message: ----------- new package structure Added Paths: ----------- trunk/fclient/src/fclient/impl/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:13:28
|
Revision: 761 http://fclient.svn.sourceforge.net/fclient/?rev=761&view=rev Author: jUrner Date: 2008-07-27 11:13:36 +0000 (Sun, 27 Jul 2008) Log Message: ----------- add expert settings (not complete yet) Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewConnection.py trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui Added Paths: ----------- trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui trunk/fclient/src/fclient/tpls/Ui_DlgConnectionExpertSettingsTpl.py Added: trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py (rev 0) +++ trunk/fclient/src/fclient/Ui_DlgConnectionExpertSettings.py 2008-07-27 11:13:36 UTC (rev 761) @@ -0,0 +1,73 @@ + +from __future__ import absolute_import +if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below + import os; __path__ = [os.path.dirname(__file__)] + +from PyQt4 import QtCore, QtGui + +from . import config + +from .tpls.Ui_DlgConnectionExpertSettingsTpl import Ui_DlgConnectionExpertSettings +#********************************************************************************** +# +#********************************************************************************** +class ConnectionExpertSettingsDlg(QtGui.QDialog, Ui_DlgConnectionExpertSettings ): + + IdEdFcpConnectionName = 'edFcpConnectionName' + IdSpinFcpConnectionTimerMaxDuration = 'spinFcpConnectionTimerMaxDuration' + IdSpinConnectionTimerTimeout = 'spinConnectionTimerTimeout' + IdSpinFcpPollTimerTimeout = 'spinFcpPollTimerTimeout' + + def __init__(self, parent=None): + QtGui.QDialog.__init__(self, parent) + + self.setupUi(self) + self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Connection expert settings')) + + edName = self.controlById(self.IdEdFcpConnectionName) + edName.setText(config.settings.value('FcpConnectionName')) + self.connect(edName, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionNameChanged) + + connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None) + spins = ( + (self.IdSpinFcpConnectionTimerMaxDuration, 'FcpConnectionTimerMaxDuration'), + (self.IdSpinConnectionTimerTimeout, 'FcpConnectionTimerTimeout'), + (self.IdSpinFcpPollTimerTimeout, 'FcpPollTimerTimeout'), + ) + for idControl, settingName in spins: + spin = self.controlById(idControl) + if connectionWidget is None: + spin.setEnabled(False) + else: + spin.setValue(connectionWidget.fcSettings.value(settingName)) + + + + + def controlById(self, idControl): + return getattr(self, idControl) + + + def onEdFcpConnectionNameChanged(self, text): + config.settings.setValues(FcpConnectionName=text) + + + +#********************************************************************************** +# +#********************************************************************************** +if __name__ == '__main__': + import sys + + class DummyKey(object): + KeyType = 'USK@' + def __init__(self): self.key = 'USG@qweqqweqwe' + def toString(self): return self.key + + app = QtGui.QApplication(sys.argv) + w = ConnectionExpertSettingsDlg(None) + w.show() + res = app.exec_() + sys.exit(res) + + Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-27 11:12:38 UTC (rev 760) +++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-27 11:13:36 UTC (rev 761) @@ -1,4 +1,13 @@ #********************************************************************* +#TODO: +# x. setting fcp connection params currently won't reset connection. how to handle? +# +# +#********************************************************************* + + + +#********************************************************************* #NOTES: # # current handling is: @@ -18,6 +27,7 @@ from . import config from .lib import fcp2 +from .Ui_DlgConnectionExpertSettings import ConnectionExpertSettingsDlg from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget #********************************************************************************** @@ -56,9 +66,9 @@ class Settings(config.SettingsBase): _key_ = config.IdViewConnectionWidget _settings_ = ( - ('ConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert), - ('ConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), - ('PollTimerTimeout', 'UInt', 200, config.SettingScopeExpert), + ('FcpConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert), + ('FcpConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert), + ('FcpPollTimerTimeout', 'UInt', 200, config.SettingScopeExpert), ) class ConnectionViewObject(config.ViewObject): @@ -82,12 +92,13 @@ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) def start(self, settings): + config.fcpClient.setConnectionName(config.settings.value('FcpConnectionName')) self.fcpIterConnect = config.fcpClient.iterConnect( - duration=settings.value('ConnectionTimerMaxDuration'), + duration=settings.value('FcpConnectionTimerMaxDuration'), timeout=0 ) if not self.onNext(): - QtCore.QTimer.start(self, settings.value('ConnectionTimerTimeout')) + QtCore.QTimer.start(self, settings.value('FcpConnectionTimerTimeout')) def onNext(self): try: @@ -112,7 +123,7 @@ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext) def start(self, settings): - QtCore.QTimer.start(self, settings.value('PollTimerTimeout')) + QtCore.QTimer.start(self, settings.value('FcpPollTimerTimeout')) def onNext(self): if config.fcpClient.isConnected(): @@ -124,9 +135,11 @@ class ViewConnectionWidget(QtGui.QWidget, Ui_ViewConnectionWidget): IdBtConnect = 'btConnect' - IdCkFcpAutoConnect = 'ckFcpAutoConnect' IdEdFcpFcpConnectionHost = 'edFcpConnectionHost' IdFcpSpinFcpConnectionPort = 'spinFcpConnectionPort' + IdCkFcpAutoConnect = 'ckFcpAutoConnect' + IdBtFcpConnectionMore = 'btFcpConnectionMore' + IdEdFproxyConnectionHost = 'edFproxyConnectionHost' IdFproxySpinConnectionPort = 'spinFproxyConnectionPort' @@ -186,7 +199,7 @@ return self._isCreated = True - # setup fcp host / port + # setup fcp host / port / name edHost = self.controlById(self.IdEdFcpFcpConnectionHost) edHost.setText(config.settings.value('FcpConnectionHost')) self.connect(edHost, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionHostChanged) @@ -201,6 +214,9 @@ ck.setChecked(doAutoConnect) self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged) + bt = self.controlById(self.IdBtFcpConnectionMore) + self.connect(bt, QtCore.SIGNAL('clicked()'), self.onBtFcpConnectionMoreClicked) + # setup fproxy host / port edHost = self.controlById(self.IdEdFproxyConnectionHost) edHost.setText(config.settings.value('FproxyConnectionHost')) @@ -251,6 +267,11 @@ def onSpinFcpConnectionPortChanged(self, value): config.settings.setValues(FcpConnectionPort=value) + def onBtFcpConnectionMoreClicked(self): + dlg = ConnectionExpertSettingsDlg(self) + if dlg.exec_() == dlg.Accepted: + pass + def onEdFproxyConnectionHostChanged(self, text): config.settings.setValues(FproxyConnectionHost=text) Added: trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui (rev 0) +++ trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui 2008-07-27 11:13:36 UTC (rev 761) @@ -0,0 +1,287 @@ +<ui version="4.0" > + <class>DlgConnectionExpertSettings</class> + <widget class="QDialog" name="DlgConnectionExpertSettings" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>392</width> + <height>589</height> + </rect> + </property> + <property name="windowTitle" > + <string>Dialog</string> + </property> + <layout class="QGridLayout" name="gridLayout_2" > + <item row="0" column="0" > + <widget class="QTabWidget" name="tabWidget" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Minimum" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="currentIndex" > + <number>0</number> + </property> + <widget class="QWidget" name="tab" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>370</width> + <height>472</height> + </rect> + </property> + <attribute name="title" > + <string>Fcp connection</string> + </attribute> + <layout class="QGridLayout" name="gridLayout" > + <item row="0" column="0" > + <layout class="QVBoxLayout" name="verticalLayout" > + <property name="spacing" > + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_5" > + <property name="text" > + <string>Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests</string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" > + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connection name:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edFcpConnectionName" /> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="label_6" > + <property name="text" > + <string>How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <layout class="QVBoxLayout" name="verticalLayout_3" > + <item> + <widget class="QLabel" name="label_3" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connect duration:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_4" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Connect timeout:</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QSpinBox" name="spinFcpConnectionTimerMaxDuration" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> seconds</string> + </property> + <property name="maximum" > + <number>999</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinConnectionTimerTimeout" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> miliseconds</string> + </property> + <property name="maximum" > + <number>99999</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QLabel" name="label_7" > + <property name="text" > + <string>How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down. +</string> + </property> + <property name="wordWrap" > + <bool>true</bool> + </property> + <property name="textInteractionFlags" > + <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard</set> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3" > + <item> + <widget class="QLabel" name="label_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Poll frequency: </string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinFcpPollTimerTimeout" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="suffix" > + <string> miliseconds</string> + </property> + <property name="maximum" > + <number>99999</number> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + </item> + <item row="1" column="0" > + <spacer name="verticalSpacer" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>98</width> + <height>15</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="0" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QDialogButtonBox" name="buttonBox" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons" > + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>DlgConnectionExpertSettings</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel" > + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel" > + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>DlgConnectionExpertSettings</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel" > + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel" > + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> Added: trunk/fclient/src/fclient/tpls/Ui_DlgConnectionExpertSettingsTpl.py =================================================================== --- trunk/fclient/src/fclient/tpls/Ui_DlgConnectionExpertSettingsTpl.py (rev 0) +++ trunk/fclient/src/fclient/tpls/Ui_DlgConnectionExpertSettingsTpl.py 2008-07-27 11:13:36 UTC (rev 761) @@ -0,0 +1,173 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/DlgConnectionExpertSettingsTpl.ui' +# +# Created: Sat Jul 26 13:40:11 2008 +# by: PyQt4 UI code generator 4.4.3-snapshot-20080705 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_DlgConnectionExpertSettings(object): + def setupUi(self, DlgConnectionExpertSettings): + DlgConnectionExpertSettings.setObjectName("DlgConnectionExpertSettings") + DlgConnectionExpertSettings.resize(392, 589) + self.gridLayout_2 = QtGui.QGridLayout(DlgConnectionExpertSettings) + self.gridLayout_2.setObjectName("gridLayout_2") + self.tabWidget = QtGui.QTabWidget(DlgConnectionExpertSettings) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) + self.tabWidget.setSizePolicy(sizePolicy) + self.tabWidget.setObjectName("tabWidget") + self.tab = QtGui.QWidget() + self.tab.setGeometry(QtCore.QRect(0, 0, 370, 472)) + self.tab.setObjectName("tab") + self.gridLayout = QtGui.QGridLayout(self.tab) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setSpacing(0) + self.verticalLayout.setObjectName("verticalLayout") + self.label_5 = QtGui.QLabel(self.tab) + self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label_5.setWordWrap(True) + self.label_5.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) + self.label_5.setObjectName("label_5") + self.verticalLayout.addWidget(self.label_5) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setSpacing(6) + self.horizontalLayout.setObjectName("horizontalLayout") + self.label = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.edFcpConnectionName = QtGui.QLineEdit(self.tab) + self.edFcpConnectionName.setObjectName("edFcpConnectionName") + self.horizontalLayout.addWidget(self.edFcpConnectionName) + self.verticalLayout.addLayout(self.horizontalLayout) + self.label_6 = QtGui.QLabel(self.tab) + self.label_6.setWordWrap(True) + self.label_6.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) + self.label_6.setObjectName("label_6") + self.verticalLayout.addWidget(self.label_6) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.verticalLayout_3 = QtGui.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.label_3 = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) + self.label_3.setSizePolicy(sizePolicy) + self.label_3.setObjectName("label_3") + self.verticalLayout_3.addWidget(self.label_3) + self.label_4 = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) + self.label_4.setSizePolicy(sizePolicy) + self.label_4.setObjectName("label_4") + self.verticalLayout_3.addWidget(self.label_4) + self.horizontalLayout_2.addLayout(self.verticalLayout_3) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.spinFcpConnectionTimerMaxDuration = QtGui.QSpinBox(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.spinFcpConnectionTimerMaxDuration.sizePolicy().hasHeightForWidth()) + self.spinFcpConnectionTimerMaxDuration.setSizePolicy(sizePolicy) + self.spinFcpConnectionTimerMaxDuration.setMaximum(999) + self.spinFcpConnectionTimerMaxDuration.setObjectName("spinFcpConnectionTimerMaxDuration") + self.verticalLayout_2.addWidget(self.spinFcpConnectionTimerMaxDuration) + self.spinConnectionTimerTimeout = QtGui.QSpinBox(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.spinConnectionTimerTimeout.sizePolicy().hasHeightForWidth()) + self.spinConnectionTimerTimeout.setSizePolicy(sizePolicy) + self.spinConnectionTimerTimeout.setMaximum(99999) + self.spinConnectionTimerTimeout.setObjectName("spinConnectionTimerTimeout") + self.verticalLayout_2.addWidget(self.spinConnectionTimerTimeout) + self.horizontalLayout_2.addLayout(self.verticalLayout_2) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.label_7 = QtGui.QLabel(self.tab) + self.label_7.setWordWrap(True) + self.label_7.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByKeyboard) + self.label_7.setObjectName("label_7") + self.verticalLayout.addWidget(self.label_7) + self.horizontalLayout_3 = QtGui.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.label_2 = QtGui.QLabel(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) + self.label_2.setSizePolicy(sizePolicy) + self.label_2.setObjectName("label_2") + self.horizontalLayout_3.addWidget(self.label_2) + self.spinFcpPollTimerTimeout = QtGui.QSpinBox(self.tab) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.spinFcpPollTimerTimeout.sizePolicy().hasHeightForWidth()) + self.spinFcpPollTimerTimeout.setSizePolicy(sizePolicy) + self.spinFcpPollTimerTimeout.setMaximum(99999) + self.spinFcpPollTimerTimeout.setObjectName("spinFcpPollTimerTimeout") + self.horizontalLayout_3.addWidget(self.spinFcpPollTimerTimeout) + self.verticalLayout.addLayout(self.horizontalLayout_3) + self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) + self.tabWidget.addTab(self.tab, "") + self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) + spacerItem = QtGui.QSpacerItem(98, 15, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1) + self.line = QtGui.QFrame(DlgConnectionExpertSettings) + self.line.setFrameShape(QtGui.QFrame.HLine) + self.line.setFrameShadow(QtGui.QFrame.Sunken) + self.line.setObjectName("line") + self.gridLayout_2.addWidget(self.line, 2, 0, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(DlgConnectionExpertSettings) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Reset) + self.buttonBox.setObjectName("buttonBox") + self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) + + self.retranslateUi(DlgConnectionExpertSettings) + self.tabWidget.setCurrentIndex(0) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DlgConnectionExpertSettings.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), DlgConnectionExpertSettings.reject) + QtCore.QMetaObject.connectSlotsByName(DlgConnectionExpertSettings) + + def retranslateUi(self, DlgConnectionExpertSettings): + DlgConnectionExpertSettings.setWindowTitle(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Adjusts the name the client uses to connect to the node. Use this for example to adjust the connection name in case the name is already in use by other clients. WARNING: changing this will loose all your current qequests", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Connection name:", None, QtGui.QApplication.UnicodeUTF8)) + self.label_6.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "How long should the client try to connect to the node before finally giving up? How long should he wait before retrying to establish a connection? WARNING: setting timeout to low values may cause the gui to slow down", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Connect duration:", None, QtGui.QApplication.UnicodeUTF8)) + self.label_4.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Connect timeout:", None, QtGui.QApplication.UnicodeUTF8)) + self.spinFcpConnectionTimerMaxDuration.setSuffix(QtGui.QApplication.translate("DlgConnectionExpertSettings", " seconds", None, QtGui.QApplication.UnicodeUTF8)) + self.spinConnectionTimerTimeout.setSuffix(QtGui.QApplication.translate("DlgConnectionExpertSettings", " miliseconds", None, QtGui.QApplication.UnicodeUTF8)) + self.label_7.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "How long should the client wait before polling the node for a the next message? Warning: setting this to high values will make messages come in more slowly. Setting it to low values may cause the gui to slow down.\n" +"", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("DlgConnectionExpertSettings", "Poll frequency: ", None, QtGui.QApplication.UnicodeUTF8)) + self.spinFcpPollTimerTimeout.setSuffix(QtGui.QApplication.translate("DlgConnectionExpertSettings", " miliseconds", None, QtGui.QApplication.UnicodeUTF8)) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("DlgConnectionExpertSettings", "Fcp connection", None, QtGui.QApplication.UnicodeUTF8)) + + +if __name__ == "__main__": + import sys + app = QtGui.QApplication(sys.argv) + DlgConnectionExpertSettings = QtGui.QDialog() + ui = Ui_DlgConnectionExpertSettings() + ui.setupUi(DlgConnectionExpertSettings) + DlgConnectionExpertSettings.show() + sys.exit(app.exec_()) + Modified: trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py =================================================================== --- trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-27 11:12:38 UTC (rev 760) +++ trunk/fclient/src/fclient/tpls/Ui_ViewConnectionWidgetTpl.py 2008-07-27 11:13:36 UTC (rev 761) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui' # -# Created: Fri Jul 25 00:27:53 2008 +# Created: Sat Jul 26 13:12:11 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,18 +12,12 @@ class Ui_ViewConnectionWidget(object): def setupUi(self, ViewConnectionWidget): ViewConnectionWidget.setObjectName("ViewConnectionWidget") - ViewConnectionWidget.resize(421, 382) + ViewConnectionWidget.resize(421, 558) self.gridLayout = QtGui.QGridLayout(ViewConnectionWidget) self.gridLayout.setObjectName("gridLayout") - self.horizontalLayout_3 = QtGui.QHBoxLayout() - self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.verticalLayout_6 = QtGui.QVBoxLayout() - self.verticalLayout_6.setObjectName("verticalLayout_6") self.label_5 = QtGui.QLabel(ViewConnectionWidget) self.label_5.setObjectName("label_5") - self.verticalLayout_6.addWidget(self.label_5) - self.verticalLayout_4 = QtGui.QVBoxLayout() - self.verticalLayout_4.setObjectName("verticalLayout_4") + self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtGui.QVBoxLayout() @@ -38,20 +32,35 @@ self.vboxlayout = QtGui.QVBoxLayout() self.vboxlayout.setObjectName("vboxlayout") self.edFcpConnectionHost = QtGui.QLineEdit(ViewConnectionWidget) + self.edFcpConnectionHost.setDragEnabled(True) self.edFcpConnectionHost.setObjectName("edFcpConnectionHost") self.vboxlayout.addWidget(self.edFcpConnectionHost) self.spinFcpConnectionPort = QtGui.QSpinBox(ViewConnectionWidget) self.spinFcpConnectionPort.setObjectName("spinFcpConnectionPort") self.vboxlayout.addWidget(self.spinFcpConnectionPort) self.horizontalLayout.addLayout(self.vboxlayout) - self.verticalLayout_4.addLayout(self.horizontalLayout) + self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.line = QtGui.QFrame(ViewConnectionWidget) + self.line.setFrameShape(QtGui.QFrame.VLine) + self.line.setFrameShadow(QtGui.QFrame.Sunken) + self.line.setObjectName("line") + self.gridLayout.addWidget(self.line, 1, 1, 6, 1) + spacerItem = QtGui.QSpacerItem(229, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem, 1, 2, 1, 1) self.ckFcpAutoConnect = QtGui.QCheckBox(ViewConnectionWidget) self.ckFcpAutoConnect.setObjectName("ckFcpAutoConnect") - self.verticalLayout_4.addWidget(self.ckFcpAutoConnect) - self.verticalLayout_6.addLayout(self.verticalLayout_4) + self.gridLayout.addWidget(self.ckFcpAutoConnect, 2, 0, 1, 1) + self.btFcpConnectionMore = QtGui.QPushButton(ViewConnectionWidget) + self.btFcpConnectionMore.setObjectName("btFcpConnectionMore") + self.gridLayout.addWidget(self.btFcpConnectionMore, 3, 0, 1, 1) + self.line_2 = QtGui.QFrame(ViewConnectionWidget) + self.line_2.setFrameShape(QtGui.QFrame.HLine) + self.line_2.setFrameShadow(QtGui.QFrame.Sunken) + self.line_2.setObjectName("line_2") + self.gridLayout.addWidget(self.line_2, 4, 0, 1, 1) self.label_6 = QtGui.QLabel(ViewConnectionWidget) self.label_6.setObjectName("label_6") - self.verticalLayout_6.addWidget(self.label_6) + self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1) self.verticalLayout_5 = QtGui.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.horizontalLayout_2 = QtGui.QHBoxLayout() @@ -68,6 +77,7 @@ self.verticalLayout_2 = QtGui.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.edFproxyConnectionHost = QtGui.QLineEdit(ViewConnectionWidget) + self.edFproxyConnectionHost.setDragEnabled(True) self.edFproxyConnectionHost.setObjectName("edFproxyConnectionHost") self.verticalLayout_2.addWidget(self.edFproxyConnectionHost) self.spinFproxyConnectionPort = QtGui.QSpinBox(ViewConnectionWidget) @@ -75,23 +85,14 @@ self.verticalLayout_2.addWidget(self.spinFproxyConnectionPort) self.horizontalLayout_2.addLayout(self.verticalLayout_2) self.verticalLayout_5.addLayout(self.horizontalLayout_2) - self.verticalLayout_6.addLayout(self.verticalLayout_5) - self.horizontalLayout_3.addLayout(self.verticalLayout_6) - self.line = QtGui.QFrame(ViewConnectionWidget) - self.line.setFrameShape(QtGui.QFrame.VLine) - self.line.setFrameShadow(QtGui.QFrame.Sunken) - self.line.setObjectName("line") - self.horizontalLayout_3.addWidget(self.line) - self.gridLayout.addLayout(self.horizontalLayout_3, 0, 0, 1, 1) - spacerItem = QtGui.QSpacerItem(229, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout.addItem(spacerItem, 0, 1, 1, 1) + self.gridLayout.addLayout(self.verticalLayout_5, 6, 0, 1, 1) spacerItem1 = QtGui.QSpacerItem(20, 97, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem1, 1, 0, 1, 1) + self.gridLayout.addItem(spacerItem1, 7, 0, 1, 1) self.btConnect = QtGui.QPushButton(ViewConnectionWidget) self.btConnect.setCheckable(True) self.btConnect.setAutoExclusive(False) self.btConnect.setObjectName("btConnect") - self.gridLayout.addWidget(self.btConnect, 2, 0, 1, 2) + self.gridLayout.addWidget(self.btConnect, 8, 0, 1, 3) self.retranslateUi(ViewConnectionWidget) QtCore.QMetaObject.connectSlotsByName(ViewConnectionWidget) @@ -102,6 +103,7 @@ self.label.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8)) self.ckFcpAutoConnect.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Auto Connect", None, QtGui.QApplication.UnicodeUTF8)) + self.btFcpConnectionMore.setText(QtGui.QApplication.translate("ViewConnectionWidget", "More..", None, QtGui.QApplication.UnicodeUTF8)) self.label_6.setText(QtGui.QApplication.translate("ViewConnectionWidget", "<b>Fproxy connection</b>", None, QtGui.QApplication.UnicodeUTF8)) self.label_3.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Host:", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate("ViewConnectionWidget", "Port:", None, QtGui.QApplication.UnicodeUTF8)) Modified: trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui 2008-07-27 11:12:38 UTC (rev 760) +++ trunk/fclient/src/fclient/tpls/ViewConnectionWidgetTpl.ui 2008-07-27 11:13:36 UTC (rev 761) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>421</width> - <height>382</height> + <height>558</height> </rect> </property> <property name="windowTitle" > @@ -14,114 +14,56 @@ </property> <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout_3" > + <widget class="QLabel" name="label_5" > + <property name="text" > + <string><b>Fcp connection</b></string> + </property> + </widget> + </item> + <item row="1" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout" > <item> - <layout class="QVBoxLayout" name="verticalLayout_6" > + <layout class="QVBoxLayout" name="verticalLayout" > <item> - <widget class="QLabel" name="label_5" > + <widget class="QLabel" name="label" > <property name="text" > - <string><b>Fcp connection</b></string> + <string>Host:</string> </property> </widget> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_4" > - <item> - <layout class="QHBoxLayout" name="horizontalLayout" > - <item> - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string>Host:</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>Port:</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" > - <item> - <widget class="QLineEdit" name="edFcpConnectionHost" /> - </item> - <item> - <widget class="QSpinBox" name="spinFcpConnectionPort" /> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QCheckBox" name="ckFcpAutoConnect" > - <property name="text" > - <string>Auto Connect</string> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="label_2" > + <property name="text" > + <string>Port:</string> + </property> + </widget> </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" > <item> - <widget class="QLabel" name="label_6" > - <property name="text" > - <string><b>Fproxy connection</b></string> + <widget class="QLineEdit" name="edFcpConnectionHost" > + <property name="dragEnabled" > + <bool>true</bool> </property> </widget> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout_5" > - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2" > - <item> - <layout class="QVBoxLayout" name="verticalLayout_3" > - <item> - <widget class="QLabel" name="label_3" > - <property name="text" > - <string>Host:</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_4" > - <property name="text" > - <string>Port:</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > - <item> - <widget class="QLineEdit" name="edFproxyConnectionHost" /> - </item> - <item> - <widget class="QSpinBox" name="spinFproxyConnectionPort" /> - </item> - </layout> - </item> - </layout> - </item> - </layout> + <widget class="QSpinBox" name="spinFcpConnectionPort" /> </item> </layout> </item> - <item> - <widget class="Line" name="line" > - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> </layout> </item> - <item row="0" column="1" > + <item rowspan="6" row="1" column="1" > + <widget class="Line" name="line" > + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + <item row="1" column="2" > <spacer name="horizontalSpacer" > <property name="orientation" > <enum>Qt::Horizontal</enum> @@ -134,7 +76,75 @@ </property> </spacer> </item> - <item row="1" column="0" > + <item row="2" column="0" > + <widget class="QCheckBox" name="ckFcpAutoConnect" > + <property name="text" > + <string>Auto Connect</string> + </property> + </widget> + </item> + <item row="3" column="0" > + <widget class="QPushButton" name="btFcpConnectionMore" > + <property name="text" > + <string>More..</string> + </property> + </widget> + </item> + <item row="4" column="0" > + <widget class="Line" name="line_2" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="5" column="0" > + <widget class="QLabel" name="label_6" > + <property name="text" > + <string><b>Fproxy connection</b></string> + </property> + </widget> + </item> + <item row="6" column="0" > + <layout class="QVBoxLayout" name="verticalLayout_5" > + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <layout class="QVBoxLayout" name="verticalLayout_3" > + <item> + <widget class="QLabel" name="label_3" > + <property name="text" > + <string>Host:</string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_4" > + <property name="text" > + <string>Port:</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QLineEdit" name="edFproxyConnectionHost" > + <property name="dragEnabled" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinFproxyConnectionPort" /> + </item> + </layout> + </item> + </layout> + </item> + </layout> + </item> + <item row="7" column="0" > <spacer name="verticalSpacer" > <property name="orientation" > <enum>Qt::Vertical</enum> @@ -147,7 +157,7 @@ </property> </spacer> </item> - <item row="2" column="0" colspan="2" > + <item row="8" column="0" colspan="3" > <widget class="QPushButton" name="btConnect" > <property name="text" > <string>Connect</string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:12:29
|
Revision: 760 http://fclient.svn.sourceforge.net/fclient/?rev=760&view=rev Author: jUrner Date: 2008-07-27 11:12:38 +0000 (Sun, 27 Jul 2008) Log Message: ----------- minor change Modified Paths: -------------- trunk/fclient/src/fclient/lib/fcp2/client.py Modified: trunk/fclient/src/fclient/lib/fcp2/client.py =================================================================== --- trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-27 11:11:47 UTC (rev 759) +++ trunk/fclient/src/fclient/lib/fcp2/client.py 2008-07-27 11:12:38 UTC (rev 760) @@ -479,7 +479,7 @@ if result: self.sendMessage( message.MsgClientHello( - Name=self._connectionName, + Name=self.getConnectionName(), ExpectedVersion=self.ExpectedFcpVersion, ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:11:38
|
Revision: 759 http://fclient.svn.sourceforge.net/fclient/?rev=759&view=rev Author: jUrner Date: 2008-07-27 11:11:47 +0000 (Sun, 27 Jul 2008) Log Message: ----------- more todos Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewBrowser.py Modified: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-27 11:11:25 UTC (rev 758) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-27 11:11:47 UTC (rev 759) @@ -16,13 +16,13 @@ # x. when mouse pointer is over an opend image a magnifier cursor appears. no idea how this is handled # x. open new tab on tab bar double click. IIRC looks like no way before qt4.5. tabBars are not stretched to fit in qt4.4 # x. global feedback on statusbar flickers. reason: first label is holds arbitrary length text -# x. save link to disk # x. fproxy. "force browser to dl" should we dl it in downloads or store emidiately? no idea # x. visiting plugins via fproxy does not work -# real toolbars +# x. real toolbars # x. remove host/port from urls? # x. browser settings - QWebSettings # x. shortcuts +# x. user staring gui for first time. maybe we should not connext untill the user connects explicitely #****************************************************************************************** """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:11:15
|
Revision: 758 http://fclient.svn.sourceforge.net/fclient/?rev=758&view=rev Author: jUrner Date: 2008-07-27 11:11:25 +0000 (Sun, 27 Jul 2008) Log Message: ----------- remove left over import Modified Paths: -------------- trunk/fclient/src/fclient/Ui_MainWindow.py Modified: trunk/fclient/src/fclient/Ui_MainWindow.py =================================================================== --- trunk/fclient/src/fclient/Ui_MainWindow.py 2008-07-27 11:10:49 UTC (rev 757) +++ trunk/fclient/src/fclient/Ui_MainWindow.py 2008-07-27 11:11:25 UTC (rev 758) @@ -8,7 +8,6 @@ from PyQt4 import QtCore, QtGui -from . import __init__ from . import config from . import Ui_Prefs from . import Ui_View This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:10:40
|
Revision: 757 http://fclient.svn.sourceforge.net/fclient/?rev=757&view=rev Author: jUrner Date: 2008-07-27 11:10:49 +0000 (Sun, 27 Jul 2008) Log Message: ----------- whitespace Modified Paths: -------------- trunk/fclient/src/fclient/fclient.py Modified: trunk/fclient/src/fclient/fclient.py =================================================================== --- trunk/fclient/src/fclient/fclient.py 2008-07-27 11:10:03 UTC (rev 756) +++ trunk/fclient/src/fclient/fclient.py 2008-07-27 11:10:49 UTC (rev 757) @@ -1,4 +1,4 @@ - + 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__)] @@ -17,7 +17,6 @@ #************************************************************* def main(): - app = QtGui.QApplication(sys.argv) mainWindow = MainWindow() viewWidget = ViewWidget(mainWindow) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:09:53
|
Revision: 756 http://fclient.svn.sourceforge.net/fclient/?rev=756&view=rev Author: jUrner Date: 2008-07-27 11:10:03 +0000 (Sun, 27 Jul 2008) Log Message: ----------- add connection name Modified Paths: -------------- trunk/fclient/src/fclient/config.py Modified: trunk/fclient/src/fclient/config.py =================================================================== --- trunk/fclient/src/fclient/config.py 2008-07-27 11:09:32 UTC (rev 755) +++ trunk/fclient/src/fclient/config.py 2008-07-27 11:10:03 UTC (rev 756) @@ -20,6 +20,7 @@ FclientLicence = 'MIT' FclientCopyright = '(c) 2008 Juergen Urner' FclientHomepage = 'http://fclient.sourceforge.net/' +FclientConnectionName = QtCore.QString(FclientAppName + ':{08625b10-2b44-4689-b1bf-8baf208b9641}') _ = os.path.dirname(os.path.abspath(__file__)) FclientDir = QtCore.QString(_) @@ -105,7 +106,7 @@ ('DownloadDir', 'String', FclientDownloadDir, SettingScopeUser), ('FcpAutoConnect', 'Bool', True, SettingScopeUser), - ('FcpConnectionName', 'String', '', SettingScopeUser), #TODO: not implemented + ('FcpConnectionName', 'String', FclientConnectionName, SettingScopeExpert), #TODO: not implemented ('FcpConnectionHost', 'String', fcp2.Client.DefaultFcpHost, SettingScopeUser), ('FcpConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort, SettingScopeUser), ('FproxyConnectionHost', 'String','127.0.0.1', SettingScopeUser), @@ -213,4 +214,5 @@ r = clss.KeyPattern.match(key) if r is None: return key, '' - return r.group(1), r.group(2) \ No newline at end of file + return r.group(1), r.group(2) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-27 11:09:22
|
Revision: 755 http://fclient.svn.sourceforge.net/fclient/?rev=755&view=rev Author: jUrner Date: 2008-07-27 11:09:32 +0000 (Sun, 27 Jul 2008) Log Message: ----------- clean up Modified Paths: -------------- trunk/fclient/src/fclient/__init__.py Modified: trunk/fclient/src/fclient/__init__.py =================================================================== --- trunk/fclient/src/fclient/__init__.py 2008-07-26 12:10:36 UTC (rev 754) +++ trunk/fclient/src/fclient/__init__.py 2008-07-27 11:09:32 UTC (rev 755) @@ -1,9 +1,4 @@ -from __future__ import absolute_import -if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below - import os; __path__ = [os.path.dirname(__file__)] + - -from . import config -from .ui import connection \ 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-26 12:10:27
|
Revision: 754 http://fclient.svn.sourceforge.net/fclient/?rev=754&view=rev Author: jUrner Date: 2008-07-26 12:10:36 +0000 (Sat, 26 Jul 2008) Log Message: ----------- better compact key Modified Paths: -------------- trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py Modified: trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py 2008-07-26 09:40:22 UTC (rev 753) +++ trunk/fclient/src/fclient/Ui_DlgDownloadKeyToDisk.py 2008-07-26 12:10:36 UTC (rev 754) @@ -29,7 +29,11 @@ self._filePath = None self._fcpKey = fcpKey - self.pathLabelWrap = pathlabelwrap.PathLabelWrap(self.labelKey, fpath=unicode(self.labelKey.text())) + self.pathLabelWrap = pathlabelwrap.PathLabelWrap( + self.labelKey, + fpath=unicode(self.labelKey.text()), + path_module=config.CompactPathFcpKeyModule + ) self.connect(self.btChooseDownloadFileName, QtCore.SIGNAL('clicked()'), self.onChooseDownloadFileName) # find out fileName to dl key to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-26 09:40:19
|
Revision: 753 http://fclient.svn.sourceforge.net/fclient/?rev=753&view=rev Author: jUrner Date: 2008-07-26 09:40:22 +0000 (Sat, 26 Jul 2008) Log Message: ----------- beautify Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewBrowser.py Modified: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:39:55 UTC (rev 752) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:40:22 UTC (rev 753) @@ -701,9 +701,9 @@ menu.addSeparator() menu.addAction(browser.pageAction(page.OpenImageInNewWindow)) + menu.addAction(browser.pageAction(page.CopyImageToClipboard)) menu.addAction(browser.pageAction(page.DownloadImageToDisk)) - menu.addAction(browser.pageAction(page.CopyImageToClipboard)) - + menu.addSeparator() menu.addAction(browser.pageAction(page.OpenFrameInNewWindow)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-26 09:39:45
|
Revision: 752 http://fclient.svn.sourceforge.net/fclient/?rev=752&view=rev Author: jUrner Date: 2008-07-26 09:39:55 +0000 (Sat, 26 Jul 2008) Log Message: ----------- add download link to disk Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewBrowser.py Modified: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:15:26 UTC (rev 751) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:39:55 UTC (rev 752) @@ -355,7 +355,7 @@ shortcut=QtGui.QKeySequence(self.trUtf8('Ctrl+F')), trigger=parent.onSearch, ) - + def intertwineBrowserActions(self, browser=None): """intertwines Browser actions with BrowserWidget actions @note: call everytime the current browser changes @@ -697,8 +697,8 @@ menu.addAction(browser.pageAction(page.OpenLink)) menu.addAction(browser.pageAction(page.OpenLinkInNewWindow)) menu.addAction(browser.pageAction(page.CopyLinkToClipboard)) - ##menu.addAction(DownloadLinkToDisk)) - + menu.addAction(browser.pageAction(page.DownloadLinkToDisk)) + menu.addSeparator() menu.addAction(browser.pageAction(page.OpenImageInNewWindow)) menu.addAction(browser.pageAction(page.DownloadImageToDisk)) @@ -724,6 +724,8 @@ self.load(hitTestResult.frame().url(), browser=browser) elif action == browser.pageAction(page.DownloadImageToDisk): self._downloadImageToDisk(hitTestResult) + elif action == browser.pageAction(page.DownloadLinkToDisk): + self._downloadKeyToDisk(hitTestResult.linkUrl()) elif action == self.fcActions['ActionObjectProperties']: dlg = Ui_DlgPropsBrowserObject.PropsBrowserObjectDlg(self, hitTestResult=hitTestResult) if dlg.exec_() == dlg.Accepted: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-26 09:15:18
|
Revision: 751 http://fclient.svn.sourceforge.net/fclient/?rev=751&view=rev Author: jUrner Date: 2008-07-26 09:15:26 +0000 (Sat, 26 Jul 2008) Log Message: ----------- better compacting of freenet keys Modified Paths: -------------- trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py trunk/fclient/src/fclient/Ui_ViewBrowser.py trunk/fclient/src/fclient/config.py Modified: trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-26 09:14:50 UTC (rev 750) +++ trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-26 09:15:26 UTC (rev 751) @@ -37,34 +37,24 @@ self.setupUi(self) self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties')) - - - - if hitTestResult is not None: if not hitTestResult.linkUrl().isEmpty(): labelLinkUrl = self.controlById(self.IdLabelLinkUrl) - self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=posixpath) + self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=config.CompactPathFcpKeyModule) self.wrapLinkUrl.setPath(unicode(hitTestResult.linkUrl().toString())) if not hitTestResult.imageUrl().isEmpty(): labelImageUrl = self.controlById(self.IdLabelImageUrl) - self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=posixpath) + self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=config.CompactPathFcpKeyModule) self.wrapImageUrl.setPath(unicode(hitTestResult.imageUrl().toString())) ellipsis = self.trUtf8('..') - print hitTestResult.linkTitle(), hitTestResult.linkText() self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkTitle().toString(), ellipsis)) self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkText(), ellipsis)) - - - - + def controlById(self, idControl): return getattr(self, idControl) - - #********************************************************************************** # #********************************************************************************** Modified: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:14:50 UTC (rev 750) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:15:26 UTC (rev 751) @@ -12,10 +12,17 @@ # x. fProxy is a bit tight-lipped when it comes to feedback. no idea # x. give feedback on tabs about load / finisched / error. maybe some color code. wait for new QTabWidget features (qt4.5) # x. close button on tabs. wait for new QTabWidget features (qt4.5) -# x. zoom in/out # x. page actions: CopyImageToClipboard, # x. when mouse pointer is over an opend image a magnifier cursor appears. no idea how this is handled -# x. open new tab on tab bar double click +# x. open new tab on tab bar double click. IIRC looks like no way before qt4.5. tabBars are not stretched to fit in qt4.4 +# x. global feedback on statusbar flickers. reason: first label is holds arbitrary length text +# x. save link to disk +# x. fproxy. "force browser to dl" should we dl it in downloads or store emidiately? no idea +# x. visiting plugins via fproxy does not work +# real toolbars +# x. remove host/port from urls? +# x. browser settings - QWebSettings +# x. shortcuts #****************************************************************************************** """ @@ -25,7 +32,6 @@ if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below import os; __path__ = [os.path.dirname(__file__)] -import posixpath from PyQt4 import QtCore, QtGui, QtWebKit from . import config @@ -176,7 +182,7 @@ label.setFrameStyle(QtGui.QLabel.Sunken | QtGui.QLabel.Box) self.labelFeedbackWrap = pathlabelwrap.PathLabelWrap( label, - path_module=posixpath, + path_module=config.CompactPathFcpKeyModule, ) self.statusBar.addWidget(self.labelFeedbackWrap.label, 1) @@ -609,7 +615,6 @@ # customize browser browser.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - ##settings.setAttribute(settings.AutoLoadImages, False) settings.setAttribute(settings.DeveloperExtrasEnabled, False) settings.setAttribute(settings.JavaEnabled, False) settings.setAttribute(settings.JavascriptEnabled, False) @@ -959,7 +964,6 @@ if browser is not None: oldMultiplier = browser.textSizeMultiplier() browser.setTextSizeMultiplier(browser.textSizeMultiplier() - 0.2) - print browser.textSizeMultiplier() if browser.textSizeMultiplier() >= oldMultiplier: menu.addAction(self.fcActions['ActionZoomOut']).setEnabled(False) Modified: trunk/fclient/src/fclient/config.py =================================================================== --- trunk/fclient/src/fclient/config.py 2008-07-26 09:14:50 UTC (rev 750) +++ trunk/fclient/src/fclient/config.py 2008-07-26 09:15:26 UTC (rev 751) @@ -197,3 +197,20 @@ return QtCore.QString(filename) return default + +class CompactPathFcpKeyModule(object): + """path module for lib.compactpath to split and join fcp keys""" + + import re + KeyPattern = re.compile('(.*? (?: CSK@ | SSK@ | KSK@ | USK@) [^\/]*)(.*)\Z', re.I | re.X) + + @classmethod + def join(clss, *components): + return ''.join(components) + + @classmethod + def split(clss, key): + r = clss.KeyPattern.match(key) + if r is None: + return key, '' + return r.group(1), r.group(2) \ 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-26 09:14:44
|
Revision: 750 http://fclient.svn.sourceforge.net/fclient/?rev=750&view=rev Author: jUrner Date: 2008-07-26 09:14:50 +0000 (Sat, 26 Jul 2008) Log Message: ----------- fix misplaced ellipsis Modified Paths: -------------- trunk/fclient/src/fclient/lib/compactpath/README trunk/fclient/src/fclient/lib/compactpath/compactpath.py Modified: trunk/fclient/src/fclient/lib/compactpath/README =================================================================== --- trunk/fclient/src/fclient/lib/compactpath/README 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/lib/compactpath/README 2008-07-26 09:14:50 UTC (rev 750) @@ -6,6 +6,15 @@ Version history #******************************************************************* +compactpath 0.5.1 +#******************************************************************** +news: + + +fixes: + x. elllipsis was misplaced in some cases + +#******************************************************************* compactpath 0.5.0 #******************************************************************** release: 06/15/2008 Modified: trunk/fclient/src/fclient/lib/compactpath/compactpath.py =================================================================== --- trunk/fclient/src/fclient/lib/compactpath/compactpath.py 2008-07-25 22:41:24 UTC (rev 749) +++ trunk/fclient/src/fclient/lib/compactpath/compactpath.py 2008-07-26 09:14:50 UTC (rev 750) @@ -159,7 +159,7 @@ tail = ellipsis + tail n = len(tail) - 1 elif head: - tail = path_module.join(head, tail, ellipsis=ellipsis) + tail = path_module.join(head, tail) n = len(tail) else: n = len(tail) @@ -167,7 +167,7 @@ while tail: if measure(tail) < w: return tail - tail = rtrunc(n, tail) + tail = rtrunc(n, tail, ellipsis=ellipsis) n -= 1 return '' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-25 22:41:15
|
Revision: 749 http://fclient.svn.sourceforge.net/fclient/?rev=749&view=rev Author: jUrner Date: 2008-07-25 22:41:24 +0000 (Fri, 25 Jul 2008) Log Message: ----------- add a basic search bar Modified Paths: -------------- trunk/fclient/src/fclient/Ui_ViewBrowser.py trunk/fclient/src/fclient/tpls/Ui_ViewBrowserWidgetTpl.py trunk/fclient/src/fclient/tpls/ViewBrowserWidgetTpl.ui Modified: trunk/fclient/src/fclient/Ui_ViewBrowser.py =================================================================== --- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-25 22:40:45 UTC (rev 748) +++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-25 22:41:24 UTC (rev 749) @@ -300,7 +300,7 @@ trigger=parent.onZoomOut, ) - # dummy actions to replace default browser actions + # default browser actions self.action( name='ActionBack', text=self.trUtf8('Back'), @@ -340,6 +340,15 @@ icon=config.resources.getIcon('button_cancel', iconSize, iconTheme=iconTheme), trigger=None, ) + + # search actions + self.action( + parent=parent, + name='ActionSearch', + text=self.trUtf8('Search'), + shortcut=QtGui.QKeySequence(self.trUtf8('Ctrl+F')), + trigger=parent.onSearch, + ) def intertwineBrowserActions(self, browser=None): """intertwines Browser actions with BrowserWidget actions @@ -407,6 +416,12 @@ IdBtReload = 'btReload' IdBtStop = 'btStop' + IdFrameSearch = 'frameSearch' + IdEdSearch = 'edSearch' + IdBtSearchUpwards = 'btSearchUpwards' + IdBtSearchDownwards = 'btSearchDownwards' + IdCkSearchCaseSensitive = 'ckSearchCaseSensitive' + ForcedMinBrowserTabText = 5 # forced minimum number of chars on browser tabBar def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): @@ -439,6 +454,16 @@ self.controlById(self.IdBtReload).setDefaultAction(self.fcActions['ActionReload']) 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) + # fire up a new broser to make a start self.newBrowser(title=self.trUtf8('Waiting for fproxy')) self.fcActions['ActionGoToHomePage'].trigger() @@ -632,6 +657,7 @@ menu.addAction(self.fcActions['ActionOpenNewTab']) menu.addAction(self.fcActions['ActionZoomIn']) menu.addAction(self.fcActions['ActionZoomOut']) + menu.addAction(self.fcActions['ActionSearch']) return menu ######################################### @@ -863,6 +889,32 @@ 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 onSearchDownwards(self): + browser = self.currentBrowser() + if browser is not None: + page = browser.page() + ed = self.controlById(self.IdEdSearch) + ck = self.controlById(self.IdCkSearchCaseSensitive) + flags = page.FindWrapsAroundDocument + if ck.checkState() == QtCore.Qt.Checked: + flags |= page.FindCaseSensitively + browser.findText(ed.text(), flags) + + def onSearchUpwards(self): + browser = self.currentBrowser() + if browser is not None: + page = browser.page() + ed = self.controlById(self.IdEdSearch) + ck = self.controlById(self.IdCkSearchCaseSensitive) + flags = page.FindWrapsAroundDocument | page.FindBackward + if ck.checkState() == QtCore.Qt.Checked: + flags |= page.FindCaseSensitively + browser.findText(ed.text(), flags) + def onTabContextMenuEvent(self, pt): menu = QtGui.QMenu() tabWidget = self.controlById(self.IdTabBrowsers) Modified: trunk/fclient/src/fclient/tpls/Ui_ViewBrowserWidgetTpl.py =================================================================== --- trunk/fclient/src/fclient/tpls/Ui_ViewBrowserWidgetTpl.py 2008-07-25 22:40:45 UTC (rev 748) +++ trunk/fclient/src/fclient/tpls/Ui_ViewBrowserWidgetTpl.py 2008-07-25 22:41:24 UTC (rev 749) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewBrowserWidgetTpl.ui' # -# Created: Fri Jul 25 19:05:55 2008 +# Created: Sat Jul 26 00:36:50 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,11 +12,9 @@ class Ui_ViewBrowserWidget(object): def setupUi(self, ViewBrowserWidget): ViewBrowserWidget.setObjectName("ViewBrowserWidget") - ViewBrowserWidget.resize(570, 516) - self.gridLayout_3 = QtGui.QGridLayout(ViewBrowserWidget) - self.gridLayout_3.setMargin(0) - self.gridLayout_3.setSpacing(0) - self.gridLayout_3.setObjectName("gridLayout_3") + ViewBrowserWidget.resize(710, 794) + self.gridLayout_4 = QtGui.QGridLayout(ViewBrowserWidget) + self.gridLayout_4.setObjectName("gridLayout_4") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setSpacing(0) self.horizontalLayout.setObjectName("horizontalLayout") @@ -59,14 +57,42 @@ self.edAddressBar.setObjectName("edAddressBar") self.gridLayout.addWidget(self.edAddressBar, 0, 0, 1, 1) self.horizontalLayout.addWidget(self.frameAddressBar) - self.gridLayout_3.addLayout(self.horizontalLayout, 0, 0, 1, 1) + self.gridLayout_4.addLayout(self.horizontalLayout, 0, 0, 1, 1) self.tabBrowsers = QtGui.QTabWidget(ViewBrowserWidget) self.tabBrowsers.setObjectName("tabBrowsers") self.tab = QtGui.QWidget() - self.tab.setGeometry(QtCore.QRect(0, 0, 566, 458)) + self.tab.setGeometry(QtCore.QRect(0, 0, 688, 654)) self.tab.setObjectName("tab") self.tabBrowsers.addTab(self.tab, "") - self.gridLayout_3.addWidget(self.tabBrowsers, 1, 0, 1, 1) + 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.gridLayout_3.setObjectName("gridLayout_3") + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.label = QtGui.QLabel(self.frameSearch) + 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) + 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.retranslateUi(ViewBrowserWidget) self.tabBrowsers.setCurrentIndex(0) @@ -79,6 +105,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)) if __name__ == "__main__": Modified: trunk/fclient/src/fclient/tpls/ViewBrowserWidgetTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/ViewBrowserWidgetTpl.ui 2008-07-25 22:40:45 UTC (rev 748) +++ trunk/fclient/src/fclient/tpls/ViewBrowserWidgetTpl.ui 2008-07-25 22:41:24 UTC (rev 749) @@ -5,20 +5,14 @@ <rect> <x>0</x> <y>0</y> - <width>570</width> - <height>516</height> + <width>710</width> + <height>794</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> - <layout class="QGridLayout" name="gridLayout_3" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>0</number> - </property> + <layout class="QGridLayout" name="gridLayout_4" > <item row="0" column="0" > <layout class="QHBoxLayout" name="horizontalLayout" > <property name="spacing" > @@ -120,8 +114,8 @@ <rect> <x>0</x> <y>0</y> - <width>566</width> - <height>458</height> + <width>688</width> + <height>654</height> </rect> </property> <attribute name="title" > @@ -130,6 +124,70 @@ </widget> </widget> </item> + <item row="2" column="0" > + <widget class="QFrame" name="frameSearch" > + <property name="frameShape" > + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow" > + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_3" > + <item row="0" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string>Search:</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="edSearch" > + <property name="dragEnabled" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btSearchDownwards" > + <property name="text" > + <string>Down</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="btSearchUpwards" > + <property name="text" > + <string>Up</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="ckSearchCaseSensitive" > + <property name="text" > + <string>Case sensitive</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>48</width> + <height>25</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + </item> </layout> </widget> <resources/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-25 22:40:36
|
Revision: 748 http://fclient.svn.sourceforge.net/fclient/?rev=748&view=rev Author: jUrner Date: 2008-07-25 22:40:45 +0000 (Fri, 25 Jul 2008) Log Message: ----------- truncates text Modified Paths: -------------- trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui trunk/fclient/src/fclient/tpls/Ui_DlgPropsBrowserObjectTpl.py Modified: trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py =================================================================== --- trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-25 22:39:39 UTC (rev 747) +++ trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-25 22:40:45 UTC (rev 748) @@ -2,8 +2,7 @@ #TODO: # just a sketch so far # -# x. layout labels -# x. limits! compact urls, truncate text (...) +# x. link and image url are not selectable # # #********************************************************************** @@ -11,11 +10,12 @@ if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below import os; __path__ = [os.path.dirname(__file__)] - +import posixpath from PyQt4 import QtGui from . import config from .lib.compactpath.qt4 import pathlabelwrap +from .lib.qt4ex.lib import tools as qtools from .tpls.Ui_DlgPropsBrowserObjectTpl import Ui_DlgPropsBrowserObject #********************************************************************************** @@ -29,6 +29,7 @@ IdLabelLinkUrl = 'labelLinkUrl' IdLabelImageUrl = 'labelImageUrl' + MaxText = 80 def __init__(self, parent, browser=None, hitTestResult=None): QtGui.QDialog.__init__(self, parent) @@ -36,16 +37,28 @@ self.setupUi(self) self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties')) + + + + if hitTestResult is not None: - self.labelTitle.setText(hitTestResult.linkTitle().toString()) - self.labelName.setText(hitTestResult.linkText()) - + if not hitTestResult.linkUrl().isEmpty(): - self.labelLinkUrl.setText(hitTestResult.linkUrl().toString()) + labelLinkUrl = self.controlById(self.IdLabelLinkUrl) + self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=posixpath) + self.wrapLinkUrl.setPath(unicode(hitTestResult.linkUrl().toString())) if not hitTestResult.imageUrl().isEmpty(): - self.labelImageUrl.setText(hitTestResult.imageUrl().toString()) - - + labelImageUrl = self.controlById(self.IdLabelImageUrl) + self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=posixpath) + self.wrapImageUrl.setPath(unicode(hitTestResult.imageUrl().toString())) + + ellipsis = self.trUtf8('..') + print hitTestResult.linkTitle(), hitTestResult.linkText() + self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkTitle().toString(), ellipsis)) + self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkText(), ellipsis)) + + + def controlById(self, idControl): return getattr(self, idControl) Modified: trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui =================================================================== --- trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-25 22:39:39 UTC (rev 747) +++ trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui 2008-07-25 22:40:45 UTC (rev 748) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>420</width> - <height>189</height> + <height>307</height> </rect> </property> <property name="windowTitle" > @@ -14,160 +14,167 @@ </property> <layout class="QGridLayout" name="gridLayout" > <item row="0" column="0" > - <layout class="QHBoxLayout" name="horizontalLayout" > + <layout class="QVBoxLayout" name="verticalLayout" > <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > - <item> - <widget class="QLabel" name="label" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Type:</string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_2" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Title:</string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_99" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Name:</string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_4" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>LinkUrl:</string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_5" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>ImageUrl:</string> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="label" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>Type:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout" > - <item> - <widget class="QLabel" name="labeType" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelTitle" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelName" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelLinkUrl" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelImageUrl" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>unknown</string> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="labeType" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> </item> + <item> + <widget class="QLabel" name="label_2" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>Title:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelTitle" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_99" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>Name:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelName" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_4" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>LinkUrl:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelLinkUrl" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_5" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Minimum" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string><b>ImageUrl:</b></string> + </property> + <property name="alignment" > + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelImageUrl" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Preferred" hsizetype="Expanding" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>unknown</string> + </property> + <property name="textInteractionFlags" > + <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> + </property> + </widget> + </item> </layout> </item> <item row="1" column="0" > Modified: trunk/fclient/src/fclient/tpls/Ui_DlgPropsBrowserObjectTpl.py =================================================================== --- trunk/fclient/src/fclient/tpls/Ui_DlgPropsBrowserObjectTpl.py 2008-07-25 22:39:39 UTC (rev 747) +++ trunk/fclient/src/fclient/tpls/Ui_DlgPropsBrowserObjectTpl.py 2008-07-25 22:40:45 UTC (rev 748) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/DlgPropsBrowserObjectTpl.ui' # -# Created: Mon Jul 21 12:08:23 2008 +# Created: Fri Jul 25 21:08:39 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,13 +12,11 @@ class Ui_DlgPropsBrowserObject(object): def setupUi(self, DlgPropsBrowserObject): DlgPropsBrowserObject.setObjectName("DlgPropsBrowserObject") - DlgPropsBrowserObject.resize(420, 189) + DlgPropsBrowserObject.resize(420, 307) self.gridLayout = QtGui.QGridLayout(DlgPropsBrowserObject) self.gridLayout.setObjectName("gridLayout") - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout_2 = QtGui.QVBoxLayout() - self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") self.label = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) @@ -27,88 +25,89 @@ self.label.setSizePolicy(sizePolicy) self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.label.setObjectName("label") - self.verticalLayout_2.addWidget(self.label) - self.label_2 = QtGui.QLabel(DlgPropsBrowserObject) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) - self.label_2.setSizePolicy(sizePolicy) - self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_2.setObjectName("label_2") - self.verticalLayout_2.addWidget(self.label_2) - self.label_99 = QtGui.QLabel(DlgPropsBrowserObject) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_99.sizePolicy().hasHeightForWidth()) - self.label_99.setSizePolicy(sizePolicy) - self.label_99.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_99.setObjectName("label_99") - self.verticalLayout_2.addWidget(self.label_99) - self.label_4 = QtGui.QLabel(DlgPropsBrowserObject) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) - self.label_4.setSizePolicy(sizePolicy) - self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_4.setObjectName("label_4") - self.verticalLayout_2.addWidget(self.label_4) - self.label_5 = QtGui.QLabel(DlgPropsBrowserObject) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) - self.label_5.setSizePolicy(sizePolicy) - self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) - self.label_5.setObjectName("label_5") - self.verticalLayout_2.addWidget(self.label_5) - self.horizontalLayout.addLayout(self.verticalLayout_2) - self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") + self.verticalLayout.addWidget(self.label) self.labeType = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.labeType.sizePolicy().hasHeightForWidth()) self.labeType.setSizePolicy(sizePolicy) + self.labeType.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labeType.setObjectName("labeType") self.verticalLayout.addWidget(self.labeType) + self.label_2 = QtGui.QLabel(DlgPropsBrowserObject) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) + self.label_2.setSizePolicy(sizePolicy) + self.label_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label_2.setObjectName("label_2") + self.verticalLayout.addWidget(self.label_2) self.labelTitle = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.labelTitle.sizePolicy().hasHeightForWidth()) self.labelTitle.setSizePolicy(sizePolicy) + self.labelTitle.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelTitle.setObjectName("labelTitle") self.verticalLayout.addWidget(self.labelTitle) + self.label_99 = QtGui.QLabel(DlgPropsBrowserObject) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_99.sizePolicy().hasHeightForWidth()) + self.label_99.setSizePolicy(sizePolicy) + self.label_99.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label_99.setObjectName("label_99") + self.verticalLayout.addWidget(self.label_99) self.labelName = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.labelName.sizePolicy().hasHeightForWidth()) self.labelName.setSizePolicy(sizePolicy) + self.labelName.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelName.setObjectName("labelName") self.verticalLayout.addWidget(self.labelName) + self.label_4 = QtGui.QLabel(DlgPropsBrowserObject) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) + self.label_4.setSizePolicy(sizePolicy) + self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label_4.setObjectName("label_4") + self.verticalLayout.addWidget(self.label_4) self.labelLinkUrl = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.labelLinkUrl.sizePolicy().hasHeightForWidth()) self.labelLinkUrl.setSizePolicy(sizePolicy) + self.labelLinkUrl.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelLinkUrl.setObjectName("labelLinkUrl") self.verticalLayout.addWidget(self.labelLinkUrl) + self.label_5 = QtGui.QLabel(DlgPropsBrowserObject) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) + self.label_5.setSizePolicy(sizePolicy) + self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) + self.label_5.setObjectName("label_5") + self.verticalLayout.addWidget(self.label_5) self.labelImageUrl = QtGui.QLabel(DlgPropsBrowserObject) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.labelImageUrl.sizePolicy().hasHeightForWidth()) self.labelImageUrl.setSizePolicy(sizePolicy) + self.labelImageUrl.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.labelImageUrl.setObjectName("labelImageUrl") self.verticalLayout.addWidget(self.labelImageUrl) - self.horizontalLayout.addLayout(self.verticalLayout) - self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) + self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) spacerItem = QtGui.QSpacerItem(397, 17, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 1, 0, 1, 1) self.line = QtGui.QFrame(DlgPropsBrowserObject) @@ -129,15 +128,15 @@ def retranslateUi(self, DlgPropsBrowserObject): DlgPropsBrowserObject.setWindowTitle(QtGui.QApplication.translate("DlgPropsBrowserObject", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Type:", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Title:", None, QtGui.QApplication.UnicodeUTF8)) - self.label_99.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "Name:", None, QtGui.QApplication.UnicodeUTF8)) - self.label_4.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "LinkUrl:", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "ImageUrl:", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>Type:</b>", None, QtGui.QApplication.UnicodeUTF8)) self.labeType.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>Title:</b>", None, QtGui.QApplication.UnicodeUTF8)) self.labelTitle.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) + self.label_99.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>Name:</b>", None, QtGui.QApplication.UnicodeUTF8)) self.labelName.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) + self.label_4.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>LinkUrl:</b>", None, QtGui.QApplication.UnicodeUTF8)) self.labelLinkUrl.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "<b>ImageUrl:</b>", None, QtGui.QApplication.UnicodeUTF8)) self.labelImageUrl.setText(QtGui.QApplication.translate("DlgPropsBrowserObject", "unknown", None, QtGui.QApplication.UnicodeUTF8)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-07-25 22:39:29
|
Revision: 747 http://fclient.svn.sourceforge.net/fclient/?rev=747&view=rev Author: jUrner Date: 2008-07-25 22:39:39 +0000 (Fri, 25 Jul 2008) Log Message: ----------- some more icons Added Paths: ----------- trunk/fclient/src/fclient/res/icons/crystal/16x16/button_cancel.png trunk/fclient/src/fclient/res/icons/crystal/48x48/button_cancel.png Property changes on: trunk/fclient/src/fclient/res/icons/crystal/16x16/button_cancel.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: trunk/fclient/src/fclient/res/icons/crystal/48x48/button_cancel.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-25 22:38:56
|
Revision: 746 http://fclient.svn.sourceforge.net/fclient/?rev=746&view=rev Author: jUrner Date: 2008-07-25 22:39:04 +0000 (Fri, 25 Jul 2008) Log Message: ----------- some more options Modified Paths: -------------- trunk/fclient/src/fclient/lib/qt4ex/lib/actions.py Modified: trunk/fclient/src/fclient/lib/qt4ex/lib/actions.py =================================================================== --- trunk/fclient/src/fclient/lib/qt4ex/lib/actions.py 2008-07-25 17:45:32 UTC (rev 745) +++ trunk/fclient/src/fclient/lib/qt4ex/lib/actions.py 2008-07-25 22:39:04 UTC (rev 746) @@ -31,6 +31,7 @@ self._dummyGroups = [] # cheat a bit to always trigger SIGNAL('triggered(QAction*)') def action(self, + parent=None, name=None, text=None, group=None, @@ -39,8 +40,11 @@ isCheckable=False, isChecked=False, isEnabled=True, + shortcut=None, userData=None, ): + """ + """ if group is None: group = QtGui.QActionGroup(self.parent()) self._dummyGroups.append(group) #TODO: is this necessary? @@ -55,12 +59,16 @@ act.setObjectName(name) act.setCheckable(isCheckable) + if parent is not None: + parent.addAction(act) + if icon is not None: act.setIcon(icon) if isCheckable: act.setChecked(isChecked) act.setEnabled(isEnabled) - + if shortcut is not None: + act.setShortcut(shortcut) self._registerAction(name, act) return act This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |