Addon Manager: Rework backend to use package.xml

This shifts to use the model-view-controller pattern for the list of addons,
and moves to using a full model class rather than an indexed array for the
data storage and management. This enables much more information to be stored
as part of the new AddonManagerRepo data type. It now wraps the Macro class
for macros, supports Preference Packs, and provides access to the Metadata
object.
This commit is contained in:
Chris Hennes
2021-10-10 14:40:02 -05:00
parent 1844a0161e
commit 768a0f086f
9 changed files with 2166 additions and 874 deletions

View File

@@ -28,40 +28,105 @@
<widget class="QWidget" name="verticalLayoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Show packages containing:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboPackageType">
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>Workbenches</string>
</property>
</item>
<item>
<property name="text">
<string>Macros</string>
</property>
</item>
<item>
<property name="text">
<string>Preference Packs</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="lineEditFilter">
<property name="placeholderText">
<string>Filter</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelFilterValidity">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableView" name="tablePackages">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Workbenches</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QListWidget" name="listWorkbenches"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Macros</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QListWidget" name="listMacros"/>
</item>
<item>
<widget class="QPushButton" name="buttonExecute">
<property name="toolTip">
<string>Executes the selected macro, if installed</string>
</property>
<property name="text">
<string>Execute</string>
</property>
</widget>
</item>
</layout>
</widget>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>16</number>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderMinimumSectionSize">
<number>12</number>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>16</number>
</attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
@@ -95,13 +160,125 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="labelIcon">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="baseSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string>Icon</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="labelPackageName">
<property name="text">
<string>&lt;h1&gt;Package Name&lt;/h1&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelVersion">
<property name="text">
<string>&lt;em&gt;Version&lt;/em&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelMaintainer">
<property name="text">
<string>Maintainer</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelDescription">
<property name="text">
<string>Description</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="urlGrid">
<item row="0" column="0">
<widget class="QLabel" name="labelUrlType">
<property name="text">
<string>URL Type</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelUrl">
<property name="text">
<string>Url</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="labelContents">
<property name="text">
<string>Package contents:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="description"/>
</item>
<item>
<widget class="QPushButton" name="buttonExecute">
<property name="text">
<string>Run Macro</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="labelStatusInfo">
<property name="text">
<string>labelStatusInfo</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@@ -109,6 +286,9 @@
<property name="value">
<number>24</number>
</property>
<property name="textVisible">
<bool>false</bool>
</property>
<property name="format">
<string>Downloading info...</string>
</property>