summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profilemanager.cpp
authorzecke <zecke>2002-10-08 23:13:17 (UTC)
committer zecke <zecke>2002-10-08 23:13:17 (UTC)
commit8c353ec8b86ee8f82cc25172fb69dd5fee65e848 (patch) (unidiff)
treea4549bcba962689edb9c40efcb23114cae5fcda2 /noncore/apps/opie-console/profilemanager.cpp
parentca0c224318a50c6618691fb30f39aa1d9b0b8a4f (diff)
downloadopie-8c353ec8b86ee8f82cc25172fb69dd5fee65e848.zip
opie-8c353ec8b86ee8f82cc25172fb69dd5fee65e848.tar.gz
opie-8c353ec8b86ee8f82cc25172fb69dd5fee65e848.tar.bz2
default I dunno
IOLayerBase the return values for speed()/parity()/flow() added MainWindow debug code :( opie-console.pro addition of serialconfigwidget.* ProfileManager fix removing of Profiles quite rude way of doing it Configure stuff is done and roughly tested The migration is done! TO WAZLAF: you might want to adjust Parity stuff for your needs!
Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 6ad08b5..e66ebcc 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -1,12 +1,16 @@
1#include <stdio.h>
2#include <stdlib.h>
3
4#include <qfile.h>
1 5
2#include <qpe/config.h> 6#include <qpe/config.h>
3 7
4#include "metafactory.h" 8#include "metafactory.h"
5#include "profileconfig.h" 9#include "profileconfig.h"
6#include "profilemanager.h" 10#include "profilemanager.h"
7 11
8ProfileManager::ProfileManager( MetaFactory* fact ) 12ProfileManager::ProfileManager( MetaFactory* fact )
9 : m_fact( fact ) 13 : m_fact( fact )
10{ 14{
11 15
12} 16}
@@ -21,24 +25,25 @@ void ProfileManager::load() {
21 QStringList::Iterator it; 25 QStringList::Iterator it;
22 26
23 /* 27 /*
24 * for each profile 28 * for each profile
25 */ 29 */
26 for ( it = groups.begin(); it != groups.end(); ++it ) { 30 for ( it = groups.begin(); it != groups.end(); ++it ) {
27 qWarning("group " + (*it) ); 31 qWarning("group " + (*it) );
28 conf.setGroup( (*it) ); 32 conf.setGroup( (*it) );
29 Profile prof; 33 Profile prof;
30 prof.setName( conf.readEntry("name") ); 34 prof.setName( conf.readEntry("name") );
31 prof.setIOLayer( conf.readEntry("iolayer").utf8() ); 35 prof.setIOLayer( conf.readEntry("iolayer").utf8() );
32 prof.setTerminalName( conf.readEntry("term").utf8() ); 36 prof.setTerminalName( conf.readEntry("term").utf8() );
37 qWarning(" %s %s", conf.readEntry("iolayer").latin1(), prof.ioLayerName().data() );
33 prof.setBackground( conf.readNumEntry("back") ); 38 prof.setBackground( conf.readNumEntry("back") );
34 prof.setForeground( conf.readNumEntry("fore") ); 39 prof.setForeground( conf.readNumEntry("fore") );
35 prof.setTerminal( conf.readNumEntry("terminal") ); 40 prof.setTerminal( conf.readNumEntry("terminal") );
36 prof.setConf( conf.items( (*it) ) ); 41 prof.setConf( conf.items( (*it) ) );
37 42
38 /* now add it */ 43 /* now add it */
39 m_list.append( prof ); 44 m_list.append( prof );
40 } 45 }
41 46
42} 47}
43void ProfileManager::clear() { 48void ProfileManager::clear() {
44 m_list.clear(); 49 m_list.clear();
@@ -51,31 +56,31 @@ Session* ProfileManager::fromProfile( const Profile& prof) {
51 session->setName( prof.name() ); 56 session->setName( prof.name() );
52 session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), 57 session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(),
53 prof) ); 58 prof) );
54 /* 59 /*
55 * FIXME 60 * FIXME
56 * load emulation 61 * load emulation
57 * load widget? 62 * load widget?
58 * set colors + fonts 63 * set colors + fonts
59 */ 64 */
60 return session; 65 return session;
61} 66}
62void ProfileManager::save( ) { 67void ProfileManager::save( ) {
68 QFile::remove( (QString(getenv("HOME") )+ "/Settings/opie-console-profiles.conf" ) );
63 ProfileConfig conf("opie-console-profiles"); 69 ProfileConfig conf("opie-console-profiles");
64 conf.clearAll();
65 Profile::ValueList::Iterator it; 70 Profile::ValueList::Iterator it;
66 for (it = m_list.begin(); it != m_list.end(); ++it ) { 71 for (it = m_list.begin(); it != m_list.end(); ++it ) {
67 conf.setGroup( (*it).name() ); 72 conf.setGroup( (*it).name() );
68 conf.writeEntry( "name", (*it).name() ); 73 conf.writeEntry( "name", (*it).name() );
69 conf.writeEntry( "ioplayer", QString::fromUtf8( (*it).ioLayerName() ) ); 74 conf.writeEntry( "iolayer", QString::fromUtf8( (*it).ioLayerName() ) );
70 conf.writeEntry( "term", QString::fromUtf8( (*it).terminalName() ) ); 75 conf.writeEntry( "term", QString::fromUtf8( (*it).terminalName() ) );
71 conf.writeEntry( "back", (*it).background() ); 76 conf.writeEntry( "back", (*it).background() );
72 conf.writeEntry( "fore", (*it).foreground() ); 77 conf.writeEntry( "fore", (*it).foreground() );
73 conf.writeEntry( "terminal", (*it).terminal() ); 78 conf.writeEntry( "terminal", (*it).terminal() );
74 /* now the config stuff */ 79 /* now the config stuff */
75 QMap<QString, QString> map = (*it).conf(); 80 QMap<QString, QString> map = (*it).conf();
76 QMap<QString, QString>::Iterator it; 81 QMap<QString, QString>::Iterator it;
77 for ( it = map.begin(); it != map.end(); ++it ) { 82 for ( it = map.begin(); it != map.end(); ++it ) {
78 conf.writeEntry( it.key(), it.data() ); 83 conf.writeEntry( it.key(), it.data() );
79 } 84 }
80 } 85 }
81} 86}