Changeset 42:f23f648550e9


Ignore:
Timestamp:
03/10/12 16:20:55 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Started the flight wizard and it is now possible to log in

Location:
src/mlx
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r40 r42  
    2020        """Construct the configuration with default values."""
    2121
     22        self._pilotID = ""
     23        self._password = ""
     24
    2225        self._autoUpdate = True       
    2326        self._updateURL = Config.DEFAULT_UPDATE_URL
    2427
    2528        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
    2653
    2754    @property
     
    5481        config.read(configPath)
    5582
     83        self._pilotID = self._get(config, "login", "id", "")
     84        self._password = self._get(config, "login", "password", "")
     85
    5686        self._autoUpdate = self._getBoolean(config, "update", "auto", True)
    5787        self._updateURL = self._get(config, "update", "url",
     
    6595
    6696        config = ConfigParser.RawConfigParser()
     97
     98        config.add_section("login")
     99        config.set("login", "id", self._pilotID)
     100        config.set("login", "password", self._password)
    67101
    68102        config.add_section("update")
  • src/mlx/gui/common.py

    r32 r42  
    1717    except Exception, e:
    1818        pass
     19
     20    MESSAGETYPE_ERROR = gtk.MESSAGE_ERROR
     21    BUTTONSTYPE_OK = gtk.BUTTONS_OK
    1922else:
    2023    print "Using PyGObject"
     
    2528    from gi.repository import AppIndicator3 as appindicator
    2629    appIndicator = True
     30
     31    MESSAGETYPE_ERROR = gtk.MessageType.ERROR
     32    BUTTONSTYPE_OK = gtk.ButtonsType.OK
    2733
    2834import cairo
  • src/mlx/gui/gui.py

    r41 r42  
    55from update import Updater
    66from mlx.gui.common import *
     7from mlx.gui.flight import Wizard
    78
    89import mlx.const as const
     
    4041
    4142        self._programDirectory = programDirectory
    42         self._config = config
     43        self.config = config
    4344        self._connecting = False
    4445        self._connected = False
     
    6970        window.add(mainVBox)
    7071
     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
    7180        setupFrame = self._buildSetupFrame()
    7281        setupFrame.set_border_width(8)
    73         mainVBox.pack_start(setupFrame, False, False, 0)
     82        dataVBox.pack_start(setupFrame, False, False, 0)
    7483
    7584        dataFrame = self._buildDataFrame()
    7685        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       
    7991        logFrame = self._buildLogFrame()
    8092        logFrame.set_border_width(8)
    81         mainVBox.pack_start(logFrame, True, True, 0)
     93        logVBox.pack_start(logFrame, True, True, 0)
    8294
    8395        mainVBox.pack_start(gtk.HSeparator(), False, False, 0)
     
    94106    def run(self):
    95107        """Run the GUI."""
    96         if self._config.autoUpdate:
     108        if self.config.autoUpdate:
    97109            self._updater = Updater(self,
    98110                                    self._programDirectory,
    99                                     self._config.updateURL,
     111                                    self.config.updateURL,
    100112                                    self._mainWindow)
    101113            self._updater.start()
Note: See TracChangeset for help on using the changeset viewer.