diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 04048a5b..2c0d8635 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -539,6 +539,10 @@ class App(QtCore.QObject): self.ui.menuhelp_home.triggered.connect(lambda: webbrowser.open(self.app_url)) self.ui.menuhelp_manual.triggered.connect(lambda: webbrowser.open(self.manual_url)) # Toolbar + self.ui.open_gerber_btn.triggered.connect(self.on_fileopengerber) + self.ui.open_exc_btn.triggered.connect(self.on_fileopenexcellon) + self.ui.open_gcode_btn.triggered.connect(self.on_fileopengcode) + self.ui.save_btn.triggered.connect(self.on_file_saveprojectas) self.ui.zoom_fit_btn.triggered.connect(self.on_zoom_fit) self.ui.zoom_in_btn.triggered.connect(lambda: self.plotcanvas.zoom(1.5)) self.ui.zoom_out_btn.triggered.connect(lambda: self.plotcanvas.zoom(1 / 1.5)) @@ -569,10 +573,12 @@ class App(QtCore.QObject): ### Tools and Plugins ### ######################### self.dblsidedtool = DblSidedTool(self) - self.dblsidedtool.install() + self.dblsidedtool.install(icon=QtGui.QIcon('share:doubleside16.png')) self.measeurement_tool = Measurement(self) - self.measeurement_tool.install() + self.measeurement_tool.install(icon=QtGui.QIcon('share:measure16.png')) + + self.ui.measure_btn.triggered.connect(self.measeurement_tool.run) self.draw = FlatCAMDraw(self, disabled=True) diff --git a/FlatCAMDraw.py b/FlatCAMDraw.py index 57c1fdb6..0c2dffd2 100644 --- a/FlatCAMDraw.py +++ b/FlatCAMDraw.py @@ -690,25 +690,34 @@ class FlatCAMDraw(QtCore.QObject): self.axes = self.canvas.new_axes("draw") ### Drawing Toolbar ### - self.drawing_toolbar = QtGui.QToolBar() + self.drawing_toolbar = QtGui.QToolBar("Draw Toolbar") self.drawing_toolbar.setDisabled(disabled) self.app.ui.addToolBar(self.drawing_toolbar) + self.select_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:pointer32.png'), "Select 'Esc'") + # Separator + self.drawing_toolbar.addSeparator() self.add_circle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:circle32.png'), 'Add Circle') self.add_arc_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:arc32.png'), 'Add Arc') self.add_rectangle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:rectangle32.png'), 'Add Rectangle') self.add_polygon_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:polygon32.png'), 'Add Polygon') self.add_path_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:path32.png'), 'Add Path') + + # Separator + self.drawing_toolbar.addSeparator() self.union_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:union32.png'), 'Polygon Union') self.intersection_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:intersection32.png'), 'Polygon Intersection') self.subtract_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:subtract32.png'), 'Polygon Subtraction') self.cutpath_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:cutpath32.png'), 'Cut Path') + + # Separator + self.drawing_toolbar.addSeparator() self.move_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:move32.png'), "Move Objects 'm'") self.copy_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:copy32.png'), "Copy Objects 'c'") self.delete_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:deleteshape32.png'), "Delete Shape '-'") ### Snap Toolbar ### - self.snap_toolbar = QtGui.QToolBar() + self.snap_toolbar = QtGui.QToolBar("Grid Toolbar") self.grid_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share:grid32.png'), 'Snap to grid') self.grid_gap_x_entry = QtGui.QLineEdit() self.grid_gap_x_entry.setMaximumWidth(70) @@ -741,6 +750,8 @@ class FlatCAMDraw(QtCore.QObject): self.intersection_menuitem = self.menu.addAction(QtGui.QIcon('share:intersection16.png'), 'Polygon Intersection') # self.subtract_menuitem = self.menu.addAction(QtGui.QIcon('share:subtract16.png'), 'Polygon Subtraction') self.cutpath_menuitem = self.menu.addAction(QtGui.QIcon('share:cutpath16.png'), 'Cut Path') + # Add Separator + self.menu.addSeparator() # self.move_menuitem = self.menu.addAction(QtGui.QIcon('share:move16.png'), "Move Objects 'm'") # self.copy_menuitem = self.menu.addAction(QtGui.QIcon('share:copy16.png'), "Copy Objects 'c'") self.delete_menuitem = self.menu.addAction(QtGui.QIcon('share:deleteshape16.png'), "Delete Shape '-'") diff --git a/FlatCAMGUI.py b/FlatCAMGUI.py index bba9875b..0bebba02 100644 --- a/FlatCAMGUI.py +++ b/FlatCAMGUI.py @@ -28,13 +28,15 @@ class FlatCAMGUI(QtGui.QMainWindow): self.menufile = self.menu.addMenu('&File') # New - self.menufilenew = QtGui.QAction(QtGui.QIcon('share:file16.png'), '&New', self) + self.menufilenew = QtGui.QAction(QtGui.QIcon('share:file16.png'), '&New project', self) self.menufile.addAction(self.menufilenew) - # Open recent # Recent self.recent = self.menufile.addMenu(QtGui.QIcon('share:folder16.png'), "Open recent ...") + # Separator + self.menufile.addSeparator() + # Open gerber ... self.menufileopengerber = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Open &Gerber ...', self) self.menufile.addAction(self.menufileopengerber) @@ -51,6 +53,9 @@ class FlatCAMGUI(QtGui.QMainWindow): self.menufileopenproject = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Open &Project ...', self) self.menufile.addAction(self.menufileopenproject) + # Separator + self.menufile.addSeparator() + # Import SVG ... self.menufileimportsvg = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Import &SVG ...', self) self.menufile.addAction(self.menufileimportsvg) @@ -59,6 +64,9 @@ class FlatCAMGUI(QtGui.QMainWindow): self.menufileexportsvg = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Export &SVG ...', self) self.menufile.addAction(self.menufileexportsvg) + # Separator + self.menufile.addSeparator() + # Save Project self.menufilesaveproject = QtGui.QAction(QtGui.QIcon('share:floppy16.png'), '&Save Project', self) self.menufile.addAction(self.menufilesaveproject) @@ -75,21 +83,26 @@ class FlatCAMGUI(QtGui.QMainWindow): self.menufilesavedefaults = QtGui.QAction(QtGui.QIcon('share:floppy16.png'), 'Save &Defaults', self) self.menufile.addAction(self.menufilesavedefaults) + # Separator + self.menufile.addSeparator() + # Quit self.exit_action = QtGui.QAction(QtGui.QIcon('share:power16.png'), '&Exit', self) + self.menufile.addAction(self.exit_action) # exitAction.setShortcut('Ctrl+Q') # exitAction.setStatusTip('Exit application') #self.exit_action.triggered.connect(QtGui.qApp.quit) - self.menufile.addAction(self.exit_action) ### Edit ### self.menuedit = self.menu.addMenu('&Edit') self.menueditnew = self.menuedit.addAction(QtGui.QIcon('share:new_geo16.png'), 'New Geometry') self.menueditedit = self.menuedit.addAction(QtGui.QIcon('share:edit16.png'), 'Edit Geometry') self.menueditok = self.menuedit.addAction(QtGui.QIcon('share:edit_ok16.png'), 'Update Geometry') - #self.menueditok. - #self.menueditcancel = self.menuedit.addAction(QtGui.QIcon('share:cancel_edit16.png'), "Cancel Edit") + + # Separator + self.menuedit.addSeparator() + self.menueditjoin = self.menuedit.addAction(QtGui.QIcon('share:join16.png'), 'Join Geometry') self.menueditdelete = self.menuedit.addAction(QtGui.QIcon('share:trash16.png'), 'Delete') @@ -111,7 +124,7 @@ class FlatCAMGUI(QtGui.QMainWindow): self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share:replot16.png'), 'Enable all plots') ### Tool ### - #self.menutool = self.menu.addMenu('&Tool') + self.menutool = QtGui.QMenu('&Tool') self.menutoolaction = self.menu.addMenu(self.menutool) self.menutoolshell = self.menutool.addAction(QtGui.QIcon('share:shell16.png'), '&Command Line') @@ -125,21 +138,38 @@ class FlatCAMGUI(QtGui.QMainWindow): ############### ### Toolbar ### ############### - self.toolbar = QtGui.QToolBar() - self.addToolBar(self.toolbar) + self.toolbarfile = QtGui.QToolBar('File Toolbar') + self.addToolBar(self.toolbarfile) + self.open_gerber_btn = self.toolbarfile.addAction(QtGui.QIcon('share:flatcam_icon32.png'), "Open &Gerber") + self.open_exc_btn = self.toolbarfile.addAction(QtGui.QIcon('share:drill32.png'), "Open &Excellon") + self.open_gcode_btn = self.toolbarfile.addAction(QtGui.QIcon('share:cnc32.png'), "Open Gco&de") + self.save_btn = self.toolbarfile.addAction(QtGui.QIcon('share:floppy32.png'), 'Save Project &As ...') - self.zoom_fit_btn = self.toolbar.addAction(QtGui.QIcon('share:zoom_fit32.png'), "&Zoom Fit") - self.zoom_out_btn = self.toolbar.addAction(QtGui.QIcon('share:zoom_out32.png'), "&Zoom Out") - self.zoom_in_btn = self.toolbar.addAction(QtGui.QIcon('share:zoom_in32.png'), "&Zoom In") - self.clear_plot_btn = self.toolbar.addAction(QtGui.QIcon('share:clear_plot32.png'), "&Clear Plot") - self.replot_btn = self.toolbar.addAction(QtGui.QIcon('share:replot32.png'), "&Replot") - self.newgeo_btn = self.toolbar.addAction(QtGui.QIcon('share:new_geo32.png'), "New Blank Geometry") - self.editgeo_btn = self.toolbar.addAction(QtGui.QIcon('share:edit32.png'), "Edit Geometry") - self.updategeo_btn = self.toolbar.addAction(QtGui.QIcon('share:edit_ok32.png'), "Update Geometry") + self.toolbarview= QtGui.QToolBar('View Toolbar') + self.addToolBar(self.toolbarview) + self.zoom_fit_btn = self.toolbarview.addAction(QtGui.QIcon('share:zoom_fit32.png'), "&Zoom Fit") + self.zoom_out_btn = self.toolbarview.addAction(QtGui.QIcon('share:zoom_out32.png'), "&Zoom Out") + self.zoom_in_btn = self.toolbarview.addAction(QtGui.QIcon('share:zoom_in32.png'), "&Zoom In") + # Separator + self.toolbarview.addSeparator() + self.clear_plot_btn = self.toolbarview.addAction(QtGui.QIcon('share:clear_plot32.png'), "&Clear Plot") + self.replot_btn = self.toolbarview.addAction(QtGui.QIcon('share:replot32.png'), "&Replot") + + self.toolbareditobj = QtGui.QToolBar('Obj.Editor Toolbar') + self.addToolBar(self.toolbareditobj) + self.newgeo_btn = self.toolbareditobj.addAction(QtGui.QIcon('share:new_geo32.png'), "New Blank Geometry") + self.editgeo_btn = self.toolbareditobj.addAction(QtGui.QIcon('share:edit32.png'), "Edit Geometry") + self.updategeo_btn = self.toolbareditobj.addAction(QtGui.QIcon('share:edit_ok32.png'), "Update Geometry") self.updategeo_btn.setEnabled(False) - #self.canceledit_btn = self.toolbar.addAction(QtGui.QIcon('share:cancel_edit32.png'), "Cancel Edit") - self.delete_btn = self.toolbar.addAction(QtGui.QIcon('share:delete32.png'), "&Delete") - self.shell_btn = self.toolbar.addAction(QtGui.QIcon('share:shell32.png'), "&Command Line") + + self.toolbaredit = QtGui.QToolBar('Edit Toolbar') + self.addToolBar(self.toolbaredit) + self.delete_btn = self.toolbaredit.addAction(QtGui.QIcon('share:delete32.png'), "&Delete") + + self.toolbartools = QtGui.QToolBar('Tools Toolbar') + self.addToolBar(self.toolbartools) + self.shell_btn = self.toolbartools.addAction(QtGui.QIcon('share:shell32.png'), "&Command Line") + self.measure_btn = self.toolbartools.addAction(QtGui.QIcon('share:measure32.png'), "&Measurement Tool") ################ ### Splitter ### diff --git a/FlatCAMTool.py b/FlatCAMTool.py index 3bd856f7..9de65625 100644 --- a/FlatCAMTool.py +++ b/FlatCAMTool.py @@ -32,8 +32,11 @@ class FlatCAMTool(QtGui.QWidget): self.menuAction = None - def install(self): - self.menuAction = self.app.ui.menutool.addAction(self.toolName) + def install(self, icon=None): + if icon is None: + self.menuAction = self.app.ui.menutool.addAction(self.toolName) + else: + self.menuAction = self.app.ui.menutool.addAction(icon, self.toolName) self.menuAction.triggered.connect(self.run) def run(self): diff --git a/MeasurementTool.py b/MeasurementTool.py index f8396d0f..19e540ff 100644 --- a/MeasurementTool.py +++ b/MeasurementTool.py @@ -29,8 +29,8 @@ class Measurement(FlatCAMTool): self.click_subscription = None self.move_subscription = None - def install(self): - FlatCAMTool.install(self) + def install(self, icon=None): + FlatCAMTool.install(self, icon) self.app.ui.right_layout.addWidget(self) self.app.plotcanvas.mpl_connect('key_press_event', self.on_key_press) diff --git a/share/buffer16.png b/share/buffer16.png new file mode 100644 index 00000000..02bae3cb Binary files /dev/null and b/share/buffer16.png differ diff --git a/share/doubleside16.png b/share/doubleside16.png new file mode 100644 index 00000000..5dcc3b4a Binary files /dev/null and b/share/doubleside16.png differ diff --git a/share/doubleside32.png b/share/doubleside32.png new file mode 100644 index 00000000..001be1e7 Binary files /dev/null and b/share/doubleside32.png differ diff --git a/share/floppy32.png b/share/floppy32.png new file mode 100644 index 00000000..643f8228 Binary files /dev/null and b/share/floppy32.png differ diff --git a/share/paint16.png b/share/paint16.png new file mode 100644 index 00000000..63cf5398 Binary files /dev/null and b/share/paint16.png differ diff --git a/termwidget.py b/termwidget.py index 41433bed..80129750 100644 --- a/termwidget.py +++ b/termwidget.py @@ -132,7 +132,6 @@ class TermWidget(QWidget): self._edit.setPlainText("...proccessing... [%s]" % detail) self._edit.setDisabled(True) - self._edit.setFocus() def close_proccessing(self): """