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
@@ -6,4 +6,7 @@ MyPty is broken in some ways
6 if you do connect/disconnect/connect sh will be executed in the 6 if you do connect/disconnect/connect sh will be executed in the
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
@@ -14,24 +14,30 @@
14 14
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 );
23 21
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
37 QButtonGroup *dialButtons = new QButtonGroup( ); 43 QButtonGroup *dialButtons = new QButtonGroup( );
@@ -67,37 +73,39 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
67 connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); 73 connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) );
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
80void DialDialog::slotEnterNumber( int number ) { 86void 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
@@ -16,13 +16,13 @@ public:
16 ~DialDialog(); 16 ~DialDialog();
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 );
28}; 28};
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
@@ -190,9 +190,9 @@ void ModemConfigWidget::slotAT() {
190 190
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 ) {
198 m_telNumber->setText( dial.number() ); 198 m_telNumber->setText( dial.number() );