author | harlekin <harlekin> | 2002-06-15 20:41:08 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-15 20:41:08 (UTC) |
commit | e23774336087439cfed07899c8446eab674a3de8 (patch) (unidiff) | |
tree | 136957b6dcef1e3b66e2a4a52a0bdb77bb0b09c7 | |
parent | e782feb7418fbf956547b9abb59afdde00745442 (diff) | |
download | opie-e23774336087439cfed07899c8446eab674a3de8.zip opie-e23774336087439cfed07899c8446eab674a3de8.tar.gz opie-e23774336087439cfed07899c8446eab674a3de8.tar.bz2 |
more
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 46 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.h | 14 |
2 files changed, 43 insertions, 17 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index 3ddba3e..842466a 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp | |||
@@ -29,2 +29,3 @@ | |||
29 | #include <qwhatsthis.h> | 29 | #include <qwhatsthis.h> |
30 | #include <qprogressbar.h> | ||
30 | 31 | ||
@@ -38,3 +39,2 @@ namespace OpieTooth { | |||
38 | /* | 39 | /* |
39 | |||
40 | */ | 40 | */ |
@@ -45,3 +45,3 @@ namespace OpieTooth { | |||
45 | setName( "ScanDialog" ); | 45 | setName( "ScanDialog" ); |
46 | resize( 360, 392 ); | 46 | resize( 240, 320 ); |
47 | setCaption( tr( "Scan for devices" ) ); | 47 | setCaption( tr( "Scan for devices" ) ); |
@@ -53,2 +53,3 @@ namespace OpieTooth { | |||
53 | 53 | ||
54 | |||
54 | QWidget* privateLayoutWidget = new QWidget( Frame7, "Layout11" ); | 55 | QWidget* privateLayoutWidget = new QWidget( Frame7, "Layout11" ); |
@@ -60,8 +61,9 @@ namespace OpieTooth { | |||
60 | 61 | ||
61 | TextLabel10 = new QLabel( privateLayoutWidget, "TextLabel10" ); | 62 | progress = new QProgressBar(privateLayoutWidget, "progbar"); |
62 | TextLabel10->setText( tr( "ersetzen durch qprogressbar" ) ); | 63 | progress->setTotalSteps(20); |
63 | 64 | ||
64 | Layout11->addMultiCellWidget( TextLabel10, 1, 1, 0, 1 ); | 65 | //Layout11->addMultiCellWidget( progress, 1, 1, 0, 1 ); |
66 | Layout11->addWidget(progress, 2, 2); | ||
65 | 67 | ||
66 | StartButton = new QPushButton( privateLayoutWidget, "PushButton13" ); | 68 | StartButton = new QPushButton( privateLayoutWidget, "StartButton" ); |
67 | StartButton->setText( tr( "Start" ) ); | 69 | StartButton->setText( tr( "Start" ) ); |
@@ -70,6 +72,6 @@ namespace OpieTooth { | |||
70 | 72 | ||
71 | PushButton6 = new QPushButton( privateLayoutWidget, "PushButton6" ); | 73 | StopButton = new QPushButton( privateLayoutWidget, "StopButton" ); |
72 | PushButton6->setText( tr( "Stop" ) ); | 74 | StopButton->setText( tr( "Cancel" ) ); |
73 | 75 | ||
74 | Layout11->addWidget( PushButton6, 2, 1 ); | 76 | Layout11->addWidget( StopButton, 2, 1 ); |
75 | 77 | ||
@@ -77,3 +79,3 @@ namespace OpieTooth { | |||
77 | 79 | ||
78 | // ListView1->addColumn( tr( "In List" ) ); | 80 | ListView1->addColumn( tr( "Add" ) ); |
79 | ListView1->addColumn( tr( "Device Name" ) ); | 81 | ListView1->addColumn( tr( "Device Name" ) ); |
@@ -84,4 +86,16 @@ namespace OpieTooth { | |||
84 | connect( (QObject*)StartButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); | 86 | connect( (QObject*)StartButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); |
87 | connect( (QObject*)StopButton, SIGNAL( clicked() ), this, SLOT( stopSearch() ) ); | ||
85 | connect( (QObject*)localDevice, SIGNAL( foundDevices( const QString& , RemoteDevices::ValueList ) ), | 88 | connect( (QObject*)localDevice, SIGNAL( foundDevices( const QString& , RemoteDevices::ValueList ) ), |
86 | this, SLOT(fillList(const QString& , RemoteDevices::ValueList ) ) ) ; | 89 | this, SLOT(fillList(const QString& , RemoteDevices::ValueList ) ) ) ; |
90 | progressStat = 0; | ||
91 | } | ||
92 | |||
93 | // hack, make cleaner later | ||
94 | void ScanDialog::progressTimer(int maxSeconds) { | ||
95 | |||
96 | progressStat++; | ||
97 | if (progressStat++ < maxSeconds) { | ||
98 | QTimer::singleShot( 1000, this, SLOT(progressTimer ) ); | ||
99 | } | ||
100 | |||
87 | } | 101 | } |
@@ -89,7 +103,16 @@ namespace OpieTooth { | |||
89 | void ScanDialog::startSearch() { | 103 | void ScanDialog::startSearch() { |
104 | progress->setProgress(0); | ||
105 | progressStat = 0; | ||
90 | // read it from config later | 106 | // read it from config later |
91 | localDevice = new Manager( "hci0" ); | 107 | localDevice = new Manager( "hci0" ); |
108 | progressTimer(20); | ||
109 | // when finished, it emmite foundDevices() | ||
110 | // checken ob initialisiert , qcop ans applet. | ||
92 | localDevice->searchDevices(); | 111 | localDevice->searchDevices(); |
112 | progress->setProgress(20); | ||
93 | } | 113 | } |
94 | 114 | ||
115 | void ScanDialog::stopSearch() { | ||
116 | |||
117 | } | ||
95 | 118 | ||
@@ -97,2 +120,3 @@ namespace OpieTooth { | |||
97 | 120 | ||
121 | QListViewItem * deviceItem; | ||
98 | 122 | ||
@@ -101,3 +125,3 @@ namespace OpieTooth { | |||
101 | 125 | ||
102 | 126 | deviceItem = new QListViewItem( ListView1, (*it).name() ); | |
103 | } | 127 | } |
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h index 5cebb11..6d9b877 100644 --- a/noncore/net/opietooth/manager/scandialog.h +++ b/noncore/net/opietooth/manager/scandialog.h | |||
@@ -33,5 +33,3 @@ class QListViewItem; | |||
33 | class QPushButton; | 33 | class QPushButton; |
34 | 34 | class QProgressBar; | |
35 | class Manager; | ||
36 | class Device; | ||
37 | 35 | ||
@@ -41,2 +39,4 @@ namespace OpieTooth { | |||
41 | 39 | ||
40 | class Manager; | ||
41 | class Device; | ||
42 | 42 | ||
@@ -50,5 +50,5 @@ namespace OpieTooth { | |||
50 | QFrame* Frame7; | 50 | QFrame* Frame7; |
51 | QLabel* TextLabel10; | 51 | QProgressBar* progress; |
52 | QPushButton* StartButton; | 52 | QPushButton* StartButton; |
53 | QPushButton* PushButton6; | 53 | QPushButton* StopButton; |
54 | QListView* ListView1; | 54 | QListView* ListView1; |
@@ -60,2 +60,3 @@ namespace OpieTooth { | |||
60 | private slots: | 60 | private slots: |
61 | void stopSearch(); | ||
61 | void startSearch(); | 62 | void startSearch(); |
@@ -64,4 +65,5 @@ namespace OpieTooth { | |||
64 | private: | 65 | private: |
65 | 66 | void progressTimer(int maxSeconds); | |
66 | Manager *localDevice; | 67 | Manager *localDevice; |
68 | int progressStat; | ||
67 | }; | 69 | }; |