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) (unidiff)
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 @@
1
2#include <qpe/config.h>
3
4#include "metafactory.h"
5#include "profileconfig.h"
6#include "profilemanager.h"
7
8ProfileManager::ProfileManager( MetaFactory* fact )
9 : m_fact( fact )
10{
11
12}
13ProfileManager::~ProfileManager() {
14
15}
16void 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}
41Profile::ValueList ProfileManager::all()const {
42 return m_list;
43}
44Session* 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}
57void ProfileManager::save( ) {
58 m_list.clear();
59 ProfileConfig conf("opie-console-profiles");
60 Session* se= 0l;
61 // FIXME save
62}