Reverting files wrongly committed with 5a974f824

This commit is contained in:
Yorik van Havre
2020-12-23 15:21:43 +01:00
parent 5a322d75cb
commit 799a2e1f5d
3 changed files with 16 additions and 127 deletions

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>266</width>
<height>691</height>
<width>453</width>
<height>424</height>
</rect>
</property>
<property name="windowTitle">
@@ -22,18 +22,6 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="comboBoxStyles">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>The name of your style. Existing style names can be edited.</string>
</property>
@@ -58,17 +46,11 @@
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
@@ -89,17 +71,11 @@
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
@@ -132,9 +108,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-58</y>
<width>233</width>
<height>624</height>
<y>-290</y>
<width>420</width>
<height>589</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -176,18 +152,6 @@
</item>
<item row="0" column="1">
<widget class="QFontComboBox" name="FontName">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>The font to use for texts and dimensions</string>
</property>
@@ -436,18 +400,6 @@
</item>
<item row="4" column="1">
<widget class="QComboBox" name="ArrowType">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>The type of arrows or markers to use at the end of dimension lines</string>
</property>
@@ -521,30 +473,6 @@
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButtonImport">
<property name="toolTip">
<string>Import styles from json file</string>
</property>
<property name="text">
<string>Import...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonExport">
<property name="toolTip">
<string>Export styles to json file</string>
</property>
<property name="text">
<string>Export...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>

View File

@@ -111,8 +111,6 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
self.form.pushButtonRename.setIcon(QtGui.QIcon(":/icons/accessories-text-editor.svg"))
self.form.pushButtonDelete.resize(self.form.pushButtonDelete.sizeHint())
self.form.pushButtonRename.resize(self.form.pushButtonRename.sizeHint())
self.form.pushButtonImport.setIcon(QtGui.QIcon(":/icons/Std_Import.svg"))
self.form.pushButtonExport.setIcon(QtGui.QIcon(":/icons/Std_Export.svg"))
# fill the styles combo
self.styles = self.read_meta()
@@ -123,8 +121,6 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
self.form.comboBoxStyles.currentIndexChanged.connect(self.on_style_changed)
self.form.pushButtonDelete.clicked.connect(self.on_delete)
self.form.pushButtonRename.clicked.connect(self.on_rename)
self.form.pushButtonImport.clicked.connect(self.on_import)
self.form.pushButtonExport.clicked.connect(self.on_export)
for attr in DEFAULT.keys():
control = getattr(self.form, attr)
for signal in ("clicked", "textChanged",
@@ -284,36 +280,6 @@ class AnnotationStyleEditor(gui_base.GuiCommandSimplest):
self.styles[newname] = value
self.renamed[style] = newname
def on_import(self):
"""imports styles from a json file"""
filename = QtGui.QFileDialog.getOpenFileName(
QtGui.QApplication.activeWindow(),
_tr("Draft","Open styles file"),
None,
_tr("Draft","JSON file (*.json)"))
if filename:
nstyles = json.load(filename[1])
if nstyles:
self.styles.update(nstyles)
self.form.comboBoxStyles.clear()
for style in self.styles.keys():
self.form.comboBoxStyles.addItem(style)
print("Styles updated from "+filename[0])
def on_export(self):
"""exports styles to a json file"""
filename = QtGui.QFileDialog.getSaveFileName(
QtGui.QApplication.activeWindow(),
_tr("Draft","Save styles file"),
None,
_tr("Draft","JSON file (*.json)"))
if filename:
json.dump(self.styles,filename[1])
print("Styles saved to "+filename[0])
def fill_editor(self, style):
"""Fill the editor fields with the contents of a style."""
if style is None: