summaryrefslogtreecommitdiff
path: root/noncore/apps
authorhash <hash>2002-10-18 19:50:27 (UTC)
committer hash <hash>2002-10-18 19:50:27 (UTC)
commitbb98ac35db9807efbcc1b59dd8abbdb05ad7656b (patch) (side-by-side diff)
tree60f83f4c10c68da1ca7641b26b91b8970ef0eaa3 /noncore/apps
parent081001a515f23626b6299e39af4511f36db46d07 (diff)
downloadopie-bb98ac35db9807efbcc1b59dd8abbdb05ad7656b.zip
opie-bb98ac35db9807efbcc1b59dd8abbdb05ad7656b.tar.gz
opie-bb98ac35db9807efbcc1b59dd8abbdb05ad7656b.tar.bz2
added autoconnect support. feel free to revert if i messed something up.
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp3
-rw-r--r--noncore/apps/opie-console/profile.cpp11
-rw-r--r--noncore/apps/opie-console/profile.h3
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp7
-rw-r--r--noncore/apps/opie-console/profileeditordialog.h2
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp2
6 files changed, 25 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index cf1fbc3..5900785 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -431,9 +431,10 @@ void MainWindow::create( const Profile& prof ) {
m_closewindow->setEnabled( true );
// is io_layer wants direct connection, then autoconnect
- if ( ( m_curSession->layer() )->supports()[0] == 1 ) {
+ //if ( ( m_curSession->layer() )->supports()[0] == 1 ) {
+ if (prof.autoConnect()) {
slotConnect();
}
}
diff --git a/noncore/apps/opie-console/profile.cpp b/noncore/apps/opie-console/profile.cpp
index 1a94619..51d1aa8 100644
--- a/noncore/apps/opie-console/profile.cpp
+++ b/noncore/apps/opie-console/profile.cpp
@@ -8,9 +8,9 @@ Profile::Profile( const QString& name,
const QCString& termName,
int background,
int foreground,
int terminal )
- : m_name( name ), m_ioLayer( iolayerName ), m_term( termName),
+ : m_name( name ), m_ioLayer( iolayerName ), m_term( termName), m_autoConnect(0),
m_back( background ), m_fore( foreground ), m_terminal( terminal )
{}
Profile::Profile( const Profile& prof )
{
@@ -23,8 +23,9 @@ bool Profile::operator==( const Profile& prof ) {
}
Profile &Profile::operator=( const Profile& prof ) {
m_name = prof.m_name;
m_ioLayer = prof.m_ioLayer;
+ m_autoConnect = prof.m_autoConnect;
m_back = prof.m_back;
m_fore = prof.m_fore;
m_terminal = prof.m_terminal;
m_conf = prof.m_conf;
@@ -45,8 +46,12 @@ QCString Profile::ioLayerName()const {
}
QCString Profile::terminalName( )const {
return m_term;
}
+bool Profile::autoConnect()const {
+
+ return m_autoConnect;
+}
int Profile::foreground()const {
return m_fore;
}
int Profile::background()const {
@@ -63,8 +68,12 @@ void Profile::setIOLayer( const QCString& name ) {
}
void Profile::setTerminalName( const QCString& str ) {
m_term = str;
}
+void Profile::setAutoConnect( const bool c) {
+
+ m_autoConnect = c;
+}
void Profile::setBackground( int back ) {
m_back = back;
}
void Profile::setForeground( int fore ) {
diff --git a/noncore/apps/opie-console/profile.h b/noncore/apps/opie-console/profile.h
index 64eb022..4f9e9c2 100644
--- a/noncore/apps/opie-console/profile.h
+++ b/noncore/apps/opie-console/profile.h
@@ -36,8 +36,9 @@ public:
~Profile();
QString name()const;
QCString ioLayerName()const;
QCString terminalName()const;
+ bool autoConnect()const;
int foreground()const;
int background()const;
int terminal()const;
@@ -56,16 +57,18 @@ public:
void setName( const QString& );
void setIOLayer( const QCString& );
void setTerminalName( const QCString& );
+ void setAutoConnect( const bool );
void setBackground( int back );
void setForeground( int fore );
void setTerminal( int term );
void setConf( const QMap<QString, QString>& );
private:
QMap<QString, QString> m_conf;
QString m_name;
QCString m_ioLayer, m_term;
+ bool m_autoConnect;
int m_back;
int m_fore;
int m_terminal;
};
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 5c5c2b3..c48ea53 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -3,11 +3,12 @@
#include <qlabel.h>
#include <qmessagebox.h>
#include <qstringlist.h>
#include <qcombobox.h>
+#include <qcheckbox.h>
-#include "profileeditorplugins.h"
+//#include "profileeditorplugins.h"
#include "metafactory.h"
#include "profileeditordialog.h"
namespace {
@@ -77,8 +78,9 @@ void ProfileEditorDialog::initUI()
QLabel *con = new QLabel(tr("Connection"), tabprof );
QLabel *term = new QLabel(tr("Terminal"), tabprof );
m_conCmb = new QComboBox( tabprof );
m_termCmb = new QComboBox( tabprof );
+ m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof);
// layouting
QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2);
vbox3->add(name);
@@ -86,8 +88,9 @@ void ProfileEditorDialog::initUI()
vbox3->add(con );
vbox3->add(m_conCmb );
vbox3->add(term );
vbox3->add(m_termCmb );
+ vbox3->add(m_autoConnect);
vbox3->addStretch(1);
tabWidget->addTab(tabprof, "", QObject::tr("Profile"));
tabWidget->addTab(m_tabCon, "", QObject::tr("Connection"));
@@ -111,8 +114,9 @@ void ProfileEditorDialog::initUI()
slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
slotTermActivated( m_fact->external(m_prof.terminalName() ) );
setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb );
setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb );
+ m_autoConnect->setChecked(m_prof.autoConnect());
// signal and slots
connect(m_conCmb, SIGNAL(activated(const QString& ) ),
@@ -140,8 +144,9 @@ void ProfileEditorDialog::accept()
// Save general values
m_prof.setName(profName());
m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) );
m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) );
+ m_prof.setAutoConnect( m_autoConnect->isChecked() );
if (m_con )
m_con->save( m_prof );
if (m_term )
diff --git a/noncore/apps/opie-console/profileeditordialog.h b/noncore/apps/opie-console/profileeditordialog.h
index 6fde839..e01e636 100644
--- a/noncore/apps/opie-console/profileeditordialog.h
+++ b/noncore/apps/opie-console/profileeditordialog.h
@@ -11,8 +11,9 @@ class EditBase;
class QTabWidget;
class QHBoxLayout;
class QLineEdit;
class QComboBox;
+class QCheckBox;
class QLabel;
class ProfileDialogWidget;
class ProfileEditorDialog : public QDialog {
@@ -42,8 +43,9 @@ private:
Profile m_prof;
QLineEdit *m_name;
QComboBox *m_conCmb, *m_termCmb;
+ QCheckBox *m_autoConnect;
QWidget *m_tabCon, *m_tabTerm;
ProfileDialogWidget* m_con, *m_term;
QHBoxLayout *m_layCon, *m_layTerm;
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 7c15560..5d39d96 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -37,8 +37,9 @@ void ProfileManager::load() {
Profile prof;
prof.setName( conf.readEntry("name") );
prof.setIOLayer( conf.readEntry("iolayer").utf8() );
prof.setTerminalName( conf.readEntry("term").utf8() );
+ prof.setAutoConnect( conf.readBoolEntry("autoConnect") );
prof.setBackground( conf.readNumEntry("back") );
prof.setForeground( conf.readNumEntry("fore") );
prof.setTerminal( conf.readNumEntry("terminal") );
@@ -113,8 +114,9 @@ void ProfileManager::save( ) {
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() );
}