summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console
authorkergoth <kergoth>2003-08-09 16:12:19 (UTC)
committer kergoth <kergoth>2003-08-09 16:12:19 (UTC)
commit1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (side-by-side diff)
tree3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/apps/opie-console
parente3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff)
downloadopie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip
opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz
opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2
Merge from BRANCH_1_0
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() {
ProfileEditorDialog dlg(m_fact, p);
- dlg.setCaption("Edit Connection Profile");
+ dlg.setCaption(tr("Edit Connection Profile"));
dlg.showMaximized();
int ret = dlg.exec();
@@ -94,7 +94,7 @@ void ConfigDialog::slotEdit() {
void ConfigDialog::slotAdd() {
ProfileEditorDialog dlg(m_fact);
- dlg.setCaption("New Connection");
+ dlg.setCaption(tr("New Connection"));
dlg.showMaximized();
int ret = dlg.exec();
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 @@
#include <qregexp.h>
#include <stdio.h>
+#include <pwd.h>
+#include <sys/types.h>
+
+
#include "consoleconfigwidget.h"
ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
@@ -65,11 +69,18 @@ ConsoleConfigWidget::~ConsoleConfigWidget() {
void ConsoleConfigWidget::load( const Profile& prof ) {
/*
- * we will use /bin/bash as default
- * but will fallback in MyPty to /bin/sh
- * if necessary
+ * default to the users default shell
*/
- m_cmd->setText(prof.readEntry("Command", "/bin/bash"));
+ struct passwd *ent = 0;
+ char *shell = "/bin/sh";
+
+ while ( (ent = getpwent()) != 0 ) {
+ if (ent->pw_shell != "") {
+ shell = ent->pw_shell;
+ }
+ }
+
+ m_cmd->setText(prof.readEntry("Command", shell ));
int envcount = prof.readNumEntry("EnvVars", 0);
for (int i=0; i<envcount; i++) {
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:
FixIt::FixIt() {
/* the new inittab */
- m_file = "#\n# /etc/inittab
-#
-
-# 0 - halt (Do NOT set initdefault to this)
-# 1 - Single user mode
-# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
-# 3 - Full multiuser mode
-# 4 - JavaVM(Intent) developer mode
-# 5 - JavaVM(Intent)
-# 6 - reboot (Do NOT set initdefault to this)
-#
-id:5:initdefault:
-
-# Specify things to do when starting
-si::sysinit:/etc/rc.d/rc.sysinit
-
-l0:0:wait:/root/etc/rc.d/rc 0
-l1:1:wait:/etc/rc.d/rc 1
-l2:2:wait:/etc/rc.d/rc 2
-l3:3:wait:/etc/rc.d/rc 3
-l4:4:wait:/etc/rc.d/rc 4
-l5:5:wait:/etc/rc.d/rc 5
-l6:6:wait:/root/etc/rc.d/rc 6
-
-# Specify things to do before rebooting
-um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1
-sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1
-
-# Specify program to run on ttyS0
-s0:24:respawn:/sbin/getty 9600 ttyS0
-#pd:5:respawn:/etc/sync/serialctl
-
-# Specify program to run on tty1
-1:2:respawn:/sbin/getty 9600 tty1
-ln:345:respawn:survive -l 6 /sbin/launch
-#qt:5:respawn:/sbin/qt
-
-# collie sp.
-sy::respawn:/sbin/shsync\n";
-
-
+ m_file = "#\n# /etc/inittab"
+"#"
+""
+"# 0 - halt (Do NOT set initdefault to this)"
+"# 1 - Single user mode"
+"# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)"
+"# 3 - Full multiuser mode"
+"# 4 - JavaVM(Intent) developer mode"
+"# 5 - JavaVM(Intent)"
+"# 6 - reboot (Do NOT set initdefault to this)"
+"#"
+"id:5:initdefault:"
+""
+"# Specify things to do when starting"
+"si::sysinit:/etc/rc.d/rc.sysinit"
+""
+"l0:0:wait:/root/etc/rc.d/rc 0"
+"l1:1:wait:/etc/rc.d/rc 1"
+"l2:2:wait:/etc/rc.d/rc 2"
+"l3:3:wait:/etc/rc.d/rc 3"
+"l4:4:wait:/etc/rc.d/rc 4"
+"l5:5:wait:/etc/rc.d/rc 5"
+"l6:6:wait:/root/etc/rc.d/rc 6"
+""
+"# Specify things to do before rebooting"
+"um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1"
+"sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1"
+""
+"# Specify program to run on ttyS0"
+"s0:24:respawn:/sbin/getty 9600 ttyS0"
+"#pd:5:respawn:/etc/sync/serialctl"
+""
+"# Specify program to run on tty1"
+"1:2:respawn:/sbin/getty 9600 tty1"
+"ln:345:respawn:survive -l 6 /sbin/launch"
+"#qt:5:respawn:/sbin/qt"
+""
+"# collie sp."
+"sy::respawn:/sbin/shsync\n";
}
FixIt::~FixIt() {
}
@@ -89,7 +87,6 @@ void FixIt::fixIt() {
}
#endif
-
int main(int argc, char **argv) {
// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole";
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() {
/*
* new Action for new sessions
*/
- QAction* newCon = new QAction(tr("New Connection"),
+ QAction* newCon = new QAction(tr("New Profile"),
Resource::loadPixmap( "new" ),
QString::null, 0, this, 0);
newCon->addTo( m_console );
@@ -93,7 +93,7 @@ void MainWindow::initUI() {
m_console->insertSeparator();
- QAction *saveCon = new QAction(tr("Save Connection"),
+ QAction *saveCon = new QAction( tr("Save Profile" ),
Resource::loadPixmap( "save" ), QString::null,
0, this, 0 );
saveCon->addTo( m_console );
@@ -428,6 +428,7 @@ void MainWindow::slotQuickLaunch() {
Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 );
newProf.setAutoConnect( true );
create( newProf );
+ slotSaveSession();
}
}
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
Maintainer: Opie team <opie@handhelds.org>
Architecture: arm
Version: 0.6-$SUB_VERSION
-Depends: qpe-base, libopie1, lrzsz, opie-keytabs
+Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs
License: GPL
Description: Opie terminal app
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 \
profile.h \
profileconfig.h \
profilemanager.h \
- configwidget.h \
tabwidget.h \
configdialog.h \
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,
ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact )
: QDialog(0, 0, TRUE), m_fact( fact )
{
- // Default profile
- m_prof = Profile("New Profile", "serial", "default", Profile::Black, Profile::White, Profile::VT102);
+ // Default profile
+ m_prof = Profile(tr("New Profile"), "serial", "default", Profile::Black, Profile::White, Profile::VT102);
- initUI();
+ initUI();
- // Apply current profile
- // plugin_plugin->load(profile);
+ // Apply current profile
+ // plugin_plugin->load(profile);
}
Profile ProfileEditorDialog::profile() const
@@ -123,11 +123,11 @@ void ProfileEditorDialog::initUI()
// load profile values
m_name->setText(m_prof.name());
- slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
- slotTermActivated( m_fact->external(m_prof.terminalName() ) );
slotKeyActivated( "Default Keyboard" );
setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb );
setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb );
+ slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
+ slotTermActivated( m_fact->external(m_prof.terminalName() ) );
m_autoConnect->setChecked(m_prof.autoConnect());
@@ -199,10 +199,13 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
// FIXME ugly hack right. Right solution would be to look into the layer and see if it
// supports auto connect and then set it as prefered
- //if ( ( )->layer()->supports()[0] == 1 ) {
if ( m_conCmb ->currentText() == tr("Local Console") ) {
m_autoConnect->setChecked( true );
+ m_prof.writeEntry("Terminal", Profile::Linux );
+ slotTermActivated( m_fact->external (m_prof.terminalName() ) );
} else {
+ m_prof.writeEntry("Terminal", Profile::VT102 );
+ slotTermActivated( m_fact->external (m_prof.terminalName() ) );
m_autoConnect->setChecked( false );
}
@@ -220,7 +223,7 @@ void ProfileEditorDialog::slotTermActivated( const QString& str ) {
m_term = m_fact->newTerminalPlugin( str, m_svTerm->viewport() );
- if (m_term) {
+ if ( m_term ) {
m_term->load( m_prof );
m_svTerm->addChild( m_term );
}