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
@@ -8,2 +8,5 @@ MyPty is broken in some ways
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
@@ -16,6 +16,4 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
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
@@ -25,11 +23,19 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
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 );
@@ -69,10 +75,10 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
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
@@ -82,8 +88,7 @@ void DialDialog::slotEnterNumber( int number ) {
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
@@ -92,12 +97,15 @@ DialDialog::~DialDialog() {
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
@@ -18,9 +18,9 @@ public:
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:
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
@@ -192,5 +192,5 @@ void 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();