author | harlekin <harlekin> | 2002-03-22 18:32:59 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-03-22 18:32:59 (UTC) |
commit | 796cb4b76f2e949b1baea3d4cf7a70b24186939d (patch) (unidiff) | |
tree | 10d7ba7a47f0d97c755648f48cdac591b60be178 /core | |
parent | a6f3ce177ac43ec2cf91f96cfd11713126e29407 (diff) | |
download | opie-796cb4b76f2e949b1baea3d4cf7a70b24186939d.zip opie-796cb4b76f2e949b1baea3d4cf7a70b24186939d.tar.gz opie-796cb4b76f2e949b1baea3d4cf7a70b24186939d.tar.bz2 |
added All and Link apps
-rw-r--r-- | core/launcher/mediummountgui.cpp | 65 | ||||
-rw-r--r-- | core/launcher/mediummountgui.h | 7 |
2 files changed, 57 insertions, 15 deletions
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp index 82c2d66..f193024 100644 --- a/core/launcher/mediummountgui.cpp +++ b/core/launcher/mediummountgui.cpp | |||
@@ -46,6 +46,7 @@ void MediumMountGui::readConfig(){ | |||
46 | checkmimeimage = cfg.readBoolEntry("image", true); | 46 | checkmimeimage = cfg.readBoolEntry("image", true); |
47 | checkmimetext = cfg.readBoolEntry("text", true); | 47 | checkmimetext = cfg.readBoolEntry("text", true); |
48 | checkmimevideo = cfg.readBoolEntry("video", true); | 48 | checkmimevideo = cfg.readBoolEntry("video", true); |
49 | checkmimeall = cfg.readBoolEntry("all", true); | ||
49 | 50 | ||
50 | cfg.setGroup("dirs"); | 51 | cfg.setGroup("dirs"); |
51 | limittodirs = cfg.readEntry("dirs", ""); | 52 | limittodirs = cfg.readEntry("dirs", ""); |
@@ -68,28 +69,37 @@ void MediumMountGui::writeConfig(bool autocheck) { | |||
68 | cfg.writeEntry("autocheck", autocheck ); | 69 | cfg.writeEntry("autocheck", autocheck ); |
69 | 70 | ||
70 | cfg.setGroup("mimetypes"); | 71 | cfg.setGroup("mimetypes"); |
72 | |||
71 | cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); | 73 | cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); |
72 | cfg.writeEntry("image",CheckBoxImage->isChecked() ); | 74 | cfg.writeEntry("image",CheckBoxImage->isChecked() ); |
73 | cfg.writeEntry("text",CheckBoxImage->isChecked() ); | 75 | cfg.writeEntry("text",CheckBoxImage->isChecked() ); |
74 | cfg.writeEntry("video",CheckBoxVideo->isChecked() ); | 76 | cfg.writeEntry("video",CheckBoxVideo->isChecked() ); |
77 | cfg.writeEntry("all",CheckBoxAll->isChecked() ); | ||
75 | 78 | ||
76 | cfg.setGroup("dirs"); | 79 | cfg.setGroup("dirs"); |
77 | cfg.writeEntry("dirs", ""); | 80 | cfg.writeEntry("dirs", ""); |
78 | 81 | ||
79 | 82 | ||
80 | if (checkmimeaudio) { | 83 | // if all is checked then add only "null" to the list. |
81 | mimeTypeList += ("audio//*"); | 84 | if (checkmimeall) { |
82 | } | 85 | mimeTypeList += ("null"); |
83 | if (checkmimetext) { | 86 | } else { |
84 | mimeTypeList += ("text//*"); | 87 | if (checkmimeaudio) { |
85 | } | 88 | mimeTypeList += ("audio//*"); |
86 | if (checkmimeaudio) { | 89 | } |
87 | mimeTypeList += ("video//*"); | 90 | if (checkmimetext) { |
91 | mimeTypeList += ("text//*"); | ||
92 | } | ||
93 | if (checkmimevideo) { | ||
94 | mimeTypeList += ("video//*"); | ||
95 | } | ||
96 | if (checkmimeimage) { | ||
97 | mimeTypeList += ("image//*"); | ||
98 | } | ||
99 | if (checkmimeall) { | ||
100 | mimeTypeList << ("null"); | ||
101 | } | ||
88 | } | 102 | } |
89 | if (checkmimeaudio) { | ||
90 | mimeTypeList += ("image//*"); | ||
91 | } | ||
92 | |||
93 | } | 103 | } |
94 | 104 | ||
95 | void MediumMountGui::startGui() { | 105 | void MediumMountGui::startGui() { |
@@ -106,7 +116,7 @@ void MediumMountGui::startGui() { | |||
106 | 116 | ||
107 | // media box | 117 | // media box |
108 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); | 118 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); |
109 | GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 60 ) ); | 119 | GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) ); |
110 | GroupBox1->setTitle( tr( "Which media files" ) ); | 120 | GroupBox1->setTitle( tr( "Which media files" ) ); |
111 | 121 | ||
112 | CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); | 122 | CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); |
@@ -124,6 +134,20 @@ void MediumMountGui::startGui() { | |||
124 | CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); | 134 | CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); |
125 | CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); | 135 | CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); |
126 | CheckBoxVideo->setText( tr( "Video" ) ); | 136 | CheckBoxVideo->setText( tr( "Video" ) ); |
137 | |||
138 | CheckBoxAll = new QCheckBox ( GroupBox1); | ||
139 | CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) ); | ||
140 | CheckBoxAll->setText( tr( "All" ) ); | ||
141 | QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) ); | ||
142 | |||
143 | |||
144 | |||
145 | CheckBoxLink = new QCheckBox ( GroupBox1); | ||
146 | CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) ); | ||
147 | CheckBoxLink->setText( tr( "Link apps" ) ); | ||
148 | // as long as the feature is not supported | ||
149 | CheckBoxLink->setEnabled(false); | ||
150 | |||
127 | 151 | ||
128 | // select dirs | 152 | // select dirs |
129 | 153 | ||
@@ -172,6 +196,21 @@ void MediumMountGui::startGui() { | |||
172 | 196 | ||
173 | } | 197 | } |
174 | 198 | ||
199 | |||
200 | void MediumMountGui::deactivateOthers() { | ||
201 | bool mod = !(CheckBoxAll->isChecked()); | ||
202 | |||
203 | //if (!CheckBoxVideo->isChecked()){ | ||
204 | // mod = false; | ||
205 | //} else { | ||
206 | // mod = true; | ||
207 | //} | ||
208 | CheckBoxVideo->setEnabled(mod); | ||
209 | CheckBoxAudio->setEnabled(mod); | ||
210 | CheckBoxText->setEnabled(mod); | ||
211 | CheckBoxImage->setEnabled(mod); | ||
212 | } | ||
213 | |||
175 | void MediumMountGui::yesPressed() { | 214 | void MediumMountGui::yesPressed() { |
176 | writeConfig(true); | 215 | writeConfig(true); |
177 | // and do something | 216 | // and do something |
diff --git a/core/launcher/mediummountgui.h b/core/launcher/mediummountgui.h index 9802b29..2e04f94 100644 --- a/core/launcher/mediummountgui.h +++ b/core/launcher/mediummountgui.h | |||
@@ -34,6 +34,8 @@ protected: | |||
34 | QCheckBox* CheckBoxImage; | 34 | QCheckBox* CheckBoxImage; |
35 | QCheckBox* CheckBoxText; | 35 | QCheckBox* CheckBoxText; |
36 | QCheckBox* CheckBoxVideo; | 36 | QCheckBox* CheckBoxVideo; |
37 | QCheckBox* CheckBoxAll; | ||
38 | QCheckBox* CheckBoxLink; | ||
37 | QCheckBox* AskBox; | 39 | QCheckBox* AskBox; |
38 | 40 | ||
39 | public: | 41 | public: |
@@ -48,8 +50,8 @@ private: | |||
48 | private slots: | 50 | private slots: |
49 | void yesPressed(); | 51 | void yesPressed(); |
50 | void noPressed(); | 52 | void noPressed(); |
51 | 53 | void deactivateOthers(); | |
52 | private: | 54 | private: |
53 | QString mediumPath; | 55 | QString mediumPath; |
54 | 56 | ||
55 | bool checkagain; | 57 | bool checkagain; |
@@ -57,6 +59,7 @@ private: | |||
57 | bool checkmimeimage; | 59 | bool checkmimeimage; |
58 | bool checkmimetext; | 60 | bool checkmimetext; |
59 | bool checkmimevideo; | 61 | bool checkmimevideo; |
62 | bool checkmimeall; | ||
60 | QString limittodirs; | 63 | QString limittodirs; |
61 | QStringList mimeTypeList; | 64 | QStringList mimeTypeList; |
62 | 65 | ||