Changeset 49:1b5b3d34dd84 for src


Ignore:
Timestamp:
03/23/12 14:13:17 (13 years ago)
Author:
István Váradi <locvais@…>
Branch:
default
Phase:
public
Message:

Implemented busy state notification

Location:
src/mlx/gui
Files:
3 edited

Legend:

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

    r48 r49  
    179179    def _loginClicked(self, button):
    180180        """Called when the login button was clicked."""
     181        self._wizard.gui.beginBusy("Logging in...")
    181182        self._wizard.gui.webHandler.login(self._pilotID.get_text(),
    182183                                          self._password.get_text(),
     
    189190    def _handleLoginResult(self, returned, result):
    190191        """Handle the login result."""
     192        self._wizard.gui.endBusy()
    191193        if returned:
    192194            if result.loggedIn:
  • src/mlx/gui/gui.py

    r48 r49  
    117117        self._statusIcon = StatusIcon(iconDirectory, self)
    118118
     119        self._busyCursor = gdk.Cursor(gdk.CursorType.WATCH if pygobject
     120                                      else gdk.WATCH)
     121
    119122    def run(self):
    120123        """Run the GUI."""
     
    238241
    239242        gobject.idle_add(self._writeStdIO)
     243
     244    def beginBusy(self, message):
     245        """Begin a period of background processing."""
     246        print dir(self._mainWindow)
     247        self._mainWindow.get_window().set_cursor(self._busyCursor)
     248        self._statusbar.updateBusyState(message)
     249
     250    def endBusy(self):
     251        """End a period of background processing."""
     252        self._mainWindow.get_window().set_cursor(None)
     253        self._statusbar.updateBusyState(None)
    240254
    241255    def _writeStdIO(self):
  • src/mlx/gui/statusbar.py

    r32 r49  
    6868        statusBox.pack_start(self._ratingLabel, False, False, 8)
    6969
     70        self._busyLabel = gtk.Label()
     71        self._busyLabel.set_width_chars(30)
     72        self._busyLabel.set_tooltip_text("The status of the background tasks.")
     73        self._busyLabel.set_alignment(1.0, 0.5)
     74        statusBox.pack_start(self._busyLabel, True, True, 8)
     75       
    7076        self._updateFlightStatus()
    7177
     
    7581        self._connected = connected
    7682        self._connStateArea.queue_draw()
     83
     84    def updateBusyState(self, message):
     85        """Update the busy state."""
     86        self._busyLabel.set_text("" if message is None else message)
    7787   
    7888    def _drawConnState(self, connStateArea, eventOrContext):
Note: See TracChangeset for help on using the changeset viewer.