summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-01 20:57:23 (UTC)
committer harlekin <harlekin>2002-10-01 20:57:23 (UTC)
commit88bef2791f8e4c99e0e9d34ddfe518b5baa2df72 (patch) (unidiff)
tree19a3d6ee9360d5765ced9b600f1b094d2a1e3c4b
parent88c3937936dbbb13575425ce9da72d5286bd1233 (diff)
downloadopie-88bef2791f8e4c99e0e9d34ddfe518b5baa2df72.zip
opie-88bef2791f8e4c99e0e9d34ddfe518b5baa2df72.tar.gz
opie-88bef2791f8e4c99e0e9d34ddfe518b5baa2df72.tar.bz2
cleanups and gui redo with layouts
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/mediummountgui.cpp97
-rw-r--r--core/launcher/mediummountgui.h4
2 files changed, 42 insertions, 59 deletions
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp
index eb2308e..6d60ce4 100644
--- a/core/launcher/mediummountgui.cpp
+++ b/core/launcher/mediummountgui.cpp
@@ -3,3 +3,2 @@
3 3
4#include <qvariant.h>
5#include <qcheckbox.h> 4#include <qcheckbox.h>
@@ -10,6 +9,6 @@
10#include <qlayout.h> 9#include <qlayout.h>
11#include <qtooltip.h>
12#include <qwhatsthis.h>
13#include <qimage.h> 10#include <qimage.h>
14#include <qpixmap.h> 11#include <qpixmap.h>
12#include <qvbox.h>
13#include <qhbox.h>
15 14
@@ -18,7 +17,2 @@
18 17
19#include <qpe/config.h>
20
21
22#include <qapplication.h>
23
24 18
@@ -28,6 +22,2 @@ MediumMountGui::MediumMountGui( Config *cfg, const QString &path ,QWidget* paren
28 m_cfg = cfg; 22 m_cfg = cfg;
29 QWidget *d = QApplication::desktop();
30 int w=d->width();
31 int h=d->height();
32 resize( w , h );
33 setCaption( tr( "Medium inserted" ) ); 23 setCaption( tr( "Medium inserted" ) );
@@ -37,2 +27,3 @@ MediumMountGui::MediumMountGui( Config *cfg, const QString &path ,QWidget* paren
37 startGui(); 27 startGui();
28 showMaximized();
38} 29}
@@ -61,4 +52,3 @@ bool MediumMountGui::check() {
61QStringList MediumMountGui::dirs() { 52QStringList MediumMountGui::dirs() {
62 QStringList list = QStringList::split(",", limittodirs ); 53 return QStringList::split( ",", limittodirs );
63 return list;
64} 54}
@@ -83,3 +73,2 @@ void MediumMountGui::writeConfig(bool autocheck) {
83 73
84
85 // if all is checked then add only "QString::null" to the list. 74 // if all is checked then add only "QString::null" to the list.
@@ -107,11 +96,15 @@ void MediumMountGui::startGui() {
107 96
108 QPixmap image = Resource::loadPixmap( "HelpBrowser"); 97 QVBoxLayout* mainLayout = new QVBoxLayout( this );
109 98
99 QHBoxLayout * titelBox = new QHBoxLayout( mainLayout );
110 Text_2 = new QLabel( this ); 100 Text_2 = new QLabel( this );
111 Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); 101 // FIXME needs an image
112 Text_2->setPixmap( image ); 102 Text_2->setPixmap( Resource::loadPixmap( "mediummount/mediummount" ) );
113 103
114 Text = new QLabel( this, "Text" ); 104 Text = new QLabel( this, "Text" );
115 Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) );
116 Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) ); 105 Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) );
106 titelBox->addWidget( Text_2 );
107 titelBox->setStretchFactor( Text_2, 2 );
108 titelBox->addWidget( Text );
109 titelBox->setStretchFactor( Text, 8 );
117 110
@@ -119,7 +112,7 @@ void MediumMountGui::startGui() {
119 GroupBox1 = new QGroupBox( this, "GroupBox1" ); 112 GroupBox1 = new QGroupBox( this, "GroupBox1" );
120 GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) );
121 GroupBox1->setTitle( tr( "Which media files" ) ); 113 GroupBox1->setTitle( tr( "Which media files" ) );
122 114
115 QGridLayout *mimeLayout = new QGridLayout( GroupBox1, 3, 2, 10 );
116
123 CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); 117 CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" );
124 CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) );
125 CheckBoxAudio->setText( tr( "Audio" ) ); 118 CheckBoxAudio->setText( tr( "Audio" ) );
@@ -127,3 +120,2 @@ void MediumMountGui::startGui() {
127 CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); 120 CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" );
128 CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) );
129 CheckBoxImage->setText( tr( "Image" ) ); 121 CheckBoxImage->setText( tr( "Image" ) );
@@ -131,3 +123,2 @@ void MediumMountGui::startGui() {
131 CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); 123 CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" );
132 CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) );
133 CheckBoxText->setText( tr( "Text" ) ); 124 CheckBoxText->setText( tr( "Text" ) );
@@ -135,3 +126,2 @@ void MediumMountGui::startGui() {
135 CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); 126 CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" );
136 CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) );
137 CheckBoxVideo->setText( tr( "Video" ) ); 127 CheckBoxVideo->setText( tr( "Video" ) );
@@ -139,10 +129,5 @@ void MediumMountGui::startGui() {
139 CheckBoxAll = new QCheckBox ( GroupBox1); 129 CheckBoxAll = new QCheckBox ( GroupBox1);
140 CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) );
141 CheckBoxAll->setText( tr( "All" ) ); 130 CheckBoxAll->setText( tr( "All" ) );
142 QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) );
143
144
145 131
146 CheckBoxLink = new QCheckBox ( GroupBox1); 132 CheckBoxLink = new QCheckBox ( GroupBox1);
147 CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) );
148 CheckBoxLink->setText( tr( "Link apps" ) ); 133 CheckBoxLink->setText( tr( "Link apps" ) );
@@ -151,20 +136,25 @@ void MediumMountGui::startGui() {
151 136
137 mimeLayout->addWidget( CheckBoxAudio, 0, 0 );
138 mimeLayout->addWidget( CheckBoxImage, 0, 1 );
139 mimeLayout->addWidget( CheckBoxText , 1, 0 );
140 mimeLayout->addWidget( CheckBoxVideo, 1, 1 );
141 mimeLayout->addWidget( CheckBoxAll, 2, 0 );
142 mimeLayout->addWidget( CheckBoxLink, 2, 1 );
152 143
153 // select dirs 144 connect( CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers() ) );
154 145
155 DirSelectText = new QLabel( this, "DirSelectText" ); 146 QVBox* dirBox = new QVBox( this );
156 DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) ); 147 dirBox->setMargin( 4 );
157 DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) );
158 148
159 LineEdit1 = new QLineEdit( this ); 149 // select dirs
160 LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) ); 150 DirSelectText = new QLabel( dirBox, "DirSelectText" );
151 DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) );
161 152
162 PushButton3 = new QPushButton( this ); 153 QHBox* dirLineBox = new QHBox( dirBox );
163 PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) ); 154 LineEdit1 = new QLineEdit( dirLineBox );
155 PushButton3 = new QPushButton( dirLineBox );
164 PushButton3->setText( tr( "Add" ) ); 156 PushButton3->setText( tr( "Add" ) );
165 157
166
167 // decision 158 // decision
168 DirSelectText_2 = new QLabel( this ); 159 DirSelectText_2 = new QLabel( dirBox );
169 DirSelectText_2->setGeometry( QRect( 10,240,this->width(), 15 ) );
170 DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) ); 160 DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) );
@@ -172,7 +162,5 @@ void MediumMountGui::startGui() {
172 // ask again 162 // ask again
173 AskBox = new QCheckBox( this ); 163 AskBox = new QCheckBox( dirBox );
174 AskBox->setGeometry( QRect( 10, 215, (this->width())-15 , 15 ) );
175 AskBox->setText( tr( "Do not ask again for this medium" ) ); 164 AskBox->setText( tr( "Do not ask again for this medium" ) );
176 165
177
178 AskBox->setChecked(checkagain); 166 AskBox->setChecked(checkagain);
@@ -184,16 +172,17 @@ void MediumMountGui::startGui() {
184 deactivateOthers(); 172 deactivateOthers();
173
174 QHBox* buttonBox = new QHBox( this );
185 // buttons 175 // buttons
186 quit = new QPushButton( this ); 176 quit = new QPushButton( buttonBox );
187 quit->setGeometry( QRect( (this->width()/2)- 90 , 260, 80, 22 ) );
188 quit->setFocus(); 177 quit->setFocus();
189 quit->setText( tr( "Yes" ) ); 178 quit->setText( tr( "Yes" ) );
190 179 quit_2 = new QPushButton( buttonBox );
191 quit_2 = new QPushButton( this );
192 quit_2->setGeometry( QRect((this->width()/2) , 260, 80, 22 ) );
193 quit_2->setText( tr( "No" ) ); 180 quit_2->setText( tr( "No" ) );
194 181
195 QObject::connect( (QObject*)quit, SIGNAL( clicked() ), this, SLOT(yesPressed() ) ); 182 mainLayout->addWidget( GroupBox1 );
196 QObject::connect( (QObject*)quit_2, SIGNAL( clicked() ), this, SLOT(noPressed() ) ); 183 mainLayout->addWidget( dirBox );
197 184 mainLayout->addWidget( buttonBox );
198 185
186 connect( quit, SIGNAL( clicked() ), this, SLOT( yesPressed() ) );
187 connect( quit_2, SIGNAL( clicked() ), this, SLOT( noPressed() ) );
199} 188}
@@ -203,8 +192,2 @@ void MediumMountGui::deactivateOthers() {
203 bool mod = !(CheckBoxAll->isChecked()); 192 bool mod = !(CheckBoxAll->isChecked());
204
205 //if (!CheckBoxVideo->isChecked()){
206 // mod = false;
207 //} else {
208 // mod = true;
209 //}
210 CheckBoxVideo->setEnabled(mod); 193 CheckBoxVideo->setEnabled(mod);
diff --git a/core/launcher/mediummountgui.h b/core/launcher/mediummountgui.h
index 8292c3a..39f9a52 100644
--- a/core/launcher/mediummountgui.h
+++ b/core/launcher/mediummountgui.h
@@ -5,2 +5,3 @@
5#include <qdialog.h> 5#include <qdialog.h>
6
6class QVBoxLayout; 7class QVBoxLayout;
@@ -15,4 +16,3 @@ class Config;
15 16
16class MediumMountGui : public QDialog 17class MediumMountGui : public QDialog {
17{
18 Q_OBJECT 18 Q_OBJECT