diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-06 15:56:40 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-06 15:56:40 -0600 |
commit | e16866e072f94410321d70daedbcb855ea878cac (patch) | |
tree | ee3f52eabde7da1a0e6ca845fb9c2813cf1558cf /tdecore/kconfig_compiler/example | |
parent | a58c20c1a7593631a1b50213c805507ebc16adaf (diff) | |
download | tdelibs-e16866e072f94410321d70daedbcb855ea878cac.tar.gz tdelibs-e16866e072f94410321d70daedbcb855ea878cac.zip |
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'tdecore/kconfig_compiler/example')
-rw-r--r-- | tdecore/kconfig_compiler/example/Makefile.am | 27 | ||||
-rw-r--r-- | tdecore/kconfig_compiler/example/autoexample.cpp | 64 | ||||
-rw-r--r-- | tdecore/kconfig_compiler/example/example.cpp | 52 | ||||
-rw-r--r-- | tdecore/kconfig_compiler/example/example.kcfg | 63 | ||||
-rw-r--r-- | tdecore/kconfig_compiler/example/exampleprefs_base.kcfgc | 18 | ||||
-rw-r--r-- | tdecore/kconfig_compiler/example/general_base.ui | 46 | ||||
-rw-r--r-- | tdecore/kconfig_compiler/example/myoptions_base.ui | 35 |
7 files changed, 305 insertions, 0 deletions
diff --git a/tdecore/kconfig_compiler/example/Makefile.am b/tdecore/kconfig_compiler/example/Makefile.am new file mode 100644 index 000000000..9c0454ad8 --- /dev/null +++ b/tdecore/kconfig_compiler/example/Makefile.am @@ -0,0 +1,27 @@ +AM_CPPFLAGS = -I$(top_srcdir)/tdecore -I$(top_srcdir) $(all_includes) + +check_PROGRAMS = example # autoexample +EXTRA_PROGRAMS = autoexample + +example_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_KDECORE) $(LIB_KDEUI) -ltdefx $(LIB_KIO) -lktexteditor +example_LDADD = $(LIB_KDECORE) +example_SOURCES = example.cpp exampleprefs_base.cpp + +autoexample_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_KDECORE) $(LIB_KDEUI) -ltdefx $(LIB_KIO) -lktexteditor +autoexample_LDADD = $(LIB_KDECORE) $(LIB_KDEUI) +autoexample_SOURCES = exampleprefs_base.cpp general_base.ui myoptions_base.ui \ + autoexample.cpp + +example.o exampleprefs_base.o: exampleprefs_base.h +# avoid running the below command in parallel +exampleprefs_base.cpp: exampleprefs_base.h +exampleprefs_base.cpp exampleprefs_base.h: $(srcdir)/example.kcfg ../kconfig_compiler $(srcdir)/exampleprefs_base.kcfgc + ../kconfig_compiler $(srcdir)/example.kcfg $(srcdir)/exampleprefs_base.kcfgc + +METASOURCES = AUTO + +CLEANFILES = exampleprefs_base.h exampleprefs_base.cpp + +## The example's messages should not go into kdelibs.pot +messages: rc.cpp + true diff --git a/tdecore/kconfig_compiler/example/autoexample.cpp b/tdecore/kconfig_compiler/example/autoexample.cpp new file mode 100644 index 000000000..2c4e4d442 --- /dev/null +++ b/tdecore/kconfig_compiler/example/autoexample.cpp @@ -0,0 +1,64 @@ +/* + This file is part of KDE. + + Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "general_base.h" +#include "myoptions_base.h" + +#include "exampleprefs_base.h" + +#include <kaboutdata.h> +#include <kapplication.h> +#include <kdebug.h> +#include <klocale.h> +#include <kcmdlineargs.h> +#include <kglobal.h> +#include <kconfig.h> +#include <kstandarddirs.h> +#include <kconfigdialog.h> + +#include <tqlabel.h> + +int main( int argc, char **argv ) +{ + KAboutData aboutData( "example", I18N_NOOP("autoconfig example"), "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + KCmdLineArgs::init( argc, argv, &aboutData ); + + KApplication app; + + ExamplePrefsBase configSkeleton( "dummy1", "dummy2" ); + configSkeleton.readConfig(); + + KConfigDialog *dialog = new KConfigDialog( 0, "settings", &configSkeleton ); + + GeneralBase *general = new GeneralBase( 0 ); + dialog->addPage( general, i18n("General"), "General", "" ); + + MyOptionsBase *myOptions = new MyOptionsBase( 0 ); + dialog->addPage( myOptions, i18n("MyOptions"), "MyOptions", "" ); + + app.setMainWidget( dialog ); + + dialog->show(); + + return app.exec(); +} diff --git a/tdecore/kconfig_compiler/example/example.cpp b/tdecore/kconfig_compiler/example/example.cpp new file mode 100644 index 000000000..146d2460f --- /dev/null +++ b/tdecore/kconfig_compiler/example/example.cpp @@ -0,0 +1,52 @@ +/* + This file is part of KDE. + + Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "exampleprefs_base.h" + +#include <kaboutdata.h> +#include <kapplication.h> +#include <kdebug.h> +#include <klocale.h> +#include <kcmdlineargs.h> +#include <kglobal.h> +#include <kconfig.h> +#include <kstandarddirs.h> + +int main( int argc, char **argv ) +{ + KAboutData aboutData( "example", I18N_NOOP("cfgc example"), "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + KCmdLineArgs::init( argc, argv, &aboutData ); + + KApplication app; + + ExamplePrefsBase *prefs = new ExamplePrefsBase("Trans1", "Folder2"); + + prefs->readConfig(); + + prefs->setAnotherOption(17); + + kdWarning() << "Another Option = " << prefs->anotherOption() << endl; + kdWarning() << "Another Option2 = " << prefs->anotherOption2() << endl; + kdWarning() << "MyPaths = " << prefs->myPaths() << endl; + kdWarning() << "MyPaths2 = " << prefs->myPaths2() << endl; +} diff --git a/tdecore/kconfig_compiler/example/example.kcfg b/tdecore/kconfig_compiler/example/example.kcfg new file mode 100644 index 000000000..076bfb644 --- /dev/null +++ b/tdecore/kconfig_compiler/example/example.kcfg @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <include>qdir.h</include> + <kcfgfile name="examplerc"> + <parameter name="transport" /> + <parameter name="folder" /> + </kcfgfile> + <group name="General-$(folder)"> + <entry name="OneOption" type="Bool"> + <label>One option</label> + <default>true</default> + </entry> + <entry name="AnotherOption" type="Int" key="Another Option"> + <label>Another option</label> + <default>5</default> + </entry> + <entry name="ListOption" type="Enum"> + <label>This is some funky option</label> + <whatsthis>And this is a longer description of this option. Just wondering, how will the translations of those be handled?</whatsthis> + <choices> + <choice name="One"/> + <choice name="Two"/> + <choice name="Three"/> + </choices> + <default>One</default> + </entry> + </group> + <group name="MyOptions"> + <entry name="MyString" type="String"> + <label>This is a string</label> + <default>Default String</default> + </entry> + <entry name="MyPath" type="Path"> + <label>This is a path</label> + <default code="true">QDir::homeDirPath()+QString::fromLatin1(".hidden_file")</default> + </entry> + <entry name="MyPaths" type="PathList"> + <label>This is a list of paths</label> + <default>/home,~</default> + </entry> + <entry name="MyPaths2" type="PathList"> + <label>This is a list of paths (test2)</label> + <default code="true">QStringList(QDir::homeDirPath())</default> + </entry> + <entry name="AnotherOption2" type="Int" key="Another Option"> + <label>Another option</label> + <default>10</default> + </entry> + <entry name="MyStringList" type="StringList"> + <default>up,down</default> + </entry> + <entry name="MyStringListHidden" hidden="true" type="StringList"> + <default>up,down</default> + </entry> + <entry name="MyNumber" type="Int64" key="List-$(transport)-$(folder)"> + <label>List Number</label> + <default>1</default> + </entry> + </group> +</kcfg> diff --git a/tdecore/kconfig_compiler/example/exampleprefs_base.kcfgc b/tdecore/kconfig_compiler/example/exampleprefs_base.kcfgc new file mode 100644 index 000000000..829ec2e29 --- /dev/null +++ b/tdecore/kconfig_compiler/example/exampleprefs_base.kcfgc @@ -0,0 +1,18 @@ +# Code generation options for kconfig_compiler +ClassName=ExamplePrefsBase +# +# Singleton=false +# +# Inherits=KConfigSkeleton +# +# IncludeFiles=libtdepim/kpimprefs.h +# +# MemberVariables=public +# +### The following line includes the file exampleprefs_base_addon.h +### It can be used to add extra functions and variables to the +### class. +# CustomAdditions=true +# +### Provide setFooBar(int) style functions +Mutators=true diff --git a/tdecore/kconfig_compiler/example/general_base.ui b/tdecore/kconfig_compiler/example/general_base.ui new file mode 100644 index 000000000..9b41370c7 --- /dev/null +++ b/tdecore/kconfig_compiler/example/general_base.ui @@ -0,0 +1,46 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>GeneralBase</class> +<widget class="QWidget"> + <property name="name"> + <cstring>GeneralBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>486</height> + </rect> + </property> + <property name="caption"> + <string>AutoExampleDialog</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox" row="0" column="1"> + <property name="name"> + <cstring>kcfg_OneOption</cstring> + </property> + <property name="text"> + <string>OneOption</string> + </property> + </widget> + <widget class="QSpinBox" row="1" column="1"> + <property name="name"> + <cstring>kcfg_AnotherOption2</cstring> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>AnotherOption:</string> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/tdecore/kconfig_compiler/example/myoptions_base.ui b/tdecore/kconfig_compiler/example/myoptions_base.ui new file mode 100644 index 000000000..3c0c2e6cb --- /dev/null +++ b/tdecore/kconfig_compiler/example/myoptions_base.ui @@ -0,0 +1,35 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>MyOptionsBase</class> +<widget class="QWidget"> + <property name="name"> + <cstring>MyOptionsBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>486</height> + </rect> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>MyString:</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>kcfg_MyString</cstring> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> |