summaryrefslogtreecommitdiff
authorzecke <zecke>2002-04-28 08:28:09 (UTC)
committer zecke <zecke>2002-04-28 08:28:09 (UTC)
commitf68f837aec3d6ddd24c2281cadc02bda5d8678e1 (patch) (unidiff)
treeada0d1ad10356700ceae9b629ac0379fd82e5d24
parent61cc74e0e4602d0df07b250f2786f0f0e96da28f (diff)
downloadopie-f68f837aec3d6ddd24c2281cadc02bda5d8678e1.zip
opie-f68f837aec3d6ddd24c2281cadc02bda5d8678e1.tar.gz
opie-f68f837aec3d6ddd24c2281cadc02bda5d8678e1.tar.bz2
remove the dependency on oconfig
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/mediummountgui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp
index f375236..eb2308e 100644
--- a/core/launcher/mediummountgui.cpp
+++ b/core/launcher/mediummountgui.cpp
@@ -1,147 +1,147 @@
1 1
2#include "mediummountgui.h" 2#include "mediummountgui.h"
3 3
4#include <qvariant.h> 4#include <qvariant.h>
5#include <qcheckbox.h> 5#include <qcheckbox.h>
6#include <qgroupbox.h> 6#include <qgroupbox.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qpushbutton.h> 9#include <qpushbutton.h>
10#include <qlayout.h> 10#include <qlayout.h>
11#include <qtooltip.h> 11#include <qtooltip.h>
12#include <qwhatsthis.h> 12#include <qwhatsthis.h>
13#include <qimage.h> 13#include <qimage.h>
14#include <qpixmap.h> 14#include <qpixmap.h>
15 15
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18 18
19#include <opie/oconfig.h> 19#include <qpe/config.h>
20 20
21 21
22#include <qapplication.h> 22#include <qapplication.h>
23 23
24 24
25MediumMountGui::MediumMountGui( Config *cfg, const QString &path ,QWidget* parent, const char* name, bool , WFlags ) 25MediumMountGui::MediumMountGui( Config *cfg, const QString &path ,QWidget* parent, const char* name, bool , WFlags )
26 : QDialog( parent, name, true ) { 26 : QDialog( parent, name, true ) {
27 27
28 m_cfg = cfg; 28 m_cfg = cfg;
29 QWidget *d = QApplication::desktop(); 29 QWidget *d = QApplication::desktop();
30 int w=d->width(); 30 int w=d->width();
31 int h=d->height(); 31 int h=d->height();
32 resize( w , h ); 32 resize( w , h );
33 setCaption( tr( "Medium inserted" ) ); 33 setCaption( tr( "Medium inserted" ) );
34 34
35 mediumPath = path; 35 mediumPath = path;
36 readConfig(); 36 readConfig();
37 startGui(); 37 startGui();
38} 38}
39 39
40void MediumMountGui::readConfig(){ 40void MediumMountGui::readConfig(){
41 41
42 //OConfig cfg (mediumPath +"/.opiestorage.cf"); 42 //OConfig cfg (mediumPath +"/.opiestorage.cf");
43 m_cfg->setGroup("main"); 43 m_cfg->setGroup("main");
44 checkagain = m_cfg->readBoolEntry("check", false); 44 checkagain = m_cfg->readBoolEntry("check", false);
45 45
46 m_cfg->setGroup("mimetypes"); 46 m_cfg->setGroup("mimetypes");
47 checkmimeaudio = m_cfg->readBoolEntry("audio", true ); 47 checkmimeaudio = m_cfg->readBoolEntry("audio", true );
48 checkmimeimage = m_cfg->readBoolEntry("image", true ); 48 checkmimeimage = m_cfg->readBoolEntry("image", true );
49 checkmimetext = m_cfg->readBoolEntry("text" , true ); 49 checkmimetext = m_cfg->readBoolEntry("text" , true );
50 checkmimevideo = m_cfg->readBoolEntry("video", true ); 50 checkmimevideo = m_cfg->readBoolEntry("video", true );
51 checkmimeall = m_cfg->readBoolEntry("all" , false); 51 checkmimeall = m_cfg->readBoolEntry("all" , false);
52 52
53 m_cfg->setGroup("dirs"); 53 m_cfg->setGroup("dirs");
54 limittodirs = m_cfg->readEntry("dirs", ""); 54 limittodirs = m_cfg->readEntry("dirs", "");
55} 55}
56 56
57bool MediumMountGui::check() { 57bool MediumMountGui::check() {
58 return !checkagain; 58 return !checkagain;
59} 59}
60 60
61QStringList MediumMountGui::dirs() { 61QStringList MediumMountGui::dirs() {
62 QStringList list = QStringList::split(",", limittodirs ); 62 QStringList list = QStringList::split(",", limittodirs );
63 return list; 63 return list;
64} 64}
65 65
66void MediumMountGui::writeConfig(bool autocheck) { 66void MediumMountGui::writeConfig(bool autocheck) {
67 67
68 //OConfig cfg (mediumPath +"/.opiestorage.cf"); 68 //OConfig cfg (mediumPath +"/.opiestorage.cf");
69 m_cfg->setGroup("main"); 69 m_cfg->setGroup("main");
70 m_cfg->writeEntry("check", AskBox->isChecked() ); 70 m_cfg->writeEntry("check", AskBox->isChecked() );
71 m_cfg->writeEntry("autocheck", autocheck ); 71 m_cfg->writeEntry("autocheck", autocheck );
72 72
73 m_cfg->setGroup("mimetypes"); 73 m_cfg->setGroup("mimetypes");
74 74
75 m_cfg->writeEntry("audio", CheckBoxAudio->isChecked() ); 75 m_cfg->writeEntry("audio", CheckBoxAudio->isChecked() );
76 m_cfg->writeEntry("image",CheckBoxImage->isChecked() ); 76 m_cfg->writeEntry("image",CheckBoxImage->isChecked() );
77 m_cfg->writeEntry("text",CheckBoxImage->isChecked() ); 77 m_cfg->writeEntry("text",CheckBoxImage->isChecked() );
78 m_cfg->writeEntry("video",CheckBoxVideo->isChecked() ); 78 m_cfg->writeEntry("video",CheckBoxVideo->isChecked() );
79 m_cfg->writeEntry("all",CheckBoxAll->isChecked() ); 79 m_cfg->writeEntry("all",CheckBoxAll->isChecked() );
80 80
81 m_cfg->setGroup("dirs"); 81 m_cfg->setGroup("dirs");
82 m_cfg->writeEntry("dirs", ""); 82 m_cfg->writeEntry("dirs", "");
83 83
84 84
85 // if all is checked then add only "QString::null" to the list. 85 // if all is checked then add only "QString::null" to the list.
86 if (checkmimeall) { 86 if (checkmimeall) {
87 mimeTypeList.clear(); 87 mimeTypeList.clear();
88 mimeTypeList += QString::null; 88 mimeTypeList += QString::null;
89 } else { 89 } else {
90 if (checkmimeaudio) { 90 if (checkmimeaudio) {
91 mimeTypeList += ("audio/*"); 91 mimeTypeList += ("audio/*");
92 } 92 }
93 if (checkmimetext) { 93 if (checkmimetext) {
94 mimeTypeList += ("text/*"); 94 mimeTypeList += ("text/*");
95 } 95 }
96 if (checkmimevideo) { 96 if (checkmimevideo) {
97 mimeTypeList += ("video/*"); 97 mimeTypeList += ("video/*");
98 } 98 }
99 if (checkmimeimage) { 99 if (checkmimeimage) {
100 mimeTypeList += ("image/*"); 100 mimeTypeList += ("image/*");
101 } 101 }
102 } 102 }
103 m_cfg->write(); // not really needed here but just to be sure 103 m_cfg->write(); // not really needed here but just to be sure
104} 104}
105 105
106void MediumMountGui::startGui() { 106void MediumMountGui::startGui() {
107 107
108 QPixmap image = Resource::loadPixmap( "HelpBrowser"); 108 QPixmap image = Resource::loadPixmap( "HelpBrowser");
109 109
110 Text_2 = new QLabel( this ); 110 Text_2 = new QLabel( this );
111 Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); 111 Text_2->setGeometry( QRect( 10, 15, 40, 40 ) );
112 Text_2->setPixmap( image ); 112 Text_2->setPixmap( image );
113 113
114 Text = new QLabel( this, "Text" ); 114 Text = new QLabel( this, "Text" );
115 Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) ); 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?" ) ); 116 Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) );
117 117
118 // media box 118 // media box
119 GroupBox1 = new QGroupBox( this, "GroupBox1" ); 119 GroupBox1 = new QGroupBox( this, "GroupBox1" );
120 GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) ); 120 GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) );
121 GroupBox1->setTitle( tr( "Which media files" ) ); 121 GroupBox1->setTitle( tr( "Which media files" ) );
122 122
123 CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); 123 CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" );
124 CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) ); 124 CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) );
125 CheckBoxAudio->setText( tr( "Audio" ) ); 125 CheckBoxAudio->setText( tr( "Audio" ) );
126 126
127 CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); 127 CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" );
128 CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) ); 128 CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) );
129 CheckBoxImage->setText( tr( "Image" ) ); 129 CheckBoxImage->setText( tr( "Image" ) );
130 130
131 CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); 131 CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" );
132 CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) ); 132 CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) );
133 CheckBoxText->setText( tr( "Text" ) ); 133 CheckBoxText->setText( tr( "Text" ) );
134 134
135 CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); 135 CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" );
136 CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); 136 CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) );
137 CheckBoxVideo->setText( tr( "Video" ) ); 137 CheckBoxVideo->setText( tr( "Video" ) );
138 138
139 CheckBoxAll = new QCheckBox ( GroupBox1); 139 CheckBoxAll = new QCheckBox ( GroupBox1);
140 CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) ); 140 CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) );
141 CheckBoxAll->setText( tr( "All" ) ); 141 CheckBoxAll->setText( tr( "All" ) );
142 QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) ); 142 QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) );
143 143
144 144
145 145
146 CheckBoxLink = new QCheckBox ( GroupBox1); 146 CheckBoxLink = new QCheckBox ( GroupBox1);
147 CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) ); 147 CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) );