Commit 6b9e6eb0 authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Port Ical dir resources dialog to QFormLayout

parent ee8bfccd
Pipeline #68842 canceled with stage
......@@ -32,67 +32,60 @@
<attribute name="title">
<string>Directory</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Directory Name</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Di&amp;rectory:</string>
</property>
<property name="buddy">
<cstring>kcfg_Path</cstring>
</property>
</widget>
</item>
<item>
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Select the directory whose contents should be represented by this resource. If the directory does not exist, it will be created.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<layout class="QFormLayout" name="verticalLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Di&amp;rectory:</string>
</property>
<property name="buddy">
<cstring>kcfg_Path</cstring>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Access Rights</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="kcfg_ReadOnly">
<property name="text">
<string>Read only</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>If read-only mode is enabled, no changes will be written to the directory selected above. Read-only mode will be automatically enabled if you do not have write access to the directory.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<item row="0" column="1">
<widget class="KUrlRequester" name="kcfg_Path"/>
</item>
<item row="1" column="1">
<widget class="QLabel" name="pathLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select the directory whose contents should be represented by this resource. If the directory does not exist, it will be created.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="kcfg_ReadOnly">
<property name="text">
<string>Read only</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="readOnlyLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="visible">
<bool>true</bool>
</property>
<property name="text">
<string>If read-only mode is enabled, no changes will be written to the directory selected above. Read-only mode will be automatically enabled if you do not have write access to the directory.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -114,9 +107,9 @@
<attribute name="title">
<string>Tuning</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_4">
<layout class="QFormLayout" name="verticalLayout_5">
<item row="0" columnspan="2">
<widget class="QLabel" name="runingLabel">
<property name="text">
<string>The options on this page allow you to change parameters that balance data safety and consistency against performance. In general you should be careful with changing anything here, the defaults are good enough in most cases.</string>
</property>
......@@ -125,39 +118,25 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="autosaveLabel">
<property name="text">
<string>Autosave delay:</string>
</property>
</widget>
</item>
<item>
<widget class="KPluralHandlingSpinBox" name="kcfg_AutosaveInterval">
<property name="minimum">
<number>0</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<item row="1" column="0">
<widget class="QLabel" name="autosaveLabel">
<property name="text">
<string>Autosave delay:</string>
</property>
<property name="buddy">
<cstring>kcfg_Path</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KPluralHandlingSpinBox" name="kcfg_AutosaveInterval">
<property name="minimum">
<number>0</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
......
......@@ -13,6 +13,7 @@
#include <KLocalizedString>
#include <QUrl>
#include <QFontDatabase>
#include <QPushButton>
#include <QTimer>
......@@ -34,6 +35,9 @@ IcalDirSettingsWidget::IcalDirSettingsWidget(const KSharedConfigPtr &config, QWi
ui.kcfg_Path->setUrl(QUrl::fromLocalFile(IcalDirResourceSettings::self()->path()));
ui.kcfg_AutosaveInterval->setSuffix(ki18np(" minute", " minutes"));
mManager = new KConfigDialogManager(mainWidget, IcalDirResourceSettings::self());
ui.readOnlyLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
ui.runingLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
ui.pathLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
}
void IcalDirSettingsWidget::validate()
......
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