summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profilemanager.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 5d39d96..cad2567 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -84,24 +84,25 @@ Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) {
/* 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 QHBox( stack );
stack->raiseWidget( dummy );
EmulationHandler* handler = new EmulationHandler(prof,dummy );
session->setEmulationHandler( handler );
session->connect();
+ session->setProfile( prof );
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();
@@ -112,24 +113,27 @@ void ProfileManager::save( ) {
conf.writeEntry( "name", (*it2).name() );
QString str = QString::fromUtf8( (*it2).ioLayerName() );
conf.writeEntry( "iolayer", str );
conf.writeEntry( "term", QString::fromUtf8( (*it2).terminalName() ) );
conf.writeEntry( "autoConnect", (*it2).autoConnect());
conf.writeEntry( "back", (*it2).background() );
conf.writeEntry( "fore", (*it2).foreground() );
conf.writeEntry( "terminal", (*it2).terminal() );
}
}
+void ProfileManager::add( const Profile& prof) {
+ m_list.append( prof );
+}
void ProfileManager::setProfiles( const Profile::ValueList& list ) {
m_list = list;
};
Profile ProfileManager::profile( const QString& name )const {
Profile prof;
Profile::ValueList::ConstIterator it;
for ( it = m_list.begin(); it != m_list.end(); ++it ) {
if ( name == (*it).name() ) {
prof = (*it);
break;
}
}