author | harlekin <harlekin> | 2002-10-24 13:27:07 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-24 13:27:07 (UTC) |
commit | 22b0ba0100376c6406d3ee0ea65b013660ebaea0 (patch) (unidiff) | |
tree | 32943709e115104d036a3b4bdbc030b90075b97f | |
parent | b007fdcf8708d377a25c93de49c4febb19651e1a (diff) | |
download | opie-22b0ba0100376c6406d3ee0ea65b013660ebaea0.zip opie-22b0ba0100376c6406d3ee0ea65b013660ebaea0.tar.gz opie-22b0ba0100376c6406d3ee0ea65b013660ebaea0.tar.bz2 |
set autoconnect by default for local console mode
-rw-r--r-- | noncore/apps/opie-console/BUGS | 14 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_layer.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 10 |
3 files changed, 12 insertions, 16 deletions
diff --git a/noncore/apps/opie-console/BUGS b/noncore/apps/opie-console/BUGS index b9d8ca3..7fae567 100644 --- a/noncore/apps/opie-console/BUGS +++ b/noncore/apps/opie-console/BUGS | |||
@@ -1,42 +1,28 @@ | |||
1 | Ok we all know we write perfect code | 1 | Ok we all know we write perfect code |
2 | but sometimes the compiler produces bad code | 2 | but sometimes the compiler produces bad code |
3 | and we need to work around some compiler bugs!! -zecke | 3 | and we need to work around some compiler bugs!! -zecke |
4 | 4 | ||
5 | 5 | ||
6 | Send/receive: lrzsz behaves strange when trying to use | 6 | Send/receive: lrzsz behaves strange when trying to use |
7 | --overwrite or --rename. | 7 | --overwrite or --rename. |
8 | 8 | ||
9 | - console should autoconnect by default | ||
10 | |||
11 | - keys and buttonbar merge | 9 | - keys and buttonbar merge |
12 | 10 | ||
13 | - keys really working | 11 | - keys really working |
14 | mc is working | 12 | mc is working |
15 | but F11 on bar seems to be the F10 key and so on | 13 | but F11 on bar seems to be the F10 key and so on |
16 | F9 is F8... -zecke | 14 | F9 is F8... -zecke |
17 | Should be fixed -zecke | 15 | Should be fixed -zecke |
18 | 16 | ||
19 | - scripting with "direct subpopup" | 17 | - scripting with "direct subpopup" |
20 | also: | 18 | also: |
21 | - an indication that it is currently recording, also change menu entry to | 19 | - an indication that it is currently recording, also change menu entry to |
22 | "cancel recording" then | 20 | "cancel recording" then |
23 | 21 | ||
24 | - kill more compiler warnings. | ||
25 | |||
26 | - more colorshemes ( "orange is ugly" ) | ||
27 | |||
28 | - irda and bluetooth out ( can be done with normal serial as long as the | ||
29 | connection is allready up, and extended stuff is a lot of work; maybe later | ||
30 | in again ). | ||
31 | |||
32 | - new conntection -> configure -> use . does not end up in profile dialog, | ||
33 | |||
34 | - disable tranfer file for console mode | ||
35 | |||
36 | - scripts need an extension and also an icon | 22 | - scripts need an extension and also an icon |
37 | 23 | ||
38 | - help documentation needs to be extended | 24 | - help documentation needs to be extended |
39 | - new connection and save connection | 25 | - new connection and save connection |
40 | - paste button | 26 | - paste button |
41 | - keys button | 27 | - keys button |
42 | 28 | ||
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h index 97a1e1c..af61099 100644 --- a/noncore/apps/opie-console/io_layer.h +++ b/noncore/apps/opie-console/io_layer.h | |||
@@ -1,126 +1,126 @@ | |||
1 | #ifndef OPIE_IO_LAYER_H | 1 | #ifndef OPIE_IO_LAYER_H |
2 | #define OPIE_IO_LAYER_H | 2 | #define OPIE_IO_LAYER_H |
3 | 3 | ||
4 | #include <qbitarray.h> | 4 | #include <qbitarray.h> |
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | 6 | ||
7 | 7 | ||
8 | #include <qpe/config.h> | 8 | #include <qpe/config.h> |
9 | 9 | ||
10 | #include "profile.h" | 10 | #include "profile.h" |
11 | 11 | ||
12 | /** | 12 | /** |
13 | * This is the base class for IO Layers | 13 | * This is the base class for IO Layers |
14 | * It will used to sent and recv data( QByteArray ) | 14 | * It will used to sent and recv data( QByteArray ) |
15 | * it | 15 | * it |
16 | */ | 16 | */ |
17 | class IOLayer : public QObject { | 17 | class IOLayer : public QObject { |
18 | Q_OBJECT | 18 | Q_OBJECT |
19 | public: | 19 | public: |
20 | enum Error { | 20 | enum Error { |
21 | NoError = -1, | 21 | NoError = -1, |
22 | Refuse = 0, | 22 | Refuse = 0, |
23 | CouldNotOpen =1, | 23 | CouldNotOpen =1, |
24 | ClosedUnexpected =2, | 24 | ClosedUnexpected =2, |
25 | ClosedError =3, | 25 | ClosedError =3, |
26 | Terminate = 4 | 26 | Terminate = 4 |
27 | /* add more errors here */ | 27 | /* add more errors here */ |
28 | }; | 28 | }; |
29 | enum Feature { | 29 | enum Feature { |
30 | AutoConnect = 0, | 30 | AutoConnect = 0, |
31 | TransferFile =1, | 31 | TransferFile = 1, |
32 | Close =2 | 32 | Close = 2 |
33 | }; | 33 | }; |
34 | /** | 34 | /** |
35 | * a small c'tor | 35 | * a small c'tor |
36 | */ | 36 | */ |
37 | IOLayer(); | 37 | IOLayer(); |
38 | 38 | ||
39 | /** | 39 | /** |
40 | * create an IOLayer instance from a config file | 40 | * create an IOLayer instance from a config file |
41 | * the currently set group stores the profile/session | 41 | * the currently set group stores the profile/session |
42 | * information | 42 | * information |
43 | */ | 43 | */ |
44 | IOLayer( const Profile& ); | 44 | IOLayer( const Profile& ); |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * destructor | 47 | * destructor |
48 | */ | 48 | */ |
49 | virtual ~IOLayer(); | 49 | virtual ~IOLayer(); |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * a small internal identifier | 52 | * a small internal identifier |
53 | */ | 53 | */ |
54 | virtual QString identifier() const = 0; | 54 | virtual QString identifier() const = 0; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * a short name | 57 | * a short name |
58 | */ | 58 | */ |
59 | virtual QString name() const = 0; | 59 | virtual QString name() const = 0; |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * a file descriptor which opens | 62 | * a file descriptor which opens |
63 | * the device for io but does not | 63 | * the device for io but does not |
64 | * do any ioctling on it... | 64 | * do any ioctling on it... |
65 | * and it'll stop listening to the before opened | 65 | * and it'll stop listening to the before opened |
66 | * device | 66 | * device |
67 | */ | 67 | */ |
68 | virtual int rawIO()const; | 68 | virtual int rawIO()const; |
69 | 69 | ||
70 | /** | 70 | /** |
71 | * will close the rawIO stuff | 71 | * will close the rawIO stuff |
72 | * and will listen to it's data again... | 72 | * and will listen to it's data again... |
73 | */ | 73 | */ |
74 | virtual void closeRawIO(int); | 74 | virtual void closeRawIO(int); |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * What does the IOLayer support? | 77 | * What does the IOLayer support? |
78 | * Bits are related to features | 78 | * Bits are related to features |
79 | */ | 79 | */ |
80 | virtual QBitArray supports()const = 0; | 80 | virtual QBitArray supports()const = 0; |
81 | 81 | ||
82 | virtual bool isConnected() = 0; | 82 | virtual bool isConnected() = 0; |
83 | 83 | ||
84 | signals: | 84 | signals: |
85 | /** | 85 | /** |
86 | * received input as QCString | 86 | * received input as QCString |
87 | */ | 87 | */ |
88 | virtual void received( const QByteArray& ); | 88 | virtual void received( const QByteArray& ); |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * an error occured | 91 | * an error occured |
92 | * int for the error number | 92 | * int for the error number |
93 | * and QString for a text | 93 | * and QString for a text |
94 | */ | 94 | */ |
95 | virtual void error( int, const QString& ); | 95 | virtual void error( int, const QString& ); |
96 | 96 | ||
97 | virtual void closed(); | 97 | virtual void closed(); |
98 | public slots: | 98 | public slots: |
99 | /** | 99 | /** |
100 | * send a QCString to the device | 100 | * send a QCString to the device |
101 | */ | 101 | */ |
102 | virtual void send( const QByteArray& ) = 0; | 102 | virtual void send( const QByteArray& ) = 0; |
103 | 103 | ||
104 | /** | 104 | /** |
105 | * bool open | 105 | * bool open |
106 | */ | 106 | */ |
107 | virtual bool open() = 0; | 107 | virtual bool open() = 0; |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * close the io | 110 | * close the io |
111 | */ | 111 | */ |
112 | virtual void close() = 0; | 112 | virtual void close() = 0; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | * closes and reloads the settings | 115 | * closes and reloads the settings |
116 | */ | 116 | */ |
117 | virtual void reload( const Profile& ) = 0; | 117 | virtual void reload( const Profile& ) = 0; |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * set the size | 120 | * set the size |
121 | * needed for pty | 121 | * needed for pty |
122 | */ | 122 | */ |
123 | virtual void setSize(int lines, int cols ); | 123 | virtual void setSize(int lines, int cols ); |
124 | }; | 124 | }; |
125 | 125 | ||
126 | #endif | 126 | #endif |
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 9890c3e..127009b 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -1,230 +1,240 @@ | |||
1 | #include <qlayout.h> | 1 | #include <qlayout.h> |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
7 | #include <qcheckbox.h> | 7 | #include <qcheckbox.h> |
8 | #include <qscrollview.h> | 8 | #include <qscrollview.h> |
9 | 9 | ||
10 | //#include "profileeditorplugins.h" | 10 | //#include "profileeditorplugins.h" |
11 | #include "metafactory.h" | 11 | #include "metafactory.h" |
12 | #include "profileeditordialog.h" | 12 | #include "profileeditordialog.h" |
13 | 13 | ||
14 | namespace { | 14 | namespace { |
15 | void setCurrent( const QString& str, QComboBox* bo ) { | 15 | void setCurrent( const QString& str, QComboBox* bo ) { |
16 | for (int i = 0; i < bo->count(); i++ ) { | 16 | for (int i = 0; i < bo->count(); i++ ) { |
17 | if ( bo->text(i) == str ) { | 17 | if ( bo->text(i) == str ) { |
18 | bo->setCurrentItem( i ); | 18 | bo->setCurrentItem( i ); |
19 | } | 19 | } |
20 | } | 20 | } |
21 | }; | 21 | }; |
22 | } | 22 | } |
23 | 23 | ||
24 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | 24 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, |
25 | const Profile& prof ) | 25 | const Profile& prof ) |
26 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 26 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
27 | { | 27 | { |
28 | initUI(); | 28 | initUI(); |
29 | 29 | ||
30 | // Apply current profile | 30 | // Apply current profile |
31 | // plugin_plugin->load(profile); | 31 | // plugin_plugin->load(profile); |
32 | // ... (reset profile name line edit etc.) | 32 | // ... (reset profile name line edit etc.) |
33 | } | 33 | } |
34 | 34 | ||
35 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | 35 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) |
36 | : QDialog(0, 0, TRUE), m_fact( fact ) | 36 | : QDialog(0, 0, TRUE), m_fact( fact ) |
37 | { | 37 | { |
38 | // Default profile | 38 | // Default profile |
39 | m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102); | 39 | m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102); |
40 | 40 | ||
41 | initUI(); | 41 | initUI(); |
42 | 42 | ||
43 | // Apply current profile | 43 | // Apply current profile |
44 | // plugin_plugin->load(profile); | 44 | // plugin_plugin->load(profile); |
45 | } | 45 | } |
46 | 46 | ||
47 | Profile ProfileEditorDialog::profile() const | 47 | Profile ProfileEditorDialog::profile() const |
48 | { | 48 | { |
49 | return m_prof; | 49 | return m_prof; |
50 | } | 50 | } |
51 | 51 | ||
52 | void ProfileEditorDialog::initUI() | 52 | void ProfileEditorDialog::initUI() |
53 | { | 53 | { |
54 | m_con = m_term = m_key = 0l; | 54 | m_con = m_term = m_key = 0l; |
55 | 55 | ||
56 | 56 | ||
57 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); | 57 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); |
58 | tabWidget = new OTabWidget( this ); | 58 | tabWidget = new OTabWidget( this ); |
59 | tabWidget->setTabStyle(OTabWidget::TextTab); | 59 | tabWidget->setTabStyle(OTabWidget::TextTab); |
60 | mainLayout->add(tabWidget); | 60 | mainLayout->add(tabWidget); |
61 | 61 | ||
62 | /* base tabs */ | 62 | /* base tabs */ |
63 | tabprof = new QWidget(this); | 63 | tabprof = new QWidget(this); |
64 | m_tabTerm = new QWidget(this); | 64 | m_tabTerm = new QWidget(this); |
65 | m_tabCon = new QWidget(this); | 65 | m_tabCon = new QWidget(this); |
66 | m_tabKey = new QWidget(this); | 66 | m_tabKey = new QWidget(this); |
67 | 67 | ||
68 | m_svCon = new QScrollView( m_tabCon ); | 68 | m_svCon = new QScrollView( m_tabCon ); |
69 | m_svCon->setResizePolicy( QScrollView::AutoOneFit ); | 69 | m_svCon->setResizePolicy( QScrollView::AutoOneFit ); |
70 | m_svCon->setHScrollBarMode( QScrollView::AlwaysOff ); | 70 | m_svCon->setHScrollBarMode( QScrollView::AlwaysOff ); |
71 | m_svCon->setFrameShape( QFrame::NoFrame ); | 71 | m_svCon->setFrameShape( QFrame::NoFrame ); |
72 | m_svTerm = new QScrollView( m_tabTerm ); | 72 | m_svTerm = new QScrollView( m_tabTerm ); |
73 | m_svTerm->setResizePolicy( QScrollView::AutoOneFit ); | 73 | m_svTerm->setResizePolicy( QScrollView::AutoOneFit ); |
74 | m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff ); | 74 | m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff ); |
75 | m_svTerm->setFrameShape( QFrame::NoFrame ); | 75 | m_svTerm->setFrameShape( QFrame::NoFrame ); |
76 | 76 | ||
77 | /* base layout for tabs */ | 77 | /* base layout for tabs */ |
78 | m_layCon = new QHBoxLayout( m_tabCon , 2 ); | 78 | m_layCon = new QHBoxLayout( m_tabCon , 2 ); |
79 | m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); | 79 | m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); |
80 | m_layKey = new QHBoxLayout( m_tabKey, 2 ); | 80 | m_layKey = new QHBoxLayout( m_tabKey, 2 ); |
81 | 81 | ||
82 | m_layCon->addWidget( m_svCon ); | 82 | m_layCon->addWidget( m_svCon ); |
83 | m_layTerm->addWidget( m_svTerm ); | 83 | m_layTerm->addWidget( m_svTerm ); |
84 | 84 | ||
85 | // profile tab | 85 | // profile tab |
86 | 86 | ||
87 | QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); | 87 | QLabel *name = new QLabel(QObject::tr("Profile name"), tabprof); |
88 | m_name = new QLineEdit(tabprof); | 88 | m_name = new QLineEdit(tabprof); |
89 | QLabel *con = new QLabel(tr("Connection"), tabprof ); | 89 | QLabel *con = new QLabel(tr("Connection"), tabprof ); |
90 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); | 90 | QLabel *term = new QLabel(tr("Terminal"), tabprof ); |
91 | m_conCmb = new QComboBox( tabprof ); | 91 | m_conCmb = new QComboBox( tabprof ); |
92 | m_termCmb = new QComboBox( tabprof ); | 92 | m_termCmb = new QComboBox( tabprof ); |
93 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); | 93 | m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); |
94 | 94 | ||
95 | // layouting | 95 | // layouting |
96 | QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); | 96 | QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); |
97 | vbox3->add(name); | 97 | vbox3->add(name); |
98 | vbox3->add(m_name); | 98 | vbox3->add(m_name); |
99 | vbox3->add(con ); | 99 | vbox3->add(con ); |
100 | vbox3->add(m_conCmb ); | 100 | vbox3->add(m_conCmb ); |
101 | vbox3->add(term ); | 101 | vbox3->add(term ); |
102 | vbox3->add(m_termCmb ); | 102 | vbox3->add(m_termCmb ); |
103 | vbox3->add(m_autoConnect); | 103 | vbox3->add(m_autoConnect); |
104 | vbox3->addStretch(1); | 104 | vbox3->addStretch(1); |
105 | 105 | ||
106 | m_showconntab = 0; | 106 | m_showconntab = 0; |
107 | tabWidget->addTab(tabprof, "", QObject::tr("Profile")); | 107 | tabWidget->addTab(tabprof, "", QObject::tr("Profile")); |
108 | tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); | 108 | tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); |
109 | tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); | 109 | tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); |
110 | tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); | 110 | tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); |
111 | tabWidget->setCurrentTab( tabprof ); | 111 | tabWidget->setCurrentTab( tabprof ); |
112 | 112 | ||
113 | 113 | ||
114 | // fill the comboboxes | 114 | // fill the comboboxes |
115 | QStringList list = m_fact->connectionWidgets(); | 115 | QStringList list = m_fact->connectionWidgets(); |
116 | QStringList::Iterator it; | 116 | QStringList::Iterator it; |
117 | for (it =list.begin(); it != list.end(); ++it ) { | 117 | for (it =list.begin(); it != list.end(); ++it ) { |
118 | m_conCmb->insertItem( (*it) ); | 118 | m_conCmb->insertItem( (*it) ); |
119 | } | 119 | } |
120 | list = m_fact->terminalWidgets(); | 120 | list = m_fact->terminalWidgets(); |
121 | for (it =list.begin(); it != list.end(); ++it ) { | 121 | for (it =list.begin(); it != list.end(); ++it ) { |
122 | m_termCmb->insertItem( (*it) ); | 122 | m_termCmb->insertItem( (*it) ); |
123 | } | 123 | } |
124 | 124 | ||
125 | // load profile values | 125 | // load profile values |
126 | m_name->setText(m_prof.name()); | 126 | m_name->setText(m_prof.name()); |
127 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); | 127 | slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); |
128 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); | 128 | slotTermActivated( m_fact->external(m_prof.terminalName() ) ); |
129 | slotKeyActivated( "Default Keyboard" ); | 129 | slotKeyActivated( "Default Keyboard" ); |
130 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); | 130 | setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); |
131 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); | 131 | setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); |
132 | m_autoConnect->setChecked(m_prof.autoConnect()); | 132 | m_autoConnect->setChecked(m_prof.autoConnect()); |
133 | 133 | ||
134 | 134 | ||
135 | // signal and slots | 135 | // signal and slots |
136 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 136 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), |
137 | this, SLOT(slotConActivated(const QString&) ) ); | 137 | this, SLOT(slotConActivated(const QString&) ) ); |
138 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 138 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), |
139 | this, SLOT(slotTermActivated(const QString& ) ) ); | 139 | this, SLOT(slotTermActivated(const QString& ) ) ); |
140 | 140 | ||
141 | } | 141 | } |
142 | 142 | ||
143 | ProfileEditorDialog::~ProfileEditorDialog() { | 143 | ProfileEditorDialog::~ProfileEditorDialog() { |
144 | 144 | ||
145 | } | 145 | } |
146 | void ProfileEditorDialog::accept() | 146 | void ProfileEditorDialog::accept() |
147 | { | 147 | { |
148 | if(profName().isEmpty()) | 148 | if(profName().isEmpty()) |
149 | { | 149 | { |
150 | QMessageBox::information(this, | 150 | QMessageBox::information(this, |
151 | QObject::tr("Invalid profile"), | 151 | QObject::tr("Invalid profile"), |
152 | QObject::tr("Please enter a profile name.")); | 152 | QObject::tr("Please enter a profile name.")); |
153 | return; | 153 | return; |
154 | } | 154 | } |
155 | // Save profile and plugin profile | 155 | // Save profile and plugin profile |
156 | //if(plugin_plugin) plugin_plugin->save(); | 156 | //if(plugin_plugin) plugin_plugin->save(); |
157 | 157 | ||
158 | // Save general values | 158 | // Save general values |
159 | m_prof.setName( profName() ); | 159 | m_prof.setName( profName() ); |
160 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); | 160 | m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); |
161 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); | 161 | m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); |
162 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); | 162 | m_prof.setAutoConnect( m_autoConnect->isChecked() ); |
163 | 163 | ||
164 | if (m_con ) | 164 | if (m_con ) |
165 | m_con->save( m_prof ); | 165 | m_con->save( m_prof ); |
166 | if (m_term ) | 166 | if (m_term ) |
167 | m_term->save( m_prof ); | 167 | m_term->save( m_prof ); |
168 | if (m_key) | 168 | if (m_key) |
169 | m_key->save( m_prof ); | 169 | m_key->save( m_prof ); |
170 | 170 | ||
171 | QDialog::accept(); | 171 | QDialog::accept(); |
172 | } | 172 | } |
173 | 173 | ||
174 | 174 | ||
175 | QString ProfileEditorDialog::profName()const | 175 | QString ProfileEditorDialog::profName()const |
176 | { | 176 | { |
177 | return m_name->text(); | 177 | return m_name->text(); |
178 | } | 178 | } |
179 | 179 | ||
180 | QCString ProfileEditorDialog::profType()const | 180 | QCString ProfileEditorDialog::profType()const |
181 | { | 181 | { |
182 | /*QStringList w = m_fact->configWidgets(); | 182 | /*QStringList w = m_fact->configWidgets(); |
183 | for(QStringList::Iterator it = w.begin(); it != w.end(); it++) | 183 | for(QStringList::Iterator it = w.begin(); it != w.end(); it++) |
184 | if(device_box->currentText() == m_fact->name((*it))) return (*it); | 184 | if(device_box->currentText() == m_fact->name((*it))) return (*it); |
185 | */ | 185 | */ |
186 | return QCString(); | 186 | return QCString(); |
187 | } | 187 | } |
188 | /* | 188 | /* |
189 | * we need to switch the widget | 189 | * we need to switch the widget |
190 | */ | 190 | */ |
191 | void ProfileEditorDialog::slotConActivated( const QString& str ) { | 191 | void ProfileEditorDialog::slotConActivated( const QString& str ) { |
192 | 192 | ||
193 | delete m_con; | 193 | delete m_con; |
194 | 194 | ||
195 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); | 195 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); |
196 | 196 | ||
197 | if ( !m_con ) { | 197 | if ( !m_con ) { |
198 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); | 198 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); |
199 | } | 199 | } |
200 | |||
201 | // FIXME ugly hack right. Right solution would be to look into the layer and see if it | ||
202 | // supports auto connect and then set it as prefered | ||
203 | //if ( ( )->layer()->supports()[0] == 1 ) { | ||
204 | if ( m_conCmb ->currentText() == "local Console" ) { | ||
205 | m_autoConnect->setChecked( true ); | ||
206 | } else { | ||
207 | m_autoConnect->setChecked( false ); | ||
208 | } | ||
209 | |||
200 | m_con->load( m_prof ); | 210 | m_con->load( m_prof ); |
201 | m_svCon->addChild( m_con ); | 211 | m_svCon->addChild( m_con ); |
202 | } | 212 | } |
203 | 213 | ||
204 | 214 | ||
205 | /* | 215 | /* |
206 | * we need to switch the widget | 216 | * we need to switch the widget |
207 | */ | 217 | */ |
208 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { | 218 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { |
209 | 219 | ||
210 | delete m_term; | 220 | delete m_term; |
211 | 221 | ||
212 | m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); | 222 | m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); |
213 | 223 | ||
214 | if (m_term) { | 224 | if (m_term) { |
215 | m_term->load( m_prof ); | 225 | m_term->load( m_prof ); |
216 | m_svTerm->addChild( m_term ); | 226 | m_svTerm->addChild( m_term ); |
217 | } | 227 | } |
218 | } | 228 | } |
219 | 229 | ||
220 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { | 230 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { |
221 | delete m_key; | 231 | delete m_key; |
222 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); | 232 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); |
223 | 233 | ||
224 | if (m_key) { | 234 | if (m_key) { |
225 | 235 | ||
226 | m_key->load(m_prof); | 236 | m_key->load(m_prof); |
227 | m_layKey->addWidget(m_key); | 237 | m_layKey->addWidget(m_key); |
228 | } | 238 | } |
229 | 239 | ||
230 | } | 240 | } |