File checking and error dialog moved to qube_manager
This commit is contained in:
parent
78d76eb70f
commit
df0e4699a0
@ -54,21 +54,13 @@ class LogDialog(ui_logdlg.Ui_LogDialog, QtWidgets.QDialog):
|
|||||||
btns_in_row = 3
|
btns_in_row = 3
|
||||||
count = 0
|
count = 0
|
||||||
for log_path in self.logfiles:
|
for log_path in self.logfiles:
|
||||||
if os.path.exists(log_path):
|
button = QtWidgets.QPushButton(log_path)
|
||||||
button = QtWidgets.QPushButton(log_path)
|
button.clicked.connect(partial(self.set_current_log, log_path))
|
||||||
button.clicked.connect(partial(self.set_current_log, log_path))
|
self.buttonsLayout.addWidget(button,
|
||||||
self.buttonsLayout.addWidget(button,
|
count / btns_in_row, count % btns_in_row)
|
||||||
count / btns_in_row, count % btns_in_row)
|
count += 1
|
||||||
count += 1
|
|
||||||
|
|
||||||
if count == 0:
|
self.buttonsLayout.itemAt(0).widget().click()
|
||||||
QtWidgets.QMessageBox.warning(
|
|
||||||
self,
|
|
||||||
self.tr("Error"),
|
|
||||||
self.tr(
|
|
||||||
"No log files where found for current selection"))
|
|
||||||
else:
|
|
||||||
self.buttonsLayout.itemAt(0).widget().click()
|
|
||||||
|
|
||||||
def copy_to_clipboard_triggered(self):
|
def copy_to_clipboard_triggered(self):
|
||||||
clipboard.copy_text_to_qubes_clipboard(self.displayed_text)
|
clipboard.copy_text_to_qubes_clipboard(self.displayed_text)
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
from os import path
|
||||||
|
|
||||||
from qubesadmin import exc
|
from qubesadmin import exc
|
||||||
from qubesadmin import utils
|
from qubesadmin import utils
|
||||||
@ -1526,8 +1527,18 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
|
|||||||
"/var/log/qubes/qrexec." + vm.name + ".log",
|
"/var/log/qubes/qrexec." + vm.name + ".log",
|
||||||
])
|
])
|
||||||
|
|
||||||
log_dlg = log_dialog.LogDialog(self.qt_app, logfiles)
|
logfiles = list(filter(lambda x: path.exists(x), logfiles))
|
||||||
log_dlg.exec_()
|
|
||||||
|
if len(logfiles) > 0:
|
||||||
|
log_dlg = log_dialog.LogDialog(self.qt_app, logfiles)
|
||||||
|
log_dlg.exec_()
|
||||||
|
else:
|
||||||
|
QMessageBox.warning(
|
||||||
|
self,
|
||||||
|
self.tr("Error"),
|
||||||
|
self.tr(
|
||||||
|
"No log files where found for the current selection."))
|
||||||
|
|
||||||
except exc.QubesDaemonAccessError:
|
except exc.QubesDaemonAccessError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user