Skip to content
Permalink
Browse files

Enable help button and title in color dialogs

  • Loading branch information
DelazJ committed Nov 26, 2017
1 parent 297138f commit 99568643e3a79eb21f90fc386c2e8d2bc937a25b
@@ -124,10 +124,17 @@ QgsColorBrewerColorRampDialog::QgsColorBrewerColorRampDialog( const QgsColorBrew
QVBoxLayout *vLayout = new QVBoxLayout();
mWidget = new QgsColorBrewerColorRampWidget( ramp );
vLayout->addWidget( mWidget );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsColorBrewerColorRampDialog::showHelp );
vLayout->addWidget( bbox );
setLayout( vLayout );
setWindowTitle( tr( "ColorBrewer Ramp" ) );
connect( mWidget, &QgsColorBrewerColorRampWidget::changed, this, &QgsColorBrewerColorRampDialog::changed );
}

void QgsColorBrewerColorRampDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
}
@@ -19,6 +19,7 @@
#include <QDialog>
#include "qgspanelwidget.h"
#include "qgscolorramp.h"
#include "qgshelp.h"
#include "ui_qgscolorbrewercolorrampwidgetbase.h"
#include "qgis_gui.h"
#include "qgis.h"
@@ -118,6 +119,10 @@ class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog

QgsColorBrewerColorRampWidget *mWidget = nullptr;

private slots:

void showHelp();

};

#endif
@@ -121,10 +121,17 @@ QgsLimitedRandomColorRampDialog::QgsLimitedRandomColorRampDialog( const QgsLimit
QVBoxLayout *vLayout = new QVBoxLayout();
mWidget = new QgsLimitedRandomColorRampWidget( ramp );
vLayout->addWidget( mWidget );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsLimitedRandomColorRampDialog::showHelp );
vLayout->addWidget( bbox );
setLayout( vLayout );
setWindowTitle( tr( "Random Color Ramp" ) );
connect( mWidget, &QgsLimitedRandomColorRampWidget::changed, this, &QgsLimitedRandomColorRampDialog::changed );
}

void QgsLimitedRandomColorRampDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
}
@@ -20,6 +20,7 @@
#include "qgis.h"
#include "qgspanelwidget.h"
#include "qgscolorramp.h"
#include "qgshelp.h"
#include "ui_qgslimitedrandomcolorrampwidgetbase.h"
#include "qgis_gui.h"

@@ -129,6 +130,10 @@ class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog

QgsLimitedRandomColorRampWidget *mWidget = nullptr;

private slots:

void showHelp();

};

#endif
@@ -112,10 +112,17 @@ QgsPresetColorRampDialog::QgsPresetColorRampDialog( const QgsPresetSchemeColorRa
QVBoxLayout *vLayout = new QVBoxLayout();
mWidget = new QgsPresetColorRampWidget( ramp );
vLayout->addWidget( mWidget );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsPresetColorRampDialog::showHelp );
vLayout->addWidget( bbox );
setLayout( vLayout );
setWindowTitle( tr( "Color Presets Ramp" ) );
connect( mWidget, &QgsPresetColorRampWidget::changed, this, &QgsPresetColorRampDialog::changed );
}

void QgsPresetColorRampDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
}
@@ -20,6 +20,7 @@
#include "qgis.h"
#include "qgspanelwidget.h"
#include "qgscolorramp.h"
#include "qgshelp.h"
#include "ui_qgspresetcolorrampwidgetbase.h"
#include "qgis_gui.h"

@@ -117,6 +118,10 @@ class GUI_EXPORT QgsPresetColorRampDialog : public QDialog

QgsPresetColorRampWidget *mWidget = nullptr;

private slots:

void showHelp();

};

#endif //QGSPRESETCOLORRAMPDIALOG_H
@@ -464,6 +464,7 @@ void QgsCptCityColorRampDialog::showHelp()
"(you must enable Experimental plugins in the plugin manager).\n\n"
);
QMessageBox *msg = new QMessageBox( this );
msg->setWindowTitle( tr( "Download more cpt-city Gradients" ) );
msg->setText( helpText );
msg->exec();
}
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>ColorBrewer Ramp</string>
<string>Color Presets Ramp</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0">
<item>

0 comments on commit 9956864

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