mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -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 <QSortFilterProxyModel>
|
||||
#include <QActionGroup>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "qgis.h"
|
||||
#include "qgsapplication.h"
|
||||
@ -82,8 +83,6 @@ QgsPluginManager::QgsPluginManager( QWidget * parent, Qt::WFlags fl )
|
||||
vwPlugins->setFocus();
|
||||
|
||||
// Preset widgets
|
||||
QString wellcomeMsg = tr( "To enable or disable plugin, click its checkbox or doubleclick its name..." );
|
||||
tbDetails->setHtml( wellcomeMsg );
|
||||
leFilter->setFocus( Qt::MouseFocusReason );
|
||||
rbFilterNames->setChecked( true );
|
||||
|
||||
@ -894,32 +893,55 @@ void QgsPluginManager::setCurrentTab( int idx )
|
||||
mOptionsStackedWidget->setCurrentIndex( 0 );
|
||||
|
||||
QStringList acceptedStatuses;
|
||||
QString welcomePage;
|
||||
switch ( idx )
|
||||
{
|
||||
case 0:
|
||||
// installed (statuses ends with Z are for spacers to always sort properly)
|
||||
acceptedStatuses << "installed" << "orphan" << "newer" << "upgradeable" << "installedZ" << "upgradeableZ" << "orphanZ" << "newerZZ" << "" ;
|
||||
welcomePage = "installed_plugins";
|
||||
break;
|
||||
case 1:
|
||||
// not installed (get more)
|
||||
acceptedStatuses << "not installed" << "new" ;
|
||||
welcomePage = "get_more_plugins";
|
||||
break;
|
||||
case 2:
|
||||
// upgradeable
|
||||
acceptedStatuses << "upgradeable" ;
|
||||
welcomePage = "upgradeable_plugins";
|
||||
break;
|
||||
case 3:
|
||||
// new
|
||||
acceptedStatuses << "new" ;
|
||||
welcomePage = "new_plugins";
|
||||
break;
|
||||
case 4:
|
||||
// invalid
|
||||
acceptedStatuses << "invalid" ;
|
||||
welcomePage = "invalid_plugins";
|
||||
break;
|
||||
}
|
||||
mModelProxy->setAcceptedStatuses( acceptedStatuses );
|
||||
|
||||
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