Skip to content

Commit

Permalink
Fixed dialog window titles
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Jan 18, 2021
1 parent 8a9fa3a commit 3897e0b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/app/qgsrelationadddlg.cpp
Expand Up @@ -40,7 +40,6 @@ QgsRelationAddDlg::QgsRelationAddDlg( QWidget *parent )
, Ui::QgsRelationManagerAddDialogBase()
{
setupUi( this );
setWindowTitle( tr( "Add New Relation" ) );

mReferencedLayerCombobox = new QgsMapLayerComboBox( this );
mReferencedLayerCombobox->setFilters( QgsMapLayerProxyModel::VectorLayer );
Expand Down
8 changes: 6 additions & 2 deletions src/app/qgsrelationaddpolymorphicdlg.cpp
Expand Up @@ -33,12 +33,16 @@
#include "qgsrelationmanager.h"
#include "qgsfieldexpressionwidget.h"

QgsRelationAddPolymorphicDlg::QgsRelationAddPolymorphicDlg( QWidget *parent )
QgsRelationAddPolymorphicDlg::QgsRelationAddPolymorphicDlg( bool isEditDialog, QWidget *parent )
: QDialog( parent )
, Ui::QgsRelationManagerAddPolymorphicDialogBase()
, mIsEditDialog( isEditDialog )
{
setupUi( this );
setWindowTitle( tr( "Add New Polymorphic Relation" ) );

setWindowTitle( mIsEditDialog
? tr( "Edit Polymorphic Relation" )
: tr( "Add Polymorphic Relation" ) );

mButtonBox->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsRelationAddPolymorphicDlg::accept );
Expand Down
4 changes: 3 additions & 1 deletion src/app/qgsrelationaddpolymorphicdlg.h
Expand Up @@ -41,7 +41,7 @@ class APP_EXPORT QgsRelationAddPolymorphicDlg : public QDialog, private Ui::QgsR
Q_OBJECT

public:
explicit QgsRelationAddPolymorphicDlg( QWidget *parent = nullptr );
explicit QgsRelationAddPolymorphicDlg( bool isEditDialog, QWidget *parent = nullptr );

/**
* Returns the id of the referencing layer
Expand Down Expand Up @@ -103,6 +103,8 @@ class APP_EXPORT QgsRelationAddPolymorphicDlg : public QDialog, private Ui::QgsR
bool isDefinitionValid();
void updateFieldsMapping();

bool mIsEditDialog = false;

};

#endif // QGSRELATIONADDPOLYMORPHICDLG_H
4 changes: 2 additions & 2 deletions src/app/qgsrelationmanagerdialog.cpp
Expand Up @@ -246,7 +246,7 @@ void QgsRelationManagerDialog::mBtnAddRelation_clicked()

void QgsRelationManagerDialog::mActionAddPolymorphicRelation_triggered()
{
QgsRelationAddPolymorphicDlg addDlg;
QgsRelationAddPolymorphicDlg addDlg( false );

if ( addDlg.exec() )
{
Expand Down Expand Up @@ -274,7 +274,7 @@ void QgsRelationManagerDialog::mActionAddPolymorphicRelation_triggered()

void QgsRelationManagerDialog::mActionEditPolymorphicRelation_triggered()
{
QgsRelationAddPolymorphicDlg addDlg;
QgsRelationAddPolymorphicDlg addDlg( true );
const QModelIndexList rows = mRelationsTree->selectionModel()->selectedRows();

if ( rows.size() != 1 )
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsrelationmanageradddialogbase.ui
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
<string>Add Relation</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,2,0">
<item row="3" column="0">
Expand Down
4 changes: 2 additions & 2 deletions src/ui/qgsrelationmanageraddpolymorphicdialogbase.ui
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
<string>Add Polymorphic Relation</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,2,0">
<item row="1" column="0">
Expand Down Expand Up @@ -155,7 +155,7 @@
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QgsFieldExpressionWidget" name="mReferencedLayerExpressionWidget"/>
<widget class="QgsFieldExpressionWidget" name="mReferencedLayerExpressionWidget" native="true"/>
</item>
<item row="6" column="0">
<widget class="QLabel" name="mRelationStrengthLabel">
Expand Down

0 comments on commit 3897e0b

Please sign in to comment.