Changeset 42:f23f648550e9 for src
- Timestamp:
- 03/10/12 16:20:55 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/config.py
r40 r42 20 20 """Construct the configuration with default values.""" 21 21 22 self._pilotID = "" 23 self._password = "" 24 22 25 self._autoUpdate = True 23 26 self._updateURL = Config.DEFAULT_UPDATE_URL 24 27 25 28 self._modified = False 29 30 @property 31 def pilotID(self): 32 """Get the pilot ID.""" 33 return self._pilotID 34 35 @pilotID.setter 36 def pilotID(self, pilotID): 37 """Set the pilot ID.""" 38 if pilotID!=self._pilotID: 39 self._pilotID = pilotID 40 self._modified = True 41 42 @property 43 def password(self): 44 """Get the password.""" 45 return self._password 46 47 @password.setter 48 def password(self, password): 49 """Set the password.""" 50 if password!=self._password: 51 self._password = password 52 self._modified = True 26 53 27 54 @property … … 54 81 config.read(configPath) 55 82 83 self._pilotID = self._get(config, "login", "id", "") 84 self._password = self._get(config, "login", "password", "") 85 56 86 self._autoUpdate = self._getBoolean(config, "update", "auto", True) 57 87 self._updateURL = self._get(config, "update", "url", … … 65 95 66 96 config = ConfigParser.RawConfigParser() 97 98 config.add_section("login") 99 config.set("login", "id", self._pilotID) 100 config.set("login", "password", self._password) 67 101 68 102 config.add_section("update") -
src/mlx/gui/common.py
r32 r42 17 17 except Exception, e: 18 18 pass 19 20 MESSAGETYPE_ERROR = gtk.MESSAGE_ERROR 21 BUTTONSTYPE_OK = gtk.BUTTONS_OK 19 22 else: 20 23 print "Using PyGObject" … … 25 28 from gi.repository import AppIndicator3 as appindicator 26 29 appIndicator = True 30 31 MESSAGETYPE_ERROR = gtk.MessageType.ERROR 32 BUTTONSTYPE_OK = gtk.ButtonsType.OK 27 33 28 34 import cairo -
src/mlx/gui/gui.py
r41 r42 5 5 from update import Updater 6 6 from mlx.gui.common import * 7 from mlx.gui.flight import Wizard 7 8 8 9 import mlx.const as const … … 40 41 41 42 self._programDirectory = programDirectory 42 self. _config = config43 self.config = config 43 44 self._connecting = False 44 45 self._connected = False … … 69 70 window.add(mainVBox) 70 71 72 notebook = gtk.Notebook() 73 mainVBox.add(notebook) 74 75 notebook.append_page(Wizard(self), gtk.Label("Flight")) 76 77 dataVBox = gtk.VBox() 78 notebook.append_page(dataVBox, gtk.Label("Data")) 79 71 80 setupFrame = self._buildSetupFrame() 72 81 setupFrame.set_border_width(8) 73 mainVBox.pack_start(setupFrame, False, False, 0)82 dataVBox.pack_start(setupFrame, False, False, 0) 74 83 75 84 dataFrame = self._buildDataFrame() 76 85 dataFrame.set_border_width(8) 77 mainVBox.pack_start(dataFrame, False, False, 0) 78 86 dataVBox.pack_start(dataFrame, False, False, 0) 87 88 logVBox = gtk.VBox() 89 notebook.append_page(logVBox, gtk.Label("Log")) 90 79 91 logFrame = self._buildLogFrame() 80 92 logFrame.set_border_width(8) 81 mainVBox.pack_start(logFrame, True, True, 0)93 logVBox.pack_start(logFrame, True, True, 0) 82 94 83 95 mainVBox.pack_start(gtk.HSeparator(), False, False, 0) … … 94 106 def run(self): 95 107 """Run the GUI.""" 96 if self. _config.autoUpdate:108 if self.config.autoUpdate: 97 109 self._updater = Updater(self, 98 110 self._programDirectory, 99 self. _config.updateURL,111 self.config.updateURL, 100 112 self._mainWindow) 101 113 self._updater.start()
Note:
See TracChangeset
for help on using the changeset viewer.