Skip to content

Commit 79a57a2

Browse files
committedMay 25, 2014
Reduce margins on delete field dialog, save geometry
1 parent bd6df5a commit 79a57a2

File tree

3 files changed

+45
-17
lines changed

3 files changed

+45
-17
lines changed
 

‎src/app/qgsdelattrdialog.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "qgsfield.h"
2020
#include "qgsvectorlayer.h"
2121

22+
#include <QSettings>
23+
2224
QgsDelAttrDialog::QgsDelAttrDialog( const QgsVectorLayer* vl ): QDialog()
2325
{
2426
setupUi( this );
@@ -32,6 +34,15 @@ QgsDelAttrDialog::QgsDelAttrDialog( const QgsVectorLayer* vl ): QDialog()
3234
item->setData( Qt::UserRole, idx );
3335
}
3436
}
37+
38+
QSettings settings;
39+
restoreGeometry( settings.value( "/Windows/QgsDelAttrDialog/geometry" ).toByteArray() );
40+
}
41+
42+
QgsDelAttrDialog::~QgsDelAttrDialog()
43+
{
44+
QSettings settings;
45+
settings.setValue( "/Windows/QgsDelAttrDialog/geometry", saveGeometry() );
3546
}
3647

3748
QList<int> QgsDelAttrDialog::selectedAttributes()

‎src/app/qgsdelattrdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class APP_EXPORT QgsDelAttrDialog: public QDialog, private Ui::QgsDelAttrDialogB
2929
Q_OBJECT
3030
public:
3131
QgsDelAttrDialog( const QgsVectorLayer* vl );
32+
~QgsDelAttrDialog();
3233
/**Returns the selected attribute indices*/
3334
QList<int> selectedAttributes();
3435
};

‎src/ui/qgsdelattrdialogbase.ui

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,51 @@
1-
<ui version="4.0" >
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
23
<class>QgsDelAttrDialogBase</class>
3-
<widget class="QDialog" name="QgsDelAttrDialogBase" >
4-
<property name="geometry" >
4+
<widget class="QDialog" name="QgsDelAttrDialogBase">
5+
<property name="geometry">
56
<rect>
67
<x>0</x>
78
<y>0</y>
89
<width>360</width>
910
<height>238</height>
1011
</rect>
1112
</property>
12-
<property name="windowTitle" >
13+
<property name="windowTitle">
1314
<string>Delete Attributes</string>
1415
</property>
15-
<layout class="QGridLayout" >
16-
<item row="0" column="0" >
17-
<widget class="QListWidget" name="listBox2" >
18-
<property name="selectionMode" >
16+
<layout class="QGridLayout">
17+
<property name="leftMargin">
18+
<number>0</number>
19+
</property>
20+
<property name="topMargin">
21+
<number>0</number>
22+
</property>
23+
<property name="rightMargin">
24+
<number>0</number>
25+
</property>
26+
<property name="bottomMargin">
27+
<number>3</number>
28+
</property>
29+
<item row="0" column="0">
30+
<widget class="QListWidget" name="listBox2">
31+
<property name="frameShape">
32+
<enum>QFrame::NoFrame</enum>
33+
</property>
34+
<property name="selectionMode">
1935
<enum>QAbstractItemView::MultiSelection</enum>
2036
</property>
2137
</widget>
2238
</item>
23-
<item row="1" column="0" >
24-
<widget class="QDialogButtonBox" name="buttonBox" >
25-
<property name="standardButtons" >
26-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
39+
<item row="1" column="0">
40+
<widget class="QDialogButtonBox" name="buttonBox">
41+
<property name="standardButtons">
42+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
2743
</property>
2844
</widget>
2945
</item>
3046
</layout>
3147
</widget>
32-
<layoutdefault spacing="6" margin="11" />
48+
<layoutdefault spacing="6" margin="11"/>
3349
<resources/>
3450
<connections>
3551
<connection>
@@ -38,11 +54,11 @@
3854
<receiver>QgsDelAttrDialogBase</receiver>
3955
<slot>accept()</slot>
4056
<hints>
41-
<hint type="sourcelabel" >
57+
<hint type="sourcelabel">
4258
<x>314</x>
4359
<y>209</y>
4460
</hint>
45-
<hint type="destinationlabel" >
61+
<hint type="destinationlabel">
4662
<x>356</x>
4763
<y>188</y>
4864
</hint>
@@ -54,11 +70,11 @@
5470
<receiver>QgsDelAttrDialogBase</receiver>
5571
<slot>reject()</slot>
5672
<hints>
57-
<hint type="sourcelabel" >
73+
<hint type="sourcelabel">
5874
<x>234</x>
5975
<y>210</y>
6076
</hint>
61-
<hint type="destinationlabel" >
77+
<hint type="destinationlabel">
6278
<x>197</x>
6379
<y>189</y>
6480
</hint>

0 commit comments

Comments
 (0)
Please sign in to comment.