Thread: SF.net SVN: fclient:[662] trunk/fclient/src/fclient/Ui_ViewConnection.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-17 16:06:24
|
Revision: 662
http://fclient.svn.sourceforge.net/fclient/?rev=662&view=rev
Author: jUrner
Date: 2008-07-17 16:06:23 +0000 (Thu, 17 Jul 2008)
Log Message:
-----------
naming ++ this and that
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-17 16:04:41 UTC (rev 661)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-17 16:06:23 UTC (rev 662)
@@ -27,7 +27,7 @@
# menus
self.menus = []
if self.menuBar is not None:
- menu = QtGui.QMenu(parent.fclientViewObject.displayName, self.menuBar)
+ menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar)
parent.populateMenu(menu)
self.menus.append(menu)
self.menuBar.addViewMenu(menu)
@@ -75,17 +75,17 @@
def __init__(self,parent):
QtCore.QTimer.__init__(self, parent)
self.fcpIterConnect = None
- self.connect(self, QtCore.SIGNAL('timeout()'), self.handleNext)
+ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext)
def start(self, settings):
self.fcpIterConnect = config.fcpClient.iterConnect(
duration=settings.value('ConnectionTimerMaxDuration'),
timeout=0
)
- if not self.handleNext():
+ if not self.onNext():
QtCore.QTimer.start(self, settings.value('ConnectionTimerTimeout'))
- def handleNext(self):
+ def onNext(self):
try:
result = self.fcpIterConnect.next()
except StopIteration:
@@ -105,12 +105,12 @@
def __init__(self,parent):
QtCore.QTimer.__init__(self, parent)
- self.connect(self, QtCore.SIGNAL('timeout()'), self.handleNext)
+ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext)
def start(self, settings):
QtCore.QTimer.start(self, settings.value('PollTimerTimeout'))
- def handleNext(self):
+ def onNext(self):
if config.fcpClient.isConnected():
result = config.fcpClient.next()
@@ -130,20 +130,20 @@
self._isCreated = False
self._connectionTimer = ConnectionTimer(self)
self._pollTimer = PollTimer(self)
- self._fcpEventHandlers = (
- (config.fcpClient.events.ClientConnected, self.handleFcpClientConected),
- (config.fcpClient.events.ClientDisconnected, self.handleFcpClientDisconected),
+ self._fcpEventonrs = (
+ (config.fcpClient.events.ClientConnected, self.onFcpClientConected),
+ (config.fcpClient.events.ClientDisconnected, self.onFcpClientDisconected),
)
- config.fcpClient.events += self._fcpEventHandlers
+ config.fcpClient.events += self._fcpEventonrs
self._mainWindowMenus = ()
self.setupUi(self)
config.ObjectRegistry.register(self)
- self.fclientSettings = Settings().restore()
- self.fclientActions = Actions(self)
- self.fclientViewObject = ConnectionViewObject(self)
- self.fclientGlobalFeedback = GlobalFeedback(self, idFeedbackParent)
+ self.fcSettings = Settings().restore()
+ self.fcActions = Actions(self)
+ self.fcViewObject = ConnectionViewObject(self)
+ self.fcGlobalFeedback = GlobalFeedback(self, idFeedbackParent)
@@ -161,7 +161,7 @@
## view methods
#########################################
def viewClose(self):
- config.fcpClient.events -= self._fcpEventHandlers
+ config.fcpClient.events -= self._fcpEventonrs
#########################################
## overwritten events
@@ -170,31 +170,31 @@
self.viewClose()
def hideEvent(self, event):
- self.fclientGlobalFeedback.setVisible(False)
+ self.fcGlobalFeedback.setVisible(False)
def showEvent(self, event):
- self.fclientGlobalFeedback.setVisible(True)
+ self.fcGlobalFeedback.setVisible(True)
if self._isCreated:
return
self._isCreated = True
# setup host / port boxes
edHost = self.controlById(self.IdEdConnectionHost)
- edHost.setText(self.fclientSettings.value('ConnectionHost'))
+ edHost.setText(self.fcSettings.value('ConnectionHost'))
spinPort = self.controlById(self.IdSpinConnectionPort)
spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable
- spinPort.setValue(self.fclientSettings.value('ConnectionPort'))
+ spinPort.setValue(self.fcSettings.value('ConnectionPort'))
# setup Connect button and AutoConnect checkbox
- doAutoConnect = self.fclientSettings.value('AutoConnect')
+ doAutoConnect = self.fcSettings.value('AutoConnect')
ck = self.controlById(self.IdckAutoConnect)
ck.setChecked(doAutoConnect)
- self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.handleCkAutoConnectStateChanged)
+ self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkAutoConnectStateChanged)
bt = self.controlById(self.IdBtConnect)
- self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.handleBtConnectClicked)
+ self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.onBtConnectClicked)
if doAutoConnect:
self.controlById(self.IdBtConnect).click()
@@ -208,15 +208,15 @@
#########################################
- ## event handlers
+ ## event onrs
#########################################
- def handleBtConnectClicked(self, isChecked):
+ def onBtConnectClicked(self, isChecked):
bt = self.controlById(self.IdBtConnect)
bt.setText(self.trUtf8('Disconnect') if isChecked else self.trUtf8('Connect'))
if isChecked:
if config.fcpClient.isConnected():
config.fcpClient.close()
- self._connectionTimer.start(self.fclientSettings)
+ self._connectionTimer.start(self.fcSettings)
else:
self._connectionTimer.stop()
if config.fcpClient.isConnected():
@@ -224,19 +224,19 @@
config.fcpClient.close()
- def handleCkAutoConnectStateChanged(self, state):
- self.fclientSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
+ def onCkAutoConnectStateChanged(self, state):
+ self.fcSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
#########################################
- ## fcp event handlers
+ ## fcp event onrs
#########################################
- def handleFcpClientDisconected(self, event, msg):
+ def onFcpClientDisconected(self, event, msg):
bt = self.controlById(self.IdBtConnect)
if bt.isChecked():
bt.click()
- def handleFcpClientConected(self, event, msg):
- self._pollTimer.start(self.fclientSettings)
+ def onFcpClientConected(self, event, msg):
+ self._pollTimer.start(self.fcSettings)
#**********************************************************************************
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-18 02:58:32
|
Revision: 667
http://fclient.svn.sourceforge.net/fclient/?rev=667&view=rev
Author: jUrner
Date: 2008-07-18 02:58:41 +0000 (Fri, 18 Jul 2008)
Log Message:
-----------
ViewObject is now in config
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-18 02:58:19 UTC (rev 666)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-18 02:58:41 UTC (rev 667)
@@ -7,7 +7,6 @@
from . import config
from .lib import fcp2
-from . import Ui_View
from .tpls.Ui_ViewConnectionWidgetTpl import Ui_ViewConnectionWidget
#**********************************************************************************
@@ -57,10 +56,10 @@
('ConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort, config.SettingScopeUser),
)
-class ConnectionViewObject(Ui_View.ViewObject):
+class ConnectionViewObject(config.ViewObject):
def __init__(self, parent):
- Ui_View.ViewObject. __init__(self, parent)
+ config.ViewObject. __init__(self, parent)
self.name=parent.objectName()
self.displayName=self.trUtf8('Connection')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-19 06:36:50
|
Revision: 673
http://fclient.svn.sourceforge.net/fclient/?rev=673&view=rev
Author: jUrner
Date: 2008-07-19 06:36:58 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
naming
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-19 06:36:49 UTC (rev 672)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-19 06:36:58 UTC (rev 673)
@@ -19,28 +19,27 @@
class GlobalFeedback(config.GlobalFeedbackBase):
"""wrapper for global statusbar widgets, menus"""
- def __init__(self, parent, idFeedbackParent):
- config.GlobalFeedbackBase.__init__(self, parent, idFeedbackParent)
+ def __init__(idGlobalFeedback, parent, idFeedbackParent):
+ config.GlobalFeedbackBase.__init__(idGlobalFeedback, parent, idFeedbackParent)
-
# menus
- self.menus = []
- if self.menuBar is not None:
- menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar)
+ idGlobalFeedback.menus = []
+ if idGlobalFeedback.menuBar is not None and hasattr(parent, 'fcViewObject'):
+ menu = QtGui.QMenu(parent.fcViewObject.displayName, idGlobalFeedback.menuBar)
parent.populateMenu(menu)
- self.menus.append(menu)
- self.menuBar.addViewMenu(menu)
+ idGlobalFeedback.menus.append(menu)
+ idGlobalFeedback.menuBar.addViewMenu(menu)
# status bar widgets
- self.label1 = None
- #if self.statusBar is not None:
- # self.label1 = QtGui.QLabel('foo here', self.statusBar)
+ idGlobalFeedback.label1 = None
+ #if idGlobalFeedback.statusBar is not None:
+ # idGlobalFeedback.label1 = QtGui.QLabel('foo here', idGlobalFeedback.statusBar)
- def setVisible(self, flag):
- for menu in self.menus:
+ def setVisible(idGlobalFeedback, flag):
+ for menu in idGlobalFeedback.menus:
menu.children()[0].setVisible(flag)
- if self.label1 is not None:
- self.label1.setVisible(flag)
+ if idGlobalFeedback.label1 is not None:
+ idGlobalFeedback.label1.setVisible(flag)
class Settings(config.SettingsBase):
@@ -58,12 +57,12 @@
class ConnectionViewObject(config.ViewObject):
- def __init__(self, parent):
- config.ViewObject. __init__(self, parent)
+ def __init__(idGlobalFeedback, parent):
+ config.ViewObject. __init__(idGlobalFeedback, parent)
- self.name=parent.objectName()
- self.displayName=self.trUtf8('Connection')
- self.icon=QtGui.QIcon()
+ idGlobalFeedback.name=parent.objectName()
+ idGlobalFeedback.displayName=idGlobalFeedback.trUtf8('Connection')
+ idGlobalFeedback.icon=QtGui.QIcon()
#**********************************************************************************
@@ -71,27 +70,27 @@
#**********************************************************************************
class ConnectionTimer(QtCore.QTimer):
- def __init__(self,parent):
- QtCore.QTimer.__init__(self, parent)
- self.fcpIterConnect = None
- self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext)
+ def __init__(idGlobalFeedback,parent):
+ QtCore.QTimer.__init__(idGlobalFeedback, parent)
+ idGlobalFeedback.fcpIterConnect = None
+ idGlobalFeedback.connect(idGlobalFeedback, QtCore.SIGNAL('timeout()'), idGlobalFeedback.onNext)
- def start(self, settings):
- self.fcpIterConnect = config.fcpClient.iterConnect(
+ def start(idGlobalFeedback, settings):
+ idGlobalFeedback.fcpIterConnect = config.fcpClient.iterConnect(
duration=settings.value('ConnectionTimerMaxDuration'),
timeout=0
)
- if not self.onNext():
- QtCore.QTimer.start(self, settings.value('ConnectionTimerTimeout'))
+ if not idGlobalFeedback.onNext():
+ QtCore.QTimer.start(idGlobalFeedback, settings.value('ConnectionTimerTimeout'))
- def onNext(self):
+ def onNext(idGlobalFeedback):
try:
- result = self.fcpIterConnect.next()
+ result = idGlobalFeedback.fcpIterConnect.next()
except StopIteration:
- self.stop()
+ idGlobalFeedback.stop()
else:
if result is not None:
- self.stop()
+ idGlobalFeedback.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
@@ -102,14 +101,14 @@
class PollTimer(QtCore.QTimer):
- def __init__(self,parent):
- QtCore.QTimer.__init__(self, parent)
- self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext)
+ def __init__(idGlobalFeedback,parent):
+ QtCore.QTimer.__init__(idGlobalFeedback, parent)
+ idGlobalFeedback.connect(idGlobalFeedback, QtCore.SIGNAL('timeout()'), idGlobalFeedback.onNext)
- def start(self, settings):
- QtCore.QTimer.start(self, settings.value('PollTimerTimeout'))
+ def start(idGlobalFeedback, settings):
+ QtCore.QTimer.start(idGlobalFeedback, settings.value('PollTimerTimeout'))
- def onNext(self):
+ def onNext(idGlobalFeedback):
if config.fcpClient.isConnected():
result = config.fcpClient.next()
@@ -123,119 +122,119 @@
IdEdConnectionHost = 'edConnectionHost' #TODO: combobox? validate input.
IdSpinConnectionPort = 'spinConnectionPort'
- def __init__(self, parent, idFeedbackParent=config.IdMainWindow):
- QtGui.QWidget.__init__(self, parent)
+ def __init__(idGlobalFeedback, parent, idFeedbackParent=config.IdMainWindow):
+ QtGui.QWidget.__init__(idGlobalFeedback, parent)
- self._isCreated = False
- self._connectionTimer = ConnectionTimer(self)
- self._pollTimer = PollTimer(self)
- self._fcpEventonrs = (
- (config.fcpClient.events.ClientConnected, self.onFcpClientConected),
- (config.fcpClient.events.ClientDisconnected, self.onFcpClientDisconected),
+ idGlobalFeedback._isCreated = False
+ idGlobalFeedback._connectionTimer = ConnectionTimer(idGlobalFeedback)
+ idGlobalFeedback._pollTimer = PollTimer(idGlobalFeedback)
+ idGlobalFeedback._fcpEventonrs = (
+ (config.fcpClient.events.ClientConnected, idGlobalFeedback.onFcpClientConected),
+ (config.fcpClient.events.ClientDisconnected, idGlobalFeedback.onFcpClientDisconected),
)
- config.fcpClient.events += self._fcpEventonrs
- self._mainWindowMenus = ()
+ config.fcpClient.events += idGlobalFeedback._fcpEventonrs
+ idGlobalFeedback._mainWindowMenus = ()
- self.setupUi(self)
- config.ObjectRegistry.register(self)
- self.fcSettings = Settings().restore()
- self.fcActions = Actions(self)
- self.fcViewObject = ConnectionViewObject(self)
- self.fcGlobalFeedback = GlobalFeedback(self, idFeedbackParent)
+ idGlobalFeedback.setupUi(idGlobalFeedback)
+ config.ObjectRegistry.register(idGlobalFeedback)
+ idGlobalFeedback.fcSettings = Settings().restore()
+ idGlobalFeedback.fcActions = Actions(idGlobalFeedback)
+ idGlobalFeedback.fcViewObject = ConnectionViewObject(idGlobalFeedback)
+ idGlobalFeedback.fcGlobalFeedback = GlobalFeedback(idGlobalFeedback, idFeedbackParent)
#########################################
## methods
#########################################
- def controlById(self, idControl):
- return getattr(self, idControl)
+ def controlById(idGlobalFeedback, idControl):
+ return getattr(idGlobalFeedback, idControl)
- def populateMenu(self, menu):
+ def populateMenu(idGlobalFeedback, menu):
return menu
#########################################
## view methods
#########################################
- def viewClose(self):
- config.fcpClient.events -= self._fcpEventonrs
+ def viewClose(idGlobalFeedback):
+ config.fcpClient.events -= idGlobalFeedback._fcpEventonrs
#########################################
## overwritten events
#########################################
- def closeEvent(self, event):
- self.viewClose()
+ def closeEvent(idGlobalFeedback, event):
+ idGlobalFeedback.viewClose()
- def hideEvent(self, event):
- self.fcGlobalFeedback.setVisible(False)
+ def hideEvent(idGlobalFeedback, event):
+ idGlobalFeedback.fcGlobalFeedback.setVisible(False)
- def showEvent(self, event):
- self.fcGlobalFeedback.setVisible(True)
- if self._isCreated:
+ def showEvent(idGlobalFeedback, event):
+ idGlobalFeedback.fcGlobalFeedback.setVisible(True)
+ if idGlobalFeedback._isCreated:
return
- self._isCreated = True
+ idGlobalFeedback._isCreated = True
# setup host / port boxes
- edHost = self.controlById(self.IdEdConnectionHost)
- edHost.setText(self.fcSettings.value('ConnectionHost'))
+ edHost = idGlobalFeedback.controlById(idGlobalFeedback.IdEdConnectionHost)
+ edHost.setText(idGlobalFeedback.fcSettings.value('ConnectionHost'))
- spinPort = self.controlById(self.IdSpinConnectionPort)
+ spinPort = idGlobalFeedback.controlById(idGlobalFeedback.IdSpinConnectionPort)
spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable
- spinPort.setValue(self.fcSettings.value('ConnectionPort'))
+ spinPort.setValue(idGlobalFeedback.fcSettings.value('ConnectionPort'))
# setup Connect button and AutoConnect checkbox
- doAutoConnect = self.fcSettings.value('AutoConnect')
- ck = self.controlById(self.IdckAutoConnect)
+ doAutoConnect = idGlobalFeedback.fcSettings.value('AutoConnect')
+ ck = idGlobalFeedback.controlById(idGlobalFeedback.IdckAutoConnect)
ck.setChecked(doAutoConnect)
- self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkAutoConnectStateChanged)
+ idGlobalFeedback.connect(ck, QtCore.SIGNAL('stateChanged(int)'), idGlobalFeedback.onCkAutoConnectStateChanged)
- bt = self.controlById(self.IdBtConnect)
- self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.onBtConnectClicked)
+ bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
+ idGlobalFeedback.connect(bt, QtCore.SIGNAL('clicked(bool)'), idGlobalFeedback.onBtConnectClicked)
if doAutoConnect:
- self.controlById(self.IdBtConnect).click()
+ idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect).click()
########################################
## overwritten methods
#########################################
- def retranslateUi(self, w):
- Ui_ViewConnectionWidget.retranslateUi(self, w)
- bt = self.controlById(self.IdBtConnect)
- bt.setText(self.trUtf8('Disconnect') if bt.isChecked() else self.trUtf8('Connect'))
+ def retranslateUi(idGlobalFeedback, w):
+ Ui_ViewConnectionWidget.retranslateUi(idGlobalFeedback, w)
+ bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
+ bt.setText(idGlobalFeedback.trUtf8('Disconnect') if bt.isChecked() else idGlobalFeedback.trUtf8('Connect'))
#########################################
## event onrs
#########################################
- def onBtConnectClicked(self, isChecked):
- bt = self.controlById(self.IdBtConnect)
- bt.setText(self.trUtf8('Disconnect') if isChecked else self.trUtf8('Connect'))
+ def onBtConnectClicked(idGlobalFeedback, isChecked):
+ bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
+ bt.setText(idGlobalFeedback.trUtf8('Disconnect') if isChecked else idGlobalFeedback.trUtf8('Connect'))
if isChecked:
if config.fcpClient.isConnected():
config.fcpClient.close()
- self._connectionTimer.start(self.fcSettings)
+ idGlobalFeedback._connectionTimer.start(idGlobalFeedback.fcSettings)
else:
- self._connectionTimer.stop()
+ idGlobalFeedback._connectionTimer.stop()
if config.fcpClient.isConnected():
- self._pollTimer.stop()
+ idGlobalFeedback._pollTimer.stop()
config.fcpClient.close()
- def onCkAutoConnectStateChanged(self, state):
- self.fcSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
+ def onCkAutoConnectStateChanged(idGlobalFeedback, state):
+ idGlobalFeedback.fcSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
#########################################
## fcp event onrs
#########################################
- def onFcpClientDisconected(self, event, msg):
- bt = self.controlById(self.IdBtConnect)
+ def onFcpClientDisconected(idGlobalFeedback, event, msg):
+ bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
if bt.isChecked():
bt.click()
- def onFcpClientConected(self, event, msg):
- self._pollTimer.start(self.fcSettings)
+ def onFcpClientConected(idGlobalFeedback, event, msg):
+ idGlobalFeedback._pollTimer.start(idGlobalFeedback.fcSettings)
#**********************************************************************************
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-19 09:48:37
|
Revision: 682
http://fclient.svn.sourceforge.net/fclient/?rev=682&view=rev
Author: jUrner
Date: 2008-07-19 09:48:44 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
some notes
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-19 09:19:07 UTC (rev 681)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-19 09:48:44 UTC (rev 682)
@@ -1,7 +1,18 @@
+#*********************************************************************
+#NOTES:
+#
+# current handling is:
+# 1. connect to fcp client
+# 2. query config
+#
+# all listebners interested in fcp client should take arrival of config
+# as signal to start doing whatever
+#
+#*********************************************************************
+
from __future__ import absolute_import
if __name__ == '__main__': # see --> http://bugs.python.org/issue1510172 . works only current dir and below
import os; __path__ = [os.path.dirname(__file__)]
-
from PyQt4 import QtCore, QtGui
@@ -241,7 +252,7 @@
#**********************************************************************************
if __name__ == '__main__':
import sys
- from . import Ui_ViewLogger
+ from . import Ui_View, Ui_ViewLogger
app = QtGui.QApplication(sys.argv)
w = Ui_View.ViewWidget(None)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-19 12:53:03
|
Revision: 687
http://fclient.svn.sourceforge.net/fclient/?rev=687&view=rev
Author: jUrner
Date: 2008-07-19 12:53:07 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
ups, rename error
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-19 12:52:44 UTC (rev 686)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-19 12:53:07 UTC (rev 687)
@@ -30,33 +30,33 @@
class GlobalFeedback(config.GlobalFeedbackBase):
"""wrapper for global statusbar widgets, menus"""
- def __init__(idGlobalFeedback, parent, idFeedbackParent):
- config.GlobalFeedbackBase.__init__(idGlobalFeedback, parent, idFeedbackParent)
+ def __init__(self, parent,idGlobalFeedback):
+ config.GlobalFeedbackBase.__init__(self, parent,idGlobalFeedback)
# menus
- idGlobalFeedback.menus = []
- if idGlobalFeedback.menuBar is not None and hasattr(parent, 'fcViewObject'):
- menu = QtGui.QMenu(parent.fcViewObject.displayName, idGlobalFeedback.menuBar)
+ self.menus = []
+ if self.menuBar is not None and hasattr(parent, 'fcViewObject'):
+ menu = QtGui.QMenu(parent.fcViewObject.displayName, self.menuBar)
parent.populateMenu(menu)
- idGlobalFeedback.menus.append(menu)
- idGlobalFeedback.menuBar.addViewMenu(menu)
+ self.menus.append(menu)
+ self.menuBar.addViewMenu(menu)
# status bar widgets
- idGlobalFeedback.label1 = None
- #if idGlobalFeedback.statusBar is not None:
- # idGlobalFeedback.label1 = QtGui.QLabel('foo here', idGlobalFeedback.statusBar)
+ self.label1 = None
+ #if self.statusBar is not None:
+ # self.label1 = QtGui.QLabel('foo here', self.statusBar)
- def setVisible(idGlobalFeedback, flag):
- for menu in idGlobalFeedback.menus:
+ def setVisible(self, flag):
+ for menu in self.menus:
menu.children()[0].setVisible(flag)
- if idGlobalFeedback.label1 is not None:
- idGlobalFeedback.label1.setVisible(flag)
+ if self.label1 is not None:
+ self.label1.setVisible(flag)
class Settings(config.SettingsBase):
_key_ = config.IdViewConnectionWidget
_settings_ = (
- ('ConnectionTimerTimeout', 'UInt', 800, config.SettingScopeExpert),
+ ('ConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert),
('ConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert),
('PollTimerTimeout', 'UInt', 200, config.SettingScopeExpert),
@@ -68,12 +68,12 @@
class ConnectionViewObject(config.ViewObject):
- def __init__(idGlobalFeedback, parent):
- config.ViewObject. __init__(idGlobalFeedback, parent)
+ def __init__(self, parent):
+ config.ViewObject. __init__(self, parent)
- idGlobalFeedback.name=parent.objectName()
- idGlobalFeedback.displayName=idGlobalFeedback.trUtf8('Connection')
- idGlobalFeedback.icon=QtGui.QIcon()
+ self.name=parent.objectName()
+ self.displayName=self.trUtf8('Connection')
+ self.icon=QtGui.QIcon()
#**********************************************************************************
@@ -81,27 +81,27 @@
#**********************************************************************************
class ConnectionTimer(QtCore.QTimer):
- def __init__(idGlobalFeedback,parent):
- QtCore.QTimer.__init__(idGlobalFeedback, parent)
- idGlobalFeedback.fcpIterConnect = None
- idGlobalFeedback.connect(idGlobalFeedback, QtCore.SIGNAL('timeout()'), idGlobalFeedback.onNext)
+ def __init__(self,parent):
+ QtCore.QTimer.__init__(self, parent)
+ self.fcpIterConnect = None
+ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext)
- def start(idGlobalFeedback, settings):
- idGlobalFeedback.fcpIterConnect = config.fcpClient.iterConnect(
+ def start(self, settings):
+ self.fcpIterConnect = config.fcpClient.iterConnect(
duration=settings.value('ConnectionTimerMaxDuration'),
timeout=0
)
- if not idGlobalFeedback.onNext():
- QtCore.QTimer.start(idGlobalFeedback, settings.value('ConnectionTimerTimeout'))
+ if not self.onNext():
+ QtCore.QTimer.start(self, settings.value('ConnectionTimerTimeout'))
- def onNext(idGlobalFeedback):
+ def onNext(self):
try:
- result = idGlobalFeedback.fcpIterConnect.next()
+ result = self.fcpIterConnect.next()
except StopIteration:
- idGlobalFeedback.stop()
+ self.stop()
else:
if result is not None:
- idGlobalFeedback.stop()
+ 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
@@ -112,14 +112,14 @@
class PollTimer(QtCore.QTimer):
- def __init__(idGlobalFeedback,parent):
- QtCore.QTimer.__init__(idGlobalFeedback, parent)
- idGlobalFeedback.connect(idGlobalFeedback, QtCore.SIGNAL('timeout()'), idGlobalFeedback.onNext)
+ def __init__(self,parent):
+ QtCore.QTimer.__init__(self, parent)
+ self.connect(self, QtCore.SIGNAL('timeout()'), self.onNext)
- def start(idGlobalFeedback, settings):
- QtCore.QTimer.start(idGlobalFeedback, settings.value('PollTimerTimeout'))
+ def start(self, settings):
+ QtCore.QTimer.start(self, settings.value('PollTimerTimeout'))
- def onNext(idGlobalFeedback):
+ def onNext(self):
if config.fcpClient.isConnected():
result = config.fcpClient.next()
@@ -133,119 +133,119 @@
IdEdConnectionHost = 'edConnectionHost' #TODO: combobox? validate input.
IdSpinConnectionPort = 'spinConnectionPort'
- def __init__(idGlobalFeedback, parent, idFeedbackParent=config.IdMainWindow):
- QtGui.QWidget.__init__(idGlobalFeedback, parent)
+ def __init__(self, parent,idGlobalFeedback=config.IdMainWindow):
+ QtGui.QWidget.__init__(self, parent)
- idGlobalFeedback._isCreated = False
- idGlobalFeedback._connectionTimer = ConnectionTimer(idGlobalFeedback)
- idGlobalFeedback._pollTimer = PollTimer(idGlobalFeedback)
- idGlobalFeedback._fcpEventonrs = (
- (config.fcpClient.events.ClientConnected, idGlobalFeedback.onFcpClientConected),
- (config.fcpClient.events.ClientDisconnected, idGlobalFeedback.onFcpClientDisconected),
+ self._isCreated = False
+ self._connectionTimer = ConnectionTimer(self)
+ self._pollTimer = PollTimer(self)
+ self._fcpEventonrs = (
+ (config.fcpClient.events.ClientConnected, self.onFcpClientConected),
+ (config.fcpClient.events.ClientDisconnected, self.onFcpClientDisconected),
)
- config.fcpClient.events += idGlobalFeedback._fcpEventonrs
- idGlobalFeedback._mainWindowMenus = ()
+ config.fcpClient.events += self._fcpEventonrs
+ self._mainWindowMenus = ()
- idGlobalFeedback.setupUi(idGlobalFeedback)
- config.ObjectRegistry.register(idGlobalFeedback)
- idGlobalFeedback.fcSettings = Settings().restore()
- idGlobalFeedback.fcActions = Actions(idGlobalFeedback)
- idGlobalFeedback.fcViewObject = ConnectionViewObject(idGlobalFeedback)
- idGlobalFeedback.fcGlobalFeedback = GlobalFeedback(idGlobalFeedback, idFeedbackParent)
+ self.setupUi(self)
+ config.ObjectRegistry.register(self)
+ self.fcSettings = Settings().restore()
+ self.fcActions = Actions(self)
+ self.fcViewObject = ConnectionViewObject(self)
+ self.fcGlobalFeedback = GlobalFeedback(self,idGlobalFeedback)
#########################################
## methods
#########################################
- def controlById(idGlobalFeedback, idControl):
- return getattr(idGlobalFeedback, idControl)
+ def controlById(self, idControl):
+ return getattr(self, idControl)
- def populateMenu(idGlobalFeedback, menu):
+ def populateMenu(self, menu):
return menu
#########################################
## view methods
#########################################
- def viewClose(idGlobalFeedback):
- config.fcpClient.events -= idGlobalFeedback._fcpEventonrs
+ def viewClose(self):
+ config.fcpClient.events -= self._fcpEventonrs
#########################################
## overwritten events
#########################################
- def closeEvent(idGlobalFeedback, event):
- idGlobalFeedback.viewClose()
+ def closeEvent(self, event):
+ self.viewClose()
- def hideEvent(idGlobalFeedback, event):
- idGlobalFeedback.fcGlobalFeedback.setVisible(False)
+ def hideEvent(self, event):
+ self.fcGlobalFeedback.setVisible(False)
- def showEvent(idGlobalFeedback, event):
- idGlobalFeedback.fcGlobalFeedback.setVisible(True)
- if idGlobalFeedback._isCreated:
+ def showEvent(self, event):
+ self.fcGlobalFeedback.setVisible(True)
+ if self._isCreated:
return
- idGlobalFeedback._isCreated = True
+ self._isCreated = True
# setup host / port boxes
- edHost = idGlobalFeedback.controlById(idGlobalFeedback.IdEdConnectionHost)
- edHost.setText(idGlobalFeedback.fcSettings.value('ConnectionHost'))
+ edHost = self.controlById(self.IdEdConnectionHost)
+ edHost.setText(self.fcSettings.value('ConnectionHost'))
- spinPort = idGlobalFeedback.controlById(idGlobalFeedback.IdSpinConnectionPort)
+ spinPort = self.controlById(self.IdSpinConnectionPort)
spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable
- spinPort.setValue(idGlobalFeedback.fcSettings.value('ConnectionPort'))
+ spinPort.setValue(self.fcSettings.value('ConnectionPort'))
# setup Connect button and AutoConnect checkbox
- doAutoConnect = idGlobalFeedback.fcSettings.value('AutoConnect')
- ck = idGlobalFeedback.controlById(idGlobalFeedback.IdckAutoConnect)
+ doAutoConnect = self.fcSettings.value('AutoConnect')
+ ck = self.controlById(self.IdckAutoConnect)
ck.setChecked(doAutoConnect)
- idGlobalFeedback.connect(ck, QtCore.SIGNAL('stateChanged(int)'), idGlobalFeedback.onCkAutoConnectStateChanged)
+ self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkAutoConnectStateChanged)
- bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
- idGlobalFeedback.connect(bt, QtCore.SIGNAL('clicked(bool)'), idGlobalFeedback.onBtConnectClicked)
+ bt = self.controlById(self.IdBtConnect)
+ self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.onBtConnectClicked)
if doAutoConnect:
- idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect).click()
+ self.controlById(self.IdBtConnect).click()
########################################
## overwritten methods
#########################################
- def retranslateUi(idGlobalFeedback, w):
- Ui_ViewConnectionWidget.retranslateUi(idGlobalFeedback, w)
- bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
- bt.setText(idGlobalFeedback.trUtf8('Disconnect') if bt.isChecked() else idGlobalFeedback.trUtf8('Connect'))
+ def retranslateUi(self, w):
+ Ui_ViewConnectionWidget.retranslateUi(self, w)
+ bt = self.controlById(self.IdBtConnect)
+ bt.setText(self.trUtf8('Disconnect') if bt.isChecked() else self.trUtf8('Connect'))
#########################################
## event onrs
#########################################
- def onBtConnectClicked(idGlobalFeedback, isChecked):
- bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
- bt.setText(idGlobalFeedback.trUtf8('Disconnect') if isChecked else idGlobalFeedback.trUtf8('Connect'))
+ def onBtConnectClicked(self, isChecked):
+ bt = self.controlById(self.IdBtConnect)
+ bt.setText(self.trUtf8('Disconnect') if isChecked else self.trUtf8('Connect'))
if isChecked:
if config.fcpClient.isConnected():
config.fcpClient.close()
- idGlobalFeedback._connectionTimer.start(idGlobalFeedback.fcSettings)
+ self._connectionTimer.start(self.fcSettings)
else:
- idGlobalFeedback._connectionTimer.stop()
+ self._connectionTimer.stop()
if config.fcpClient.isConnected():
- idGlobalFeedback._pollTimer.stop()
+ self._pollTimer.stop()
config.fcpClient.close()
- def onCkAutoConnectStateChanged(idGlobalFeedback, state):
- idGlobalFeedback.fcSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
+ def onCkAutoConnectStateChanged(self, state):
+ self.fcSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
#########################################
## fcp event onrs
#########################################
- def onFcpClientDisconected(idGlobalFeedback, event, msg):
- bt = idGlobalFeedback.controlById(idGlobalFeedback.IdBtConnect)
+ def onFcpClientDisconected(self, event, msg):
+ bt = self.controlById(self.IdBtConnect)
if bt.isChecked():
bt.click()
- def onFcpClientConected(idGlobalFeedback, event, msg):
- idGlobalFeedback._pollTimer.start(idGlobalFeedback.fcSettings)
+ def onFcpClientConected(self, event, msg):
+ self._pollTimer.start(self.fcSettings)
#**********************************************************************************
#
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-21 10:59:35
|
Revision: 714
http://fclient.svn.sourceforge.net/fclient/?rev=714&view=rev
Author: jUrner
Date: 2008-07-21 10:59:00 +0000 (Mon, 21 Jul 2008)
Log Message:
-----------
beautify
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-21 10:57:23 UTC (rev 713)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-21 10:59:00 UTC (rev 714)
@@ -133,7 +133,7 @@
IdEdConnectionHost = 'edConnectionHost' #TODO: combobox? validate input.
IdSpinConnectionPort = 'spinConnectionPort'
- def __init__(self, parent,idGlobalFeedback=config.IdMainWindow):
+ def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
QtGui.QWidget.__init__(self, parent)
self._isCreated = False
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jU...@us...> - 2008-07-25 07:14:10
|
Revision: 737
http://fclient.svn.sourceforge.net/fclient/?rev=737&view=rev
Author: jUrner
Date: 2008-07-25 07:14:19 +0000 (Fri, 25 Jul 2008)
Log Message:
-----------
fproxy is set now on connection pane
Modified Paths:
--------------
trunk/fclient/src/fclient/Ui_ViewConnection.py
Modified: trunk/fclient/src/fclient/Ui_ViewConnection.py
===================================================================
--- trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-25 07:13:57 UTC (rev 736)
+++ trunk/fclient/src/fclient/Ui_ViewConnection.py 2008-07-25 07:14:19 UTC (rev 737)
@@ -59,11 +59,6 @@
('ConnectionTimerTimeout', 'UInt', 500, config.SettingScopeExpert),
('ConnectionTimerMaxDuration', 'UInt', 20, config.SettingScopeExpert),
('PollTimerTimeout', 'UInt', 200, config.SettingScopeExpert),
-
- ('AutoConnect', 'Bool', False, config.SettingScopeUser),
- ('ConnectionName', 'String', '', config.SettingScopeUser), #TODO: we need a python ansi string
- ('ConnectionHost', 'String', fcp2.Client.DefaultFcpHost, config.SettingScopeUser),
- ('ConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort, config.SettingScopeUser),
)
class ConnectionViewObject(config.ViewObject):
@@ -129,10 +124,13 @@
class ViewConnectionWidget(QtGui.QWidget, Ui_ViewConnectionWidget):
IdBtConnect = 'btConnect'
- IdckAutoConnect = 'ckAutoConnect'
- IdEdConnectionHost = 'edConnectionHost' #TODO: combobox? validate input.
- IdSpinConnectionPort = 'spinConnectionPort'
+ IdCkFcpAutoConnect = 'ckFcpAutoConnect'
+ IdEdFcpFcpConnectionHost = 'edFcpConnectionHost'
+ IdFcpSpinFcpConnectionPort = 'spinFcpConnectionPort'
+ IdEdFproxyConnectionHost = 'edFproxyConnectionHost'
+ IdFproxySpinConnectionPort = 'spinFproxyConnectionPort'
+
def __init__(self, parent, idGlobalFeedback=config.IdMainWindow):
QtGui.QWidget.__init__(self, parent)
@@ -188,25 +186,36 @@
return
self._isCreated = True
- # setup host / port boxes
- edHost = self.controlById(self.IdEdConnectionHost)
- edHost.setText(self.fcSettings.value('ConnectionHost'))
+ # setup fcp host / port
+ edHost = self.controlById(self.IdEdFcpFcpConnectionHost)
+ edHost.setText(config.settings.value('FcpConnectionHost'))
+ self.connect(edHost, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFcpConnectionHostChanged)
- spinPort = self.controlById(self.IdSpinConnectionPort)
+ spinPort = self.controlById(self.IdFcpSpinFcpConnectionPort)
spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable
- spinPort.setValue(self.fcSettings.value('ConnectionPort'))
+ spinPort.setValue(config.settings.value('FcpConnectionPort'))
+ self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFcpConnectionPortChanged)
- # setup Connect button and AutoConnect checkbox
- doAutoConnect = self.fcSettings.value('AutoConnect')
- ck = self.controlById(self.IdckAutoConnect)
+ doAutoConnect = config.settings.value('FcpAutoConnect')
+ ck = self.controlById(self.IdCkFcpAutoConnect)
ck.setChecked(doAutoConnect)
- self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkAutoConnectStateChanged)
+ self.connect(ck, QtCore.SIGNAL('stateChanged(int)'), self.onCkFcpAutoConnectStateChanged)
+
+ # setup fproxy host / port
+ edHost = self.controlById(self.IdEdFproxyConnectionHost)
+ edHost.setText(config.settings.value('FproxyConnectionHost'))
+ self.connect(edHost, QtCore.SIGNAL('textChanged(const QString &)'), self.onEdFproxyConnectionHostChanged)
+ spinPort = self.controlById(self.IdFproxySpinConnectionPort)
+ spinPort.setRange(0, 0xFFFF) #TODO: no idea if port range (0, 0xFFFF) this is reasonable
+ spinPort.setValue(config.settings.value('FproxyConnectionPort'))
+ self.connect(spinPort, QtCore.SIGNAL('valueChanged(int)'), self.onSpinFproxyConnectionPortChanged)
+
bt = self.controlById(self.IdBtConnect)
self.connect(bt, QtCore.SIGNAL('clicked(bool)'), self.onBtConnectClicked)
if doAutoConnect:
self.controlById(self.IdBtConnect).click()
-
+
########################################
## overwritten methods
#########################################
@@ -233,9 +242,22 @@
config.fcpClient.close()
- def onCkAutoConnectStateChanged(self, state):
- self.fcSettings.setValues(AutoConnect=state == QtCore.Qt.Checked)
+ def onCkFcpAutoConnectStateChanged(self, state):
+ config.settings.setValues(FcpAutoConnect=state == QtCore.Qt.Checked)
+ def onEdFcpConnectionHostChanged(self, text):
+ config.settings.setValues(FcpConnectionHost=text)
+
+ def onSpinFcpConnectionPortChanged(self, value):
+ config.settings.setValues(FcpConnectionPort=value)
+
+ def onEdFproxyConnectionHostChanged(self, text):
+ config.settings.setValues(FproxyConnectionHost=text)
+
+ def onSpinFproxyConnectionPortChanged(self, value):
+ config.settings.setValues(FproxyConnectionPort=value)
+
+
#########################################
## fcp event onrs
#########################################
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|