Changeset 1067:9ce88d0b881d
- Timestamp:
- 12/21/22 10:17:25 (2 years ago)
- Branch:
- python3
- Phase:
- public
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
locale/en/mlx.po
r1034 r1067 1857 1857 1858 1858 msgid "prefs_update_auto" 1859 msgstr "Update the program auto _matically"1859 msgstr "Update the program automaticall_y" 1860 1860 1861 1861 msgid "prefs_update_auto_tooltip" … … 1878 1878 "The URL from which to download the updates. Change this only if you " 1879 1879 "know what you are doing!" 1880 1881 msgid "prefs_xplane_remote" 1882 msgstr "Connect to X-Plane _remotely" 1883 1884 msgid "prefs_xplane_remote_tooltip" 1885 msgstr "" 1886 "If selected and you are usinb X-Plane, the logger will connect to X-Plane " 1887 "running on another machine, whose IP address or domain name should be " 1888 "entered below." 1889 1890 msgid "prefs_xplane_address" 1891 msgstr "_Address or name:" 1892 1893 msgid "prefs_xplane_address_tooltip" 1894 msgstr "" 1895 "Enter the IP address or the domain name of the machine, " 1896 "where X-Plane runs." 1880 1897 1881 1898 msgid "prefs_use_rpc" -
locale/hu/mlx.po
r1034 r1067 1890 1890 "Az URL, ahol a frissítéseket keresi a program. Csak akkor változtasd meg, " 1891 1891 "ha biztos vagy a dolgodban!" 1892 1893 msgid "prefs_xplane_remote" 1894 msgstr "X-Plane _távoli elérése" 1895 1896 msgid "prefs_xplane_remote_tooltip" 1897 msgstr "" 1898 "Ha ez ki van választva, és X-Plane-t használsz, a logger a lent megadott " 1899 "névvel vagy IP címmel rendelkező másik gépen futó X-Plane-hez fog " 1900 "kapcsolódni." 1901 1902 msgid "prefs_xplane_address" 1903 msgstr "_Cím vagy név:" 1904 1905 msgid "prefs_xplane_address_tooltip" 1906 msgstr "" 1907 "Add meg az X-Plane-t futtató gép IP címét vagy nevét." 1892 1908 1893 1909 msgid "prefs_use_rpc" -
src/mlx/config.py
r1045 r1067 260 260 self._updateURLUpdated = True 261 261 262 self._xplaneRemote = False 263 self._xplaneAddress = "" 264 262 265 self._messageTypeLevels = {} 263 266 … … 667 670 if updateURL!=self._updateURL: 668 671 self._updateURL = updateURL 672 self._modified = True 673 674 @property 675 def xplaneRemote(self): 676 """Indicate if X-Plane should be accessed remotely.""" 677 return self._xplaneRemote 678 679 @xplaneRemote.setter 680 def xplaneRemote(self, xplaneRemote): 681 """Set if X-Plane should be accessed remotely.""" 682 if xplaneRemote!=self._xplaneRemote: 683 self._xplaneRemote = xplaneRemote 684 self._modified = True 685 686 @property 687 def xplaneAddress(self): 688 """Get the address of the machine running X-Plane""" 689 return self._xplaneAddress 690 691 @xplaneAddress.setter 692 def xplaneAddress(self, xplaneAddress): 693 """Set the address of the machine running X-Plane.""" 694 if xplaneAddress!=self._xplaneAddress: 695 self._xplaneAddress = xplaneAddress 669 696 self._modified = True 670 697 … … 799 826 "defaultMSFS", os.name=="nt") 800 827 828 self._xplaneRemote = self._getBoolean(config, "general", 829 "xplaneRemote", False) 830 self._xplaneAddress = self._get(config, "general", 831 "xplaneAddress", "") 832 801 833 self._modified = False 802 834 … … 852 884 "yes" if self._defaultMSFS else "no") 853 885 886 config.set("general", "xplaneRemote", 887 "yes" if self._xplaneRemote else "no") 888 config.set("general", "xplaneAddress", self._xplaneAddress) 889 854 890 config.add_section(Config._messageTypesSection) 855 891 for messageType in const.messageTypes: … … 1002 1038 1003 1039 print(" defaultMSFS:", self._defaultMSFS) 1040 print(" xplaneRemote:", self._xplaneRemote) 1041 print(" xplaneAddress:", self._xplaneAddress) 1004 1042 1005 1043 print(" enableSounds:", self._enableSounds) -
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() -
src/mlx/xplane.py
r1064 r1067 494 494 not due to no longer requested. 495 495 """ 496 config = self._connectionListener.config 497 if config.xplaneRemote: 498 address = "tcp:" + config.xplaneAddress 499 else: 500 address = "local" 501 502 print("xplane.Handler._connect: address:", address) 503 496 504 while self._connectionRequested: 497 505 if attempts>=self.NUM_CONNECTATTEMPTS: … … 507 515 try: 508 516 attempts += 1 509 self._xplane.connect( )517 self._xplane.connect(address = address) 510 518 511 519 (xplaneVersion, xplmVersion, xplraVersion) = \ … … 734 742 735 743 self._fuelCallback = None 744 745 @property 746 def config(self): 747 """Get the configuration.""" 748 return self._connectionListener.config 736 749 737 750 def connect(self, aircraft):
Note:
See TracChangeset
for help on using the changeset viewer.