コード例 #1
0
ファイル: Locomotif.py プロジェクト: zzr1100/locomotifGUI
	def __init__(self, parent=None):
		"""
		Docstring
		"""
		# load all basic PyQt4 functions from QWidget
		QtGui.QWidget.__init__(self, parent)
        
		# load the ui
		self.ui = Ui_Locomotif()
		self.ui.setupUi(self)
		
		# setup global config
		configData.setupConfig()

		# load tools
		self.tools = Tools_Locomotif()
		self.tools.setupTools()
		# load work
		self.work = Work_Locomotif()
		self.work.setupWork()
        
		# load configuration values and store in config class
		__base__ = os.path.abspath(os.path.dirname(__file__))
		configData.initConfig( __base__ )
		configData.debugConfig()

		# setup global rundata buffer (not sure whetter this is required any longer)
		g_rundata.setupRundata()
		g_rundata.setDataFont( configData.getDataFont() )
		
		# initial values for maps in the working dock widget
		mapWidth = configData.getMapWidth()
		g_rundata.setMapWidth( mapWidth )
		self.ui.cmdMapWidth.setText(str(mapWidth))
		mapHeight = configData.getMapHeight()
		g_rundata.setMapHeight( mapHeight )
		self.ui.cmdMapHeight.setText(str(mapHeight))

		# setup/select the main data display
		mainDataWidget = self.ui.mainDataDisplay
		# delete the first tab page that is created by the code
		# from the QT-Designer
		mainDataWidget.removeTab(0)

		# setup customized main tab page
		uiTools.setupUiTools(self)
		uiTools.initCustomTabWidget(self.ui.mainDataDisplay, 0 )
		# and now add the first custom tab page
		uiTools.addCustomTabPage()
		uiTools.selectCustomTabPage(0)
		
		# initial values for google maps in custom tab page
		mapWidth = configData.getGoogleMapWidth()
		g_rundata.setGoogleMapWidth( mapWidth )
		#g_tabwidgets.t1GMMapWidth.setText(str(mapWidth))
		#g_tabwidgets.t1GM2MapWidth.setText(str(mapWidth))
		mapHeight = configData.getGoogleMapHeight()
		g_rundata.setGoogleMapHeight( mapHeight )
コード例 #2
0
ファイル: Locomotif.py プロジェクト: zzr1100/locomotifGUI
	def doConfigDialog(self, Locomotif):
		print "open configuration dialog"
		dialog = ConfigDialog(self)
		dialog.setModal(1)
		ret = dialog.exec_()
		
		# transfer (new) map sizes
		mapWidth = configData.getMapWidth()
		g_rundata.setMapWidth( mapWidth )
		self.ui.cmdMapWidth.setText(str(mapWidth))
		mapHeight = configData.getMapHeight()
		g_rundata.setMapHeight( mapHeight )
		self.ui.cmdMapHeight.setText(str(mapHeight))
		
		# transfer (new) google maps settings
		mapWidth = configData.getGoogleMapWidth()
		g_rundata.setGoogleMapWidth( mapWidth )
		g_tabwidgets.t1GMMapWidth.setText(str(mapWidth))
		g_tabwidgets.t1GM2MapWidth.setText(str(mapWidth))
		mapHeight = configData.getGoogleMapHeight()
		g_rundata.setGoogleMapHeight( mapHeight )
		g_tabwidgets.t1GMMapHeight.setText(str(mapHeight))
		g_tabwidgets.t1GM2MapHeight.setText(str(mapHeight))
		
		maptype = configData.getGoogle1Maptype()
		g_rundata.setGoogle1Maptype( maptype )
		# following values must fit to combobox in configuration
		if maptype == "hybrid":
			g_tabwidgets.t1GMmaptype.setChecked(True)
		if maptype == "satellite":
			g_tabwidgets.t1GMmaptype_2.setChecked(True)
		if maptype == "roadmap":
			g_tabwidgets.t1GMmaptype_3.setChecked(True)
		if maptype == "terrain":
			g_tabwidgets.t1GMmaptype_4.setChecked(True)
		
		maptype = configData.getGoogle2Maptype()
		g_rundata.setGoogle2Maptype( maptype )
		# following values must fit to combobox in configuration
		if maptype == "hybrid":
			g_tabwidgets.t1GM2maptype.setChecked(True)
		if maptype == "satellite":
			g_tabwidgets.t1GM2maptype_2.setChecked(True)
		if maptype == "roadmap":
			g_tabwidgets.t1GM2maptype_3.setChecked(True)
		if maptype == "terrain":
			g_tabwidgets.t1GM2maptype_4.setChecked(True)