Ignore:
Timestamp:
01/06/16 14:16:46 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added a check for any signs of a previous running of the program, and if none found, a question about registration (re #285)

Location:
src/mlx/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/gui.py

    r746 r755  
    447447                                    self._mainWindow)
    448448            self._updater.start()
     449        else:
     450            self.updateDone()
    449451
    450452        cef.initialize(self._programDirectory, self._cefInitialized)
     
    457459
    458460        self._disconnect()
     461
     462    def updateDone(self):
     463        """Called when the update is done (and there is no need to restart)."""
     464        gobject.idle_add(self._updateDone)
    459465
    460466    def connected(self, fsType, descriptor):
     
    16941700            self._credentialsAvailable = True
    16951701            self._credentialsCondition.notify()
     1702
     1703    def _updateDone(self):
     1704        """Called when the update is done.
     1705
     1706        It checks if we already know the PID, and if not, asks the user whether
     1707        to register."""
     1708        if not self.config.pilotID and not self.config.password:
     1709            dialog = gtk.MessageDialog(parent = self._mainWindow,
     1710                                       type = MESSAGETYPE_QUESTION,
     1711                                       message_format = xstr("register_ask"))
     1712
     1713            dialog.set_title(WINDOW_TITLE_BASE)
     1714            dialog.format_secondary_markup(xstr("register_ask_sec"))
     1715
     1716            dialog.add_button(xstr("button_cancel"), 0)
     1717            dialog.add_button(xstr("button_register"), 1)
     1718            dialog.set_default_response(1)
     1719
     1720            result = dialog.run()
     1721            dialog.hide()
     1722            if result == 1:
     1723                self._wizard.jumpPage("register")
  • src/mlx/gui/update.py

    r300 r755  
    124124        if not self._waitAfterFinish:
    125125            gobject.idle_add(self._progressWindow.hide)
     126            self._gui.updateDone()
    126127
    127128    def downloadingManifest(self):
     
    286287        if self._restart:
    287288            self._gui.restart()
     289        else:
     290            self._gui.updateDone()
    288291
    289292#-------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.