author | josef <josef> | 2002-10-14 16:48:18 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-14 16:48:18 (UTC) |
commit | 8168216f961dc60db1acdea8671eeaa93e3ed560 (patch) (unidiff) | |
tree | cd9fe6e2e905069dbf140cd51e9fc910ec3eba3f | |
parent | f48ddfb53e49550f9fe8e9502f2a44aeb8b359cc (diff) | |
download | opie-8168216f961dc60db1acdea8671eeaa93e3ed560.zip opie-8168216f961dc60db1acdea8671eeaa93e3ed560.tar.gz opie-8168216f961dc60db1acdea8671eeaa93e3ed560.tar.bz2 |
- use OTabDialog::TextStyle (might be done for terminal sessions, too?)
- show only vt100 and vt102 entries
- save profiles upon closing profiles manager dialog
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/profile.h | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/terminalwidget.cpp | 21 |
4 files changed, 15 insertions, 10 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 27bcc09..415259e 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -265,24 +265,25 @@ void MainWindow::slotTerminate() { | |||
265 | } | 265 | } |
266 | 266 | ||
267 | void MainWindow::slotConfigure() { | 267 | void MainWindow::slotConfigure() { |
268 | qWarning("configure"); | 268 | qWarning("configure"); |
269 | ConfigDialog conf( manager()->all(), factory() ); | 269 | ConfigDialog conf( manager()->all(), factory() ); |
270 | conf.showMaximized(); | 270 | conf.showMaximized(); |
271 | 271 | ||
272 | int ret = conf.exec(); | 272 | int ret = conf.exec(); |
273 | 273 | ||
274 | if ( QDialog::Accepted == ret ) { | 274 | if ( QDialog::Accepted == ret ) { |
275 | qWarning("conf %d", conf.list().count() ); | 275 | qWarning("conf %d", conf.list().count() ); |
276 | manager()->setProfiles( conf.list() ); | 276 | manager()->setProfiles( conf.list() ); |
277 | manager()->save(); | ||
277 | populateProfiles(); | 278 | populateProfiles(); |
278 | } | 279 | } |
279 | } | 280 | } |
280 | /* | 281 | /* |
281 | * we will remove | 282 | * we will remove |
282 | * this window from the tabwidget | 283 | * this window from the tabwidget |
283 | * remove it from the list | 284 | * remove it from the list |
284 | * delete it | 285 | * delete it |
285 | * and set the currentSession() | 286 | * and set the currentSession() |
286 | */ | 287 | */ |
287 | void MainWindow::slotClose() { | 288 | void MainWindow::slotClose() { |
288 | qWarning("close"); | 289 | qWarning("close"); |
diff --git a/noncore/apps/opie-console/profile.h b/noncore/apps/opie-console/profile.h index 78fe6ab..1b71cda 100644 --- a/noncore/apps/opie-console/profile.h +++ b/noncore/apps/opie-console/profile.h | |||
@@ -9,25 +9,25 @@ | |||
9 | * A session will be generated from a saved | 9 | * A session will be generated from a saved |
10 | * profile. A profile contains the iolayername | 10 | * profile. A profile contains the iolayername |
11 | * a name. | 11 | * a name. |
12 | * We can generate a Session from a Profile | 12 | * We can generate a Session from a Profile |
13 | * Configuration is contained here too | 13 | * Configuration is contained here too |
14 | */ | 14 | */ |
15 | class Profile { | 15 | class Profile { |
16 | public: | 16 | public: |
17 | typedef QValueList<Profile> ValueList; | 17 | typedef QValueList<Profile> ValueList; |
18 | enum Color { Black = 0, | 18 | enum Color { Black = 0, |
19 | White, | 19 | White, |
20 | Gray }; | 20 | Gray }; |
21 | enum Terminal {VT102 = 0 }; | 21 | enum Terminal {VT102 = 0, VT100 }; |
22 | enum Font { Micro = 0, Small, Medium }; | 22 | enum Font { Micro = 0, Small, Medium }; |
23 | Profile(); | 23 | Profile(); |
24 | Profile( const QString& name, | 24 | Profile( const QString& name, |
25 | const QCString& iolayerName, | 25 | const QCString& iolayerName, |
26 | const QCString& termName, | 26 | const QCString& termName, |
27 | int background, | 27 | int background, |
28 | int foreground, | 28 | int foreground, |
29 | int terminal); | 29 | int terminal); |
30 | Profile( const Profile& ); | 30 | Profile( const Profile& ); |
31 | Profile &operator=( const Profile& ); | 31 | Profile &operator=( const Profile& ); |
32 | bool operator==( const Profile& prof ); | 32 | bool operator==( const Profile& prof ); |
33 | 33 | ||
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp index 914fd25..094c871 100644 --- a/noncore/apps/opie-console/profileeditordialog.cpp +++ b/noncore/apps/opie-console/profileeditordialog.cpp | |||
@@ -49,24 +49,25 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | |||
49 | 49 | ||
50 | Profile ProfileEditorDialog::profile() const | 50 | Profile ProfileEditorDialog::profile() const |
51 | { | 51 | { |
52 | return m_prof; | 52 | return m_prof; |
53 | } | 53 | } |
54 | 54 | ||
55 | void ProfileEditorDialog::initUI() | 55 | void ProfileEditorDialog::initUI() |
56 | { | 56 | { |
57 | m_con = m_term = 0l; | 57 | m_con = m_term = 0l; |
58 | 58 | ||
59 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); | 59 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); |
60 | OTabWidget *tabWidget = new OTabWidget( this ); | 60 | OTabWidget *tabWidget = new OTabWidget( this ); |
61 | tabWidget->setTabStyle(OTabWidget::TextTab); | ||
61 | mainLayout->add(tabWidget); | 62 | mainLayout->add(tabWidget); |
62 | 63 | ||
63 | QWidget *tabprof; | 64 | QWidget *tabprof; |
64 | 65 | ||
65 | /* base tabs */ | 66 | /* base tabs */ |
66 | tabprof = new QWidget(this); | 67 | tabprof = new QWidget(this); |
67 | m_tabTerm = new QWidget(this); | 68 | m_tabTerm = new QWidget(this); |
68 | m_tabCon = new QWidget(this); | 69 | m_tabCon = new QWidget(this); |
69 | 70 | ||
70 | /* base layout for tabs */ | 71 | /* base layout for tabs */ |
71 | m_layCon = new QHBoxLayout( m_tabCon , 2 ); | 72 | m_layCon = new QHBoxLayout( m_tabCon , 2 ); |
72 | m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); | 73 | m_layTerm = new QHBoxLayout( m_tabTerm, 2 ); |
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp index 80627c4..2d37be2 100644 --- a/noncore/apps/opie-console/terminalwidget.cpp +++ b/noncore/apps/opie-console/terminalwidget.cpp | |||
@@ -4,25 +4,25 @@ | |||
4 | #include <qcombobox.h> | 4 | #include <qcombobox.h> |
5 | #include <qradiobutton.h> | 5 | #include <qradiobutton.h> |
6 | #include <qgroupbox.h> | 6 | #include <qgroupbox.h> |
7 | #include <qvbox.h> | 7 | #include <qvbox.h> |
8 | #include <qhgroupbox.h> | 8 | #include <qhgroupbox.h> |
9 | #include <qlayout.h> | 9 | #include <qlayout.h> |
10 | 10 | ||
11 | #include "terminalwidget.h" | 11 | #include "terminalwidget.h" |
12 | 12 | ||
13 | namespace { | 13 | namespace { |
14 | enum TermIds { | 14 | enum TermIds { |
15 | id_term_vt100, | 15 | id_term_vt100, |
16 | id_term_vt220, | 16 | id_term_vt102, |
17 | id_term_ansi | 17 | id_term_ansi |
18 | }; | 18 | }; |
19 | 19 | ||
20 | enum ColourIds { | 20 | enum ColourIds { |
21 | id_term_black, | 21 | id_term_black, |
22 | id_term_white | 22 | id_term_white |
23 | }; | 23 | }; |
24 | 24 | ||
25 | enum FontIds { | 25 | enum FontIds { |
26 | id_size_small, | 26 | id_size_small, |
27 | id_size_medium, | 27 | id_size_medium, |
28 | id_size_large | 28 | id_size_large |
@@ -64,26 +64,26 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
64 | m_hbox->add(m_sizeMedium ); | 64 | m_hbox->add(m_sizeMedium ); |
65 | m_hbox->add(m_sizeLarge ); | 65 | m_hbox->add(m_sizeLarge ); |
66 | m_lroot->add(m_groupSize ); | 66 | m_lroot->add(m_groupSize ); |
67 | 67 | ||
68 | m_colorBox->add( m_colorLabel ); | 68 | m_colorBox->add( m_colorLabel ); |
69 | m_colorBox->add( m_colorCmb ); | 69 | m_colorBox->add( m_colorCmb ); |
70 | 70 | ||
71 | m_lroot->add(m_groupConv ); | 71 | m_lroot->add(m_groupConv ); |
72 | m_lroot->add(m_groupOptions ); | 72 | m_lroot->add(m_groupOptions ); |
73 | 73 | ||
74 | // Fill in some options | 74 | // Fill in some options |
75 | m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); | 75 | m_terminalBox->insertItem( tr("VT 100"), id_term_vt100 ); |
76 | m_terminalBox->insertItem( tr("VT 220"), id_term_vt220 ); | 76 | m_terminalBox->insertItem( tr("VT 102"), id_term_vt102 ); |
77 | m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); | 77 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); |
78 | 78 | ||
79 | m_colorCmb->insertItem( tr("black on white"), id_term_black ); | 79 | m_colorCmb->insertItem( tr("black on white"), id_term_black ); |
80 | m_colorCmb->insertItem( tr("white on black"), id_term_white ); | 80 | m_colorCmb->insertItem( tr("white on black"), id_term_white ); |
81 | 81 | ||
82 | // signals + slots | 82 | // signals + slots |
83 | /* | 83 | /* |
84 | connect(m_terminalBox, SIGNAL(activated(int) ), | 84 | connect(m_terminalBox, SIGNAL(activated(int) ), |
85 | this, SLOT(slotTermTerm(int) ) ); | 85 | this, SLOT(slotTermTerm(int) ) ); |
86 | connect(m_colorBox, SIGNAL(activated(int) ), | 86 | connect(m_colorBox, SIGNAL(activated(int) ), |
87 | tis, SLOT(slotTermColor(int) ) ); | 87 | tis, SLOT(slotTermColor(int) ) ); |
88 | connect(m_groupSize, SIGNAL(activated(int) ), | 88 | connect(m_groupSize, SIGNAL(activated(int) ), |
89 | this, SLOT(slotTermFont(int) ) ); | 89 | this, SLOT(slotTermFont(int) ) ); |
@@ -101,27 +101,30 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
101 | TerminalWidget::~TerminalWidget() { | 101 | TerminalWidget::~TerminalWidget() { |
102 | } | 102 | } |
103 | void TerminalWidget::load( const Profile& prof ) { | 103 | void TerminalWidget::load( const Profile& prof ) { |
104 | int term = prof.readNumEntry("Terminal"); | 104 | int term = prof.readNumEntry("Terminal"); |
105 | int color = prof.readNumEntry("Color"); | 105 | int color = prof.readNumEntry("Color"); |
106 | int fontsize = prof.readNumEntry("Font"); | 106 | int fontsize = prof.readNumEntry("Font"); |
107 | int opt_echo = prof.readNumEntry("Echo"); | 107 | int opt_echo = prof.readNumEntry("Echo"); |
108 | int opt_wrap = prof.readNumEntry("Wrap"); | 108 | int opt_wrap = prof.readNumEntry("Wrap"); |
109 | int opt_inbound = prof.readNumEntry("Inbound"); | 109 | int opt_inbound = prof.readNumEntry("Inbound"); |
110 | int opt_outbound = prof.readNumEntry("Outbound"); | 110 | int opt_outbound = prof.readNumEntry("Outbound"); |
111 | 111 | ||
112 | switch( term ) { | 112 | switch( term ) { |
113 | case Profile::VT102: | 113 | case Profile::VT100: |
114 | m_terminalBox->setCurrentItem(id_term_vt100 ); | 114 | m_terminalBox->setCurrentItem(id_term_vt100 ); |
115 | break; | 115 | break; |
116 | case Profile::VT102: | ||
117 | m_terminalBox->setCurrentItem(id_term_vt102 ); | ||
118 | break; | ||
116 | default: | 119 | default: |
117 | break; | 120 | break; |
118 | }; | 121 | }; |
119 | 122 | ||
120 | switch( color ) { | 123 | switch( color ) { |
121 | case Profile::Black: | 124 | case Profile::Black: |
122 | m_colorCmb->setCurrentItem(id_term_black ); | 125 | m_colorCmb->setCurrentItem(id_term_black ); |
123 | break; | 126 | break; |
124 | case Profile::White: | 127 | case Profile::White: |
125 | m_colorCmb->setCurrentItem(id_term_white ); | 128 | m_colorCmb->setCurrentItem(id_term_white ); |
126 | break; | 129 | break; |
127 | default: | 130 | default: |
@@ -143,32 +146,32 @@ void TerminalWidget::load( const Profile& prof ) { | |||
143 | break; | 146 | break; |
144 | }; | 147 | }; |
145 | 148 | ||
146 | if (opt_echo) m_optionEcho->setChecked( true ); | 149 | if (opt_echo) m_optionEcho->setChecked( true ); |
147 | if (opt_wrap) m_optionWrap->setChecked( true ); | 150 | if (opt_wrap) m_optionWrap->setChecked( true ); |
148 | if (opt_inbound) m_convInbound->setChecked( true ); | 151 | if (opt_inbound) m_convInbound->setChecked( true ); |
149 | if (opt_outbound) m_convOutbound->setChecked( true ); | 152 | if (opt_outbound) m_convOutbound->setChecked( true ); |
150 | 153 | ||
151 | } | 154 | } |
152 | void TerminalWidget::save( Profile& profile ) { | 155 | void TerminalWidget::save( Profile& profile ) { |
153 | switch(m_terminalBox->currentItem() ) { | 156 | switch(m_terminalBox->currentItem() ) { |
154 | case id_term_vt100: | 157 | case id_term_vt100: |
155 | profile.writeEntry("Terminal", Profile::VT102 ); | 158 | profile.writeEntry("Terminal", Profile::VT100 ); |
156 | break; | ||
157 | case id_term_vt220: | ||
158 | profile.writeEntry("Terminal", Profile::VT102 ); | ||
159 | break; | 159 | break; |
160 | case id_term_ansi: | 160 | case id_term_vt102: |
161 | profile.writeEntry("Terminal", Profile::VT102 ); | 161 | profile.writeEntry("Terminal", Profile::VT102 ); |
162 | break; | 162 | break; |
163 | //case id_term_ansi: | ||
164 | // profile.writeEntry("Terminal", Profile::VT102 ); | ||
165 | // break; | ||
163 | default: | 166 | default: |
164 | break; | 167 | break; |
165 | }; | 168 | }; |
166 | 169 | ||
167 | // color | 170 | // color |
168 | switch(m_colorCmb->currentItem() ) { | 171 | switch(m_colorCmb->currentItem() ) { |
169 | case id_term_black: | 172 | case id_term_black: |
170 | profile.writeEntry("Color", Profile::Black ); | 173 | profile.writeEntry("Color", Profile::Black ); |
171 | break; | 174 | break; |
172 | case id_term_white: | 175 | case id_term_white: |
173 | profile.writeEntry("Color", Profile::White ); | 176 | profile.writeEntry("Color", Profile::White ); |
174 | break; | 177 | break; |