Commit 580c3b60 authored by Enrico Ros's avatar Enrico Ros
Browse files

Added KConfigXT configuration management system.

The config class is Settings. Mutators are static.
Define new properties editing kpdf.kcfg with kdeextragear-3/kcfgcreator and
use setProperty( Type val ) and (val)property() to set/get property value.

svn path=/branches/kpdf_experiments/kdegraphics/kpdf/; revision=358206
parent dec5dbb3
noinst_LTLIBRARIES = libconf.la
libconf_la_SOURCES = dlggeneral.ui preferencesdialog.cpp \
settings.kcfgc
INCLUDES = -I$(srcdir)/.. $(all_includes)
METASOURCES = AUTO
kde_kcfg_DATA = kpdf.kcfg
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>DlgNetwork</class>
<widget class="QWidget">
<property name="name">
<cstring>DlgNetwork</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>332</width>
<height>315</height>
</rect>
</property>
<property name="caption">
<string>DlgNetwork</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_DownloadAtStartup</cstring>
</property>
<property name="text">
<string>Start downloading files immediately after startup</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_LimitDownloads</cstring>
</property>
<property name="text">
<string>Limit maximum downloads</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout19</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer16_2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>40</height>
</size>
</property>
</spacer>
<spacer row="0" column="2" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer19</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
<widget class="KIntSpinBox" row="0" column="3">
<property name="name">
<cstring>kcfg_MaxConnections</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="minValue">
<number>1</number>
</property>
</widget>
<widget class="QLabel" row="1" column="1">
<property name="name">
<cstring>lbl_maxnum_2</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Downloads from the same server:</string>
</property>
</widget>
<widget class="KIntSpinBox" row="1" column="3">
<property name="name">
<cstring>kcfg_MaxConnectionsServer</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="minValue">
<number>1</number>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>lbl_maxnum</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Total downloads number:</string>
</property>
</widget>
</grid>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ReconnectOnBroken</cstring>
</property>
<property name="text">
<string>Reconnect on error or broken connection</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout14</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="1" column="1">
<property name="name">
<cstring>lb_after_2</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Retry after:</string>
</property>
</widget>
<spacer row="0" column="2" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer2_3</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>90</width>
<height>50</height>
</size>
</property>
</spacer>
<widget class="KIntSpinBox" row="1" column="3">
<property name="name">
<cstring>kcfg_ReconnectDelay</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string> sec</string>
</property>
<property name="maxValue">
<number>3600</number>
</property>
<property name="minValue">
<number>1</number>
</property>
<property name="value">
<number>60</number>
</property>
</widget>
<widget class="KIntSpinBox" row="0" column="3">
<property name="name">
<cstring>kcfg_ReconnectRetries</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="minValue">
<number>1</number>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>lb_retries_2</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Number of retries:</string>
</property>
</widget>
<spacer row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer16_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>40</height>
</size>
</property>
</spacer>
</grid>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox5</cstring>
</property>
<property name="title">
<string>After completing downloads</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_AutoShutdown</cstring>
</property>
<property name="text">
<string>Auto shutdown</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_AutoDisconnect</cstring>
</property>
<property name="text">
<string>Auto disconnect</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout9</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer16</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>16</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QLabel">
<property name="name">
<cstring>lb_autoDisconnect</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Disconnect command:</string>
</property>
</widget>
<widget class="KLineEdit">
<property name="name">
<cstring>kcfg_DisconnectCommand</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>kppp -k</string>
</property>
</widget>
</hbox>
</widget>
</vbox>
</widget>
<spacer>
<property name="name">
<cstring>spacer20</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>180</width>
<height>16</height>
</size>
</property>
</spacer>
</vbox>
</widget>
<connections>
<connection>
<sender>kcfg_AutoDisconnect</sender>
<signal>toggled(bool)</signal>
<receiver>lb_autoDisconnect</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_AutoDisconnect</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_DisconnectCommand</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>lb_retries_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_ReconnectRetries</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>lb_after_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ReconnectOnBroken</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_ReconnectDelay</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>lbl_maxnum</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_MaxConnections</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>lbl_maxnum_2</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_LimitDownloads</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_MaxConnectionsServer</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
</includes>
<layoutdefaults spacing="6" margin="11"/>
</UI>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="kpdfpartrc" />
<group name="Accessibility" >
<entry key="PaperColor" type="Color" >
<default code="true" >Qt::white</default>
</entry>
<entry key="HilightLinks" type="Bool" >
<default>false</default>
</entry>
<entry key="RenderMode" type="Enum" >
<values>
<value>Normal</value>
<value>Inverted</value>
<value>Recolor</value>
<value>Contrast</value>
</values>
</entry>
</group>
<group name="General" />
<group name="MainView" >
<entry key="SplitterSizes" type="IntList" />
<entry key="ShowLeftPanel" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="PageView" >
<entry key="ShowScrollBars" type="Bool" >
<default>true</default>
</entry>
<entry key="ViewTwoPages" type="Bool" >
<default>false</default>
</entry>
<entry key="ViewContinous" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="SearchBar" >
<entry key="ShowSearchBar" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="Performance" >
<entry key="MemoryLevel" type="Enum" >
<values>
<value>Low</value>
<value>Normal</value>
<value>Aggressive</value>
</values>
</entry>
</group>
</kcfg>
/***************************************************************************
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include <klocale.h>
// single config pages
/*
#include "dlggeneral.h"
#include "dlgaccessibility.h"
*/
// reimplementing this
#include "preferencesdialog.h"
PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton )
: KConfigDialog( parent, "preferences", skeleton )
{
/*
m_general = new DlgGeneral(0);
m_accessibility = new DlgAccessibility(0);
addPage( m_general, i18n("General"), "looknfeel", i18n("General setup") );
addPage( m_accessibility, i18n("Accessibility"), "folder_open", i18n("Read aids") );
*/
}
/***************************************************************************
* Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef _PREFERENCESDIALOG_H
#define _PREFERENCESDIALOG_H
#include <kconfigdialog.h>
#include "settings.h"
class QWidget;
class KConfigSkeleton;
class PreferencesDialog : public KConfigDialog
{
public:
PreferencesDialog( QWidget * parent, KConfigSkeleton * config );
protected:
// void updateSettings(); // Called when OK/Apply is pressed.
// void updateWidgets(); // Called upon construction or when Reset is pressed
// void updateWidgetsDefault(); // Called when Defaults button is pressed
// bool hasChanged(); // In order to correctly disable/enable Apply button
// bool isDefault(); // In order to correctly disable/enable Defaults button
private:
class DlgGeneral * m_general;
class DlgAccessibility * m_accessibility;
};
#endif
ClassName=Settings
File=kpdf.kcfg
Mutators=true
Singleton=true
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