Skip to content

Commit

Permalink
add simple help to cpt-city dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennesky committed Apr 25, 2013
1 parent 43c2805 commit 4f41de8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
27 changes: 13 additions & 14 deletions src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
#include <QPushButton>
#include <QTextEdit>
#include <QTime>
#include <QErrorMessage>
#include <QMessageBox>
#include <QSortFilterProxyModel>

/////////

// TODO
// - remove dialog or add help as help button
// - fix Diverging children when first show Selections
// - fix crash on Diverging?

Expand Down Expand Up @@ -172,18 +171,6 @@ QgsCptCityColorRampV2Dialog::QgsCptCityColorRampV2Dialog( QgsCptCityColorRampV2*
if ( mArchive->archiveName() == DEFAULT_CPTCITY_ARCHIVE )
tabBar->setCurrentIndex( 1 );

// show error message to use color ramp manager to get more gradients
if ( mArchive->archiveName() == DEFAULT_CPTCITY_ARCHIVE &&
QgsCptCityArchive::archiveRegistry().count() == 1 )
{
QString helpText = tr( "You can download a more complete set of cpt-city gradients "
"by installing the \"Color Ramp Manager\" plugin "
"(you must enable Experimental plugins in the plugin manager).\n\n"
);
QErrorMessage* msg = new QErrorMessage( this );
msg->showMessage( helpText, "cpt-city" );
}

}

QgsCptCityColorRampV2Dialog::~QgsCptCityColorRampV2Dialog()
Expand Down Expand Up @@ -502,6 +489,18 @@ void QgsCptCityColorRampV2Dialog::onFinished()
settings.setValue( "/Windows/CptCityColorRampV2Dialog/splitter", mSplitter->saveState() );
}

void QgsCptCityColorRampV2Dialog::on_buttonBox_helpRequested()
{
// show error message to use color ramp manager to get more gradients
QString helpText = tr( "You can download a more complete set of cpt-city gradients "
"by installing the \"Color Ramp Manager\" plugin "
"(you must enable Experimental plugins in the plugin manager).\n\n"
);
QMessageBox* msg = new QMessageBox( this );
msg->setText( helpText );
msg->exec();
}

bool QgsCptCityColorRampV2Dialog::saveAsGradientRamp() const
{
QgsDebugMsg( QString( "result: %1 checked: %2" ).arg( result() ).arg( cboConvertStandard->isChecked() ) );
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgscptcitycolorrampv2dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class GUI_EXPORT QgsCptCityColorRampV2Dialog : public QDialog, private Ui::QgsCp
void on_pbtnLicenseDetails_pressed();
void on_cboVariantName_currentIndexChanged( int index );
void onFinished();
void on_buttonBox_helpRequested();
/* void refresh(); */

protected:
Expand Down
18 changes: 9 additions & 9 deletions src/ui/qgscptcitycolorrampv2dialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,14 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_4">
<widget class="QCheckBox" name="cboConvertStandard">
<property name="text">
<string>Save as standard gradient</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand All @@ -500,20 +507,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cboConvertStandard">
<property name="text">
<string>Save as standard gradient</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit 4f41de8

Please sign in to comment.