Skip to content

Commit ad9a0fe

Browse files
author
jef
committed
replace context help ids with classnames
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12169 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 307ec1c commit ad9a0fe

File tree

154 files changed

+296
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+296
-642
lines changed

python/core/qgscontexthelp.sip

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ class QgsContextHelp : QObject
2020
%End
2121

2222
public:
23-
static void run(int contextId);
23+
static void run(QString context);
2424

2525
private:
2626
//! Constructor
27-
QgsContextHelp(int contextId);
27+
QgsContextHelp(QString context);
28+
2829
//! Destructor
2930
~QgsContextHelp();
30-
3131
};
32-

resources/context_help/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
2-
FILE(GLOB HELP_FILES *_*)
1+
FILE(GLOB HELP_FILES *-*)
32

43
INSTALL(FILES ${HELP_FILES}
54
DESTINATION ${QGIS_DATA_DIR}/resources/context_help)
6-

resources/context_help/contextids.txt

-18
This file was deleted.

src/app/composer/qgscomposer.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -994,11 +994,6 @@ void QgsComposer::restoreWindowState()
994994
}
995995
}
996996

997-
void QgsComposer::on_buttonBox_helpRequested()
998-
{
999-
QgsContextHelp::run( context_id );
1000-
}
1001-
1002997
void QgsComposer::writeXML( QDomDocument& doc )
1003998
{
1004999

src/app/composer/qgscomposer.h

+3-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define QGSCOMPOSER_H
2020
#include "ui_qgscomposerbase.h"
2121
#include "qgscomposeritem.h"
22+
#include "qgscontexthelp.h"
2223

2324
class QgisApp;
2425
class QgsComposerLabel;
@@ -188,9 +189,6 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
188189
//! Save window state
189190
void saveWindowState();
190191

191-
//! Slot for when the help button is clicked
192-
void on_buttonBox_helpRequested();
193-
194192
/**Add a composer map to the item/widget map and creates a configuration widget for it*/
195193
void addComposerMap( QgsComposerMap* map );
196194

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

227+
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
228+
229229
private:
230230

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

279279
//! Window menu action to select this window
280280
QAction *mWindowAction;
281-
282-
//! Help context id
283-
static const int context_id = 985715179;
284-
285281
};
286282

287283
#endif

src/app/ogr/qgsnewogrconnection.cpp

+1-20
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ QgsNewOgrConnection::QgsNewOgrConnection( QWidget *parent, const QString& connTy
3434
: QDialog( parent, fl )
3535
{
3636
setupUi( this );
37-
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( help() ) );
37+
3838
//add database drivers
3939
QStringList dbDrivers = QgsProviderRegistry::instance()->databaseDrivers().split( ";" );
4040
for ( int i = 0; i < dbDrivers.count(); i++ )
@@ -115,28 +115,9 @@ void QgsNewOgrConnection::accept()
115115
QDialog::accept();
116116
}
117117

118-
void QgsNewOgrConnection::help()
119-
{
120-
helpInfo();
121-
}
122-
123118
void QgsNewOgrConnection::on_btnConnect_clicked()
124119
{
125120
testConnection();
126121
}
127122

128-
void QgsNewOgrConnection::helpInfo()
129-
{
130-
QgsContextHelp::run( context_id );
131-
}
132-
133123
/** end Autoconnected SLOTS **/
134-
135-
136-
137-
138-
139-
140-
141-
142-

src/app/ogr/qgsnewogrconnection.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#define QGSNEWOGRCONNECTION_H
2121
#include "ui_qgsnewogrconnectionbase.h"
2222
#include "qgisgui.h"
23+
#include "qgscontexthelp.h"
2324

