Showing with 73 additions and 29 deletions.
  1. +36 −0 src/app/pluginmanager/qgspluginmanager.cpp
  2. +7 −1 src/app/pluginmanager/qgspluginmanager.h
  3. +30 −28 src/ui/qgspluginmanagerbase.ui
36 changes: 36 additions & 0 deletions src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QSortFilterProxyModel>
#include <QActionGroup>
#include <QTextStream>
#include <QTimer>

#include "qgis.h"
#include "qgsapplication.h"
Expand Down Expand Up @@ -538,6 +539,8 @@ void QgsPluginManager::reloadModelData()
if ( hasAvailablePlugins() ) mModelPlugins->appendRow( createSpacerItem( tr( "Installable", "category: plugins that are available for installation" ), "not installedZ" ) );
}

updateWindowTitle();

buttonUpgradeAll->setEnabled( hasUpgradeablePlugins() );

// Disable tabs that are empty because of no suitable plugins in the model.
Expand Down Expand Up @@ -1003,6 +1006,8 @@ void QgsPluginManager::setCurrentTab( int idx )
buttonInstall->setEnabled( false );
buttonUninstall->setEnabled( false );
}

updateWindowTitle();
}


Expand Down Expand Up @@ -1336,3 +1341,34 @@ bool QgsPluginManager::hasInvalidPlugins( )

return false;
}



void QgsPluginManager::updateWindowTitle( )
{
QString newTitle = QString( "%1 - %2" ).arg( tr( "Plugins" ) ).arg( mOptionsListWidget->currentItem()->text() );
if ( mOptionsListWidget->currentRow() < mOptionsListWidget->count() - 1 )
{
// if it's not the Settings tab, add the plugin count
newTitle += QString( " (%3)" ).arg( mModelProxy->countWithCurrentStatus() );
}
setWindowTitle( newTitle );
return;
}



void QgsPluginManager::showEvent( QShowEvent* e )
{
if ( mInit )
{
updateOptionsListVerticalTabs();
}
else
{
QTimer::singleShot( 0, this, SLOT( warnAboutMissingObjects() ) );
}

QDialog::showEvent( e );
}

8 changes: 7 additions & 1 deletion src/app/pluginmanager/qgspluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
//! Set tab of the stacked widget (called from the vertical list item)
void setCurrentTab( int idx );

//! Update the window title according to the current filters
void updateWindowTitle();

//! Handle plugin selection
void currentPluginChanged( const QModelIndex & theIndex );

Expand Down Expand Up @@ -160,8 +163,11 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
//! Enable all repositories disabled by "Enable selected repository only"
void clearRepositoryFilter( );

private:
protected:
//! Reimplement QgsOptionsDialogBase method as we have a custom window title what would be overwritten by this method
void showEvent( QShowEvent* e );

private:
//! Load translated descriptions. Source strings implemented in external qgspluginmanager_texts.cpp
void initTabDescriptions();

Expand Down
58 changes: 30 additions & 28 deletions src/ui/qgspluginmanagerbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
<number>0</number>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="pagePlugins">
<layout class="QVBoxLayout" name="verticalLayout_8">
Expand Down Expand Up @@ -467,6 +467,33 @@
<property name="bottomMargin">
<number>0</number>
</property>

<item>
<widget class="QLabel" name="labelNoPython">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>The settings on this tab are only applicable for Python Plugins. No Python support detected, thus no settings available.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>20</number>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>

<item>
<widget class="QFrame" name="frameSettings">
<property name="sizePolicy">
Expand All @@ -492,36 +519,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>573</width>
<height>734</height>
<width>574</width>
<height>653</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QLabel" name="labelNoPython">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>The settings on this tab are only applicable for Python Plugins. No Python support detected, thus no settings available.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="margin">
<number>20</number>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="ckbCheckUpdates">
<property name="enabled">
Expand Down