Skip to content

Commit

Permalink
Pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
donob4n committed Apr 5, 2020
1 parent 37790f0 commit 233ec12
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions qubesmanager/qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ def mousePressEvent(self, e): # pylint: disable=invalid-name
self.selectAll()
self.focusing = False

row_height = 30
size_multiplier = 1 #0.7

icon_size = QSize(30, 30)

# pylint: disable=invalid-name
class StateIconDelegate(QStyledItemDelegate):
Expand Down Expand Up @@ -110,7 +108,6 @@ def sizeHint(self, option, index):
style = widget.style()
iconRect = style.subElementRect(style.SE_ItemViewItemDecoration,
option, widget)
margin = iconRect.left() - option.rect.left()
width = iconRect.width() * 3 # Nº of possible icons
hint.setWidth(width)
return hint
Expand Down Expand Up @@ -375,11 +372,9 @@ def data(self, index, role):
try:
return self.klass_pixmap[vm.klass]
except KeyError:
self.klass_pixmap[vm.klass] = QPixmap(row_height*size_multiplier,\
row_height*size_multiplier)
self.klass_pixmap[vm.klass].load(":/"+vm.klass.lower()+".png")
self.klass_pixmap[vm.klass] = self.klass_pixmap[vm.klass].scaled(\
row_height*size_multiplier,row_height*size_multiplier)
pixmap = QPixmap()
pixmap.load(":/"+vm.klass.lower()+".png")
self.klass_pixmap[vm.klass] = pixmap.scaled(icon_size)
return self.klass_pixmap[vm.klass]

if col == 1:
Expand Down Expand Up @@ -833,7 +828,8 @@ def on_domain_status_changed(self, vm, event, **_kwargs):
self.qubes_cache.get_vm(qid=vm.qid).update(event=event)
if vm.klass in {'TemplateVM'}:
for appvm in vm.appvms:
self.qubes_cache.get_vm(qid=appvm.qid).update(event="outdated")
self.qubes_cache.get_vm(qid=appvm.qid).\
update(event="outdated")
self.proxy.invalidate()
self.table_selection_changed()
except exc.QubesPropertyAccessError:
Expand Down Expand Up @@ -1001,16 +997,16 @@ def action_removevm_triggered(self):

if dependencies:
list_text = "<br>" + \
manager_utils.format_dependencies_list(dependencies) + \
"<br>"
manager_utils.format_dependencies_list \
(dependencies) + "<br>"

info_dialog = QMessageBox(self)
info_dialog.setWindowTitle(self.tr("Warning!"))
info_dialog.setText(
self.tr("This qube cannot be removed. It is used as:"
" <br> {} <small>If you want to remove this qube, "
"you should remove or change settings of each qube "
"or setting that uses it.</small>").format(list_text))
self.tr("This qube cannot be removed. It is used as: <br> "
"{} <small>If you want to remove this qube, you "
"should remove or change settings of each qube or "
"setting that uses it.</small>").format(list_text))
info_dialog.setModal(False)
info_dialog.show()

Expand Down

0 comments on commit 233ec12

Please sign in to comment.