summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/indigroup.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch)
treed3bb9f5d25a2dc09ca81adecf39621d871534297 /kstars/kstars/indigroup.cpp
downloadtdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz
tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kstars/kstars/indigroup.cpp')
-rw-r--r--kstars/kstars/indigroup.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/kstars/kstars/indigroup.cpp b/kstars/kstars/indigroup.cpp
new file mode 100644
index 00000000..7ef606b6
--- /dev/null
+++ b/kstars/kstars/indigroup.cpp
@@ -0,0 +1,75 @@
+/* INDI Group
+ Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
+
+ This application 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.
+
+ JM Changelog
+ 2004-16-1: Start
+
+ */
+
+ #include "indiproperty.h"
+ #include "indigroup.h"
+ #include "indidevice.h"
+ #include "devicemanager.h"
+
+ #include <klocale.h>
+
+ #include <qlayout.h>
+ #include <qframe.h>
+ #include <qtimer.h>
+ #include <qtabwidget.h>
+
+ /*******************************************************************
+** INDI Group: a tab widget for common properties. All properties
+** belong to a group, whether they have one or not but how the group
+** is displayed differs
+*******************************************************************/
+INDI_G::INDI_G(INDI_D *parentDevice, QString inName)
+{
+ dp = parentDevice;
+
+ name = inName;
+
+ pl.setAutoDelete(true);
+
+ // FIXME what's the parent exactly?
+ // You can do this eaither way:
+ // 1. Propertycontainer is a QFrame, then you make QVBoxLayout for it (check form1.cpp)
+ // 2. Keep it as QVBox and let it handle its children.
+ // Depends on which one works best.
+ propertyContainer = new QFrame(dp->groupContainer);
+ propertyLayout = new QVBoxLayout(propertyContainer, 20, KDialog::spacingHint() );
+ VerticalSpacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+
+ propertyLayout->addItem(VerticalSpacer);
+
+ dp->groupContainer->addTab(propertyContainer, name);
+}
+
+INDI_G::~INDI_G()
+{
+ pl.clear();
+
+ delete(propertyContainer);
+}
+
+void INDI_G::addProperty(INDI_P *pp)
+{
+ dp->registerProperty(pp);
+
+ propertyLayout->addLayout(pp->PHBox);
+ propertyLayout->addItem(VerticalSpacer);
+
+ pl.append(pp);
+}
+
+bool INDI_G::removeProperty(INDI_P *pp)
+{
+
+ return (pl.remove(pp));
+
+}