|
|
|
@ -37,6 +37,44 @@ def get_system_rgb(obj, pallete_type):
|
|
|
|
|
def alphed(rgbstr, value):
|
|
|
|
|
return rgbstr.replace(")", ",%d)"%value)
|
|
|
|
|
|
|
|
|
|
def get_icon(*images):
|
|
|
|
|
fimage = images[0]
|
|
|
|
|
if fimage.startswith("/") or fimage.endswith(".svg") or fimage.endswith(".png"):
|
|
|
|
|
icon = qt.QIcon(fimage)
|
|
|
|
|
images = images[1:]
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
return icon
|
|
|
|
|
else:
|
|
|
|
|
icon = qt.QIcon()
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
for image in images:
|
|
|
|
|
for theme in (themeName, "Calculate", "Tango", "Adwaita"):
|
|
|
|
|
icon.setThemeName(theme)
|
|
|
|
|
icon = icon.fromTheme(image)
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
return icon
|
|
|
|
|
return qt.QIcon()
|
|
|
|
|
|
|
|
|
|
def get_pixmap(*images, **kw):
|
|
|
|
|
pixmap = None
|
|
|
|
|
fallback_icon = kw.get('fallback_icon', None)
|
|
|
|
|
_size = kw.get('size', 32)
|
|
|
|
|
qsize = kw.get('size', qt.QSize(_size,_size))
|
|
|
|
|
for image in images:
|
|
|
|
|
icon = get_icon(image)
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
return icon.pixmap(_size)
|
|
|
|
|
elif os.path.isfile(image):
|
|
|
|
|
ir = qt.QImageReader(image)
|
|
|
|
|
ir.setScaledSize(qsize)
|
|
|
|
|
img = ir.read()
|
|
|
|
|
return qt.QPixmap().fromImage(img)
|
|
|
|
|
else:
|
|
|
|
|
if fallback_icon:
|
|
|
|
|
return get_icon('applications-system').pixmap(_size)
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_('The user must not be root')
|
|
|
|
|
class TopMenu(qt.QPushButton):
|
|
|
|
|
def __init__(self, label, images, parent = None):
|
|
|
|
@ -53,17 +91,7 @@ class TopMenu(qt.QPushButton):
|
|
|
|
|
|
|
|
|
|
self.image_lbl = qt.QLabel(self)
|
|
|
|
|
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
icon = qt.QIcon()
|
|
|
|
|
for image in images:
|
|
|
|
|
icon.setThemeName(themeName)
|
|
|
|
|
icon = icon.fromTheme(image)
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
icon.setThemeName('Tango')
|
|
|
|
|
icon = icon.fromTheme(image)
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
icon = get_icon(*images)
|
|
|
|
|
|
|
|
|
|
# icon.actualSize(qt.QSize(48,48))
|
|
|
|
|
pm1 = icon.pixmap(24)
|
|
|
|
@ -141,55 +169,23 @@ class HelpMenu(TopMenu):
|
|
|
|
|
TopMenu.mousePressEvent(self, event)
|
|
|
|
|
menu = qt.QMenu(self)
|
|
|
|
|
|
|
|
|
|
About_icon = (qt.QIcon \
|
|
|
|
|
('/usr/share/pixmaps/calculate-console-online.svg'))
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
if About_icon.isNull():
|
|
|
|
|
about_icons = ['help-about','help-browser']
|
|
|
|
|
About_icon = qt.QIcon()
|
|
|
|
|
for image in about_icons:
|
|
|
|
|
About_icon.setThemeName(themeName)
|
|
|
|
|
About_icon = About_icon.fromTheme(image)
|
|
|
|
|
if not About_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
About_icon.setThemeName('Tango')
|
|
|
|
|
About_icon = About_icon.fromTheme(image)
|
|
|
|
|
if not About_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
About_icon = get_icon(
|
|
|
|
|
'/usr/share/pixmaps/calculate-console-online.svg',
|
|
|
|
|
'help-about', 'help-browser')
|
|
|
|
|
|
|
|
|
|
about = qt.QAction(About_icon, _("About"), self,
|
|
|
|
|
triggered=self.actions.help)
|
|
|
|
|
menu.addAction(about)
|
|
|
|
|
|
|
|
|
|
menu.addSeparator()
|
|
|
|
|
handbook_icons = ['help-contents','system-help','help-browser']
|
|
|
|
|
handbook_icon = qt.QIcon()
|
|
|
|
|
for image in handbook_icons:
|
|
|
|
|
handbook_icon.setThemeName(themeName)
|
|
|
|
|
handbook_icon = handbook_icon.fromTheme(image)
|
|
|
|
|
if not handbook_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
handbook_icon.setThemeName('Tango')
|
|
|
|
|
handbook_icon = handbook_icon.fromTheme(image)
|
|
|
|
|
if not handbook_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
handbook_icon = get_icon('help-contents','system-help','help-browser')
|
|
|
|
|
|
|
|
|
|
handbook = qt.QAction(handbook_icon,_("Info"),\
|
|
|
|
|
self, triggered=self.actions.hand_book)
|
|
|
|
|
menu.addAction(handbook)
|
|
|
|
|
|
|
|
|
|
menu.addSeparator()
|
|
|
|
|
bug_icons = ['tools-report-bug','system-help','help-browser']
|
|
|
|
|
bug_icon = qt.QIcon()
|
|
|
|
|
for image in bug_icons:
|
|
|
|
|
bug_icon.setThemeName(themeName)
|
|
|
|
|
bug_icon = bug_icon.fromTheme(image)
|
|
|
|
|
if not bug_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
bug_icon.setThemeName('Tango')
|
|
|
|
|
bug_icon = bug_icon.fromTheme(image)
|
|
|
|
|
if not bug_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
bug_icon = get_icon('tools-report-bug','system-help','help-browser')
|
|
|
|
|
|
|
|
|
|
bug = qt.QAction(bug_icon, _("Report a Bug"), \
|
|
|
|
|
self, triggered=self.actions.bug_report)
|
|
|
|
@ -210,28 +206,9 @@ class ButtonMenu(qt.QPushButton):
|
|
|
|
|
if not images:
|
|
|
|
|
images = ''
|
|
|
|
|
|
|
|
|
|
images = images.split(',')
|
|
|
|
|
icon_flag = True
|
|
|
|
|
|
|
|
|
|
qt.QIcon.setThemeName('Calculate')
|
|
|
|
|
pm2 = None
|
|
|
|
|
for image in images:
|
|
|
|
|
icon = qt.QIcon.fromTheme(image)
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
pm2 = icon.pixmap(128)
|
|
|
|
|
icon_flag = False
|
|
|
|
|
break
|
|
|
|
|
elif os.path.isfile(image):
|
|
|
|
|
ir = qt.QImageReader(image)
|
|
|
|
|
ir.setScaledSize(qt.QSize(32, 32))
|
|
|
|
|
img = ir.read()
|
|
|
|
|
pm2 = qt.QPixmap().fromImage(img)
|
|
|
|
|
|
|
|
|
|
icon_flag = False
|
|
|
|
|
break
|
|
|
|
|
if icon_flag:
|
|
|
|
|
icon = qt.QIcon.fromTheme('applications-system')
|
|
|
|
|
pm2 = icon.pixmap(32)
|
|
|
|
|
pm2 = get_pixmap(*images.split(','),
|
|
|
|
|
fallback_icon='applications-system',
|
|
|
|
|
size=32)
|
|
|
|
|
|
|
|
|
|
if pm2:
|
|
|
|
|
pm2 = pm2.scaled(qt.QSize(32,32), qt.Qt.IgnoreAspectRatio,
|
|
|
|
@ -306,13 +283,12 @@ class ErrorLabel (qt.QWidget):
|
|
|
|
|
|
|
|
|
|
self.image_lbl = qt.QLabel(self)
|
|
|
|
|
|
|
|
|
|
icon = qt.QIcon.fromTheme('dialog-warning')
|
|
|
|
|
pm1 = icon.pixmap(16)
|
|
|
|
|
|
|
|
|
|
pm2 = pm1.scaled(qt.QSize(16, 16), qt.Qt.KeepAspectRatio, \
|
|
|
|
|
qt.Qt.SmoothTransformation)
|
|
|
|
|
|
|
|
|
|
self.image_lbl.setPixmap(pm2)
|
|
|
|
|
pm1 = get_pixmap("dialog-warning", size=16)
|
|
|
|
|
if pm1:
|
|
|
|
|
pm2 = pm1.scaled(qt.QSize(16, 16),
|
|
|
|
|
qt.Qt.KeepAspectRatio,
|
|
|
|
|
qt.Qt.SmoothTransformation)
|
|
|
|
|
self.image_lbl.setPixmap(pm2)
|
|
|
|
|
self.image_lbl.setAlignment(qt.Qt.AlignCenter)
|
|
|
|
|
|
|
|
|
|
# add transparency
|
|
|
|
@ -354,20 +330,9 @@ class ErrorLabel (qt.QWidget):
|
|
|
|
|
self.text_lbl.setText(txt)
|
|
|
|
|
|
|
|
|
|
if not hasattr(self, 'menu'):
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
self.menu = qt.QMenu(self)
|
|
|
|
|
bug_icons = ['tools-report-bug','system-help','help-browser']
|
|
|
|
|
bug_icon = qt.QIcon()
|
|
|
|
|
for image in bug_icons:
|
|
|
|
|
bug_icon.setThemeName(themeName)
|
|
|
|
|
bug_icon = bug_icon.fromTheme(image)
|
|
|
|
|
if not bug_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
bug_icon.setThemeName('Tango')
|
|
|
|
|
bug_icon = bug_icon.fromTheme(image)
|
|
|
|
|
if not bug_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
bug_icon = get_icon('tools-report-bug','system-help','help-browser')
|
|
|
|
|
bug = qt.QAction(bug_icon, _("Report a Bug"), self, \
|
|
|
|
|
triggered=self.bug_report)
|
|
|
|
|
self.menu.addAction(bug)
|
|
|
|
@ -408,20 +373,9 @@ class ErrorWgt(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
def add_menu(self):
|
|
|
|
|
if not hasattr(self, 'menu'):
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
self.menu = qt.QMenu(self)
|
|
|
|
|
bug_icons = ['tools-report-bug','system-help','help-browser']
|
|
|
|
|
bug_icon = qt.QIcon()
|
|
|
|
|
for image in bug_icons:
|
|
|
|
|
bug_icon.setThemeName(themeName)
|
|
|
|
|
bug_icon = bug_icon.fromTheme(image)
|
|
|
|
|
if not bug_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
bug_icon.setThemeName('Tango')
|
|
|
|
|
bug_icon = bug_icon.fromTheme(image)
|
|
|
|
|
if not bug_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bug_icon = get_icon('tools-report-bug','system-help','help-browser')
|
|
|
|
|
bug = qt.QAction(bug_icon, _("Report a Bug"), self, \
|
|
|
|
|
triggered=self.bug_report)
|
|
|
|
|
# bug.setDisabled(True)
|
|
|
|
@ -490,9 +444,10 @@ class ClearLineEdit(qt.QLineEdit):
|
|
|
|
|
self.button.setCursor(qt.Qt.ArrowCursor)
|
|
|
|
|
self.button.hide()
|
|
|
|
|
self.button.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
try:
|
|
|
|
|
self.button.setIcon(qt.QIcon.fromTheme("edit-clear"))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon("edit-clear")
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.button.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.button.setText('clear')
|
|
|
|
|
self.button.setStyleSheet("border: none;")
|
|
|
|
|
self.textChanged.connect(self.changed)
|
|
|
|
@ -535,9 +490,10 @@ class FileOpenWgt(qt.QWidget):
|
|
|
|
|
self.button=qt.QToolButton(self)
|
|
|
|
|
self.button.setCursor(qt.Qt.ArrowCursor)
|
|
|
|
|
self.button.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
try:
|
|
|
|
|
self.button.setIcon(qt.QIcon.fromTheme("document-open"))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon("document-open")
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.button.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.button.setText(_('Open'))
|
|
|
|
|
self.button.setStyleSheet("border: none;")
|
|
|
|
|
self.button.clicked.connect(self.file_dialog)
|
|
|
|
@ -648,9 +604,11 @@ class ComboFileWgt(qt.QWidget):
|
|
|
|
|
self.button = qt.QToolButton(self)
|
|
|
|
|
self.button.setCursor(qt.Qt.ArrowCursor)
|
|
|
|
|
self.button.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
try:
|
|
|
|
|
self.button.setIcon(qt.QIcon.fromTheme("document-open"))
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
|
|
icon = get_icon("document-open")
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.button.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.button.setText(_('Open'))
|
|
|
|
|
# self.button.setStyleSheet("QToolButton {border: none;}")
|
|
|
|
|
self.button.clicked.connect(self.file_dialog)
|
|
|
|
@ -883,9 +841,10 @@ class MultipleChoiceDialog (qt.QWidget):
|
|
|
|
|
# add "add new items" PushButton
|
|
|
|
|
self.add_Button = qt.QPushButton(self)
|
|
|
|
|
self.add_Button.setFixedWidth(32)
|
|
|
|
|
try:
|
|
|
|
|
self.add_Button.setIcon(qt.QIcon.fromTheme("list-add"))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon("list-add")
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.add_Button.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.add_Button.setText('Add Item')
|
|
|
|
|
self.add_Button.setShortcut \
|
|
|
|
|
(qt.QKeySequence(qt.Qt.Key_Return))
|
|
|
|
@ -914,39 +873,30 @@ class MultipleChoiceDialog (qt.QWidget):
|
|
|
|
|
|
|
|
|
|
# add '++' button
|
|
|
|
|
self.plus_all_Button = qt.QPushButton(self)
|
|
|
|
|
plus_all_icons = ['go-last-view', 'go-last']
|
|
|
|
|
for icon in plus_all_icons:
|
|
|
|
|
icon_next = qt.QIcon.fromTheme(icon)
|
|
|
|
|
if not icon_next.isNull():
|
|
|
|
|
self.plus_all_Button.setIcon(icon_next)
|
|
|
|
|
break
|
|
|
|
|
if icon_next.isNull():
|
|
|
|
|
icon_next = get_icon('go-last-view', 'go-last')
|
|
|
|
|
if not icon_next.isNull():
|
|
|
|
|
self.plus_all_Button.setIcon(icon_next)
|
|
|
|
|
else:
|
|
|
|
|
self.plus_all_Button.setText('->\n->')
|
|
|
|
|
self.plus_all_Button.clicked.connect(self.plus_all_items)
|
|
|
|
|
p_m_layout.addWidget(self.plus_all_Button)
|
|
|
|
|
|
|
|
|
|
# add '+' button
|
|
|
|
|
self.plus_Button = qt.QPushButton(self)
|
|
|
|
|
plus_icons = ['go-next-view','go-next']
|
|
|
|
|
for icon in plus_icons:
|
|
|
|
|
icon_next = qt.QIcon.fromTheme(icon)
|
|
|
|
|
if not icon_next.isNull():
|
|
|
|
|
self.plus_Button.setIcon(icon_next)
|
|
|
|
|
break
|
|
|
|
|
if icon_next.isNull():
|
|
|
|
|
icon_plus = get_icon('go-next-view', 'go-next')
|
|
|
|
|
if not icon_plus.isNull():
|
|
|
|
|
self.plus_Button.setIcon(icon_plus)
|
|
|
|
|
else:
|
|
|
|
|
self.plus_Button.setText('->')
|
|
|
|
|
self.plus_Button.clicked.connect(self.plus_item)
|
|
|
|
|
p_m_layout.addWidget(self.plus_Button)
|
|
|
|
|
|
|
|
|
|
# add '-' button
|
|
|
|
|
self.minus_Button = qt.QPushButton(self)
|
|
|
|
|
minus_icons = ['go-previous-view','go-previous']
|
|
|
|
|
for icon in minus_icons:
|
|
|
|
|
icon_prev = qt.QIcon.fromTheme(icon)
|
|
|
|
|
if not icon_prev.isNull():
|
|
|
|
|
self.minus_Button.setIcon(icon_prev)
|
|
|
|
|
break
|
|
|
|
|
if icon_prev.isNull():
|
|
|
|
|
icon_minus = get_icon('go-previous-view', 'go-previous')
|
|
|
|
|
if not icon_minus.isNull():
|
|
|
|
|
self.minus_Button.setIcon(icon_minus)
|
|
|
|
|
else:
|
|
|
|
|
self.minus_Button.setText('<-')
|
|
|
|
|
self.minus_Button.clicked.connect(self.minus_item)
|
|
|
|
|
p_m_layout.addWidget(self.minus_Button)
|
|
|
|
@ -955,13 +905,10 @@ class MultipleChoiceDialog (qt.QWidget):
|
|
|
|
|
|
|
|
|
|
# add '--' button
|
|
|
|
|
self.minus_all_Button = qt.QPushButton(self)
|
|
|
|
|
minus_all_icons = ['go-first-view', 'go-first']
|
|
|
|
|
for icon in minus_all_icons:
|
|
|
|
|
icon_next = qt.QIcon.fromTheme(icon)
|
|
|
|
|
if not icon_next.isNull():
|
|
|
|
|
self.minus_all_Button.setIcon(icon_next)
|
|
|
|
|
break
|
|
|
|
|
if icon_next.isNull():
|
|
|
|
|
icon_all_minus = get_icon('go-first-view', 'go-first')
|
|
|
|
|
if not icon_all_minus.isNull():
|
|
|
|
|
self.minus_all_Button.setIcon(icon_all_minus)
|
|
|
|
|
else:
|
|
|
|
|
self.minus_all_Button.setText('<-\n<-')
|
|
|
|
|
self.minus_all_Button.clicked.connect(self.minus_all_items)
|
|
|
|
|
p_m_layout.addWidget(self.minus_all_Button)
|
|
|
|
@ -1117,9 +1064,10 @@ class MultipleChoice (qt.QWidget):
|
|
|
|
|
self.button=qt.QToolButton(self)
|
|
|
|
|
# self.button.hide()
|
|
|
|
|
self.button.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
try:
|
|
|
|
|
self.button.setIcon(qt.QIcon.fromTheme("list-add"))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon("list-add")
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.button.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.button.setText('+')
|
|
|
|
|
self.button.setStyleSheet("border: none;")
|
|
|
|
|
self.button.setFixedWidth(24)
|
|
|
|
@ -1129,9 +1077,10 @@ class MultipleChoice (qt.QWidget):
|
|
|
|
|
if expert:
|
|
|
|
|
self.clear_button = qt.QPushButton(self)
|
|
|
|
|
self.clear_button.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
try:
|
|
|
|
|
self.clear_button.setIcon(qt.QIcon.fromTheme('edit-clear'))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon('edit-clear')
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.clear_button.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.clear_button.setText('C')
|
|
|
|
|
self.clear_button.setToolTip(_('Clear the table'))
|
|
|
|
|
self.clear_button.setStyleSheet("border: none;")
|
|
|
|
@ -1231,9 +1180,10 @@ class SelectTable(qt.QWidget):
|
|
|
|
|
|
|
|
|
|
if add_ability:
|
|
|
|
|
plus_but = qt.QPushButton(self)
|
|
|
|
|
try:
|
|
|
|
|
plus_but.setIcon(qt.QIcon.fromTheme('list-add'))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon('list-add')
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
plus_but.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
plus_but.setText('+')
|
|
|
|
|
|
|
|
|
|
plus_but.setToolTip(_('Add a row'))
|
|
|
|
@ -1242,9 +1192,10 @@ class SelectTable(qt.QWidget):
|
|
|
|
|
unit_layout.addWidget(plus_but)
|
|
|
|
|
|
|
|
|
|
self.recover_but = qt.QPushButton(self)
|
|
|
|
|
try:
|
|
|
|
|
self.recover_but.setIcon(qt.QIcon.fromTheme('edit-clear'))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon('edit-clear')
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.recover_but.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.recover_but.setText('R')
|
|
|
|
|
|
|
|
|
|
self.recover_but.setToolTip(_('Recover the table'))
|
|
|
|
@ -1437,9 +1388,10 @@ class SelectList(qt.QGroupBox):
|
|
|
|
|
self.plus_but = qt.QPushButton(self)
|
|
|
|
|
self.plus_but.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
self.plus_but.setFixedSize(30, 30)
|
|
|
|
|
try:
|
|
|
|
|
self.plus_but.setIcon(qt.QIcon.fromTheme('list-add'))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon('list-add')
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.plus_but.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.plus_but.setText('+')
|
|
|
|
|
self.plus_but.setToolTip(_('Add a row'))
|
|
|
|
|
self.plus_but.clicked.connect(self.line_add)
|
|
|
|
@ -1449,9 +1401,10 @@ class SelectList(qt.QGroupBox):
|
|
|
|
|
self.recover_but = qt.QPushButton(self)
|
|
|
|
|
self.recover_but.setFocusPolicy(qt.Qt.NoFocus)
|
|
|
|
|
self.recover_but.setFixedSize(30, 30)
|
|
|
|
|
try:
|
|
|
|
|
self.recover_but.setIcon(qt.QIcon.fromTheme('edit-undo'))
|
|
|
|
|
except:
|
|
|
|
|
icon = get_icon('edit-undo')
|
|
|
|
|
if not icon.isNull():
|
|
|
|
|
self.recover_but.setIcon(icon)
|
|
|
|
|
else:
|
|
|
|
|
self.recover_but.setText('R')
|
|
|
|
|
|
|
|
|
|
self.recover_but.setToolTip(_('Reset'))
|
|
|
|
@ -1630,17 +1583,7 @@ class ExpertWidget (qt.QPushButton):
|
|
|
|
|
layout.setAlignment(qt.Qt.AlignLeft | qt.Qt.AlignVCenter)
|
|
|
|
|
|
|
|
|
|
def set_close(self):
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
self.icon = qt.QIcon()
|
|
|
|
|
for image in self.images:
|
|
|
|
|
self.icon.setThemeName(themeName)
|
|
|
|
|
self.icon = self.icon.fromTheme(image)
|
|
|
|
|
if not self.icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
self.icon.setThemeName('Tango')
|
|
|
|
|
self.icon = self.icon.fromTheme(image)
|
|
|
|
|
if not self.icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
self.icon = get_icon(*self.images)
|
|
|
|
|
|
|
|
|
|
pm = self.icon.pixmap(16)
|
|
|
|
|
pm = pm.scaled(qt.QSize(16, 16), qt.Qt.KeepAspectRatio, \
|
|
|
|
@ -1653,17 +1596,7 @@ class ExpertWidget (qt.QPushButton):
|
|
|
|
|
self.image_lbl.setAttribute(qt.Qt.WA_NoSystemBackground)
|
|
|
|
|
|
|
|
|
|
def set_open(self):
|
|
|
|
|
themeName = qt.QIcon.themeName()
|
|
|
|
|
self.icon = qt.QIcon()
|
|
|
|
|
for image in self.images:
|
|
|
|
|
self.icon.setThemeName(themeName)
|
|
|
|
|
self.icon = self.icon.fromTheme(image)
|
|
|
|
|
if not self.icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
self.icon.setThemeName('Tango')
|
|
|
|
|
self.icon = self.icon.fromTheme(image)
|
|
|
|
|
if not self.icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
self.icon = get_icon(*self.images)
|
|
|
|
|
|
|
|
|
|
pm = self.icon.pixmap(16)
|
|
|
|
|
|
|
|
|
@ -2414,7 +2347,7 @@ def show_msg(text, title = None, parent = None):
|
|
|
|
|
text = temp
|
|
|
|
|
msgBox.setText(text)
|
|
|
|
|
msgBox.setStandardButtons(qt.QMessageBox.Ok)
|
|
|
|
|
msgBox.setWindowIcon (qt.QIcon('calculate-install.svg'))
|
|
|
|
|
msgBox.setWindowIcon(get_icon('calculate-install.svg'))
|
|
|
|
|
msgBox.exec_()
|
|
|
|
|
|
|
|
|
|
def show_question(parent, text, informative_text = None, cursor_pos = False,
|
|
|
|
|