Changeset 124:6633722f7f86 for src/mlx
- Timestamp:
- 04/29/12 07:37:22 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/config.py
r123 r124 12 12 configPath = os.path.join(os.path.expanduser("~"), 13 13 "mlx.config" if os.name=="nt" else ".mlxrc") 14 15 #------------------------------------------------------------------------------- 16 17 if os.name=="nt": 18 _languageMap = { "en_GB" : "eng", 19 "hu_HU" : "hun" } 14 20 15 21 #------------------------------------------------------------------------------- … … 172 178 import locale 173 179 if self._language: 174 os.environ["LANGUAGE"] = self._language175 os.environ["LANG"] = self._language + ".UTF-8"176 os.environ["LC_MESSAGES"] = self._language + ".UTF-8"177 os.environ["LC_COLLATE"] = self._language + ".UTF-8"178 os.environ["LC_CTYPE"] = self._language + ".UTF-8"179 180 locale.setlocale(locale.LC_ALL, (self._language,181 locale.getpreferredencoding()))180 if os.name=="nt": 181 if self._language in _languageMap: 182 locale.setlocale(locale.LC_ALL, _languageMap[self._language]) 183 else: 184 locale.setlocale(locale.LC_ALL, "") 185 else: 186 locale.setlocale(locale.LC_ALL, (self._language, 187 locale.getpreferredencoding())) 182 188 return self._language 183 189 else: -
src/mlx/gui/common.py
r123 r124 24 24 MESSAGETYPE_QUESTION = gtk.MESSAGE_QUESTION 25 25 MESSAGETYPE_INFO = gtk.MESSAGE_INFO 26 BUTTONSTYPE_OK = gtk.BUTTONS_OK 27 BUTTONSTYPE_YES_NO = gtk.BUTTONS_YES_NO 26 RESPONSETYPE_OK = gtk.RESPONSE_OK 28 27 RESPONSETYPE_YES = gtk.RESPONSE_YES 28 RESPONSETYPE_NO = gtk.RESPONSE_NO 29 29 RESPONSETYPE_ACCEPT = gtk.RESPONSE_ACCEPT 30 30 RESPONSETYPE_REJECT = gtk.RESPONSE_REJECT … … 49 49 MESSAGETYPE_QUESTION = gtk.MessageType.QUESTION 50 50 MESSAGETYPE_INFO = gtk.MessageType.INFO 51 BUTTONSTYPE_OK = gtk.ButtonsType.OK 52 BUTTONSTYPE_YES_NO = gtk.ButtonsType.YES_NO 51 RESPONSETYPE_OK = gtk.ResponseType.OK 53 52 RESPONSETYPE_YES = gtk.ResponseType.YES 53 RESPONSETYPE_NO = gtk.ResponseType.NO 54 54 RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT 55 55 RESPONSETYPE_REJECT = gtk.ResponseType.REJECT -
src/mlx/gui/flight.py
r122 r124 306 306 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 307 307 type = MESSAGETYPE_ERROR, 308 buttons = BUTTONSTYPE_OK,309 308 message_format = xstr("login_invalid")) 309 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 310 310 dialog.set_title(WINDOW_TITLE_BASE) 311 311 dialog.format_secondary_markup(xstr("login_invalid_sec")) … … 315 315 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 316 316 type = MESSAGETYPE_ERROR, 317 buttons = BUTTONSTYPE_OK,318 317 message_format = xstr("login_failconn")) 318 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 319 319 dialog.set_title(WINDOW_TITLE_BASE) 320 320 dialog.format_secondary_markup(xstr("login_failconn_sec")) … … 523 523 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 524 524 type = MESSAGETYPE_ERROR, 525 buttons = BUTTONSTYPE_OK,526 525 message_format = xstr("gatesel_conflict")) 526 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 527 527 dialog.set_title(WINDOW_TITLE_BASE) 528 528 dialog.format_secondary_markup(xstr("gatesel_conflict_sec")) … … 1880 1880 1881 1881 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 1882 type = type, buttons = BUTTONSTYPE_OK,1883 message_format = messageFormat)1882 type = type, message_format = messageFormat) 1883 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 1884 1884 dialog.set_title(WINDOW_TITLE_BASE) 1885 1885 if secondaryMarkup is not None: … … 2140 2140 dialog = gtk.MessageDialog(parent = self.gui.mainWindow, 2141 2141 type = MESSAGETYPE_ERROR, 2142 buttons = BUTTONSTYPE_OK,2143 2142 message_format = 2144 2143 xstr("fleet_update_failed")) 2144 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 2145 2145 dialog.set_title(WINDOW_TITLE_BASE) 2146 2146 dialog.run() -
src/mlx/gui/gui.py
r123 r124 581 581 dialog = gtk.MessageDialog(parent = self.mainWindow, 582 582 type = MESSAGETYPE_ERROR, 583 buttons = BUTTONSTYPE_OK,584 583 message_format = xstr("fleet_failed")) 584 dialog.add_button(xstr("button_ok"), RESPONSETYPE_ACCEPT) 585 585 dialog.set_title(WINDOW_TITLE_BASE) 586 586 dialog.run() … … 756 756 dialog = gtk.MessageDialog(parent = self._mainWindow, 757 757 type = MESSAGETYPE_QUESTION, 758 buttons = BUTTONSTYPE_YES_NO,759 758 message_format = xstr("quit_question")) 759 760 dialog.add_button(xstr("button_no"), RESPONSETYPE_NO) 761 dialog.add_button(xstr("button_yes"), RESPONSETYPE_YES) 760 762 761 763 dialog.set_title(WINDOW_TITLE_BASE) -
src/mlx/gui/prefs.py
r123 r124 19 19 xstr("prefs_title"), 20 20 gui.mainWindow, 21 DIALOG_MODAL ,22 (gtk.STOCK_CANCEL, 23 RESPONSETYPE_REJECT,24 gtk.STOCK_OK,25 RESPONSETYPE_ACCEPT))21 DIALOG_MODAL) 22 23 self.add_button(xstr("button_cancel"), RESPONSETYPE_REJECT) 24 self.add_button(xstr("button_ok"), RESPONSETYPE_ACCEPT) 25 26 26 self._gui = gui 27 27 … … 139 139 dialog = gtk.MessageDialog(parent = self, 140 140 type = MESSAGETYPE_INFO, 141 buttons = BUTTONSTYPE_OK,142 141 message_format = xstr("prefs_restart")) 142 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 143 143 dialog.set_title(self.get_title()) 144 144 dialog.format_secondary_markup(xstr("prefs_language_restart_sec")) … … 199 199 dialog = gtk.MessageDialog(parent = self, 200 200 type = MESSAGETYPE_INFO, 201 buttons = BUTTONSTYPE_OK,202 201 message_format = xstr("prefs_update_auto_warning")) 202 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 203 203 dialog.set_title(self.get_title()) 204 204 dialog.run() -
src/mlx/gui/update.py
r115 r124 75 75 gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"), 76 76 parentWindow, 77 gtk.DialogFlags.MODAL if pygobject else gtk.DIALOG_MODAL ,78 (gtk.STOCK_CANCEL, 0,79 gtk.STOCK_OK, 1))80 77 gtk.DialogFlags.MODAL if pygobject else gtk.DIALOG_MODAL) 78 sudoDialog.add_button(xstr("button_cancel"), 0) 79 sudoDialog.add_button(xstr("button_ok"), 1) 80 81 81 infoLabelAlignment = gtk.Alignment(xalign = 0.5, xscale = 0.1) 82 82 infoLabelAlignment.set_padding(padding_top = 4, padding_bottom = 10, -
src/mlx/i18n.py
r123 r124 124 124 def initialize(self): 125 125 """Initialize the strings.""" 126 self.add("button_ok", "_OK") 127 self.add("button_cancel", "_Cancel") 128 self.add("button_yes", "_Yes") 129 self.add("button_no", "_No") 130 126 131 self.add("menu_file", "File") 127 132 self.add("menu_file_quit", "_Quit") … … 166 171 "Then press <b>Reconnect</b> to reconnect.\n\n" 167 172 "If you want to cancel the flight, press <b>Cancel</b>.") 168 self.add("button_cancel", "_Cancel")169 173 self.add("button_tryagain", "_Try again") 170 174 self.add("button_reconnect", "_Reconnect") 171 175 172 176 self.add("login", "Login") 173 177 self.add("loginHelp", … … 576 580 def initialize(self): 577 581 """Initialize the strings.""" 582 self.add("button_ok", "_OK") 583 self.add("button_cancel", "_Mégse") 584 self.add("button_yes", "_Igen") 585 self.add("button_no", "_Nem") 586 578 587 self.add("menu_file", "Fájl") 579 588 self.add("menu_file_quit", "_Kilépés") … … 621 630 "Ha meg akarod szakítani a repülést, nyomd meg a " 622 631 "<b>Mégse</b> gombot.") 623 self.add("button_cancel", "_Mégse")624 632 self.add("button_tryagain", "_Próbáld újra") 625 633 self.add("button_reconnect", "Újra_kapcsolódás") 626 634 627 635 self.add("login", "Bejelentkezés") 628 636 self.add("loginHelp",
Note:
See TracChangeset
for help on using the changeset viewer.