SF.net SVN: fclient:[866] trunk/fclient/fclient/impl/ViewBrowser.py
Status: Pre-Alpha
Brought to you by:
jurner
|
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.
|