Skip to content

Commit 6c9a75f

Browse files
authoredDec 11, 2017
Merge pull request #5732 from DelazJ/colorDialogTitle
Some general tweaks to dialogs
2 parents 6e18210 + d281b44 commit 6c9a75f

11 files changed

+54
-6
lines changed
 

‎src/app/qgsdiagramproperties.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,9 +1039,10 @@ void QgsDiagramProperties::showSizeLegendDialog()
10391039
dlg.setLayout( new QVBoxLayout() );
10401040
dlg.setWindowTitle( panel->panelTitle() );
10411041
dlg.layout()->addWidget( panel );
1042-
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Help | QDialogButtonBox::Ok );
1042+
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
10431043
connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
10441044
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDiagramProperties::showHelp );
1045+
connect( buttonBox, &QDialogButtonBox::rejected, &dlg, &QDialog::reject );
10451046
dlg.layout()->addWidget( buttonBox );
10461047
if ( dlg.exec() )
10471048
mSizeLegend.reset( panel->dataDefinedSizeLegend() );

‎src/gui/qgscolorbrewercolorrampdialog.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include "qgscolorramp.h"
1919
#include "qgssymbollayerutils.h"
20+
#include "qgshelp.h"
21+
2022
#include <QAbstractButton>
2123
#include <QDialogButtonBox>
2224

@@ -124,10 +126,17 @@ QgsColorBrewerColorRampDialog::QgsColorBrewerColorRampDialog( const QgsColorBrew
124126
QVBoxLayout *vLayout = new QVBoxLayout();
125127
mWidget = new QgsColorBrewerColorRampWidget( ramp );
126128
vLayout->addWidget( mWidget );
127-
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
129+
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
128130
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
129131
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
132+
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsColorBrewerColorRampDialog::showHelp );
130133
vLayout->addWidget( bbox );
131134
setLayout( vLayout );
135+
setWindowTitle( tr( "ColorBrewer Ramp" ) );
132136
connect( mWidget, &QgsColorBrewerColorRampWidget::changed, this, &QgsColorBrewerColorRampDialog::changed );
133137
}
138+
139+
void QgsColorBrewerColorRampDialog::showHelp()
140+
{
141+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
142+
}

‎src/gui/qgscolorbrewercolorrampdialog.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ class GUI_EXPORT QgsColorBrewerColorRampDialog : public QDialog
118118

119119
QgsColorBrewerColorRampWidget *mWidget = nullptr;
120120

121+
private slots:
122+
123+
void showHelp();
124+
121125
};
122126

123127
#endif

‎src/gui/qgslimitedrandomcolorrampdialog.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "qgssymbollayerutils.h"
1919
#include "qgscolorramp.h"
20+
#include "qgshelp.h"
2021

2122
#include <QColorDialog>
2223
#include <QDialogButtonBox>
@@ -121,10 +122,17 @@ QgsLimitedRandomColorRampDialog::QgsLimitedRandomColorRampDialog( const QgsLimit
121122
QVBoxLayout *vLayout = new QVBoxLayout();
122123
mWidget = new QgsLimitedRandomColorRampWidget( ramp );
123124
vLayout->addWidget( mWidget );
124-
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
125+
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
125126
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
126127
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
128+
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsLimitedRandomColorRampDialog::showHelp );
127129
vLayout->addWidget( bbox );
128130
setLayout( vLayout );
131+
setWindowTitle( tr( "Random Color Ramp" ) );
129132
connect( mWidget, &QgsLimitedRandomColorRampWidget::changed, this, &QgsLimitedRandomColorRampDialog::changed );
130133
}
134+
135+
void QgsLimitedRandomColorRampDialog::showHelp()
136+
{
137+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
138+
}

‎src/gui/qgslimitedrandomcolorrampdialog.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ class GUI_EXPORT QgsLimitedRandomColorRampDialog : public QDialog
129129

130130
QgsLimitedRandomColorRampWidget *mWidget = nullptr;
131131

