Changeset 753:c4b335324b86
- Timestamp:
- 01/06/16 13:07:30 (9 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
locale/en/mlx.po
r744 r753 94 94 msgstr "_Send..." 95 95 96 msgid "button_register" 97 msgstr "_Register" 98 96 99 msgid "button_cancelFlight" 97 100 msgstr "Cancel flight" … … 269 272 msgid "login_remember_tooltip" 270 273 msgstr "" 271 "If checked, your password will be stored , so that you "274 "If checked, your password will be stored by the program, so that you " 272 275 "should not have to enter it every time. Note, however, that " 273 276 "the password is stored as text, and anybody who can access " … … 279 282 msgid "login_entranceExam_tooltip" 280 283 msgstr "Check this to log in to take your entrance exam." 284 285 msgid "button_login_register" 286 msgstr "R_egister..." 287 288 msgid "button_login_register_tooltip" 289 msgstr "Click here if you would like to register with Malév Virtual" 281 290 282 291 msgid "button_offline" … … 2113 2122 msgid "sendBugReport_error_sec" 2114 2123 msgstr "There was some communication error, try again later." 2124 2125 msgid "register_title" 2126 msgstr "Registration" 2127 2128 msgid "register_help" 2129 msgstr "" 2130 "Enter the data below.\n" 2131 "Optional data items are in <i>italics</i>.\n" 2132 "One of VATSIM ID or IVAO ID is mandatory." 2133 2134 msgid "register_name" 2135 msgstr "_Name:" 2136 2137 msgid "register_name_tooltip" 2138 msgstr "Enter your real name." 2139 2140 msgid "register_year_of_birth" 2141 msgstr "_Year of birth:" 2142 2143 msgid "register_year_of_birth_tooltip" 2144 msgstr "Enter the year in which you were born." 2145 2146 msgid "register_email" 2147 msgstr "_E-mail:" 2148 2149 msgid "register_email_tooltip" 2150 msgstr "Enter your e-mail address." 2151 2152 msgid "register_email_public" 2153 msgstr "P_ublic" 2154 2155 msgid "register_email_public_tooltip" 2156 msgstr "" 2157 "If checked, your e-mail address will be displayed in our forums and " 2158 "possibly other internal website areas, and thus it will be made " 2159 "available to other members of MAVA." 2160 2161 msgid "register_vatsim_id" 2162 msgstr "_VATSIM CID:" 2163 2164 msgid "register_vatsim_id_tooltip" 2165 msgstr "" 2166 "Enter your VATSIM CID, if you are registered with VATSIM. " 2167 "Note that either a VATSIM CID or an IVAO VID is required for the registration." 2168 2169 msgid "register_ivao_id" 2170 msgstr "IV_AO VID:" 2171 2172 msgid "register_ivao_id_tooltip" 2173 msgstr "" 2174 "Enter your IVAO VID, if you are registered with IVAO. " 2175 "Note that either a VATSIM CID or an IVAO VID is required for the registration." 2176 2177 msgid "register_phone_num" 2178 msgstr "<i>Phone num_ber</i>:" 2179 2180 msgid "register_phone_num_tooltip" 2181 msgstr "Enter your phone number, if we can reach you by phone." 2182 2183 msgid "register_nationality" 2184 msgstr "<i>Na_tionality</i>:" 2185 2186 msgid "register_nationality_tooltip" 2187 msgstr "Enter your nationality, if you would like to share that info with us." 2188 2189 msgid "register_password" 2190 msgstr "Pa_ssword:" 2191 2192 msgid "register_password_tooltip" 2193 msgstr "Enter the password you would like to use for logging in." 2194 2195 msgid "register_password2" 2196 msgstr "Pass_word again:" 2197 2198 msgid "register_password2_tooltip" 2199 msgstr "Enter the same password again." 2200 2201 msgid "register_password_ok" 2202 msgstr "<span foreground=\"green\">OK</span>" 2203 2204 msgid "register_password_too_short" 2205 msgstr "<span foreground=\"orange\">Too short</span>" 2206 2207 msgid "register_password_mismatch" 2208 msgstr "<span foreground=\"red\">Passwords differ</span>" -
locale/hu/mlx.po
r744 r753 94 94 msgstr "_Küldés..." 95 95 96 msgid "button_register" 97 msgstr "_Regisztráció" 98 96 99 msgid "button_cancelFlight" 97 100 msgstr "Járat megszakítása" … … 278 281 msgid "login_entranceExam_tooltip" 279 282 msgstr "Ha ezt bejelölöd, ellenörző repülésre jelentkezhetsz be." 283 284 msgid "button_login_register" 285 msgstr "_Regisztráció..." 286 287 msgid "button_login_register_tooltip" 288 msgstr "Kattints ide a Malév Virtualhoz való regisztrálás céljából." 280 289 281 290 msgid "button_offline" … … 2127 2136 msgid "sendBugReport_error_sec" 2128 2137 msgstr "Valamilyen kommunikációs probléma adódott, próbáld újra később." 2138 2139 msgid "register_title" 2140 msgstr "Regisztráció" 2141 2142 msgid "register_help" 2143 msgstr "" 2144 "Töltsd ki a lenti űrlapot.\n" 2145 "A <i>dőlt</i> betűs adatokat nem kötelező megadnod.\n" 2146 "Vagy VATSIM vagy IVAO azonosítót meg kell adni." 2147 2148 msgid "register_name" 2149 msgstr "Né_v:" 2150 2151 msgid "register_name_tooltip" 2152 msgstr "Írd be a valódi nevedet" 2153 2154 msgid "register_year_of_birth" 2155 msgstr "S_zületés éve:" 2156 2157 msgid "register_year_of_birth_tooltip" 2158 msgstr "Írd be az évnek a számát, amelyben születtél.." 2159 2160 msgid "register_email" 2161 msgstr "E-m_ail:" 2162 2163 msgid "register_email_tooltip" 2164 msgstr "Írd be az e-mail címedet." 2165 2166 msgid "register_email_public" 2167 msgstr "P_ublikus" 2168 2169 msgid "register_email_public_tooltip" 2170 msgstr "" 2171 "Ha ezt bejelölöd, az e-mail címed megjelenhet a fórumunkban és " 2172 "egyéb belső weboldalakon is, így azt a MAVA többi tagja " 2173 "láthatja." 2174 2175 msgid "register_vatsim_id" 2176 msgstr "VATSIM _CID:" 2177 2178 msgid "register_vatsim_id_tooltip" 2179 msgstr "" 2180 "Ha rendelkezel VATSIM regisztrációval, írd be ide az azonosítódat. " 2181 "A regisztrációhoz vagy VATSIM vagy IVAO azonosító szükséges." 2182 2183 msgid "register_ivao_id" 2184 msgstr "IVA_O VID:" 2185 2186 msgid "register_ivao_id_tooltip" 2187 msgstr "" 2188 "Ha rendelkezel IVAO regisztrációval, írd be ide az azonosítódat. " 2189 "A regisztrációhoz vagy VATSIM vagy IVAO azonosító szükséges." 2190 2191 msgid "register_phone_num" 2192 msgstr "<i>Tele_fonszám</i>:" 2193 2194 msgid "register_phone_num_tooltip" 2195 msgstr "Ha telefonon is kereshetünk, írd be a számodat." 2196 2197 msgid "register_nationality" 2198 msgstr "<i>Nemzetisé_g</i>:" 2199 2200 msgid "register_nationality_tooltip" 2201 msgstr "Írd be a nemzetiségedet, ha meg kívánod azt velünk osztani." 2202 2203 msgid "register_password" 2204 msgstr "Je_lszó:" 2205 2206 msgid "register_password_tooltip" 2207 msgstr "Írd be a jelszót, amivel be szeretnél majd jelentkezni." 2208 2209 msgid "register_password2" 2210 msgstr "Jelszó új_ra:" 2211 2212 msgid "register_password2_tooltip" 2213 msgstr "Írd be ugyanazt a jelszót megint." 2214 2215 msgid "register_password_ok" 2216 msgstr "<span foreground=\"green\">Rendben</span>" 2217 2218 msgid "register_password_too_short" 2219 msgstr "<span foreground=\"orange\">Túl rövid</span>" 2220 2221 msgid "register_password_mismatch" 2222 msgstr "<span foreground=\"red\">A két jelszó különbözik</span>" -
src/mlx/gui/flight.py
r739 r753 20 20 import tempfile 21 21 import threading 22 import re 22 23 23 24 #----------------------------------------------------------------------------- … … 327 328 table.attach(self._entranceExam, 1, 2, 3, 4, ypadding = 12) 328 329 330 self.addButton(xstr("button_login_register"), 331 clicked = self._registerClicked, 332 tooltip = xstr("button_login_register_tooltip")) 333 329 334 self.addButton(xstr("button_offline"), 330 335 clicked = self._offlineClicked, … … 385 390 self._loginButton.set_sensitive(pilotID!="" and 386 391 (password!="" or entranceExam)) 392 393 def _registerClicked(self, button): 394 """Called when the Register button was clicked.""" 395 self._wizard.jumpPage(3) 387 396 388 397 def _offlineClicked(self, button): … … 658 667 const.PLANE_AWAY) 659 668 else: 660 self._nextDistance = 2661 self._wizard.jumpPage( 2)669 self._nextDistance = 4 670 self._wizard.jumpPage(4) 662 671 663 672 def _fleetRetrieved(self, fleet): 664 673 """Called when the fleet has been retrieved.""" 665 674 if fleet is None: 666 self._nextDistance = 2667 self._wizard.jumpPage( 2)675 self._nextDistance = 4 676 self._wizard.jumpPage(4) 668 677 else: 669 678 plane = fleet[self._wizard._bookedFlight.tailNumber] 670 679 if plane is None: 671 self._nextDistance = 2672 self._wizard.jumpPage( 2)680 self._nextDistance = 4 681 self._wizard.jumpPage(4) 673 682 elif plane.gateNumber is not None and \ 674 683 not fleet.isGateConflicting(plane): 675 684 self._wizard._departureGate = plane.gateNumber 676 self._nextDistance = 2677 self._wizard.jumpPage( 2)685 self._nextDistance = 4 686 self._wizard.jumpPage(4) 678 687 else: 679 688 self._nextDistance = 1 … … 682 691 def _planeUpdated(self, success): 683 692 """Callback for the plane updating.""" 684 self._nextDistance = 2685 self._wizard.jumpPage( 2)693 self._nextDistance = 4 694 self._wizard.jumpPage(4) 686 695 687 696 def _getSaveDialog(self): … … 849 858 self._gateSelected() 850 859 else: 851 self._wizard. nextPage()860 self._wizard.jumpPage(3) 852 861 853 862 def _rowActivated(self, flightList, path, column): … … 871 880 """Callback for the plane updating call.""" 872 881 if success is None or success: 873 self._wizard. nextPage()882 self._wizard.jumpPage(3) 874 883 else: 875 884 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, … … 887 896 """Called when the fleet has been retrieved.""" 888 897 if fleet is None: 889 self._wizard. nextPage()898 self._wizard.jumpPage(3) 890 899 else: 891 900 self.activate() 901 902 #----------------------------------------------------------------------------- 903 904 class RegisterPage(Page): 905 """A page to enter the registration data.""" 906 907 # The minimal year of birth 908 _minYearOfBirth = 1900 909 910 # The maximal year of birth 911 _maxYearOfBirth = datetime.date.today().year 912 913 # The regular expression to check the e-mail address with 914 _emailAddressRE = re.compile("[^@]+@[^@]+\.[^@]+") 915 916 def __init__(self, wizard): 917 """Construct the registration page.""" 918 super(RegisterPage, self).__init__(wizard, xstr("register_title"), 919 xstr("register_help")) 920 921 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 922 xscale = 0.0, yscale = 0.0) 923 924 table = gtk.Table(11, 3) 925 table.set_row_spacings(4) 926 table.set_col_spacings(32) 927 alignment.add(table) 928 self.setMainWidget(alignment) 929 930 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 931 xscale = 0.0, yscale = 0.0) 932 label = gtk.Label(xstr("register_name")) 933 label.set_use_underline(True) 934 labelAlignment.add(label) 935 table.attach(labelAlignment, 0, 1, 0, 1) 936 937 self._name = gtk.Entry() 938 self._name.connect("changed", self._updateButtons) 939 self._name.set_tooltip_text(xstr("register_name_tooltip")) 940 self._name.set_width_chars(30) 941 table.attach(self._name, 1, 2, 0, 1) 942 label.set_mnemonic_widget(self._name) 943 944 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 945 xscale = 0.0, yscale = 0.0) 946 label = gtk.Label(xstr("register_year_of_birth")) 947 label.set_use_underline(True) 948 labelAlignment.add(label) 949 table.attach(labelAlignment, 0, 1, 1, 2) 950 951 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0, 952 xscale = 0.0, yscale = 0.0) 953 954 self._yearOfBirth = gtk.SpinButton() 955 self._yearOfBirth.set_increments(step = 1, page = 10) 956 self._yearOfBirth.set_range(min = RegisterPage._minYearOfBirth, 957 max = RegisterPage._maxYearOfBirth) 958 self._yearOfBirth.set_numeric(True) 959 self._yearOfBirth.set_tooltip_text(xstr("register_year_of_birth_tooltip")) 960 self._yearOfBirth.set_width_chars(5) 961 self._yearOfBirth.connect("changed", self._updateButtons) 962 self._yearOfBirth.connect("value-changed", self._updateButtons) 963 alignment.add(self._yearOfBirth) 964 table.attach(alignment, 1, 2, 1, 2) 965 label.set_mnemonic_widget(self._yearOfBirth) 966 967 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 968 xscale = 0.0, yscale = 0.0) 969 label = gtk.Label(xstr("register_email")) 970 label.set_use_underline(True) 971 labelAlignment.add(label) 972 table.attach(labelAlignment, 0, 1, 2, 3) 973 974 self._emailAddress = gtk.Entry() 975 self._emailAddress.connect("changed", self._updateButtons) 976 self._emailAddress.set_tooltip_text(xstr("register_email_tooltip")) 977 table.attach(self._emailAddress, 1, 2, 2, 3) 978 label.set_mnemonic_widget(self._emailAddress) 979 980 self._emailAddressPublic = gtk.CheckButton(xstr("register_email_public")) 981 self._emailAddressPublic.set_use_underline(True) 982 self._emailAddressPublic.set_tooltip_text(xstr("register_email_public_tooltip")) 983 table.attach(self._emailAddressPublic, 2, 3, 2, 3) 984 985 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 986 xscale = 0.0, yscale = 0.0) 987 label = gtk.Label(xstr("register_vatsim_id")) 988 label.set_use_underline(True) 989 labelAlignment.add(label) 990 table.attach(labelAlignment, 0, 1, 3, 4) 991 992 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0, 993 xscale = 0.0, yscale = 0.0) 994 self._vatsimID = IntegerEntry() 995 self._vatsimID.connect("changed", self._updateButtons) 996 self._vatsimID.set_tooltip_text(xstr("register_vatsim_id_tooltip")) 997 self._vatsimID.set_width_chars(7) 998 alignment.add(self._vatsimID) 999 table.attach(alignment, 1, 2, 3, 4) 1000 label.set_mnemonic_widget(self._vatsimID) 1001 1002 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 1003 xscale = 0.0, yscale = 0.0) 1004 label = gtk.Label(xstr("register_ivao_id")) 1005 label.set_use_underline(True) 1006 labelAlignment.add(label) 1007 table.attach(labelAlignment, 0, 1, 4, 5) 1008 1009 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0, 1010 xscale = 0.0, yscale = 0.0) 1011 self._ivaoID = IntegerEntry() 1012 self._ivaoID.connect("changed", self._updateButtons) 1013 self._ivaoID.set_tooltip_text(xstr("register_ivao_id_tooltip")) 1014 self._ivaoID.set_width_chars(7) 1015 alignment.add(self._ivaoID) 1016 table.attach(alignment, 1, 2, 4, 5) 1017 label.set_mnemonic_widget(self._ivaoID) 1018 1019 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 1020 xscale = 0.0, yscale = 0.0) 1021 label = gtk.Label(xstr("register_phone_num")) 1022 label.set_use_underline(True) 1023 label.set_use_markup(True) 1024 labelAlignment.add(label) 1025 table.attach(labelAlignment, 0, 1, 5, 6) 1026 1027 self._phoneNumber = gtk.Entry() 1028 self._phoneNumber.set_tooltip_text(xstr("register_phone_num_tooltip")) 1029 table.attach(self._phoneNumber, 1, 2, 5, 6) 1030 label.set_mnemonic_widget(self._phoneNumber) 1031 1032 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 1033 xscale = 0.0, yscale = 0.0) 1034 label = gtk.Label(xstr("register_nationality")) 1035 label.set_use_underline(True) 1036 label.set_use_markup(True) 1037 labelAlignment.add(label) 1038 table.attach(labelAlignment, 0, 1, 6, 7) 1039 1040 1041 self._nationality = gtk.Entry() 1042 self._nationality.set_tooltip_text(xstr("register_nationality_tooltip")) 1043 table.attach(self._nationality, 1, 2, 6, 7) 1044 label.set_mnemonic_widget(self._nationality) 1045 1046 placeholder = gtk.Label() 1047 placeholder.set_text(xstr("register_password_mismatch")) 1048 placeholder.set_use_markup(True) 1049 placeholder.set_child_visible(False) 1050 placeholder.hide() 1051 table.attach(placeholder, 2, 3, 6, 7) 1052 1053 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 1054 xscale = 0.0, yscale = 0.0) 1055 label = gtk.Label(xstr("register_password")) 1056 label.set_use_underline(True) 1057 labelAlignment.add(label) 1058 table.attach(labelAlignment, 0, 1, 8, 9) 1059 1060 self._password = gtk.Entry() 1061 self._password.set_visibility(False) 1062 self._password.connect("changed", self._updateButtons) 1063 self._password.set_tooltip_text(xstr("register_password_tooltip")) 1064 table.attach(self._password, 1, 2, 8, 9) 1065 label.set_mnemonic_widget(self._password) 1066 1067 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5, 1068 xscale = 0.0, yscale = 0.0) 1069 self._passwordStatus = gtk.Label() 1070 alignment.add(self._passwordStatus) 1071 table.attach(alignment, 2, 3, 8, 9) 1072 1073 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 1074 xscale = 0.0, yscale = 0.0) 1075 label = gtk.Label(xstr("register_password2")) 1076 label.set_use_underline(True) 1077 labelAlignment.add(label) 1078 table.attach(labelAlignment, 0, 1, 9, 10) 1079 1080 self._password2 = gtk.Entry() 1081 self._password2.set_visibility(False) 1082 self._password2.connect("changed", self._updateButtons) 1083 self._password2.set_tooltip_text(xstr("register_password2_tooltip")) 1084 table.attach(self._password2, 1, 2, 9, 10) 1085 label.set_mnemonic_widget(self._password2) 1086 1087 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5, 1088 xscale = 0.0, yscale = 0.0) 1089 self._password2Status = gtk.Label() 1090 alignment.add(self._password2Status) 1091 table.attach(alignment, 2, 3, 9, 10) 1092 1093 self._rememberButton = gtk.CheckButton(xstr("remember_password")) 1094 self._rememberButton.set_use_underline(True) 1095 self._rememberButton.set_tooltip_text(xstr("login_remember_tooltip")) 1096 table.attach(self._rememberButton, 1, 2, 10, 11) 1097 1098 cancelButton = \ 1099 self.addButton(xstr("button_cancel")) 1100 cancelButton.connect("clicked", self._cancelClicked) 1101 1102 self._registerButton = \ 1103 self.addButton(xstr("button_register"), default = True, 1104 tooltip = xstr("button_register_tooltip")) 1105 self._registerButton.connect("clicked", self._registerClicked) 1106 1107 self._updateButtons() 1108 1109 def activate(self): 1110 """Setup the route from the booked flight.""" 1111 self._yearOfBirth.set_value(0) 1112 self._yearOfBirth.set_text("") 1113 self._updateButtons() 1114 1115 def _updateButtons(self, widget = None): 1116 """Update the sensitive state of the buttons""" 1117 name = self._name.get_text() 1118 nameLength = len(name) 1119 nameSpacePosition = name.find(" ") 1120 1121 yearOfBirthText = self._yearOfBirth.get_text() 1122 yearOfBirth = int(yearOfBirthText) if yearOfBirthText else 0 1123 1124 emailAddressText = self._emailAddress.get_text() 1125 emailAddressMatch = RegisterPage._emailAddressRE.match(emailAddressText) 1126 1127 vatsimID = self._vatsimID.get_int() 1128 ivaoID = self._ivaoID.get_int() 1129 1130 password = self._password.get_text() 1131 password2 = self._password2.get_text() 1132 if not password: 1133 self._passwordStatus.set_text("") 1134 elif len(password)<5: 1135 self._passwordStatus.set_text(xstr("register_password_too_short")) 1136 else: 1137 self._passwordStatus.set_text(xstr("register_password_ok")) 1138 self._passwordStatus.set_use_markup(True) 1139 1140 if len(password)<5 or not password2: 1141 self._password2Status.set_text("") 1142 elif password!=password2: 1143 self._password2Status.set_text(xstr("register_password_mismatch")) 1144 else: 1145 self._password2Status.set_text(xstr("register_password_ok")) 1146 self._password2Status.set_use_markup(True) 1147 1148 sensitive = \ 1149 nameLength >= 5 and nameSpacePosition != -1 and \ 1150 nameSpacePosition<(nameLength-2) and \ 1151 yearOfBirth>=RegisterPage._minYearOfBirth and \ 1152 yearOfBirth<=RegisterPage._maxYearOfBirth and \ 1153 emailAddressMatch is not None and \ 1154 (vatsimID>=800000 or ivaoID>=100000) and \ 1155 len(password)>=5 and password==password2 1156 1157 self._registerButton.set_sensitive(sensitive) 1158 1159 def _cancelClicked(self, button): 1160 """Called when the Cancel button is clicked.""" 1161 self.goBack() 1162 1163 def _registerClicked(self, button): 1164 """Called when the Register button is clicked.""" 1165 1166 #----------------------------------------------------------------------------- 1167 1168 class StudentPage(Page): 1169 """A page displayed to students after logging in.""" 1170 def __init__(self, wizard): 1171 """Construct the student page.""" 1172 super(StudentPage, self).__init__(wizard, xstr("student_title"), 1173 xstr("student_help")) 892 1174 893 1175 #----------------------------------------------------------------------------- … … 4256 4538 self._pages.append(FlightSelectionPage(self)) 4257 4539 self._pages.append(GateSelectionPage(self)) 4540 self._pages.append(RegisterPage(self)) 4541 self._pages.append(StudentPage(self)) 4258 4542 self._pages.append(ConnectPage(self)) 4259 4543 self._payloadPage = PayloadPage(self)
Note:
See TracChangeset
for help on using the changeset viewer.