From c8a407e15d36e6a099836fb61ac164b0e90209dc Mon Sep 17 00:00:00 2001 From: zecke Date: Wed, 02 Oct 2002 12:25:48 +0000 Subject: more files --- (limited to 'noncore/apps/opie-console') 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 + +#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 -- cgit v0.9.0.2