Changeset 738:d51ccfc6e8a9


Ignore:
Timestamp:
01/02/16 12:09:24 (8 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The usage of RPC can be configured (re #283).

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r729 r738  
    17371737"know what you are doing!"
    17381738
     1739msgid "prefs_use_rpc"
     1740msgstr "Use _RPC calls"
     1741
     1742msgid "prefs_use_rpc_tooltip"
     1743msgstr ""
     1744"If checked the program will use RPC calls towards the MAVA server. "
     1745"This should be the normal operation, but if some server operation "
     1746"fails, you may want to try to uncheck here. Note, that some new "
     1747"functionality will still be called over RPC."
     1748
    17391749msgid "prefs_msgs_fs"
    17401750msgstr "Displayed in FS"
  • locale/hu/mlx.po

    r729 r738  
    17481748"ha biztos vagy a dolgodban!"
    17491749
     1750msgid "prefs_use_rpc"
     1751msgstr "_RPC hívások"
     1752
     1753msgid "prefs_use_rpc_tooltip"
     1754msgstr ""
     1755"Ha ez be van jelölve, a program RPC hívásokkal kommunikál a MAVA "
     1756"szerverrel. Ez a normális, azonban ha valamilyen szerverművelet "
     1757"nem sikerül, megpróbálhatjuk itt megszüntetni a kijelölést. "
     1758"Azonban bizonyos új funkciókat továbbra is RPC-n fog hívni a program."
     1759
    17501760msgid "prefs_msgs_fs"
    17511761msgstr ""
  • src/mlx/config.py

    r733 r738  
    258258        if secondaryInstallation:
    259259            self._updateURL += "/exp"
     260        self._useRPC = True
    260261
    261262        self._messageTypeLevels = {}
     
    666667        if updateURL!=self._updateURL:
    667668            self._updateURL = updateURL
     669            self._modified = True
     670
     671    @property
     672    def useRPC(self):
     673        """Determine if RPC calls should be used."""
     674        return self._useRPC
     675
     676    @useRPC.setter
     677    def useRPC(self, useRPC):
     678        """Set whether RPC calls should be used."""
     679        if useRPC!=self._useRPC:
     680            self._useRPC = useRPC
    668681            self._modified = True
    669682
     
    775788                                    Config.DEFAULT_UPDATE_URL +
    776789                                    ("/exp" if secondaryInstallation else ""))
     790        self._useRPC = self._getBoolean(config, "general", "useRPC", True)
    777791
    778792        for aircraftType in const.aircraftTypes:
     
    867881        config.set("update", "url", self._updateURL)
    868882
     883        config.set("general", "useRPC",
     884                   "yes" if self._useRPC else "no")
     885
    869886        config.add_section(Checklist.SECTION)
    870887        config.add_section(ApproachCallouts.SECTION)
     
    10011018        print "  autoUpdate:", self._autoUpdate
    10021019        print "  updateURL:", self._updateURL
     1020        print "  useRPC:", self._useRPC
    10031021
    10041022        print "  messageTypeLevels:"
  • src/mlx/gui/prefs.py

    r684 r738  
    276276
    277277        self._updateURL.set_text(config.updateURL)
     278
     279        self._useRPC.set_active(config.useRPC)
    278280
    279281        self._settingFromConfig = False
     
    320322        config.autoUpdate = self._autoUpdate.get_active()
    321323        config.updateURL = self._updateURL.get_text()
     324        config.useRPC = self._useRPC.get_active()
    322325
    323326    def _buildGeneral(self):
     
    814817        updateURLBox.pack_start(self._updateURL, True, True, 4)
    815818
     819        self._useRPC = gtk.CheckButton(xstr("prefs_use_rpc"))
     820        mainBox.pack_start(self._useRPC, False, False, 16)
     821
     822        self._useRPC.set_use_underline(True)
     823        self._useRPC.set_tooltip_text(xstr("prefs_use_rpc_tooltip"))
     824
    816825        return mainAlignment
    817826
Note: See TracChangeset for help on using the changeset viewer.