summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-02 12:25:48 (UTC)
committer zecke <zecke>2002-10-02 12:25:48 (UTC)
commitc8a407e15d36e6a099836fb61ac164b0e90209dc (patch) (side-by-side diff)
treecd4e31454534bc12aab712930bec0b00eda46064
parent6d20f295c578281b043073a5c0dd668fe754581a (diff)
downloadopie-c8a407e15d36e6a099836fb61ac164b0e90209dc.zip
opie-c8a407e15d36e6a099836fb61ac164b0e90209dc.tar.gz
opie-c8a407e15d36e6a099836fb61ac164b0e90209dc.tar.bz2
more files
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/configdialog.cpp68
-rw-r--r--noncore/apps/opie-console/configdialog.h23
2 files changed, 91 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp
new file mode 100644
index 0000000..ba3cd31
--- a/dev/null
+++ b/noncore/apps/opie-console/configdialog.cpp
@@ -0,0 +1,68 @@
+
+#include "profile.h"
+#include "qlistview.h"
+#include "configdialog.h"
+
+class ConfigListItem : public QListViewItem {
+public:
+ ConfigListItem( QListView* item, const Profile& );
+ ~ConfigListItem();
+ Profile profile()const;
+
+private:
+ Profile m_prof;
+};
+ConfigListItem::ConfigListItem( QListView* item, const Profile& prof )
+ : QListViewItem( item ), m_prof( prof )
+{
+ setText(0, prof.name() );
+}
+ConfigListItem::~ConfigListItem() {
+
+}
+Profile ConfigListItem::profile()const {
+ return m_prof;
+}
+
+/* Dialog */
+
+ConfigDialog::ConfigDialog( const Profile::ValueList& lis, QWidget* parent )
+ : ConfigureBase( parent, 0, TRUE )
+{
+ //init();
+ {
+ Profile::ValueList::ConstIterator it;
+ for (it = lis.begin(); it != lis.end(); ++it ) {
+ new ConfigListItem( lstView, (*it) );
+ }
+ }
+}
+ConfigDialog::~ConfigDialog() {
+
+}
+Profile::ValueList ConfigDialog::list()const {
+/* iterate over the list */
+ Profile::ValueList lst;
+ QListViewItemIterator it(lstView);
+ for ( ; it.current(); ++it ) {
+ ConfigListItem* item = (ConfigListItem*)it.current();
+ lst.append( item->profile() );
+ }
+ return lst;
+}
+/* our slots */
+void ConfigDialog::slotRemove() {
+ ConfigListItem* item = (ConfigListItem*)lstView->currentItem();
+ if (!item )
+ return;
+
+ lstView->takeItem( item );
+ delete item;
+}
+void ConfigDialog::slotEdit() {
+
+}
+void ConfigDialog::slotAdd() {
+
+}
+
diff --git a/noncore/apps/opie-console/configdialog.h b/noncore/apps/opie-console/configdialog.h
new file mode 100644
index 0000000..a0c40d0
--- a/dev/null
+++ b/noncore/apps/opie-console/configdialog.h
@@ -0,0 +1,23 @@
+#ifndef OPIE_CONFIG_DIALOG_H
+#define OPIE_CONFIG_DIALOG_H
+
+#include <qdialog.h>
+
+#include "configurebase.h"
+#include "profile.h"
+
+class ConfigDialog : public ConfigureBase {
+ Q_OBJECT
+public:
+ ConfigDialog( const Profile::ValueList&, QWidget* parent = 0l);
+ ~ConfigDialog();
+
+ Profile::ValueList list()const;
+protected slots:
+ void slotRemove();
+ void slotEdit();
+ void slotAdd();
+
+};
+
+#endif