Commit 0ee8f39b authored by JanKusanagi's avatar JanKusanagi

Switch FilterEditor and EmailChanger to QDialogButtonBox

parent 35d5b71a
v1.4.2
- Make Ok/Cancel buttons in dialogs follow environment style.
- Make Ok/Cancel buttons in dialogs follow environment style. (WIP)
- Option to open attachments without saving them.
......
......@@ -78,6 +78,9 @@ EmailChanger::EmailChanger(QString explanation,
connect(m_cancelButton, &QAbstractButton::clicked,
this, &EmailChanger::cancelDialog);
m_bottomButtonBox = new QDialogButtonBox(this);
m_bottomButtonBox->addButton(m_changeButton, QDialogButtonBox::AcceptRole);
m_bottomButtonBox->addButton(m_cancelButton, QDialogButtonBox::RejectRole);
// ESC to cancel, too
......@@ -95,11 +98,6 @@ EmailChanger::EmailChanger(QString explanation,
m_middleLayout->addRow(tr("Again:"), m_mailRepeatLineEdit);
m_middleLayout->addRow(tr("Your Password:"), m_passwordLineEdit);
m_bottomLayout = new QHBoxLayout();
m_bottomLayout->setAlignment(Qt::AlignRight);
m_bottomLayout->addWidget(m_changeButton);
m_bottomLayout->addWidget(m_cancelButton);
m_mainLayout = new QVBoxLayout();
m_mainLayout->addWidget(m_infoLabel);
m_mainLayout->addSpacing(8);
......@@ -109,7 +107,7 @@ EmailChanger::EmailChanger(QString explanation,
m_mainLayout->addWidget(m_errorsLabel, 2);
m_mainLayout->addStretch(1);
m_mainLayout->addSpacing(8);
m_mainLayout->addLayout(m_bottomLayout);
m_mainLayout->addWidget(m_bottomButtonBox);
this->setLayout(m_mainLayout);
qDebug() << "EmailChanger created";
......
......@@ -25,8 +25,8 @@
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QHBoxLayout>
#include <QAction>
#include <QCloseEvent>
......@@ -64,7 +64,7 @@ protected:
private:
QVBoxLayout *m_mainLayout;
QFormLayout *m_middleLayout;
QHBoxLayout *m_bottomLayout;
QDialogButtonBox *m_bottomButtonBox;
QLabel *m_infoLabel;
......
......@@ -134,6 +134,11 @@ FilterEditor::FilterEditor(FilterChecker *filterChecker,
connect(m_cancelButton, &QAbstractButton::clicked,
this, &QWidget::hide);
m_bottomButtonBox = new QDialogButtonBox(this);
m_bottomButtonBox->addButton(m_saveButton, QDialogButtonBox::AcceptRole);
m_bottomButtonBox->addButton(m_cancelButton, QDialogButtonBox::RejectRole);
m_closeAction = new QAction(this);
m_closeAction->setShortcut(QKeySequence(Qt::Key_Escape));
connect(m_closeAction, &QAction::triggered,
......@@ -166,11 +171,6 @@ FilterEditor::FilterEditor(FilterChecker *filterChecker,
m_currentFiltersGroupBox->setLayout(m_middleLayout);
m_bottomLayout = new QHBoxLayout();
m_bottomLayout->setAlignment(Qt::AlignRight);
m_bottomLayout->addWidget(m_saveButton);
m_bottomLayout->addWidget(m_cancelButton);
m_mainLayout = new QVBoxLayout();
m_mainLayout->addWidget(m_explanationLabel);
m_mainLayout->addSpacing(4);
......@@ -178,7 +178,7 @@ FilterEditor::FilterEditor(FilterChecker *filterChecker,
m_mainLayout->addSpacing(2);
m_mainLayout->addWidget(m_currentFiltersGroupBox);
m_mainLayout->addSpacing(8);
m_mainLayout->addLayout(m_bottomLayout);
m_mainLayout->addWidget(m_bottomButtonBox);
this->setLayout(m_mainLayout);
......
......@@ -30,6 +30,7 @@
#include <QComboBox>
#include <QLineEdit>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QListWidget>
#include <QVariantList>
#include <QVariantMap>
......@@ -77,7 +78,7 @@ private:
QGroupBox *m_newFilterGroupBox;
QVBoxLayout *m_middleLayout;
QGroupBox *m_currentFiltersGroupBox;
QHBoxLayout *m_bottomLayout;
QDialogButtonBox *m_bottomButtonBox;
QAction *m_closeAction;
......
......@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
{
QApplication dianaraApp(argc, argv);
dianaraApp.setApplicationName("Dianara");
dianaraApp.setApplicationVersion("1.4.2-dev+4");
dianaraApp.setApplicationVersion("1.4.2-dev+5");
dianaraApp.setOrganizationName("JanCoding");
dianaraApp.setOrganizationDomain("jancoding.wordpress.com");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment