Changeset 149:aab353620d1c for src/mlx/gui
- Timestamp:
- 05/04/12 17:53:57 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r144 r149 29 29 RESPONSETYPE_ACCEPT = gtk.RESPONSE_ACCEPT 30 30 RESPONSETYPE_REJECT = gtk.RESPONSE_REJECT 31 RESPONSETYPE_CANCEL = gtk.RESPONSE_CANCEL 31 32 ACCEL_VISIBLE = gtk.ACCEL_VISIBLE 32 33 CONTROL_MASK = gdk.CONTROL_MASK … … 43 44 44 45 SPIN_USER_DEFINED = gtk.SPIN_USER_DEFINED 46 47 FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER 45 48 46 49 def text2unicode(text): … … 65 68 RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT 66 69 RESPONSETYPE_REJECT = gtk.ResponseType.REJECT 70 RESPONSETYPE_CANCEL = gtk.ResponseType.CANCEL 67 71 ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE 68 72 CONTROL_MASK = gdk.ModifierType.CONTROL_MASK … … 79 83 80 84 SPIN_USER_DEFINED = gtk.SpinType.USER_DEFINED 85 86 FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FileChooserAction.SELECT_FOLDER 81 87 82 88 import codecs -
src/mlx/gui/prefs.py
r148 r149 73 73 self._syncFSTime.set_active(config.syncFSTime) 74 74 75 pirepDirectory = config.pirepDirectory 76 self._pirepDirectory.set_text("" if pirepDirectory is None 77 else pirepDirectory) 78 75 79 for messageType in const.messageTypes: 76 80 level = config.getMessageTypeLevel(messageType) … … 98 102 config.flareTimeFromFS = self._flareTimeFromFS.get_active() 99 103 config.syncFSTime = self._syncFSTime.get_active() 104 config.pirepDirectory = self._pirepDirectory.get_text() 100 105 101 106 for messageType in const.messageTypes: … … 117 122 """Build the page for the general settings.""" 118 123 mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0, 119 xscale = 0.0, yscale = 0.0)120 mainAlignment.set_padding(padding_top = 16, padding_bottom = 32,121 padding_left = 4, padding_right = 4 8)124 xscale = 1.0, yscale = 0.0) 125 mainAlignment.set_padding(padding_top = 16, padding_bottom = 8, 126 padding_left = 4, padding_right = 4) 122 127 mainBox = gtk.VBox() 123 128 mainAlignment.add(mainBox) … … 174 179 self._syncFSTime.set_tooltip_text(xstr("prefs_syncFSTime_tooltip")) 175 180 mainBox.pack_start(self._syncFSTime, False, False, 4) 176 181 182 pirepBox = gtk.HBox() 183 mainBox.pack_start(pirepBox, False, False, 4) 184 185 label = gtk.Label(xstr("prefs_pirepDirectory")) 186 label.set_use_underline(True) 187 pirepBox.pack_start(label, False, False, 4) 188 189 self._pirepDirectory = gtk.Entry() 190 self._pirepDirectory.set_tooltip_text(xstr("prefs_pirepDirectory_tooltip")) 191 label.set_mnemonic_widget(self._pirepDirectory) 192 pirepBox.pack_start(self._pirepDirectory, True, True, 4) 193 194 self._pirepDirectoryButton = gtk.Button(xstr("button_browse")) 195 self._pirepDirectoryButton.connect("clicked", 196 self._pirepDirectoryButtonClicked) 197 pirepBox.pack_start(self._pirepDirectoryButton, False, False, 4) 198 177 199 return mainAlignment 178 200 … … 209 231 dialog.hide() 210 232 self._warnedRestartNeeded = True 211 233 234 def _pirepDirectoryButtonClicked(self, button): 235 """Called when the PIREP directory button is clicked.""" 236 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 237 xstr("prefs_pirepDirectory_browser_title"), 238 action = FILE_CHOOSER_ACTION_SELECT_FOLDER, 239 buttons = (gtk.STOCK_CANCEL, RESPONSETYPE_CANCEL, 240 gtk.STOCK_OK, RESPONSETYPE_OK)) 241 242 directory = self._pirepDirectory.get_text() 243 if directory: 244 dialog.select_filename(directory) 245 246 result = dialog.run() 247 dialog.hide() 248 249 if result==RESPONSETYPE_OK: 250 self._pirepDirectory.set_text(dialog.get_filename()) 251 212 252 def _buildMessages(self): 213 253 """Build the page for the message settings.""" … … 292 332 293 333 mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0, 294 xscale = 0.0, yscale = 0.0)295 mainAlignment.set_padding(padding_top = 16, padding_bottom = 32,296 padding_left = 4, padding_right = 4 8)334 xscale = 1.0, yscale = 0.0) 335 mainAlignment.set_padding(padding_top = 16, padding_bottom = 8, 336 padding_left = 4, padding_right = 4) 297 337 mainBox = gtk.VBox() 298 338 mainAlignment.add(mainBox) … … 318 358 self._updateURL.set_tooltip_text(xstr("prefs_update_url_tooltip")) 319 359 self._updateURL.connect("changed", self._updateURLChanged) 320 updateURLBox.pack_start(self._updateURL, False, False, 4)360 updateURLBox.pack_start(self._updateURL, True, True, 4) 321 361 322 362 return mainAlignment … … 350 390 """Called when the update URL is changed.""" 351 391 self._setOKButtonSensitivity() 352 353
Note:
See TracChangeset
for help on using the changeset viewer.