Skip to content
Permalink
Browse files

[Plugin Manager] Fix window title issues after recent changes in QgsO…

…ptionsDialogBase
  • Loading branch information
borysiasty committed Jan 19, 2014
1 parent 72ec87d commit 377d30aa16e89d36a9ec0dd20c7c7cb3eced1be3
Showing with 43 additions and 1 deletion.
  1. +36 −0 src/app/pluginmanager/qgspluginmanager.cpp
  2. +7 −1 src/app/pluginmanager/qgspluginmanager.h
@@ -29,6 +29,7 @@
#include <QSortFilterProxyModel>
#include <QActionGroup>
#include <QTextStream>
#include <QTimer>

#include "qgis.h"
#include "qgsapplication.h"
@@ -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.
@@ -1003,6 +1006,8 @@ void QgsPluginManager::setCurrentTab( int idx )
buttonInstall->setEnabled( false );
buttonUninstall->setEnabled( false );
}

updateWindowTitle();
}


@@ -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 );
}

@@ -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 );

@@ -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();

0 comments on commit 377d30a

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