Changeset 1067:9ce88d0b881d for src/mlx/gui
- Timestamp:
- 12/21/22 10:17:25 (2 years ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/prefs.py
r1044 r1067 276 276 277 277 self._updateURL.set_text(config.updateURL) 278 279 self._xplaneRemote.set_active(config.xplaneRemote) 280 self._xplaneAddress.set_text(config.xplaneAddress) 278 281 279 282 self._settingFromConfig = False … … 321 324 config.updateURL = self._updateURL.get_text() 322 325 326 config.xplaneRemote = self._xplaneRemote.get_active() 327 config.xplaneAddress = self._xplaneAddress.get_text() 328 323 329 def _buildGeneral(self): 324 330 """Build the page for the general settings.""" … … 793 799 mainAlignment.add(mainBox) 794 800 801 frame = Gtk.Frame.new() 802 795 803 self._autoUpdate = Gtk.CheckButton(xstr("prefs_update_auto")) 796 mainBox.pack_start(self._autoUpdate, False, False, 4) 804 frame.set_label_widget(self._autoUpdate) 805 frame.set_label_align(0.025, 0.5) 806 mainBox.pack_start(frame, False, False, 4) 797 807 798 808 self._autoUpdate.set_use_underline(True) … … 802 812 803 813 updateURLBox = Gtk.HBox() 804 mainBox.pack_start(updateURLBox, False, False, 4)805 814 label = Gtk.Label(xstr("prefs_update_url")) 806 815 label.set_use_underline(True) … … 813 822 self._updateURL.connect("changed", self._updateURLChanged) 814 823 updateURLBox.pack_start(self._updateURL, True, True, 4) 824 825 updateURLBox.set_margin_top(6) 826 updateURLBox.set_margin_bottom(6) 827 updateURLBox.set_margin_left(4) 828 updateURLBox.set_margin_right(4) 829 frame.add(updateURLBox) 830 831 frame = Gtk.Frame.new() 832 self._xplaneRemote = Gtk.CheckButton(xstr("prefs_xplane_remote")) 833 frame.set_label_widget(self._xplaneRemote) 834 frame.set_label_align(0.025, 0.5) 835 mainBox.pack_start(frame, False, False, 4) 836 837 self._xplaneRemote.set_use_underline(True) 838 self._xplaneRemote.set_tooltip_text(xstr("prefs_xplane_remote_tooltip")) 839 self._xplaneRemote.connect("toggled", self._xplaneRemoteToggled) 840 841 xplaneAddressBox = Gtk.HBox() 842 label = Gtk.Label(xstr("prefs_xplane_address")) 843 label.set_use_underline(True) 844 xplaneAddressBox.pack_start(label, False, False, 4) 845 846 self._xplaneAddress = Gtk.Entry() 847 label.set_mnemonic_widget(self._xplaneAddress) 848 self._xplaneAddress.set_width_chars(40) 849 self._xplaneAddress.set_tooltip_text(xstr("prefs_xplane_address_tooltip")) 850 self._xplaneAddress.connect("changed", self._xplaneAddressChanged) 851 xplaneAddressBox.pack_start(self._xplaneAddress, True, True, 4) 852 853 xplaneAddressBox.set_margin_top(6) 854 xplaneAddressBox.set_margin_bottom(6) 855 xplaneAddressBox.set_margin_left(4) 856 xplaneAddressBox.set_margin_right(4) 857 frame.add(xplaneAddressBox) 815 858 816 859 return mainAlignment … … 824 867 except: 825 868 pass 869 870 if sensitive: 871 sensitive = not self._xplaneRemote.get_active() or \ 872 len(self._xplaneAddress.get_text())>0 826 873 827 874 okButton = self.get_widget_for_response(Gtk.ResponseType.ACCEPT) … … 845 892 self._setOKButtonSensitivity() 846 893 894 def _xplaneRemoteToggled(self, button): 895 """Called when the X-Plane remote access checkbox is toggled.""" 896 self._setOKButtonSensitivity() 897 898 def _xplaneAddressChanged(self, entry): 899 """Called when the X-Plane address is changed.""" 900 self._setOKButtonSensitivity()
Note:
See TracChangeset
for help on using the changeset viewer.