author | harlekin <harlekin> | 2002-10-24 14:44:59 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-24 14:44:59 (UTC) |
commit | 6c5fa32d4ca48498336f986ca4e8a05ad663e10e (patch) (unidiff) | |
tree | 1c9a375b73bbc6137aa6de3f387509e775dd1784 /noncore/apps | |
parent | a33f6eae4730a7ca0bec18b72becd3bc73a20aa5 (diff) | |
download | opie-6c5fa32d4ca48498336f986ca4e8a05ad663e10e.zip opie-6c5fa32d4ca48498336f986ca4e8a05ad663e10e.tar.gz opie-6c5fa32d4ca48498336f986ca4e8a05ad663e10e.tar.bz2 |
nicer layout, and a a qlineedit instead of _2_ QLCDs
-rw-r--r-- | noncore/apps/opie-console/BUGS | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialdialog.cpp | 51 | ||||
-rw-r--r-- | noncore/apps/opie-console/dialdialog.h | 7 |
3 files changed, 24 insertions, 37 deletions
diff --git a/noncore/apps/opie-console/BUGS b/noncore/apps/opie-console/BUGS index 694bc8b..8195dc5 100644 --- a/noncore/apps/opie-console/BUGS +++ b/noncore/apps/opie-console/BUGS | |||
@@ -20,16 +20,13 @@ connection its used on | |||
20 | - scripting with "direct subpopup" | 20 | - scripting with "direct subpopup" |
21 | also: | 21 | also: |
22 | - an indication that it is currently recording, also change menu entry to | 22 | - an indication that it is currently recording, also change menu entry to |
23 | "cancel recording" then | 23 | "cancel recording" then |
24 | 24 | ||
25 | - scripts need an extension and also an icon | 25 | - scripts need an extension and also an icon |
26 | 26 | ||
27 | - help documentation needs to be extended | 27 | - help documentation needs to be extended |
28 | - new connection and save connection | 28 | - new connection and save connection |
29 | - paste button | 29 | - paste button |
30 | - keys button | 30 | - keys button |
31 | 31 | ||
32 | - dial dialog - ugly , better use a qlineedit there to for showing or | ||
33 | disable | ||
34 | |||
35 | - exit / strg + d does not close conection / tab \ No newline at end of file | 32 | - exit / strg + d does not close conection / tab \ No newline at end of file |
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp index 0d115bc..ac1e1db 100644 --- a/noncore/apps/opie-console/dialdialog.cpp +++ b/noncore/apps/opie-console/dialdialog.cpp | |||
@@ -13,99 +13,88 @@ | |||
13 | 13 | ||
14 | 14 | ||
15 | DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 15 | DialDialog::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 | setCaption( tr( "Enter number" ) ); | 18 | setCaption( tr( "Enter number" ) ); |
19 | 19 | ||
20 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); | 20 | QVBoxLayout *mainLayout = new QVBoxLayout( this ); |
21 | 21 | ||
22 | QLabel *textLabel = new QLabel( this ); | 22 | QLabel *textLabel = new QLabel( this ); |
23 | 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") ); |
24 | 24 | ||
25 | LCD1 = new QLCDNumber( this, "LCD" ); | 25 | m_dialLine = new QLineEdit( this ); |
26 | QFont LCD_font1( LCD1->font() ); | 26 | m_dialLine->setReadOnly( true ); |
27 | LCD_font1.setPointSize( 7 ); | 27 | m_dialLine->setFrame( false ); |
28 | LCD1->setFont( LCD_font1 ); | 28 | m_dialLine->setAlignment( Qt::AlignLeft ); |
29 | LCD1->setNumDigits( 8 ); | 29 | QFont dialLine_font( m_dialLine->font() ); |
30 | LCD1->setSegmentStyle( QLCDNumber::Flat ); | 30 | dialLine_font.setBold( TRUE ); |
31 | LCD1->setMaximumHeight( 30 ); | 31 | dialLine_font.setPointSize( 18 ); |
32 | 32 | m_dialLine->setFont( dialLine_font ); | |
33 | LCD2 = new QLCDNumber( this, "LCD" ); | 33 | |
34 | QFont LCD_font2( LCD2->font() ); | 34 | QWidget* dialWidget = new QWidget( this ); |
35 | LCD_font2.setPointSize( 7 ); | 35 | QGridLayout *layout = new QGridLayout( dialWidget , 4, 3 ); |
36 | LCD2->setFont( LCD_font2 ); | ||
37 | LCD2->setNumDigits( 8 ); | ||
38 | LCD2->setSegmentStyle( QLCDNumber::Flat ); | ||
39 | LCD2->setMaximumHeight( 30 ); | ||
40 | |||
41 | QGridLayout *layout = new QGridLayout( this , 4, 3 ); | ||
42 | 36 | ||
43 | QButtonGroup *dialButtons = new QButtonGroup( ); | 37 | QButtonGroup *dialButtons = new QButtonGroup( ); |
44 | 38 | ||
45 | QPushButton *number0 = new QPushButton( this ); | 39 | QPushButton *number0 = new QPushButton( dialWidget ); |
46 | number0->setText( QString( "0" ) ); | 40 | number0->setText( QString( "0" ) ); |
47 | QFont number0_font( number0->font() ); | 41 | QFont number0_font( number0->font() ); |
48 | number0_font.setBold( TRUE ); | 42 | number0_font.setBold( TRUE ); |
49 | number0->setFont( number0_font ); | 43 | number0->setFont( number0_font ); |
50 | layout->addWidget( number0, 4, 1 ); | 44 | layout->addWidget( number0, 4, 1 ); |
51 | dialButtons->insert( number0 ); | 45 | dialButtons->insert( number0 ); |
52 | 46 | ||
53 | int x = 0, y = 0; | 47 | int x = 0, y = 0; |
54 | for ( int i = 0 ; i < 9; i++ ) { | 48 | for ( int i = 0 ; i < 9; i++ ) { |
55 | QPushButton *number = new QPushButton( this ); | 49 | QPushButton *number = new QPushButton( dialWidget ); |
56 | number->setText( QString( "%1" ).arg( i + 1 ) ); | 50 | number->setText( QString( "%1" ).arg( i + 1 ) ); |
57 | QFont number_font( number->font() ); | 51 | QFont number_font( number->font() ); |
58 | number_font.setBold( TRUE ); | 52 | number_font.setBold( TRUE ); |
59 | number->setFont( number_font ); | 53 | number->setFont( number_font ); |
60 | 54 | ||
61 | dialButtons->insert( number ); | 55 | dialButtons->insert( number ); |
62 | 56 | ||
63 | layout->addWidget( number, x, y ); | 57 | layout->addWidget( number, x, y ); |
64 | 58 | ||
65 | if ( y < 2 ) { | 59 | if ( y < 2 ) { |
66 | y++; | 60 | y++; |
67 | } else { | 61 | } else { |
68 | x++; | 62 | x++; |
69 | y = 0; | 63 | y = 0; |
70 | } | 64 | } |
71 | } | 65 | } |
72 | 66 | ||
73 | connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); | 67 | connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); |
74 | 68 | ||
75 | mainLayout->addStretch( 0 ); | 69 | mainLayout->addStretch( 2 ); |
76 | mainLayout->addWidget( textLabel ); | 70 | mainLayout->addWidget( textLabel ); |
77 | QHBoxLayout *lcdLayout = new QHBoxLayout(mainLayout); | 71 | mainLayout->addStretch( 1 ); |
78 | lcdLayout->addWidget( LCD1 ); | 72 | mainLayout->addWidget( m_dialLine ); |
79 | lcdLayout->addWidget( LCD2 ); | 73 | mainLayout->addStretch( 2 ); |
80 | mainLayout->addStretch( 0 ); | 74 | mainLayout->addWidget( dialWidget ); |
81 | mainLayout->addLayout( layout ); | 75 | mainLayout->addStretch( 4 ); |
82 | mainLayout->addStretch( 0 ); | ||
83 | } | 76 | } |
84 | 77 | ||
85 | 78 | ||
86 | void DialDialog::slotEnterNumber( int number ) { | 79 | void DialDialog::slotEnterNumber( int number ) { |
87 | 80 | ||
88 | // pretty stupid, just for testing .-) | 81 | // pretty stupid, just for testing .-) |
89 | 82 | ||
90 | m_number.append(QString("%1").arg(number)); | 83 | m_number.append(QString("%1").arg(number)); |
91 | 84 | ||
92 | setNumber(m_number); | 85 | setNumber(m_number); |
93 | } | 86 | } |
94 | 87 | ||
95 | DialDialog::~DialDialog() { | 88 | DialDialog::~DialDialog() { |
96 | } | 89 | } |
97 | 90 | ||
98 | QString DialDialog::number() { | 91 | QString DialDialog::number() { |
99 | return m_number; | 92 | return m_number; |
100 | 93 | ||
101 | } | 94 | } |
102 | 95 | ||
103 | void DialDialog::setNumber( QString number ) | 96 | void DialDialog::setNumber( QString number ) |
104 | { | 97 | { |
105 | QString n1; | 98 | m_dialLine->setText( QString("%1").arg( 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() ); | ||
110 | } | 99 | } |
111 | 100 | ||
diff --git a/noncore/apps/opie-console/dialdialog.h b/noncore/apps/opie-console/dialdialog.h index 4a74b66..6da26a1 100644 --- a/noncore/apps/opie-console/dialdialog.h +++ b/noncore/apps/opie-console/dialdialog.h | |||
@@ -1,31 +1,32 @@ | |||
1 | 1 | ||
2 | #ifndef DIALDIALOG_H | 2 | #ifndef DIALDIALOG_H |
3 | #define DIALDIALOG_H | 3 | #define DIALDIALOG_H |
4 | 4 | ||
5 | #include <qdialog.h> | 5 | #include <qdialog.h> |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qlcdnumber.h> | 7 | #include <qlineedit.h> |
8 | |||
8 | 9 | ||
9 | class DialDialog : public QDialog { | 10 | class DialDialog : public QDialog { |
10 | 11 | ||
11 | Q_OBJECT | 12 | Q_OBJECT |
12 | 13 | ||
13 | public: | 14 | public: |
14 | DialDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 15 | DialDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
15 | 16 | ||
16 | ~DialDialog(); | 17 | ~DialDialog(); |
17 | 18 | ||
18 | QString number(); | 19 | QString number(); |
19 | 20 | ||
20 | void setNumber( QString number ); | 21 | void setNumber( QString number ); |
21 | 22 | ||
22 | private: | 23 | private: |
23 | QString m_number; | 24 | QString m_number; |
24 | QLCDNumber *LCD1, *LCD2; | 25 | QLineEdit *m_dialLine; |
25 | 26 | ||
26 | private slots: | 27 | private slots: |
27 | void slotEnterNumber( int ); | 28 | void slotEnterNumber( int ); |
28 | }; | 29 | }; |
29 | 30 | ||
30 | 31 | ||
31 | #endif | 32 | #endif |