summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-10-27 20:36:21 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-10-27 20:36:21 (GMT)
commitd88076fd00e0e3eb1789c1ce2ae1bc843d37ef6a (patch)
treebfd52c9e519624d7325c7b3681787de490e4addb
parent9450b9361249c6731e79cf009510686f3734f28c (diff)
Fix overlaping UI elements in key generate dialog.
REVIEW: 129269
-rw-r--r--kgpgkeygenerate.cpp19
-rw-r--r--kgpgkeygenerate.h1
-rw-r--r--kgpgkeygenerate.ui49
3 files changed, 41 insertions, 28 deletions
diff --git a/kgpgkeygenerate.cpp b/kgpgkeygenerate.cpp
index e0ed353..9e2fa68 100644
--- a/kgpgkeygenerate.cpp
+++ b/kgpgkeygenerate.cpp
@@ -60,28 +60,9 @@ KgpgKeyGenerate::KgpgKeyGenerate(QWidget *parent)
connect(m_kname, &QLineEdit::textChanged, this, &KgpgKeyGenerate::slotEnableOk);
- QWidget *hgroup = new QWidget(vgroup);
- QHBoxLayout *hgroupHBoxLayout = new QHBoxLayout(hgroup);
- hgroupHBoxLayout->setMargin(0);
- m_days->setParent(hgroup);
- QIntValidator *validator = new QIntValidator(m_days);
- validator->setBottom(0);
- m_days->setValidator(validator);
- m_days->setMaxLength(4);
- m_days->setDisabled(true);
-
- m_keyexp = new QComboBox(hgroup);
- hgroupHBoxLayout->addWidget(m_keyexp);
- m_keyexp->addItem(i18nc("Key will not expire", "Never"), 0);
- m_keyexp->addItem(i18n("Days"), 1);
- m_keyexp->addItem(i18n("Weeks"), 2);
- m_keyexp->addItem(i18n("Months"), 3);
- m_keyexp->addItem(i18n("Years"), 4);
m_keyexp->setMinimumSize(m_keyexp->sizeHint());
connect(m_keyexp, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &KgpgKeyGenerate::slotEnableDays);
- qobject_cast<QVBoxLayout *>(vgroup->layout())->insertWidget(7, hgroup);
-
m_keysize->addItem(i18n("1024"));
m_keysize->addItem(i18n("2048"));
m_keysize->addItem(i18n("4096"));
diff --git a/kgpgkeygenerate.h b/kgpgkeygenerate.h
index 7df71ce..4fff6db 100644
--- a/kgpgkeygenerate.h
+++ b/kgpgkeygenerate.h
@@ -56,7 +56,6 @@ private slots:
private:
QPushButton *okButton;
- QComboBox *m_keyexp;
bool m_expert;
};
diff --git a/kgpgkeygenerate.ui b/kgpgkeygenerate.ui
index 2e0cbd0..544c716 100644
--- a/kgpgkeygenerate.ui
+++ b/kgpgkeygenerate.ui
@@ -77,17 +77,50 @@
<property name="text">
<string>Expiration:</string>
</property>
- <property name="buddy">
- <cstring>m_days</cstring>
- </property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="m_days">
- <property name="text">
- <string>0</string>
- </property>
- </widget>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QSpinBox" name="m_days">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maximum">
+ <number>9999</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="m_keyexp">
+ <item>
+ <property name="text">
+ <string comment="Key will not expire">Never</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Days</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Weeks</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Months</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Years</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
<widget class="QLabel" name="label_4">