Skip to content

Commit

Permalink
ENH: add ToolTable edit dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtJacobson committed Feb 19, 2019
1 parent b00abc0 commit 56cbc7b
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 0 deletions.
165 changes: 165 additions & 0 deletions qtpyvcp/widgets/dialogs/tooledit_dialog.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit ToolTable</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="ToolTable" name="tooltable"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Add Tool</string>
</property>
<property name="icon">
<iconset theme="add"/>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>Remove Tool</string>
</property>
<property name="icon">
<iconset theme="remove"/>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>Reload Table</string>
</property>
<property name="icon">
<iconset theme="view-refresh"/>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_4">
<property name="text">
<string>Save Changes</string>
</property>
<property name="icon">
<iconset theme="object-select"/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ToolTable</class>
<extends>QTableView</extends>
<header>qtpyvcp.widgets.input_widgets.tool_table</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>pushButton_4</sender>
<signal>clicked()</signal>
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>649</x>
<y>377</y>
</hint>
<hint type="destinationlabel">
<x>535</x>
<y>320</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton</sender>
<signal>clicked()</signal>
<receiver>tooltable</receiver>
<slot>addTool()</slot>
<hints>
<hint type="sourcelabel">
<x>117</x>
<y>376</y>
</hint>
<hint type="destinationlabel">
<x>106</x>
<y>305</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton_2</sender>
<signal>clicked()</signal>
<receiver>tooltable</receiver>
<slot>deleteSelectedTool()</slot>
<hints>
<hint type="sourcelabel">
<x>308</x>
<y>376</y>
</hint>
<hint type="destinationlabel">
<x>308</x>
<y>314</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton_3</sender>
<signal>clicked()</signal>
<receiver>tooltable</receiver>
<slot>loadToolTable()</slot>
<hints>
<hint type="sourcelabel">
<x>500</x>
<y>378</y>
</hint>
<hint type="destinationlabel">
<x>495</x>
<y>260</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushButton_4</sender>
<signal>clicked()</signal>
<receiver>tooltable</receiver>
<slot>saveToolTable()</slot>
<hints>
<hint type="sourcelabel">
<x>697</x>
<y>372</y>
</hint>
<hint type="destinationlabel">
<x>696</x>
<y>324</y>
</hint>
</hints>
</connection>
</connections>
</ui>
5 changes: 5 additions & 0 deletions qtpyvcp/yaml_lib/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ dialogs:
set_work_offsets:
provider: qtpyvcp.widgets.dialogs.offsets_dialog:OffsetsDialog

tool_edit:
provider: qtpyvcp.widgets.dialogs.base_dialog:BaseDialog
kwargs:
ui_file: {{ file.dir }}/../widgets/dialogs/tooledit_dialog.ui

probe_sim:
provider: qtpyvcp.widgets.dialogs.probesim_dialog:ProbeSim

Expand Down
6 changes: 6 additions & 0 deletions qtpyvcp/yaml_lib/default_menubar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ default_menubar:

- separator

- title: "Edit ToolTable"
action: win.showDialog
args: tool_edit

- separator

- title: Exit
action: app.exit # or win.close
shortcut: ctrl+q
Expand Down

0 comments on commit 56cbc7b

Please # to comment.