fclient-commit Mailing List for fclient (Page 5)
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-08-03 08:21:47
|
Revision: 870 http://fclient.svn.sourceforge.net/fclient/?rev=870&view=rev Author: jUrner Date: 2008-08-03 08:21:56 +0000 (Sun, 03 Aug 2008) Log Message: ----------- fixed a bug in dls when removing dls (was: ups, QTreeWidgetItemIterator does not work as i expected) Modified Paths: -------------- trunk/fclient/fclient/impl/ViewDownloads.py trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py Modified: trunk/fclient/fclient/impl/ViewDownloads.py =================================================================== --- trunk/fclient/fclient/impl/ViewDownloads.py 2008-08-02 19:33:37 UTC (rev 869) +++ trunk/fclient/fclient/impl/ViewDownloads.py 2008-08-03 08:21:56 UTC (rev 870) @@ -349,18 +349,25 @@ def onRemoveSelectedDownloads(self, action): tree = self.controlById(self.IdTree) - for item in tree.selectedItems(): + selectedItems = tree.selectedItems() + + # remove items + for item in selectedItems: parent = item.parent() if parent is None: parent = tree.invisibleRootItem() - it = treewidgetwrap.TreeWidgetIterator(parent) - it.next() - for tmp_item in it: - del self.fcpRequests[tmp_item.fcpRequest['Identifier']] - config.fcpClient.removeRequest(tmp_item.fcpRequest) - tmp_item.fcpRequest = None parent.removeChild(item) + # cancel all requests + for item in selectedItems: + for tmp_item in treewidgetwrap.walkItem(item): + if tmp_item.fcpRequest is not None: # we may come across the same item multiple times + del self.fcpRequests[tmp_item.fcpRequest['Identifier']] + config.fcpClient.removeRequest(tmp_item.fcpRequest) + tmp_item.fcpRequest = None + + + def onRestartSelectedDownloads(self, action): tree = self.controlById(self.IdTree) for item in tree.selectedItems(): Modified: trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py =================================================================== --- trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py 2008-08-02 19:33:37 UTC (rev 869) +++ trunk/fclient/fclient/impl/lib/qt4ex/treewidgetwrap.py 2008-08-03 08:21:56 UTC (rev 870) @@ -26,3 +26,24 @@ raise StopIteration return value +#*************************************************************************************** +# ups, if my observaions are correct, QTreeWidgetItemIterator handles the tree as list. +#<root> +# <item1> +# <item2> +# +#for i in TreeWidgetIterator(<item1>): item +#<item1> +#<item2> +#for i in TreeWidgetIterator(<item2>): item +#<item2> +# +#thow in a walker to fix this.. +#************************************************************************************** +def walkItem(item): + yield item + for i in xrange(item.childCount()): + child = item.child(i) + for x in walkItem(child): + yield x + \ 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-08-02 19:33:30
|
Revision: 869 http://fclient.svn.sourceforge.net/fclient/?rev=869&view=rev Author: jUrner Date: 2008-08-02 19:33:37 +0000 (Sat, 02 Aug 2008) Log Message: ----------- more todos Modified Paths: -------------- trunk/fclient/fclient/impl/ViewBrowser.py Modified: trunk/fclient/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 19:16:23 UTC (rev 868) +++ trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 19:33:37 UTC (rev 869) @@ -12,7 +12,7 @@ # 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. 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 @@ -26,13 +26,16 @@ # x. looks like on error loading page reload does not work # x. when loading a page, until fproxy reacts reload is enabled instead of stop. hitting reloading will trigger an error # page, but reloads the current page as expected. no idea how to handle error page poping up. -# x. icons on find bar push button text tio the side. no idea +# x. icons on find bar push button text tio the side. no idea so far # x. on find action, give feedback when no matching text was found on page # x. some shortcuts for actions are still missing # x. rework to support dynamic retranslation # x. tooltips for tabs showing truncated title # x. reduce tab width when many tabs are open to allow for more tabs being visible -# x. tab context menu: "Close all tabs" is a bit of a trap. maybe remove it +# x. tab context menu: "Close all tabs" is a bit of a trap. maybe remove or place it on the very bottom once we have +# more menu entries +# x. dropping. accept keys +1. what else to accept? +# x. option to upload content from browser? "upload current page" / image ..whatevs #****************************************************************************************** """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 19:16:16
|
Revision: 868 http://fclient.svn.sourceforge.net/fclient/?rev=868&view=rev Author: jUrner Date: 2008-08-02 19:16:23 +0000 (Sat, 02 Aug 2008) Log Message: ----------- whitespace Modified Paths: -------------- trunk/fclient/fclient/impl/ViewLogger.py Modified: trunk/fclient/fclient/impl/ViewLogger.py =================================================================== --- trunk/fclient/fclient/impl/ViewLogger.py 2008-08-02 19:15:44 UTC (rev 867) +++ trunk/fclient/fclient/impl/ViewLogger.py 2008-08-02 19:16:23 UTC (rev 868) @@ -184,7 +184,6 @@ ######################################### def addRecord(self, record): """adds a logging record""" - ed = self.controlById(self.IdEdLogger) fmt = ed.currentCharFormat() colorFg = self.fcSettings.value(self.fcSettings.PrefixVerbosityColorFg + record.levelname) @@ -193,12 +192,10 @@ text = '%s:%s:%s' % (record.levelname, record.name, record.getMessage()) ed.appendPlainText(text) - - + def controlById(self, idControl): return getattr(self, idControl) - def populateMenu(self, menu): menu.addAction(self.fcActions['ActionLoggerClear']) subMenu = menu.addMenu(self.trUtf8('Verbosity')) @@ -229,12 +226,10 @@ menu = ed.createStandardContextMenu() self.populateMenu(menu) menu.exec_(event.globalPos()) - - + def hideEvent(self, event): self.fcGlobalFeedback.setVisible(False) - - + def showEvent(self, event): self.fcGlobalFeedback.setVisible(True) if self._isCreated: @@ -247,13 +242,11 @@ def onActionLoggerClear(self, action): self.controlById(self.IdEdLogger).clear() - def onGroupVerbosityTriggered(self, action): nameVerbosity = action.objectName()[len(self.fcActions.PrefixVerbosity):] self.fcSettings.setValues(Verbosity=nameVerbosity) logging.getLogger().setLevel(action.userData()) - - + def onLoggerTextChanged(self): ed = self.controlById(self.IdEdLogger) self.fcActions['ActionLoggerClear'].setEnabled(not ed.document().isEmpty()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 19:15:38
|
Revision: 867 http://fclient.svn.sourceforge.net/fclient/?rev=867&view=rev Author: jUrner Date: 2008-08-02 19:15:44 +0000 (Sat, 02 Aug 2008) Log Message: ----------- don't query config. not necessary Modified Paths: -------------- trunk/fclient/fclient/impl/ViewConnection.py Modified: trunk/fclient/fclient/impl/ViewConnection.py =================================================================== --- trunk/fclient/fclient/impl/ViewConnection.py 2008-08-02 19:08:59 UTC (rev 866) +++ trunk/fclient/fclient/impl/ViewConnection.py 2008-08-02 19:15:44 UTC (rev 867) @@ -4,17 +4,6 @@ # # #********************************************************************* -#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__)] @@ -139,10 +128,6 @@ 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 19:08:52
|
Revision: 866 http://fclient.svn.sourceforge.net/fclient/?rev=866&view=rev Author: jUrner Date: 2008-08-02 19:08:59 +0000 (Sat, 02 Aug 2008) Log Message: ----------- handle reload when fproxy could not be reached ++ some more notes Modified Paths: -------------- trunk/fclient/fclient/impl/ViewBrowser.py Modified: trunk/fclient/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 13:22:20 UTC (rev 865) +++ trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 19:08:59 UTC (rev 866) @@ -335,8 +335,13 @@ self.action( name='ActionReload', text=self.trUtf8('Reload'), - trigger=None, + #EXPERIMENTAL: we handle it, cos page.url() is empty if fproxy did not respond. + # for some reason QWebView has "Reload" enabled in this case. we keep track of + # the last known url and reload it manually. hope we don't get into trouble with + # this. NOTE: we may have to do this for other actions aswell + trigger=parent.onBrowserReloadTriggered, isEnabled=False, + #TODO: how to assign QKeySequence.Refresh and* F5 ? shortcut=QtGui.QKeySequence(QtGui.QKeySequence.Refresh), icon=config.fcResources.getIcon('reload_page', iconSize, iconTheme=iconTheme), userData=(None, None), @@ -441,8 +446,17 @@ class BrowserTabBar(QtGui.QTabBar): """customized tabBar to show progress indicstor on tabs""" + #EXPERIMENTAL: to show progressBar at 100% use a timer to clear it after + # a short delay. current implementation may pile up timers, not doing any + # harm to the progressBar though. we'd have to remove all obsolete timers + # (user hitting links like crazy), but no idea if we may run into strange race + # conditions + # + #NOTE: excessive link hitting will trigger a Qt unhandled sooner or later: + # >>> QAbstractSocket::connectToHost() called when already connecting/connected + # ...looks like we're not alone when it comes to race conditions :-) class ClearProgressbarTimer(QtCore.QTimer): - + def __init__(self, parent, lastBrowserState): QtCore.QTimer.__init__(self, parent) self.lastBrowserState = lastBrowserState @@ -912,6 +926,13 @@ lastBrowserState.statusMessage = self.trUtf8('Loading') tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Loading'))) + def onBrowserReloadTriggered(self, action): + browser = self.currentBrowser() + if browser is not None: + if browser.url().toString().isEmpty(): + url = browser.userData().url + self.load(url, browser=browser) + def onBrowserStatusBarMessage(self, qString): browser = self.sender() qString = QtCore.QString(qString) # copy it - qt nukes it on return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 13:22:11
|
Revision: 865 http://fclient.svn.sourceforge.net/fclient/?rev=865&view=rev Author: jUrner Date: 2008-08-02 13:22:20 +0000 (Sat, 02 Aug 2008) Log Message: ----------- trying to speed up browser on gui start Modified Paths: -------------- trunk/fclient/fclient/impl/ViewBrowser.py Modified: trunk/fclient/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 13:21:29 UTC (rev 864) +++ trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 13:22:20 UTC (rev 865) @@ -557,7 +557,7 @@ self.connect(ed, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFindTextChanged) frameFind = self.controlById(self.IdFrameFind) frameFind.setVisible(False) - + ######################################### ## private methods ######################################### @@ -787,7 +787,9 @@ if not self.isCreated: self.isCreated = True # fire up a new broser to make a start + #TODO: find a better time to fire up the browser. how do we know when the gui is up and running? self.newBrowser(title=self.trUtf8('Waiting for fproxy')) + QtGui.QApplication.instance().processEvents() self.fcActions['ActionGoToHomePage'].trigger() def viewClose(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 13:21:20
|
Revision: 864 http://fclient.svn.sourceforge.net/fclient/?rev=864&view=rev Author: jUrner Date: 2008-08-02 13:21:29 +0000 (Sat, 02 Aug 2008) Log Message: ----------- save geometry of signle app error dlg Modified Paths: -------------- trunk/fclient/fclient/fclient.py trunk/fclient/fclient/impl/config.py Modified: trunk/fclient/fclient/fclient.py =================================================================== --- trunk/fclient/fclient/fclient.py 2008-08-02 11:37:20 UTC (rev 863) +++ trunk/fclient/fclient/fclient.py 2008-08-02 13:21:29 UTC (rev 864) @@ -52,18 +52,22 @@ magicToRespond='{2e86f6f1-0707-415d-bfe6-6d485603a98c}' ) try: + #raise singleapp.ErrorCanNotConnect() #<-- uncomment for testing DlgSingleAppError() singleApp.start() + except singleapp.ErrorOtherAppIsRunning: print 'looks like another %s application is already running' % config.FcAppName print 'exit' sys.exit(5) + except singleapp.ErrorCanNotConnect: app = QtGui.QApplication(sys.argv) dlg = DlgSingleAppError() + dlg.restoreGeometry(config.fcSettings.value('DlgSingleAppErrorGeometry')) dlg.exec_() - - else: - # start gui + config.fcSettings.setValues(DlgSingleAppErrorGeometry=dlg.saveGeometry()) + + else: # everything went well. start gui app = QtGui.QApplication(sys.argv) mainWindow = MainWindow() singleApp.userData = mainWindow Modified: trunk/fclient/fclient/impl/config.py =================================================================== --- trunk/fclient/fclient/impl/config.py 2008-08-02 11:37:20 UTC (rev 863) +++ trunk/fclient/fclient/impl/config.py 2008-08-02 13:21:29 UTC (rev 864) @@ -103,6 +103,8 @@ class Settings(SettingsBase): _key_ = 'ConfigSettings' _settings_ = ( + ('DlgSingleAppErrorGeometry', 'ByteArray', QtCore.QByteArray(), SettingScopePrivate), + ('Version', 'String', QtCore.QString(FcVersion), SettingScopePrivate), ('SingleAppHost', 'String', QtCore.QString('localhost'), SettingScopeExpert), ('SingleAppPort', 'UInt', 45663, SettingScopeExpert), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 11:37:11
|
Revision: 863 http://fclient.svn.sourceforge.net/fclient/?rev=863&view=rev Author: jUrner Date: 2008-08-02 11:37:20 +0000 (Sat, 02 Aug 2008) Log Message: ----------- more notes Modified Paths: -------------- trunk/fclient/fclient/impl/ViewBrowser.py Modified: trunk/fclient/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 11:36:56 UTC (rev 862) +++ trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 11:37:20 UTC (rev 863) @@ -32,6 +32,7 @@ # x. rework to support dynamic retranslation # x. tooltips for tabs showing truncated title # x. reduce tab width when many tabs are open to allow for more tabs being visible +# x. tab context menu: "Close all tabs" is a bit of a trap. maybe remove it #****************************************************************************************** """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 11:36:47
|
Revision: 862 http://fclient.svn.sourceforge.net/fclient/?rev=862&view=rev Author: jUrner Date: 2008-08-02 11:36:56 +0000 (Sat, 02 Aug 2008) Log Message: ----------- throw in logger last Modified Paths: -------------- trunk/fclient/fclient/fclient.py Modified: trunk/fclient/fclient/fclient.py =================================================================== --- trunk/fclient/fclient/fclient.py 2008-08-02 11:36:24 UTC (rev 861) +++ trunk/fclient/fclient/fclient.py 2008-08-02 11:36:56 UTC (rev 862) @@ -1,4 +1,7 @@ - +#********************************************************************* +#TODO: +# +#********************************************************************* 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__)] @@ -67,12 +70,12 @@ viewWidget = ViewWidget(mainWindow) mainWindow.setCentralWidget(viewWidget) - viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) viewWidget.addTopViews( ViewConnectionWidget(mainWindow), ViewBrowserWidget(mainWindow), ViewDownloadsWidget(mainWindow), ) + viewWidget.addBottomViews(ViewLoggerWidget(mainWindow)) mainWindow.show() res = app.exec_() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 11:36:14
|
Revision: 861 http://fclient.svn.sourceforge.net/fclient/?rev=861&view=rev Author: jUrner Date: 2008-08-02 11:36:24 +0000 (Sat, 02 Aug 2008) Log Message: ----------- title bar support Modified Paths: -------------- trunk/fclient/fclient/impl/config.py Modified: trunk/fclient/fclient/impl/config.py =================================================================== --- trunk/fclient/fclient/impl/config.py 2008-08-02 11:35:59 UTC (rev 860) +++ trunk/fclient/fclient/impl/config.py 2008-08-02 11:36:24 UTC (rev 861) @@ -137,6 +137,7 @@ self.id = idGlobalFeedback self.menuBar = None self.statusBar = None + self.titleBar = None feedbackParent = ObjectRegistry.get(idGlobalFeedback, None) if feedbackParent is not None: @@ -146,6 +147,9 @@ mthd = getattr(feedbackParent, 'statusBar', None) if mthd is not None: self.statusBar = mthd() + mthd = getattr(feedbackParent, 'titleBar', None) + if mthd is not None: + self.titleBar = mthd() def setVisible(self, flag): pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 11:35:50
|
Revision: 860 http://fclient.svn.sourceforge.net/fclient/?rev=860&view=rev Author: jUrner Date: 2008-08-02 11:35:59 +0000 (Sat, 02 Aug 2008) Log Message: ----------- add app icon Modified Paths: -------------- trunk/fclient/fclient/impl/MainWindow.py Modified: trunk/fclient/fclient/impl/MainWindow.py =================================================================== --- trunk/fclient/fclient/impl/MainWindow.py 2008-08-02 11:35:44 UTC (rev 859) +++ trunk/fclient/fclient/impl/MainWindow.py 2008-08-02 11:35:59 UTC (rev 860) @@ -76,7 +76,6 @@ return menu - class StatusBar(QtGui.QStatusBar): def __init__(self, parent): @@ -85,6 +84,19 @@ #config.ObjectRegistry.register(self) parent.setStatusBar(self) +class TitleBar(QtCore.QObject): + + def __init__(self, parent): + QtCore.QObject.__init__(self, parent) + self.setInfo('') + + def setInfo(self, text): + if text: + title = config.FcAppName + ' - [%s]' % text + else: + title = config.FcAppName + self.parent().setWindowTitle(title) + #********************************************************************************** # #********************************************************************************** @@ -101,24 +113,32 @@ self.fcActions = Actions(self) self.setMenuBar(MenuBar(self)) self.setStatusBar(StatusBar(self)) + self.fcTitleBar = TitleBar(self) + self.setWindowIcon(config.fcResources.getIcon('fclient', 32, iconTheme='application', ext='.svg')) self.restoreGeometry(self.fcSettings.value('Geometry')) - ################################################## + ################################## + ## methods + ################################## + def titleBar(self): + return self.fcTitleBar + + + ################################## ## events - ################################################## + ################################## def closeEvent(self, event): self.fcSettings.setValues(Geometry=self.saveGeometry()) - - + def showEvent(self, event): if self._isCreated: return self._isCreated = True - ################################################## + ################################### ## event onrs - ################################################## + ################################### def onActPreferencesTriggered(self): dlg = Prefs.PrefsDlg(self) 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-08-02 11:35:34
|
Revision: 859 http://fclient.svn.sourceforge.net/fclient/?rev=859&view=rev Author: jUrner Date: 2008-08-02 11:35:44 +0000 (Sat, 02 Aug 2008) Log Message: ----------- throw in support for icon filename extensions Modified Paths: -------------- trunk/fclient/fclient/impl/lib/qt4ex/lib/resources.py Modified: trunk/fclient/fclient/impl/lib/qt4ex/lib/resources.py =================================================================== --- trunk/fclient/fclient/impl/lib/qt4ex/lib/resources.py 2008-08-02 11:35:11 UTC (rev 858) +++ trunk/fclient/fclient/impl/lib/qt4ex/lib/resources.py 2008-08-02 11:35:44 UTC (rev 859) @@ -64,13 +64,13 @@ return out - def getIconPath(self, name, size, iconTheme=None): + def getIconPath(self, name, size, iconTheme=None, ext='.png'): size = '%sx%s' % (size, size) iconDir = 'icons' if iconTheme is not None: iconDir = os.path.join(unicode(iconDir), unicode(iconTheme)) for resourceDir in self._resourceDirs: - fpath = os.path.join(unicode(resourceDir), unicode(iconDir), size, unicode(name) + '.png') + fpath = os.path.join(unicode(resourceDir), unicode(iconDir), size, unicode(name) + ext) if os.path.isfile(fpath): return fpath return None @@ -88,7 +88,7 @@ return '%s\x00%s\x00%s' % (iconTheme, size, name) - def getIcon(self, name, size, iconTheme=None): + def getIcon(self, name, size, iconTheme=None, ext='.png'): """ @param name: name of the icon (no ext) @param size: (int) size of the icon @@ -101,7 +101,7 @@ iconId = self.makeIconId(size, name, iconTheme=iconTheme) ico = self.iconCache.get(iconId, None) if ico is None: - fpath = self.getIconPath(name, size, iconTheme=iconTheme) + fpath = self.getIconPath(name, size, iconTheme=iconTheme, ext=ext) if fpath is None: ico = QtGui.QIcon() else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 11:35:03
|
Revision: 858 http://fclient.svn.sourceforge.net/fclient/?rev=858&view=rev Author: jUrner Date: 2008-08-02 11:35:11 +0000 (Sat, 02 Aug 2008) Log Message: ----------- placeholder application icon Added Paths: ----------- trunk/fclient/fclient/impl/res/icons/application/ trunk/fclient/fclient/impl/res/icons/application/32x32/ trunk/fclient/fclient/impl/res/icons/application/32x32/fclient.svg Added: trunk/fclient/fclient/impl/res/icons/application/32x32/fclient.svg =================================================================== --- trunk/fclient/fclient/impl/res/icons/application/32x32/fclient.svg (rev 0) +++ trunk/fclient/fclient/impl/res/icons/application/32x32/fclient.svg 2008-08-02 11:35:11 UTC (rev 858) @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="640" + height="640" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + version="1.0" + sodipodi:docname="fclient.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective10" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="350" + inkscape:cy="520" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="777" + inkscape:window-height="824" + inkscape:window-x="239" + inkscape:window-y="60" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Ebene 1" + inkscape:groupmode="layer" + id="layer1"> + <path + sodipodi:type="arc" + style="opacity:0.7;fill:#d40000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path2383" + sodipodi:cx="122.85714" + sodipodi:cy="384.28571" + sodipodi:rx="105.71429" + sodipodi:ry="164.28572" + d="M 228.57143,384.28571 A 105.71429,164.28572 0 1 1 17.142853,384.28571 A 105.71429,164.28572 0 1 1 228.57143,384.28571 z" + transform="matrix(1.7280066,0,0,1.077152,244.8449,28.922974)" /> + <path + sodipodi:type="arc" + style="opacity:0.7;fill:#0000ff" + id="path2385" + sodipodi:cx="361.42856" + sodipodi:cy="148.57143" + sodipodi:rx="32.857143" + sodipodi:ry="20" + d="M 394.2857,148.57143 A 32.857143,20 0 1 1 328.57141,148.57143 A 32.857143,20 0 1 1 394.2857,148.57143 z" + transform="matrix(5.521739,0,0,8.8571429,-1617.1428,-1133.0612)" /> + <path + sodipodi:type="arc" + style="opacity:0.6;fill:#ffff00" + id="path2387" + sodipodi:cx="100" + sodipodi:cy="138.57143" + sodipodi:rx="31.428572" + sodipodi:ry="44.285713" + d="M 131.42857,138.57143 A 31.428572,44.285713 0 1 1 68.571428,138.57143 A 31.428572,44.285713 0 1 1 131.42857,138.57143 z" + transform="matrix(5.9545454,0,0,4.0645162,-374.02598,-180.36867)" /> + </g> +</svg> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 10:31:24
|
Revision: 857 http://fclient.svn.sourceforge.net/fclient/?rev=857&view=rev Author: jUrner Date: 2008-08-02 10:31:31 +0000 (Sat, 02 Aug 2008) Log Message: ----------- give DlgPrefs a name Modified Paths: -------------- trunk/fclient/fclient/impl/Prefs.py trunk/fclient/fclient/impl/config.py Modified: trunk/fclient/fclient/impl/Prefs.py =================================================================== --- trunk/fclient/fclient/impl/Prefs.py 2008-08-02 10:21:41 UTC (rev 856) +++ trunk/fclient/fclient/impl/Prefs.py 2008-08-02 10:31:31 UTC (rev 857) @@ -15,7 +15,7 @@ # #********************************************************************************** class Settings(config.SettingsBase): - _key_ = config.IdViewBrowserWidget + _key_ = config.IdDlgPrefs _settings_ = ( ('DlgState', 'String', '', config.SettingScopePrivate), ) @@ -53,7 +53,6 @@ class PrefsDlg(dlgpreferences.DlgPreferencesFlatTree): def __init__(self, parent): - pages = PrefsPageRoot()( PrefsPageGlobal(), PrefsPageConnectionExpertSettings() @@ -62,12 +61,12 @@ ), PrefsPageBrowser(), ) - dlgpreferences.DlgPreferencesFlatTree.__init__(self, parent, pages=pages, startPage=PrefsPageGlobal.UUID, ) + self.setObjectName(config.IdDlgPrefs) self.fcSettings = Settings(self).restore() Modified: trunk/fclient/fclient/impl/config.py =================================================================== --- trunk/fclient/fclient/impl/config.py 2008-08-02 10:21:41 UTC (rev 856) +++ trunk/fclient/fclient/impl/config.py 2008-08-02 10:31:31 UTC (rev 857) @@ -44,6 +44,7 @@ IdViewCDownloadsWidget = 'ViewDownloadsWidget' IdViewLoggerWidget = 'ViewDownloadsWidget' IdViewLoggerWidget = 'ViewLoggerWidget' +IdDlgPrefs = 'DlgPrefs' class ObjectRegistry(weakref.WeakValueDictionary): @@ -102,6 +103,7 @@ class Settings(SettingsBase): _key_ = 'ConfigSettings' _settings_ = ( + ('Version', 'String', QtCore.QString(FcVersion), SettingScopePrivate), ('SingleAppHost', 'String', QtCore.QString('localhost'), SettingScopeExpert), ('SingleAppPort', 'UInt', 45663, SettingScopeExpert), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 10:21:32
|
Revision: 856 http://fclient.svn.sourceforge.net/fclient/?rev=856&view=rev Author: jUrner Date: 2008-08-02 10:21:41 +0000 (Sat, 02 Aug 2008) Log Message: ----------- ups, left over test code Modified Paths: -------------- trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py Modified: trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py =================================================================== --- trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-08-02 10:06:52 UTC (rev 855) +++ trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-08-02 10:21:41 UTC (rev 856) @@ -713,7 +713,6 @@ out = QtCore.QString() while True: out.prepend(page.displayName() + '/') - test.append(page) if page.isRoot(): break page = page.parent() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 10:06:43
|
Revision: 855 http://fclient.svn.sourceforge.net/fclient/?rev=855&view=rev Author: jUrner Date: 2008-08-02 10:06:52 +0000 (Sat, 02 Aug 2008) Log Message: ----------- more work on connection widget Modified Paths: -------------- trunk/fclient/fclient/impl/ViewConnection.py Modified: trunk/fclient/fclient/impl/ViewConnection.py =================================================================== --- trunk/fclient/fclient/impl/ViewConnection.py 2008-08-02 09:44:44 UTC (rev 854) +++ trunk/fclient/fclient/impl/ViewConnection.py 2008-08-02 10:06:52 UTC (rev 855) @@ -1,13 +1,9 @@ #********************************************************************* #TODO: -# x. setting fcp connection params currently won't reset connection. how to handle? +# x. setting fcp/fproxy connection params currently won't reset connection. how to handle? # # #********************************************************************* - - - -#********************************************************************* #NOTES: # # current handling is: @@ -127,6 +123,8 @@ def start(self, settings): config.fcpClient.setConnectionName(settings.value('FcpConnectionName')) self.fcpIterConnect = config.fcpClient.iterConnect( + host=settings.value('FcpConnectionHost'), + port=settings.value('FcpConnectionPort'), duration=settings.value('FcpConnectionTimerMaxDuration'), timeout=0 ) @@ -179,7 +177,13 @@ def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): QtGui.QWidget.__init__(self, parent) self.setupUi(self) - + + # adjust spin box ranges + spinPort = self.controlById(self.IdFcpSpinFcpConnectionPort) + spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable + spinPort = self.controlById(self.IdFproxySpinConnectionPort) + spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable + self._isCreated = False config.ObjectRegistry.register(self) self.fcSettings = Settings(self).restore() @@ -236,29 +240,21 @@ return self._isCreated = True - - - # setup fcp host / port / name - edHost = self.controlById(self.IdEdFcpConnectionHost) - self.connect(edHost, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionHostChanged) - - spinPort = self.controlById(self.IdFcpSpinFcpConnectionPort) - spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable - self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFcpConnectionPortChanged) - doAutoConnect = self.fcSettings.value('FcpAutoConnect') ck = self.controlById(self.IdCkFcpAutoConnect) ck.setChecked(doAutoConnect) self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged) + spinPort = self.controlById(self.IdFcpSpinFcpConnectionPort) + self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFcpConnectionPortChanged) + + spinPort = self.controlById(self.IdFproxySpinConnectionPort) + self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFproxyConnectionPortChanged) + # setup fproxy host / port edHost = self.controlById(self.IdEdFproxyConnectionHost) 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 - 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: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 09:44:36
|
Revision: 854 http://fclient.svn.sourceforge.net/fclient/?rev=854&view=rev Author: jUrner Date: 2008-08-02 09:44:44 +0000 (Sat, 02 Aug 2008) Log Message: ----------- add separator Modified Paths: -------------- trunk/fclient/fclient/impl/View.py Modified: trunk/fclient/fclient/impl/View.py =================================================================== --- trunk/fclient/fclient/impl/View.py 2008-08-02 09:42:45 UTC (rev 853) +++ trunk/fclient/fclient/impl/View.py 2008-08-02 09:44:44 UTC (rev 854) @@ -198,6 +198,7 @@ """populates a menu with actions the view widget defines""" menu.addAction(self.fcActions['ActionShowTopTabBar']) menu.addAction(self.fcActions['ActionShowBottomTabBar']) + menu.addSeparator() menu.addMenu(self.menuGoToTopView) menu.addMenu(self.menuGoToBottomView) return menu This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 09:42:36
|
Revision: 853 http://fclient.svn.sourceforge.net/fclient/?rev=853&view=rev Author: jUrner Date: 2008-08-02 09:42:45 +0000 (Sat, 02 Aug 2008) Log Message: ----------- more bells Modified Paths: -------------- trunk/fclient/fclient/impl/View.py Modified: trunk/fclient/fclient/impl/View.py =================================================================== --- trunk/fclient/fclient/impl/View.py 2008-08-02 09:41:53 UTC (rev 852) +++ trunk/fclient/fclient/impl/View.py 2008-08-02 09:42:45 UTC (rev 853) @@ -1,9 +1,7 @@ -#FIXES #*************************************************************************** -# [0001] +#TODO: # -# QTabWidget.closeEvent() does not seem to propagate close events -# to child widgets +# x. shortcuts for "Go to" menus and items # # #*************************************************************************** @@ -21,7 +19,7 @@ #********************************************************************************** # #********************************************************************************** -class Actions(config.ActionsBase): +class ViewActions(config.ActionsBase): def __init__(self, parent): config.ActionsBase.__init__(self, parent) @@ -33,8 +31,14 @@ isCheckable=True, isChecked=True, ) - - + self.action( + name='ActionShowBottomTabBar', + text=self.trUtf8('Show bottom &tabs'), + trigger=parent.onActionShowTabsBottom, + isCheckable=True, + isChecked=True, + ) + class GlobalFeedback(config.GlobalFeedbackBase): """wrapper for global statusbar widgets, menus""" @@ -42,19 +46,17 @@ config.GlobalFeedbackBase.__init__(self, parent, idGlobalFeedback) # menus - self.menus = [] + self.menu = None 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) + self.menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar) + parent.populateMenu(self.menu) + self.menuBar.addViewMenu(self.menu) def setVisible(self, flag): - for menu in self.menus: - menu.children()[0].setVisible(flag) + if self.menu is not None: + self.menu.children()[0].setEnabled(flag) - class Settings(config.SettingsBase): _key_ = config.IdViewWidget _settings_ = ( @@ -62,10 +64,11 @@ ('LastViewBottom', 'String', '', config.SettingScopePrivate), ('SplitterPos', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), ('ShowTopTabBar', 'Bool', True, config.SettingScopePrivate), + ('ShowBottomTabBar', 'Bool', True, config.SettingScopePrivate), ) -class ViewObject(config.ViewObject): +class ViewViewObject(config.ViewObject): def __init__(self, parent): config.ViewObject. __init__(self, parent) @@ -74,6 +77,17 @@ self.displayName=self.trUtf8('View') self.icon=QtGui.QIcon() + +class ViewData(object): + """data structure to hold data for a view""" + + def __init__(self, tab, view): + self.tab = tab + self.view = view + self.actions = { + 'ActionGoTo': None, + } + #*********************************************************************** # #*********************************************************************** @@ -82,22 +96,30 @@ IdSplitter = 'splitter' IdTabTop = 'tabTop' IdTabBottom = 'tabBottom' - def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): QtGui.QWidget.__init__(self, parent) - self._isCreated = False + # setup ui + self.isCreated = False + self.menuGoToTopView = QtGui.QMenu(self) + self.menuGoToBottomView = QtGui.QMenu(self) + self.setupUi(self) - self.views = {} - - self.setupUi(self) + # setup ... config.ObjectRegistry.register(self) - self.fcActions = Actions(self) + self.fcActions = ViewActions(self) self.fcSettings = Settings().restore() - self.fcViewObject = ViewObject(self) + self.fcViewObject = ViewViewObject(self) self.fcGlobalFeedback = GlobalFeedback(self, idGlobalFeedback) + # setup views + self.viewData = {} # viewName --> ViewData + self.actionGroupGoToTopView = QtGui.QActionGroup(self.menuGoToTopView) + self.actionGroupGoToTopView.setExclusive(True) + self.actionGroupGoToBottomView = QtGui.QActionGroup(self.menuGoToBottomView) + self.actionGroupGoToBottomView.setExclusive(True) + # setup tab widgets tabWidgetTop = self.controlById(self.IdTabTop) tabWidgetTop.removeTab(0) @@ -109,120 +131,180 @@ 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) - - + ################################### + ## private methods + ################################### def _addViews(self, toTop, *views): + """private method to add one or more views ro bottom or top tabs""" tabWidget = self.controlById(self.IdTabTop) if toTop else self.controlById(self.IdTabBottom) for view in views: - name = view.fcViewObject.name - if not name: + viewName = view.fcViewObject.name + if not viewName: raise ValueError('view must have a name') - if name in self.views: - raise ValueError('view with that name is already present: %s' % name) + if viewName in self.viewData: + raise ValueError('view with that name is already present: %s' % viewName) view.setParent(tabWidget) - i = tabWidget.addTab(view, view.fcViewObject.icon, view.fcViewObject.displayName) - self.views[name] = (tabWidget, view) - + tabWidget.addTab(view, view.fcViewObject.icon, view.fcViewObject.displayName) + self.viewData[viewName] = viewData = ViewData(tabWidget, view) + + # add some actions dynamically + menu = self.menuGoToTopView if toTop else self.menuGoToBottomView + actionGroup = self.actionGroupGoToTopView if toTop else self.actionGroupGoToBottomView + act = QtGui.QAction(actionGroup) + act.setObjectName(viewName) + act.setText(view.fcViewObject.displayName) + act.setCheckable(True) + self.connect(act, QtCore.SIGNAL('triggered()'), self.onActionGoToView) + viewData.actions['ActionGoTo'] = act + menu.addAction(act) + actionGroup.addAction(act) #tab.tabBar().setVisible(tab.count() > 1) - + ################################### + ## overwritten methods + ################################### + def retranslateUi(self, me): + Ui_ViewWidget.retranslateUi(self, me) + self.menuGoToTopView.setTitle(self.trUtf8('Top go to')) + self.menuGoToBottomView.setTitle(self.trUtf8('Bottom go to')) + + ################################### + ## methods + ################################### def addBottomViews(self, *views): + """adds one or more L{View}s to the bottom area of the view widget""" return self._addViews(False, *views) - def addTopViews(self, *views): + """adds one or more L{View}s to the top area of the view widget""" return self._addViews(True, *views) + def controlById(self, idControl): + return getattr(self, idControl) + + def currentView(self, top=True): + """returns the name of the current view + @param top: if True, returns the name of the current view on the top tabWidget, else the name + of current view on the bottom tabWidget + @return: (QString) name or None + """ + tabWidget = self.controlById(self.IdTabTop) if top else self.controlById(self.IdTabBottom) + view = tabWidget.currentWidget() + if view is not None: + return view.objectName() + return None def populateMenu(self, menu): + """populates a menu with actions the view widget defines""" menu.addAction(self.fcActions['ActionShowTopTabBar']) + menu.addAction(self.fcActions['ActionShowBottomTabBar']) + menu.addMenu(self.menuGoToTopView) + menu.addMenu(self.menuGoToBottomView) 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] + """sets the current view on the tabWidgtes given the views name + @return: Lname of the current view or None + """ + viewData = self.viewData.get(name, None) + if viewData is not None: + viewData.tab.setCurrentWidget(viewData.view) + return name return None + + def viewDataFromName(self, name): + """returns L{ViewData} associated to a view + @param name: (QString) name of the view + @return: L{ViewData} or None + """ + viewData = self.viewData.get(name, None) + if viewData is not None: + return viewData + return None ######################################################### - ## + ## overwritten events ######################################################### + def closeEvent(self, event): + for viewData in self.viewData.values(): + viewData.view.viewClose() + 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: + if self.isCreated: return - self._isCreated = True + self.isCreated = True - # restore current views + # restore last selected views (could be costy, so do it here) tabWidgetTop = self.controlById(self.IdTabTop) - lastName = self.fcSettings.value('LastViewTop') - self.setCurrentView(lastName) + viewName = self.fcSettings.value('LastViewTop') + viewName = self.setCurrentView(viewName) + if viewName is None: + viewName = self.currentView(top=True) + if viewName is not None: + viewData = self.viewDataFromName(viewName) + viewData.actions['ActionGoTo'].setChecked(True) tabWidgetBottom = self.controlById(self.IdTabBottom) - lastName = self.fcSettings.value('LastViewBottom') - self.setCurrentView(lastName) + viewName = self.fcSettings.value('LastViewBottom') + viewName = self.setCurrentView(viewName) + if viewName is None: + viewName = self.currentView(top=False) + if viewName is not None: + viewData = self.viewDataFromName(viewName) + viewData.actions['ActionGoTo'].setChecked(True) # finally connect... not to overwrite settings self.connect(tabWidgetTop, QtCore.SIGNAL('currentChanged(int)'), self.onTabTopCurrentChanged) self.connect(tabWidgetBottom, QtCore.SIGNAL('currentChanged(int)'), self.onTabBottomCurrentChanged) - ######################################################### - ## - ######################################################### + # adjust tabWidgets + showTopTabBar = self.fcSettings.value('ShowTopTabBar') + self.fcActions['ActionShowTopTabBar'].setChecked(showTopTabBar) + tabWidgetTop.tabBar().setVisible(showTopTabBar) + + showBottomTabBar = self.fcSettings.value('ShowBottomTabBar') + self.fcActions['ActionShowBottomTabBar'].setChecked(showBottomTabBar) + tabWidgetBottom.tabBar().setVisible(showBottomTabBar) + + + ################################## + ## event handlers + ################################## + def onActionGoToView(self): + act = self.sender() + viewData = self.viewData[act.objectName()] + viewData.tab.setCurrentWidget(viewData.view) + + def onActionShowTabsBottom(self, action): + tabWidgetTop = self.controlById(self.IdTabBottom) + tabWidgetTop.tabBar().setVisible(action.isChecked()) + self.fcSettings.setValues(ShowBottomTabBar=action.isChecked()) + 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() + viewData = self.viewData[view.objectName()] + viewData.actions['ActionGoTo'].setChecked(True) self.fcSettings.setValues(LastViewTop=view.fcViewObject.name) - def onTabBottomCurrentChanged(self, index): tab = self.controlById(self.IdTabBottom) view = tab.currentWidget() + viewData = self.viewData[view.objectName()] + viewData.actions['ActionGoTo'].setChecked(True) self.fcSettings.setValues(LastViewBottom=view.fcViewObject.name) #********************************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 09:41:44
|
Revision: 852 http://fclient.svn.sourceforge.net/fclient/?rev=852&view=rev Author: jUrner Date: 2008-08-02 09:41:53 +0000 (Sat, 02 Aug 2008) Log Message: ----------- fixed context menu pos Modified Paths: -------------- trunk/fclient/fclient/impl/ViewBrowser.py Modified: trunk/fclient/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 09:41:20 UTC (rev 851) +++ trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 09:41:53 UTC (rev 852) @@ -30,6 +30,8 @@ # x. on find action, give feedback when no matching text was found on page # x. some shortcuts for actions are still missing # x. rework to support dynamic retranslation +# x. tooltips for tabs showing truncated title +# x. reduce tab width when many tabs are open to allow for more tabs being visible #****************************************************************************************** """ @@ -799,6 +801,7 @@ frame = browser.page().currentFrame() page = browser.page() hitTestResult = frame.hitTestContent(pt) + pt = browser.mapToGlobal(pt) #if not hitTest.isNull(): #TODO: looks like hitTest.isNull() alwas returns True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 09:41:10
|
Revision: 851 http://fclient.svn.sourceforge.net/fclient/?rev=851&view=rev Author: jUrner Date: 2008-08-02 09:41:20 +0000 (Sat, 02 Aug 2008) Log Message: ----------- looks like a comb-over is necessary Modified Paths: -------------- trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py Modified: trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py =================================================================== --- trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-08-02 00:01:59 UTC (rev 850) +++ trunk/fclient/fclient/impl/lib/qt4ex/dlgpreferences.py 2008-08-02 09:41:20 UTC (rev 851) @@ -16,6 +16,7 @@ # x. maybe call close on all pages to allow for cleanup # x. maybe weakref this thingy # x. user hits apply then hits cancel. can't tell from the top of my head ...should we undo changes? +# x. path to page (on title bar feedback) is always name of the page not path as expected # #******************************************************************************* """Preferences dialog""" @@ -535,14 +536,13 @@ # setup page controler self._pageControler = PageControler( - self, - self.onPageControler, - self.controlById(self.IdFramePages), - self.controlById(self.IdButtonBox), - maxPageDepth=maxDepth, - pages=pages - ) - + self, + self.onPageControler, + self.controlById(self.IdFramePages), + self.controlById(self.IdButtonBox), + maxPageDepth=maxDepth, + pages=pages + ) if caption is None: self.setWindowTitle(self._oldWindowTitle) else: @@ -563,10 +563,7 @@ else: self.restoreState(state) - - - ######################################### ## overwritten methods ######################################## @@ -579,7 +576,6 @@ self.setCursor(oldCursor) QtGui.QDialog.accept(self) - ####################################### ## slots ####################################### @@ -717,14 +713,10 @@ out = QtCore.QString() while True: out.prepend(page.displayName() + '/') - #out.append(page.displayName()) + test.append(page) if page.isRoot(): break page = page.parent() - if page.parent() is None: - break - #out.reverse() - #title = self._oldWindowTitle + ' - [' + '/'.join(out) + ']' title = QtCore.QString('%1 - [%2]').arg(self._oldWindowTitle, out) QtGui.QDialog.setWindowTitle(self, title) @@ -737,9 +729,7 @@ In contrast to DlgPreferencesTree(), child pages of a page have a fixed indent and no decorations are shown to save space. Best use with page hirarchys nested at most 1 level deep. - """ - def __init__(self, *args, **kwargs): kwargs['maxDepth'] = 1 DlgPreferencesTree.__init__(self, *args, **kwargs) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-02 00:01:50
|
Revision: 850 http://fclient.svn.sourceforge.net/fclient/?rev=850&view=rev Author: jUrner Date: 2008-08-02 00:01:59 +0000 (Sat, 02 Aug 2008) Log Message: ----------- custom progressbars on tabWidget ++ fixed a nasty segfault Modified Paths: -------------- trunk/fclient/fclient/impl/ViewBrowser.py Modified: trunk/fclient/fclient/impl/ViewBrowser.py =================================================================== --- trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-01 23:58:41 UTC (rev 849) +++ trunk/fclient/fclient/impl/ViewBrowser.py 2008-08-02 00:01:59 UTC (rev 850) @@ -96,9 +96,6 @@ self._lastProgress = 0 return QtWebKit.QWebView.load(self, url) - def setLastStatusMessage(self, qString): - self._lastStatusMessage = qString - def setUrl(self, url): return self.load(url) @@ -178,40 +175,21 @@ 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) - - + self.statusBar.addWidget(self.labelFeedbackWrap.label, 10) + def setVisible(self, flag): if self.menuBar is not None: for menu in self.menus: menu.children()[0].setEnabled(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)) @@ -237,12 +215,17 @@ ('BackIsClose', 'Bool', False, config.SettingScopeUser), #TODO: not implemented ('HomePage', 'String', QtCore.QString(), 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), + ('MaxTabText', 'UInt', 15, config.SettingScopeUser), #NOTE: make shure Max >= Min and Max and Min > 0 + ('MinTabText', 'UInt', 15, config.SettingScopeUser), + + ('TabProgressBarColor', 'QColor', QtGui.QColor('blue'), config.SettingScopeUser), + ('TabProgressBarAlpha', 'UInt', 55, config.SettingScopeUser), ) def setValues(self, **kws): config.SettingsBase.setValues(self, **kws) + if not self.parent().isCreated: + return autoLoadImages = kws.get('AutoLoadImages', None) if autoLoadImages is not None: @@ -254,7 +237,11 @@ settings = browser.settings() settings.setAttribute(settings.AutoLoadImages, autoLoadImages) - + if kws.get('TabProgressBarColor', None) is not None or kws.get('TabProgressBarAlpha', None) is not None: + tabWidget = browserWidget.controlById(browserWidget.IdTabBrowsers) + tabWidget.tabBar().repaint() + + #backIsClose = kws.get('BackIsClose', None) #if backIsClose is not None: # self.parent()._adjustBackIsClose() @@ -388,9 +375,7 @@ shortcut=QtGui.QKeySequence(QtGui.QKeySequence.FindPrevious), trigger=parent.onFindPrevious, ) - - - + def intertwineBrowserActions(self, browser=None): """intertwines Browser actions with BrowserWidget actions @note: call everytime the current browser changes @@ -426,11 +411,20 @@ class LastBrowserState(object): """records the last known state browser""" - __slots__ = ('icon', 'progress', 'statusMessage', 'title', 'url') + StateNone = 0x0 + StateLoading = 0x1 + StateComplete = 0x2 + StateError = 0x4 + StateHideProgressBar = 0x100 - def __init__(self, icon=None, progress=0, statusMessage=None, title=None, url=None): + + __slots__ = ('clearProgressBarTimers', 'icon', 'progress', 'state', 'statusMessage', 'title', 'url') + + def __init__(self, icon=None, progress=0, statusMessage=None, state=StateNone, title=None, url=None): + self.clearProgressBarTimers = [] # timers scheduled for hiding progressBar self.progress = 0 self.icon = tCore.QIcon() if icon is None else icon + self.state = state 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. @@ -440,6 +434,53 @@ # to reimplement contextMenuEvent() :-( self.url = QtCore.QUrl() if url is None else url + +class BrowserTabBar(QtGui.QTabBar): + """customized tabBar to show progress indicstor on tabs""" + + class ClearProgressbarTimer(QtCore.QTimer): + + def __init__(self, parent, lastBrowserState): + QtCore.QTimer.__init__(self, parent) + self.lastBrowserState = lastBrowserState + self.setSingleShot(True) + self.start(500) + self.connect(self, QtCore.SIGNAL('timeout()'), self.onTimeout) + + def onTimeout(self): + self.lastBrowserState.clearProgressBarTimers.remove(self) + if not self.lastBrowserState.clearProgressBarTimers: + if not self.lastBrowserState.state & self.lastBrowserState.StateHideProgressBar: + self.lastBrowserState.state |= self.lastBrowserState.StateHideProgressBar + self.parent().repaint() + + def __init__(self, parent, fcSettings): + QtGui.QTabBar.__init__(self, parent) + self.fcSettings = fcSettings + + def paintEvent(self, event): + # let QTabBar do the dirty work and draw over with a big brush + QtGui.QTabBar.paintEvent(self, event) + + application = QtGui.QApplication.instance() + painter = QtGui.QPainter(self) + for i in xrange(self.count()): + browser = self.parent().widget(i) + lastBrowserState = browser.userData() + if lastBrowserState.state & lastBrowserState.StateHideProgressBar: + continue + if lastBrowserState.state & (lastBrowserState.StateComplete | lastBrowserState.StateError): + timer = self.ClearProgressbarTimer(self, lastBrowserState) + lastBrowserState.clearProgressBarTimers.append(timer) + color = QtGui.QColor(self.fcSettings.value('TabProgressBarColor')) + color.setAlpha(self.fcSettings.value('TabProgressBarAlpha')) + brush = QtGui.QBrush(color) + rc = self.tabRect(i) + rc.adjust(4, 4, -4, -4) + w = int(rc.width() * (float(lastBrowserState.progress) / 100)) + painter.setClipRect(rc.left(), rc.top(), w, rc.height()) + painter.fillRect(rc, brush) + #********************************************************************************** # #********************************************************************************** @@ -471,7 +512,7 @@ self.setupUi(self) config.ObjectRegistry.register(self) - self._isCreated = False + self.isCreated = False self._initialConfigDataArrived = False self.fcSettings = BrowserWidgetSettings(self).restore() @@ -485,7 +526,8 @@ # setup tab bar tabWidget = self.controlById(self.IdTabBrowsers) - tabWidget.clear() + tabWidget.clear() # clear, setTabBar() seems to take over alreeady present tabs (qt-designer!) + tabWidget.setTabBar(BrowserTabBar(tabWidget, self.fcSettings)) tabWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.connect(tabWidget, QtCore.SIGNAL('currentChanged(int)'), self.onTabCurrentChanged) self.connect(tabWidget, QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), self.onTabContextMenuEvent) @@ -612,7 +654,9 @@ def currentBrowser(self): """returns the current browser or None""" tabWidget = self.controlById(self.IdTabBrowsers) - return tabWidget.currentWidget() + widget = tabWidget.currentWidget() + if isinstance(widget, Browser): + return widget 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 @@ -634,7 +678,7 @@ connectionWidget = config.ObjectRegistry.get(config.IdViewConnectionWidget, None) if connectionWidget is None: raise ValueError('No connection widget found') - + # load url url.setScheme('http') url.setHost(connectionWidget.fcSettings.value('FproxyConnectionHost')) @@ -642,6 +686,7 @@ tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(self.trUtf8('Loading'))) addressBar.setText(url.toString()) lastBrowserState = browser.userData() + lastBrowserState.state = lastBrowserState.StateLoading lastBrowserState.url = url browser.load(url) return True @@ -697,8 +742,6 @@ 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 @@ -738,12 +781,12 @@ def showEvent(self, event): self.fcGlobalFeedback.setVisible(True) - if not self._isCreated: - self._isCreated = True + if not self.isCreated: + self.isCreated = True # fire up a new broser to make a start self.newBrowser(title=self.trUtf8('Waiting for fproxy')) self.fcActions['ActionGoToHomePage'].trigger() - + def viewClose(self): pass @@ -812,41 +855,20 @@ lastBrowserState.progress = Browser.MaxProgress if ok: + lastBrowserState.state = lastBrowserState.StateComplete lastBrowserState.statusMessage = self.trUtf8('Complete') title = self.trUtf8('Complete') if lastBrowserState.title.isEmpty() else lastBrowserState.title tabWidget.setTabText(tabWidget.indexOf(browser), self._adjustTabText(title)) - if browser == self.currentBrowser(): - self.fcGlobalFeedback.setStatusMessage(lastBrowserState.statusMessage) else: # something went wrong. most likely fProxy can not be reached + lastBrowserState.state = lastBrowserState.StateError 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) - + #TODO: or maybe NOTE: we can not give any feedback to the user here, like + # injecting some html via JavaScript. Browser crashes when navigating to another + # page. looks like we should not interrupt the java code. maybe there is a way by intercepting + # the network request.. + def onBrowserIconChanged(self, qIcon): browser = self.sender() qIcon = QtCore.QIcon(qIcon) # copy it - qt nukes it on return @@ -859,11 +881,10 @@ def onBrowserLoadProgress(self, n): browser = self.sender() lastBrowserState = browser.userData() + lastBrowserState.state = lastBrowserState.StateLoading lastBrowserState.progress = n - if self.sender() == self.currentBrowser(): - self.fcGlobalFeedback.setProgress(n) - + def onBrowserLinkClicked(self, qUrl): browser = self.sender() qUrl = QtCore.QUrl(qUrl) @@ -884,10 +905,7 @@ 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 @@ -895,9 +913,7 @@ 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 @@ -1029,7 +1045,6 @@ 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() @@ -1037,9 +1052,7 @@ # 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() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-01 23:58:31
|
Revision: 849 http://fclient.svn.sourceforge.net/fclient/?rev=849&view=rev Author: jUrner Date: 2008-08-01 23:58:41 +0000 (Fri, 01 Aug 2008) Log Message: ----------- adjust to allow for ProgressBar styling via Css Modified Paths: -------------- trunk/fclient/fclient/impl/ViewDownloads.py Modified: trunk/fclient/fclient/impl/ViewDownloads.py =================================================================== --- trunk/fclient/fclient/impl/ViewDownloads.py 2008-08-01 23:56:15 UTC (rev 848) +++ trunk/fclient/fclient/impl/ViewDownloads.py 2008-08-01 23:58:41 UTC (rev 849) @@ -53,6 +53,7 @@ # #********************************************************************************** BLOCK_SIZE = 32768 # from CHKBlock.java + #********************************************************************************** # #********************************************************************************** @@ -136,11 +137,17 @@ trigger=parent.onDownloadKey, ) self.action( - name='ActionRemoveSelectedRequests', - text=self.trUtf8('Remove'), - trigger=parent.onRemoveSelectedRequests, + name='ActionRemoveSelectedDownloads', + text=self.trUtf8('Remove download'), + trigger=parent.onRemoveSelectedDownloads, isEnabled=False, ) + self.action( + name='ActionRestartSelectedDownloads', + text=self.trUtf8('Restart download'), + trigger=parent.onRestartSelectedDownloads, + isEnabled=False, + ) class DownloadsWidgetSettings(config.SettingsBase): @@ -159,47 +166,6 @@ #********************************************************************************** # #********************************************************************************** -# from: network/torrent/mainwindow.cpp -# TorrentViewDelegate is used to draw the progress bars. -class DownloadTreeDelegate(QtGui.QItemDelegate): - - def __init__(self, parent): - QtGui.QItemDelegate.__init__(self, parent) - - def paint(self, painter, option, index): - if index.column() != self.parent().HeaderIndexProgress: - return QtGui.QItemDelegate.paint(self, painter, option, index) - - application = QtGui.QApplication.instance() - fcpRequest = self.parent().fcRequests.itemFromIndex(index.row()).fcpRequest - progress = fcpRequest['ProgressSucceeeded'] - required = fcpRequest['ProgressRequired'] - - # Set up a QprogressbarOptionProgressBar to precisely mimic the - # environment of a progress bar. - progressBarOption = QtGui.QStyleOptionProgressBar() - progressBarOption.state = QtGui.QStyle.State_Enabled - progressBarOption.direction = application.layoutDirection() - progressBarOption.rect = option.rect - progressBarOption.fontMetrics = application.fontMetrics() - progressBarOption.minimum = 0 - progressBarOption.maximum = fcpRequest['ProgressRequired'] - progressBarOption.textAlignment = QtCore.Qt.AlignCenter - progressBarOption.textVisible = True - - # Set the progress and text values of the style option. - progressBarOption.progress = progress - if required: - progressBarOption.text = '%s%%' % round(progress * 100 / required, 2) - else: - progressBarOption.text = '0%' - - # Draw the progress bar onto the view. - application.style().drawControl(QtGui.QStyle.CE_ProgressBar, progressBarOption, painter) - -#********************************************************************************** -# -#********************************************************************************** class TreeItem(QtGui.QTreeWidgetItem): def __init__(self, fcpRequest, *params): @@ -207,18 +173,23 @@ self.fcpRequest = fcpRequest -# can be used to expose properties for stylesheets for example +# exposes properties for stylesheets class ProgressBar(QtGui.QProgressBar): - def __init__(self, parent): + def __init__(self, parent, item): QtGui.QProgressBar.__init__(self, parent) - # self.__foo = True + self.item = item - #def foo(self): - # return self.__foo - #def setFoo(self, value): - # self.__foo = value - #foo = QtCore.pyqtProperty("bool",foo, setFoo) + def _status(self): + if self.item.fcpRequest is not None: + if self.item.fcpRequest['RequestStatus'] & fcp2.ConstRequestStatus.Error: + return "error" + elif self.item.fcpRequest['RequestStatus'] & fcp2.ConstRequestStatus.Completed: + return "complete" + else: + return QtCore.QString("loading") + return "notset" + status= QtCore.pyqtProperty("QString", _status) #********************************************************************************** # @@ -233,6 +204,7 @@ HeaderIndexMimeType = 2 HeaderIndexStatus = 3 HeaderIndexProgress = 4 + HeaderIndexElapsed = 5 def __init__(self, parent, idGlobalFeedback=config.IdMainWindow): QtGui.QWidget.__init__(self, parent) @@ -254,12 +226,30 @@ (config.fcpClient.events.RequestRemoved, self.onFcpRequestRemoved), ) config.fcpClient.events += self.fcpEvents - self.fcHeadeLabels = {} + self.fcHeadeLabels = {} # fcpIdentifier --> treeItem self.fcpRequests = {} ############################ ## private methods ############################ + def _adjustStatusBar(self, item, status): + # to take Css styling into account we have to set a new statusBar for each state change + oldProgressBar= self.tree.itemWidget(item, self.HeaderIndexProgress) + progressBar = ProgressBar(self.tree, item) + progressBar.setObjectName('downloadKey') + if status == 'loading': + progressBar.setRange(0, 0) + elif status == 'complete': + progressBar.setRange(0, 1) + progressBar.setValue(progressBar.maximum()) + elif status == 'error': + progressbar.setMinimum(oldProgressBar.minimum()) + progressbar.setMaximum(oldProgressBar.maximum()) + progressbar.setValue(oldProgressBar.value()) + else: + raise ValueError('Unknown status: %r' % status) + self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar) + def _createItemFromFcpRequest(self, fcpRequest): item= TreeItem(fcpRequest, self.tree) fileName = fcpRequest['Filename'] @@ -275,9 +265,7 @@ QtCore.Qt.DisplayRole, QtCore.QVariant(os.path.basename(fcpRequest['Filename'])) ) - progressBar = ProgressBar(self) - progressBar.setRange(0, 0) - self.tree.setItemWidget(item, self.HeaderIndexProgress, progressBar) + self._adjustStatusBar(item, 'loading') self.fcpRequests[fcpRequest['Identifier']] = item return item @@ -293,6 +281,7 @@ self.HeaderIndexMimeType: self.trUtf8('MimeType'), self.HeaderIndexStatus: self.trUtf8('Status'), self.HeaderIndexProgress: self.trUtf8('Progress'), + self.HeaderIndexElapsed: self.trUtf8('Elapsed'), } tree.setHeaderLabels([i[1] for i in sorted(self.fcHeadeLabels.items())]) @@ -333,6 +322,7 @@ fcpKey, fileName, persistentUserData=PersistentRequestData(ClientName=unicode(self.objectName())).dump(), + #TODO: browser sets this. ok or not? #handleFilenameCollision=True, handlePermanentRedirect=True, **kws @@ -357,7 +347,7 @@ handleFilenameCollision=True, ) - def onRemoveSelectedRequests(self, action): + def onRemoveSelectedDownloads(self, action): tree = self.controlById(self.IdTree) for item in tree.selectedItems(): parent = item.parent() @@ -371,12 +361,23 @@ tmp_item.fcpRequest = None parent.removeChild(item) + def onRestartSelectedDownloads(self, action): + tree = self.controlById(self.IdTree) + for item in tree.selectedItems(): + if item.fcpRequest is None: + raise RuntimeError('fcpRequest is None. should not happen') + del self.fcpRequests[item.fcpRequest['Identifier']] + item.fcpRequest = config.fcpClient.resendRequest(item.fcpRequest) + self.fcpRequests[item.fcpRequest['Identifier']] = item + self._adjustStatusBar(item, 'loading') + def onTreeCustomContextMenuRequested(self, pt): tree = self.controlById(self.IdTree) pt = tree.viewport().mapToGlobal(pt) menu = QtGui.QMenu(self) - menu.addAction(self.fcActions['ActionRemoveSelectedRequests']) + menu.addAction(self.fcActions['ActionRemoveSelectedDownloads']) + menu.addAction(self.fcActions['ActionRestartSelectedDownloads']) menu.exec_(pt) @@ -384,7 +385,8 @@ tree = self.controlById(self.IdTree) hasSelectedItems = tree.selectionModel().hasSelection() - self.fcActions['ActionRemoveSelectedRequests'].setEnabled(hasSelectedItems) + self.fcActions['ActionRemoveSelectedDownloads'].setEnabled(hasSelectedItems) + self.fcActions['ActionRestartSelectedDownloads'].setEnabled(hasSelectedItems) ######################################### ## fcp event handlers @@ -394,14 +396,8 @@ def onFcpRequestCompleted(self, fcpEvent, fcpRequest): - requestIdentifier = fcpRequest['Identifier'] - - item = self.fcpRequests.get(requestIdentifier, None) + item = self.fcpRequests.get(fcpRequest['Identifier'], None) if item is not None: - progressBar = self.tree.itemWidget(item, self.HeaderIndexProgress) - progressBar.setRange(0, 1) - progressBar.setValue(progressBar.maximum()) - item.setData( self.HeaderIndexSize, QtCore.Qt.DisplayRole, @@ -412,8 +408,13 @@ QtCore.Qt.DisplayRole, QtCore.QVariant(fcpRequest['MetadataContentType']) ) + self._adjustStatusBar(item, 'complete') def onFcpRequestFailed(self, fcpEvent, fcpRequest): + item = self.fcpRequests.get(rfcpRequest['Identifier'], None) + if item is not None: + self._adjustStatusBar(item, 'error') + pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-01 23:56:05
|
Revision: 848 http://fclient.svn.sourceforge.net/fclient/?rev=848&view=rev Author: jUrner Date: 2008-08-01 23:56:15 +0000 (Fri, 01 Aug 2008) Log Message: ----------- typo Modified Paths: -------------- trunk/fclient/fclient/impl/View.py Modified: trunk/fclient/fclient/impl/View.py =================================================================== --- trunk/fclient/fclient/impl/View.py 2008-08-01 23:55:52 UTC (rev 847) +++ trunk/fclient/fclient/impl/View.py 2008-08-01 23:56:15 UTC (rev 848) @@ -62,7 +62,6 @@ ('LastViewBottom', 'String', '', config.SettingScopePrivate), ('SplitterPos', 'ByteArray', QtCore.QByteArray(), config.SettingScopePrivate), ('ShowTopTabBar', 'Bool', True, config.SettingScopePrivate), - ) @@ -80,7 +79,7 @@ #*********************************************************************** class ViewWidget(QtGui.QWidget, Ui_ViewWidget): - IdSplitter = 'Splitter' + IdSplitter = 'splitter' IdTabTop = 'tabTop' IdTabBottom = 'tabBottom' @@ -115,7 +114,6 @@ self.fcActions['ActionShowTopTabBar'].setChecked(showTopTabBar) tabWidgetTop.tabBar().setVisible(showTopTabBar) - def controlById(self, idControl): return getattr(self, idControl) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-01 23:55:43
|
Revision: 847 http://fclient.svn.sourceforge.net/fclient/?rev=847&view=rev Author: jUrner Date: 2008-08-01 23:55:52 +0000 (Fri, 01 Aug 2008) Log Message: ----------- some ui changes Modified Paths: -------------- trunk/fclient/fclient/impl/tpls/MainWindowTpl.ui trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui trunk/fclient/fclient/impl/tpls/Ui_MainWindowTpl.py trunk/fclient/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py trunk/fclient/fclient/impl/tpls/Ui_ViewWidgetTpl.py trunk/fclient/fclient/impl/tpls/ViewWidgetTpl.ui Modified: trunk/fclient/fclient/impl/tpls/MainWindowTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/MainWindowTpl.ui 2008-08-01 23:53:07 UTC (rev 846) +++ trunk/fclient/fclient/impl/tpls/MainWindowTpl.ui 2008-08-01 23:55:52 UTC (rev 847) @@ -5,8 +5,8 @@ <rect> <x>0</x> <y>0</y> - <width>800</width> - <height>600</height> + <width>774</width> + <height>591</height> </rect> </property> <property name="windowTitle" > @@ -17,17 +17,18 @@ <rect> <x>0</x> <y>0</y> - <width>800</width> - <height>577</height> + <width>774</width> + <height>568</height> </rect> </property> + <zorder>frame</zorder> </widget> <widget class="QStatusBar" name="statusbar" > <property name="geometry" > <rect> <x>0</x> - <y>577</y> - <width>800</width> + <y>568</y> + <width>774</width> <height>23</height> </rect> </property> Modified: trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-08-01 23:53:07 UTC (rev 846) +++ trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui 2008-08-01 23:55:52 UTC (rev 847) @@ -13,7 +13,14 @@ <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout" > - <item row="0" column="0" colspan="2" > + <item row="0" column="0" > + <widget class="QLabel" name="fieldHeader_3" > + <property name="text" > + <string>Single application:</string> + </property> + </widget> + </item> + <item row="1" column="0" colspan="2" > <widget class="QLabel" name="label" > <property name="text" > <string>The gui uses a socket connection to enshure only one instance is running at a time. Use the boxes below to adjust host and port of the connection to your needs.</string> @@ -29,31 +36,39 @@ </property> </widget> </item> - <item row="1" column="0" > - <layout class="QVBoxLayout" name="verticalLayout" > + <item row="2" column="0" > + <layout class="QHBoxLayout" name="horizontalLayout" > <item> - <widget class="QLabel" name="fieldHeader" > - <property name="text" > - <string>Single application host: </string> - </property> - </widget> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QLabel" name="fieldName" > + <property name="text" > + <string>Host: </string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="fieldName_2" > + <property name="text" > + <string>Port: </string> + </property> + </widget> + </item> + </layout> </item> <item> - <widget class="QLineEdit" name="edHost" /> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QLineEdit" name="edHost" /> + </item> + <item> + <widget class="QSpinBox" name="spinPort" /> + </item> + </layout> </item> - <item> - <widget class="QLabel" name="fieldHeader_2" > - <property name="text" > - <string>Single application port: </string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="spinPort" /> - </item> </layout> </item> - <item row="1" column="1" > + <item row="2" column="1" > <spacer name="horizontalSpacer" > <property name="orientation" > <enum>Qt::Horizontal</enum> @@ -66,7 +81,7 @@ </property> </spacer> </item> - <item row="2" column="0" > + <item row="3" column="0" > <spacer name="verticalSpacer" > <property name="orientation" > <enum>Qt::Vertical</enum> Modified: trunk/fclient/fclient/impl/tpls/Ui_MainWindowTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_MainWindowTpl.py 2008-08-01 23:53:07 UTC (rev 846) +++ trunk/fclient/fclient/impl/tpls/Ui_MainWindowTpl.py 2008-08-01 23:55:52 UTC (rev 847) @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/MainWindowTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/MainWindowTpl.ui' # -# Created: Wed Jul 16 11:46:00 2008 +# Created: Sat Aug 2 01:50:59 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,13 +12,13 @@ class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.resize(800, 600) + MainWindow.resize(774, 591) self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setGeometry(QtCore.QRect(0, 0, 800, 577)) + self.centralwidget.setGeometry(QtCore.QRect(0, 0, 774, 568)) self.centralwidget.setObjectName("centralwidget") MainWindow.setCentralWidget(self.centralwidget) self.statusbar = QtGui.QStatusBar(MainWindow) - self.statusbar.setGeometry(QtCore.QRect(0, 577, 800, 23)) + self.statusbar.setGeometry(QtCore.QRect(0, 568, 774, 23)) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.action_Preferences = QtGui.QAction(MainWindow) Modified: trunk/fclient/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py 2008-08-01 23:53:07 UTC (rev 846) +++ trunk/fclient/fclient/impl/tpls/Ui_PrefsSingleAppTpl.py 2008-08-01 23:55:52 UTC (rev 847) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/PrefsSingleAppTpl.ui' # -# Created: Thu Jul 31 20:31:58 2008 +# Created: Fri Aug 1 10:08:05 2008 # by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -15,40 +15,50 @@ PrefsSingleApp.resize(533, 399) self.gridLayout = QtGui.QGridLayout(PrefsSingleApp) self.gridLayout.setObjectName("gridLayout") + self.fieldHeader_3 = QtGui.QLabel(PrefsSingleApp) + self.fieldHeader_3.setObjectName("fieldHeader_3") + self.gridLayout.addWidget(self.fieldHeader_3, 0, 0, 1, 1) self.label = QtGui.QLabel(PrefsSingleApp) self.label.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.label.setWordWrap(True) self.label.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 0, 0, 1, 2) + self.gridLayout.addWidget(self.label, 1, 0, 1, 2) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.fieldHeader = QtGui.QLabel(PrefsSingleApp) - self.fieldHeader.setObjectName("fieldHeader") - self.verticalLayout.addWidget(self.fieldHeader) + self.fieldName = QtGui.QLabel(PrefsSingleApp) + self.fieldName.setObjectName("fieldName") + self.verticalLayout.addWidget(self.fieldName) + self.fieldName_2 = QtGui.QLabel(PrefsSingleApp) + self.fieldName_2.setObjectName("fieldName_2") + self.verticalLayout.addWidget(self.fieldName_2) + self.horizontalLayout.addLayout(self.verticalLayout) + self.verticalLayout_2 = QtGui.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") self.edHost = QtGui.QLineEdit(PrefsSingleApp) self.edHost.setObjectName("edHost") - self.verticalLayout.addWidget(self.edHost) - self.fieldHeader_2 = QtGui.QLabel(PrefsSingleApp) - self.fieldHeader_2.setObjectName("fieldHeader_2") - self.verticalLayout.addWidget(self.fieldHeader_2) + self.verticalLayout_2.addWidget(self.edHost) self.spinPort = QtGui.QSpinBox(PrefsSingleApp) self.spinPort.setObjectName("spinPort") - self.verticalLayout.addWidget(self.spinPort) - self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1) + self.verticalLayout_2.addWidget(self.spinPort) + self.horizontalLayout.addLayout(self.verticalLayout_2) + self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1) spacerItem = QtGui.QSpacerItem(251, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.gridLayout.addItem(spacerItem, 1, 1, 1, 1) + self.gridLayout.addItem(spacerItem, 2, 1, 1, 1) spacerItem1 = QtGui.QSpacerItem(20, 218, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.gridLayout.addItem(spacerItem1, 2, 0, 1, 1) + self.gridLayout.addItem(spacerItem1, 3, 0, 1, 1) self.retranslateUi(PrefsSingleApp) QtCore.QMetaObject.connectSlotsByName(PrefsSingleApp) def retranslateUi(self, PrefsSingleApp): PrefsSingleApp.setWindowTitle(QtGui.QApplication.translate("PrefsSingleApp", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldHeader_3.setText(QtGui.QApplication.translate("PrefsSingleApp", "Single application:", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("PrefsSingleApp", "The gui uses a socket connection to enshure only one instance is running at a time. Use the boxes below to adjust host and port of the connection to your needs.", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldHeader.setText(QtGui.QApplication.translate("PrefsSingleApp", "Single application host: ", None, QtGui.QApplication.UnicodeUTF8)) - self.fieldHeader_2.setText(QtGui.QApplication.translate("PrefsSingleApp", "Single application port: ", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName.setText(QtGui.QApplication.translate("PrefsSingleApp", "Host: ", None, QtGui.QApplication.UnicodeUTF8)) + self.fieldName_2.setText(QtGui.QApplication.translate("PrefsSingleApp", "Port: ", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": Modified: trunk/fclient/fclient/impl/tpls/Ui_ViewWidgetTpl.py =================================================================== --- trunk/fclient/fclient/impl/tpls/Ui_ViewWidgetTpl.py 2008-08-01 23:53:07 UTC (rev 846) +++ trunk/fclient/fclient/impl/tpls/Ui_ViewWidgetTpl.py 2008-08-01 23:55:52 UTC (rev 847) @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewWidgetTpl.ui' +# Form implementation generated from reading ui file '/home/me/src/fclient/trunk/fclient/fclient/impl/tpls/ViewWidgetTpl.ui' # -# Created: Sun Jul 13 00:07:25 2008 -# by: PyQt4 UI code generator 4.3.3 +# Created: Fri Aug 1 18:03:14 2008 +# by: PyQt4 UI code generator 4.4.3-snapshot-20080705 # # WARNING! All changes made in this file will be lost! @@ -12,56 +12,28 @@ class Ui_ViewWidget(object): def setupUi(self, ViewWidget): ViewWidget.setObjectName("ViewWidget") - ViewWidget.resize(QtCore.QSize(QtCore.QRect(0,0,530,629).size()).expandedTo(ViewWidget.minimumSizeHint())) - - self.gridlayout = QtGui.QGridLayout(ViewWidget) - self.gridlayout.setMargin(0) - self.gridlayout.setSpacing(0) - self.gridlayout.setObjectName("gridlayout") - - self.Splitter = QtGui.QSplitter(ViewWidget) - self.Splitter.setOrientation(QtCore.Qt.Vertical) - self.Splitter.setObjectName("Splitter") - - self.frameTop = QtGui.QFrame(self.Splitter) - self.frameTop.setFrameShape(QtGui.QFrame.NoFrame) - self.frameTop.setFrameShadow(QtGui.QFrame.Plain) - self.frameTop.setLineWidth(0) - self.frameTop.setObjectName("frameTop") - - self.gridlayout1 = QtGui.QGridLayout(self.frameTop) - self.gridlayout1.setMargin(0) - self.gridlayout1.setSpacing(0) - self.gridlayout1.setObjectName("gridlayout1") - - self.tabTop = QtGui.QTabWidget(self.frameTop) + ViewWidget.resize(530, 237) + self.gridLayout = QtGui.QGridLayout(ViewWidget) + self.gridLayout.setMargin(0) + self.gridLayout.setSpacing(0) + self.gridLayout.setObjectName("gridLayout") + self.splitter = QtGui.QSplitter(ViewWidget) + self.splitter.setOrientation(QtCore.Qt.Vertical) + self.splitter.setObjectName("splitter") + self.tabTop = QtGui.QTabWidget(self.splitter) self.tabTop.setObjectName("tabTop") - + self.tab = QtGui.QWidget() + self.tab.setGeometry(QtCore.QRect(0, 0, 526, 72)) + self.tab.setObjectName("tab") + self.tabTop.addTab(self.tab, "") + self.tabBottom = QtGui.QTabWidget(self.splitter) + self.tabBottom.setObjectName("tabBottom") self.tab_3 = QtGui.QWidget() + self.tab_3.setGeometry(QtCore.QRect(0, 0, 526, 103)) self.tab_3.setObjectName("tab_3") - self.tabTop.addTab(self.tab_3,"") - self.gridlayout1.addWidget(self.tabTop,0,0,1,1) + self.tabBottom.addTab(self.tab_3, "") + self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1) - self.frameBottom = QtGui.QFrame(self.Splitter) - self.frameBottom.setFrameShape(QtGui.QFrame.NoFrame) - self.frameBottom.setFrameShadow(QtGui.QFrame.Plain) - self.frameBottom.setLineWidth(0) - self.frameBottom.setObjectName("frameBottom") - - self.gridlayout2 = QtGui.QGridLayout(self.frameBottom) - self.gridlayout2.setMargin(0) - self.gridlayout2.setSpacing(0) - self.gridlayout2.setObjectName("gridlayout2") - - self.tabBottom = QtGui.QTabWidget(self.frameBottom) - self.tabBottom.setObjectName("tabBottom") - - self.tab_5 = QtGui.QWidget() - self.tab_5.setObjectName("tab_5") - self.tabBottom.addTab(self.tab_5,"") - self.gridlayout2.addWidget(self.tabBottom,0,0,1,1) - self.gridlayout.addWidget(self.Splitter,0,0,1,1) - self.retranslateUi(ViewWidget) self.tabTop.setCurrentIndex(0) self.tabBottom.setCurrentIndex(0) @@ -69,11 +41,10 @@ def retranslateUi(self, ViewWidget): ViewWidget.setWindowTitle(QtGui.QApplication.translate("ViewWidget", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.tabTop.setTabText(self.tabTop.indexOf(self.tab_3), QtGui.QApplication.translate("ViewWidget", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) - self.tabBottom.setTabText(self.tabBottom.indexOf(self.tab_5), QtGui.QApplication.translate("ViewWidget", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) + self.tabTop.setTabText(self.tabTop.indexOf(self.tab), QtGui.QApplication.translate("ViewWidget", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) + self.tabBottom.setTabText(self.tabBottom.indexOf(self.tab_3), QtGui.QApplication.translate("ViewWidget", "Tab 1", None, QtGui.QApplication.UnicodeUTF8)) - if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) @@ -82,3 +53,4 @@ ui.setupUi(ViewWidget) ViewWidget.show() sys.exit(app.exec_()) + Modified: trunk/fclient/fclient/impl/tpls/ViewWidgetTpl.ui =================================================================== --- trunk/fclient/fclient/impl/tpls/ViewWidgetTpl.ui 2008-08-01 23:53:07 UTC (rev 846) +++ trunk/fclient/fclient/impl/tpls/ViewWidgetTpl.ui 2008-08-01 23:55:52 UTC (rev 847) @@ -6,121 +6,59 @@ <x>0</x> <y>0</y> <width>530</width> - <height>629</height> + <height>237</height> </rect> </property> <property name="windowTitle" > <string>Form</string> </property> - <layout class="QGridLayout" > - <property name="leftMargin" > + <layout class="QGridLayout" name="gridLayout" > + <property name="margin" > <number>0</number> </property> - <property name="topMargin" > + <property name="spacing" > <number>0</number> </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> - </property> - <property name="horizontalSpacing" > - <number>0</number> - </property> - <property name="verticalSpacing" > - <number>0</number> - </property> <item row="0" column="0" > - <widget class="QSplitter" name="Splitter" > + <widget class="QSplitter" name="splitter" > <property name="orientation" > <enum>Qt::Vertical</enum> </property> - <widget class="QFrame" name="frameTop" > - <property name="frameShape" > - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth" > + <widget class="QTabWidget" name="tabTop" > + <property name="currentIndex" > <number>0</number> </property> - <layout class="QGridLayout" > - <property name="leftMargin" > - <number>0</number> + <widget class="QWidget" name="tab" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>526</width> + <height>72</height> + </rect> </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> - </property> - <property name="horizontalSpacing" > - <number>0</number> - </property> - <property name="verticalSpacing" > - <number>0</number> - </property> - <item row="0" column="0" > - <widget class="QTabWidget" name="tabTop" > - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="tab_3" > - <attribute name="title" > - <string>Tab 1</string> - </attribute> - </widget> - </widget> - </item> - </layout> + <attribute name="title" > + <string>Tab 1</string> + </attribute> + </widget> </widget> - <widget class="QFrame" name="frameBottom" > - <property name="frameShape" > - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Plain</enum> - </property> - <property name="lineWidth" > + <widget class="QTabWidget" name="tabBottom" > + <property name="currentIndex" > <number>0</number> </property> - <layout class="QGridLayout" > - <property name="leftMargin" > - <number>0</number> + <widget class="QWidget" name="tab_3" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>526</width> + <height>103</height> + </rect> </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> - </property> - <property name="horizontalSpacing" > - <number>0</number> - </property> - <property name="verticalSpacing" > - <number>0</number> - </property> - <item row="0" column="0" > - <widget class="QTabWidget" name="tabBottom" > - <property name="currentIndex" > - <number>0</number> - </property> - <widget class="QWidget" name="tab_5" > - <attribute name="title" > - <string>Tab 1</string> - </attribute> - </widget> - </widget> - </item> - </layout> + <attribute name="title" > + <string>Tab 1</string> + </attribute> + </widget> </widget> </widget> </item> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jU...@us...> - 2008-08-01 23:52:57
|
Revision: 846 http://fclient.svn.sourceforge.net/fclient/?rev=846&view=rev Author: jUrner Date: 2008-08-01 23:53:07 +0000 (Fri, 01 Aug 2008) Log Message: ----------- experimental, style progressBars Modified Paths: -------------- trunk/fclient/fclient/impl/res/stylesheets/default.css Modified: trunk/fclient/fclient/impl/res/stylesheets/default.css =================================================================== --- trunk/fclient/fclient/impl/res/stylesheets/default.css 2008-08-01 23:51:57 UTC (rev 845) +++ trunk/fclient/fclient/impl/res/stylesheets/default.css 2008-08-01 23:53:07 UTC (rev 846) @@ -14,8 +14,7 @@ **********************************************************************************************/ /* label style. sample: Host: - | 9999| -*/ + | 9999| */ QLabel#fieldHeader, QLabel#fieldHeader_2, QLabel#fieldHeader_3, @@ -30,8 +29,7 @@ /* label style. sample: - Host: | 9999| -*/ + Host: | 9999| */ QLabel#fieldName, QLabel#fieldName_2, QLabel#fieldName_3, @@ -41,6 +39,44 @@ QLabel#fieldName_7, QLabel#fieldName_8, QLabel#fieldName_9{ - font: bold; - color: green; - } \ No newline at end of file + } + + +/* progressBars */ +QProgressBar:horizontal { +border: 1px solid gray; +border-radius: 3px; +background: white; +text-align: center vcenter; +padding: 1px; +} +QProgressBar::chunk:horizontal { +background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop: 1 white); +} + +/* +QProgressBar{ + color: white; + border: 0px solid black; + background: gray; + margin: 0px; + padding: 0px; + text-align: center vcenter; +} +QProgressBar::chunk{ + background: #377FFF; + border-radius: 5px; + border: 1px solid darkgrey; + } + + +QProgressBar#downloadKey[status="loading"]::chunk{ + background:#0000FF; + } +QProgressBar#downloadKey[status="complete"]::chunk{ + background:#009600; + } +QProgressBar#downloadKey[status="error"]::chunk{ + background:red; + } +*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |