summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profileeditordialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index fbe0f23..fc95e56 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -20,25 +20,25 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact,
{
initUI();
// Apply current profile
// plugin_plugin->load(profile);
// ... (reset profile name line edit etc.)
}
ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact )
: QTabDialog(0, 0, TRUE), m_fact( fact )
{
// Default profile
- m_prof = Profile("serial", QString::null, Profile::Black, Profile::White, Profile::VT102);
+ m_prof = Profile(QString::null, "serial", Profile::Black, Profile::White, Profile::VT102);
initUI();
// Apply current profile
// plugin_plugin->load(profile);
}
Profile ProfileEditorDialog::profile() const
{
return m_prof;
}
@@ -185,26 +185,31 @@ void ProfileEditorDialog::initUI()
vbox2->add(options);
QHBoxLayout *hbox4 = new QHBoxLayout(vbox2, 2);
hbox4->add(option_wrap);
hbox4->add(option_echo);
addTab(tabprof, QObject::tr("Profile"));
addTab(tabconn, QObject::tr("Connection"));
addTab(tabterm, QObject::tr("Terminal"));
setOkButton(QObject::tr("OK"));
setCancelButton(QObject::tr("Cancel"));
- connect(this, SIGNAL(cancelButtonPressed()), SLOT(slotCancel()));
+ // load profile values
+
+ name_line->setText(m_prof.name());
+
+ // signals
+ connect(this, SIGNAL(cancelButtonPressed()), SLOT(slotCancel()));
connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int)));
}
ProfileEditorDialog::~ProfileEditorDialog() {
}
void ProfileEditorDialog::slotDevice(int id)
{
delete plugin_plugin;
plugin_plugin = m_fact->newConfigPlugin(prof_type(), plugin_base, m_prof);
@@ -222,24 +227,27 @@ void ProfileEditorDialog::accept()
{
if(prof_name().isEmpty())
{
QMessageBox::information(this,
QObject::tr("Invalid profile"),
QObject::tr("Please enter a profile name."));
return;
}
// Save profile and plugin profile
if(plugin_plugin) plugin_plugin->save();
+ // Save general values
+ m_prof.setName(prof_name());
+
QDialog::accept();
}
void ProfileEditorDialog::slotCancel()
{
reject();
}
QString ProfileEditorDialog::prof_name()
{
return name_line->text();
}