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) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp29
1 files changed, 11 insertions, 18 deletions
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 2dfc0fd..413e80b 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -4,32 +4,30 @@
#include <qmessagebox.h>
#include <qstringlist.h>
#include <qcombobox.h>
#include <qcheckbox.h>
//#include "profileeditorplugins.h"
#include "metafactory.h"
#include "profileeditordialog.h"
namespace {
void setCurrent( const QString& str, QComboBox* bo ) {
- for (uint i = 0; i < bo->count(); i++ ) {
+ for (int i = 0; i < bo->count(); i++ ) {
if ( bo->text(i) == str ) {
bo->setCurrentItem( i );
}
}
- }
-
-
+ };
}
ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact,
const Profile& 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.)
}
@@ -39,25 +37,25 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact )
{
// Default profile
m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102);
initUI();
// Apply current profile
// plugin_plugin->load(profile);
}
Profile ProfileEditorDialog::profile() const
{
- return m_prof;
+ return m_prof;
}
void ProfileEditorDialog::initUI()
{
m_con = m_term = m_key = 0l;
QVBoxLayout *mainLayout = new QVBoxLayout( this );
tabWidget = new OTabWidget( this );
tabWidget->setTabStyle(OTabWidget::TextTab);
mainLayout->add(tabWidget);
/* base tabs */
@@ -172,38 +170,33 @@ QCString ProfileEditorDialog::profType()const
for(QStringList::Iterator it = w.begin(); it != w.end(); it++)
if(device_box->currentText() == m_fact->name((*it))) return (*it);
*/
return QCString();
}
/*
* we need to switch the widget
*/
void ProfileEditorDialog::slotConActivated( const QString& str ) {
delete m_con;
m_con = m_fact->newConnectionPlugin( str, m_tabCon );
- if ( m_con ) {
- m_con->load( m_prof );
- m_layCon->addWidget( m_con );
-
- if(!m_showconntab)
- {
- tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") );
- tabWidget->setCurrentTab( tabprof );
- m_showconntab = 1;
- }
- } else {
- tabWidget->removePage( m_tabCon );
- m_showconntab = 0;
+ if ( !m_con ) {
+ m_con = new NoOptions( str, m_tabCon, "name");
}
+ m_con->load( m_prof );
+ m_layCon->addWidget( m_con );
+
+ tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") );
+ tabWidget->setCurrentTab( tabprof );
+
}
/*
* we need to switch the widget
*/
void ProfileEditorDialog::slotTermActivated( const QString& str ) {
delete m_term;
m_term = m_fact->newTerminalPlugin( str, m_tabTerm );
if (m_term) {
m_term->load(m_prof );
m_layTerm->addWidget( m_term );
}