summaryrefslogtreecommitdiff
path: root/core/launcher/mediummountgui.cpp
Unidiff
Diffstat (limited to 'core/launcher/mediummountgui.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/mediummountgui.cpp54
1 files changed, 28 insertions, 26 deletions
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp
index e0acf4e..8cc2411 100644
--- a/core/launcher/mediummountgui.cpp
+++ b/core/launcher/mediummountgui.cpp
@@ -11,22 +11,24 @@
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>
18
17#include <opie/oconfig.h> 19#include <opie/oconfig.h>
18 20
19 21
20#include <qapplication.h> 22#include <qapplication.h>
21 23
22 24
23MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) 25MediumMountGui::MediumMountGui( Config *cfg, const QString &path ,QWidget* parent, const char* name, bool , WFlags )
24 : QDialog( parent, name, true ) { 26 : QDialog( parent, name, true ) {
25 27
26 28 m_cfg = cfg;
27 QWidget *d = QApplication::desktop(); 29 QWidget *d = QApplication::desktop();
28 int w=d->width(); 30 int w=d->width();
29 int h=d->height(); 31 int h=d->height();
30 resize( w , h ); 32 resize( w , h );
31 setCaption( tr( "Medium inserted" ) ); 33 setCaption( tr( "Medium inserted" ) );
32 34
@@ -34,25 +36,25 @@ MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const cha
34 readConfig(); 36 readConfig();
35 startGui(); 37 startGui();
36} 38}
37 39
38void MediumMountGui::readConfig(){ 40void MediumMountGui::readConfig(){
39 41
40 OConfig cfg (mediumPath +"/.opiestorage.cf"); 42 //OConfig cfg (mediumPath +"/.opiestorage.cf");
41 cfg.setGroup("main"); 43 m_cfg->setGroup("main");
42 checkagain = cfg.readBoolEntry("check", false); 44 checkagain = m_cfg->readBoolEntry("check", false);
43 45
44 cfg.setGroup("mimetypes"); 46 m_cfg->setGroup("mimetypes");
45 checkmimeaudio = cfg.readBoolEntry("audio", true); 47 checkmimeaudio = m_cfg->readBoolEntry("audio", true);
46 checkmimeimage = cfg.readBoolEntry("image", true); 48 checkmimeimage = m_cfg->readBoolEntry("image", true);
47 checkmimetext = cfg.readBoolEntry("text", true); 49 checkmimetext = m_cfg->readBoolEntry("text", true);
48 checkmimevideo = cfg.readBoolEntry("video", true); 50 checkmimevideo = m_cfg->readBoolEntry("video", true);
49 checkmimeall = cfg.readBoolEntry("all", true); 51 checkmimeall = m_cfg->readBoolEntry("all", true);
50 52
51 cfg.setGroup("dirs"); 53 m_cfg->setGroup("dirs");
52 limittodirs = cfg.readEntry("dirs", ""); 54 limittodirs = m_cfg->readEntry("dirs", "");
53} 55}
54 56
55bool MediumMountGui::check() { 57bool MediumMountGui::check() {
56 return !checkagain; 58 return !checkagain;
57} 59}
58 60
@@ -60,27 +62,27 @@ QStringList MediumMountGui::dirs() {
60 QStringList list = QStringList::split(",", limittodirs ); 62 QStringList list = QStringList::split(",", limittodirs );
61 return list; 63 return list;
62} 64}
63 65
64void MediumMountGui::writeConfig(bool autocheck) { 66void MediumMountGui::writeConfig(bool autocheck) {
65 67
66 OConfig cfg (mediumPath +"/.opiestorage.cf"); 68 //OConfig cfg (mediumPath +"/.opiestorage.cf");
67 cfg.setGroup("main"); 69 m_cfg->setGroup("main");
68 cfg.writeEntry("check", AskBox->isChecked() ); 70 m_cfg->writeEntry("check", AskBox->isChecked() );
69 cfg.writeEntry("autocheck", autocheck ); 71 m_cfg->writeEntry("autocheck", autocheck );
70 72
71 cfg.setGroup("mimetypes"); 73 m_cfg->setGroup("mimetypes");
72 74
73 cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); 75 m_cfg->writeEntry("audio", CheckBoxAudio->isChecked() );
74 cfg.writeEntry("image",CheckBoxImage->isChecked() ); 76 m_cfg->writeEntry("image",CheckBoxImage->isChecked() );
75 cfg.writeEntry("text",CheckBoxImage->isChecked() ); 77 m_cfg->writeEntry("text",CheckBoxImage->isChecked() );
76 cfg.writeEntry("video",CheckBoxVideo->isChecked() ); 78 m_cfg->writeEntry("video",CheckBoxVideo->isChecked() );
77 cfg.writeEntry("all",CheckBoxAll->isChecked() ); 79 m_cfg->writeEntry("all",CheckBoxAll->isChecked() );
78 80
79 cfg.setGroup("dirs"); 81 m_cfg->setGroup("dirs");
80 cfg.writeEntry("dirs", ""); 82 m_cfg->writeEntry("dirs", "");
81 83
82 84
83 // 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.
84 if (checkmimeall) { 86 if (checkmimeall) {
85 mimeTypeList.clear(); 87 mimeTypeList.clear();
86 mimeTypeList += QString::null; 88 mimeTypeList += QString::null;
@@ -95,13 +97,13 @@ void MediumMountGui::writeConfig(bool autocheck) {
95 mimeTypeList += ("video/*"); 97 mimeTypeList += ("video/*");
96 } 98 }
97 if (checkmimeimage) { 99 if (checkmimeimage) {
98 mimeTypeList += ("image/*"); 100 mimeTypeList += ("image/*");
99 } 101 }
100 } 102 }
101 cfg.write(); // not really needed here but just to be sure 103 m_cfg->write(); // not really needed here but just to be sure
102} 104}
103 105
104void MediumMountGui::startGui() { 106void MediumMountGui::startGui() {
105 107
106 QPixmap image = Resource::loadPixmap( "HelpBrowser"); 108 QPixmap image = Resource::loadPixmap( "HelpBrowser");
107 109