SF.net SVN: fclient:[751] trunk/fclient/src/fclient
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-26 09:15:18
|
Revision: 751
http://fclient.svn.sourceforge.net/fclient/?rev=751&view=rev
Author: jUrner
Date: 2008-07-26 09:15:26 +0000 (Sat, 26 Jul 2008)
Log Message:
-----------
better compacting of freenet keys
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py
trunk/fclient/src/fclient/Ui_ViewBrowser.py
trunk/fclient/src/fclient/config.py
Modified: trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py
===================================================================
--- trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-26 09:14:50 UTC (rev 750)
+++ trunk/fclient/src/fclient/Ui_DlgPropsBrowserObject.py 2008-07-26 09:15:26 UTC (rev 751)
@@ -37,34 +37,24 @@
self.setupUi(self)
self.setWindowTitle(config.FclientAppName + self.trUtf8(' - Properties'))
-
-
-
-
if hitTestResult is not None:
if not hitTestResult.linkUrl().isEmpty():
labelLinkUrl = self.controlById(self.IdLabelLinkUrl)
- self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=posixpath)
+ self.wrapLinkUrl = pathlabelwrap.PathLabelWrap(labelLinkUrl, path_module=config.CompactPathFcpKeyModule)
self.wrapLinkUrl.setPath(unicode(hitTestResult.linkUrl().toString()))
if not hitTestResult.imageUrl().isEmpty():
labelImageUrl = self.controlById(self.IdLabelImageUrl)
- self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=posixpath)
+ self.wrapImageUrl = pathlabelwrap.PathLabelWrap(labelImageUrl, path_module=config.CompactPathFcpKeyModule)
self.wrapImageUrl.setPath(unicode(hitTestResult.imageUrl().toString()))
ellipsis = self.trUtf8('..')
- print hitTestResult.linkTitle(), hitTestResult.linkText()
self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkTitle().toString(), ellipsis))
self.labelTitle.setText(qtools.truncateString(self.MaxText, hitTestResult.linkText(), ellipsis))
-
-
-
-
+
def controlById(self, idControl):
return getattr(self, idControl)
-
-
#**********************************************************************************
#
#**********************************************************************************
Modified: trunk/fclient/src/fclient/Ui_ViewBrowser.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:14:50 UTC (rev 750)
+++ trunk/fclient/src/fclient/Ui_ViewBrowser.py 2008-07-26 09:15:26 UTC (rev 751)
@@ -12,10 +12,17 @@
# x. fProxy is a bit tight-lipped when it comes to feedback. no idea
# x. give feedback on tabs about load / finisched / error. maybe some color code. wait for new QTabWidget features (qt4.5)
# x. close button on tabs. wait for new QTabWidget features (qt4.5)
-# x. zoom in/out
# x. page actions: CopyImageToClipboard,
# x. when mouse pointer is over an opend image a magnifier cursor appears. no idea how this is handled
-# x. open new tab on tab bar double click
+# x. open new tab on tab bar double click. IIRC looks like no way before qt4.5. tabBars are not stretched to fit in qt4.4
+# x. global feedback on statusbar flickers. reason: first label is holds arbitrary length text
+# x. save link to disk
+# x. fproxy. "force browser to dl" should we dl it in downloads or store emidiately? no idea
+# x. visiting plugins via fproxy does not work
+# real toolbars
+# x. remove host/port from urls?
+# x. browser settings - QWebSettings
+# x. shortcuts
#******************************************************************************************
"""
@@ -25,7 +32,6 @@
if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below
import os; __path__ = [os.path.dirname(__file__)]
-import posixpath
from PyQt4 import QtCore, QtGui, QtWebKit
from . import config
@@ -176,7 +182,7 @@
label.setFrameStyle(QtGui.QLabel.Sunken | QtGui.QLabel.Box)
self.labelFeedbackWrap = pathlabelwrap.PathLabelWrap(
label,
- path_module=posixpath,
+ path_module=config.CompactPathFcpKeyModule,
)
self.statusBar.addWidget(self.labelFeedbackWrap.label, 1)
@@ -609,7 +615,6 @@
# customize browser
browser.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
- ##settings.setAttribute(settings.AutoLoadImages, False)
settings.setAttribute(settings.DeveloperExtrasEnabled, False)
settings.setAttribute(settings.JavaEnabled, False)
settings.setAttribute(settings.JavascriptEnabled, False)
@@ -959,7 +964,6 @@
if browser is not None:
oldMultiplier = browser.textSizeMultiplier()
browser.setTextSizeMultiplier(browser.textSizeMultiplier() - 0.2)
- print browser.textSizeMultiplier()
if browser.textSizeMultiplier() >= oldMultiplier:
menu.addAction(self.fcActions['ActionZoomOut']).setEnabled(False)
Modified: trunk/fclient/src/fclient/config.py
===================================================================
--- trunk/fclient/src/fclient/config.py 2008-07-26 09:14:50 UTC (rev 750)
+++ trunk/fclient/src/fclient/config.py 2008-07-26 09:15:26 UTC (rev 751)
@@ -197,3 +197,20 @@
return QtCore.QString(filename)
return default
+
+class CompactPathFcpKeyModule(object):
+ """path module for lib.compactpath to split and join fcp keys"""
+
+ import re
+ KeyPattern = re.compile('(.*? (?: CSK@ | SSK@ | KSK@ | USK@) [^\/]*)(.*)\Z', re.I | re.X)
+
+ @classmethod
+ def join(clss, *components):
+ return ''.join(components)
+
+ @classmethod
+ def split(clss, key):
+ r = clss.KeyPattern.match(key)
+ if r is None:
+ return key, ''
+ return r.group(1), r.group(2)
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|