summaryrefslogtreecommitdiffstats
path: root/tdecore/tdeconfig_compiler/example
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-27 01:04:16 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-27 01:04:16 -0600
commit5159cd2beb2e87806a5b54e9991b7895285c9d3e (patch)
tree9b70e8be47a390f8f4d56ead812ab0c9dad88709 /tdecore/tdeconfig_compiler/example
parentc17cb900dcf52b8bd6dc300d4f103392900ec2b4 (diff)
downloadtdelibs-5159cd2beb2e87806a5b54e9991b7895285c9d3e.tar.gz
tdelibs-5159cd2beb2e87806a5b54e9991b7895285c9d3e.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'tdecore/tdeconfig_compiler/example')
-rw-r--r--tdecore/tdeconfig_compiler/example/Makefile.am27
-rw-r--r--tdecore/tdeconfig_compiler/example/autoexample.cpp64
-rw-r--r--tdecore/tdeconfig_compiler/example/example.cpp52
-rw-r--r--tdecore/tdeconfig_compiler/example/example.kcfg63
-rw-r--r--tdecore/tdeconfig_compiler/example/exampleprefs_base.kcfgc18
-rw-r--r--tdecore/tdeconfig_compiler/example/general_base.ui46
-rw-r--r--tdecore/tdeconfig_compiler/example/myoptions_base.ui35
7 files changed, 305 insertions, 0 deletions
diff --git a/tdecore/tdeconfig_compiler/example/Makefile.am b/tdecore/tdeconfig_compiler/example/Makefile.am
new file mode 100644
index 000000000..612788f6b
--- /dev/null
+++ b/tdecore/tdeconfig_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_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+example_LDADD = $(LIB_TDECORE)
+example_SOURCES = example.cpp exampleprefs_base.cpp
+
+autoexample_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+autoexample_LDADD = $(LIB_TDECORE) $(LIB_TDEUI)
+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 ../tdeconfig_compiler $(srcdir)/exampleprefs_base.kcfgc
+ ../tdeconfig_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 tdelibs.pot
+messages: rc.cpp
+ true
diff --git a/tdecore/tdeconfig_compiler/example/autoexample.cpp b/tdecore/tdeconfig_compiler/example/autoexample.cpp
new file mode 100644
index 000000000..6ed89d75f
--- /dev/null
+++ b/tdecore/tdeconfig_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 <tdeconfig.h>
+#include <kstandarddirs.h>
+#include <tdeconfigdialog.h>
+
+#include <tqlabel.h>
+
+int main( int argc, char **argv )
+{
+ TDEAboutData aboutData( "example", I18N_NOOP("autoconfig example"), "0.1" );
+ aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
+
+ TDECmdLineArgs::init( argc, argv, &aboutData );
+
+ TDEApplication app;
+
+ ExamplePrefsBase configSkeleton( "dummy1", "dummy2" );
+ configSkeleton.readConfig();
+
+ TDEConfigDialog *dialog = new TDEConfigDialog( 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/tdeconfig_compiler/example/example.cpp b/tdecore/tdeconfig_compiler/example/example.cpp
new file mode 100644
index 000000000..6788d1ee0
--- /dev/null
+++ b/tdecore/tdeconfig_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 <tdeconfig.h>
+#include <kstandarddirs.h>
+
+int main( int argc, char **argv )
+{
+ TDEAboutData aboutData( "example", I18N_NOOP("cfgc example"), "0.1" );
+ aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" );
+
+ TDECmdLineArgs::init( argc, argv, &aboutData );
+
+ TDEApplication 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/tdeconfig_compiler/example/example.kcfg b/tdecore/tdeconfig_compiler/example/example.kcfg
new file mode 100644
index 000000000..076bfb644
--- /dev/null
+++ b/tdecore/tdeconfig_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/tdeconfig_compiler/example/exampleprefs_base.kcfgc b/tdecore/tdeconfig_compiler/example/exampleprefs_base.kcfgc
new file mode 100644
index 000000000..9b72fdb07
--- /dev/null
+++ b/tdecore/tdeconfig_compiler/example/exampleprefs_base.kcfgc
@@ -0,0 +1,18 @@
+# Code generation options for tdeconfig_compiler
+ClassName=ExamplePrefsBase
+#
+# Singleton=false
+#
+# Inherits=TDEConfigSkeleton
+#
+# 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/tdeconfig_compiler/example/general_base.ui b/tdecore/tdeconfig_compiler/example/general_base.ui
new file mode 100644
index 000000000..9b41370c7
--- /dev/null
+++ b/tdecore/tdeconfig_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/tdeconfig_compiler/example/myoptions_base.ui b/tdecore/tdeconfig_compiler/example/myoptions_base.ui
new file mode 100644
index 000000000..3c0c2e6cb
--- /dev/null
+++ b/tdecore/tdeconfig_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>