Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index e5aedb6..7c15560 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp @@ -1,28 +1,29 @@ #include <stdio.h> #include <stdlib.h> #include <qfile.h> +#include <qhbox.h> #include <qlayout.h> #include <qwidgetstack.h> #include <qpe/config.h> #include "emulation_handler.h" #include "widget_layer.h" #include "emulation_widget.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(); @@ -64,61 +65,53 @@ Profile::ValueList ProfileManager::all()const { * add "Widget" to the layout * add the dummy to the stack * raise the dummy * call session->connect(= * this way we only need to reparent * in TabWidget */ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { /* TEST PROFILE!!! Profile prof; QString str = "/dev/ttyS0"; prof.writeEntry("Device",str ); prof.writeEntry("Baud", 115200 ); prof.setIOLayer("serial"); prof.setName( "test"); */ Session* session = new Session(); session->setName( prof.name() ); /* translate the internal name to the external */ session->setIOLayer(m_fact->newIOLayer( m_fact->external(prof.ioLayerName()) , prof) ); QWidgetStack *stack = new QWidgetStack( parent ); session->setWidgetStack( stack ); - QWidget* dummy = new QWidget( stack ); - QHBoxLayout* lay = new QHBoxLayout( dummy ); - stack->addWidget( dummy, 0 ); - stack->raiseWidget( 0 ); + QWidget* dummy = new QHBox( stack ); + stack->raiseWidget( dummy ); + EmulationHandler* handler = new EmulationHandler(prof,dummy ); session->setEmulationHandler( handler ); - lay->addWidget( handler->widget() ); -// WidgetLayer* wid = new EmulationWidget( prof, dummy ); -// lay->addWidget( wid ); - -// session->setEmulationWidget( wid ); -// session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ), -// wid ) ); session->connect(); return session; } void ProfileManager::save( ) { QFile::remove( (QString(getenv("HOME") )+ "/Settings/opie-console-profiles.conf" ) ); ProfileConfig conf("opie-console-profiles"); Profile::ValueList::Iterator it2; for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) { conf.setGroup( (*it2).name() ); /* now the config stuff */ QMap<QString, QString> map = (*it2).conf(); QMap<QString, QString>::Iterator confIt; for ( confIt = map.begin(); confIt != map.end(); ++confIt ) { conf.writeEntry( confIt.key(), confIt.data() ); } conf.writeEntry( "name", (*it2).name() ); QString str = QString::fromUtf8( (*it2).ioLayerName() ); conf.writeEntry( "iolayer", str ); conf.writeEntry( "term", QString::fromUtf8( (*it2).terminalName() ) ); conf.writeEntry( "back", (*it2).background() ); |