-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manager revival #52
Manager revival #52
Conversation
Everything that should work works. Further improvements that would be nice: - replace untidy multitude of QtGui Items with one generic type - restore Qubes Network functionality - add Boot From Device action (and easy way to install windows tool from there) fixes QubesOS/qubes-issues#2966 QubesOS/qubes-issues#2132
Renamed 'VM' to 'Qube' in the user interface for Qube Manager.
Removed errors discovered by pylint, or told it to be quiet when needed.
Changed "size on disk" widget to display only two decimal places.
Surprisingly, it has not been touched since 3.2. It should work now.
5ad8aaa
to
1cee3a5
Compare
qubesmanager/log_dialog.py
Outdated
self.__init_log_text__() | ||
|
||
def __init_log_text__(self): | ||
self.displayed_text = "" | ||
log = open(self.log_path) | ||
log.seek(0, os.SEEK_END) | ||
log.seek(0, clipboard.os.SEEK_END) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.SEEK_END
qubesmanager/log_dialog.py
Outdated
log.seek(-LOG_DISPLAY_SIZE, os.SEEK_END) | ||
self.displayed_text = self.tr( | ||
"(Showing only last %d bytes of file)\n") % LOG_DISPLAY_SIZE | ||
log.seek(-LOG_DISPLAY_SIZE, clipboard.os.SEEK_END) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
qubesmanager/qube_manager.py
Outdated
vm = self.vm | ||
vm_is_running = vm.is_running() | ||
vm_start_time = datetime.fromtimestamp( | ||
float(getattr(vm, 'start_time', None))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None
isn't the best choice here - float(None)
throws TypeError. Alternatively wrap this in try/except TypeError.
qubesmanager/qube_manager.py
Outdated
vm_is_running = vm.is_running() | ||
vm_start_time = datetime.fromtimestamp( | ||
float(getattr(vm, 'start_time', None))) | ||
if vm_is_running and vm_start_time \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you check if vm_start_time is not false (so, not None
, or 0
in practice). So, maybe use some of those if start_time
attribute is inaccessible.
qubesmanager/qube_manager.py
Outdated
# pylint: disable=unused-argument | ||
super(VmManagerWindow, self).__init__() | ||
self.setupUi(self) | ||
self.toolbar = self.toolBar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
|
||
row_no += 1 | ||
|
||
self.table.setRowCount(row_no) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again?
qubesmanager/qube_manager.py
Outdated
for row_no in range(self.table.rowCount()): | ||
widget = self.table.cellWidget(row_no, | ||
self.columns_indices["State"]) | ||
show = (self.search in widget.vm.name or not self.search) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not self.search
is always false here, see top if
in the function.
qubesmanager/qube_manager.py
Outdated
and vm.klass != 'AdminVM') | ||
self.action_restartvm.setEnabled( | ||
vm.is_running() and vm.get_power_state() != "Paused" | ||
and vm.klass != 'AdminVM' and vm.klass != 'DisposableVM') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DispVM
qubesmanager/qube_manager.py
Outdated
and vm.klass != 'AdminVM') | ||
|
||
self.action_appmenus.setEnabled( | ||
vm.klass != 'AdminVM' and vm.klass != 'DisposableMV' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DispVM
qubesmanager/table_widgets.py
Outdated
|
||
def update(self): | ||
if self.previous_power_state != self.vm.last_power_state: | ||
self.previous_power_state = self.vm.get_power_state() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong, you check for "previous" value a line below.
As requested by @marmarek
0d645e1
to
b1dc245
Compare
Because I forgot it the first time round. Sorry.
e370c18
to
5c2f3b4
Compare
Revived old Qubes Manager in a slimmer, lighter, less horrifyingly complex form.
Remaining recommended fixes:
fixes QubesOS/qubes-issues#2966
QubesOS/qubes-issues#2132