2425
/*! \class QgsNewOgrConnection
2526
* \brief Dialog to allow the user to define, test and save connection
@@ -28,6 +29,7 @@
2829
class QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConnectionBase
2930
{
3031
Q_OBJECT
32+
3133
public:
3234
//! Constructor
3335
QgsNewOgrConnection( QWidget *parent = 0, const QString& connType = QString::null, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags );
@@ -37,14 +39,10 @@ class QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConnectionBase
3739
void testConnection();
3840
//! Saves the connection to ~/.qt/qgisrc
3941
void saveConnection();
40-
//! Display the context help
41-
void helpInfo();
4242
public slots:
4343
void accept();
44-
void help();
4544
void on_btnConnect_clicked();
46-
private:
47-
static const int context_id = 63428984;
45+
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
4846
};
4947

5048
#endif // QGSNEWOGRCONNECTIONBASE_H

src/app/ogr/qgsopenvectorlayerdialog.cpp

+1-10
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ QgsOpenVectorLayerDialog::QgsOpenVectorLayerDialog( QWidget* parent, Qt::WFlags
3535
: QDialog( parent, fl )
3636
{
3737
setupUi( this );
38+
3839
cmbDatabaseTypes->blockSignals( true );
3940
cmbConnections->blockSignals( true );
4041
radioSrcFile->setChecked( true );
@@ -141,11 +142,6 @@ QString QgsOpenVectorLayerDialog::encoding()
141142
return cmbEncodings->currentText();
142143
}
143144

144-
void QgsOpenVectorLayerDialog::helpInfo()
145-
{
146-
QgsContextHelp::run( context_id );
147-
}
148-
149145
QString QgsOpenVectorLayerDialog::dataSourceType()
150146
{
151147
return mDataSourceType;
@@ -418,11 +414,6 @@ void QgsOpenVectorLayerDialog::on_buttonBox_accepted()
418414
accept();
419415
}
420416

421-
void QgsOpenVectorLayerDialog::on_btnHelp_clicked()
422-
{
423-
helpInfo();
424-
}
425-
426417
void QgsOpenVectorLayerDialog::on_radioSrcFile_toggled( bool checked )
427418
{
428419
if ( checked )

src/app/ogr/qgsopenvectorlayerdialog.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#ifndef QGSOPENVECTORLAYERDIALOG_H
2121
#define QGSOPENVECTORLAYERDIALOG_H
2222

23-
2423
#include <ui_qgsopenvectorlayerdialogbase.h>
2524
#include <QDialog>
25+
#include "qgscontexthelp.h"
2626

2727
/**
2828
* Class for a dialog to select the type and source for ogr vectors, supports
@@ -43,8 +43,6 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
4343
QStringList dataSources();
4444
//! Returns the encoding selected for user*/
4545
QString encoding();
46-
//! Display the context help
47-
void helpInfo();
4846
//! Returns the connection type
4947
QString dataSourceType();
5048
private:
@@ -59,8 +57,6 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
5957
QString mEnc;
6058
//! Stores the datasource type
6159
QString mDataSourceType;
62-
static const int context_id = 348772824;
63-
6460

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

8379
void on_buttonBox_accepted();
84-
void on_btnHelp_clicked();
8580
void on_buttonSelectSrc_clicked();
8681
void on_radioSrcFile_toggled( bool checked );
8782
void on_radioSrcDirectory_toggled( bool checked );
@@ -92,6 +87,7 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
9287
void on_btnDelete_clicked();
9388
void on_cmbDatabaseTypes_currentIndexChanged( const QString & text );
9489
void on_cmbConnections_currentIndexChanged( const QString & text );
90+
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
9591
};
9692

9793
#endif // QGSOPENVECTORDIALOG_H

src/app/qgsbookmarks.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ QgsBookmarks::QgsBookmarks( QWidget *parent, Qt::WFlags fl )
6666
connect( btnZoomTo, SIGNAL( clicked() ), this, SLOT( on_btnZoomTo_clicked() ) );
6767
// connect the slot up to catch when a new bookmark is added
6868
connect( mParent, SIGNAL( bookmarkAdded() ), this, SLOT( refreshBookmarks() ) );
69-
//and for help requested
70-
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpRequested() ) );
7169
}
7270

7371
// Destructor
@@ -256,8 +254,3 @@ int QgsBookmarks::connectDb()
256254
}
257255
return rc;
258256
}
259-
260-
void QgsBookmarks::helpRequested()
261-
{
262-
QgsContextHelp::run( context_id );
263-
}

src/app/qgsbookmarks.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define QGSBOOKMARKS_H
2020
#include "ui_qgsbookmarksbase.h"
2121
#include <QDialog>
22+
#include "qgscontexthelp.h"
2223

2324
class QString;
2425
class QWidget;
@@ -27,6 +28,7 @@ struct sqlite3;
2728
class QgsBookmarks : public QDialog, private Ui::QgsBookmarksBase
2829
{
2930
Q_OBJECT
31+
3032
public:
3133
QgsBookmarks( QWidget *parent = 0, Qt::WFlags fl = 0 );
3234
~QgsBookmarks();
@@ -36,16 +38,16 @@ class QgsBookmarks : public QDialog, private Ui::QgsBookmarksBase
3638
void on_btnDelete_clicked();
3739
void on_btnZoomTo_clicked();
3840
void on_lstBookmarks_doubleClicked( QTreeWidgetItem * );
39-
void helpRequested();
4041
void refreshBookmarks();
42+
43+
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
44+
4145
private:
4246
QWidget *mParent;
4347
void initialise();
4448
int connectDb();
4549
void zoomToBookmark();
4650
sqlite3 *db;
47-
static const int context_id = 151694916;
48-
4951
};
5052
#endif // QGSBOOKMARKS_H
5153

src/app/qgsidentifyresults.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
/* $Id$ */
1919

2020
#include "qgsidentifyresults.h"
21-
#include "qgscontexthelp.h"
2221
#include "qgsapplication.h"
2322
#include "qgisapp.h"
2423
#include "qgsmaplayer.h"
@@ -109,8 +108,6 @@ QgsIdentifyResults::QgsIdentifyResults( QgsMapCanvas *canvas, QWidget *parent, Q
109108
setColumnText( 0, tr( "Feature" ) );
110109
setColumnText( 1, tr( "Value" ) );
111110

112-
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );
113-
114111
connect( buttonBox, SIGNAL( clicked() ), this, SLOT( close() ) );
115112

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

534531
return featItem;
535532
}
536-
// Slot for showing help
537-
void QgsIdentifyResults::helpClicked()
538-
{
539-
QgsContextHelp::run( context_id );
540-
}
541533

542534
void QgsIdentifyResults::itemExpanded( QTreeWidgetItem* item )
543535
{

src/app/qgsidentifyresults.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "ui_qgsidentifyresultsbase.h"
2323
#include "qgsattributeaction.h"
24+
#include "qgscontexthelp.h"
2425

2526
#include <QWidget>
2627
#include <QList>
@@ -43,6 +44,7 @@ class QDockWidget;
4344
class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
4445
{
4546
Q_OBJECT
47+
4648
public:
4749

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

92-
//! Context help
93-
void helpClicked();
94-
9594
/* Called when an item is expanded so that we can ensure that the
9695
column width if expanded to show it */
9796
void itemExpanded( QTreeWidgetItem * );
@@ -104,15 +103,15 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
104103

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

106+
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
107+
107108
private:
108109
QMenu *mActionPopup;
109110
QgsVectorLayer *mRubberBandLayer;
110111
int mRubberBandFid;
111112
QgsRubberBand *mRubberBand;
112113
QgsMapCanvas *mCanvas;
113114

114-
static const int context_id = 689216579;
115-
116115
QgsVectorLayer *vectorLayer( QTreeWidgetItem *item );
117116
QTreeWidgetItem *featureItem( QTreeWidgetItem *item );
118117
QTreeWidgetItem *layerItem( QObject *layer );

0 commit comments

Comments
 (0)