Ignore:
Timestamp:
04/29/12 06:48:38 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The Preferences dialog works

Location:
src/mlx/gui
Files:
1 added
3 edited

Legend:

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

    r105 r123  
    2727    BUTTONSTYPE_YES_NO = gtk.BUTTONS_YES_NO
    2828    RESPONSETYPE_YES = gtk.RESPONSE_YES
     29    RESPONSETYPE_ACCEPT = gtk.RESPONSE_ACCEPT
     30    RESPONSETYPE_REJECT = gtk.RESPONSE_REJECT
    2931    ACCEL_VISIBLE = gtk.ACCEL_VISIBLE
    3032    CONTROL_MASK = gdk.CONTROL_MASK
     33    DIALOG_MODAL = gtk.DIALOG_MODAL
    3134
    3235    def text2unicode(text):
     
    4952    BUTTONSTYPE_YES_NO = gtk.ButtonsType.YES_NO
    5053    RESPONSETYPE_YES = gtk.ResponseType.YES
     54    RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT
     55    RESPONSETYPE_REJECT = gtk.ResponseType.REJECT
    5156    ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE
    5257    CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
     58    DIALOG_MODAL = gtk.DialogFlags.MODAL
    5359
    5460    import codecs
  • src/mlx/gui/gui.py

    r120 r123  
    1010from mlx.gui.weighthelp import WeightHelp
    1111from mlx.gui.gates import FleetGateStatus
     12from mlx.gui.prefs import Preferences
    1213
    1314import mlx.const as const
     
    6162        """Build the GUI."""
    6263       
    63         window = gtk.Window()
     64        self._mainWindow = window = gtk.Window()
    6465        window.set_title(WINDOW_TITLE_BASE)
    6566        window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico"))
     
    7374        window.add(mainVBox)
    7475
     76        self._preferences = Preferences(self)
     77
    7578        menuBar = self._buildMenuBar(accelGroup)
    7679        mainVBox.pack_start(menuBar, False, False, 0)
     
    130133        self._weightHelp.reset()
    131134        self._weightHelp.disable()
    132 
    133         self._mainWindow = window
    134135
    135136        self._statusIcon = StatusIcon(iconDirectory, self)
     
    663664        fileMenu.append(quitMenuItem)
    664665
     666        toolsMenuItem = gtk.MenuItem(xstr("menu_tools"))
     667        toolsMenu = gtk.Menu()
     668        toolsMenuItem.set_submenu(toolsMenu)
     669        menuBar.append(toolsMenuItem)
     670
     671        prefsMenuItem = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES)
     672        prefsMenuItem.set_use_stock(True)
     673        prefsMenuItem.set_label(xstr("menu_tools_prefs"))
     674        prefsMenuItem.add_accelerator("activate", accelGroup,
     675                                      ord(xstr("menu_tools_prefs_key")),
     676                                      CONTROL_MASK, ACCEL_VISIBLE)
     677        prefsMenuItem.connect("activate", self._editPreferences)
     678        toolsMenu.append(prefsMenuItem)
    665679
    666680        viewMenuItem = gtk.MenuItem(xstr("menu_view"))
     
    759773        else:
    760774            self._mainWindow.set_default(None)
     775
     776    def _editPreferences(self, menuItem):
     777        """Callback for editing the preferences."""
     778        self._preferences.run(self.config)
  • src/mlx/gui/info.py

    r122 r123  
    55from mlx.i18n import xstr
    66import mlx.const as const
     7
     8#------------------------------------------------------------------------------
    79
    810class FlightInfo(gtk.VBox):
Note: See TracChangeset for help on using the changeset viewer.