Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index e66ebcc..dcf3cbd 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp | |||
@@ -4,2 +4,4 @@ | |||
4 | #include <qfile.h> | 4 | #include <qfile.h> |
5 | #include <qlayout.h> | ||
6 | #include <qwidgetstack.h> | ||
5 | 7 | ||
@@ -7,2 +9,3 @@ | |||
7 | 9 | ||
10 | #include "widget.h" | ||
8 | #include "metafactory.h" | 11 | #include "metafactory.h" |
@@ -53,13 +56,36 @@ Profile::ValueList ProfileManager::all()const { | |||
53 | } | 56 | } |
54 | Session* ProfileManager::fromProfile( const Profile& prof) { | 57 | /* |
58 | * Our goal is to create a Session | ||
59 | * We will load the the IOLayer and EmulationLayer | ||
60 | * from the factory | ||
61 | * we will generate a QWidgetStack | ||
62 | * add a dummy widget with layout | ||
63 | * add "Widget" to the layout | ||
64 | * add the dummy to the stack | ||
65 | * raise the dummy | ||
66 | * call session->connect(= | ||
67 | * this way we only need to reparent | ||
68 | * in TabWidget | ||
69 | */ | ||
70 | Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { | ||
55 | Session* session = new Session(); | 71 | Session* session = new Session(); |
56 | session->setName( prof.name() ); | 72 | session->setName( prof.name() ); |
57 | session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), | 73 | /* translate the internal name to the external */ |
58 | prof) ); | 74 | session->setIOLayer(m_fact->newIOLayer( m_fact->external(prof.ioLayerName()) , |
59 | /* | 75 | prof) ); |
60 | * FIXME | 76 | |
61 | * load emulation | 77 | QWidgetStack *stack = new QWidgetStack(parent); |
62 | * load widget? | 78 | session->setWidgetStack( stack ); |
63 | * set colors + fonts | 79 | QWidget* dummy = new QWidget(stack ); |
64 | */ | 80 | QHBoxLayout* lay = new QHBoxLayout(dummy ); |
81 | stack->addWidget( dummy, 0 ); | ||
82 | stack->raiseWidget( 0 ); | ||
83 | Widget* wid = new Widget(dummy ); | ||
84 | lay->addWidget( wid ); | ||
85 | |||
86 | session->setEmulationWidget( wid ); | ||
87 | session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ), | ||
88 | wid ) ); | ||
89 | session->connect(); | ||
90 | |||
65 | return session; | 91 | return session; |