Skip to content

Commit 8a7c8be

Browse files
author
timlinux
committed
[FEATURE] Not sure how we coped without this till now...we now have a tip presented at startup. You can en/disable tips in the options panel. To contribute more tips, please add them to src/app/qgstipfactory.cpp
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15199 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a9ffeb1 commit 8a7c8be

7 files changed

+152
-138
lines changed

src/app/CMakeLists.txt

+31-26
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ SET(QGIS_APP_SRCS
8787
qgssnappingdialog.cpp
8888
qgsundowidget.cpp
8989
qgstilescalewidget.cpp
90+
qgstipgui.cpp
91+
qgstipfactory.cpp
9092
qgsuniquevaluedialog.cpp
9193
qgsvectorlayerproperties.cpp
9294
qgsquerybuilder.cpp
@@ -144,77 +146,80 @@ SET (QGIS_APP_MOC_HDRS
144146
qgisapp.h
145147
qgisappinterface.h
146148
qgsabout.h
147-
qgssponsors.h
148149
qgsaddattrdialog.h
149-
qgsdisplayangle.h
150150
qgsaddjoindialog.h
151151
qgsannotationwidget.h
152152
qgsattributeactiondialog.h
153153
qgsattributedialog.h
154154
qgsattributetypedialog.h
155155
qgsattributetypeloaddialog.h
156156
qgsbookmarks.h
157-
qgscontinuouscolordialog.h
158157
qgsconfigureshortcutsdialog.h
158+
qgscontinuouscolordialog.h
159159
qgscustomprojectiondialog.h
160+
qgsdbtablemodel.h
160161
qgsdelattrdialog.h
162+
qgsdisplayangle.h
163+
qgsfeatureaction.h
161164
qgsfieldcalculator.h
162165
qgsformannotationdialog.h
163-
qgslabelinggui.h
164-
qgslabelengineconfigdialog.h
165-
qgsmaptoolmeasureangle.h
166-
qgsnewvectorlayerdialog.h
167166
qgsgraduatedsymboldialog.h
168167
qgshelpviewer.h
169168
qgsidentifyresults.h
170-
qgsfeatureaction.h
171169
qgslabeldialog.h
170+
qgslabelengineconfigdialog.h
171+
qgslabelinggui.h
172172
qgslabelpropertydialog.h
173173
qgsmanageconnectionsdialog.h
174-
qgsmaptoolidentify.h
175-
qgsmaptoolsplitfeatures.h
176-
qgsmaptoolvertexedit.h
177174
qgsmaptooladdfeature.h
178175
qgsmaptooladdisland.h
179176
qgsmaptooladdring.h
177+
qgsmaptooladdvertex.h
178+
qgsmaptoolchangelabelproperties.h
179+
qgsmaptooldeletepart.h
180+
qgsmaptooldeletering.h
181+
qgsmaptooldeletevertex.h
182+
qgsmaptoolidentify.h
183+
qgsmaptoolmeasureangle.h
180184
qgsmaptoolmovefeature.h
181185
qgsmaptoolmovelabel.h
186+
qgsmaptoolmovevertex.h
182187
qgsmaptoolnodetool.h
183188
qgsmaptoolreshape.h
184189
qgsmaptoolrotatelabel.h
185190
qgsmaptoolrotatepointsymbols.h
186-
qgsmaptoolselect.h
187-
qgsmaptoolselectrectangle.h
188191
qgsmaptoolselectfreehand.h
192+
qgsmaptoolselect.h
189193
qgsmaptoolselectpolygon.h
190194
qgsmaptoolselectradius.h
191-
qgsmaptooladdvertex.h
192-
qgsmaptoolchangelabelproperties.h
193-
qgsmaptooldeletering.h
194-
qgsmaptooldeletepart.h
195-
qgsmaptooldeletevertex.h
196-
qgsmaptoolmovevertex.h
195+
qgsmaptoolselectrectangle.h
197196
qgsmaptoolsimplify.h
198-
qgsmeasuretool.h
197+
qgsmaptoolsplitfeatures.h
198+
qgsmaptoolvertexedit.h
199199
qgsmeasuredialog.h
200+
qgsmeasuretool.h
200201
qgsmergeattributesdialog.h
201202
qgsnewhttpconnection.h
203+
qgsnewvectorlayerdialog.h
202204
qgsoptions.h
203205
qgspastetransformations.h
204206
qgspluginmanager.h
205207
qgsprojectproperties.h
208+
qgsquerybuilder.h
206209
qgsrastercalcdialog.h
207210
qgsrasterlayerproperties.h
208-
qgstextannotationdialog.h
209-
qgswmssourceselect.h
210211
qgssinglesymboldialog.h
211212
qgssnappingdialog.h
213+
qgssponsors.h
214+
qgstextannotationdialog.h
215+
qgstilescalewidget.h
216+
qgstip.h
217+
qgstipgui.h
218+
qgstipfactory.h
219+
qgsundowidget.h
212220
qgsuniquevaluedialog.h
213221
qgsvectorlayerproperties.h
214-
qgsdbtablemodel.h
215-
qgsundowidget.h
216-
qgstilescalewidget.h
217-
qgsquerybuilder.h
222+
qgswmssourceselect.h
218223

219224
composer/qgsattributeselectiondialog.h
220225
composer/qgscomposer.h

src/app/qgisapp.cpp

+20-4
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
#include "qgssponsors.h"
157157
#include "qgstextannotationitem.h"
158158
#include "qgstilescalewidget.h"
159+
#include "qgstipgui.h"
159160
#include "qgsundowidget.h"
160161
#include "qgsvectordataprovider.h"
161162
#include "qgsvectorfilewriter.h"
@@ -532,16 +533,31 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
532533
mPrevScreenModeMaximized = false;
533534
show();
534535
qApp->processEvents();
535-
//finally show all the application settings as initialised above
536536

537-
QgsDebugMsg( "\n\n\nApplication Settings:\n--------------------------\n" );
538-
QgsDebugMsg( QgsApplication::showSettings() );
539-
QgsDebugMsg( "\n--------------------------\n\n\n" );
540537
mMapCanvas->freeze( false );
541538
mMapCanvas->clearExtentHistory(); // reset zoomnext/zoomlast
542539
mLastComposerId = 0;
543540
mLBL = new QgsPalLabeling();
544541
mMapCanvas->mapRenderer()->setLabelingEngine( mLBL );
542+
543+
// Show a nice tip of the day
544+
QSettings settings;
545+
if ( settings.value( "/qgis/showTips", 1 ).toBool() )
546+
{
547+
mSplash->hide();
548+
QgsTipGui myTip;
549+
myTip.exec();
550+
}
551+
else
552+
{
553+
QgsDebugMsg( "Tips are disabled");
554+
}
555+
556+
//finally show all the application settings as initialised above
557+
QgsDebugMsg( "\n\n\nApplication Settings:\n--------------------------\n" );
558+
QgsDebugMsg( QgsApplication::showSettings() );
559+
QgsDebugMsg( "\n--------------------------\n\n\n" );
560+
545561
} // QgisApp ctor
546562

547563

src/app/qgsoptions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
257257
chkAddedVisibility->setChecked( settings.value( "/qgis/new_layers_visible", true ).toBool() );
258258
cbxLegendClassifiers->setChecked( settings.value( "/qgis/showLegendClassifiers", false ).toBool() );
259259
cbxHideSplash->setChecked( settings.value( "/qgis/hideSplash", false ).toBool() );
260+
cbxShowTips->setChecked( settings.value( "/qgis/showTips", true ).toBool() );
260261
cbxAttributeTableDocked->setChecked( settings.value( "/qgis/dockAttributeTable", false ).toBool() );
261262
cbxIdentifyResultsDocked->setChecked( settings.value( "/qgis/dockIdentifyResults", false ).toBool() );
262263
cbxSnappingOptionsDocked->setChecked( settings.value( "/qgis/dockSnapping", false ).toBool() );
@@ -527,6 +528,7 @@ void QgsOptions::saveOptions()
527528
settings.setValue( "/Map/identifyRadius", spinBoxIdentifyValue->value() );
528529
settings.setValue( "/qgis/showLegendClassifiers", cbxLegendClassifiers->isChecked() );
529530
settings.setValue( "/qgis/hideSplash", cbxHideSplash->isChecked() );
531+
settings.setValue( "/qgis/showTips", cbxShowTips->isChecked() );
530532
settings.setValue( "/qgis/dockAttributeTable", cbxAttributeTableDocked->isChecked() );
531533
settings.setValue( "/qgis/attributeTableBehaviour", cmbAttrTableBehaviour->currentIndex() );
532534
settings.setValue( "/qgis/dockIdentifyResults", cbxIdentifyResultsDocked->isChecked() );

src/app/qgstipfactory.cpp

+45-74
Original file line numberDiff line numberDiff line change
@@ -19,103 +19,74 @@
1919
***************************************************************************/
2020

2121

22-
#include "omgtipfactory.h"
22+
#include "qgstipfactory.h"
2323
#include <QTime>
2424
//for rand & srand
2525
#include <cstdlib>
2626

2727

28-
OmgTipFactory::OmgTipFactory() : QObject()
28+
QgsTipFactory::QgsTipFactory() : QObject()
2929
{
3030
// Im just doing this in a simple way so
3131
// its easy for translators...later
3232
// it its worth the time Ill move this data
3333
// into a sqlite database...
34-
OmgTip myTip;
35-
myTip.setTitle(tr("openModeller is open source"));
36-
myTip.setContent(tr("openModeller is open source software."
34+
QgsTip myTip;
35+
myTip.setTitle(tr("Quantum GIS is open source"));
36+
myTip.setContent(tr("Quantum GIS is open source software."
3737
" This means that the software source code can be freely viewed "
3838
" and modified. The GPL places a restriction that any modifications "
3939
" you make must be made available to the openModeller project, and "
4040
" that you can not create a new version of openModeller under a "
41-
" 'closed source' license. Visit <a href=\"http://openModeller.sf.net\">"
42-
" the openModeller home page (http://openModeller.sf.net)</a> for more"
41+
" 'closed source' license. Visit <a href=\"http://qgis.org\">"
42+
" the QGIS home page (http://qgis.org)</a> for more"
4343
" information."));
4444
addGenericTip(myTip);
4545
//
46-
myTip.setTitle(tr("openModeller Publications"));
46+
myTip.setTitle(tr("QGIS Publications"));
4747
myTip.setContent(tr("If you write a scientific paper or any other article"
48-
" that refers to openModeller we would love to include your work"
49-
" in the references section of "
50-
" the openModeller home page (http://openModeller.sf.net).</a>"
48+
" that refers to QGIS we would love to include your work"
49+
" in the <a href=\"http://www.qgis.org/en/community/qgis-case-studies.html\">case studies section</a> of"
50+
" the Quantum GIS home page (http://http://www.qgis.org/en/community/qgis-case-studies.html)."
5151
));
5252
addGenericTip(myTip);
53-
myTip.setTitle(tr("Become an openModeller Desktop translator"));
54-
myTip.setContent(tr("Would you like to see openModeller Desktop"
53+
myTip.setTitle(tr("Become an QGIS translator"));
54+
myTip.setContent(tr("Would you like to see QGIS"
5555
" in your native language? We are looking for more translators"
5656
" and would appreciate your help! The translation process is "
5757
" fairly straight forward - instructions are available in the "
58-
" resources section of "
59-
" the openModeller home page (http://openModeller.sf.net).</a>"
58+
" QGIS wiki"
59+
" <a href=\"http://www.qgis.org/wiki/GUI_Translation\">translator's page (http://www.qgis.org/wiki/GUI_Translation).</a>"
6060
));
6161
addGuiTip(myTip);
62-
myTip.setTitle(tr("openModeller Mailing lists"));
63-
myTip.setContent(tr("If you need help using openModeller Desktop"
64-
" we have a mailing list where users help each other with issues"
65-
" related to niche modelling and using openModeller Desktop."
66-
" Details on how to subscribe are in the resources section of"
67-
" the openModeller home page (http://openModeller.sf.net).</a>"
62+
myTip.setTitle(tr("QGIS Mailing lists"));
63+
myTip.setContent(tr("If you need help using QGIS"
64+
" we have a 'users' mailing list where users help each other with issues"
65+
" related to using our sofware. We also have a 'developers' mailing list."
66+
" for those wanting help and to discuss things relating the the QGIS code base."
67+
" Details on how to subscribe are in the <a href=\"http://www.qgis.org/en/community/mailing-lists.html\">community section</a> of"
68+
" the QGIS home page (http://www.qgis.org/en/community/mailing-lists.html)."
6869
));
6970
addGuiTip(myTip);
70-
myTip.setTitle(tr("Is it 'modelling' or 'modeling'?"));
71-
myTip.setContent(tr("Both spellings are correct. For openModeller"
72-
" we use the former spelling."
71+
myTip.setTitle(tr("Is it 'QGIS' or 'Quantum GIS'?"));
72+
myTip.setContent(tr("Both are correct. For articles we suggest you write 'Quantum GIS (QGIS) is ....'"
73+
" and then refer to it as QGIS thereafter."
7374
));
7475
addGenericTip(myTip);
75-
myTip.setTitle(tr("How do I refer to openModeller?"));
76-
myTip.setContent(tr("openModeller is spelled with a lower case"
77-
" 'o' at the start of the word - even if its the beginning"
78-
" of a sentance. We have various subprojects of the openModeller "
76+
myTip.setTitle(tr("How do I refer to Quantum GIS?"));
77+
myTip.setContent(tr("QGIS is spelled in all caps."
78+
" We have various subprojects of the QGIS project "
7979
" project and it will help to avoid confusion if you refer to each by"
8080
" its name:"
8181
"<ul>"
82-
"<li>openModeller Library - this is the C++ library that contains"
83-
" the core logic for carrying out niche modelling"
84-
"<li>openModeller Console - these are a collection of command"
85-
" line tools that allow you to run niche models from a unix or"
86-
" DOS shell, or from a scripting environment."
87-
"<li>openModeller Web Service - The openModeller Web Service"
88-
" allows for remote execution of niche models."
89-
"<li>openModeller Desktop - the openModeller Desktop provides"
90-
" a graphical user interface for the openModeller Library. It"
91-
" also includes the capability to run models using the"
92-
" openModeller Web Service (though this is still considered"
93-
" experimental)."
82+
"<li>QGIS Library - this is the C++ library that contains"
83+
" the core logic that is used to build the QGIS user interface and other applications.</li>"
84+
"<li>QGIS Application - this is the desktop application that you know and love so much :-).</li>"
85+
"<li>QGIS Mapserver - this is a server-side application based on the QGIS Library"
86+
" that will serve up your .qgs projects using the WMS protocol.</li>"
9487
"</ul>"
9588
));
9689
addGenericTip(myTip);
97-
myTip.setTitle(tr("How can I improve model execution times?"));
98-
myTip.setContent(tr("Model processing time is typically determined by"
99-
"<ul>"
100-
"<li>the algorithm you select,</li>"
101-
"<li>the number, extents and spatial resolution of your format and environmental layers,</li>"
102-
"<li>the number of cells excluded by your mask (if any),</li>"
103-
"<li>in some cases the number of presence and absence points (e.g. distance algs),</li>"
104-
"<li>the speed of the computer the model is running on (CPU, disk access etc).</li>"
105-
"</ul>"
106-
"So if you want to improve model processing times you need to adjust "
107-
"one of these variables. One thing noticed quite commonly is that people "
108-
"use extremely high resolution datasets that often carry little "
109-
"additional information over lower resolution equivalents. For example "
110-
"interpolating widely dispersed weather station data to produce a 50cm "
111-
"raster probably carries little additional value over for example using "
112-
"10m2 pixels.<br>"
113-
"Another area of performance improvement you can look at is "
114-
"preselecting environmental variables using techniques such as Chi "
115-
"Square test. Future versions of openModeller will integrate the ability "
116-
"to do this type of preselection."
117-
));
118-
addGenericTip(myTip);
11990
/* Template for adding more tips
12091
myTip.setTitle(tr(""));
12192
myTip.setContent(tr(""
@@ -124,52 +95,52 @@ OmgTipFactory::OmgTipFactory() : QObject()
12495
*/
12596
}
12697

127-
OmgTipFactory::~OmgTipFactory()
98+
QgsTipFactory::~QgsTipFactory()
12899
{
129100

130101
}
131102
//private helper method
132-
void OmgTipFactory::addGuiTip(OmgTip theTip)
103+
void QgsTipFactory::addGuiTip(QgsTip theTip)
133104
{
134105
mGuiTips << theTip;
135106
mAllTips << theTip;
136107
}
137108
//private helper method
138-
void OmgTipFactory::addGenericTip(OmgTip theTip)
109+
void QgsTipFactory::addGenericTip(QgsTip theTip)
139110
{
140111
mGenericTips << theTip;
141112
mAllTips << theTip;
142113
}
143-
OmgTip OmgTipFactory::getTip()
114+
QgsTip QgsTipFactory::getTip()
144115
{
145116
srand(QTime::currentTime().msec());
146117
int myRand = rand();
147118
int myValue = static_cast<int> (myRand % mAllTips.count()); //range [0,(count-1)]
148-
OmgTip myTip = mAllTips.at(myValue);
119+
QgsTip myTip = mAllTips.at(myValue);
149120
return myTip;
150121
}
151-
OmgTip OmgTipFactory::getTip(int thePosition)
122+
QgsTip QgsTipFactory::getTip(int thePosition)
152123
{
153-
OmgTip myTip = mAllTips.at(thePosition);
124+
QgsTip myTip = mAllTips.at(thePosition);
154125
return myTip;
155126
}
156-
OmgTip OmgTipFactory::getGenericTip()
127+
QgsTip QgsTipFactory::getGenericTip()
157128
{
158129
srand(QTime::currentTime().msec());
159130
int myRand = rand();
160131
int myValue = static_cast<int> (myRand % mGenericTips.count()); //range [0,(count-1)]
161-
OmgTip myTip = mGenericTips.at(myValue);
132+
QgsTip myTip = mGenericTips.at(myValue);
162133
return myTip;
163134
}
164-
OmgTip OmgTipFactory::getGuiTip()
135+
QgsTip QgsTipFactory::getGuiTip()
165136
{
166137
srand(QTime::currentTime().msec());
167138
int myRand = rand();
168139
int myValue = static_cast<int> (myRand % mGuiTips.count()); //range [0,(count-1)]
169-
OmgTip myTip = mGuiTips.at(myValue);
140+
QgsTip myTip = mGuiTips.at(myValue);
170141
return myTip;
171142
}
172-
int OmgTipFactory::randomNumber(int theMax)
143+
int QgsTipFactory::randomNumber(int theMax)
173144
{
174145
return 0;
175146
}

0 commit comments

Comments
 (0)