summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/atconfigdialog.cpp1
-rw-r--r--noncore/apps/opie-console/dialdialog.cpp1
-rw-r--r--noncore/apps/opie-console/dialer.cpp26
-rw-r--r--noncore/apps/opie-console/io_layer.h6
-rw-r--r--noncore/apps/opie-console/io_modem.h2
-rw-r--r--noncore/apps/opie-console/io_serial.cpp6
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp9
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp4
8 files changed, 30 insertions, 25 deletions
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp
index 5c02692..e683ab3 100644
--- a/noncore/apps/opie-console/atconfigdialog.cpp
+++ b/noncore/apps/opie-console/atconfigdialog.cpp
@@ -152,8 +152,9 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) {
}
void ATConfigDialog::readConfig( const Profile& config ) {
+ qWarning("config in atconfigdialog");
initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) );
resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) );
dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) );
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp
index ac1e1db..b91727b 100644
--- a/noncore/apps/opie-console/dialdialog.cpp
+++ b/noncore/apps/opie-console/dialdialog.cpp
@@ -19,8 +19,9 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
QVBoxLayout *mainLayout = new QVBoxLayout( this );
QLabel *textLabel = new QLabel( this );
+ textLabel->setTextFormat( QLabel::RichText );
textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") );
m_dialLine = new QLineEdit( this );
m_dialLine->setReadOnly( true );
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp
index 8524422..67ad10e 100644
--- a/noncore/apps/opie-console/dialer.cpp
+++ b/noncore/apps/opie-console/dialer.cpp
@@ -12,8 +12,10 @@
#include <string.h>
#include <fcntl.h>
#include <errno.h>
+#include "io_modem.h"
+
// State machine: | When an error occurs, we don't have to
// | reset everything.
// (init) <------+ | But if the user wants to reset,
// | | | we stop dialing immediately.
@@ -52,16 +54,12 @@ Dialer::Dialer(const Profile& profile, int fd, QWidget *parent, const char *name
{
QVBoxLayout *vbox;
QLabel *desc;
- //m_profile.writeEntry("InitString", "ATZ");
- //m_profile.writeEntry("DialPrefix1", "ATDT");
- //m_profile.writeEntry("Termination", "\n");
usercancel = 0;
cleanshutdown = 0;
-// fcntl(m_fd, F_SETFL, O_NONBLOCK);
desc = new QLabel(QObject::tr("Dialing number: %1").arg(m_profile.readEntry("Number")), this);
progress = new QProgressBar(this);
status = new QLabel("", this);
@@ -88,9 +86,9 @@ Dialer::~Dialer()
void Dialer::setHangupOnly()
{
state = state_cancel;
usercancel = 1;
- send("+++ATH\r");
+ send( m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING )+"\r" );
}
void Dialer::slotCancel()
{
@@ -141,21 +139,17 @@ void Dialer::trydial(const QString& number)
qWarning("TryDial:%s", number.latin1() );
if(state != state_cancel) switchState(state_preinit);
if(cleanshutdown)
{
- qWarning("HangupString " + m_profile.readEntry("HangupString"));
- //send(m_profile.readEntry("HangupString"));
- send("+++ATH\r");
- //send("");
+ qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING));
+ send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r");
}
if(state != state_cancel)
{
switchState(state_init);
- //send("ATZ");
- qWarning("Init String " + m_profile.readEntry("InitString") );
-// send(m_profile.readEntry("InitString", "AT"));
- send("AT\r");
+// qWarning("Init String " + m_profile.readEntry("InitString") );
+ send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r");
QString response2 = receive();
if(!response2.contains("\nOK\r"))
reset();
}
@@ -186,10 +180,12 @@ void Dialer::trydial(const QString& number)
{
qWarning("progress");
switchState(state_dialing);
- send(QString("ATDT %1\r").arg(number));
-// send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number));
+// send(QString("ATDT %1\r").arg(number));
+ send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ))
+ .arg(number));
+
QString response5 = receive();
if(!response5.contains("CONNECT") )
{
if(response5.contains("BUSY"))
diff --git a/noncore/apps/opie-console/io_layer.h b/noncore/apps/opie-console/io_layer.h
index af61099..ed4478b 100644
--- a/noncore/apps/opie-console/io_layer.h
+++ b/noncore/apps/opie-console/io_layer.h
@@ -93,9 +93,15 @@ signals:
* and QString for a text
*/
virtual void error( int, const QString& );
+
virtual void closed();
+
+ /* signal emitted for closure of the IOLayer
+ * for some reasons
+ */
+ virtual void closed(IOLayer*);
public slots:
/**
* send a QCString to the device
*/
diff --git a/noncore/apps/opie-console/io_modem.h b/noncore/apps/opie-console/io_modem.h
index 1328706..17228bd 100644
--- a/noncore/apps/opie-console/io_modem.h
+++ b/noncore/apps/opie-console/io_modem.h
@@ -12,9 +12,9 @@
#define MODEM_DEFAULT_DBITS 8
#define MODEM_DEFAULT_SBITS 1
#define MODEM_DEFAULT_FLOW 0
-#define MODEM_DEFAULT_INIT_STRING "ATZ"
+#define MODEM_DEFAULT_INIT_STRING "AT"
#define MODEM_DEFAULT_RESET_STRING "ATZ~"
#define MODEM_DEFAULT_DIAL_PREFIX1 "ATDT"
#define MODEM_DEFAULT_DIAL_SUFFIX1 ""
#define MODEM_DEFAULT_DIAL_PREFIX2 ""
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index 03e92dd..ddd4994 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -165,13 +165,9 @@ void IOSerial::dataArrived() {
if (len == 0)
close();
if (len < 0)
return;
- qWarning("got from layer");
- for (int i = 0; i < len; i++ ) {
- printf("%c", array[i] );
- }
- printf("\n");
+
array.resize( len );
emit received(array);
}
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index 37eb184..f7fb6f3 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -131,15 +131,16 @@ void ModemConfigWidget::load( const Profile& prof ) {
m_base->setStop( IOLayerBase::Stop_One );
}
-
+ atConf->readConfig( prof );
if ( prof.readEntry( "Device" ).isEmpty() ) {
+ qWarning("device empty!");
return;
}
setCurrent( prof.readEntry( "Device" ), m_deviceCmb );
- atConf->readConfig( prof );
+
}
/*
* save speed,
@@ -233,8 +234,12 @@ void ModemConfigWidget::save( Profile& prof ) {
}
void ModemConfigWidget::slotAT() {
// ATConfigDialog conf( this, "ATConfig", true );
+ // josef/Max I know why don't you create the stuff on the stack
+ // but making it a TopLevel Dialog and ignoring
+ // cancel is not fun either...
+ // what to do? FIXME!!! -zecke
atConf->showMaximized();
if ( atConf->exec() != QDialog::Accepted ) {
// reload old settings
}
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 36daaef..fd04b6b 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -65,13 +65,13 @@ void ProfileEditorDialog::initUI()
m_tabKey = new QWidget(this);
m_svCon = new QScrollView( m_tabCon );
m_svCon->setResizePolicy( QScrollView::AutoOneFit );
- m_svCon->setHScrollBarMode( QScrollView::AlwaysOff );
+ //m_svCon->setHScrollBarMode( QScrollView::AlwaysOff );
m_svCon->setFrameShape( QFrame::NoFrame );
m_svTerm = new QScrollView( m_tabTerm );
m_svTerm->setResizePolicy( QScrollView::AutoOneFit );
- m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff );
+ //m_svTerm->setHScrollBarMode( QScrollView::AlwaysOff );
m_svTerm->setFrameShape( QFrame::NoFrame );
/* base layout for tabs */
m_layCon = new QHBoxLayout( m_tabCon , 2 );