Changeset 115:fa8178825b29 for src/mlx
- Timestamp:
- 04/27/12 18:29:22 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/update.py
r105 r115 6 6 7 7 from mlx.update import update 8 from mlx.i18n import xstr 8 9 9 10 import mlx.const as const … … 39 40 40 41 Updater._progressWindow = window = gtk.Window() 41 window.set_title(WINDOW_TITLE_BASE + " Update")42 window.set_title(WINDOW_TITLE_BASE + " " + xstr("update_title")) 42 43 window.set_transient_for(parentWindow) 43 44 #win.set_icon_from_file(os.path.join(iconDirectory, "logo.ico")) … … 72 73 73 74 Updater._sudoDialog = sudoDialog = \ 74 gtk.Dialog(WINDOW_TITLE_BASE + " Update",75 gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"), 75 76 parentWindow, 76 77 gtk.DialogFlags.MODAL if pygobject else gtk.DIALOG_MODAL, … … 82 83 padding_left = 16, padding_right = 16) 83 84 84 infoLabel = gtk.Label("There is an update available, but the program cannot write\n" 85 "its directory due to insufficient privileges.\n\n" 86 "Click OK, if you want to run a helper program\n" 87 "with administrator privileges " 88 "to complete the update,\n" 89 "Cancel otherwise.") 85 infoLabel = gtk.Label(xstr("update_needsudo")) 90 86 infoLabel.set_justify(gtk.Justification.CENTER if pygobject 91 87 else gtk.JUSTIFY_CENTER) … … 128 124 def _downloadingManifest(self): 129 125 """Called when the downloading of the manifest has started.""" 130 self._progressLabel.set_text( "Downloading manifest...")126 self._progressLabel.set_text(xstr("update_manifest_progress")) 131 127 self._progressBar.set_fraction(0) 132 128 … … 137 133 def _downloadedManifest(self): 138 134 """Called when the downloading of the manifest has finished.""" 139 self._progressLabel.set_text( "Downloaded manifest...")135 self._progressLabel.set_text(xstr("update_manifest_done")) 140 136 self._progressBar.set_fraction(0.05) 141 137 … … 178 174 def _startDownload(self): 179 175 """Called when the download has started.""" 180 self._progressLabel.set_text( "Downloading files...")176 self._progressLabel.set_text(xstr("update_files_progress")) 181 177 182 178 def setDownloaded(self, downloaded): … … 187 183 def _setDownloaded(self, downloaded): 188 184 """Called when a certain number of bytes are downloaded.""" 189 self._progressLabel.set_text( "Downloaded %d of %d"% \185 self._progressLabel.set_text(xstr("update_files_bytes") % \ 190 186 (downloaded, self._totalSize)) 191 187 self._setProgress() … … 197 193 def _startRenaming(self): 198 194 """Called when the renaming of files has started.""" 199 self._progressLabel.set_text( "Renaming downloaded files...")195 self._progressLabel.set_text(xstr("update_renaming")) 200 196 201 197 def renamed(self, path, count): … … 206 202 def _renamed(self, path, count): 207 203 """Called when a file has been renamed.""" 208 self._progressLabel.set_text( "Renamed %s"% (path,))204 self._progressLabel.set_text(xstr("update_renamed") % (path,)) 209 205 self._setProgress() 210 206 … … 215 211 def _startRemoving(self): 216 212 """Called when the removing of files has started.""" 217 self._progressLabel.set_text( "Removing files...")213 self._progressLabel.set_text(xstr("update_removing")) 218 214 219 215 def removed(self, path, count): … … 224 220 def _removed(self, path, count): 225 221 """Called when a file has been removed.""" 226 self._progressLabel.set_text( "Removed %s"% (path,))222 self._progressLabel.set_text(xstr("update_removed") % (path,)) 227 223 self._setProgress() 228 224 … … 233 229 def _writingManifest(self): 234 230 """Called when the writing of the new manifest file has started.""" 235 self._progressLabel.set_text( "Writing the new manifest")231 self._progressLabel.set_text(xstr("update_writing_manifest")) 236 232 237 233 def done(self): … … 244 240 self._progressBar.set_fraction(1) 245 241 if self._totalProgress>0: 246 self._progressLabel.set_text( "Finished updating. Press OK to restart the program.")242 self._progressLabel.set_text(xstr("update_finished")) 247 243 self._progressOKButton.set_sensitive(True) 248 244 else: 249 self._progressLabel.set_text( "There was nothing to update")245 self._progressLabel.set_text(xstr("update_nothing")) 250 246 251 247 def _setProgress(self): … … 264 260 def _failed(self, what): 265 261 """Called when the downloading has failed.""" 266 self._progressLabel.set_text( "Failed, see the debug log for details.")262 self._progressLabel.set_text(xstr("update_failed")) 267 263 self._progressBar.set_fraction(1) 268 264 self._progressOKButton.set_sensitive(True) -
src/mlx/i18n.py
r114 r115 453 453 self.add("statusicon_stage", "Stage:") 454 454 self.add("statusicon_rating", "Rating:") 455 456 self.add("update_title", "Update") 457 self.add("update_needsudo", 458 "There is an update available, but the program cannot write\n" 459 "its directory due to insufficient privileges.\n\n" 460 "Click OK, if you want to run a helper program\n" 461 "with administrator privileges " 462 "to complete the update,\n" 463 "Cancel otherwise.") 464 self.add("update_manifest_progress", "Downloading manifest...") 465 self.add("update_manifest_done", "Downloaded manifest...") 466 self.add("update_files_progress", "Downloading files...") 467 self.add("update_files_bytes", "Downloaded %d of %d bytes") 468 self.add("update_renaming", "Renaming downloaded files...") 469 self.add("update_renamed", "Renamed %s") 470 self.add("update_removing", "Removing files...") 471 self.add("update_removed", "Removed %s") 472 self.add("update_writing_manifest", "Writing the new manifest") 473 self.add("update_finished", 474 "Finished updating. Press OK to restart the program.") 475 self.add("update_nothing", "There was nothing to update") 476 self.add("update_failed", "Failed, see the debug log for details.") 455 477 456 478 #------------------------------------------------------------------------------ … … 799 821 self.add("statusicon_rating", "Pontszám:") 800 822 823 self.add("update_title", "Frissítés") 824 self.add("update_needsudo", 825 "Lenne mit frissíteni, de a program hozzáférési jogok\n" 826 "hiányában nem tud írni a saját könyvtárába.\n\n" 827 "Kattints az OK gombra, ha el szeretnél indítani egy\n" 828 "segédprogramot adminisztrátori jogokkal, amely\n" 829 "befejezné a frissítést, egyébként a Mégse gombra.") 830 self.add("update_manifest_progress", "A manifesztum letöltése...") 831 self.add("update_manifest_done", "A manifesztum letöltve...") 832 self.add("update_files_progress", "Fájlok letöltése...") 833 self.add("update_files_bytes", "%d bájtot töltöttem le %d bájtból") 834 self.add("update_renaming", "A letöltött fájlok átnevezése...") 835 self.add("update_renamed", "Átneveztem a(z) %s fájlt") 836 self.add("update_removing", "Fájlok törlése...") 837 self.add("update_removed", "Letöröltem a(z) %s fájlt") 838 self.add("update_writing_manifest", "Az új manifesztum írása") 839 self.add("update_finished", 840 "A frissítés sikerült. Kattints az OK-ra a program újraindításához.") 841 self.add("update_nothing", "Nem volt mit frissíteni") 842 self.add("update_failed", "Nem sikerült, a részleteket lásd a debug naplóban.") 843 801 844 #------------------------------------------------------------------------------ 802 845 -
src/mlx/update.py
r39 r115 425 425 426 426 serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 427 serverSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 427 428 serverSocket.bind(("127.0.0.1", 0)) 428 429 (_host, port) = serverSocket.getsockname()
Note:
See TracChangeset
for help on using the changeset viewer.