Changeset 115:fa8178825b29 for src/mlx/gui
- Timestamp:
- 04/27/12 18:29:22 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 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)
Note:
See TracChangeset
for help on using the changeset viewer.