summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profileeditordialog.cpp
authorharlekin <harlekin>2002-10-07 18:05:43 (UTC)
committer harlekin <harlekin>2002-10-07 18:05:43 (UTC)
commitd55aa591770675008da9e3290617e463a77e4c98 (patch) (side-by-side diff)
tree93d779cc85298545673f4d5f2ea0fcc7d4d301b7 /noncore/apps/opie-console/profileeditordialog.cpp
parentd25a925e70982b86539b98362ab2cd75c7883110 (diff)
downloadopie-d55aa591770675008da9e3290617e463a77e4c98.zip
opie-d55aa591770675008da9e3290617e463a77e4c98.tar.gz
opie-d55aa591770675008da9e3290617e463a77e4c98.tar.bz2
reworked config dialog gui a bit and adapted it to opie
Diffstat (limited to 'noncore/apps/opie-console/profileeditordialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 8e63429..be23eff 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -1,7 +1,8 @@
+#include <opie/otabwidget.h>
#include "profileeditordialog.h"
#include "qlayout.h"
#include "qlineedit.h"
#include "qlabel.h"
#include "qmessagebox.h"
@@ -10,23 +11,23 @@
#include "profileeditorplugins.h"
#include "metafactory.h"
ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact,
const Profile& prof )
- : QTabDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof )
+ : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof )
{
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 )
+ : QDialog(0, 0, TRUE), m_fact( fact )
{
// Default profile
m_prof = Profile(QString::null, "serial", Profile::Black, Profile::White, Profile::VT102);
initUI();
@@ -38,12 +39,17 @@ Profile ProfileEditorDialog::profile() const
{
return m_prof;
}
void ProfileEditorDialog::initUI()
{
+
+ QVBoxLayout *mainLayout = new QVBoxLayout( this );
+ OTabWidget *tabWidget = new OTabWidget( this );
+ mainLayout->add(tabWidget);
+
QWidget *tabterm, *tabconn, *tabprof;
tabprof = new QWidget(this);
tabterm = new QWidget(this);
tabconn = new QWidget(this);
@@ -95,39 +101,37 @@ void ProfileEditorDialog::initUI()
QVBoxLayout *vbox = new QVBoxLayout(tabconn, 2);
vbox->add(device);
vbox->add(device_box);
vbox->add(plugin_base);
vbox->add(conn_widget);
+ vbox->setStretchFactor(device, 1);
+ vbox->setStretchFactor(device_box, 1);
+ vbox->setStretchFactor(plugin_base, 1);
+ vbox->setStretchFactor(conn_widget, 7);
QVBoxLayout *vbox2 = new QVBoxLayout(tabterm, 2);
vbox2->add(term_widget);
- addTab(tabprof, QObject::tr("Profile"));
- addTab(tabconn, QObject::tr("Connection"));
- addTab(tabterm, QObject::tr("Terminal"));
-
- setOkButton(QObject::tr("OK"));
- setCancelButton(QObject::tr("Cancel"));
+ tabWidget->addTab(tabprof, "", QObject::tr("Profile"));
+ tabWidget->addTab(tabconn, "", QObject::tr("Connection"));
+ tabWidget->addTab(tabterm, "", QObject::tr("Terminal"));
// load profile values
-
name_line->setText(m_prof.name());
for(int i = 0; i < device_box->count(); i++)
{
device_box->setCurrentItem(i);
if(prof_type() == m_prof.ioLayerName())
{
slotDevice(i);
break;
}
}
// signals
-
- connect(this, SIGNAL(cancelButtonPressed()), SLOT(slotCancel()));
connect(device_box, SIGNAL(activated(int)), SLOT(slotDevice(int)));
}
ProfileEditorDialog::~ProfileEditorDialog() {
}
@@ -163,16 +167,12 @@ void ProfileEditorDialog::accept()
m_prof.setName(prof_name());
m_prof.setIOLayer(prof_type());
QDialog::accept();
}
-void ProfileEditorDialog::slotCancel()
-{
- reject();
-}
QString ProfileEditorDialog::prof_name()
{
return name_line->text();
}