summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-21 20:23:34 (UTC)
committer josef <josef>2002-10-21 20:23:34 (UTC)
commitdf721474c6ed785ab7f258f4a9d9384cafa3f8fa (patch) (unidiff)
tree7800a4a8d98559fd812b8536a1c62a6b52a905c8
parentd7703116959fb71492f18a60eb41babd1183d7ec (diff)
downloadopie-df721474c6ed785ab7f258f4a9d9384cafa3f8fa.zip
opie-df721474c6ed785ab7f258f4a9d9384cafa3f8fa.tar.gz
opie-df721474c6ed785ab7f258f4a9d9384cafa3f8fa.tar.bz2
- remove . and , from numbers
- use 2 QLCDWidgets so we can handle larger numbers
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/BUGS3
-rw-r--r--noncore/apps/opie-console/dialdialog.cpp46
-rw-r--r--noncore/apps/opie-console/dialdialog.h6
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp2
4 files changed, 34 insertions, 23 deletions
diff --git a/noncore/apps/opie-console/BUGS b/noncore/apps/opie-console/BUGS
index ffaceef..496e28a 100644
--- a/noncore/apps/opie-console/BUGS
+++ b/noncore/apps/opie-console/BUGS
@@ -7,3 +7,6 @@ MyPty is broken in some ways
7 process of opie-console.... funny aye? 7 process of opie-console.... funny aye?
8 8
9OTabWidget seems to give us problems too 9OTabWidget seems to give us problems too
10
11Send/receive: lrzsz behaves strange when trying to use
12--overwrite or --rename.
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp
index 0ace8f7..0d115bc 100644
--- a/noncore/apps/opie-console/dialdialog.cpp
+++ b/noncore/apps/opie-console/dialdialog.cpp
@@ -15,8 +15,6 @@
15DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 15DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
16 : QDialog( parent, name, modal, fl ) { 16 : QDialog( parent, name, modal, fl ) {
17 17
18 m_number = 0;
19
20 setCaption( tr( "Enter number" ) ); 18 setCaption( tr( "Enter number" ) );
21 19
22 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 20 QVBoxLayout *mainLayout = new QVBoxLayout( this );
@@ -24,13 +22,21 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
24 QLabel *textLabel = new QLabel( this ); 22 QLabel *textLabel = new QLabel( this );
25 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") ); 23 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") );
26 24
27 LCD = new QLCDNumber( this, "LCD" ); 25 LCD1 = new QLCDNumber( this, "LCD" );
28 QFont LCD_font( LCD->font() ); 26 QFont LCD_font1( LCD1->font() );
29 LCD_font.setPointSize( 7 ); 27 LCD_font1.setPointSize( 7 );
30 LCD->setFont( LCD_font ); 28 LCD1->setFont( LCD_font1 );
31 LCD->setNumDigits( 25 ); 29 LCD1->setNumDigits( 8 );
32 LCD->setSegmentStyle( QLCDNumber::Flat ); 30 LCD1->setSegmentStyle( QLCDNumber::Flat );
33 LCD->setMaximumHeight( 30 ); 31 LCD1->setMaximumHeight( 30 );
32
33 LCD2 = new QLCDNumber( this, "LCD" );
34 QFont LCD_font2( LCD2->font() );
35 LCD_font2.setPointSize( 7 );
36 LCD2->setFont( LCD_font2 );
37 LCD2->setNumDigits( 8 );
38 LCD2->setSegmentStyle( QLCDNumber::Flat );
39 LCD2->setMaximumHeight( 30 );
34 40
35 QGridLayout *layout = new QGridLayout( this , 4, 3 ); 41 QGridLayout *layout = new QGridLayout( this , 4, 3 );
36 42
@@ -68,12 +74,12 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
68 74
69 mainLayout->addStretch( 0 ); 75 mainLayout->addStretch( 0 );
70 mainLayout->addWidget( textLabel ); 76 mainLayout->addWidget( textLabel );
71 mainLayout->addWidget( LCD ); 77 QHBoxLayout *lcdLayout = new QHBoxLayout(mainLayout);
78 lcdLayout->addWidget( LCD1 );
79 lcdLayout->addWidget( LCD2 );
72 mainLayout->addStretch( 0 ); 80 mainLayout->addStretch( 0 );
73 mainLayout->addLayout( layout ); 81 mainLayout->addLayout( layout );
74 mainLayout->addStretch( 0 ); 82 mainLayout->addStretch( 0 );
75
76
77} 83}
78 84
79 85
@@ -81,23 +87,25 @@ void DialDialog::slotEnterNumber( int number ) {
81 87
82 // pretty stupid, just for testing .-) 88 // pretty stupid, just for testing .-)
83 89
84 m_number = ( m_number * 10 ) + number; 90 m_number.append(QString("%1").arg(number));
85 qDebug( QString("%1").arg( m_number ) );
86 LCD->display( m_number );
87 91
92 setNumber(m_number);
88} 93}
89 94
90DialDialog::~DialDialog() { 95DialDialog::~DialDialog() {
91} 96}
92 97
93QString DialDialog::number() { 98QString DialDialog::number() {
94 return QString( "%1").arg( m_number ); 99 return m_number;
95 100
96} 101}
97 102
98void DialDialog::setNumber( int number ) 103void DialDialog::setNumber( QString number )
99{ 104{
100 m_number = number; 105 QString n1;
101 LCD->display( m_number ); 106 if(number.length() > 8) n1 = number.left(number.length() - 8);
107 QString n2 = number.right(8);
108 LCD1->display( n1.toInt() );
109 LCD2->display( n2.toInt() );
102} 110}
103 111
diff --git a/noncore/apps/opie-console/dialdialog.h b/noncore/apps/opie-console/dialdialog.h
index bec7b81..4a74b66 100644
--- a/noncore/apps/opie-console/dialdialog.h
+++ b/noncore/apps/opie-console/dialdialog.h
@@ -17,11 +17,11 @@ public:
17 17
18 QString number(); 18 QString number();
19 19
20 void setNumber( int ); 20 void setNumber( QString number );
21 21
22private: 22private:
23 float m_number; 23 QString m_number;
24 QLCDNumber *LCD; 24 QLCDNumber *LCD1, *LCD2;
25 25
26private slots: 26private slots:
27 void slotEnterNumber( int ); 27 void slotEnterNumber( int );
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index c0ab0fc..d3a23fa 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -191,7 +191,7 @@ void ModemConfigWidget::slotAT() {
191void ModemConfigWidget::slotDial() { 191void ModemConfigWidget::slotDial() {
192 DialDialog dial( this, "DialConfig", true ); 192 DialDialog dial( this, "DialConfig", true );
193 if(!m_telNumber->text().isEmpty()) { 193 if(!m_telNumber->text().isEmpty()) {
194 dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ ]"), "").toInt()); 194 dial.setNumber(m_telNumber->text().replace(QRegExp("[\\-\\/\\ \\.\\,]"), ""));
195 } 195 }
196 dial.showMaximized(); 196 dial.showMaximized();
197 if ( dial.exec() == QDialog::Accepted ) { 197 if ( dial.exec() == QDialog::Accepted ) {