summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp17
-rw-r--r--noncore/apps/opie-console/consoleconfigwidget.cpp11
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp2
3 files changed, 25 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index b0f0275..c3c58be 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -290,9 +290,24 @@ void MyPty::close() {
290 m_fd = openPty(); 290 m_fd = openPty();
291} 291}
292void MyPty::reload( const Profile& prof) { 292void MyPty::reload( const Profile& prof) {
293 m_env.clear(); 293 m_env.clear();
294 m_cmd = prof.readEntry("Command", "/bin/bash"); 294 m_cmd = prof.readEntry("Command", "/bin/sh");
295
296 /*
297 * Lets check if m_cmd actually
298 * exists....
299 * we try to use bin/bash and if
300 * this fails we
301 * will fallback to /bin/sh
302 * which should be there 100%
303 */
304 if ( !QFile::exists(QFile::encodeName(m_cmd) ) )
305 if (QFile::exists("/bin/bash") )
306 m_cmd = "/bin/bash";
307 else
308 m_cmd = "/bin/sh";
309
295 int envcount = prof.readNumEntry("EnvVars", 0); 310 int envcount = prof.readNumEntry("EnvVars", 0);
296 for (int i=0; i<envcount; i++) { 311 for (int i=0; i<envcount; i++) {
297 QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); 312 QString name = prof.readEntry("Env_Name_" + QString::number(i), "");
298 QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); 313 QString value = prof.readEntry("Env_Value_" + QString::number(i), "");
diff --git a/noncore/apps/opie-console/consoleconfigwidget.cpp b/noncore/apps/opie-console/consoleconfigwidget.cpp
index 70e2e78..3f2d154 100644
--- a/noncore/apps/opie-console/consoleconfigwidget.cpp
+++ b/noncore/apps/opie-console/consoleconfigwidget.cpp
@@ -23,9 +23,9 @@ ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
23 m_env = new QListView(this); 23 m_env = new QListView(this);
24 m_env->addColumn(tr("Name")); 24 m_env->addColumn(tr("Name"));
25 m_env->addColumn(tr("Value")); 25 m_env->addColumn(tr("Value"));
26 m_lay->addWidget(m_env); 26 m_lay->addWidget(m_env);
27 27
28 QHBox *hbox = new QHBox(this); 28 QHBox *hbox = new QHBox(this);
29 label = new QLabel(tr("Name :"), hbox); 29 label = new QLabel(tr("Name :"), hbox);
30 m_name = new QLineEdit(hbox); 30 m_name = new QLineEdit(hbox);
31 m_lay->addWidget(hbox); 31 m_lay->addWidget(hbox);
@@ -33,9 +33,9 @@ ConsoleConfigWidget::ConsoleConfigWidget( const QString& name, QWidget* parent,
33 hbox = new QHBox(this); 33 hbox = new QHBox(this);
34 label = new QLabel(tr("Value :"), hbox); 34 label = new QLabel(tr("Value :"), hbox);
35 m_value = new QLineEdit(hbox); 35 m_value = new QLineEdit(hbox);
36 m_lay->addWidget(hbox); 36 m_lay->addWidget(hbox);
37 37
38 hbox = new QHBox(this); 38 hbox = new QHBox(this);
39 hbox->setSpacing(10); 39 hbox->setSpacing(10);
40 m_remove = new QPushButton(tr("Remove"), hbox); 40 m_remove = new QPushButton(tr("Remove"), hbox);
41 connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemove())); 41 connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemove()));
@@ -63,10 +63,15 @@ void ConsoleConfigWidget::slotRemove() {
63ConsoleConfigWidget::~ConsoleConfigWidget() { 63ConsoleConfigWidget::~ConsoleConfigWidget() {
64} 64}
65 65
66void ConsoleConfigWidget::load( const Profile& prof ) { 66void ConsoleConfigWidget::load( const Profile& prof ) {
67 /*
68 * we will use /bin/bash as default
69 * but will fallback in MyPty to /bin/sh
70 * if necessary
71 */
67 m_cmd->setText(prof.readEntry("Command", "/bin/bash")); 72 m_cmd->setText(prof.readEntry("Command", "/bin/bash"));
68 int envcount = prof.readNumEntry("EnvVars", 0); 73 int envcount = prof.readNumEntry("EnvVars", 0);
69 for (int i=0; i<envcount; i++) { 74 for (int i=0; i<envcount; i++) {
70 QString name = prof.readEntry("Env_Name_" + QString::number(i), ""); 75 QString name = prof.readEntry("Env_Name_" + QString::number(i), "");
71 QString value = prof.readEntry("Env_Value_" + QString::number(i), ""); 76 QString value = prof.readEntry("Env_Value_" + QString::number(i), "");
72 if (!(name.isEmpty() || value.isEmpty())) { 77 if (!(name.isEmpty() || value.isEmpty())) {
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index fd04b6b..6b607df 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -199,9 +199,9 @@ 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 ) { 202 //if ( ( )->layer()->supports()[0] == 1 ) {
203 if ( m_conCmb ->currentText() == tr("local Console") ) { 203 if ( m_conCmb ->currentText() == tr("Local Console") ) {
204 m_autoConnect->setChecked( true ); 204 m_autoConnect->setChecked( true );
205 } else { 205 } else {
206 m_autoConnect->setChecked( false ); 206 m_autoConnect->setChecked( false );
207 } 207 }