- prepared the application for usage of dark icons in case of using the dark theme

- updated the languages
- RELEASE 8.99
This commit is contained in:
Marius Stanciu 2019-12-15 16:28:36 +02:00 committed by Marius
parent ca4c7b245f
commit 8361ee7897
34 changed files with 18341 additions and 18387 deletions

View File

@ -962,6 +962,11 @@ class App(QtCore.QObject):
else:
self.decimals = int(self.defaults['decimals_inch'])
if self.defaults["global_theme"] == 'white':
self.resource_location = 'share'
else:
self.resource_location = 'share'
self.current_units = self.defaults['units']
# #############################################################################
@ -985,7 +990,7 @@ class App(QtCore.QObject):
show_splash = 1
if show_splash and self.cmd_line_headless != 1:
splash_pix = QtGui.QPixmap('share/splash.png')
splash_pix = QtGui.QPixmap(self.resource_location + '/splash.png')
self.splash = QtWidgets.QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
# self.splash.setMask(splash_pix.mask())
@ -1702,11 +1707,13 @@ class App(QtCore.QObject):
self.parent_w = QtWidgets.QWidget()
if self.cmd_line_headless == 1:
self.trayIcon = FlatCAMSystemTray(app=self, icon=QtGui.QIcon('share/flatcam_icon32_green.png'),
self.trayIcon = FlatCAMSystemTray(app=self,
icon=QtGui.QIcon(self.resource_location + '/flatcam_icon32_green.png'),
headless=True,
parent=self.parent_w)
else:
self.trayIcon = FlatCAMSystemTray(app=self, icon=QtGui.QIcon('share/flatcam_icon32_green.png'),
self.trayIcon = FlatCAMSystemTray(app=self,
icon=QtGui.QIcon(self.resource_location + '/flatcam_icon32_green.png'),
parent=self.parent_w)
# #############################################################################
@ -2992,84 +2999,96 @@ class App(QtCore.QObject):
:return: None
"""
self.dblsidedtool = DblSidedTool(self)
self.dblsidedtool.install(icon=QtGui.QIcon('share/doubleside16.png'), separator=True)
self.dblsidedtool.install(icon=QtGui.QIcon(self.resource_location + '/doubleside16.png'), separator=True)
self.cal_exc_tool = ToolCalibration(self)
self.cal_exc_tool.install(icon=QtGui.QIcon('share/calibrate_16.png'), pos=self.ui.menutool,
self.cal_exc_tool.install(icon=QtGui.QIcon(self.resource_location + '/calibrate_16.png'), pos=self.ui.menutool,
before=self.dblsidedtool.menuAction,
separator=False)
self.distance_tool = Distance(self)
self.distance_tool.install(icon=QtGui.QIcon('share/distance16.png'), pos=self.ui.menuedit,
self.distance_tool.install(icon=QtGui.QIcon(self.resource_location + '/distance16.png'), pos=self.ui.menuedit,
before=self.ui.menueditorigin,
separator=False)
self.distance_min_tool = DistanceMin(self)
self.distance_min_tool.install(icon=QtGui.QIcon('share/distance_min16.png'), pos=self.ui.menuedit,
self.distance_min_tool.install(icon=QtGui.QIcon(self.resource_location + '/distance_min16.png'),
pos=self.ui.menuedit,
before=self.ui.menueditorigin,
separator=True)
self.panelize_tool = Panelize(self)
self.panelize_tool.install(icon=QtGui.QIcon('share/panelize16.png'))
self.panelize_tool.install(icon=QtGui.QIcon(self.resource_location + '/panelize16.png'))
self.film_tool = Film(self)
self.film_tool.install(icon=QtGui.QIcon('share/film16.png'))
self.film_tool.install(icon=QtGui.QIcon(self.resource_location + '/film16.png'))
self.paste_tool = SolderPaste(self)
self.paste_tool.install(icon=QtGui.QIcon('share/solderpastebis32.png'))
self.paste_tool.install(icon=QtGui.QIcon(self.resource_location + '/solderpastebis32.png'))
self.calculator_tool = ToolCalculator(self)
self.calculator_tool.install(icon=QtGui.QIcon('share/calculator16.png'), separator=True)
self.calculator_tool.install(icon=QtGui.QIcon(self.resource_location + '/calculator16.png'), separator=True)
self.sub_tool = ToolSub(self)
self.sub_tool.install(icon=QtGui.QIcon('share/sub32.png'), pos=self.ui.menutool, separator=True)
self.sub_tool.install(icon=QtGui.QIcon(self.resource_location + '/sub32.png'),
pos=self.ui.menutool, separator=True)
self.rules_tool = RulesCheck(self)
self.rules_tool.install(icon=QtGui.QIcon('share/rules32.png'), pos=self.ui.menutool, separator=False)
self.rules_tool.install(icon=QtGui.QIcon(self.resource_location + '/rules32.png'),
pos=self.ui.menutool, separator=False)
self.optimal_tool = ToolOptimal(self)
self.optimal_tool.install(icon=QtGui.QIcon('share/open_excellon32.png'), pos=self.ui.menutool, separator=True)
self.optimal_tool.install(icon=QtGui.QIcon(self.resource_location + '/open_excellon32.png'),
pos=self.ui.menutool, separator=True)
self.move_tool = ToolMove(self)
self.move_tool.install(icon=QtGui.QIcon('share/move16.png'), pos=self.ui.menuedit,
self.move_tool.install(icon=QtGui.QIcon(self.resource_location + '/move16.png'), pos=self.ui.menuedit,
before=self.ui.menueditorigin, separator=True)
self.cutout_tool = CutOut(self)
self.cutout_tool.install(icon=QtGui.QIcon('share/cut16_bis.png'), pos=self.ui.menutool,
self.cutout_tool.install(icon=QtGui.QIcon(self.resource_location + '/cut16_bis.png'), pos=self.ui.menutool,
before=self.sub_tool.menuAction)
self.ncclear_tool = NonCopperClear(self)
self.ncclear_tool.install(icon=QtGui.QIcon('share/ncc16.png'), pos=self.ui.menutool,
self.ncclear_tool.install(icon=QtGui.QIcon(self.resource_location + '/ncc16.png'), pos=self.ui.menutool,
before=self.sub_tool.menuAction, separator=True)
self.paint_tool = ToolPaint(self)
self.paint_tool.install(icon=QtGui.QIcon('share/paint16.png'), pos=self.ui.menutool,
self.paint_tool.install(icon=QtGui.QIcon(self.resource_location + '/paint16.png'), pos=self.ui.menutool,
before=self.sub_tool.menuAction, separator=True)
self.copper_thieving_tool = ToolCopperThieving(self)
self.copper_thieving_tool.install(icon=QtGui.QIcon('share/copperfill32.png'), pos=self.ui.menutool)
self.copper_thieving_tool.install(icon=QtGui.QIcon(self.resource_location + '/copperfill32.png'),
pos=self.ui.menutool)
self.fiducial_tool = ToolFiducials(self)
self.fiducial_tool.install(icon=QtGui.QIcon('share/fiducials_32.png'), pos=self.ui.menutool)
self.fiducial_tool.install(icon=QtGui.QIcon(self.resource_location + '/fiducials_32.png'),
pos=self.ui.menutool)
self.qrcode_tool = QRCode(self)
self.qrcode_tool.install(icon=QtGui.QIcon('share/qrcode32.png'), pos=self.ui.menutool)
self.qrcode_tool.install(icon=QtGui.QIcon(self.resource_location + '/qrcode32.png'),
pos=self.ui.menutool)
self.transform_tool = ToolTransform(self)
self.transform_tool.install(icon=QtGui.QIcon('share/transform.png'), pos=self.ui.menuoptions, separator=True)
self.transform_tool.install(icon=QtGui.QIcon(self.resource_location + '/transform.png'),
pos=self.ui.menuoptions, separator=True)
self.properties_tool = Properties(self)
self.properties_tool.install(icon=QtGui.QIcon('share/properties32.png'), pos=self.ui.menuoptions)
self.properties_tool.install(icon=QtGui.QIcon(self.resource_location + '/properties32.png'),
pos=self.ui.menuoptions)
self.pdf_tool = ToolPDF(self)
self.pdf_tool.install(icon=QtGui.QIcon('share/pdf32.png'), pos=self.ui.menufileimport,
self.pdf_tool.install(icon=QtGui.QIcon(self.resource_location + '/pdf32.png'),
pos=self.ui.menufileimport,
separator=True)
self.image_tool = ToolImage(self)
self.image_tool.install(icon=QtGui.QIcon('share/image32.png'), pos=self.ui.menufileimport,
self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'),
pos=self.ui.menufileimport,
separator=True)
self.pcb_wizard_tool = PcbWizard(self)
self.pcb_wizard_tool.install(icon=QtGui.QIcon('share/drill32.png'), pos=self.ui.menufileimport)
self.pcb_wizard_tool.install(icon=QtGui.QIcon(self.resource_location + '/drill32.png'),
pos=self.ui.menufileimport)
self.log.debug("Tools are installed.")
@ -3112,7 +3131,8 @@ class App(QtCore.QObject):
self.remove_tools()
# re-add the TCL Shell action to the Tools menu and reconnect it to ist slot function
self.ui.menutoolshell = self.ui.menutool.addAction(QtGui.QIcon('share/shell16.png'), '&Command Line\tS')
self.ui.menutoolshell = self.ui.menutool.addAction(QtGui.QIcon(self.resource_location + '/shell16.png'),
'&Command Line\tS')
self.ui.menutoolshell.triggered.connect(self.on_toggle_shell)
# third install all of them
@ -3293,7 +3313,7 @@ class App(QtCore.QObject):
msgbox = QtWidgets.QMessageBox()
msgbox.setText(_("Do you want to save the edited object?"))
msgbox.setWindowTitle(_("Close Editor"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)
@ -4418,9 +4438,11 @@ class App(QtCore.QObject):
beta = self.beta
class AboutDialog(QtWidgets.QDialog):
def __init__(self, parent=None):
def __init__(self, app, parent=None):
QtWidgets.QDialog.__init__(self, parent)
self.app = app
# Icon and title
self.setWindowIcon(parent.app_icon)
self.setWindowTitle(_("About FlatCAM"))
@ -4431,14 +4453,14 @@ class App(QtCore.QObject):
# "background-attachment: fixed"
# )
# bgimage = QtGui.QImage('share/flatcam_icon256.png')
# bgimage = QtGui.QImage(self.resource_location + '/flatcam_icon256.png')
# s_bgimage = bgimage.scaled(QtCore.QSize(self.frameGeometry().width(), self.frameGeometry().height()))
# palette = QtGui.QPalette()
# palette.setBrush(10, QtGui.QBrush(bgimage)) # 10 = Windowrole
# self.setPalette(palette)
logo = QtWidgets.QLabel()
logo.setPixmap(QtGui.QPixmap('share/flatcam_icon256.png'))
logo.setPixmap(QtGui.QPixmap(self.app.resource_location + '/flatcam_icon256.png'))
title = QtWidgets.QLabel(
"<font size=8><B>FlatCAM</B></font><BR>"
@ -4630,6 +4652,8 @@ class App(QtCore.QObject):
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Chris Breneman"), 30, 0)
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Eric Varsanyi"), 31, 0)
self.prog_grid_lay.addWidget(QtWidgets.QLabel(''), 34, 0)
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "@Idechix"), 100, 0)
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "@SM"), 101, 0)
self.prog_grid_lay.addWidget(QtWidgets.QLabel('%s' % "@grbf"), 102, 0)
@ -4664,12 +4688,12 @@ class App(QtCore.QObject):
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Carlos Stein"), 1, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "<carlos.stein@gmail.com>"), 1, 3)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "French"), 2, 0)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu"), 2, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "(Google-Translation)"), 2, 2)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu (Google-Tr)"), 2, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % ""), 2, 2)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % " "), 2, 3)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "German"), 3, 0)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu"), 3, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Jens Karstedt"), 3, 2)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu (Google-Tr)"), 3, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Jens Karstedt, @detlefeckardt"), 3, 2)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % " "), 3, 3)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Romanian"), 4, 0)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu"), 4, 1)
@ -4678,8 +4702,8 @@ class App(QtCore.QObject):
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Andrey Kultyapov"), 5, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "<camellan@yandex.ru>"), 5, 3)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Spanish"), 6, 0)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu"), 6, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "(Google-Translation)"), 6, 2)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % "Marius Stanciu (Google-Tr)"), 6, 1)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % ""), 6, 2)
self.translator_grid_lay.addWidget(QtWidgets.QLabel('%s' % " "), 6, 3)
self.translator_grid_lay.setColumnStretch(0, 0)
self.translators_tab_layout.addStretch()
@ -4697,7 +4721,7 @@ class App(QtCore.QObject):
closebtn.clicked.connect(self.accept)
AboutDialog(self.ui).exec_()
AboutDialog(app=self, parent=self.ui).exec_()
def install_bookmarks(self, book_dict=None):
"""
@ -4751,7 +4775,7 @@ class App(QtCore.QObject):
act = QtWidgets.QAction(parent=self.ui.menuhelp_bookmarks)
act.setText(title)
act.setIcon(QtGui.QIcon('share/link16.png'))
act.setIcon(QtGui.QIcon(self.resource_location + '/link16.png'))
# from here: https://stackoverflow.com/questions/20390323/pyqt-dynamic-generate-qmenu-action-and-connect
if title == 'Backup Site' and weblink == "":
act.triggered.connect(self.on_backup_site)
@ -4784,8 +4808,7 @@ class App(QtCore.QObject):
# Switch plot_area to preferences page
self.ui.plot_tab_area.setCurrentWidget(self.book_dialog_tab)
@staticmethod
def on_backup_site():
def on_backup_site(self):
msgbox = QtWidgets.QMessageBox()
msgbox.setText(_("This entry will resolve to another website if:\n\n"
"1. FlatCAM.org website is down\n"
@ -4795,7 +4818,7 @@ class App(QtCore.QObject):
"use the YouTube channel link from the Help menu."))
msgbox.setWindowTitle(_("Alternative website"))
msgbox.setWindowIcon(QtGui.QIcon('share/globe16.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/globe16.png'))
bt_yes = msgbox.addButton(_('Close'), QtWidgets.QMessageBox.YesRole)
msgbox.setDefaultButton(bt_yes)
@ -4822,7 +4845,7 @@ class App(QtCore.QObject):
# "\n"
# "Do you want to Save the project?")
# msgbox.setWindowTitle("Save changes")
# msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
# msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png'))
# msgbox.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No |
# QtWidgets.QMessageBox.Cancel)
# msgbox.setDefaultButton(QtWidgets.QMessageBox.Yes)
@ -5002,7 +5025,7 @@ class App(QtCore.QObject):
"\n"
"Do you want to Save the project?"))
msgbox.setWindowTitle(_("Save changes"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)
bt_cancel = msgbox.addButton(_('Cancel'), QtWidgets.QMessageBox.RejectRole)
@ -5836,7 +5859,7 @@ class App(QtCore.QObject):
# Changing project units. Warn user.
msgbox = QtWidgets.QMessageBox()
msgbox.setWindowTitle(_("Toggle Units"))
msgbox.setWindowIcon(QtGui.QIcon('share/toggle_units32.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/toggle_units32.png'))
msgbox.setText(_("Changing the units of the project\n"
"will scale all objects.\n\n"
"Do you want to continue?"))
@ -7064,7 +7087,7 @@ class App(QtCore.QObject):
tool_add_popup = FCInputDialog(title="New Tool ...",
text='Enter a Tool Diameter:',
min=0.0000, max=99.9999, decimals=4)
tool_add_popup.setWindowIcon(QtGui.QIcon('share/letter_t_32.png'))
tool_add_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/letter_t_32.png'))
val, ok = tool_add_popup.get_value()
if ok:
@ -7081,7 +7104,7 @@ class App(QtCore.QObject):
msgbox.setText(_("Adding Tool works only when Advanced is checked.\n"
"Go to Preferences -> General - Show Advanced Options."))
msgbox.setWindowTitle("Tool adding ...")
msgbox.setWindowIcon(QtGui.QIcon('share/warning.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/warning.png'))
bt_ok = msgbox.addButton(_('Ok'), QtWidgets.QMessageBox.AcceptRole)
msgbox.setDefaultButton(bt_ok)
@ -7154,7 +7177,7 @@ class App(QtCore.QObject):
if self.defaults["global_delete_confirmation"] is True:
msgbox = QtWidgets.QMessageBox()
msgbox.setWindowTitle(_("Delete objects"))
msgbox.setWindowIcon(QtGui.QIcon('share/deleteshape32.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/deleteshape32.png'))
# msgbox.setText("<B>%s</B>" % _("Change project units ..."))
msgbox.setText(_("Are you sure you want to permanently delete\n"
"the selected objects?"))
@ -7351,7 +7374,7 @@ class App(QtCore.QObject):
dia_box = Dialog_box(title=_("Jump to ..."),
label=_("Enter the coordinates in format X,Y:"),
icon=QtGui.QIcon('share/jump_to16.png'),
icon=QtGui.QIcon(self.resource_location + '/jump_to16.png'),
initial_text=dia_box_location)
if dia_box.ok is True:
@ -7861,7 +7884,7 @@ class App(QtCore.QObject):
msgbox.setText(_("One or more values are changed.\n"
"Do you want to save the Preferences?"))
msgbox.setWindowTitle(_("Save Preferences"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)
@ -7887,7 +7910,7 @@ class App(QtCore.QObject):
msgbox.setText(_("One or more Tools are edited.\n"
"Do you want to update the Tools Database?"))
msgbox.setWindowTitle(_("Save Tools Database"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)
@ -8183,12 +8206,12 @@ class App(QtCore.QObject):
:return: None
"""
icon_files = {
"gerber": "share/flatcam_icon16.png",
"excellon": "share/drill16.png",
"cncjob": "share/cnc16.png",
"geometry": "share/geometry16.png",
"script": "share/script_new16.png",
"document": "share/notes16_1.png"
"gerber": self.resource_location + "/flatcam_icon16.png",
"excellon": self.resource_location + "/drill16.png",
"cncjob": self.resource_location + "/cnc16.png",
"geometry": self.resource_location + "/geometry16.png",
"script": self.resource_location + "/script_new16.png",
"document": self.resource_location + "/notes16_1.png"
}
if state == 'append':
@ -8257,11 +8280,11 @@ class App(QtCore.QObject):
self.ui.menuobjects.addSeparator()
self.ui.menuobjects_selall = self.ui.menuobjects.addAction(
QtGui.QIcon('share/select_all.png'),
QtGui.QIcon(self.resource_location + '/select_all.png'),
_('Select All')
)
self.ui.menuobjects_unselall = self.ui.menuobjects.addAction(
QtGui.QIcon('share/deselect_all32.png'),
QtGui.QIcon(self.resource_location + '/deselect_all32.png'),
_('Deselect All')
)
self.ui.menuobjects_selall.triggered.connect(lambda: self.on_objects_selection(True))
@ -8304,11 +8327,11 @@ class App(QtCore.QObject):
self.ui.menuobjects.addSeparator()
self.ui.menuobjects_selall = self.ui.menuobjects.addAction(
QtGui.QIcon('share/select_all.png'),
QtGui.QIcon(self.resource_location + '/select_all.png'),
_('Select All')
)
self.ui.menuobjects_unselall = self.ui.menuobjects.addAction(
QtGui.QIcon('share/deselect_all32.png'),
QtGui.QIcon(self.resource_location + '/deselect_all32.png'),
_('Deselect All')
)
self.ui.menuobjects_selall.triggered.connect(lambda: self.on_objects_selection(True))
@ -8351,7 +8374,8 @@ class App(QtCore.QObject):
self.ui.cmenu_gridmenu.clear()
sorted_list = sorted(self.defaults["global_grid_context_menu"][str(units)])
grid_toggle = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/grid32_menu.png'), _("Grid On/Off"))
grid_toggle = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon(self.resource_location + '/grid32_menu.png'),
_("Grid On/Off"))
grid_toggle.setCheckable(True)
if self.grid_status() == True:
grid_toggle.setChecked(True)
@ -8360,12 +8384,15 @@ class App(QtCore.QObject):
self.ui.cmenu_gridmenu.addSeparator()
for grid in sorted_list:
action = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/grid32_menu.png'), "%s" % str(grid))
action = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon(self.resource_location + '/grid32_menu.png'),
"%s" % str(grid))
action.triggered.connect(self.set_grid)
self.ui.cmenu_gridmenu.addSeparator()
grid_add = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/plus32.png'), _("Add"))
grid_delete = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon('share/delete32.png'), _("Delete"))
grid_add = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon(self.resource_location + '/plus32.png'),
_("Add"))
grid_delete = self.ui.cmenu_gridmenu.addAction(QtGui.QIcon(self.resource_location + '/delete32.png'),
_("Delete"))
grid_add.triggered.connect(self.on_grid_add)
grid_delete.triggered.connect(self.on_grid_delete)
grid_toggle.triggered.connect(lambda: self.ui.grid_snap_btn.trigger())
@ -8381,7 +8408,7 @@ class App(QtCore.QObject):
grid_add_popup = FCInputDialog(title=_("New Grid ..."),
text=_('Enter a Grid Value:'),
min=0.0000, max=99.9999, decimals=4)
grid_add_popup.setWindowIcon(QtGui.QIcon('share/plus32.png'))
grid_add_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/plus32.png'))
val, ok = grid_add_popup.get_value()
if ok:
@ -8408,7 +8435,7 @@ class App(QtCore.QObject):
grid_del_popup = FCInputDialog(title="Delete Grid ...",
text='Enter a Grid Value:',
min=0.0000, max=99.9999, decimals=4)
grid_del_popup.setWindowIcon(QtGui.QIcon('share/delete32.png'))
grid_del_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/delete32.png'))
val, ok = grid_del_popup.get_value()
if ok:
@ -9046,7 +9073,7 @@ class App(QtCore.QObject):
"Creating a New project will delete them.\n"
"Do you want to Save the project?"))
msgbox.setWindowTitle(_("Save changes"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)
bt_cancel = msgbox.addButton(_('Cancel'), QtWidgets.QMessageBox.RejectRole)
@ -11532,17 +11559,17 @@ class App(QtCore.QObject):
# TODO: Move this to constructor
icons = {
"gerber": "share/flatcam_icon16.png",
"excellon": "share/drill16.png",
'geometry': "share/geometry16.png",
"cncjob": "share/cnc16.png",
"script": "share/script_new24.png",
"document": "share/notes16_1.png",
"project": "share/project16.png",
"svg": "share/geometry16.png",
"dxf": "share/dxf16.png",
"pdf": "share/pdf32.png",
"image": "share/image16.png"
"gerber": self.resource_location + "/flatcam_icon16.png",
"excellon": self.resource_location + "/drill16.png",
'geometry': self.resource_location + "/geometry16.png",
"cncjob": self.resource_location + "/cnc16.png",
"script": self.resource_location + "/script_new24.png",
"document": self.resource_location + "/notes16_1.png",
"project": self.resource_location + "/project16.png",
"svg": self.resource_location + "/geometry16.png",
"dxf": self.resource_location + "/dxf16.png",
"pdf": self.resource_location + "/pdf32.png",
"image": self.resource_location + "/image16.png"
}
@ -11652,7 +11679,8 @@ class App(QtCore.QObject):
App.log.error("Unsupported file type: %s" % recent["kind"])
# Last action in Recent Files menu is one that Clear the content
clear_action_proj = QtWidgets.QAction(QtGui.QIcon('share/trash32.png'), (_("Clear Recent projects")), self)
clear_action_proj = QtWidgets.QAction(QtGui.QIcon(self.resource_location + '/trash32.png'),
(_("Clear Recent projects")), self)
clear_action_proj.triggered.connect(reset_recent_projects)
self.ui.recent_projects.addSeparator()
self.ui.recent_projects.addAction(clear_action_proj)
@ -11675,7 +11703,8 @@ class App(QtCore.QObject):
App.log.error("Unsupported file type: %s" % recent["kind"])
# Last action in Recent Files menu is one that Clear the content
clear_action = QtWidgets.QAction(QtGui.QIcon('share/trash32.png'), (_("Clear Recent files")), self)
clear_action = QtWidgets.QAction(QtGui.QIcon(self.resource_location + '/trash32.png'),
(_("Clear Recent files")), self)
clear_action.triggered.connect(reset_recent_files)
self.ui.recent.addSeparator()
self.ui.recent.addAction(clear_action)

View File

@ -290,7 +290,7 @@ class BookmarkManager(QtWidgets.QWidget):
if len(self.bm_dict) < bm_limit:
act = QtWidgets.QAction(parent=self.app.ui.menuhelp_bookmarks)
act.setText(title)
act.setIcon(QtGui.QIcon('share/link16.png'))
act.setIcon(QtGui.QIcon(self.app.resource_location + '/link16.png'))
act.triggered.connect(lambda: webbrowser.open(link))
self.app.ui.menuhelp_bookmarks.insertAction(self.app.ui.menuhelp_bookmarks_manager, act)
@ -749,11 +749,11 @@ class ToolsDB(QtWidgets.QWidget):
self.table_widget.setupContextMenu()
self.table_widget.addContextMenu(
_("Add to DB"), self.on_tool_add, icon=QtGui.QIcon("share/plus16.png"))
_("Add to DB"), self.on_tool_add, icon=QtGui.QIcon(self.app.resource_location + "/plus16.png"))
self.table_widget.addContextMenu(
_("Copy from DB"), self.on_tool_copy, icon=QtGui.QIcon("share/copy16.png"))
_("Copy from DB"), self.on_tool_copy, icon=QtGui.QIcon(self.app.resource_location + "/copy16.png"))
self.table_widget.addContextMenu(
_("Delete from DB"), self.on_tool_delete, icon=QtGui.QIcon("share/delete32.png"))
_("Delete from DB"), self.on_tool_delete, icon=QtGui.QIcon(self.app.resource_location + "/delete32.png"))
def build_db_ui(self):
self.ui_disconnect()

View File

@ -3893,11 +3893,14 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
self.ui.geo_tools_table.setupContextMenu()
self.ui.geo_tools_table.addContextMenu(
_("Add from Tool DB"), self.on_tool_add_from_db_clicked, icon=QtGui.QIcon("share/plus16.png"))
_("Add from Tool DB"), self.on_tool_add_from_db_clicked,
icon=QtGui.QIcon(self.app.resource_location + "/plus16.png"))
self.ui.geo_tools_table.addContextMenu(
_("Copy"), self.on_tool_copy, icon=QtGui.QIcon("share/copy16.png"))
_("Copy"), self.on_tool_copy,
icon=QtGui.QIcon(self.app.resource_location + "/copy16.png"))
self.ui.geo_tools_table.addContextMenu(
_("Delete"), lambda: self.on_tool_delete(all=None), icon=QtGui.QIcon("share/delete32.png"))
_("Delete"), lambda: self.on_tool_delete(all=None),
icon=QtGui.QIcon(self.app.resource_location + "/delete32.png"))
# Show/Hide Advanced Options
if self.app.defaults["global_app_level"] == 'b':

View File

@ -80,6 +80,17 @@ def on_language_apply_click(app, restart=False):
"""
name = app.ui.general_defaults_form.general_app_group.language_cb.currentText()
theme_settings = QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
resource_loc = 'share'
else:
resource_loc = 'share'
# do nothing if trying to apply the language that is the current language (already applied).
settings = QSettings("Open Source", "FlatCAM")
if settings.contains("language"):
@ -93,7 +104,7 @@ def on_language_apply_click(app, restart=False):
msgbox.setInformativeText('%s %s?' %
(_("Are you sure do you want to change the current language to"), name.capitalize()))
msgbox.setWindowTitle(_("Apply Language ..."))
msgbox.setWindowIcon(QtGui.QIcon('share/language32.png'))
msgbox.setWindowIcon(QtGui.QIcon(resource_loc + '/language32.png'))
bt_yes = msgbox.addButton(_("Yes"), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_("No"), QtWidgets.QMessageBox.NoRole)
@ -161,13 +172,24 @@ def restart_program(app, ask=None):
saving data) must be done before calling this function.
"""
theme_settings = QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
resource_loc = 'share'
else:
resource_loc = 'share'
if app.should_we_save and app.collection.get_list() or ask is True:
msgbox = QtWidgets.QMessageBox()
msgbox.setText(_("There are files/objects modified in FlatCAM. "
"\n"
"Do you want to Save the project?"))
msgbox.setWindowTitle(_("Save changes"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
msgbox.setWindowIcon(QtGui.QIcon(resource_loc + '/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)

View File

@ -234,7 +234,8 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# ## Icons for the list view
self.icons = {}
for kind in ObjectCollection.icon_files:
self.icons[kind] = QtGui.QPixmap(ObjectCollection.icon_files[kind])
self.icons[kind] = QtGui.QPixmap(
ObjectCollection.icon_files[kind].replace('share', self.app.resource_location))
# Create root tree view item
self.root_item = TreeItem(["root"])

View File

@ -13,6 +13,9 @@ CAD program, and create G-Code for Isolation routing.
- fixed a bug that created a crash in special conditions; it's related to the QSettings in FlatCAMGui.py
- added a script to remove the bad profiles from resource pictures. From here: https://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile/43415650, link mentioned by @camellan (Andrey Kultyapov)
- prepared the application for usage of dark icons in case of using the dark theme
- updated the languages
- RELEASE 8.99
14.12.2019

View File

@ -65,7 +65,7 @@ class FCDrillAdd(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_drill.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_drill.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
geo = self.utility_geometry(data=(self.draw_app.snap_x, self.draw_app.snap_y))
@ -171,7 +171,7 @@ class FCDrillArray(FCShapeTool):
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_drill_array.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_drill_array.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
geo = self.utility_geometry(data=(self.draw_app.snap_x, self.draw_app.snap_y), static=True)
@ -376,7 +376,7 @@ class FCSlot(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_slot.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_slot.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
@ -566,7 +566,7 @@ class FCSlotArray(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_array.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_array.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
@ -1471,7 +1471,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.tools_box.addLayout(self.title_box)
# ## Page Title icon
pixmap = QtGui.QPixmap('share/flatcam_icon32.png')
pixmap = QtGui.QPixmap(self.app.resource_location + '/flatcam_icon32.png')
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)

View File

@ -304,12 +304,12 @@ class TextInputTool(FlatCAMTool):
self.font_bold_tb = QtWidgets.QToolButton()
self.font_bold_tb.setCheckable(True)
self.font_bold_tb.setIcon(QtGui.QIcon('share/bold32.png'))
self.font_bold_tb.setIcon(QtGui.QIcon(self.app.resource_location + '/bold32.png'))
hlay.addWidget(self.font_bold_tb)
self.font_italic_tb = QtWidgets.QToolButton()
self.font_italic_tb.setCheckable(True)
self.font_italic_tb.setIcon(QtGui.QIcon('share/italic32.png'))
self.font_italic_tb.setIcon(QtGui.QIcon(self.app.resource_location + '/italic32.png'))
hlay.addWidget(self.font_italic_tb)
self.form_layout.addRow(QtWidgets.QLabel('%s:' % "Size"), hlay)
@ -1495,7 +1495,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_rotate']))
val_box.setWindowIcon(QtGui.QIcon('share/rotate.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
val, ok = val_box.get_value()
if ok:
@ -1514,7 +1514,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-9999.9999, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_x']))
val_box.setWindowIcon(QtGui.QIcon('share/offsetx32.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
val, ok = val_box.get_value()
if ok:
@ -1533,7 +1533,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-9999.9999, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_y']))
val_box.setWindowIcon(QtGui.QIcon('share/offsety32.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
val, ok = val_box.get_value()
if ok:
@ -1550,7 +1550,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_x']))
val_box.setWindowIcon(QtGui.QIcon('share/skewX.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
val, ok = val_box.get_value()
if ok:
@ -1567,7 +1567,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_y']))
val_box.setWindowIcon(QtGui.QIcon('share/skewY.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
val, ok = val_box.get_value()
if ok:
@ -1938,7 +1938,7 @@ class FCCircle(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_circle_geo.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_circle_geo.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_("Click on Center point ..."))
@ -1990,7 +1990,7 @@ class FCArc(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_arc.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_arc.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_("Click on Center point ..."))
@ -2209,7 +2209,7 @@ class FCRectangle(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_("Click on 1st corner ..."))
@ -2263,7 +2263,7 @@ class FCPolygon(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_("Click on 1st corner ..."))
@ -2326,7 +2326,7 @@ class FCPath(FCPolygon):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path5.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_path5.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
def make(self):
@ -2686,7 +2686,7 @@ class FCText(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_text.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_text.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
# self.shape_buffer = self.draw_app.shape_buffer

View File

@ -199,7 +199,7 @@ class FCPad(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_circle.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_circle.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
try:
@ -417,7 +417,7 @@ class FCPadArray(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_array.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_array.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
@ -874,7 +874,7 @@ class FCRegion(FCShapeTool):
except Exception as e:
log.debug("FlatCAMGrbEditor.FCRegion --> %s" % str(e))
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_('Corner Mode 1: 45 degrees ...'))
@ -1148,7 +1148,7 @@ class FCTrack(FCRegion):
except Exception as e:
log.debug("FlatCAMGrbEditor.FCTrack.__init__() --> %s" % str(e))
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path%s.png' % self.draw_app.bend_mode))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.app.resource_location + '/aero_path%s.png' % self.draw_app.bend_mode))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_('Track Mode 1: 45 degrees ...'))
@ -1295,27 +1295,27 @@ class FCTrack(FCRegion):
if self.draw_app.bend_mode == 1:
self.draw_app.bend_mode = 2
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path2.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path2.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 2: Reverse 45 degrees ...')
elif self.draw_app.bend_mode == 2:
self.draw_app.bend_mode = 3
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path3.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path3.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 3: 90 degrees ...')
elif self.draw_app.bend_mode == 3:
self.draw_app.bend_mode = 4
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path4.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path4.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 4: Reverse 90 degrees ...')
elif self.draw_app.bend_mode == 4:
self.draw_app.bend_mode = 5
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path5.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path5.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 5: Free angle ...')
else:
self.draw_app.bend_mode = 1
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path1.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path1.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 1: 45 degrees ...')
@ -1334,27 +1334,27 @@ class FCTrack(FCRegion):
if self.draw_app.bend_mode == 1:
self.draw_app.bend_mode = 5
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path5.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path5.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 5: Free angle ...')
elif self.draw_app.bend_mode == 5:
self.draw_app.bend_mode = 4
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path4.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path4.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 4: Reverse 90 degrees ...')
elif self.draw_app.bend_mode == 4:
self.draw_app.bend_mode = 3
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path3.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path3.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 3: 90 degrees ...')
elif self.draw_app.bend_mode == 3:
self.draw_app.bend_mode = 2
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path2.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path2.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 2: Reverse 45 degrees ...')
else:
self.draw_app.bend_mode = 1
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_path1.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_path1.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
msg = _('Track Mode 1: 45 degrees ...')
@ -1379,7 +1379,7 @@ class FCDisc(FCShapeTool):
QtGui.QGuiApplication.restoreOverrideCursor()
except Exception as e:
pass
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_disc.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_disc.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size'])
@ -1461,7 +1461,7 @@ class FCSemiDisc(FCShapeTool):
except Exception as e:
log.debug("FlatCAMGrbEditor.FCSemiDisc --> %s" % str(e))
self.cursor = QtGui.QCursor(QtGui.QPixmap('share/aero_semidisc.png'))
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_semidisc.png'))
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
self.draw_app.app.inform.emit(_("Click on Center point ..."))
@ -2367,7 +2367,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
layout.addLayout(self.title_box)
# Page Title icon
pixmap = QtGui.QPixmap('share/flatcam_icon32.png')
pixmap = QtGui.QPixmap(self.app.resource_location + '/flatcam_icon32.png')
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)
@ -5949,7 +5949,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_rotate']))
val_box.setWindowIcon(QtGui.QIcon('share/rotate.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
val, ok = val_box.get_value()
if ok:
@ -5966,7 +5966,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-9999.9999, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_x']))
val_box.setWindowIcon(QtGui.QIcon('share/offsetx32.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
val, ok = val_box.get_value()
if ok:
@ -5983,7 +5983,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
min=-9999.9999, max=10000.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_offset_y']))
val_box.setWindowIcon(QtGui.QIcon('share/offsety32.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
val, ok = val_box.get_value()
if ok:
@ -5998,7 +5998,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_x']))
val_box.setWindowIcon(QtGui.QIcon('share/skewX.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
val, ok = val_box.get_value()
if ok:
@ -6013,7 +6013,7 @@ class TransformEditorTool(FlatCAMTool):
text='%s:' % _('Enter an Angle Value (degrees)'),
min=-359.9999, max=360.0000, decimals=self.decimals,
init_val=float(self.app.defaults['tools_transform_skew_y']))
val_box.setWindowIcon(QtGui.QIcon('share/skewY.png'))
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
val, ok = val_box.get_value()
if ok:

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,17 @@ class ObjectUI(QtWidgets.QWidget):
self.decimals = decimals
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
self.resource_loc = 'share'
else:
self.resource_loc = 'share'
layout = QtWidgets.QVBoxLayout()
self.setLayout(layout)
@ -49,7 +60,7 @@ class ObjectUI(QtWidgets.QWidget):
layout.addLayout(self.title_box)
# ## Page Title icon
pixmap = QtGui.QPixmap(icon_file)
pixmap = QtGui.QPixmap(icon_file.replace('share', self.resource_loc))
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)
@ -436,8 +447,8 @@ class GerberObjectUI(ObjectUI):
# we get rid of item1 ("Excellon") as it is not suitable
self.type_obj_combo.view().setRowHidden(1, True)
self.type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.type_obj_combo.setItemIcon(0, QtGui.QIcon(self.resource_loc + "/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon(self.resource_loc + "/geometry16.png"))
self.type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Obj Type"))
self.type_obj_combo_label.setToolTip(
@ -682,14 +693,27 @@ class GerberObjectUI(ObjectUI):
separator_line2.setFrameShadow(QtWidgets.QFrame.Sunken)
grid2.addWidget(separator_line2, 11, 0, 1, 2)
class ExcellonObjectUI(ObjectUI):
"""
User interface for Excellon objects.
"""
def __init__(self, decimals, parent=None):
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
self.resource_loc = 'share'
else:
self.resource_loc = 'share'
ObjectUI.__init__(self, title=_('Excellon Object'),
icon_file='share/drill32.png',
icon_file=self.resource_loc + '/drill32.png',
parent=parent,
decimals=decimals)
@ -1112,8 +1136,23 @@ class GeometryObjectUI(ObjectUI):
"""
def __init__(self, decimals, parent=None):
super(GeometryObjectUI, self).__init__(title=_('Geometry Object'),
icon_file='share/geometry32.png', parent=parent, decimals=decimals)
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
self.resource_loc = 'share'
else:
self.resource_loc = 'share'
super(GeometryObjectUI, self).__init__(
title=_('Geometry Object'),
icon_file=self.resource_loc + '/geometry32.png', parent=parent, decimals=decimals
)
self.decimals = decimals
# Plot options
@ -1733,9 +1772,22 @@ class CNCObjectUI(ObjectUI):
Creates the user interface for CNCJob objects. GUI elements should
be placed in ``self.custom_box`` to preserve the layout.
"""
ObjectUI.__init__(self, title=_('CNC Job Object'), icon_file='share/cnc32.png', parent=parent,
decimals=decimals)
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
self.resource_loc = 'share'
else:
self.resource_loc = 'share'
ObjectUI.__init__(
self, title=_('CNC Job Object'),
icon_file=self.resource_loc + '/cnc32.png', parent=parent,
decimals=decimals)
self.decimals = decimals
for i in range(0, self.common_grid.count()):
@ -2052,8 +2104,19 @@ class ScriptObjectUI(ObjectUI):
be placed in ``self.custom_box`` to preserve the layout.
"""
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
self.resource_loc = 'share'
else:
self.resource_loc = 'share'
ObjectUI.__init__(self, title=_('Script Object'),
icon_file='share/script_new24.png',
icon_file=self.resource_loc + '/script_new24.png',
parent=parent,
common=False,
decimals=decimals)
@ -2107,8 +2170,19 @@ class DocumentObjectUI(ObjectUI):
be placed in ``self.custom_box`` to preserve the layout.
"""
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
theme = 'white'
if theme == 'white':
self.resource_loc = 'share'
else:
self.resource_loc = 'share'
ObjectUI.__init__(self, title=_('Document Object'),
icon_file='share/notes16_1.png',
icon_file=self.resource_loc + '/notes16_1.png',
parent=parent,
common=False,
decimals=decimals)
@ -2194,16 +2268,16 @@ class DocumentObjectUI(ObjectUI):
self.font_bold_tb = QtWidgets.QToolButton()
self.font_bold_tb.setCheckable(True)
self.font_bold_tb.setIcon(QtGui.QIcon('share/bold32.png'))
self.font_bold_tb.setIcon(QtGui.QIcon(self.resource_loc + '/bold32.png'))
size_hlay.addWidget(self.font_bold_tb)
self.font_italic_tb = QtWidgets.QToolButton()
self.font_italic_tb.setCheckable(True)
self.font_italic_tb.setIcon(QtGui.QIcon('share/italic32.png'))
self.font_italic_tb.setIcon(QtGui.QIcon(self.resource_loc + '/italic32.png'))
size_hlay.addWidget(self.font_italic_tb)
self.font_under_tb = QtWidgets.QToolButton()
self.font_under_tb.setCheckable(True)
self.font_under_tb.setIcon(QtGui.QIcon('share/underline32.png'))
self.font_under_tb.setIcon(QtGui.QIcon(self.resource_loc + '/underline32.png'))
size_hlay.addWidget(self.font_under_tb)
self.form_box.addRow(self.font_size_label, size_hlay)
@ -2215,22 +2289,22 @@ class DocumentObjectUI(ObjectUI):
self.al_left_tb = QtWidgets.QToolButton()
self.al_left_tb.setToolTip(_("Align Left"))
self.al_left_tb.setIcon(QtGui.QIcon('share/align_left32.png'))
self.al_left_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_left32.png'))
al_hlay.addWidget(self.al_left_tb)
self.al_center_tb = QtWidgets.QToolButton()
self.al_center_tb.setToolTip(_("Center"))
self.al_center_tb.setIcon(QtGui.QIcon('share/align_center32.png'))
self.al_center_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_center32.png'))
al_hlay.addWidget(self.al_center_tb)
self.al_right_tb = QtWidgets.QToolButton()
self.al_right_tb.setToolTip(_("Align Right"))
self.al_right_tb.setIcon(QtGui.QIcon('share/align_right32.png'))
self.al_right_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_right32.png'))
al_hlay.addWidget(self.al_right_tb)
self.al_justify_tb = QtWidgets.QToolButton()
self.al_justify_tb.setToolTip(_("Justify"))
self.al_justify_tb.setIcon(QtGui.QIcon('share/align_justify32.png'))
self.al_justify_tb.setIcon(QtGui.QIcon(self.resource_loc + '/align_justify32.png'))
al_hlay.addWidget(self.al_justify_tb)
self.form_box.addRow(self.alignment_label, al_hlay)

View File

@ -1031,7 +1031,7 @@ class GeneralGUISetGroupUI(OptionsGroupUI):
"\n")
)
msgbox.setWindowTitle(_("Clear GUI Settings"))
msgbox.setWindowIcon(QtGui.QIcon('share/trash32.png'))
msgbox.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/trash32.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)

View File

@ -197,8 +197,8 @@ class ToolCalibration(FlatCAMTool):
self.obj_type_combo.addItem(_("Excellon"))
self.obj_type_combo.setCurrentIndex(1)
self.obj_type_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.obj_type_combo.setItemIcon(1, QtGui.QIcon("share/drill16.png"))
self.obj_type_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.obj_type_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/drill16.png"))
grid_lay.addWidget(self.obj_type_label, 12, 0)
grid_lay.addWidget(self.obj_type_combo, 12, 1, 1, 2)
@ -634,9 +634,9 @@ class ToolCalibration(FlatCAMTool):
self.adj_object_type_combo.addItems([_("Gerber"), _("Excellon"), _("Geometry")])
self.adj_object_type_combo.setCurrentIndex(0)
self.adj_object_type_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.adj_object_type_combo.setItemIcon(1, QtGui.QIcon("share/drill16.png"))
self.adj_object_type_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.adj_object_type_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.adj_object_type_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/drill16.png"))
self.adj_object_type_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.adj_object_type_label = QtWidgets.QLabel("%s:" % _("Adjusted object type"))
self.adj_object_type_label.setToolTip(

View File

@ -73,9 +73,9 @@ class CutOut(FlatCAMTool):
# we get rid of item1 ("Excellon") as it is not suitable for creating film
self.type_obj_combo.view().setRowHidden(1, True)
self.type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
# self.type_obj_combo.setItemIcon(1, QtGui.QIcon("share/drill16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
# self.type_obj_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/drill16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Object Type"))
self.type_obj_combo_label.setToolTip(

View File

@ -72,8 +72,8 @@ class Film(FlatCAMTool):
# we get rid of item1 ("Excellon") as it is not suitable for creating film
self.tf_type_obj_combo.view().setRowHidden(1, True)
self.tf_type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.tf_type_obj_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.tf_type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.tf_type_obj_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.tf_type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Object Type"))
self.tf_type_obj_combo_label.setToolTip(
@ -107,8 +107,8 @@ class Film(FlatCAMTool):
# we get rid of item1 ("Excellon") as it is not suitable for box when creating film
self.tf_type_box_combo.view().setRowHidden(1, True)
self.tf_type_box_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.tf_type_box_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.tf_type_box_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.tf_type_box_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.tf_type_box_combo_label = QtWidgets.QLabel(_("Box Type:"))
self.tf_type_box_combo_label.setToolTip(

View File

@ -49,8 +49,8 @@ class ToolImage(FlatCAMTool):
self.tf_type_obj_combo.addItem("Gerber")
self.tf_type_obj_combo.addItem("Geometry")
self.tf_type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.tf_type_obj_combo.setItemIcon(1, QtGui.QIcon("share/geometry16.png"))
self.tf_type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.tf_type_obj_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.tf_type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Object Type"))
self.tf_type_obj_combo_label.setToolTip(

View File

@ -76,8 +76,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
# we get rid of item1 ("Excellon") as it is not suitable
self.type_obj_combo.view().setRowHidden(1, True)
self.type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Obj Type"))
self.type_obj_combo_label.setToolTip(
@ -508,10 +508,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
# #############################################################################
self.tools_table.setupContextMenu()
self.tools_table.addContextMenu(
"Add", self.on_add_tool_by_key, icon=QtGui.QIcon("share/plus16.png"))
"Add", self.on_add_tool_by_key, icon=QtGui.QIcon(self.app.resource_location + "/plus16.png"))
self.tools_table.addContextMenu(
"Delete", lambda:
self.on_tool_delete(rows_to_delete=None, all_tools=None), icon=QtGui.QIcon("share/delete32.png"))
self.on_tool_delete(rows_to_delete=None, all_tools=None),
icon=QtGui.QIcon(self.app.resource_location + "/delete32.png"))
# #############################################################################
# ########################## VARIABLES ########################################
@ -587,7 +588,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
tool_add_popup = FCInputDialog(title='%s...' % _("New Tool"),
text='%s:' % _('Enter a Tool Diameter'),
min=0.0001, max=9999.9999, decimals=self.decimals)
tool_add_popup.setWindowIcon(QtGui.QIcon('share/letter_t_32.png'))
tool_add_popup.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
val, ok = tool_add_popup.get_value()
if ok:

View File

@ -79,8 +79,8 @@ class ToolPaint(FlatCAMTool, Gerber):
# we get rid of item1 ("Excellon") as it is not suitable
self.type_obj_combo.view().setRowHidden(1, True)
self.type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Obj Type"))
self.type_obj_combo_label.setToolTip(
@ -481,10 +481,11 @@ class ToolPaint(FlatCAMTool, Gerber):
# #############################################################################
self.tools_table.setupContextMenu()
self.tools_table.addContextMenu(
"Add", self.on_add_tool_by_key, icon=QtGui.QIcon("share/plus16.png"))
"Add", self.on_add_tool_by_key, icon=QtGui.QIcon(self.app.resource_location + "/plus16.png"))
self.tools_table.addContextMenu(
"Delete", lambda:
self.on_tool_delete(rows_to_delete=None, all=None), icon=QtGui.QIcon("share/delete32.png"))
self.on_tool_delete(rows_to_delete=None, all=None),
icon=QtGui.QIcon(self.app.resource_location + "/delete32.png"))
def on_type_obj_index_changed(self, index):
obj_type = self.type_obj_combo.currentIndex()
@ -498,7 +499,7 @@ class ToolPaint(FlatCAMTool, Gerber):
tool_add_popup = FCInputDialog(title='%s...' % _("New Tool"),
text='%s:' % _('Enter a Tool Diameter'),
min=0.0000, max=99.9999, decimals=4)
tool_add_popup.setWindowIcon(QtGui.QIcon('share/letter_t_32.png'))
tool_add_popup.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
val, ok = tool_add_popup.get_value()
if ok:

View File

@ -59,9 +59,9 @@ class Panelize(FlatCAMTool):
self.type_obj_combo.addItem("Excellon")
self.type_obj_combo.addItem("Geometry")
self.type_obj_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(1, QtGui.QIcon("share/drill16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.type_obj_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.type_obj_combo.setItemIcon(1, QtGui.QIcon(self.app.resource_location + "/drill16.png"))
self.type_obj_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.type_obj_combo_label = QtWidgets.QLabel('%s:' % _("Object Type"))
self.type_obj_combo_label.setToolTip(
@ -115,8 +115,8 @@ class Panelize(FlatCAMTool):
# we get rid of item1 ("Excellon") as it is not suitable for use as a "box" for panelizing
self.type_box_combo.view().setRowHidden(1, True)
self.type_box_combo.setItemIcon(0, QtGui.QIcon("share/flatcam_icon16.png"))
self.type_box_combo.setItemIcon(2, QtGui.QIcon("share/geometry16.png"))
self.type_box_combo.setItemIcon(0, QtGui.QIcon(self.app.resource_location + "/flatcam_icon16.png"))
self.type_box_combo.setItemIcon(2, QtGui.QIcon(self.app.resource_location + "/geometry16.png"))
self.type_box_combo_label = QtWidgets.QLabel('%s:' % _("Box Type"))
self.type_box_combo_label.setToolTip(

View File

@ -500,7 +500,7 @@ class SolderPaste(FlatCAMTool):
self.flat_geometry = []
# action to be added in the combobox context menu
self.combo_context_del_action = QtWidgets.QAction(QtGui.QIcon('share/trash16.png'), _("Delete Object"))
self.combo_context_del_action = QtWidgets.QAction(QtGui.QIcon(self.app.resource_location + '/trash16.png'), _("Delete Object"))
# ## Signals
self.combo_context_del_action.triggered.connect(self.on_delete_object)
@ -553,7 +553,7 @@ class SolderPaste(FlatCAMTool):
tool_add_popup = FCInputDialog(title='%s...' % _("New Tool"),
text='%s:' % _('Enter a Tool Diameter'),
min=0.0000, max=99.9999, decimals=4)
tool_add_popup.setWindowIcon(QtGui.QIcon('share/letter_t_32.png'))
tool_add_popup.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
val, ok = tool_add_popup.get_value()
if ok:
@ -588,10 +588,13 @@ class SolderPaste(FlatCAMTool):
self.tools_table.setupContextMenu()
self.tools_table.addContextMenu(
_("Add"), lambda: self.on_tool_add(dia=None, muted=None), icon=QtGui.QIcon("share/plus16.png"))
_("Add"), lambda: self.on_tool_add(dia=None, muted=None),
icon=QtGui.QIcon(self.app.resource_location + "/plus16.png"))
self.tools_table.addContextMenu(
_("Delete"), lambda:
self.on_tool_delete(rows_to_delete=None, all=None), icon=QtGui.QIcon("share/delete32.png"))
self.on_tool_delete(rows_to_delete=None, all=None),
icon=QtGui.QIcon(self.app.resource_location + "/delete32.png")
)
try:
dias = [float(eval(dia)) for dia in self.app.defaults["tools_solderpaste_tools"].split(",") if dia != '']

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff