Skip to content

Commit

Permalink
replace context help ids with classnames
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12169 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 18, 2009
1 parent 307ec1c commit ad9a0fe
Show file tree
Hide file tree
Showing 154 changed files with 296 additions and 642 deletions.
7 changes: 3 additions & 4 deletions python/core/qgscontexthelp.sip
Expand Up @@ -20,13 +20,12 @@ class QgsContextHelp : QObject
%End

public:
static void run(int contextId);
static void run(QString context);

private:
//! Constructor
QgsContextHelp(int contextId);
QgsContextHelp(QString context);

//! Destructor
~QgsContextHelp();

};

4 changes: 1 addition & 3 deletions resources/context_help/CMakeLists.txt
@@ -1,6 +1,4 @@

FILE(GLOB HELP_FILES *_*)
FILE(GLOB HELP_FILES *-*)

INSTALL(FILES ${HELP_FILES}
DESTINATION ${QGIS_DATA_DIR}/resources/context_help)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions resources/context_help/contextids.txt

This file was deleted.

5 changes: 0 additions & 5 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -994,11 +994,6 @@ void QgsComposer::restoreWindowState()
}
}

void QgsComposer::on_buttonBox_helpRequested()
{
QgsContextHelp::run( context_id );
}

void QgsComposer::writeXML( QDomDocument& doc )
{

Expand Down
10 changes: 3 additions & 7 deletions src/app/composer/qgscomposer.h
Expand Up @@ -19,6 +19,7 @@
#define QGSCOMPOSER_H
#include "ui_qgscomposerbase.h"
#include "qgscomposeritem.h"
#include "qgscontexthelp.h"

class QgisApp;
class QgsComposerLabel;
Expand Down Expand Up @@ -188,9 +189,6 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Save window state
void saveWindowState();

//! Slot for when the help button is clicked
void on_buttonBox_helpRequested();

/**Add a composer map to the item/widget map and creates a configuration widget for it*/
void addComposerMap( QgsComposerMap* map );

Expand Down Expand Up @@ -226,6 +224,8 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Raise, unminimize and activate this window
void activate();

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

private:

/**Establishes the signal slot connection for the class*/
Expand Down Expand Up @@ -278,10 +278,6 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase

//! Window menu action to select this window
QAction *mWindowAction;

//! Help context id
static const int context_id = 985715179;

};

#endif
21 changes: 1 addition & 20 deletions src/app/ogr/qgsnewogrconnection.cpp
Expand Up @@ -34,7 +34,7 @@ QgsNewOgrConnection::QgsNewOgrConnection( QWidget *parent, const QString& connTy
: QDialog( parent, fl )
{
setupUi( this );
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( help() ) );

//add database drivers
QStringList dbDrivers = QgsProviderRegistry::instance()->databaseDrivers().split( ";" );
for ( int i = 0; i < dbDrivers.count(); i++ )
Expand Down Expand Up @@ -115,28 +115,9 @@ void QgsNewOgrConnection::accept()
QDialog::accept();
}

void QgsNewOgrConnection::help()
{
helpInfo();
}

void QgsNewOgrConnection::on_btnConnect_clicked()
{
testConnection();
}

void QgsNewOgrConnection::helpInfo()
{
QgsContextHelp::run( context_id );
}

/** end Autoconnected SLOTS **/









8 changes: 3 additions & 5 deletions src/app/ogr/qgsnewogrconnection.h
Expand Up @@ -20,6 +20,7 @@
#define QGSNEWOGRCONNECTION_H
#include "ui_qgsnewogrconnectionbase.h"
#include "qgisgui.h"
#include "qgscontexthelp.h"

/*! \class QgsNewOgrConnection
* \brief Dialog to allow the user to define, test and save connection
Expand All @@ -28,6 +29,7 @@
class QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConnectionBase
{
Q_OBJECT

public:
//! Constructor
QgsNewOgrConnection( QWidget *parent = 0, const QString& connType = QString::null, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags );
Expand All @@ -37,14 +39,10 @@ class QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConnectionBase
void testConnection();
//! Saves the connection to ~/.qt/qgisrc
void saveConnection();
//! Display the context help
void helpInfo();
public slots:
void accept();
void help();
void on_btnConnect_clicked();
private:
static const int context_id = 63428984;
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};

#endif // QGSNEWOGRCONNECTIONBASE_H
11 changes: 1 addition & 10 deletions src/app/ogr/qgsopenvectorlayerdialog.cpp
Expand Up @@ -35,6 +35,7 @@ QgsOpenVectorLayerDialog::QgsOpenVectorLayerDialog( QWidget* parent, Qt::WFlags
: QDialog( parent, fl )
{
setupUi( this );

cmbDatabaseTypes->blockSignals( true );
cmbConnections->blockSignals( true );
radioSrcFile->setChecked( true );
Expand Down Expand Up @@ -141,11 +142,6 @@ QString QgsOpenVectorLayerDialog::encoding()
return cmbEncodings->currentText();
}

void QgsOpenVectorLayerDialog::helpInfo()
{
QgsContextHelp::run( context_id );
}

QString QgsOpenVectorLayerDialog::dataSourceType()
{
return mDataSourceType;
Expand Down Expand Up @@ -418,11 +414,6 @@ void QgsOpenVectorLayerDialog::on_buttonBox_accepted()
accept();
}

void QgsOpenVectorLayerDialog::on_btnHelp_clicked()
{
helpInfo();
}

void QgsOpenVectorLayerDialog::on_radioSrcFile_toggled( bool checked )
{
if ( checked )
Expand Down
8 changes: 2 additions & 6 deletions src/app/ogr/qgsopenvectorlayerdialog.h
Expand Up @@ -20,9 +20,9 @@
#ifndef QGSOPENVECTORLAYERDIALOG_H
#define QGSOPENVECTORLAYERDIALOG_H


#include <ui_qgsopenvectorlayerdialogbase.h>
#include <QDialog>
#include "qgscontexthelp.h"

/**
* Class for a dialog to select the type and source for ogr vectors, supports
Expand All @@ -43,8 +43,6 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
QStringList dataSources();
//! Returns the encoding selected for user*/
QString encoding();
//! Display the context help
void helpInfo();
//! Returns the connection type
QString dataSourceType();
private:
Expand All @@ -59,8 +57,6 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
QString mEnc;
//! Stores the datasource type
QString mDataSourceType;
static const int context_id = 348772824;


private slots:
//! Opens the create connection dialog to build a new connection
Expand All @@ -81,7 +77,6 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
void setSelectedConnection();

void on_buttonBox_accepted();
void on_btnHelp_clicked();
void on_buttonSelectSrc_clicked();
void on_radioSrcFile_toggled( bool checked );
void on_radioSrcDirectory_toggled( bool checked );
Expand All @@ -92,6 +87,7 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
void on_btnDelete_clicked();
void on_cmbDatabaseTypes_currentIndexChanged( const QString & text );
void on_cmbConnections_currentIndexChanged( const QString & text );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};

#endif // QGSOPENVECTORDIALOG_H
7 changes: 0 additions & 7 deletions src/app/qgsbookmarks.cpp
Expand Up @@ -66,8 +66,6 @@ QgsBookmarks::QgsBookmarks( QWidget *parent, Qt::WFlags fl )
connect( btnZoomTo, SIGNAL( clicked() ), this, SLOT( on_btnZoomTo_clicked() ) );
// connect the slot up to catch when a new bookmark is added
connect( mParent, SIGNAL( bookmarkAdded() ), this, SLOT( refreshBookmarks() ) );
//and for help requested
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpRequested() ) );
}

// Destructor
Expand Down Expand Up @@ -256,8 +254,3 @@ int QgsBookmarks::connectDb()
}
return rc;
}

void QgsBookmarks::helpRequested()
{
QgsContextHelp::run( context_id );
}
8 changes: 5 additions & 3 deletions src/app/qgsbookmarks.h
Expand Up @@ -19,6 +19,7 @@
#define QGSBOOKMARKS_H
#include "ui_qgsbookmarksbase.h"
#include <QDialog>
#include "qgscontexthelp.h"

class QString;
class QWidget;
Expand All @@ -27,6 +28,7 @@ struct sqlite3;
class QgsBookmarks : public QDialog, private Ui::QgsBookmarksBase
{
Q_OBJECT

public:
QgsBookmarks( QWidget *parent = 0, Qt::WFlags fl = 0 );
~QgsBookmarks();
Expand All @@ -36,16 +38,16 @@ class QgsBookmarks : public QDialog, private Ui::QgsBookmarksBase
void on_btnDelete_clicked();
void on_btnZoomTo_clicked();
void on_lstBookmarks_doubleClicked( QTreeWidgetItem * );
void helpRequested();
void refreshBookmarks();

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

private:
QWidget *mParent;
void initialise();
int connectDb();
void zoomToBookmark();
sqlite3 *db;
static const int context_id = 151694916;

};
#endif // QGSBOOKMARKS_H

8 changes: 0 additions & 8 deletions src/app/qgsidentifyresults.cpp
Expand Up @@ -18,7 +18,6 @@
/* $Id$ */

#include "qgsidentifyresults.h"
#include "qgscontexthelp.h"
#include "qgsapplication.h"
#include "qgisapp.h"
#include "qgsmaplayer.h"
Expand Down Expand Up @@ -109,8 +108,6 @@ QgsIdentifyResults::QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent, Q
setColumnText( 0, tr( "Feature" ) );
setColumnText( 1, tr( "Value" ) );

connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );

connect( buttonBox, SIGNAL( clicked() ), this, SLOT( close() ) );

connect( lstResults, SIGNAL( itemExpanded( QTreeWidgetItem* ) ),
Expand Down Expand Up @@ -533,11 +530,6 @@ QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item,

return featItem;
}
// Slot for showing help
void QgsIdentifyResults::helpClicked()
{
QgsContextHelp::run( context_id );
}

void QgsIdentifyResults::itemExpanded( QTreeWidgetItem* item )
{
Expand Down
9 changes: 4 additions & 5 deletions src/app/qgsidentifyresults.h
Expand Up @@ -21,6 +21,7 @@

#include "ui_qgsidentifyresultsbase.h"
#include "qgsattributeaction.h"
#include "qgscontexthelp.h"

#include <QWidget>
#include <QList>
Expand All @@ -43,6 +44,7 @@ class QDockWidget;
class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
{
Q_OBJECT

public:

//! Constructor - takes it own copy of the QgsAttributeAction so
Expand Down Expand Up @@ -89,9 +91,6 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
void expandAll();
void collapseAll();

//! Context help
void helpClicked();

/* Called when an item is expanded so that we can ensure that the
column width if expanded to show it */
void itemExpanded( QTreeWidgetItem * );
Expand All @@ -104,15 +103,15 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase

QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QList< QPair<QString, QString> > &attributes );

void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

private:
QMenu *mActionPopup;
QgsVectorLayer *mRubberBandLayer;
int mRubberBandFid;
QgsRubberBand *mRubberBand;
QgsMapCanvas *mCanvas;

static const int context_id = 689216579;

QgsVectorLayer *vectorLayer( QTreeWidgetItem *item );
QTreeWidgetItem *featureItem( QTreeWidgetItem *item );
QTreeWidgetItem *layerItem( QObject *layer );
Expand Down

0 comments on commit ad9a0fe

Please sign in to comment.