summaryrefslogtreecommitdiff
path: root/noncore
authorzecke <zecke>2002-10-02 12:25:48 (UTC)
committer zecke <zecke>2002-10-02 12:25:48 (UTC)
commitc8a407e15d36e6a099836fb61ac164b0e90209dc (patch) (unidiff)
treecd4e31454534bc12aab712930bec0b00eda46064 /noncore
parent6d20f295c578281b043073a5c0dd668fe754581a (diff)
downloadopie-c8a407e15d36e6a099836fb61ac164b0e90209dc.zip
opie-c8a407e15d36e6a099836fb61ac164b0e90209dc.tar.gz
opie-c8a407e15d36e6a099836fb61ac164b0e90209dc.tar.bz2
more files
Diffstat (limited to 'noncore') (more/less context) (ignore 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 @@
1
2#include "profile.h"
3#include "qlistview.h"
4#include "configdialog.h"
5
6class ConfigListItem : public QListViewItem {
7public:
8 ConfigListItem( QListView* item, const Profile& );
9 ~ConfigListItem();
10 Profile profile()const;
11
12private:
13 Profile m_prof;
14};
15ConfigListItem::ConfigListItem( QListView* item, const Profile& prof )
16 : QListViewItem( item ), m_prof( prof )
17{
18 setText(0, prof.name() );
19}
20ConfigListItem::~ConfigListItem() {
21
22}
23Profile ConfigListItem::profile()const {
24 return m_prof;
25}
26
27/* Dialog */
28
29ConfigDialog::ConfigDialog( const Profile::ValueList& lis, QWidget* parent )
30 : ConfigureBase( parent, 0, TRUE )
31{
32 //init();
33 {
34 Profile::ValueList::ConstIterator it;
35 for (it = lis.begin(); it != lis.end(); ++it ) {
36 new ConfigListItem( lstView, (*it) );
37 }
38 }
39}
40ConfigDialog::~ConfigDialog() {
41
42}
43Profile::ValueList ConfigDialog::list()const {
44/* iterate over the list */
45 Profile::ValueList lst;
46 QListViewItemIterator it(lstView);
47 for ( ; it.current(); ++it ) {
48 ConfigListItem* item = (ConfigListItem*)it.current();
49 lst.append( item->profile() );
50 }
51 return lst;
52}
53/* our slots */
54void ConfigDialog::slotRemove() {
55 ConfigListItem* item = (ConfigListItem*)lstView->currentItem();
56 if (!item )
57 return;
58
59 lstView->takeItem( item );
60 delete item;
61}
62void ConfigDialog::slotEdit() {
63
64}
65void ConfigDialog::slotAdd() {
66
67}
68
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 @@
1#ifndef OPIE_CONFIG_DIALOG_H
2#define OPIE_CONFIG_DIALOG_H
3
4#include <qdialog.h>
5
6#include "configurebase.h"
7#include "profile.h"
8
9class ConfigDialog : public ConfigureBase {
10 Q_OBJECT
11public:
12 ConfigDialog( const Profile::ValueList&, QWidget* parent = 0l);
13 ~ConfigDialog();
14
15 Profile::ValueList list()const;
16protected slots:
17 void slotRemove();
18 void slotEdit();
19 void slotAdd();
20
21};
22
23#endif