summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-21 21:43:43 (UTC)
committer zecke <zecke>2002-10-21 21:43:43 (UTC)
commit21d29dbf8a9c1a12c7c23f96b80307e87ffaa50a (patch) (side-by-side diff)
tree98586789ecce5eea1f1d3eb1e5a2184412f90a06
parente2f94235dae5ec84a5e888e4114ce0bdd91db7e7 (diff)
downloadopie-21d29dbf8a9c1a12c7c23f96b80307e87ffaa50a.zip
opie-21d29dbf8a9c1a12c7c23f96b80307e87ffaa50a.tar.gz
opie-21d29dbf8a9c1a12c7c23f96b80307e87ffaa50a.tar.bz2
add a quirk mode into main. if you -DFSCKED_DISTRIBUTION
opie-console will take care of some magic... Add a No Configuration Widget instead of a big fat gray thing above my beloved OTabWidget Fix some compiler warning
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/file_layer.h6
-rw-r--r--noncore/apps/opie-console/main.cpp102
-rw-r--r--noncore/apps/opie-console/profiledialogwidget.cpp19
-rw-r--r--noncore/apps/opie-console/profiledialogwidget.h9
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp19
-rw-r--r--noncore/apps/opie-console/serialconfigwidget.cpp2
6 files changed, 140 insertions, 17 deletions
diff --git a/noncore/apps/opie-console/file_layer.h b/noncore/apps/opie-console/file_layer.h
index edb30e1..caa7478 100644
--- a/noncore/apps/opie-console/file_layer.h
+++ b/noncore/apps/opie-console/file_layer.h
@@ -51,5 +51,5 @@ public slots:
- virtual void sendFile( const QString& file,
- Mode mode, BlockSize blk,
- Features feat ) {};
+ virtual void sendFile( const QString&,
+ Mode, BlockSize,
+ Features ) {};
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
index 350bb3e..78a91a2 100644
--- a/noncore/apps/opie-console/main.cpp
+++ b/noncore/apps/opie-console/main.cpp
@@ -1 +1,9 @@
+#include <sys/types.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+
+#include <qfile.h>
+
#include <qpe/qpeapplication.h>
@@ -4,2 +12,82 @@
+//#define FSCKED_DISTRIBUTION 1
+#ifdef FSCKED_DISTRIBUTION
+/*
+ * The Zaurus rom
+ */
+class FixIt {
+public:
+ FixIt();
+ ~FixIt();
+ void fixIt();
+ /* no real interested in implementing it */
+ void breakIt() {
+
+ };
+ char* m_file;
+};
+
+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";
+
+
+}
+FixIt::~FixIt() {
+}
+/*
+ * the retail Zaurus is broken in many ways
+ * one is that pppd is listening on our port...
+ * we've to stop it from that and then do kill(SIGHUP,1);
+ */
+void FixIt::fixIt() {
+ ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" );
+ QFile file( "/etc/inittab" );
+ if ( file.open(IO_WriteOnly | IO_Raw ) ) {
+ file.writeBlock(m_file,strlen(m_file) );
+ }
+ file.close();
+ ::kill( SIGHUP, 1 );
+}
+#endif
+
+
int main(int argc, char **argv) {
@@ -7,2 +95,8 @@ int main(int argc, char **argv) {
+#ifdef FSCKED_DISTRIBUTION
+ qWarning("fscked");
+ FixIt it;
+ it.fixIt();
+#endif
+
MainWindow mw;
@@ -11,3 +105,9 @@ int main(int argc, char **argv) {
- return app.exec();
+ int ap = app.exec();
+
+#ifdef FSCKED_DISTRIBUTION
+ /* should add a signal handler too */
+ it.breakIt();
+#endif
+ return ap;
}
diff --git a/noncore/apps/opie-console/profiledialogwidget.cpp b/noncore/apps/opie-console/profiledialogwidget.cpp
index caad998..c356535 100644
--- a/noncore/apps/opie-console/profiledialogwidget.cpp
+++ b/noncore/apps/opie-console/profiledialogwidget.cpp
@@ -1 +1,4 @@
+#include <qlayout.h>
+#include <qlabel.h>
+
#include "profiledialogwidget.h"
@@ -43 +46,17 @@ ProfileDialogWidget::Type ProfileDialogKeyWidget::type() const{
}
+
+NoOptions::NoOptions( const QString& name, QWidget* parent, const char* na )
+ : ProfileDialogWidget( name, parent, na ) {
+ QHBoxLayout* lay = new QHBoxLayout(this);
+ QLabel* lbl = new QLabel( this );
+ lbl->setText( tr("This Plugin does not support any configurations") );
+ lbl->setTextFormat( RichText );
+
+ lay->addWidget( lbl );
+}
+void NoOptions::load( const Profile& ) {
+
+}
+void NoOptions::save( Profile& ) {
+
+}
diff --git a/noncore/apps/opie-console/profiledialogwidget.h b/noncore/apps/opie-console/profiledialogwidget.h
index 9d2d5ec..68f2162 100644
--- a/noncore/apps/opie-console/profiledialogwidget.h
+++ b/noncore/apps/opie-console/profiledialogwidget.h
@@ -58,2 +58,11 @@ public:
+class NoOptions : public ProfileDialogWidget {
+ Q_OBJECT
+ public:
+ NoOptions( const QString& name, QWidget* parent, const char* na );
+ ~NoOptions() {}
+ void load( const Profile& );
+ void save( Profile& );
+ Type type()const{ return Connection; };
+};
#endif
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 2dfc0fd..413e80b 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -15,3 +15,3 @@ namespace {
void setCurrent( const QString& str, QComboBox* bo ) {
- for (uint i = 0; i < bo->count(); i++ ) {
+ for (int i = 0; i < bo->count(); i++ ) {
if ( bo->text(i) == str ) {
@@ -20,5 +20,3 @@ namespace {
}
- }
-
-
+ };
}
@@ -183,3 +181,5 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
- if ( m_con ) {
+ if ( !m_con ) {
+ m_con = new NoOptions( str, m_tabCon, "name");
+ }
m_con->load( m_prof );
@@ -187,12 +187,5 @@ void ProfileEditorDialog::slotConActivated( const QString& str ) {
- if(!m_showconntab)
- {
tabWidget->addTab( m_tabCon, "", QObject::tr("Connection") );
tabWidget->setCurrentTab( tabprof );
- m_showconntab = 1;
- }
- } else {
- tabWidget->removePage( m_tabCon );
- m_showconntab = 0;
- }
+
}
diff --git a/noncore/apps/opie-console/serialconfigwidget.cpp b/noncore/apps/opie-console/serialconfigwidget.cpp
index 1e97a24..bd0312a 100644
--- a/noncore/apps/opie-console/serialconfigwidget.cpp
+++ b/noncore/apps/opie-console/serialconfigwidget.cpp
@@ -99,2 +99,3 @@ void SerialConfigWidget::save( Profile& prof ) {
int flow, parity, speed;
+ flow = parity = speed = 0;
prof.writeEntry("Device", m_deviceCmb->currentText() );
@@ -138,2 +139,3 @@ void SerialConfigWidget::save( Profile& prof ) {
break;
+ default:
case IOLayerBase::Baud_9600: