diff --git a/b_asic/gui_utils/icons.py b/b_asic/gui_utils/icons.py index 54f02db18c3e7a8df02fb3569240fd81c1c22fb6..fb83e1f219b99bf8e4affc6f868ca4adb8c5cc6f 100644 --- a/b_asic/gui_utils/icons.py +++ b/b_asic/gui_utils/icons.py @@ -9,6 +9,7 @@ ICONS = { 'redo': 'mdi6.redo', 'new': 'mdi6.file-outline', 'open': 'mdi6.folder-open', + 'import': 'mdi6.import', 'legend': 'mdi6.map-legend', 'close': 'mdi6.close', 'all': 'mdi6.select-all', diff --git a/b_asic/scheduler_gui/main_window.py b/b_asic/scheduler_gui/main_window.py index 21f2b211a9101d47491696179f4fa519532d7c58..5b4d2f591cc7d76c1513b94b2bef9fd6bd3c31f0 100644 --- a/b_asic/scheduler_gui/main_window.py +++ b/b_asic/scheduler_gui/main_window.py @@ -132,8 +132,10 @@ class ScheduleMainWindow(QMainWindow, Ui_MainWindow): # Connect signals to slots self.menu_load_from_file.triggered.connect(self._load_schedule_from_pyfile) - self.menu_load_from_file.setIcon(get_icon('open')) + self.menu_load_from_file.setIcon(get_icon('import')) + self.menu_open.setIcon(get_icon('open')) self.menu_close_schedule.triggered.connect(self.close_schedule) + self.menu_close_schedule.setIcon(get_icon('close')) self.menu_save.triggered.connect(self.save) self.menu_save.setIcon(get_icon('save')) self.menu_save_as.triggered.connect(self.save_as) diff --git a/b_asic/scheduler_gui/main_window.ui b/b_asic/scheduler_gui/main_window.ui index 4eb76195e7d8c4930c601e62b1429833f47d8a91..a3ad6f2fa6ab5435d21aa5f3b70d0fb7d5c8b94b 100644 --- a/b_asic/scheduler_gui/main_window.ui +++ b/b_asic/scheduler_gui/main_window.ui @@ -211,13 +211,14 @@ </property> <widget class="QMenu" name="menu_Recent_Schedule"> <property name="title"> - <string>&Recent Schedule</string> + <string>&Open recent</string> </property> </widget> - <addaction name="menu_load_from_file"/> - <addaction name="menu_close_schedule"/> + <addaction name="menu_open"/> <addaction name="menu_save"/> <addaction name="menu_save_as"/> + <addaction name="menu_load_from_file"/> + <addaction name="menu_close_schedule"/> <addaction name="separator"/> <addaction name="menu_Recent_Schedule"/> <addaction name="separator"/> @@ -228,6 +229,7 @@ <string>&View</string> </property> <addaction name="menu_node_info"/> + <addaction name="actionToolbar"/> <addaction name="actionStatus_bar"/> <addaction name="separator"/> <addaction name="actionPlot_schedule"/> @@ -241,6 +243,7 @@ <addaction name="actionUndo"/> <addaction name="actionRedo"/> <addaction name="separator"/> + <addaction name="actionReorder"/> <addaction name="actionIncrease_time_resolution"/> <addaction name="actionDecrease_time_resolution"/> </widget> @@ -275,29 +278,32 @@ <attribute name="toolBarBreak"> <bool>false</bool> </attribute> - <addaction name="menu_load_from_file"/> + <addaction name="menu_open"/> <addaction name="menu_save"/> <addaction name="menu_save_as"/> <addaction name="separator"/> + <addaction name="actionUndo"/> + <addaction name="actionRedo"/> + <addaction name="separator"/> <addaction name="menu_node_info"/> <addaction name="actionReorder"/> </widget> <action name="menu_load_from_file"> <property name="icon"> <iconset theme="document-open-folder"> - <normaloff>.</normaloff>.</iconset> + <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset> </property> <property name="text"> - <string>&Load Schedule From File...</string> + <string>&Import schedule from file...</string> </property> <property name="toolTip"> - <string>Load schedule from python script</string> + <string>Import schedule from python script</string> </property> <property name="statusTip"> <string/> </property> <property name="shortcut"> - <string>Ctrl+O</string> + <string>Ctrl+I</string> </property> </action> <action name="menu_save"> @@ -306,7 +312,7 @@ </property> <property name="icon"> <iconset theme="document-save"> - <normaloff>.</normaloff>.</iconset> + <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset> </property> <property name="text"> <string>&Save</string> @@ -331,10 +337,10 @@ <normalon>:/icons/misc/right_filled_panel.svg</normalon>:/icons/misc/right_panel.svg</iconset> </property> <property name="text"> - <string>&Node Info</string> + <string>&Node info</string> </property> <property name="toolTip"> - <string>Show node information</string> + <string>Show(hide node information</string> </property> <property name="shortcut"> <string>Ctrl+I</string> @@ -346,7 +352,7 @@ <action name="menu_quit"> <property name="icon"> <iconset theme="application-exit"> - <normaloff>.</normaloff>.</iconset> + <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset> </property> <property name="text"> <string>&Quit</string> @@ -361,10 +367,13 @@ </property> <property name="icon"> <iconset theme="document-save-as"> - <normaloff>.</normaloff>.</iconset> + <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset> </property> <property name="text"> - <string>Save &As...</string> + <string>Save &as...</string> + </property> + <property name="toolTip"> + <string>Save schedule with new file name</string> </property> </action> <action name="menu_exit_dialog"> @@ -373,7 +382,7 @@ </property> <property name="icon"> <iconset theme="view-close"> - <normaloff>.</normaloff>.</iconset> + <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset> </property> <property name="text"> <string>&Hide exit dialog</string> @@ -382,31 +391,32 @@ <string>Hide exit dialog</string> </property> </action> - <action name="actionT"> - <property name="text"> - <string>T</string> - </property> - </action> <action name="menu_close_schedule"> <property name="enabled"> <bool>false</bool> </property> <property name="icon"> <iconset theme="view-close"> - <normaloff>.</normaloff>.</iconset> + <normaloff>../../../.designer/backup</normaloff>../../../.designer/backup</iconset> </property> <property name="text"> - <string>&Close Schedule</string> + <string>&Close schedule</string> </property> </action> <action name="actionAbout"> <property name="text"> - <string>About</string> + <string>&About</string> + </property> + <property name="toolTip"> + <string>Open about window</string> </property> </action> <action name="actionDocumentation"> <property name="text"> - <string>Documentation</string> + <string>&Documentation</string> + </property> + <property name="toolTip"> + <string>Open documentation</string> </property> </action> <action name="actionReorder"> @@ -419,6 +429,9 @@ </action> <action name="actionPlot_schedule"> <property name="text"> + <string>&Plot schedule</string> + </property> + <property name="toolTip"> <string>Plot schedule</string> </property> </action> @@ -429,6 +442,9 @@ <property name="text"> <string>Undo</string> </property> + <property name="shortcut"> + <string>Ctrl+Z</string> + </property> </action> <action name="actionRedo"> <property name="enabled"> @@ -437,6 +453,9 @@ <property name="text"> <string>Redo</string> </property> + <property name="shortcut"> + <string>Ctrl+R</string> + </property> </action> <action name="actionIncrease_time_resolution"> <property name="text"> @@ -450,7 +469,7 @@ </action> <action name="actionZoom_to_fit"> <property name="text"> - <string>Zoom to fit</string> + <string>Zoom to &fit</string> </property> </action> <action name="actionStatus_bar"> @@ -461,7 +480,35 @@ <bool>true</bool> </property> <property name="text"> - <string>Status bar</string> + <string>&Status bar</string> + </property> + <property name="toolTip"> + <string>Show/hide status bar</string> + </property> + </action> + <action name="actionToolbar"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="text"> + <string>&Toolbar</string> + </property> + <property name="toolTip"> + <string>Show/hide toolbar</string> + </property> + </action> + <action name="menu_open"> + <property name="text"> + <string>Open...</string> + </property> + <property name="toolTip"> + <string>Open previously saved schedule</string> + </property> + <property name="shortcut"> + <string>Ctrl+O</string> </property> </action> </widget> diff --git a/b_asic/scheduler_gui/ui_main_window.py b/b_asic/scheduler_gui/ui_main_window.py index 4cf895d686c563be308e06f51375a7f34c847911..d985e9ed6eeb39b63a716254ba268d74ca2838f2 100644 --- a/b_asic/scheduler_gui/ui_main_window.py +++ b/b_asic/scheduler_gui/ui_main_window.py @@ -189,8 +189,6 @@ class Ui_MainWindow(object): icon = QtGui.QIcon.fromTheme("view-close") self.menu_exit_dialog.setIcon(icon) self.menu_exit_dialog.setObjectName("menu_exit_dialog") - self.actionT = QtWidgets.QAction(MainWindow) - self.actionT.setObjectName("actionT") self.menu_close_schedule = QtWidgets.QAction(MainWindow) self.menu_close_schedule.setEnabled(False) icon = QtGui.QIcon.fromTheme("view-close") @@ -224,15 +222,23 @@ class Ui_MainWindow(object): self.actionStatus_bar.setCheckable(True) self.actionStatus_bar.setChecked(True) self.actionStatus_bar.setObjectName("actionStatus_bar") - self.menuFile.addAction(self.menu_load_from_file) - self.menuFile.addAction(self.menu_close_schedule) + self.actionToolbar = QtWidgets.QAction(MainWindow) + self.actionToolbar.setCheckable(True) + self.actionToolbar.setChecked(True) + self.actionToolbar.setObjectName("actionToolbar") + self.menu_open = QtWidgets.QAction(MainWindow) + self.menu_open.setObjectName("menu_open") + self.menuFile.addAction(self.menu_open) self.menuFile.addAction(self.menu_save) self.menuFile.addAction(self.menu_save_as) + self.menuFile.addAction(self.menu_load_from_file) + self.menuFile.addAction(self.menu_close_schedule) self.menuFile.addSeparator() self.menuFile.addAction(self.menu_Recent_Schedule.menuAction()) self.menuFile.addSeparator() self.menuFile.addAction(self.menu_quit) self.menuView.addAction(self.menu_node_info) + self.menuView.addAction(self.actionToolbar) self.menuView.addAction(self.actionStatus_bar) self.menuView.addSeparator() self.menuView.addAction(self.actionPlot_schedule) @@ -241,6 +247,7 @@ class Ui_MainWindow(object): self.menu_Edit.addAction(self.actionUndo) self.menu_Edit.addAction(self.actionRedo) self.menu_Edit.addSeparator() + self.menu_Edit.addAction(self.actionReorder) self.menu_Edit.addAction(self.actionIncrease_time_resolution) self.menu_Edit.addAction(self.actionDecrease_time_resolution) self.menuWindow.addAction(self.menu_exit_dialog) @@ -252,10 +259,13 @@ class Ui_MainWindow(object): self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuWindow.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) - self.toolBar.addAction(self.menu_load_from_file) + self.toolBar.addAction(self.menu_open) self.toolBar.addAction(self.menu_save) self.toolBar.addAction(self.menu_save_as) self.toolBar.addSeparator() + self.toolBar.addAction(self.actionUndo) + self.toolBar.addAction(self.actionRedo) + self.toolBar.addSeparator() self.toolBar.addAction(self.menu_node_info) self.toolBar.addAction(self.actionReorder) @@ -280,48 +290,67 @@ class Ui_MainWindow(object): item.setText(_translate("MainWindow", "Operator")) self.info_table.setSortingEnabled(__sortingEnabled) self.menuFile.setTitle(_translate("MainWindow", "&File")) - self.menu_Recent_Schedule.setTitle(_translate("MainWindow", "&Recent Schedule")) + self.menu_Recent_Schedule.setTitle(_translate("MainWindow", "&Open recent")) self.menuView.setTitle(_translate("MainWindow", "&View")) self.menu_Edit.setTitle(_translate("MainWindow", "&Edit")) self.menuWindow.setTitle(_translate("MainWindow", "&Window")) self.menuHelp.setTitle(_translate("MainWindow", "&Help")) self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) self.menu_load_from_file.setText( - _translate("MainWindow", "&Load Schedule From File...") + _translate("MainWindow", "&Import schedule from file...") ) self.menu_load_from_file.setToolTip( - _translate("MainWindow", "Load schedule from python script") + _translate("MainWindow", "Import schedule from python script") ) - self.menu_load_from_file.setShortcut(_translate("MainWindow", "Ctrl+O")) + self.menu_load_from_file.setShortcut(_translate("MainWindow", "Ctrl+I")) self.menu_save.setText(_translate("MainWindow", "&Save")) self.menu_save.setToolTip(_translate("MainWindow", "Save schedule")) self.menu_save.setShortcut(_translate("MainWindow", "Ctrl+S")) - self.menu_node_info.setText(_translate("MainWindow", "&Node Info")) + self.menu_node_info.setText(_translate("MainWindow", "&Node info")) self.menu_node_info.setToolTip( - _translate("MainWindow", "Show node information") + _translate("MainWindow", "Show(hide node information") ) self.menu_node_info.setShortcut(_translate("MainWindow", "Ctrl+I")) self.menu_quit.setText(_translate("MainWindow", "&Quit")) self.menu_quit.setShortcut(_translate("MainWindow", "Ctrl+Q")) - self.menu_save_as.setText(_translate("MainWindow", "Save &As...")) + self.menu_save_as.setText(_translate("MainWindow", "Save &as...")) + self.menu_save_as.setToolTip( + _translate("MainWindow", "Save schedule with new file name") + ) self.menu_exit_dialog.setText(_translate("MainWindow", "&Hide exit dialog")) self.menu_exit_dialog.setToolTip(_translate("MainWindow", "Hide exit dialog")) - self.actionT.setText(_translate("MainWindow", "T")) - self.menu_close_schedule.setText(_translate("MainWindow", "&Close Schedule")) - self.actionAbout.setText(_translate("MainWindow", "About")) - self.actionDocumentation.setText(_translate("MainWindow", "Documentation")) + self.menu_close_schedule.setText(_translate("MainWindow", "&Close schedule")) + self.actionAbout.setText(_translate("MainWindow", "&About")) + self.actionAbout.setToolTip(_translate("MainWindow", "Open about window")) + self.actionDocumentation.setText(_translate("MainWindow", "&Documentation")) + self.actionDocumentation.setToolTip( + _translate("MainWindow", "Open documentation") + ) self.actionReorder.setText(_translate("MainWindow", "Reorder")) self.actionReorder.setToolTip( _translate("MainWindow", "Reorder schedule based on start time") ) - self.actionPlot_schedule.setText(_translate("MainWindow", "Plot schedule")) + self.actionPlot_schedule.setText(_translate("MainWindow", "&Plot schedule")) + self.actionPlot_schedule.setToolTip(_translate("MainWindow", "Plot schedule")) self.actionUndo.setText(_translate("MainWindow", "Undo")) + self.actionUndo.setShortcut(_translate("MainWindow", "Ctrl+Z")) self.actionRedo.setText(_translate("MainWindow", "Redo")) + self.actionRedo.setShortcut(_translate("MainWindow", "Ctrl+R")) self.actionIncrease_time_resolution.setText( _translate("MainWindow", "Increase time resolution...") ) self.actionDecrease_time_resolution.setText( _translate("MainWindow", "Decrease time resolution...") ) - self.actionZoom_to_fit.setText(_translate("MainWindow", "Zoom to fit")) - self.actionStatus_bar.setText(_translate("MainWindow", "Status bar")) + self.actionZoom_to_fit.setText(_translate("MainWindow", "Zoom to &fit")) + self.actionStatus_bar.setText(_translate("MainWindow", "&Status bar")) + self.actionStatus_bar.setToolTip( + _translate("MainWindow", "Show/hide status bar") + ) + self.actionToolbar.setText(_translate("MainWindow", "&Toolbar")) + self.actionToolbar.setToolTip(_translate("MainWindow", "Show/hide toolbar")) + self.menu_open.setText(_translate("MainWindow", "Open...")) + self.menu_open.setToolTip( + _translate("MainWindow", "Open previously saved schedule") + ) + self.menu_open.setShortcut(_translate("MainWindow", "Ctrl+O"))