-rw-r--r-- | noncore/apps/opie-console/configdialog.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/consoleconfigwidget.cpp | 19 | ||||
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 81 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.control | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/opie-console.pro | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileeditordialog.cpp | 21 |
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 | |||
@@ -66,44 +66,44 @@ void ConfigDialog::slotRemove() { | |||
66 | } | 66 | } |
67 | 67 | ||
68 | void ConfigDialog::slotEdit() { | 68 | void ConfigDialog::slotEdit() { |
69 | Profile p; | 69 | Profile p; |
70 | 70 | ||
71 | if(!lstView->currentItem()) return; | 71 | if(!lstView->currentItem()) return; |
72 | 72 | ||
73 | // Load profile | 73 | // Load profile |
74 | p = ((ConfigListItem*)lstView->currentItem())->profile(); | 74 | p = ((ConfigListItem*)lstView->currentItem())->profile(); |
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 | ||
82 | if(ret == QDialog::Accepted) | 82 | if(ret == QDialog::Accepted) |
83 | { | 83 | { |
84 | if(lstView->currentItem()) delete lstView->currentItem(); | 84 | if(lstView->currentItem()) delete lstView->currentItem(); |
85 | 85 | ||
86 | // use dlg.terminal()! | 86 | // use dlg.terminal()! |
87 | Profile p = dlg.profile(); | 87 | Profile p = dlg.profile(); |
88 | 88 | ||
89 | new ConfigListItem(lstView, p); | 89 | new ConfigListItem(lstView, p); |
90 | } | 90 | } |
91 | } | 91 | } |
92 | 92 | ||
93 | 93 | ||
94 | void ConfigDialog::slotAdd() { | 94 | void 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 | ||
101 | if(ret == QDialog::Accepted) | 101 | if(ret == QDialog::Accepted) |
102 | { | 102 | { |
103 | // TODO: Move into general profile save part | 103 | // TODO: Move into general profile save part |
104 | // assignments | 104 | // assignments |
105 | //QString type = dlg.term_type(); | 105 | //QString type = dlg.term_type(); |
106 | //if(type == "VT102") profile = Profile::VT102; | 106 | //if(type == "VT102") profile = Profile::VT102; |
107 | 107 | ||
108 | // get profile from editor | 108 | // get profile from editor |
109 | Profile p = dlg.profile(); | 109 | Profile p = dlg.profile(); |
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 | |||
@@ -1,22 +1,26 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qlayout.h> | 2 | #include <qlayout.h> |
3 | #include <qcombobox.h> | 3 | #include <qcombobox.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <qpushbutton.h> | 5 | #include <qpushbutton.h> |
6 | #include <qlistview.h> | 6 | #include <qlistview.h> |
7 | #include <qhbox.h> | 7 | #include <qhbox.h> |
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 | ||
13 | ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, | 17 | ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent, |
14 | const char* na ) | 18 | const char* na ) |
15 | : ProfileDialogConnectionWidget( name, parent, na ) { | 19 | : ProfileDialogConnectionWidget( name, parent, na ) { |
16 | m_lay = new QVBoxLayout( this ); | 20 | m_lay = new QVBoxLayout( this ); |
17 | QLabel *label = new QLabel(tr("Command to execute"), this); | 21 | QLabel *label = new QLabel(tr("Command to execute"), this); |
18 | m_lay->addWidget(label); | 22 | m_lay->addWidget(label); |
19 | m_cmd = new QLineEdit(this); | 23 | m_cmd = new QLineEdit(this); |
20 | m_lay->addWidget(m_cmd); | 24 | m_lay->addWidget(m_cmd); |
21 | label = new QLabel(tr("Environment Variables"), this); | 25 | label = new QLabel(tr("Environment Variables"), this); |
22 | m_lay->addWidget(label); | 26 | m_lay->addWidget(label); |
@@ -56,29 +60,36 @@ void ConsoleConfigWidget::slotAdd() { | |||
56 | void ConsoleConfigWidget::slotRemove() { | 60 | void ConsoleConfigWidget::slotRemove() { |
57 | QListViewItem *item = m_env->currentItem(); | 61 | QListViewItem *item = m_env->currentItem(); |
58 | if (item) { | 62 | if (item) { |
59 | m_env->takeItem(item); | 63 | m_env->takeItem(item); |
60 | } | 64 | } |
61 | } | 65 | } |
62 | 66 | ||
63 | ConsoleConfigWidget::~ConsoleConfigWidget() { | 67 | ConsoleConfigWidget::~ConsoleConfigWidget() { |
64 | } | 68 | } |
65 | 69 | ||
66 | void ConsoleConfigWidget::load( const Profile& prof ) { | 70 | void 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), ""); |
76 | QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); | 87 | QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); |
77 | if (!(name.isEmpty() || value.isEmpty())) { | 88 | if (!(name.isEmpty() || value.isEmpty())) { |
78 | QListViewItem *item = new QListViewItem(m_env); | 89 | QListViewItem *item = new QListViewItem(m_env); |
79 | item->setText(0, name); | 90 | item->setText(0, name); |
80 | item->setText(1, value); | 91 | item->setText(1, value); |
81 | m_env->insertItem(item); | 92 | m_env->insertItem(item); |
82 | } | 93 | } |
83 | } | 94 | } |
84 | } | 95 | } |
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 | |||
@@ -20,85 +20,82 @@ public: | |||
20 | FixIt(); | 20 | FixIt(); |
21 | ~FixIt(); | 21 | ~FixIt(); |
22 | void fixIt(); | 22 | void fixIt(); |
23 | /* no real interested in implementing it */ | 23 | /* no real interested in implementing it */ |
24 | void breakIt() { | 24 | void breakIt() { |
25 | 25 | ||
26 | }; | 26 | }; |
27 | char* m_file; | 27 | char* m_file; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | FixIt::FixIt() { | 30 | FixIt::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 | "#" |
43 | id:5:initdefault: | 43 | "id:5:initdefault:" |
44 | 44 | "" | |
45 | # Specify things to do when starting | 45 | "# Specify things to do when starting" |
46 | si::sysinit:/etc/rc.d/rc.sysinit | 46 | "si::sysinit:/etc/rc.d/rc.sysinit" |
47 | 47 | "" | |
48 | l0:0:wait:/root/etc/rc.d/rc 0 | 48 | "l0:0:wait:/root/etc/rc.d/rc 0" |
49 | l1:1:wait:/etc/rc.d/rc 1 | 49 | "l1:1:wait:/etc/rc.d/rc 1" |
50 | l2:2:wait:/etc/rc.d/rc 2 | 50 | "l2:2:wait:/etc/rc.d/rc 2" |
51 | l3:3:wait:/etc/rc.d/rc 3 | 51 | "l3:3:wait:/etc/rc.d/rc 3" |
52 | l4:4:wait:/etc/rc.d/rc 4 | 52 | "l4:4:wait:/etc/rc.d/rc 4" |
53 | l5:5:wait:/etc/rc.d/rc 5 | 53 | "l5:5:wait:/etc/rc.d/rc 5" |
54 | l6: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" |
57 | um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 | 57 | "um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1" |
58 | sw::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" |
61 | s0: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" |
65 | 1:2:respawn:/sbin/getty 9600 tty1 | 65 | "1:2:respawn:/sbin/getty 9600 tty1" |
66 | ln: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." |
70 | sy::respawn:/sbin/shsync\n"; | 70 | "sy::respawn:/sbin/shsync\n"; |
71 | |||
72 | |||
73 | } | 71 | } |
74 | FixIt::~FixIt() { | 72 | FixIt::~FixIt() { |
75 | } | 73 | } |
76 | /* | 74 | /* |
77 | * the retail Zaurus is broken in many ways | 75 | * the retail Zaurus is broken in many ways |
78 | * one is that pppd is listening on our port... | 76 | * one is that pppd is listening on our port... |
79 | * we've to stop it from that and then do kill(SIGHUP,1); | 77 | * we've to stop it from that and then do kill(SIGHUP,1); |
80 | */ | 78 | */ |
81 | void FixIt::fixIt() { | 79 | void FixIt::fixIt() { |
82 | ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); | 80 | ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); |
83 | QFile file( "/etc/inittab" ); | 81 | QFile file( "/etc/inittab" ); |
84 | if ( file.open(IO_WriteOnly | IO_Raw ) ) { | 82 | if ( file.open(IO_WriteOnly | IO_Raw ) ) { |
85 | file.writeBlock(m_file,strlen(m_file) ); | 83 | file.writeBlock(m_file,strlen(m_file) ); |
86 | } | 84 | } |
87 | file.close(); | 85 | file.close(); |
88 | ::kill( SIGHUP, 1 ); | 86 | ::kill( SIGHUP, 1 ); |
89 | } | 87 | } |
90 | #endif | 88 | #endif |
91 | 89 | ||
92 | |||
93 | int main(int argc, char **argv) { | 90 | int 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 ); |
96 | 93 | ||
97 | #ifdef FSCKED_DISTRIBUTION | 94 | #ifdef FSCKED_DISTRIBUTION |
98 | qWarning("fscked"); | 95 | qWarning("fscked"); |
99 | FixIt it; | 96 | FixIt it; |
100 | it.fixIt(); | 97 | it.fixIt(); |
101 | #endif | 98 | #endif |
102 | 99 | ||
103 | MainWindow mw; | 100 | MainWindow mw; |
104 | mw.setCaption(QObject::tr("Opie Console") ); | 101 | mw.setCaption(QObject::tr("Opie Console") ); |
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 | |||
@@ -75,34 +75,34 @@ void MainWindow::initUI() { | |||
75 | */ | 75 | */ |
76 | m_setProfiles = new QAction(tr("Configure Profiles"), | 76 | m_setProfiles = new QAction(tr("Configure Profiles"), |
77 | Resource::loadPixmap( "SettingsIcon" ), | 77 | Resource::loadPixmap( "SettingsIcon" ), |
78 | QString::null, 0, this, 0); | 78 | QString::null, 0, this, 0); |
79 | m_setProfiles->addTo( m_console ); | 79 | m_setProfiles->addTo( m_console ); |
80 | connect( m_setProfiles, SIGNAL(activated() ), | 80 | connect( m_setProfiles, SIGNAL(activated() ), |
81 | this, SLOT(slotConfigure() ) ); | 81 | this, SLOT(slotConfigure() ) ); |
82 | 82 | ||
83 | m_console->insertSeparator(); | 83 | m_console->insertSeparator(); |
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 ); |
91 | connect( newCon, SIGNAL(activated() ), | 91 | connect( newCon, SIGNAL(activated() ), |
92 | this, SLOT(slotNew() ) ); | 92 | this, SLOT(slotNew() ) ); |
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 ); |
100 | connect( saveCon, SIGNAL(activated() ), | 100 | connect( saveCon, SIGNAL(activated() ), |
101 | this, SLOT(slotSaveSession() ) ); | 101 | this, SLOT(slotSaveSession() ) ); |
102 | m_console->insertSeparator(); | 102 | m_console->insertSeparator(); |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * connect action | 105 | * connect action |
106 | */ | 106 | */ |
107 | m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"), | 107 | m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"), |
108 | QString::null, 0, this, 0 ); | 108 | QString::null, 0, this, 0 ); |
@@ -419,24 +419,25 @@ void MainWindow::slotTerminate() { | |||
419 | 419 | ||
420 | 420 | ||
421 | 421 | ||
422 | 422 | ||
423 | void MainWindow::slotQuickLaunch() { | 423 | void MainWindow::slotQuickLaunch() { |
424 | Profile prof = manager()->profile( "default" ); | 424 | Profile prof = manager()->profile( "default" ); |
425 | if ( prof.name() == "default" ) { | 425 | if ( prof.name() == "default" ) { |
426 | create( prof ); | 426 | create( prof ); |
427 | } else { | 427 | } else { |
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 | } |
434 | 435 | ||
435 | void MainWindow::slotConfigure() { | 436 | void MainWindow::slotConfigure() { |
436 | ConfigDialog conf( manager()->all(), factory() ); | 437 | ConfigDialog conf( manager()->all(), factory() ); |
437 | conf.showMaximized(); | 438 | conf.showMaximized(); |
438 | 439 | ||
439 | int ret = conf.exec(); | 440 | int ret = conf.exec(); |
440 | 441 | ||
441 | if ( QDialog::Accepted == ret ) { | 442 | if ( QDialog::Accepted == ret ) { |
442 | manager()->setProfiles( conf.list() ); | 443 | manager()->setProfiles( conf.list() ); |
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 | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-console | 1 | Package: opie-console |
2 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* | 2 | Files: bin/opie-console apps/Applications/opie-console.desktop pics/console/* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Opie team <opie@handhelds.org> | 5 | Maintainer: Opie team <opie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 0.6-$SUB_VERSION | 7 | Version: 0.6-$SUB_VERSION |
8 | Depends: qpe-base, libopie1, lrzsz, opie-keytabs | 8 | Depends: qpe-base, libopie1, opie-console-help-en, lrzsz, opie-keytabs |
9 | License: GPL | 9 | License: GPL |
10 | Description: Opie terminal app | 10 | Description: 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 | |||
@@ -2,25 +2,24 @@ TEMPLATE = app | |||
2 | TMAKE_CXXFLAGS+= -DHAVE_OPENPTY | 2 | TMAKE_CXXFLAGS+= -DHAVE_OPENPTY |
3 | CONFIG += qt warn_on release | 3 | CONFIG += qt warn_on release |
4 | #CONFIG = qt debug | 4 | #CONFIG = qt debug |
5 | DESTDIR = $(OPIEDIR)/bin | 5 | DESTDIR = $(OPIEDIR)/bin |
6 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ | 6 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ |
7 | file_layer.h filetransfer.h \ | 7 | file_layer.h filetransfer.h \ |
8 | metafactory.h \ | 8 | metafactory.h \ |
9 | session.h \ | 9 | session.h \ |
10 | mainwindow.h \ | 10 | mainwindow.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 \ |
18 | transferdialog.h \ | 17 | transferdialog.h \ |
19 | profiledialogwidget.h \ | 18 | profiledialogwidget.h \ |
20 | profileeditordialog.h \ | 19 | profileeditordialog.h \ |
21 | default.h \ | 20 | default.h \ |
22 | iolayerbase.h \ | 21 | iolayerbase.h \ |
23 | serialconfigwidget.h irdaconfigwidget.h \ | 22 | serialconfigwidget.h irdaconfigwidget.h \ |
24 | btconfigwidget.h modemconfigwidget.h \ | 23 | btconfigwidget.h modemconfigwidget.h \ |
25 | atconfigdialog.h dialdialog.h \ | 24 | atconfigdialog.h dialdialog.h \ |
26 | procctl.h \ | 25 | procctl.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 | |||
@@ -25,31 +25,31 @@ ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact, | |||
25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) | 25 | : QDialog(0, 0, TRUE), m_fact( fact ), m_prof( prof ) |
26 | { | 26 | { |
27 | initUI(); | 27 | initUI(); |
28 | 28 | ||
29 | // Apply current profile | 29 | // Apply current profile |
30 | // plugin_plugin->load(profile); | 30 | // plugin_plugin->load(profile); |
31 | // ... (reset profile name line edit etc.) | 31 | // ... (reset profile name line edit etc.) |
32 | } | 32 | } |
33 | 33 | ||
34 | ProfileEditorDialog::ProfileEditorDialog( MetaFactory* fact ) | 34 | ProfileEditorDialog::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 | ||
46 | Profile ProfileEditorDialog::profile() const | 46 | Profile ProfileEditorDialog::profile() const |
47 | { | 47 | { |
48 | return m_prof; | 48 | return m_prof; |
49 | } | 49 | } |
50 | 50 | ||
51 | void ProfileEditorDialog::initUI() | 51 | void ProfileEditorDialog::initUI() |
52 | { | 52 | { |
53 | m_con = m_term = m_key = 0l; | 53 | m_con = m_term = m_key = 0l; |
54 | 54 | ||
55 | 55 | ||
@@ -114,29 +114,29 @@ void ProfileEditorDialog::initUI() | |||
114 | QStringList list = m_fact->connectionWidgets(); | 114 | QStringList list = m_fact->connectionWidgets(); |
115 | QStringList::Iterator it; | 115 | QStringList::Iterator it; |
116 | for (it =list.begin(); it != list.end(); ++it ) { | 116 | for (it =list.begin(); it != list.end(); ++it ) { |
117 | m_conCmb->insertItem( (*it) ); | 117 | m_conCmb->insertItem( (*it) ); |
118 | } | 118 | } |
119 | list = m_fact->terminalWidgets(); | 119 | list = m_fact->terminalWidgets(); |
120 | for (it =list.begin(); it != list.end(); ++it ) { | 120 | for (it =list.begin(); it != list.end(); ++it ) { |
121 | m_termCmb->insertItem( (*it) ); | 121 | m_termCmb->insertItem( (*it) ); |
122 | } | 122 | } |
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 | ||
134 | // signal and slots | 134 | // signal and slots |
135 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), | 135 | connect(m_conCmb, SIGNAL(activated(const QString& ) ), |
136 | this, SLOT(slotConActivated(const QString&) ) ); | 136 | this, SLOT(slotConActivated(const QString&) ) ); |
137 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), | 137 | connect(m_termCmb, SIGNAL(activated(const QString& ) ), |
138 | this, SLOT(slotTermActivated(const QString& ) ) ); | 138 | this, SLOT(slotTermActivated(const QString& ) ) ); |
139 | 139 | ||
140 | } | 140 | } |
141 | 141 | ||
142 | ProfileEditorDialog::~ProfileEditorDialog() { | 142 | ProfileEditorDialog::~ProfileEditorDialog() { |
@@ -190,46 +190,49 @@ QCString ProfileEditorDialog::profType()const | |||
190 | void ProfileEditorDialog::slotConActivated( const QString& str ) { | 190 | void ProfileEditorDialog::slotConActivated( const QString& str ) { |
191 | 191 | ||
192 | delete m_con; | 192 | delete m_con; |
193 | 193 | ||
194 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); | 194 | m_con = m_fact->newConnectionPlugin( str, m_svCon->viewport() ); |
195 | 195 | ||
196 | if ( !m_con ) { | 196 | if ( !m_con ) { |
197 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); | 197 | m_con = new NoOptions( str, m_svCon->viewport(), "name"); |
198 | } | 198 | } |
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 | ||
209 | m_con->load( m_prof ); | 212 | m_con->load( m_prof ); |
210 | m_svCon->addChild( m_con ); | 213 | m_svCon->addChild( m_con ); |
211 | } | 214 | } |
212 | 215 | ||
213 | 216 | ||
214 | /* | 217 | /* |
215 | * we need to switch the widget | 218 | * we need to switch the widget |
216 | */ | 219 | */ |
217 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { | 220 | void ProfileEditorDialog::slotTermActivated( const QString& str ) { |
218 | 221 | ||
219 | delete m_term; | 222 | delete m_term; |
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 | } |
227 | } | 230 | } |
228 | 231 | ||
229 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { | 232 | void ProfileEditorDialog::slotKeyActivated(const QString &str) { |
230 | delete m_key; | 233 | delete m_key; |
231 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); | 234 | m_key = m_fact->newKeyboardPlugin( str, m_tabKey ); |
232 | 235 | ||
233 | if (m_key) { | 236 | if (m_key) { |
234 | 237 | ||
235 | m_key->load(m_prof); | 238 | m_key->load(m_prof); |