summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
Unidiff
Diffstat (limited to 'noncore/apps/opie-console') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/configdialog.cpp4
-rw-r--r--noncore/apps/opie-console/consoleconfigwidget.cpp19
-rw-r--r--noncore/apps/opie-console/main.cpp81
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp5
-rw-r--r--noncore/apps/opie-console/opie-console.control2
-rw-r--r--noncore/apps/opie-console/opie-console.pro1
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp21
7 files changed, 72 insertions, 61 deletions
diff --git a/noncore/apps/opie-console/configdialog.cpp b/noncore/apps/opie-console/configdialog.cpp
index 0bc6588..53b3853 100644
--- a/noncore/apps/opie-console/configdialog.cpp
+++ b/noncore/apps/opie-console/configdialog.cpp
@@ -75,7 +75,7 @@ void ConfigDialog::slotEdit() {
75 75
76 ProfileEditorDialog dlg(m_fact, p); 76 ProfileEditorDialog dlg(m_fact, p);
77 77
78 dlg.setCaption("Edit Connection Profile"); 78 dlg.setCaption(tr("Edit Connection Profile"));
79 dlg.showMaximized(); 79 dlg.showMaximized();
80 int ret = dlg.exec(); 80 int ret = dlg.exec();
81 81
@@ -94,7 +94,7 @@ void ConfigDialog::slotEdit() {
94void ConfigDialog::slotAdd() { 94void ConfigDialog::slotAdd() {
95 ProfileEditorDialog dlg(m_fact); 95 ProfileEditorDialog dlg(m_fact);
96 96
97 dlg.setCaption("New Connection"); 97 dlg.setCaption(tr("New Connection"));
98 dlg.showMaximized(); 98 dlg.showMaximized();
99 int ret = dlg.exec(); 99 int ret = dlg.exec();
100 100
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp
index 3f2d154..faedc58 100644
--- a/noncore/apps/opie-console/consoleconfigwidget.cpp
+++ b/noncore/apps/opie-console/consoleconfigwidget.cpp
@@ -8,6 +8,10 @@
8#include <qregexp.h> 8#include <qregexp.h>
9#include <stdio.h> 9#include <stdio.h>
10 10
11#include <pwd.h>
12#include <sys/types.h>
13
14
11#include "consoleconfigwidget.h" 15#include "consoleconfigwidget.h"
12 16
13ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, 17ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
@@ -65,11 +69,18 @@ ConsoleConfigWidget::~ConsoleConfigWidget() {
65 69
66void ConsoleConfigWidget::load( const Profile& prof ) { 70void ConsoleConfigWidget::load( const Profile& prof ) {
67 /* 71 /*
68 * we will use /bin/bash as default 72 * default to the users default shell
69 * but will fallback in MyPty to /bin/sh
70 * if necessary
71 */ 73 */
72 m_cmd->setText(prof.readEntry("Command", "/bin/bash")); 74 struct passwd *ent = 0;
75 char *shell = "/bin/sh";
76
77 while ( (ent = getpwent()) != 0 ) {
78 if (ent->pw_shell != "") {
79 shell = ent->pw_shell;
80 }
81 }
82
83 m_cmd->setText(prof.readEntry("Command", shell ));
73 int envcount = prof.readNumEntry("EnvVars", 0); 84 int envcount = prof.readNumEntry("EnvVars", 0);
74 for (int i=0; i<envcount; i++) { 85 for (int i=0; i<envcount; i++) {
75 QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); 86 QString name = prof.readEntry("Env_Name_" + QString::number(i), "");
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
index b17f8e8..228db57 100644
--- a/noncore/apps/opie-console/main.cpp
+++ b/noncore/apps/opie-console/main.cpp
@@ -29,47 +29,45 @@ public:
29 29
30FixIt::FixIt() { 30FixIt::FixIt() {
31 /* the new inittab */ 31 /* the new inittab */
32 m_file = "#\n# /etc/inittab 32 m_file = "#\n# /etc/inittab"
33# 33"#"
34 34""
35# 0 - halt (Do NOT set initdefault to this) 35"# 0 - halt (Do NOT set initdefault to this)"
36# 1 - Single user mode 36"# 1 - Single user mode"
37# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) 37"# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)"
38# 3 - Full multiuser mode 38"# 3 - Full multiuser mode"
39# 4 - JavaVM(Intent) developer mode 39"# 4 - JavaVM(Intent) developer mode"
40# 5 - JavaVM(Intent) 40"# 5 - JavaVM(Intent)"
41# 6 - reboot (Do NOT set initdefault to this) 41"# 6 - reboot (Do NOT set initdefault to this)"
42# 42"#"
43id:5:initdefault: 43"id:5:initdefault:"
44 44""
45# Specify things to do when starting 45"# Specify things to do when starting"
46si::sysinit:/etc/rc.d/rc.sysinit 46"si::sysinit:/etc/rc.d/rc.sysinit"
47 47""
48l0:0:wait:/root/etc/rc.d/rc 0 48"l0:0:wait:/root/etc/rc.d/rc 0"
49l1:1:wait:/etc/rc.d/rc 1 49"l1:1:wait:/etc/rc.d/rc 1"
50l2:2:wait:/etc/rc.d/rc 2 50"l2:2:wait:/etc/rc.d/rc 2"
51l3:3:wait:/etc/rc.d/rc 3 51"l3:3:wait:/etc/rc.d/rc 3"
52l4:4:wait:/etc/rc.d/rc 4 52"l4:4:wait:/etc/rc.d/rc 4"
53l5:5:wait:/etc/rc.d/rc 5 53"l5:5:wait:/etc/rc.d/rc 5"
54l6:6:wait:/root/etc/rc.d/rc 6 54"l6:6:wait:/root/etc/rc.d/rc 6"
55 55""
56# Specify things to do before rebooting 56"# Specify things to do before rebooting"
57um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 57"um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1"
58sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1 58"sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1"
59 59""
60# Specify program to run on ttyS0 60"# Specify program to run on ttyS0"
61s0:24:respawn:/sbin/getty 9600 ttyS0 61"s0:24:respawn:/sbin/getty 9600 ttyS0"
62#pd:5:respawn:/etc/sync/serialctl 62"#pd:5:respawn:/etc/sync/serialctl"
63 63""
64# Specify program to run on tty1 64"# Specify program to run on tty1"
651:2:respawn:/sbin/getty 9600 tty1 65"1:2:respawn:/sbin/getty 9600 tty1"
66ln:345:respawn:survive -l 6 /sbin/launch 66"ln:345:respawn:survive -l 6 /sbin/launch"
67#qt:5:respawn:/sbin/qt 67"#qt:5:respawn:/sbin/qt"
68 68""
69# collie sp. 69"# collie sp."
70sy::respawn:/sbin/shsync\n"; 70"sy::respawn:/sbin/shsync\n";
71
72
73} 71}
74FixIt::~FixIt() { 72FixIt::~FixIt() {
75} 73}
@@ -89,7 +87,6 @@ void FixIt::fixIt() {
89} 87}
90#endif 88#endif
91 89
92
93int main(int argc, char **argv) { 90int main(int argc, char **argv) {
94// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; 91// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole";
95 QPEApplication app( argc, argv ); 92 QPEApplication app( argc, argv );
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index c48116d..3c9603c 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -84,7 +84,7 @@ void MainWindow::initUI() {
84 /* 84 /*
85 * new Action for new sessions 85 * new Action for new sessions
86 */ 86 */
87 QAction* newCon = new QAction(tr("New Connection"), 87 QAction* newCon = new QAction(tr("New Profile"),
88 Resource::loadPixmap( "new" ), 88 Resource::loadPixmap( "new" ),
89 QString::null, 0, this, 0); 89 QString::null, 0, this, 0);
90 newCon->addTo( m_console ); 90 newCon->addTo( m_console );
@@ -93,7 +93,7 @@ void MainWindow::initUI() {
93 93
94 m_console->insertSeparator(); 94 m_console->insertSeparator();
95 95
96 QAction *saveCon = new QAction(tr("Save Connection"), 96 QAction *saveCon = new QAction( tr("Save Profile" ),
97 Resource::loadPixmap( "save" ), QString::null, 97 Resource::loadPixmap( "save" ), QString::null,
98 0, this, 0 ); 98 0, this, 0 );
99 saveCon->addTo( m_console ); 99 saveCon->addTo( m_console );
@@ -428,6 +428,7 @@ void MainWindow::slotQuickLaunch() {
428 Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); 428 Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 );
429 newProf.setAutoConnect( true ); 429 newProf.setAutoConnect( true );
430 create( newProf ); 430 create( newProf );
431 slotSaveSession();
431 } 432 }
432 433
433} 434}
diff --git a/noncore/apps/opie-console/opie-console.control b/noncore/apps/opie-console/opie-console.control
index 693c72c..852451d 100644
--- a/noncore/apps/opie-console/opie-console.control
+++ b/noncore/apps/opie-console/opie-console.control
@@ -5,7 +5,7 @@ Section: opie/applications
5Maintainer: Opie team <opie@handhelds.org> 5Maintainer: Opie team <opie@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 0.6-$SUB_VERSION 7Version: 0.6-$SUB_VERSION
8Depends: qpe-base, libopie1, lrzsz, opie-keytabs 8Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs
9License: GPL 9License: GPL
10Description: Opie terminal app 10Description: Opie terminal app
11 11
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro
index 58b29ca..ccf2e08 100644
--- a/noncore/apps/opie-console/opie-console.pro
+++ b/noncore/apps/opie-console/opie-console.pro
@@ -11,7 +11,6 @@ HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \
11 profile.h \ 11 profile.h \
12 profileconfig.h \ 12 profileconfig.h \
13 profilemanager.h \ 13 profilemanager.h \
14 configwidget.h \
15 tabwidget.h \ 14 tabwidget.h \
16 configdialog.h \ 15 configdialog.h \
17 keytrans.h \ 16 keytrans.h \
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 6b607df..e2501a6 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -34,13 +34,13 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact,
34ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) 34ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact )
35 : QDialog(0, 0, TRUE), m_fact( fact ) 35 : QDialog(0, 0, TRUE), m_fact( fact )
36{ 36{
37 // Default profile 37 // Default profile
38 m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102); 38 m_prof = Profile(tr("New Profile"), "serial", "default", Profile::Black, Profile::White, Profile::VT102);
39 39
40 initUI(); 40 initUI();
41 41
42 // Apply current profile 42 // Apply current profile
43 // plugin_plugin->load(profile); 43 // plugin_plugin->load(profile);
44} 44}
45 45
46Profile ProfileEditorDialog::profile() const 46Profile ProfileEditorDialog::profile() const
@@ -123,11 +123,11 @@ void ProfileEditorDialog::initUI()
123 123
124 // load profile values 124 // load profile values
125 m_name->setText(m_prof.name()); 125 m_name->setText(m_prof.name());
126 slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
127 slotTermActivated( m_fact->external(m_prof.terminalName() ) );
128 slotKeyActivated( "Default Keyboard" ); 126 slotKeyActivated( "Default Keyboard" );
129 setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); 127 setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb );
130 setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); 128 setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb );
129 slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
130 slotTermActivated( m_fact->external(m_prof.terminalName() ) );
131 m_autoConnect->setChecked(m_prof.autoConnect()); 131 m_autoConnect->setChecked(m_prof.autoConnect());
132 132
133 133
@@ -199,10 +199,13 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
199 199
200 // FIXME ugly hack right. Right solution would be to look into the layer and see if it 200 // FIXME ugly hack right. Right solution would be to look into the layer and see if it
201 // supports auto connect and then set it as prefered 201 // supports auto connect and then set it as prefered
202 //if ( ( )->layer()->supports()[0] == 1 ) {
203 if ( m_conCmb ->currentText() == tr("Local Console") ) { 202 if ( m_conCmb ->currentText() == tr("Local Console") ) {
204 m_autoConnect->setChecked( true ); 203 m_autoConnect->setChecked( true );
204 m_prof.writeEntry("Terminal", Profile::Linux );
205 slotTermActivated( m_fact->external (m_prof.terminalName() ) );
205 } else { 206 } else {
207 m_prof.writeEntry("Terminal", Profile::VT102 );
208 slotTermActivated( m_fact->external (m_prof.terminalName() ) );
206 m_autoConnect->setChecked( false ); 209 m_autoConnect->setChecked( false );
207 } 210 }
208 211
@@ -220,7 +223,7 @@ void ProfileEditorDialog::slotTermActivated( const QString& str ) {
220 223
221 m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() ); 224 m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() );
222 225
223 if (m_term) { 226 if ( m_term ) {
224 m_term->load( m_prof ); 227 m_term->load( m_prof );
225 m_svTerm->addChild( m_term ); 228 m_svTerm->addChild( m_term );
226 } 229 }