Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 62 |
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 @@ | |||
1 | |||
2 | #include <qpe/config.h> | ||
3 | |||
4 | #include "metafactory.h" | ||
5 | #include "profileconfig.h" | ||
6 | #include "profilemanager.h" | ||
7 | |||
8 | ProfileManager::ProfileManager( MetaFactory* fact ) | ||
9 | : m_fact( fact ) | ||
10 | { | ||
11 | |||
12 | } | ||
13 | ProfileManager::~ProfileManager() { | ||
14 | |||
15 | } | ||
16 | void ProfileManager::load() { | ||
17 | m_list.clear(); | ||
18 | ProfileConfig conf("opie-console-profiles"); | ||
19 | QStringList groups = conf.groups(); | ||
20 | QStringList::Iterator it; | ||
21 | |||
22 | /* | ||
23 | * for each profile | ||
24 | */ | ||
25 | /* | ||
26 | * QAsciiDict Parsing FIXME | ||
27 | */ | ||
28 | for ( it = groups.begin(); it != groups.end(); ++it ) { | ||
29 | conf.setGroup( (*it) ); | ||
30 | Profile prof; | ||
31 | prof.setName( conf.readEntry("name") ); | ||
32 | prof.setIOLayer( conf.readEntry("iolayer") ); | ||
33 | prof.setBackground( conf.readNumEntry("back") ); | ||
34 | prof.setForeground( conf.readNumEntry("fore") ); | ||
35 | prof.setTerminal( conf.readNumEntry("terminal") ); | ||
36 | |||
37 | m_list.append( prof ); | ||
38 | } | ||
39 | |||
40 | } | ||
41 | Profile::ValueList ProfileManager::all()const { | ||
42 | return m_list; | ||
43 | } | ||
44 | Session* ProfileManager::fromProfile( const Profile& prof) { | ||
45 | Session* session = new Session(); | ||
46 | session->setName( prof.name() ); | ||
47 | session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), | ||
48 | prof) ); | ||
49 | /* | ||
50 | * FIXME | ||
51 | * load emulation | ||
52 | * load widget | ||
53 | * set colors + fonts | ||
54 | */ | ||
55 | return session; | ||
56 | } | ||
57 | void ProfileManager::save( ) { | ||
58 | m_list.clear(); | ||
59 | ProfileConfig conf("opie-console-profiles"); | ||
60 | Session* se= 0l; | ||
61 | // FIXME save | ||
62 | } | ||