From 6fcd09700f8fdd9fa6a9156f4bfdb67607aff4e9 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 6 Jul 2021 11:31:48 +0200 Subject: [PATCH 1/2] Port Google Groupware resources to QFormLayout --- .../google-groupware/googlesettingsdialog.cpp | 24 +- .../google-groupware/googlesettingsdialog.ui | 246 ++++++++++-------- 2 files changed, 153 insertions(+), 117 deletions(-) diff --git a/resources/google-groupware/googlesettingsdialog.cpp b/resources/google-groupware/googlesettingsdialog.cpp index d4f022cef..2edc36548 100644 --- a/resources/google-groupware/googlesettingsdialog.cpp +++ b/resources/google-groupware/googlesettingsdialog.cpp @@ -114,9 +114,11 @@ void GoogleSettingsDialog::accountChanged() { if (!m_account) { m_ui->accountLabel->setText(i18n("not configured")); - m_ui->calendarsBox->setDisabled(true); + m_ui->calendarsList->setDisabled(true); + m_ui->reloadCalendarsBtn->setDisabled(true); m_ui->calendarsList->clear(); - m_ui->taskListsBox->setDisabled(true); + m_ui->taskListsList->setDisabled(true); + m_ui->reloadTaskListsBtn->setDisabled(true); m_ui->taskListsList->clear(); return; } @@ -203,7 +205,8 @@ void GoogleSettingsDialog::slotSaveSettings() void GoogleSettingsDialog::slotReloadCalendars() { - m_ui->calendarsBox->setDisabled(true); + m_ui->calendarsList->setDisabled(true); + m_ui->reloadCalendarsBtn->setDisabled(true); m_ui->calendarsList->clear(); if (!m_account) { @@ -213,7 +216,8 @@ void GoogleSettingsDialog::slotReloadCalendars() auto fetchJob = new CalendarFetchJob(m_account, this); connect(fetchJob, &CalendarFetchJob::finished, this, [this](KGAPI2::Job *job) { if (!handleError(job) || !m_account) { - m_ui->calendarsBox->setEnabled(false); + m_ui->calendarsList->setEnabled(false); + m_ui->reloadCalendarsBtn->setEnabled(false); return; } @@ -234,7 +238,8 @@ void GoogleSettingsDialog::slotReloadCalendars() m_ui->calendarsList->addItem(item); } - m_ui->calendarsBox->setEnabled(true); + m_ui->calendarsList->setEnabled(true); + m_ui->reloadCalendarsBtn->setEnabled(true); }); } @@ -244,13 +249,15 @@ void GoogleSettingsDialog::slotReloadTaskLists() return; } - m_ui->taskListsBox->setDisabled(true); + m_ui->taskListsList->setDisabled(true); + m_ui->reloadTaskListsBtn->setDisabled(true); m_ui->taskListsList->clear(); auto job = new TaskListFetchJob(m_account, this); connect(job, &TaskListFetchJob::finished, this, [this](KGAPI2::Job *job) { if (!handleError(job) || !m_account) { - m_ui->taskListsBox->setDisabled(true); + m_ui->taskListsList->setDisabled(true); + m_ui->reloadTaskListsBtn->setDisabled(true); return; } @@ -271,6 +278,7 @@ void GoogleSettingsDialog::slotReloadTaskLists() m_ui->taskListsList->addItem(item); } - m_ui->taskListsBox->setEnabled(true); + m_ui->taskListsList->setEnabled(true); + m_ui->reloadTaskListsBtn->setEnabled(true); }); } diff --git a/resources/google-groupware/googlesettingsdialog.ui b/resources/google-groupware/googlesettingsdialog.ui index c3bb1a380..b42c26fc8 100644 --- a/resources/google-groupware/googlesettingsdialog.ui +++ b/resources/google-groupware/googlesettingsdialog.ui @@ -10,19 +10,16 @@ 680 - - + + + + + Account: + + + + - - - - Account: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - @@ -32,6 +29,11 @@ + + + + + Configure... @@ -39,113 +41,139 @@ - - - - Refresh + + + + Enable interval refresh - - false + + + + + + Refresh interval: + + + refreshSpinBox - - - - - Refresh interval: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - refreshSpinBox - - - - - - - 10 - - - 720 - - - 30 - - - - - - - Enable interval refresh - - - - - - - - Calendars + + + + 10 + + + 720 + + + 30 - - - - - - - - Fetch only events since - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - eventsLimitCombo - - - - - - - - - - Reload - - - - .. - - - - - - - - Tasklists + + + + Fetch only events since: + + + eventsLimitCombo - - - - - - - - Reload - - - - .. - - - - + + + + + + + Enabled Calendars: + + + Qt::AlignLeft|Qt::AlignTrailing|Qt::AlignVCenter + + + calendarsList + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Reload + + + + .. + + + + + + + + + + Enabled Tasklists: + + + Qt::AlignLeft|Qt::AlignTrailing|Qt::AlignVCenter + + + taskListsList + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Reload + + + + .. + + + + + + -- GitLab From cf73ac958d25dadc68d5337260a80ead33fbd091 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 6 Jul 2021 16:19:35 +0200 Subject: [PATCH 2/2] Change configure button position and add min width --- .../google-groupware/googlesettingsdialog.ui | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/resources/google-groupware/googlesettingsdialog.ui b/resources/google-groupware/googlesettingsdialog.ui index b42c26fc8..9ff9bc93b 100644 --- a/resources/google-groupware/googlesettingsdialog.ui +++ b/resources/google-groupware/googlesettingsdialog.ui @@ -6,10 +6,16 @@ 0 0 - 584 + 704 680 + + + 500 + 300 + + @@ -19,36 +25,32 @@ - - - - - <b>not configured</b> - - - - - - - - - - - - Configure... - - - - + + + <b>not configured</b> + + + + + + + + + + Configure... + + + + Enable interval refresh - + Refresh interval: @@ -58,7 +60,7 @@ - + 10 @@ -71,7 +73,7 @@ - + Fetch only events since: @@ -81,10 +83,10 @@ - + - + Enabled Calendars: @@ -97,10 +99,10 @@ - + - + @@ -129,7 +131,7 @@ - + Enabled Tasklists: @@ -142,13 +144,13 @@ - + - + - + Qt::Horizontal -- GitLab