<div dir="ltr">Hey Borys,<div><br></div><div style>That looks bloody great!  Going to give it a test soon.</div><div style><br></div><div style>- Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Mon, May 27, 2013 at 10:23 PM, Borys Jurgiel <span dir="ltr"><<a href="mailto:lists@borysjurgiel.pl" target="_blank">lists@borysjurgiel.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi All,<br>
<br>
The new manager is ready. Here is a screenshot for impatient ones :)<br>
<a href="http://tmp.borysjurgiel.pl/manager4.png" target="_blank">http://tmp.borysjurgiel.pl/manager4.png</a><br>
<br>
The code is in a branch "newmanager":<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771</a><br>


<br>
As it affects a number of classes, please review the architecture summary<br>
below and if there is no veto, it's ready to be merged to master. Otherewise I'll<br>
make requested changes before merging.<br>
<br>
<br>
*QgsPluginItem*<br>
==========<br>
Removed. It only used in the old manager and wasn't usefull anymore.<br>
<br>
<br>
<br>
*QgsDetailedItemData, QgsDetailedItemDelegate and QgsDetailedItemWidget*<br>
==========<br>
Untouched. It was used in the old manager and Grass Plugin, now it's used<br>
exclusively by Grass Plugin.<br>
<br>
<br>
<br>
*QgsPluginMedatadata*<br>
==========<br>
Untouched, however I propose to rename it to QgsPluginItem or QgsPluginRegistryItem<br>
for consistency. It's only used in QgsPluginRegistry and it mainly conatains<br>
pointers to loaded plugins instances, while its name may imply a rich metadata<br>
map. If some day during QGIS 2.x lifetime the Manager will need a separate class<br>
for storing rich metadata (now QMap is enough), and it would be nice to use this name.<br>
<br>
<br>
<br>
*QgsPluginRegistry*<br>
==========<br>
Info: This class is a registry for instances of lodaded plugins. It has nothing to to<br>
with metadata and it works independently from the manager, just by restoring<br>
session plugins from QSettings. Manager only calls its method to load and unload plugins.<br>
<br>
Small change: as it already had methods loadCppPlugin() and loadPythonPlugin(),<br>
I've added also unloadCppPlugin() and unloadPythonPlugin() too keep the<br>
loading/unloading stuff in one place.<br>
<br>
Diff:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgspluginregistry.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgspluginregistry.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgspluginregistry.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgspluginregistry.cpp</a><br>


<br>
<br>
<br>
*QgsPluginManager*<br>
==========<br>
Completely rewritten and moved to src/app/pluginmanager/ subdirectory<br>
class for the dialog window. Important facts:<br>
<br>
1) It keeps plugin metadata registry just in nested QMap:<br>
QMap< QString, QMap<QString,QString> >   mPlugins;<br>
<br>
where the first key is library/module basename, and the second one is attribute<br>
name. There was no need to create a separate class for storing metadata,<br>
however, some day it may become convinient to create a class called QgsPluginMedatadata.<br>
For this reason I propose to rename the current QgsPluginMedatadata<br>
(what actually has nothing to do with metadata) before releasing QGIS 2.0.<br>
The list of used attributes is provided in the "metadata" file and it's an unification<br>
of existing fields from repository xml, metadata.txt, the old installer and c++ plugins.<br>
QgsPluginManager populates this field (let's call it metadata registry) with<br>
c++ plugins when the window is opened. On the contrary, Python plugins<br>
are handled on Python's side and they are appended to mPlugins by API.<br>
<br>
2) The plugin list view uses QStandardItemModel populated from mPlugins<br>
and also QgsPluginSortFilterProxyModel for filtering and sorting.<br>
<br>
3) The html metadata browser is quite simple, and we can extend it in QGIS 2.1.<br>
For example, some tags can be clickable and set a new filter (filter by clicked<br>
author/tag/status). Also the separate buttons Install/Uninstall can be<br>
implemented by html "buttonsm", and the popup dialog with installation progress<br>
can be replaced by animated image (this way we don't freeze the gui when installing).<br>
<br>
Code:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginmanager.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginmanager.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginmanager.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginmanager.cpp</a><br>


<br>
<br>
<br>
*QgsPluginSortFilterProxyModel*<br>
==========<br>
New class: just a sort-filter proxy for the metadata. Filtering is done by status<br>
in the left list as well as name/description/tags/author in the filter input line.<br>
Sorting is done by rightclicking on the list. Foltering and sorting is based<br>
on a few user data roles. I tried to read necessary data from mPlugins everytime,<br>
but it affected the performance too much.<br>
<br>
Code:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginsortfilterproxymodel.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginsortfilterproxymodel.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginsortfilterproxymodel.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgspluginsortfilterproxymodel.cpp</a><br>


<br>
<br>
<br>
*QgsAppPluginManagerInterface, QgsPluginManagerInterface and SIP binding*<br>
==========<br>
New classes: just the interface to QgsPluginManager. Is's exactly based<br>
on the existing Qgs(App)LegendInterface<br>
<br>
Code:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/python/gui/qgspluginmanagerinterface.sip" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/python/gui/qgspluginmanagerinterface.sip</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/gui/qgspluginmanagerinterface.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/gui/qgspluginmanagerinterface.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/gui/qgspluginmanagerinterface.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/gui/qgspluginmanagerinterface.cpp</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgsapppluginmanagerinterface.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgsapppluginmanagerinterface.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgsapppluginmanagerinterface.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/entry/src/app/pluginmanager/qgsapppluginmanagerinterface.cpp</a><br>


<br>
<br>
<br>
QgisApp<br>
==========<br>
Small change: initialize the QgsPluginManager and Python module<br>
pyplugin_installer in the constructor. Only open the QgsPluginManager window<br>
when called from the main menu.<br>
<br>
Diff:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisapp.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisapp.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisapp.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisapp.cpp</a><br>


<br>
<br>
QgisAppInterface and QgisInterface and SIP binding<br>
==========<br>
Small change: instantiate Qgs(App)PluginManagerInterface<br>
exactly the same way as Qgs(App)LegendInterface<br>
<br>
Diff:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisappinterface.h" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisappinterface.h</a><br>


<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisappinterface.cpp" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/diff/src/app/qgisappinterface.cpp</a><br>


<br>
<br>
<br>
pyplugin_installer Python module<br>
==========<br>
New python module in python/pyplugin_installer. It contains just slightly refactored<br>
code of the old plugin_installer plugin and provides backend for handling Python<br>
plugis, e.g.: fetching remote repositories, loading installed plugin metadata, finding<br>
upgradeable plugins, (un)installing python plugins etc. It's methods are called from<br>
QgsPluginManager and it calls QgsPluginManager methods via QgsPluginManagerInterface.<br>
<br>
Code:<br>
<a href="http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/show/python/pyplugin_installer" target="_blank">http://hub.qgis.org/projects/quantum-gis/repository/revisions/5ee09d362148c411047a0fc7bc22679d9989f771/show/python/pyplugin_installer</a><br>


<br>
<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br></div>