SF.net SVN: fclient:[685] trunk/fclient/src/fclient
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-19 10:56:57
|
Revision: 685
http://fclient.svn.sourceforge.net/fclient/?rev=685&view=rev
Author: jUrner
Date: 2008-07-19 10:57:04 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
add basic code for downloads widget to the gui
Modified Paths:
--------------
trunk/fclient/src/fclient/config.py
trunk/fclient/src/fclient/fclient.py
Added Paths:
-----------
trunk/fclient/src/fclient/Ui_ViewDownloads.py
trunk/fclient/src/fclient/tpls/Ui_ViewDownloadsWidgetTpl.py
trunk/fclient/src/fclient/tpls/ViewDownloadsWidgetTpl.ui
Added: trunk/fclient/src/fclient/Ui_ViewDownloads.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewDownloads.py (rev 0)
+++ trunk/fclient/src/fclient/Ui_ViewDownloads.py 2008-07-19 10:57:04 UTC (rev 685)
@@ -0,0 +1,96 @@
+""""""
+
+#**************************************************************************************************************
+#TODO:
+#
+# x. prtty tricky to get dls right when the node or client may disconnect unexpectedly
+# problem: dls that we send and that have not reached the node
+# problem: what to do when the user wants to quit and we still have dls to push to the node
+#
+# solution would require keeping track of all requests
+# a. keep identifiers of requests that reached the node (have to do it anyways)
+# b. keep track of requests ahead of sending them to the node (feels not too good doubeling downloads.dat.gz)
+#
+# best idea seems to be to ignore the problem
+# 1. wait till (if ever) freenet devels fdrop node keeping track of client requests
+#
+# 2. a box thrown to the user (x. do not show this message again) to inform him about pendings
+# should be enough. maybe along with a separate widget or some separate color code for pendings
+#
+# x. performance
+# start with a standard model and improve it over time. no need to set any hard
+# limits. the user will find out by himself how many dls his machine can handle.
+# have to be carefrul though when adding dls, like from a *.frdx to provide appropriate
+# warnings
+#**************************************************************************************************************
+from __future__ import absolute_import
+if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below
+ import os; __path__ = [os.path.dirname(__file__)]
+
+from PyQt4 import QtCore, QtGui
+
+from . import config
+from .lib import fcp2
+
+from .tpls.Ui_ViewDownloadsWidgetTpl import Ui_ViewDownloadsWidget
+#**********************************************************************************
+#
+#**********************************************************************************
+class DownloadsViewObject(config.ViewObject):
+
+ def __init__(self, parent):
+ config.ViewObject. __init__(self, parent)
+
+ self.name=parent.objectName()
+ self.displayName=self.trUtf8('Downloads')
+ self.icon=QtGui.QIcon()
+
+
+#**********************************************************************************
+#
+#**********************************************************************************
+class Model(QtGui.QStandardItemModel):
+
+ def __init__(self, parent=None):
+ pass
+
+#**********************************************************************************
+#
+#**********************************************************************************
+class ViewDownloadsWidget(QtGui.QWidget, Ui_ViewDownloadsWidget):
+
+ IdTreeView = 'treeView'
+
+
+ def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
+ QtGui.QWidget.__init__(self, parent)
+ self._isCreated = False
+
+ self.setupUi(self)
+
+ self.fcViewObject = DownloadsViewObject(self)
+
+ def viewClose(self):
+ pass
+
+#**********************************************************************************
+#
+#**********************************************************************************
+if __name__ == '__main__':
+ import sys
+ from . import Ui_View
+ from . import Ui_ViewConnection
+ from . import Ui_ViewLogger
+
+
+ app = QtGui.QApplication(sys.argv)
+ w = Ui_View.ViewWidget(None)
+ w.addTopViews(
+ Ui_ViewConnection.ViewConnectionWidget(None),
+ ViewDownloadsWidget(None),
+ )
+ w.addBottomViews(Ui_ViewLogger.ViewLoggerWidget(None))
+
+ w.show()
+ res = app.exec_()
+ sys.exit(res)
\ No newline at end of file
Modified: trunk/fclient/src/fclient/config.py
===================================================================
--- trunk/fclient/src/fclient/config.py 2008-07-19 10:55:05 UTC (rev 684)
+++ trunk/fclient/src/fclient/config.py 2008-07-19 10:57:04 UTC (rev 685)
@@ -35,6 +35,7 @@
IdViewWidget = 'ViewWidget'
IdViewBrowserWidget = 'ViewBrowserWidget'
IdViewConnectionWidget = 'ViewConnectionWidget'
+IdViewLoggerWidget = 'ViewDownloadsWidget'
IdViewLoggerWidget = 'ViewLoggerWidget'
Modified: trunk/fclient/src/fclient/fclient.py
===================================================================
--- trunk/fclient/src/fclient/fclient.py 2008-07-19 10:55:05 UTC (rev 684)
+++ trunk/fclient/src/fclient/fclient.py 2008-07-19 10:57:04 UTC (rev 685)
@@ -10,6 +10,7 @@
from .Ui_View import ViewWidget
from .Ui_ViewBrowser import ViewBrowserWidget
from .Ui_ViewConnection import ViewConnectionWidget
+from .Ui_ViewDownloads import ViewDownloadsWidget
from .Ui_ViewLogger import ViewLoggerWidget
#*************************************************************
#
@@ -25,6 +26,7 @@
viewWidget.addTopViews(
ViewConnectionWidget(mainWindow),
ViewBrowserWidget(mainWindow),
+ ViewDownloadsWidget(mainWindow),
)
viewWidget.addBottomViews(ViewLoggerWidget(mainWindow))
Added: trunk/fclient/src/fclient/tpls/Ui_ViewDownloadsWidgetTpl.py
===================================================================
--- trunk/fclient/src/fclient/tpls/Ui_ViewDownloadsWidgetTpl.py (rev 0)
+++ trunk/fclient/src/fclient/tpls/Ui_ViewDownloadsWidgetTpl.py 2008-07-19 10:57:04 UTC (rev 685)
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/me/src/proj/fclient/trunk/fclient/src/fclient/tpls/ViewDownloadsWidgetTpl.ui'
+#
+# Created: Sat Jul 19 12:46:32 2008
+# by: PyQt4 UI code generator 4.4.3-snapshot-20080705
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_ViewDownloadsWidget(object):
+ def setupUi(self, ViewDownloadsWidget):
+ ViewDownloadsWidget.setObjectName("ViewDownloadsWidget")
+ ViewDownloadsWidget.resize(400, 300)
+ self.gridLayout = QtGui.QGridLayout(ViewDownloadsWidget)
+ self.gridLayout.setObjectName("gridLayout")
+ self.treeView = QtGui.QTreeView(ViewDownloadsWidget)
+ self.treeView.setObjectName("treeView")
+ self.gridLayout.addWidget(self.treeView, 0, 0, 1, 1)
+
+ self.retranslateUi(ViewDownloadsWidget)
+ QtCore.QMetaObject.connectSlotsByName(ViewDownloadsWidget)
+
+ def retranslateUi(self, ViewDownloadsWidget):
+ ViewDownloadsWidget.setWindowTitle(QtGui.QApplication.translate("ViewDownloadsWidget", "Form", None, QtGui.QApplication.UnicodeUTF8))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtGui.QApplication(sys.argv)
+ ViewDownloadsWidget = QtGui.QWidget()
+ ui = Ui_ViewDownloadsWidget()
+ ui.setupUi(ViewDownloadsWidget)
+ ViewDownloadsWidget.show()
+ sys.exit(app.exec_())
+
Added: trunk/fclient/src/fclient/tpls/ViewDownloadsWidgetTpl.ui
===================================================================
--- trunk/fclient/src/fclient/tpls/ViewDownloadsWidgetTpl.ui (rev 0)
+++ trunk/fclient/src/fclient/tpls/ViewDownloadsWidgetTpl.ui 2008-07-19 10:57:04 UTC (rev 685)
@@ -0,0 +1,23 @@
+<ui version="4.0" >
+ <class>ViewDownloadsWidget</class>
+ <widget class="QWidget" name="ViewDownloadsWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTreeView" name="treeView" />
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|