mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-19 00:04:52 -04:00
[PluginManager] Move title pages for tabs to the resources. Will be included to translations when the contents is ready.
This commit is contained in:
parent
b3e5e629b5
commit
c490688106
1
resources/plugin_manager/get_more_plugins
Normal file
1
resources/plugin_manager/get_more_plugins
Normal file
@ -0,0 +1 @@
|
|||||||
|
Here we have <b>not yet installed</b> plugins. You can download whatever you want.
|
1
resources/plugin_manager/installed_plugins
Normal file
1
resources/plugin_manager/installed_plugins
Normal file
@ -0,0 +1 @@
|
|||||||
|
Here are <b>installed plugins</b>. To <i>enable</i> or <i>disable</i> plugin, click its checkbox or doubleclick its name...
|
3
resources/plugin_manager/invalid_plugins
Normal file
3
resources/plugin_manager/invalid_plugins
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Plugins here are <b>broken, incompatible or disappointed</b>.<br/><br/>
|
||||||
|
|
||||||
|
<font size="2">How a plugin can be disappointed? Ha ha! We promised them plenty Python modules they need to run, but we sold them and now you probably need to install them manually.</font>
|
1
resources/plugin_manager/new_plugins
Normal file
1
resources/plugin_manager/new_plugins
Normal file
@ -0,0 +1 @@
|
|||||||
|
Here are hot <b>news</b>. They are not yet installed plugins that are seen for the first time.
|
1
resources/plugin_manager/upgradeable_plugins
Normal file
1
resources/plugin_manager/upgradeable_plugins
Normal file
@ -0,0 +1 @@
|
|||||||
|
Here are <b>upgradeable plugins</b>. It means more recent versions of installed plugins are available somewhere over the Internet (and I know where!).
|
@ -28,6 +28,7 @@
|
|||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <QActionGroup>
|
#include <QActionGroup>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
#include "qgis.h"
|
#include "qgis.h"
|
||||||
#include "qgsapplication.h"
|
#include "qgsapplication.h"
|
||||||
@ -82,8 +83,6 @@ QgsPluginManager::QgsPluginManager( QWidget * parent, Qt::WFlags fl )
|
|||||||
vwPlugins->setFocus();
|
vwPlugins->setFocus();
|
||||||
|
|
||||||
// Preset widgets
|
// Preset widgets
|
||||||
QString wellcomeMsg = tr( "To enable or disable plugin, click its checkbox or doubleclick its name..." );
|
|
||||||
tbDetails->setHtml( wellcomeMsg );
|
|
||||||
leFilter->setFocus( Qt::MouseFocusReason );
|
leFilter->setFocus( Qt::MouseFocusReason );
|
||||||
rbFilterNames->setChecked( true );
|
rbFilterNames->setChecked( true );
|
||||||
|
|
||||||
@ -894,32 +893,55 @@ void QgsPluginManager::setCurrentTab( int idx )
|
|||||||
mOptionsStackedWidget->setCurrentIndex( 0 );
|
mOptionsStackedWidget->setCurrentIndex( 0 );
|
||||||
|
|
||||||
QStringList acceptedStatuses;
|
QStringList acceptedStatuses;
|
||||||
|
QString welcomePage;
|
||||||
switch ( idx )
|
switch ( idx )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
// installed (statuses ends with Z are for spacers to always sort properly)
|
// installed (statuses ends with Z are for spacers to always sort properly)
|
||||||
acceptedStatuses << "installed" << "orphan" << "newer" << "upgradeable" << "installedZ" << "upgradeableZ" << "orphanZ" << "newerZZ" << "" ;
|
acceptedStatuses << "installed" << "orphan" << "newer" << "upgradeable" << "installedZ" << "upgradeableZ" << "orphanZ" << "newerZZ" << "" ;
|
||||||
|
welcomePage = "installed_plugins";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// not installed (get more)
|
// not installed (get more)
|
||||||
acceptedStatuses << "not installed" << "new" ;
|
acceptedStatuses << "not installed" << "new" ;
|
||||||
|
welcomePage = "get_more_plugins";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// upgradeable
|
// upgradeable
|
||||||
acceptedStatuses << "upgradeable" ;
|
acceptedStatuses << "upgradeable" ;
|
||||||
|
welcomePage = "upgradeable_plugins";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
// new
|
// new
|
||||||
acceptedStatuses << "new" ;
|
acceptedStatuses << "new" ;
|
||||||
|
welcomePage = "new_plugins";
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
// invalid
|
// invalid
|
||||||
acceptedStatuses << "invalid" ;
|
acceptedStatuses << "invalid" ;
|
||||||
|
welcomePage = "invalid_plugins";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mModelProxy->setAcceptedStatuses( acceptedStatuses );
|
mModelProxy->setAcceptedStatuses( acceptedStatuses );
|
||||||
|
|
||||||
updateTabTitle();
|
updateTabTitle();
|
||||||
|
|
||||||
|
// load welcome HTML to the detail browser
|
||||||
|
// // // // // // // TODO: after texts are done, read from translations instead.
|
||||||
|
QString welcomeHTML = "";
|
||||||
|
QFile welcomeFile( QgsApplication::pkgDataPath() + "/resources/plugin_manager/" + welcomePage );
|
||||||
|
if ( welcomeFile.open( QIODevice::ReadOnly ) )
|
||||||
|
{
|
||||||
|
QTextStream welcomeStream( &welcomeFile ); // Remove from includes too.
|
||||||
|
welcomeStream.setCodec( "UTF-8" );
|
||||||
|
QString myStyle = QgsApplication::reportStyleSheet();
|
||||||
|
welcomeHTML += "<style>" + myStyle + "</style>";
|
||||||
|
while ( !welcomeStream.atEnd() )
|
||||||
|
{
|
||||||
|
welcomeHTML += welcomeStream.readLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tbDetails->setHtml( welcomeHTML );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user