i18n: wrap self.tf in unicode() where 'format' function is used
Qstring (returned by self.tr) does not have 'format' method. Fixes QubesOS/qubes-issues#2599
This commit is contained in:
parent
47ac45b9b7
commit
d073b3582d
@ -225,10 +225,11 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
self.blk_manager.check_if_serves_as_backend(vm)
|
self.blk_manager.check_if_serves_as_backend(vm)
|
||||||
|
|
||||||
reply = QMessageBox.question(None, self.tr("VM Shutdown Confirmation"),
|
reply = QMessageBox.question(None, self.tr("VM Shutdown Confirmation"),
|
||||||
self.tr("Are you sure you want to power down the following VMs: "
|
unicode(self.tr(
|
||||||
"<b>{0}</b>?<br/>"
|
"Are you sure you want to power down the following VMs: "
|
||||||
"<small>This will shutdown all the running applications "
|
"<b>{0}</b>?<br/>"
|
||||||
"within them.</small>").format(', '.join(names)),
|
"<small>This will shutdown all the running applications "
|
||||||
|
"within them.</small>")).format(', '.join(names)),
|
||||||
QMessageBox.Yes | QMessageBox.Cancel)
|
QMessageBox.Yes | QMessageBox.Cancel)
|
||||||
|
|
||||||
self.app.processEvents()
|
self.app.processEvents()
|
||||||
@ -354,7 +355,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
print "Exception:", ex
|
print "Exception:", ex
|
||||||
QMessageBox.critical(None,
|
QMessageBox.critical(None,
|
||||||
self.tr("Error while preparing backup."),
|
self.tr("Error while preparing backup."),
|
||||||
self.tr("ERROR: {0}").format(ex))
|
unicode(self.tr("ERROR: {0}")).format(ex))
|
||||||
|
|
||||||
self.textEdit.setReadOnly(True)
|
self.textEdit.setReadOnly(True)
|
||||||
self.textEdit.setFontFamily("Monospace")
|
self.textEdit.setFontFamily("Monospace")
|
||||||
@ -390,7 +391,7 @@ class BackupVMsWindow(Ui_Backup, QWizard):
|
|||||||
else:
|
else:
|
||||||
self.progress_status.setText(self.tr("Backup error."))
|
self.progress_status.setText(self.tr("Backup error."))
|
||||||
QMessageBox.warning(self, self.tr("Backup error!"),
|
QMessageBox.warning(self, self.tr("Backup error!"),
|
||||||
self.tr("ERROR: {}").format(
|
unicode(self.tr("ERROR: {}")).format(
|
||||||
self.thread_monitor.error_msg))
|
self.thread_monitor.error_msg))
|
||||||
else:
|
else:
|
||||||
self.progress_bar.setValue(100)
|
self.progress_bar.setValue(100)
|
||||||
|
@ -189,8 +189,8 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
|
|||||||
if self.qvm_collection.get_vm_by_name(vmname) is not None:
|
if self.qvm_collection.get_vm_by_name(vmname) is not None:
|
||||||
QMessageBox.warning(None,
|
QMessageBox.warning(None,
|
||||||
self.tr("Incorrect AppVM Name!"),
|
self.tr("Incorrect AppVM Name!"),
|
||||||
self.tr("A VM with the name <b>{0}</b> already exists in the "
|
unicode(self.tr("A VM with the name <b>{0}</b> already exists in the "
|
||||||
"system!").format(vmname))
|
"system!")).format(vmname))
|
||||||
return
|
return
|
||||||
|
|
||||||
label = self.label_list[self.vmlabel.currentIndex()]
|
label = self.label_list[self.vmlabel.currentIndex()]
|
||||||
@ -240,7 +240,7 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
|
|||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
progress = QProgressDialog(
|
progress = QProgressDialog(
|
||||||
self.tr("Creating new {0} <b>{1}</b>...").format(vmtype, vmname), "", 0, 0)
|
unicode(self.tr("Creating new {0} <b>{1}</b>...")).format(vmtype, vmname), "", 0, 0)
|
||||||
progress.setCancelButton(None)
|
progress.setCancelButton(None)
|
||||||
progress.setModal(True)
|
progress.setModal(True)
|
||||||
progress.show()
|
progress.show()
|
||||||
@ -253,11 +253,11 @@ class NewVmDlg (QDialog, Ui_NewVMDlg):
|
|||||||
|
|
||||||
if thread_monitor.success:
|
if thread_monitor.success:
|
||||||
self.trayIcon.showMessage(
|
self.trayIcon.showMessage(
|
||||||
"VM '{0}' has been created.".format(vmname), msecs=3000)
|
unicode(self.tr("VM '{0}' has been created.")).format(vmname), msecs=3000)
|
||||||
else:
|
else:
|
||||||
QMessageBox.warning(None,
|
QMessageBox.warning(None,
|
||||||
self.tr("Error creating AppVM!"),
|
self.tr("Error creating AppVM!"),
|
||||||
self.tr("ERROR: {0}").format(thread_monitor.error_msg))
|
unicode(self.tr("ERROR: {0}")).format(thread_monitor.error_msg))
|
||||||
|
|
||||||
self.done(0)
|
self.done(0)
|
||||||
|
|
||||||
|
@ -102,10 +102,10 @@ class QubesManagerFileWatcher(ProcessEvent):
|
|||||||
"it into an application.</small>"),
|
"it into an application.</small>"),
|
||||||
msecs=3000)
|
msecs=3000)
|
||||||
else:
|
else:
|
||||||
trayIcon.showMessage(self.tr(
|
trayIcon.showMessage(unicode(self.tr(
|
||||||
"Qubes Clipboard fetched from VM: <b>'{0}'</b>\n"
|
"Qubes Clipboard fetched from VM: <b>'{0}'</b>\n"
|
||||||
"<small>Press Ctrl-Shift-v to copy this clipboard into dest"
|
"<small>Press Ctrl-Shift-v to copy this clipboard into dest"
|
||||||
" VM's clipboard.</small>").format(
|
" VM's clipboard.</small>")).format(
|
||||||
src_vmname), msecs=3000)
|
src_vmname), msecs=3000)
|
||||||
src_info_file.close()
|
src_info_file.close()
|
||||||
|
|
||||||
@ -282,11 +282,11 @@ class VmShutdownMonitor(QObject):
|
|||||||
timedelta(milliseconds=self.shutdown_time):
|
timedelta(milliseconds=self.shutdown_time):
|
||||||
reply = QMessageBox.question(
|
reply = QMessageBox.question(
|
||||||
None, self.tr("VM Shutdown"),
|
None, self.tr("VM Shutdown"),
|
||||||
self.tr("The VM <b>'{0}'</b> hasn't shutdown within the last "
|
unicode(self.tr("The VM <b>'{0}'</b> hasn't shutdown within the last "
|
||||||
"{1} seconds, do you want to kill it?<br>").format(
|
"{1} seconds, do you want to kill it?<br>")).format(
|
||||||
vm.name, self.shutdown_time / 1000),
|
vm.name, self.shutdown_time / 1000),
|
||||||
self.tr("Kill it!"),
|
self.tr("Kill it!"),
|
||||||
self.tr("Wait another {0} seconds...").format(
|
unicode(self.tr("Wait another {0} seconds...")).format(
|
||||||
self.shutdown_time / 1000))
|
self.shutdown_time / 1000))
|
||||||
if reply == 0:
|
if reply == 0:
|
||||||
vm.force_shutdown()
|
vm.force_shutdown()
|
||||||
@ -1041,9 +1041,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
(requested_name, ok) = QInputDialog.getText(
|
(requested_name, ok) = QInputDialog.getText(
|
||||||
None, self.tr("VM Removal Confirmation"),
|
None, self.tr("VM Removal Confirmation"),
|
||||||
self.tr("Are you sure you want to remove the VM <b>'{0}'</b>?<br>"
|
unicode(self.tr("Are you sure you want to remove the VM <b>'{0}'</b>?<br>"
|
||||||
"All data on this VM's private storage will be lost!<br><br>"
|
"All data on this VM's private storage will be lost!<br><br>"
|
||||||
"Type the name of the VM (<b>{1}</b>) below to confirm:")
|
"Type the name of the VM (<b>{1}</b>) below to confirm:"))
|
||||||
.format(vm.name, vm.name))
|
.format(vm.name, vm.name))
|
||||||
|
|
||||||
if not ok:
|
if not ok:
|
||||||
@ -1053,7 +1053,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
elif requested_name != vm.name:
|
elif requested_name != vm.name:
|
||||||
# name did not match
|
# name did not match
|
||||||
QMessageBox.warning(None, self.tr("VM removal confirmation failed"),
|
QMessageBox.warning(None, self.tr("VM removal confirmation failed"),
|
||||||
self.tr("Entered name did not match! Not removing {0}.").format(vm.name))
|
unicode(self.tr("Entered name did not match! Not removing {0}.")).format(vm.name))
|
||||||
return
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@ -1065,7 +1065,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
progress = QProgressDialog(
|
progress = QProgressDialog(
|
||||||
self.tr("Removing VM: <b>{0}</b>...").format(vm.name), "", 0, 0)
|
unicode(self.tr("Removing VM: <b>{0}</b>...")).format(vm.name), "", 0, 0)
|
||||||
progress.setCancelButton(None)
|
progress.setCancelButton(None)
|
||||||
progress.setModal(True)
|
progress.setModal(True)
|
||||||
progress.show()
|
progress.show()
|
||||||
@ -1078,10 +1078,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
if thread_monitor.success:
|
if thread_monitor.success:
|
||||||
trayIcon.showMessage(
|
trayIcon.showMessage(
|
||||||
self.tr("VM '{0}' has been removed.").format(vm.name), msecs=3000)
|
unicode(self.tr("VM '{0}' has been removed.")).format(vm.name), msecs=3000)
|
||||||
else:
|
else:
|
||||||
QMessageBox.warning(None, self.tr("Error removing VM!"),
|
QMessageBox.warning(None, self.tr("Error removing VM!"),
|
||||||
self.tr("ERROR: {0}").format(
|
unicode(self.tr("ERROR: {0}")).format(
|
||||||
thread_monitor.error_msg))
|
thread_monitor.error_msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -1122,7 +1122,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
(clone_name, ok) = QInputDialog.getText(
|
(clone_name, ok) = QInputDialog.getText(
|
||||||
self, self.tr('Qubes clone VM'),
|
self, self.tr('Qubes clone VM'),
|
||||||
self.tr('Enter name for VM <b>{}</b> clone:').format(vm.name),
|
unicode(self.tr('Enter name for VM <b>{}</b> clone:')).format(vm.name),
|
||||||
text=(name_format % name_number))
|
text=(name_format % name_number))
|
||||||
if not ok or clone_name == "":
|
if not ok or clone_name == "":
|
||||||
return
|
return
|
||||||
@ -1134,7 +1134,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
progress = QProgressDialog(
|
progress = QProgressDialog(
|
||||||
self.tr("Cloning VM <b>{0}</b> to <b>{1}</b>...").format(vm.name,
|
unicode(self.tr("Cloning VM <b>{0}</b> to <b>{1}</b>...")).format(vm.name,
|
||||||
clone_name), "", 0,
|
clone_name), "", 0,
|
||||||
0)
|
0)
|
||||||
progress.setCancelButton(None)
|
progress.setCancelButton(None)
|
||||||
@ -1149,7 +1149,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
if not thread_monitor.success:
|
if not thread_monitor.success:
|
||||||
QMessageBox.warning(None, self.tr("Error while cloning VM"),
|
QMessageBox.warning(None, self.tr("Error while cloning VM"),
|
||||||
self.tr("Exception while cloning:<br>{0}").format(
|
unicode(self.tr("Exception while cloning:<br>{0}")).format(
|
||||||
thread_monitor.error_msg))
|
thread_monitor.error_msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -1187,7 +1187,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
vm.resume()
|
vm.resume()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
QMessageBox.warning(None, self.tr("Error unpausing VM!"),
|
QMessageBox.warning(None, self.tr("Error unpausing VM!"),
|
||||||
self.tr("ERROR: {0}").format(ex))
|
unicode(self.tr("ERROR: {0}")).format(ex))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@ -1201,18 +1201,18 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
trayIcon.showMessage(self.tr("Starting '{0}'...").format(vm.name), msecs=3000)
|
trayIcon.showMessage(unicode(self.tr("Starting '{0}'...")).format(vm.name), msecs=3000)
|
||||||
|
|
||||||
while not thread_monitor.is_finished():
|
while not thread_monitor.is_finished():
|
||||||
app.processEvents()
|
app.processEvents()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
if thread_monitor.success:
|
if thread_monitor.success:
|
||||||
trayIcon.showMessage(self.tr("VM '{0}' has been started.").format(vm.name),
|
trayIcon.showMessage(unicode(self.tr("VM '{0}' has been started.")).format(vm.name),
|
||||||
msecs=3000)
|
msecs=3000)
|
||||||
else:
|
else:
|
||||||
trayIcon.showMessage(
|
trayIcon.showMessage(
|
||||||
self.tr("Error starting VM <b>'{0}'</b>: {1}").format(
|
unicode(self.tr("Error starting VM <b>'{0}'</b>: {1}")).format(
|
||||||
vm.name, thread_monitor.error_msg),
|
vm.name, thread_monitor.error_msg),
|
||||||
msecs=3000)
|
msecs=3000)
|
||||||
self.set_error(vm.qid,
|
self.set_error(vm.qid,
|
||||||
@ -1250,19 +1250,19 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
trayIcon.showMessage(self.tr("Starting '{0}'...").format(vm.name), msecs=3000)
|
trayIcon.showMessage(unicode(self.tr("Starting '{0}'...")).format(vm.name), msecs=3000)
|
||||||
|
|
||||||
while not thread_monitor.is_finished():
|
while not thread_monitor.is_finished():
|
||||||
app.processEvents()
|
app.processEvents()
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
if thread_monitor.success:
|
if thread_monitor.success:
|
||||||
trayIcon.showMessage(self.tr("VM '{0}' has been started. Start Qubes "
|
trayIcon.showMessage(unicode(self.tr("VM '{0}' has been started. Start Qubes "
|
||||||
"Tools installation from attached CD")
|
"Tools installation from attached CD"))
|
||||||
.format(vm.name), msecs=3000)
|
.format(vm.name), msecs=3000)
|
||||||
else:
|
else:
|
||||||
trayIcon.showMessage(
|
trayIcon.showMessage(
|
||||||
self.tr("Error starting VM <b>'{0}'</b>: {1}")
|
unicode(self.tr("Error starting VM <b>'{0}'</b>: {1}"))
|
||||||
.format(vm.name, thread_monitor.error_msg),
|
.format(vm.name, thread_monitor.error_msg),
|
||||||
msecs=3000)
|
msecs=3000)
|
||||||
self.set_error(vm.qid,
|
self.set_error(vm.qid,
|
||||||
@ -1291,7 +1291,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
vm.pause()
|
vm.pause()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
QMessageBox.warning(None, self.tr("Error pausing VM!"),
|
QMessageBox.warning(None, self.tr("Error pausing VM!"),
|
||||||
self.tr("ERROR: {0}").format(ex))
|
unicode(self.tr("ERROR: {0}")).format(ex))
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot(name='on_action_shutdownvm_triggered')
|
@pyqtSlot(name='on_action_shutdownvm_triggered')
|
||||||
@ -1303,9 +1303,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
reply = QMessageBox.question(
|
reply = QMessageBox.question(
|
||||||
None, self.tr("VM Shutdown Confirmation"),
|
None, self.tr("VM Shutdown Confirmation"),
|
||||||
self.tr("Are you sure you want to power down the VM <b>'{0}'</b>?<br>"
|
unicode(self.tr("Are you sure you want to power down the VM <b>'{0}'</b>?<br>"
|
||||||
"<small>This will shutdown all the running applications "
|
"<small>This will shutdown all the running applications "
|
||||||
"within this VM.</small>").format(vm.name),
|
"within this VM.</small>")).format(vm.name),
|
||||||
QMessageBox.Yes | QMessageBox.Cancel)
|
QMessageBox.Yes | QMessageBox.Cancel)
|
||||||
|
|
||||||
app.processEvents()
|
app.processEvents()
|
||||||
@ -1319,10 +1319,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
vm.shutdown()
|
vm.shutdown()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
QMessageBox.warning(None, self.tr("Error shutting down VM!"),
|
QMessageBox.warning(None, self.tr("Error shutting down VM!"),
|
||||||
self.tr("ERROR: {0}").format(ex))
|
unicode(self.tr("ERROR: {0}")).format(ex))
|
||||||
return
|
return
|
||||||
|
|
||||||
trayIcon.showMessage(self.tr("VM '{0}' is shutting down...").format(vm.name),
|
trayIcon.showMessage(unicode(self.tr("VM '{0}' is shutting down...")).format(vm.name),
|
||||||
msecs=3000)
|
msecs=3000)
|
||||||
|
|
||||||
self.shutdown_monitor[vm.qid] = VmShutdownMonitor(vm, shutdown_time,
|
self.shutdown_monitor[vm.qid] = VmShutdownMonitor(vm, shutdown_time,
|
||||||
@ -1340,9 +1340,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
reply = QMessageBox.question(
|
reply = QMessageBox.question(
|
||||||
None, self.tr("VM Restart Confirmation"),
|
None, self.tr("VM Restart Confirmation"),
|
||||||
self.tr("Are you sure you want to restart the VM <b>'{0}'</b>?<br>"
|
unicode(self.tr("Are you sure you want to restart the VM <b>'{0}'</b>?<br>"
|
||||||
"<small>This will shutdown all the running applications "
|
"<small>This will shutdown all the running applications "
|
||||||
"within this VM.</small>").format(vm.name),
|
"within this VM.</small>")).format(vm.name),
|
||||||
QMessageBox.Yes | QMessageBox.Cancel)
|
QMessageBox.Yes | QMessageBox.Cancel)
|
||||||
|
|
||||||
app.processEvents()
|
app.processEvents()
|
||||||
@ -1357,9 +1357,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
reply = QMessageBox.question(
|
reply = QMessageBox.question(
|
||||||
None, self.tr("VM Kill Confirmation"),
|
None, self.tr("VM Kill Confirmation"),
|
||||||
self.tr("Are you sure you want to kill the VM <b>'{0}'</b>?<br>"
|
unicode(self.tr("Are you sure you want to kill the VM <b>'{0}'</b>?<br>"
|
||||||
"<small>This will end <b>(not shutdown!)</b> all the running "
|
"<small>This will end <b>(not shutdown!)</b> all the running "
|
||||||
"applications within this VM.</small>").format(vm.name),
|
"applications within this VM.</small>")).format(vm.name),
|
||||||
QMessageBox.Yes | QMessageBox.Cancel,
|
QMessageBox.Yes | QMessageBox.Cancel,
|
||||||
QMessageBox.Cancel)
|
QMessageBox.Cancel)
|
||||||
|
|
||||||
@ -1371,11 +1371,12 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
QMessageBox.critical(
|
QMessageBox.critical(
|
||||||
None, self.tr("Error while killing VM!"),
|
None, self.tr("Error while killing VM!"),
|
||||||
self.tr("<b>An exception ocurred while killing {0}.</b><br>"
|
unicode(self.tr("<b>An exception ocurred while killing {0}.</b><br>"
|
||||||
"ERROR: {1}").format(vm.name, ex))
|
"ERROR: {1}")).format(vm.name, ex))
|
||||||
return
|
return
|
||||||
|
|
||||||
trayIcon.showMessage("VM '{0}' killed!".format(vm.name), msecs=3000)
|
trayIcon.showMessage(unicode(self.tr("VM '{0}' killed!"))
|
||||||
|
.format(vm.name), msecs=3000)
|
||||||
|
|
||||||
@pyqtSlot(name='on_action_settings_triggered')
|
@pyqtSlot(name='on_action_settings_triggered')
|
||||||
def action_settings_triggered(self):
|
def action_settings_triggered(self):
|
||||||
@ -1433,12 +1434,12 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
if not vm.is_running():
|
if not vm.is_running():
|
||||||
reply = QMessageBox.question(
|
reply = QMessageBox.question(
|
||||||
None, self.tr("VM Update Confirmation"),
|
None, self.tr("VM Update Confirmation"),
|
||||||
self.tr("<b>{0}</b><br>The VM has to be running to be updated.<br>"
|
unicode(self.tr("<b>{0}</b><br>The VM has to be running to be updated.<br>"
|
||||||
"Do you want to start it?<br>").format(vm.name),
|
"Do you want to start it?<br>")).format(vm.name),
|
||||||
QMessageBox.Yes | QMessageBox.Cancel)
|
QMessageBox.Yes | QMessageBox.Cancel)
|
||||||
if reply != QMessageBox.Yes:
|
if reply != QMessageBox.Yes:
|
||||||
return
|
return
|
||||||
trayIcon.showMessage(self.tr("Starting '{0}'...").format(vm.name),
|
trayIcon.showMessage(unicode(self.tr("Starting '{0}'...")).format(vm.name),
|
||||||
msecs=3000)
|
msecs=3000)
|
||||||
|
|
||||||
app.processEvents()
|
app.processEvents()
|
||||||
@ -1465,7 +1466,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
if vm.qid != 0:
|
if vm.qid != 0:
|
||||||
if not thread_monitor.success:
|
if not thread_monitor.success:
|
||||||
QMessageBox.warning(None, self.tr("Error VM update!"),
|
QMessageBox.warning(None, self.tr("Error VM update!"),
|
||||||
self.tr("ERROR: {0}").format(
|
unicode(self.tr("ERROR: {0}")).format(
|
||||||
thread_monitor.error_msg))
|
thread_monitor.error_msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -1495,7 +1496,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
(command_to_run, ok) = QInputDialog.getText(
|
(command_to_run, ok) = QInputDialog.getText(
|
||||||
self, self.tr('Qubes command entry'),
|
self, self.tr('Qubes command entry'),
|
||||||
self.tr('Run command in <b>{}</b>:').format(vm.name))
|
unicode(self.tr('Run command in <b>{}</b>:')).format(vm.name))
|
||||||
if not ok or command_to_run == "":
|
if not ok or command_to_run == "":
|
||||||
return
|
return
|
||||||
thread_monitor = ThreadMonitor()
|
thread_monitor = ThreadMonitor()
|
||||||
@ -1510,7 +1511,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
|
|
||||||
if not thread_monitor.success:
|
if not thread_monitor.success:
|
||||||
QMessageBox.warning(None, self.tr("Error while running command"),
|
QMessageBox.warning(None, self.tr("Error while running command"),
|
||||||
self.tr("Exception while running command:<br>{0}").format(
|
unicode(self.tr("Exception while running command:<br>{0}")).format(
|
||||||
thread_monitor.error_msg))
|
thread_monitor.error_msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -1725,7 +1726,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
for d in self.blk_manager.attached_devs:
|
for d in self.blk_manager.attached_devs:
|
||||||
if (self.blk_manager.attached_devs[d]
|
if (self.blk_manager.attached_devs[d]
|
||||||
['attached_to']['vm'].qid == vm.qid):
|
['attached_to']['vm'].qid == vm.qid):
|
||||||
text = self.tr("Detach {dev} {size} {desc}").format(
|
text = unicode(self.tr("Detach {dev} {size} {desc}")).format(
|
||||||
dev=d,
|
dev=d,
|
||||||
size=unicode(
|
size=unicode(
|
||||||
self.blk_manager.attached_devs[d]['size']),
|
self.blk_manager.attached_devs[d]['size']),
|
||||||
@ -1742,7 +1743,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
|||||||
if d[-1].isdigit() and \
|
if d[-1].isdigit() and \
|
||||||
d[0:-1] in self.blk_manager.current_blk:
|
d[0:-1] in self.blk_manager.current_blk:
|
||||||
continue
|
continue
|
||||||
text = self.tr("Attach {dev} {size} {desc}").format(
|
text = unicode(self.tr("Attach {dev} {size} {desc}")).format(
|
||||||
dev=d,
|
dev=d,
|
||||||
size=unicode(
|
size=unicode(
|
||||||
self.blk_manager.free_devs[d]['size']),
|
self.blk_manager.free_devs[d]['size']),
|
||||||
@ -1868,7 +1869,7 @@ class QubesTrayIcon(QSystemTrayIcon):
|
|||||||
if len(self.blk_manager.attached_devs) > 0:
|
if len(self.blk_manager.attached_devs) > 0:
|
||||||
for d in self.blk_manager.attached_devs:
|
for d in self.blk_manager.attached_devs:
|
||||||
vm = self.blk_manager.attached_devs[d]['attached_to']['vm']
|
vm = self.blk_manager.attached_devs[d]['attached_to']['vm']
|
||||||
text = self.tr("Detach {dev} {desc} ({size}) from {vm}").format(
|
text = unicode(self.tr("Detach {dev} {desc} ({size}) from {vm}")).format(
|
||||||
dev=d,
|
dev=d,
|
||||||
desc=self.blk_manager.attached_devs[d]['desc'],
|
desc=self.blk_manager.attached_devs[d]['desc'],
|
||||||
size=unicode(self.blk_manager.attached_devs[d]['size']),
|
size=unicode(self.blk_manager.attached_devs[d]['size']),
|
||||||
@ -1883,7 +1884,7 @@ class QubesTrayIcon(QSystemTrayIcon):
|
|||||||
# skip partitions heuristic
|
# skip partitions heuristic
|
||||||
if d[-1].isdigit() and d[0:-1] in self.blk_manager.current_blk:
|
if d[-1].isdigit() and d[0:-1] in self.blk_manager.current_blk:
|
||||||
continue
|
continue
|
||||||
text = self.tr("Attach {dev} {size} {desc}").format(
|
text = unicode(self.tr("Attach {dev} {size} {desc}")).format(
|
||||||
dev=d,
|
dev=d,
|
||||||
size=unicode(self.blk_manager.free_devs[d]['size']),
|
size=unicode(self.blk_manager.free_devs[d]['size']),
|
||||||
desc=self.blk_manager.free_devs[d]['desc']
|
desc=self.blk_manager.free_devs[d]['desc']
|
||||||
|
@ -272,7 +272,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
|
|||||||
shutil.rmtree(self.tmpdir_to_remove)
|
shutil.rmtree(self.tmpdir_to_remove)
|
||||||
else:
|
else:
|
||||||
QMessageBox.warning(None,
|
QMessageBox.warning(None,
|
||||||
self.tr("Backup error!"), self.tr("ERROR: {0}")
|
self.tr("Backup error!"), unicode(self.tr("ERROR: {0}"))
|
||||||
.format(self.thread_monitor.error_msg))
|
.format(self.thread_monitor.error_msg))
|
||||||
|
|
||||||
if self.showFileDialog.isChecked():
|
if self.showFileDialog.isChecked():
|
||||||
|
@ -54,7 +54,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
self.source_vm = self.vm
|
self.source_vm = self.vm
|
||||||
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setWindowTitle(self.tr("Settings: {vm}").format(vm=self.vm.name))
|
self.setWindowTitle(unicode(self.tr("Settings: {vm}")).format(vm=self.vm.name))
|
||||||
if init_page in self.tabs_indices:
|
if init_page in self.tabs_indices:
|
||||||
idx = self.tabs_indices[init_page]
|
idx = self.tabs_indices[init_page]
|
||||||
assert (idx in range(self.tabWidget.count()))
|
assert (idx in range(self.tabWidget.count()))
|
||||||
@ -119,7 +119,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
progress = QProgressDialog(
|
progress = QProgressDialog(
|
||||||
self.tr("Applying settings to <b>{0}</b>...").format(self.vm.name), "", 0, 0)
|
unicode(self.tr("Applying settings to <b>{0}</b>...")).format(self.vm.name), "", 0, 0)
|
||||||
progress.setCancelButton(None)
|
progress.setCancelButton(None)
|
||||||
progress.setModal(True)
|
progress.setModal(True)
|
||||||
progress.show()
|
progress.show()
|
||||||
@ -132,8 +132,8 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
|
|
||||||
if not thread_monitor.success:
|
if not thread_monitor.success:
|
||||||
QMessageBox.warning(None,
|
QMessageBox.warning(None,
|
||||||
self.tr("Error while changing settings for {0}!").format(self.vm.name),
|
unicode(self.tr("Error while changing settings for {0}!")).format(self.vm.name),
|
||||||
self.tr("ERROR: {0}").format(thread_monitor.error_msg))
|
unicode(self.tr("ERROR: {0}")).format(thread_monitor.error_msg))
|
||||||
|
|
||||||
self.done(0)
|
self.done(0)
|
||||||
|
|
||||||
@ -191,11 +191,11 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
if self.vm.netvm is not None and not self.vm.netvm.is_proxyvm():
|
if self.vm.netvm is not None and not self.vm.netvm.is_proxyvm():
|
||||||
QMessageBox.warning(None,
|
QMessageBox.warning(None,
|
||||||
self.tr("VM configuration problem!"),
|
self.tr("VM configuration problem!"),
|
||||||
self.tr("The '{vm}' AppVM is not network connected to a "
|
unicode(self.tr("The '{vm}' AppVM is not network connected to a "
|
||||||
"FirewallVM!<p>"
|
"FirewallVM!<p>"
|
||||||
"You may edit the '{vm}' VM firewall rules, but these "
|
"You may edit the '{vm}' VM firewall rules, but these "
|
||||||
"will not take any effect until you connect it to "
|
"will not take any effect until you connect it to "
|
||||||
"a working Firewall VM.").format(vm=self.vm.name))
|
"a working Firewall VM.")).format(vm=self.vm.name))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -336,8 +336,8 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
msg.append(self.tr("Can't change name of a running VM."))
|
msg.append(self.tr("Can't change name of a running VM."))
|
||||||
elif self.qvm_collection.get_vm_by_name(vmname) is not None:
|
elif self.qvm_collection.get_vm_by_name(vmname) is not None:
|
||||||
msg.append(
|
msg.append(
|
||||||
self.tr("Can't change VM name - a VM named <b>{0}</b>"
|
unicode(self.tr("Can't change VM name - a VM named <b>{0}</b>"
|
||||||
"already exists in the system!").format(vmname))
|
"already exists in the system!")).format(vmname))
|
||||||
else:
|
else:
|
||||||
oldname = self.vm.name
|
oldname = self.vm.name
|
||||||
try:
|
try:
|
||||||
@ -978,7 +978,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
if port is not None:
|
if port is not None:
|
||||||
if port2 is not None and port2 <= port:
|
if port2 is not None and port2 <= port:
|
||||||
QMessageBox.warning(None, self.tr("Invalid service ports range"),
|
QMessageBox.warning(None, self.tr("Invalid service ports range"),
|
||||||
self.tr("Port {0} is lower than port {1}.").format(
|
unicode(self.tr("Port {0} is lower than port {1}.")).format(
|
||||||
port2, port))
|
port2, port))
|
||||||
else:
|
else:
|
||||||
item = {"address": address,
|
item = {"address": address,
|
||||||
@ -993,7 +993,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
|
|||||||
self.fw_model.appendChild(item)
|
self.fw_model.appendChild(item)
|
||||||
else:
|
else:
|
||||||
QMessageBox.warning(None, self.tr("Invalid service name"),
|
QMessageBox.warning(None, self.tr("Invalid service name"),
|
||||||
self.tr("Service '{0}' is unknown.").format(service))
|
unicode(self.tr("Service '{0}' is unknown.")).format(service))
|
||||||
|
|
||||||
|
|
||||||
# Bases on the original code by:
|
# Bases on the original code by:
|
||||||
|
Loading…
Reference in New Issue
Block a user