Skip to content
Permalink
Browse files

add simple help to cpt-city dialog

  • Loading branch information
etiennesky committed Apr 25, 2013
1 parent 43c2805 commit 4f41de83434b7a208f296a166b7e248a3caa7a4c
@@ -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?

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

0 comments on commit 4f41de8

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