Skip to content

Commit

Permalink
Merge pull request #5732 from DelazJ/colorDialogTitle
Browse files Browse the repository at this point in the history
Some general tweaks to dialogs
  • Loading branch information
nyalldawson committed Dec 11, 2017
2 parents 6e18210 + d281b44 commit 6c9a75f
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/app/qgsdiagramproperties.cpp
Expand Up @@ -1039,9 +1039,10 @@ void QgsDiagramProperties::showSizeLegendDialog()
dlg.setLayout( new QVBoxLayout() );
dlg.setWindowTitle( panel->panelTitle() );
dlg.layout()->addWidget( panel );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Help | QDialogButtonBox::Ok );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDiagramProperties::showHelp );
connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
dlg.layout()->addWidget( buttonBox );
if ( dlg.exec() )
mSizeLegend.reset( panel->dataDefinedSizeLegend() );
Expand Down
11 changes: 10 additions & 1 deletion src/gui/qgscolorbrewercolorrampdialog.cpp
Expand Up @@ -17,6 +17,8 @@

#include "qgscolorramp.h"
#include "qgssymbollayerutils.h"
#include "qgshelp.h"

#include <QAbstractButton>
#include <QDialogButtonBox>

Expand Down Expand Up @@ -124,10 +126,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" ) );
}
4 changes: 4 additions & 0 deletions src/gui/qgscolorbrewercolorrampdialog.h
Expand Up @@ -118,6 +118,10 @@ class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog

QgsColorBrewerColorRampWidget *mWidget = nullptr;

private slots:

void showHelp();

};

#endif
10 changes: 9 additions & 1 deletion src/gui/qgslimitedrandomcolorrampdialog.cpp
Expand Up @@ -17,6 +17,7 @@

#include "qgssymbollayerutils.h"
#include "qgscolorramp.h"
#include "qgshelp.h"

#include <QColorDialog>
#include <QDialogButtonBox>
Expand Down Expand Up @@ -121,10 +122,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" ) );
}
4 changes: 4 additions & 0 deletions src/gui/qgslimitedrandomcolorrampdialog.h
Expand Up @@ -129,6 +129,10 @@ class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog

QgsLimitedRandomColorRampWidget *mWidget = nullptr;

private slots:

void showHelp();

};

#endif
9 changes: 8 additions & 1 deletion src/gui/qgspresetcolorrampdialog.cpp
Expand Up @@ -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" ) );
}
4 changes: 4 additions & 0 deletions src/gui/qgspresetcolorrampdialog.h
Expand Up @@ -117,6 +117,10 @@ class GUI_EXPORT QgsPresetColorRampDialog : public QDialog

QgsPresetColorRampWidget *mWidget = nullptr;

private slots:

void showHelp();

};

#endif //QGSPRESETCOLORRAMPDIALOG_H
1 change: 1 addition & 0 deletions src/gui/symbology/qgscptcitycolorrampdialog.cpp
Expand Up @@ -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();
}
Expand Down
9 changes: 8 additions & 1 deletion src/gui/symbology/qgssymbollevelsdialog.cpp
Expand Up @@ -184,19 +184,26 @@ QgsSymbolLevelsDialog::QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool
QVBoxLayout *vLayout = new QVBoxLayout();
mWidget = new QgsSymbolLevelsWidget( renderer, usingSymbolLevels );
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, mWidget, &QgsSymbolLevelsWidget::apply );
connect( bbox, &QDialogButtonBox::accepted, this, &QgsSymbolLevelsDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QgsSymbolLevelsDialog::reject );
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsSymbolLevelsDialog::showHelp );
vLayout->addWidget( bbox );
setLayout( vLayout );
setWindowTitle( tr( "Symbol Levels" ) );
}

void QgsSymbolLevelsDialog::setForceOrderingEnabled( bool enabled )
{
mWidget->setForceOrderingEnabled( enabled );
}

void QgsSymbolLevelsDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#symbols-levels" ) );
}

/// @cond PRIVATE

QWidget *SpinBoxDelegate::createEditor( QWidget *parent, const QStyleOptionViewItem &, const QModelIndex & ) const
Expand Down
3 changes: 3 additions & 0 deletions src/gui/symbology/qgssymbollevelsdialog.h
Expand Up @@ -102,6 +102,9 @@ class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog

QgsSymbolLevelsWidget *mWidget = nullptr;

private slots:

void showHelp();
};

#ifndef SIP_RUN
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgspresetcolorrampwidgetbase.ui
Expand Up @@ -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>
Expand Down

0 comments on commit 6c9a75f

Please sign in to comment.