Changeset 392:ddb312cb8a3d
- Timestamp:
- 12/22/12 09:05:16 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
locale/en/mlx.po
r391 r392 1360 1360 msgstr "Select PIREP directory" 1361 1361 1362 msgid "prefs_pirepAutoSave" 1363 msgstr "Sav_e PIREP automatically" 1364 1365 msgid "prefs_pirepAutoSave_tooltip" 1366 msgstr "If this is enabled, the PIREP will be automatically saved at the end of the flight, when all mandatory data are present. You can still modify the data later, and save it again manually." 1367 1362 1368 msgid "prefs_frame_gui" 1363 1369 msgstr "GUI" -
locale/hu/mlx.po
r391 r392 1402 1402 msgstr "Válaszd ki a PIREP-ek könyvtárát" 1403 1403 1404 msgid "prefs_pirepAutoSave" 1405 msgstr "PIREP men_tése automatikusan" 1406 1407 msgid "prefs_pirepAutoSave_tooltip" 1408 msgstr "Ha bekapcsolod, a program automatikusan elmenti a PIREP-et a repülés végén, ha már minden kötelezően megadandó adat ki van töltve. Az adatok a későbbiek során is módosíthatók, és a PIREP kézzel is elmenthető." 1409 1404 1410 msgid "prefs_frame_gui" 1405 1411 msgstr "Grafikus felület" -
src/mlx/config.py
r373 r392 234 234 235 235 self._pirepDirectory = None 236 self._pirepAutoSave = False 236 237 237 238 self._enableSounds = not secondaryInstallation … … 453 454 self._pirepDirectory = None if pirepDirectory=="" \ 454 455 else pirepDirectory 456 if self._pirepDirectory is None: 457 self._pirepAutoSave = False 458 self._modified = True 459 460 @property 461 def pirepAutoSave(self): 462 """Get whether the PIREP should be saved automatically when it becomes 463 saveable.""" 464 return self._pirepAutoSave 465 466 @pirepAutoSave.setter 467 def pirepAutoSave(self, pirepAutoSave): 468 """Set whether the PIREP should be saved automatically when it becomes 469 saveable.""" 470 pirepAutoSave = pirepAutoSave and self._pirepDirectory is not None 471 if pirepAutoSave!=self._pirepAutoSave: 472 self._pirepAutoSave = pirepAutoSave 455 473 self._modified = True 456 474 … … 649 667 "pirepDirectory", None) 650 668 669 self._pirepAutoSave = self._get(config, "general", 670 "pirepAutoSave", False) 671 self._pirepAutoSave = self._pirepAutoSave and \ 672 self._pirepAutoSave is not None 673 651 674 self._messageTypeLevels = {} 652 675 for messageType in const.messageTypes: … … 720 743 if self._pirepDirectory is not None: 721 744 config.set("general", "pirepDirectory", self._pirepDirectory) 745 config.set("general", "pirepAutoSave", 746 "yes" if self._pirepAutoSave else "no") 722 747 723 748 config.add_section(Config._messageTypesSection) -
src/mlx/gui/prefs.py
r300 r392 25 25 # Constant to denote that the status of the Ctrl modifier is changed 26 26 CHANGED_CTRL = 1 27 27 28 28 # Constant to denote that the status of the Shift modifier is changed 29 29 CHANGED_SHIFT = 2 30 30 31 31 # Constant to denote that the value of the key is changed 32 32 CHANGED_KEY = 3 33 33 34 34 def __init__(self, labelText, tooltips): 35 35 """Construct the hotkey widget. … … 42 42 - the shift check box.""" 43 43 super(Hotkey, self).__init__() 44 44 45 45 label = gtk.Label(labelText) 46 46 label.set_use_underline(True) … … 56 56 self._ctrl.connect("toggled", self._ctrlToggled) 57 57 self.pack_start(self._ctrl, False, False, 4) 58 58 59 59 self._shift = gtk.CheckButton("Shift") 60 60 self._shift.set_tooltip_text(tooltips[2]) … … 121 121 iter = hotkeyModel.get_iter_first() 122 122 123 self._hotkey.set_active_iter(iter) 123 self._hotkey.set_active_iter(iter) 124 124 125 125 self._setting = False … … 178 178 self.add_button(xstr("button_ok"), RESPONSETYPE_ACCEPT) 179 179 self.set_resizable(False) 180 180 181 181 self._gui = gui 182 182 self._settingFromConfig = False … … 238 238 self._syncFSTime.set_active(config.syncFSTime) 239 239 self._usingFS2Crew.set_active(config.usingFS2Crew) 240 240 241 241 self._setSmoothing(self._iasSmoothingEnabled, self._iasSmoothingLength, 242 242 config.iasSmoothingLength) … … 247 247 self._pirepDirectory.set_text("" if pirepDirectory is None 248 248 else pirepDirectory) 249 self._pirepAutoSave.set_active(config.pirepAutoSave) 250 if not pirepDirectory: 251 self._pirepAutoSave.set_sensitive(False) 249 252 250 253 for messageType in const.messageTypes: … … 263 266 self._speedbrakeAtTD.set_active(config.speedbrakeAtTD) 264 267 265 self._enableChecklists.set_active(config.enableChecklists) 268 self._enableChecklists.set_active(config.enableChecklists) 266 269 self._checklistHotkey.set(config.checklistHotkey) 267 270 … … 289 292 self._vsSmoothingLength) 290 293 config.pirepDirectory = text2unicode(self._pirepDirectory.get_text()) 294 config.pirepAutoSave = self._pirepAutoSave.get_active() 291 295 292 296 for messageType in const.messageTypes: … … 324 328 325 329 guiBox = self._createFrame(mainBox, xstr("prefs_frame_gui")) 326 330 327 331 languageBox = gtk.HBox() 328 332 guiBox.pack_start(languageBox, False, False, 4) … … 339 343 340 344 self._languageComboBox = languageComboBox = \ 341 gtk.ComboBox(model = self._languageList) 345 gtk.ComboBox(model = self._languageList) 342 346 cell = gtk.CellRendererText() 343 347 languageComboBox.pack_start(cell, True) … … 362 366 guiBox.pack_start(self._quitOnClose, False, False, 4) 363 367 364 onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online")) 368 onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online")) 365 369 366 370 self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem")) … … 380 384 self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip")) 381 385 simulatorBox.pack_start(self._flareTimeFromFS, False, False, 4) 382 386 383 387 self._syncFSTime = gtk.CheckButton(xstr("prefs_syncFSTime")) 384 388 self._syncFSTime.set_use_underline(True) … … 390 394 self._usingFS2Crew.set_tooltip_text(xstr("prefs_usingFS2Crew_tooltip")) 391 395 simulatorBox.pack_start(self._usingFS2Crew, False, False, 4) 392 396 393 397 (iasSmoothingBox, self._iasSmoothingEnabled, 394 398 self._iasSmoothingLength) = \ … … 412 416 self._pirepDirectory = gtk.Entry() 413 417 self._pirepDirectory.set_tooltip_text(xstr("prefs_pirepDirectory_tooltip")) 418 self._pirepDirectory.connect("changed", self._pirepDirectoryChanged) 414 419 label.set_mnemonic_widget(self._pirepDirectory) 415 420 pirepBox.pack_start(self._pirepDirectory, True, True, 4) … … 419 424 self._pirepDirectoryButtonClicked) 420 425 pirepBox.pack_start(self._pirepDirectoryButton, False, False, 4) 421 426 427 self._pirepAutoSave = gtk.CheckButton(xstr("prefs_pirepAutoSave")) 428 self._pirepAutoSave.set_use_underline(True) 429 self._pirepAutoSave.set_tooltip_text(xstr("prefs_pirepAutoSave_tooltip")) 430 mainBox.pack_start(self._pirepAutoSave, False, False, 0) 431 422 432 return mainAlignment 423 433 … … 482 492 483 493 def _getLanguage(self): 484 """Get the language selected by the user.""" 494 """Get the language selected by the user.""" 485 495 iter = self._languageComboBox.get_active_iter() 486 496 (lang,) = self._languageList.get(iter, 1) … … 514 524 smoothingEnabled.set_active(smoothing>=2) 515 525 smoothingLength.set_value(abs(smoothing)) 516 526 517 527 def _getSmoothing(self, smoothingEnabled, smoothingLength): 518 528 """Get the smoothing value from the given controls. … … 524 534 value *= -1 525 535 return value 526 536 527 537 def _pirepDirectoryButtonClicked(self, button): 528 538 """Called when the PIREP directory button is clicked.""" … … 539 549 if directory: 540 550 dialog.select_filename(directory) 541 551 542 552 result = dialog.run() 543 553 dialog.hide() … … 545 555 if result==RESPONSETYPE_OK: 546 556 self._pirepDirectory.set_text(text2unicode(dialog.get_filename())) 547 557 558 def _pirepDirectoryChanged(self, entry): 559 """Called when the PIREP directory is changed.""" 560 if self._pirepDirectory.get_text(): 561 self._pirepAutoSave.set_sensitive(True) 562 else: 563 self._pirepAutoSave.set_active(False) 564 self._pirepAutoSave.set_sensitive(False) 565 548 566 def _buildMessages(self): 549 567 """Build the page for the message settings.""" … … 561 579 table.set_homogeneous(False) 562 580 mainBox.pack_start(table, False, False, 4) 563 581 564 582 label = gtk.Label(xstr("prefs_msgs_fs")) 565 583 label.set_justify(JUSTIFY_CENTER) 566 584 label.set_alignment(0.5, 1.0) 567 585 table.attach(label, 1, 2, 0, 1) 568 586 569 587 label = gtk.Label(xstr("prefs_msgs_sound")) 570 588 label.set_justify(JUSTIFY_CENTER) … … 573 591 574 592 self._msgFSCheckButtons = {} 575 self._msgSoundCheckButtons = {} 593 self._msgSoundCheckButtons = {} 576 594 row = 1 577 595 for messageType in const.messageTypes: … … 589 607 table.attach(alignment, 1, 2, row, row+1) 590 608 self._msgFSCheckButtons[messageType] = fsCheckButton 591 609 592 610 soundCheckButton = gtk.CheckButton() 593 611 alignment = gtk.Alignment(xscale = 0.0, yscale = 0.0, 594 612 xalign = 0.5, yalign = 0.5) 595 613 alignment.add(soundCheckButton) 596 table.attach(alignment, 2, 3, row, row+1) 614 table.attach(alignment, 2, 3, row, row+1) 597 615 self._msgSoundCheckButtons[messageType] = soundCheckButton 598 616 … … 665 683 xstr("prefs_sounds_pilotHotkeyCtrl_tooltip"), 666 684 xstr("prefs_sounds_pilotHotkeyShift_tooltip")]) 667 685 668 686 backgroundBox.pack_start(self._pilotHotkey, False, False, 4) 669 687 … … 672 690 self._enableApproachCallouts.set_tooltip_text(xstr("prefs_sounds_approachCallouts_tooltip")) 673 691 backgroundBox.pack_start(self._enableApproachCallouts, False, False, 4) 674 692 675 693 self._speedbrakeAtTD = gtk.CheckButton(xstr("prefs_sounds_speedbrakeAtTD")) 676 694 self._speedbrakeAtTD.set_use_underline(True) … … 689 707 checklistBox = gtk.VBox() 690 708 checklistAlignment.add(checklistBox) 691 709 692 710 self._enableChecklists = gtk.CheckButton(xstr("prefs_sounds_enableChecklists")) 693 711 self._enableChecklists.set_use_underline(True) … … 774 792 self._autoUpdate.set_tooltip_text(xstr("prefs_update_auto_tooltip")) 775 793 self._warnedAutoUpdate = False 776 794 777 795 updateURLBox = gtk.HBox() 778 796 mainBox.pack_start(updateURLBox, False, False, 4) … … 814 832 dialog.hide() 815 833 self._warnedAutoUpdate = True 816 834 817 835 def _updateURLChanged(self, entry): 818 836 """Called when the update URL is changed."""
Note:
See TracChangeset
for help on using the changeset viewer.