SF.net SVN: fclient:[955] trunk/fclient/fclient/impl/ViewConnection
Status: Pre-Alpha
                
                Brought to you by:
                
                    jurner
                    
                
            | 
      
      
      From: <jU...@us...> - 2008-08-22 12:22:53
      
     | 
| Revision: 955
          http://fclient.svn.sourceforge.net/fclient/?rev=955&view=rev
Author:   jUrner
Date:     2008-08-22 12:23:00 +0000 (Fri, 22 Aug 2008)
Log Message:
-----------
split module into submodules
Modified Paths:
--------------
    trunk/fclient/fclient/impl/ViewConnection/ViewConnection.py
Added Paths:
-----------
    trunk/fclient/fclient/impl/ViewConnection/Actions.py
    trunk/fclient/fclient/impl/ViewConnection/GlobalFeedback.py
    trunk/fclient/fclient/impl/ViewConnection/Settings.py
Added: trunk/fclient/fclient/impl/ViewConnection/Actions.py
===================================================================
--- trunk/fclient/fclient/impl/ViewConnection/Actions.py	                        (rev 0)
+++ trunk/fclient/fclient/impl/ViewConnection/Actions.py	2008-08-22 12:23:00 UTC (rev 955)
@@ -0,0 +1,20 @@
+# some fixes for relative imports
+# see --> [http://bugs.python.org/issue1510172] absolute/rellative import not working (works only current dir and below)
+# see -->  [http://mail.python.org/pipermail/python-ideas/2007-February/000232.html] PEP for executing a module in a 
+# ...package containing relative imports
+from __future__ import absolute_import
+if __name__ == '__main__':	
+	import os
+	__path__ = [os.path.dirname(__file__)]
+	from ._fix_mexec import fix_mexec
+	fix_mexec(__name__, __file__)
+	del fix_mexec
+from PyQt4 import QtCore, QtGui
+
+from .. import config
+from ..lib import fcp2
+#**********************************************************************************
+#
+#********************************************************************************** 
+class Actions(config.ActionsBase): 
+	pass
Added: trunk/fclient/fclient/impl/ViewConnection/GlobalFeedback.py
===================================================================
--- trunk/fclient/fclient/impl/ViewConnection/GlobalFeedback.py	                        (rev 0)
+++ trunk/fclient/fclient/impl/ViewConnection/GlobalFeedback.py	2008-08-22 12:23:00 UTC (rev 955)
@@ -0,0 +1,43 @@
+# some fixes for relative imports
+# see --> [http://bugs.python.org/issue1510172] absolute/rellative import not working (works only current dir and below)
+# see -->  [http://mail.python.org/pipermail/python-ideas/2007-February/000232.html] PEP for executing a module in a 
+# ...package containing relative imports
+from __future__ import absolute_import
+if __name__ == '__main__':	
+	import os
+	__path__ = [os.path.dirname(__file__)]
+	from ._fix_mexec import fix_mexec
+	fix_mexec(__name__, __file__)
+	del fix_mexec
+from PyQt4 import QtCore, QtGui
+
+from .. import config
+#**********************************************************************************
+#
+#********************************************************************************** 
+class GlobalFeedback(config.GlobalFeedbackBase):
+	"""wrapper for global statusbar widgets, menus"""
+	
+	def __init__(self, parent,idGlobalFeedback):
+		config.GlobalFeedbackBase.__init__(self, parent,idGlobalFeedback)
+		
+		# menus
+		self.menus = []
+		if self.menuBar is not None:
+			viewObject = config.ObjectRegistry.get(config.IdViewObjectConnection, None)
+			menu = QtGui.QMenu(viewObject.displayName(), self.menuBar)
+			parent.populateMenu(menu)
+			self.menus.append(menu)
+			self.menuBar.addViewMenu(menu)
+				
+		# status bar widgets
+		self.label1 = None
+		#if self.statusBar is not None:
+		#	self.label1 = QtGui.QLabel('foo here', self.statusBar)
+			
+	def setVisible(self, flag):
+		for menu in self.menus:
+			menu.children()[0].setEnabled(flag)
+		if self.label1 is not None:
+			self.label1.setVisible(flag)
+			
\ No newline at end of file
Added: trunk/fclient/fclient/impl/ViewConnection/Settings.py
===================================================================
--- trunk/fclient/fclient/impl/ViewConnection/Settings.py	                        (rev 0)
+++ trunk/fclient/fclient/impl/ViewConnection/Settings.py	2008-08-22 12:23:00 UTC (rev 955)
@@ -0,0 +1,58 @@
+# some fixes for relative imports
+# see --> [http://bugs.python.org/issue1510172] absolute/rellative import not working (works only current dir and below)
+# see -->  [http://mail.python.org/pipermail/python-ideas/2007-February/000232.html] PEP for executing a module in a 
+# ...package containing relative imports
+from __future__ import absolute_import
+if __name__ == '__main__':	
+	import os
+	__path__ = [os.path.dirname(__file__)]
+	from ._fix_mexec import fix_mexec
+	fix_mexec(__name__, __file__)
+	del fix_mexec
+from PyQt4 import QtCore, QtGui
+
+from .. import config
+from ..lib import fcp2
+#**********************************************************************************
+#
+#********************************************************************************** 
+class Settings(config.SettingsBase):
+		_key_ = config.IdViewObjectConnection
+		_settings_  = (
+				('FcpAutoConnect', 'Bool', True),
+				('FcpConnectionName', 'String', config.FcConnectionName),
+				('FcpConnectionHost', 'String', fcp2.Client.DefaultFcpHost),
+				('FcpConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort),
+				('FcpConnectionTimerTimeout', 'UInt', 500),
+				('FcpConnectionTimerMaxDuration', 'UInt', 20),
+				('FcpPollTimerTimeout', 'UInt', 200),
+								
+				('FproxyConnectionHost', 'String','127.0.0.1'),
+				('FproxyConnectionPort', 'UInt', 8888),
+				)
+				
+		def setValues(self, **kws):
+			config.SettingsBase.setValues(self, **kws)
+			parent = self.parent()
+			
+			# set fcp connection params
+			if 'FcpConnectionHost' in kws:
+				edHost = parent.controlById(parent.IdEdFcpConnectionHost)
+				edHost.setText(self.value('FcpConnectionHost'))
+			
+			if 'FcpConnectionPort' in kws:
+				spinPort = parent.controlById(parent.IdFcpSpinFcpConnectionPort)
+				spinPort.setValue(self.value('FcpConnectionPort'))
+			
+			if 'FcpAutoConnect' in kws:
+				ck = parent.controlById(parent.IdCkFcpAutoConnect)
+				ck.setChecked(self.value('FcpAutoConnect'))
+			
+			# set fproxy connection params
+			if 'FproxyConnectionHost' in kws:
+				edHost = parent.controlById(parent.IdEdFproxyConnectionHost)
+				edHost.setText(self.value('FproxyConnectionHost'))
+			
+			if 'FproxyConnectionPort' in kws:
+				spinPort = parent.controlById(parent.IdFproxySpinConnectionPort)
+				spinPort.setValue(self.value('FproxyConnectionPort'))
Modified: trunk/fclient/fclient/impl/ViewConnection/ViewConnection.py
===================================================================
--- trunk/fclient/fclient/impl/ViewConnection/ViewConnection.py	2008-08-22 08:09:32 UTC (rev 954)
+++ trunk/fclient/fclient/impl/ViewConnection/ViewConnection.py	2008-08-22 12:23:00 UTC (rev 955)
@@ -20,85 +20,13 @@
 from .. import config
 from ..lib import fcp2
 
+from . import Actions
+from . import GlobalFeedback
+from. import Settings
 from .Ui_ConnectionWidgetTpl import Ui_ViewConnectionWidget
 #**********************************************************************************
 #
 #**********************************************************************************
-class Actions(config.ActionsBase): 
-	pass
-
-
-class GlobalFeedback(config.GlobalFeedbackBase):
-	"""wrapper for global statusbar widgets, menus"""
-	
-	def __init__(self, parent,idGlobalFeedback):
-		config.GlobalFeedbackBase.__init__(self, parent,idGlobalFeedback)
-		
-		# menus
-		self.menus = []
-		if self.menuBar is not None:
-			viewObject = config.ObjectRegistry.get(config.IdViewObjectConnection, None)
-			menu = QtGui.QMenu(viewObject.displayName(), self.menuBar)
-			parent.populateMenu(menu)
-			self.menus.append(menu)
-			self.menuBar.addViewMenu(menu)
-				
-		# status bar widgets
-		self.label1 = None
-		#if self.statusBar is not None:
-		#	self.label1 = QtGui.QLabel('foo here', self.statusBar)
-			
-	def setVisible(self, flag):
-		for menu in self.menus:
-			menu.children()[0].setEnabled(flag)
-		if self.label1 is not None:
-			self.label1.setVisible(flag)
-			
-			
-class Settings(config.SettingsBase):
-		_key_ = config.IdViewObjectConnection
-		_settings_  = (
-				('FcpAutoConnect', 'Bool', True),
-				('FcpConnectionName', 'String', config.FcConnectionName),
-				('FcpConnectionHost', 'String', fcp2.Client.DefaultFcpHost),
-				('FcpConnectionPort', 'UInt', fcp2.Client.DefaultFcpPort),
-				('FcpConnectionTimerTimeout', 'UInt', 500),
-				('FcpConnectionTimerMaxDuration', 'UInt', 20),
-				('FcpPollTimerTimeout', 'UInt', 200),
-								
-				('FproxyConnectionHost', 'String','127.0.0.1'),
-				('FproxyConnectionPort', 'UInt', 8888),
-				)
-				
-		def setValues(self, **kws):
-			config.SettingsBase.setValues(self, **kws)
-			parent = self.parent()
-			
-			# set fcp connection params
-			if 'FcpConnectionHost' in kws:
-				edHost = parent.controlById(parent.IdEdFcpConnectionHost)
-				edHost.setText(self.value('FcpConnectionHost'))
-			
-			if 'FcpConnectionPort' in kws:
-				spinPort = parent.controlById(parent.IdFcpSpinFcpConnectionPort)
-				spinPort.setValue(self.value('FcpConnectionPort'))
-			
-			if 'FcpAutoConnect' in kws:
-				ck = parent.controlById(parent.IdCkFcpAutoConnect)
-				ck.setChecked(self.value('FcpAutoConnect'))
-			
-			# set fproxy connection params
-			if 'FproxyConnectionHost' in kws:
-				edHost = parent.controlById(parent.IdEdFproxyConnectionHost)
-				edHost.setText(self.value('FproxyConnectionHost'))
-			
-			if 'FproxyConnectionPort' in kws:
-				spinPort = parent.controlById(parent.IdFproxySpinConnectionPort)
-				spinPort.setValue(self.value('FproxyConnectionPort'))
-
-#**********************************************************************************
-#
-#**********************************************************************************
 class ConnectionTimer(QtCore.QTimer):
 	
 	def __init__(self,parent):
@@ -167,9 +95,9 @@
 		spinPort.setRange(0, 0xFFFF)		#TODO: no idea if port range (0, 0xFFFF) this is reasonable
 				
 		self._isCreated = False
-		self.fcSettings = Settings(self).restore()
-		self.fcActions = Actions(self)
-		self.fcGlobalFeedback = GlobalFeedback(self,idGlobalFeedback)
+		self.fcSettings = Settings.Settings(self).restore()
+		self.fcActions = Actions.Actions(self)
+		self.fcGlobalFeedback = GlobalFeedback.GlobalFeedback(self,idGlobalFeedback)
 				
 		self._connectionTimer = ConnectionTimer(self)
 		self._pollTimer = PollTimer(self)
@@ -297,16 +225,39 @@
 #**********************************************************************************
 if __name__ == '__main__':
 	import sys
-	from .. import View, ViewLogger
-	
+	from ..MainWindow.ViewObject import ViewObjectMainWindow
+	from ..ViewView.ViewObject import ViewObjectView
+	from ..ViewConnection.ViewObject import ViewObjectConnection
+	from ..ViewLogger.ViewObject import ViewObjectLogger
+		
 	app = QtGui.QApplication(sys.argv)
-	w = View.ViewWidget(None)
-	w.addTopViews(ViewConnectionWidget(None))
-	w.addBottomViews(ViewLogger.ViewLoggerWidget(None))
 	
-	w.show()
+	voMainWindow = ViewObjectMainWindow(None)
+	voMainWindow.create()
+				
+	voView = ViewObjectView(voMainWindow)
+	viewWidget = voView.create()
+	voMainWindow.widget().setCentralWidget(viewWidget)
+			
+	topViews = (
+			ViewObjectConnection,
+			)
+	for view in topViews:
+		view = view(voView)
+		view.create()
+		viewWidget.addTopViews(view)
+		
+	bottomViews = (
+			ViewObjectLogger,
+			)
+	for view in bottomViews:
+		view = view(voView)
+		view.create()
+		viewWidget.addBottomViews(view)
+		
+	voMainWindow.widget().show()
 	res = app.exec_()
 	sys.exit(res)
+	
 
-
  
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |