-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgsapppluginmanagerinterface.cpp
79 lines (66 loc) · 2.64 KB
/
qgsapppluginmanagerinterface.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/***************************************************************************
qgsapppluginmanagerinterface.cpp
--------------------------------------
Date : 15-May-2013
Copyright : (C) 2013 by Borys Jurgiel
Email : info at borysjurgiel dot pl
****************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgsapppluginmanagerinterface.h"
#include "qgspluginmanager.h"
#include "qgslogger.h"
QgsAppPluginManagerInterface::QgsAppPluginManagerInterface( QgsPluginManager *pluginManager )
: mPluginManager( pluginManager )
{
}
void QgsAppPluginManagerInterface::showPluginManager( int tabIndex )
{
mPluginManager->getCppPluginsMetadata();
mPluginManager->reloadModelData();
//! switch to tab, if specified ( -1 means not specified )
if ( tabIndex > -1 )
{
mPluginManager->selectTabItem( tabIndex );
}
mPluginManager->exec();
}
void QgsAppPluginManagerInterface::clearPythonPluginMetadata()
{
mPluginManager->clearPythonPluginMetadata();
}
void QgsAppPluginManagerInterface::addPluginMetadata( const QMap<QString, QString> &metadata )
{
if ( metadata.isEmpty() || !metadata.contains( QStringLiteral( "id" ) ) )
{
QgsDebugError( QStringLiteral( "Warning: incomplete metadata" ) );
return;
}
mPluginManager->addPluginMetadata( metadata.value( QStringLiteral( "id" ) ), metadata );
}
void QgsAppPluginManagerInterface::reloadModel()
{
mPluginManager->reloadModelData();
}
const QMap<QString, QString> *QgsAppPluginManagerInterface::pluginMetadata( const QString &key ) const
{
return mPluginManager->pluginMetadata( key );
}
void QgsAppPluginManagerInterface::clearRepositoryList()
{
mPluginManager->clearRepositoryList();
}
void QgsAppPluginManagerInterface::addToRepositoryList( const QMap<QString, QString> &repository )
{
mPluginManager->addToRepositoryList( repository );
}
void QgsAppPluginManagerInterface::pushMessage( const QString &text, Qgis::MessageLevel level, int duration )
{
mPluginManager->pushMessage( text, level, duration );
}