Skip to content
Permalink
Browse files

[PluginManager] Move title pages for tabs to the resources. Will be i…

…ncluded to translations when the contents is ready.
  • Loading branch information
borysiasty committed Jun 9, 2013
1 parent b3e5e62 commit c490688106941be91e589359083607466e35c6c6
@@ -0,0 +1 @@
Here we have <b>not yet installed</b> plugins. You can download whatever you want.
@@ -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...
@@ -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>
@@ -0,0 +1 @@
Here are hot <b>news</b>. They are not yet installed plugins that are seen for the first time.
@@ -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 );
}
}

0 comments on commit c490688

Please sign in to comment.
You can’t perform that action at this time.