summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profilemanager.cpp
authorzecke <zecke>2002-09-28 18:29:02 (UTC)
committer zecke <zecke>2002-09-28 18:29:02 (UTC)
commitbc88219d0a9cf935d90c88fe75e238e86c675937 (patch) (side-by-side diff)
tree0121d1d3d881cf69948f3faf420a71d894dd6832 /noncore/apps/opie-console/profilemanager.cpp
parent18d575d0ee47a0700091de81bc3e8c54be4eae18 (diff)
downloadopie-bc88219d0a9cf935d90c88fe75e238e86c675937.zip
opie-bc88219d0a9cf935d90c88fe75e238e86c675937.tar.gz
opie-bc88219d0a9cf935d90c88fe75e238e86c675937.tar.bz2
io_layer take Profile instead of Config
Profile added including some Config like stuff io_serial getBaud -> baud a default for gcc3 later tabdwidget will be our central widget profileconfig I needed groups() and clearAll that's pretty much it
Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
new file mode 100644
index 0000000..db36686
--- a/dev/null
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -0,0 +1,62 @@
+
+#include <qpe/config.h>
+
+#include "metafactory.h"
+#include "profileconfig.h"
+#include "profilemanager.h"
+
+ProfileManager::ProfileManager( MetaFactory* fact )
+ : m_fact( fact )
+{
+
+}
+ProfileManager::~ProfileManager() {
+
+}
+void ProfileManager::load() {
+ m_list.clear();
+ ProfileConfig conf("opie-console-profiles");
+ QStringList groups = conf.groups();
+ QStringList::Iterator it;
+
+ /*
+ * for each profile
+ */
+ /*
+ * QAsciiDict Parsing FIXME
+ */
+ for ( it = groups.begin(); it != groups.end(); ++it ) {
+ conf.setGroup( (*it) );
+ Profile prof;
+ prof.setName( conf.readEntry("name") );
+ prof.setIOLayer( conf.readEntry("iolayer") );
+ prof.setBackground( conf.readNumEntry("back") );
+ prof.setForeground( conf.readNumEntry("fore") );
+ prof.setTerminal( conf.readNumEntry("terminal") );
+
+ m_list.append( prof );
+ }
+
+}
+Profile::ValueList ProfileManager::all()const {
+ return m_list;
+}
+Session* ProfileManager::fromProfile( const Profile& prof) {
+ Session* session = new Session();
+ session->setName( prof.name() );
+ session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(),
+ prof) );
+ /*
+ * FIXME
+ * load emulation
+ * load widget
+ * set colors + fonts
+ */
+ return session;
+}
+void ProfileManager::save( ) {
+ m_list.clear();
+ ProfileConfig conf("opie-console-profiles");
+ Session* se= 0l;
+ // FIXME save
+}