132+
private slots:
133+
134+
void showHelp();
135+
132136
};
133137

134138
#endif

‎src/gui/qgspresetcolorrampdialog.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,17 @@ QgsPresetColorRampDialog::QgsPresetColorRampDialog( const QgsPresetSchemeColorRa
112112
QVBoxLayout *vLayout = new QVBoxLayout();
113113
mWidget = new QgsPresetColorRampWidget( ramp );
114114
vLayout->addWidget( mWidget );
115-
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
115+
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
116116
connect( bbox, &QDialogButtonBox::accepted, this, &QDialog::accept );
117117
connect( bbox, &QDialogButtonBox::rejected, this, &QDialog::reject );
118+
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsPresetColorRampDialog::showHelp );
118119
vLayout->addWidget( bbox );
119120
setLayout( vLayout );
121+
setWindowTitle( tr( "Color Presets Ramp" ) );
120122
connect( mWidget, &QgsPresetColorRampWidget::changed, this, &QgsPresetColorRampDialog::changed );
121123
}
124+
125+
void QgsPresetColorRampDialog::showHelp()
126+
{
127+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
128+
}

‎src/gui/qgspresetcolorrampdialog.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ class GUI_EXPORT QgsPresetColorRampDialog : public QDialog
117117

118118
QgsPresetColorRampWidget *mWidget = nullptr;
119119

120+
private slots:
121+
122+
void showHelp();
123+
120124
};
121125

122126
#endif //QGSPRESETCOLORRAMPDIALOG_H

‎src/gui/symbology/qgscptcitycolorrampdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ void QgsCptCityColorRampDialog::showHelp()
464464
"(you must enable Experimental plugins in the plugin manager).\n\n"
465465
);
466466
QMessageBox *msg = new QMessageBox( this );
467+
msg->setWindowTitle( tr( "Download more cpt-city Gradients" ) );
467468
msg->setText( helpText );
468469
msg->exec();
469470
}

‎src/gui/symbology/qgssymbollevelsdialog.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,26 @@ QgsSymbolLevelsDialog::QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool
184184
QVBoxLayout *vLayout = new QVBoxLayout();
185185
mWidget = new QgsSymbolLevelsWidget( renderer, usingSymbolLevels );
186186
vLayout->addWidget( mWidget );
187-
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
187+
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
188188
connect( bbox, &QDialogButtonBox::accepted, mWidget, &QgsSymbolLevelsWidget::apply );
189189
connect( bbox, &QDialogButtonBox::accepted, this, &QgsSymbolLevelsDialog::accept );
190190
connect( bbox, &QDialogButtonBox::rejected, this, &QgsSymbolLevelsDialog::reject );
191+
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsSymbolLevelsDialog::showHelp );
191192
vLayout->addWidget( bbox );
192193
setLayout( vLayout );
194+
setWindowTitle( tr( "Symbol Levels" ) );
193195
}
194196

195197
void QgsSymbolLevelsDialog::setForceOrderingEnabled( bool enabled )
196198
{
197199
mWidget->setForceOrderingEnabled( enabled );
198200
}
199201

202+
void QgsSymbolLevelsDialog::showHelp()
203+
{
204+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#symbols-levels" ) );
205+
}
206+
200207
/// @cond PRIVATE
201208

202209
QWidget *SpinBoxDelegate::createEditor( QWidget *parent, const QStyleOptionViewItem &, const QModelIndex & ) const

‎src/gui/symbology/qgssymbollevelsdialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog
102102

103103
QgsSymbolLevelsWidget *mWidget = nullptr;
104104

105+
private slots:
106+
107+
void showHelp();
105108
};
106109

107110
#ifndef SIP_RUN

‎src/ui/qgspresetcolorrampwidgetbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>ColorBrewer Ramp</string>
14+
<string>Color Presets Ramp</string>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0,0">
1717
<item>

0 commit comments

Comments
 (0)
Please sign in to comment.