Addon Manager: Implement content addition dialogs

This commit is contained in:
Chris Hennes
2022-09-01 20:47:37 -05:00
parent 669d0ac13b
commit 5087b6ca5c
10 changed files with 1462 additions and 380 deletions

View File

@@ -1,75 +1,191 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<class>addContentDialog</class>
<widget class="QDialog" name="addContentDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>641</width>
<height>388</height>
<width>642</width>
<height>593</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Content Item</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="toolTip">
<string>If this is the only thing in the Addon, all other metadata can be inherited from the top level, and does not need to be specified here.</string>
</property>
<property name="text">
<string>This workbench is the only item in the Addon</string>
</property>
<property name="checked">
<bool>true</bool>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Content type:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="addonKindComboBox">
<item>
<property name="text">
<string>Macro</string>
</property>
</item>
<item>
<property name="text">
<string>Preference Pack</string>
</property>
</item>
<item>
<property name="text">
<string>Workbench</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="singletonCheckBox">
<property name="toolTip">
<string>If this is the only thing in the Addon, all other metadata can be inherited from the top level, and does not need to be specified here.</string>
</property>
<property name="text">
<string>This is the only item in the Addon</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="Macro">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Main macro file</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="macroFileLineEdit">
<property name="placeholderText">
<string>The file with the macro's metadata in it</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="macroFileBrowseButton">
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="PreferencePack">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Preference Pack Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="prefPackNameLineEdit"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Workbench">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Workbench class name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="workbenchClassnameLineEdit">
<property name="placeholderText">
<string>Class that defines &quot;Icon&quot; data member</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Class name</string>
<string>Subdirectory</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="subdirectoryLineEdit">
<property name="placeholderText">
<string>Optional, defaults to name of content item</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="subdirectoryBrowseButton">
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Path</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_3"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Icon</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="iconLabel">
<property name="text">
<string>actualIcon</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_2"/>
<widget class="QLineEdit" name="iconLineEdit">
<property name="placeholderText">
<string>Optional, defaults to inheriting from top-level Addon</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="iconBrowseButton">
<property name="text">
<string>Browse...</string>
</property>
@@ -82,14 +198,21 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButton_2">
<widget class="QPushButton" name="tagsButton">
<property name="text">
<string>Tags...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="dependenciesButton">
<property name="text">
<string>Dependencies...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<widget class="QPushButton" name="freecadVersionsButton">
<property name="text">
<string>FreeCAD Versions...</string>
</property>
@@ -111,207 +234,304 @@
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<spacer name="otherMetadataSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="otherMetadataGroupBox">
<property name="title">
<string>Other Metadata</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="5" column="0">
<widget class="QLabel" name="labelLicensePath">
<property name="text">
<string>License file path</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="descriptionLineEdit">
<property name="toolTip">
<string>Explanation of what this Addon provides. Displayed in the Addon Manager. It is not necessary for this to state that this is a FreeCAD Addon.</string>
</property>
</widget>
</item>
<item row="4" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QComboBox" name="licenseComboBox"/>
</item>
<item>
<widget class="QLineEdit" name="otherLicenseLineEdit"/>
</item>
</layout>
</item>
<item row="5" column="2">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="licenseFilePathLineEdit"/>
</item>
<item>
<widget class="QPushButton" name="licenseFilePathBrowse">
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="licenseCreateButton">
<property name="text">
<string>Create...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="labelMaintainerName">
<property name="text">
<string>Primary maintainer name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="maintainerNameLineEdit"/>
</item>
<item>
<widget class="QLabel" name="labelContactEmail">
<property name="text">
<string>Contact email</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="maintainerEmailLineEdit"/>
</item>
<item>
<widget class="QPushButton" name="addPeopleButton">
<property name="text">
<string>Add additional people</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelVersion">
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item row="1" column="1">
<widget class="QLineEdit" name="displayNameLineEdit">
<property name="toolTip">
<string>Displayed in the Addon Manager's list of Addons. Should not include the word &quot;FreeCAD&quot;.</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelLicense">
<property name="text">
<string>License</string>
<item row="2" column="1">
<widget class="QPlainTextEdit" name="plainTextEdit">
<property name="tabChangesFocus">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<widget class="QLabel" name="labelVersion">
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelDescription">
<property name="text">
<string>Description</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QComboBox" name="versionTypeComboBox">
<item>
<property name="text">
<string>Semantic (e.g. 1.2.3-beta)</string>
</property>
</item>
<item>
<property name="text">
<string>CalVer (e.g. 2021.12.08)</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="versionMajorLabel">
<property name="text">
<string>Y:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="versionMajorSpinBox"/>
</item>
<item>
<widget class="QLabel" name="versionMinorLabel">
<property name="text">
<string>M:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="versionMinorSpinBox"/>
</item>
<item>
<widget class="QLabel" name="versionPatchLabel">
<property name="text">
<string>D:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="versionPatchSpinBox"/>
</item>
<item>
<widget class="QLabel" name="versionSuffixDashLabel">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="versionSuffixLineEdit">
<widget class="QLineEdit" name="versionLineEdit">
<property name="placeholderText">
<string>(optional suffix)</string>
<string>Semantic (1.2.3-beta) or CalVer (2022.08.30) styles supported</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="versionToTodayButton">
<property name="text">
<string>Set to today</string>
<string>Set to today (CalVer style)</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="labelDisplayName">
<property name="text">
<string>Display Name</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="peopleAndLicenseshorizontalLayout">
<item>
<widget class="QGroupBox" name="peopleGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>People</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutPeople">
<item>
<widget class="QTableWidget" name="peopleTableWidget">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="columnCount">
<number>3</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>75</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>Kind</string>
</property>
</column>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Email</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutPeople">
<item>
<spacer name="horizontalSpacerPeople">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="addPersonToolButton">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="removePersonToolButton">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="licensesGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Licenses</string>
</property>
<layout class="QVBoxLayout" name="verticalLayoutLicenses">
<item>
<widget class="QTableWidget" name="licensesTableWidget">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="columnCount">
<number>2</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
<attribute name="horizontalHeaderDefaultSectionSize">
<number>60</number>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string>License</string>
</property>
</column>
<column>
<property name="text">
<string>License file</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutLicenses">
<item>
<spacer name="horizontalSpacer_Licenses">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="addLicenseToolButton">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="removeLicenseToolButton">
<property name="text">
<string>...</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<weight>50</weight>
<italic>true</italic>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Any fields left blank are inherited from the top-level Addon metadata, so technically they are all optional. For Addons with multiple content items, each item should provide a unique Display Name and Description.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
@@ -329,7 +549,7 @@
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</receiver>
<receiver>addContentDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
@@ -345,7 +565,7 @@
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<receiver>addContentDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
@@ -358,5 +578,37 @@
</hint>
</hints>
</connection>
<connection>
<sender>addonKindComboBox</sender>
<signal>currentIndexChanged(int)</signal>
<receiver>stackedWidget</receiver>
<slot>setCurrentIndex(int)</slot>
<hints>
<hint type="sourcelabel">
<x>134</x>
<y>19</y>
</hint>
<hint type="destinationlabel">
<x>320</x>
<y>83</y>
</hint>
</hints>
</connection>
<connection>
<sender>singletonCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>otherMetadataGroupBox</receiver>
<slot>setHidden(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>394</x>
<y>19</y>
</hint>
<hint type="destinationlabel">
<x>320</x>
<y>294</y>
</hint>
</hints>
</connection>
</connections>
</ui>