Commit 5c180193 authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Port Google Groupware resources to QFormLayout

parent 82856deb
Pipeline #69533 failed with stage
in 12 minutes
......@@ -114,9 +114,11 @@ void GoogleSettingsDialog::accountChanged()
{
if (!m_account) {
m_ui->accountLabel->setText(i18n("<b>not configured</b>"));
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);
});
}
......@@ -6,145 +6,175 @@
<rect>
<x>0</x>
<y>0</y>
<width>584</width>
<width>704</width>
<height>680</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="minimumSize">
<size>
<width>500</width>
<height>300</height>
</size>
</property>
<layout class="QFormLayout" name="verticalLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="accountTextLabel">
<property name="text">
<string>Account:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="accountLabel">
<property name="text">
<string>&lt;b&gt;not configured&lt;/b&gt;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="configureBtn">
<property name="icon">
<iconset theme="configure">
<normaloff/>
</iconset>
</property>
<property name="text">
<string>Configure...</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="enableRefresh">
<property name="text">
<string>Enable interval refresh</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="refreshLabel">
<property name="text">
<string>Refresh interval:</string>
</property>
<property name="buddy">
<cstring>refreshSpinBox</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KPluralHandlingSpinBox" name="refreshSpinBox">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>720</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="eventsLimitLabel">
<property name="text">
<string>Fetch only events since:</string>
</property>
<property name="buddy">
<cstring>eventsLimitCombo</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="KDateComboBox" name="eventsLimitCombo"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="calendarsLabel">
<property name="text">
<string>Enabled Calendars:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>calendarsList</cstring>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QListWidget" name="calendarsList"/>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="accountTextLabel">
<property name="text">
<string>Account:</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item>
<widget class="QLabel" name="accountLabel">
<widget class="QPushButton" name="reloadCalendarsBtn">
<property name="text">
<string>&lt;b&gt;not configured&lt;/b&gt;</string>
<string>Reload</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="configureBtn">
<property name="text">
<string>Configure...</string>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.
</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="refreshBox">
<property name="title">
<string>Refresh</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="refreshLabel">
<property name="text">
<string>Refresh interval:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>refreshSpinBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KPluralHandlingSpinBox" name="refreshSpinBox">
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>720</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="enableRefresh">
<property name="text">
<string>Enable interval refresh</string>
</property>
</widget>
</item>
</layout>
<item row="8" column="0">
<widget class="QLabel" name="taskListsLabel">
<property name="text">
<string>Enabled Tasklists:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>taskListsList</cstring>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="calendarsBox">
<property name="title">
<string>Calendars</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
<widget class="QListWidget" name="calendarsList"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="eventsLimitLabel">
<property name="text">
<string>Fetch only events since</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>eventsLimitCombo</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="KDateComboBox" name="eventsLimitCombo"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QPushButton" name="reloadCalendarsBtn">
<property name="text">
<string>Reload</string>
</property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<item row="9" column="0" colspan="2">
<widget class="QListWidget" name="taskListsList"/>
</item>
<item>
<widget class="QGroupBox" name="taskListsBox">
<property name="title">
<string>Tasklists</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="taskListsList"/>
</item>
<item>
<widget class="QPushButton" name="reloadTaskListsBtn">
<property name="text">
<string>Reload</string>
</property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<item row="10" column="1">
<layout class="QHBoxLayout">
<item>
<spacer name="horizontalSpacer1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="reloadTaskListsBtn">
<property name="text">
<string>Reload</string>
</property>
<property name="icon">
<iconset theme="view-refresh">
<normaloff>.</normaloff>.
</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
......
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