-rw-r--r-- | core/launcher/launcher.pro | 4 | ||||
-rw-r--r-- | core/launcher/mediummountgui.cpp | 17 | ||||
-rw-r--r-- | core/launcher/mediummountgui.h | 15 |
3 files changed, 21 insertions, 15 deletions
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro index 29eaea7..146fffd 100644 --- a/core/launcher/launcher.pro +++ b/core/launcher/launcher.pro | |||
@@ -1,113 +1,115 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | 2 | ||
3 | CONFIG = qt warn_on release | 3 | CONFIG = qt warn_on release |
4 | 4 | ||
5 | DESTDIR = $(OPIEDIR)/bin | 5 | DESTDIR = $(OPIEDIR)/bin |
6 | 6 | ||
7 | HEADERS = background.h \ | 7 | HEADERS = background.h \ |
8 | desktop.h \ | 8 | desktop.h \ |
9 | qprocess.h \ | 9 | qprocess.h \ |
10 | mediummountgui.h \ | ||
10 | info.h \ | 11 | info.h \ |
11 | appicons.h \ | 12 | appicons.h \ |
12 | taskbar.h \ | 13 | taskbar.h \ |
13 | sidething.h \ | 14 | sidething.h \ |
14 | mrulist.h \ | 15 | mrulist.h \ |
15 | stabmon.h \ | 16 | stabmon.h \ |
16 | inputmethods.h \ | 17 | inputmethods.h \ |
17 | systray.h \ | 18 | systray.h \ |
18 | wait.h \ | 19 | wait.h \ |
19 | shutdownimpl.h \ | 20 | shutdownimpl.h \ |
20 | launcher.h \ | 21 | launcher.h \ |
21 | launcherview.h \ | 22 | launcherview.h \ |
22 | ../calibrate/calibrate.h \ | 23 | ../calibrate/calibrate.h \ |
23 | startmenu.h \ | 24 | startmenu.h \ |
24 | transferserver.h \ | 25 | transferserver.h \ |
25 | qcopbridge.h \ | 26 | qcopbridge.h \ |
26 | packageslave.h \ | 27 | packageslave.h \ |
27 | irserver.h \ | 28 | irserver.h \ |
28 | $(OPIEDIR)/rsync/buf.h \ | 29 | $(OPIEDIR)/rsync/buf.h \ |
29 | $(OPIEDIR)/rsync/checksum.h \ | 30 | $(OPIEDIR)/rsync/checksum.h \ |
30 | $(OPIEDIR)/rsync/command.h \ | 31 | $(OPIEDIR)/rsync/command.h \ |
31 | $(OPIEDIR)/rsync/emit.h \ | 32 | $(OPIEDIR)/rsync/emit.h \ |
32 | $(OPIEDIR)/rsync/job.h \ | 33 | $(OPIEDIR)/rsync/job.h \ |
33 | $(OPIEDIR)/rsync/netint.h \ | 34 | $(OPIEDIR)/rsync/netint.h \ |
34 | $(OPIEDIR)/rsync/protocol.h \ | 35 | $(OPIEDIR)/rsync/protocol.h \ |
35 | $(OPIEDIR)/rsync/prototab.h \ | 36 | $(OPIEDIR)/rsync/prototab.h \ |
36 | $(OPIEDIR)/rsync/rsync.h \ | 37 | $(OPIEDIR)/rsync/rsync.h \ |
37 | $(OPIEDIR)/rsync/search.h \ | 38 | $(OPIEDIR)/rsync/search.h \ |
38 | $(OPIEDIR)/rsync/stream.h \ | 39 | $(OPIEDIR)/rsync/stream.h \ |
39 | $(OPIEDIR)/rsync/sumset.h \ | 40 | $(OPIEDIR)/rsync/sumset.h \ |
40 | $(OPIEDIR)/rsync/trace.h \ | 41 | $(OPIEDIR)/rsync/trace.h \ |
41 | $(OPIEDIR)/rsync/types.h \ | 42 | $(OPIEDIR)/rsync/types.h \ |
42 | $(OPIEDIR)/rsync/util.h \ | 43 | $(OPIEDIR)/rsync/util.h \ |
43 | $(OPIEDIR)/rsync/whole.h \ | 44 | $(OPIEDIR)/rsync/whole.h \ |
44 | $(OPIEDIR)/rsync/config_rsync.h \ | 45 | $(OPIEDIR)/rsync/config_rsync.h \ |
45 | $(OPIEDIR)/rsync/qrsync.h | 46 | $(OPIEDIR)/rsync/qrsync.h |
46 | # quicklauncher.h \ | 47 | # quicklauncher.h \ |
47 | 48 | ||
48 | SOURCES = background.cpp \ | 49 | SOURCES = background.cpp \ |
49 | desktop.cpp \ | 50 | desktop.cpp \ |
51 | mediummountgui.cpp \ | ||
50 | qprocess.cpp qprocess_unix.cpp \ | 52 | qprocess.cpp qprocess_unix.cpp \ |
51 | info.cpp \ | 53 | info.cpp \ |
52 | appicons.cpp \ | 54 | appicons.cpp \ |
53 | taskbar.cpp \ | 55 | taskbar.cpp \ |
54 | sidething.cpp \ | 56 | sidething.cpp \ |
55 | mrulist.cpp \ | 57 | mrulist.cpp \ |
56 | stabmon.cpp \ | 58 | stabmon.cpp \ |
57 | inputmethods.cpp \ | 59 | inputmethods.cpp \ |
58 | systray.cpp \ | 60 | systray.cpp \ |
59 | wait.cpp \ | 61 | wait.cpp \ |
60 | shutdownimpl.cpp \ | 62 | shutdownimpl.cpp \ |
61 | launcher.cpp \ | 63 | launcher.cpp \ |
62 | launcherview.cpp \ | 64 | launcherview.cpp \ |
63 | $(OPIEDIR)/calibrate/calibrate.cpp \ | 65 | $(OPIEDIR)/calibrate/calibrate.cpp \ |
64 | transferserver.cpp \ | 66 | transferserver.cpp \ |
65 | packageslave.cpp \ | 67 | packageslave.cpp \ |
66 | irserver.cpp \ | 68 | irserver.cpp \ |
67 | qcopbridge.cpp \ | 69 | qcopbridge.cpp \ |
68 | startmenu.cpp \ | 70 | startmenu.cpp \ |
69 | main.cpp \ | 71 | main.cpp \ |
70 | $(OPIEDIR)/rsync/base64.c \ | 72 | $(OPIEDIR)/rsync/base64.c \ |
71 | $(OPIEDIR)/rsync/buf.c \ | 73 | $(OPIEDIR)/rsync/buf.c \ |
72 | $(OPIEDIR)/rsync/checksum.c \ | 74 | $(OPIEDIR)/rsync/checksum.c \ |
73 | $(OPIEDIR)/rsync/command.c \ | 75 | $(OPIEDIR)/rsync/command.c \ |
74 | $(OPIEDIR)/rsync/delta.c \ | 76 | $(OPIEDIR)/rsync/delta.c \ |
75 | $(OPIEDIR)/rsync/emit.c \ | 77 | $(OPIEDIR)/rsync/emit.c \ |
76 | $(OPIEDIR)/rsync/hex.c \ | 78 | $(OPIEDIR)/rsync/hex.c \ |
77 | $(OPIEDIR)/rsync/job.c \ | 79 | $(OPIEDIR)/rsync/job.c \ |
78 | $(OPIEDIR)/rsync/mdfour.c \ | 80 | $(OPIEDIR)/rsync/mdfour.c \ |
79 | $(OPIEDIR)/rsync/mksum.c \ | 81 | $(OPIEDIR)/rsync/mksum.c \ |
80 | $(OPIEDIR)/rsync/msg.c \ | 82 | $(OPIEDIR)/rsync/msg.c \ |
81 | $(OPIEDIR)/rsync/netint.c \ | 83 | $(OPIEDIR)/rsync/netint.c \ |
82 | $(OPIEDIR)/rsync/patch.c \ | 84 | $(OPIEDIR)/rsync/patch.c \ |
83 | $(OPIEDIR)/rsync/prototab.c \ | 85 | $(OPIEDIR)/rsync/prototab.c \ |
84 | $(OPIEDIR)/rsync/readsums.c \ | 86 | $(OPIEDIR)/rsync/readsums.c \ |
85 | $(OPIEDIR)/rsync/scoop.c \ | 87 | $(OPIEDIR)/rsync/scoop.c \ |
86 | $(OPIEDIR)/rsync/search.c \ | 88 | $(OPIEDIR)/rsync/search.c \ |
87 | $(OPIEDIR)/rsync/stats.c \ | 89 | $(OPIEDIR)/rsync/stats.c \ |
88 | $(OPIEDIR)/rsync/stream.c \ | 90 | $(OPIEDIR)/rsync/stream.c \ |
89 | $(OPIEDIR)/rsync/sumset.c \ | 91 | $(OPIEDIR)/rsync/sumset.c \ |
90 | $(OPIEDIR)/rsync/trace.c \ | 92 | $(OPIEDIR)/rsync/trace.c \ |
91 | $(OPIEDIR)/rsync/tube.c \ | 93 | $(OPIEDIR)/rsync/tube.c \ |
92 | $(OPIEDIR)/rsync/util.c \ | 94 | $(OPIEDIR)/rsync/util.c \ |
93 | $(OPIEDIR)/rsync/version.c \ | 95 | $(OPIEDIR)/rsync/version.c \ |
94 | $(OPIEDIR)/rsync/whole.c \ | 96 | $(OPIEDIR)/rsync/whole.c \ |
95 | $(OPIEDIR)/rsync/qrsync.cpp | 97 | $(OPIEDIR)/rsync/qrsync.cpp |
96 | 98 | ||
97 | INTERFACES= shutdown.ui syncdialog.ui | 99 | INTERFACES= shutdown.ui syncdialog.ui |
98 | 100 | ||
99 | INCLUDEPATH += $(OPIEDIR)/include | 101 | INCLUDEPATH += $(OPIEDIR)/include |
100 | DEPENDPATH+= $(OPIEDIR)/include . | 102 | DEPENDPATH+= $(OPIEDIR)/include . |
101 | 103 | ||
102 | INCLUDEPATH += $(OPIEDIR)/calibrate | 104 | INCLUDEPATH += $(OPIEDIR)/calibrate |
103 | DEPENDPATH+= $(OPIEDIR)/calibrate | 105 | DEPENDPATH+= $(OPIEDIR)/calibrate |
104 | 106 | ||
105 | INCLUDEPATH += $(OPIEDIR)/rsync | 107 | INCLUDEPATH += $(OPIEDIR)/rsync |
106 | DEPENDPATH+= $(OPIEDIR)/rsync | 108 | DEPENDPATH+= $(OPIEDIR)/rsync |
107 | 109 | ||
108 | TARGET = qpe | 110 | TARGET = qpe |
109 | 111 | ||
110 | LIBS += -lqpe -lcrypt | 112 | LIBS += -lqpe -lcrypt -lopie |
111 | 113 | ||
112 | TRANSLATIONS = ../i18n/de/qpe.ts | 114 | TRANSLATIONS = ../i18n/de/qpe.ts |
113 | TRANSLATIONS += ../i18n/pt_BR/qpe.ts | 115 | TRANSLATIONS += ../i18n/pt_BR/qpe.ts |
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp index 8307eb6..82c2d66 100644 --- a/core/launcher/mediummountgui.cpp +++ b/core/launcher/mediummountgui.cpp | |||
@@ -1,190 +1,193 @@ | |||
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 <opie/oconfig.h> | 17 | #include <opie/oconfig.h> |
18 | 18 | ||
19 | 19 | ||
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | 21 | ||
22 | 22 | ||
23 | MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) | 23 | MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) |
24 | : QDialog( parent, name, modal, fl ) { | 24 | : QDialog( parent, name, modal, fl ) { |
25 | 25 | ||
26 | 26 | ||
27 | QWidget *d = QApplication::desktop(); | 27 | QWidget *d = QApplication::desktop(); |
28 | int w=d->width(); | 28 | int w=d->width(); |
29 | int h=d->height(); | 29 | int h=d->height(); |
30 | resize( w , h ); | 30 | resize( w , h ); |
31 | setCaption( tr( "Medium inserted" ) ); | 31 | setCaption( tr( "Medium inserted" ) ); |
32 | 32 | ||
33 | mediumPath = path; | 33 | mediumPath = path; |
34 | readConfig(); | 34 | readConfig(); |
35 | startGui(); | 35 | startGui(); |
36 | } | 36 | } |
37 | 37 | ||
38 | void MediumMountGui::readConfig(){ | 38 | void MediumMountGui::readConfig(){ |
39 | 39 | ||
40 | OConfig cfg (mediumPath +"/.opiestorage.cf"); | 40 | OConfig cfg (mediumPath +"/.opiestorage.cf"); |
41 | cfg.setGroup("main"); | 41 | cfg.setGroup("main"); |
42 | checkagain = cfg.readBoolEntry("check", false); | 42 | checkagain = cfg.readBoolEntry("check", false); |
43 | 43 | ||
44 | cfg.setGroup("mimetypes"); | 44 | cfg.setGroup("mimetypes"); |
45 | checkmimeaudio = cfg.readBoolEntry("audio", false); | 45 | checkmimeaudio = cfg.readBoolEntry("audio", true); |
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 | 49 | ||
50 | cfg.setGroup("dirs"); | 50 | cfg.setGroup("dirs"); |
51 | limittodirs = cfg.readEntry("dirs", "/"); | 51 | limittodirs = cfg.readEntry("dirs", ""); |
52 | } | 52 | } |
53 | 53 | ||
54 | bool MediumMountGui::check() { | 54 | bool MediumMountGui::check() { |
55 | return checkagain; | 55 | return checkagain; |
56 | } | 56 | } |
57 | 57 | ||
58 | QStringList MediumMountGui::dirs() { | 58 | QStringList MediumMountGui::dirs() { |
59 | QStringList list = QStringList::split(",", limittodirs ); | 59 | QStringList list = QStringList::split(",", limittodirs ); |
60 | return list; | 60 | return list; |
61 | } | 61 | } |
62 | 62 | ||
63 | void MediumMountGui::writeConfig() { | 63 | void MediumMountGui::writeConfig(bool autocheck) { |
64 | 64 | ||
65 | OConfig cfg (mediumPath +"/.opiestorage.cf"); | 65 | OConfig cfg (mediumPath +"/.opiestorage.cf"); |
66 | cfg.setGroup("main"); | 66 | cfg.setGroup("main"); |
67 | cfg.writeEntry("check", AskBox->isChecked() ); | 67 | cfg.writeEntry("check", AskBox->isChecked() ); |
68 | 68 | cfg.writeEntry("autocheck", autocheck ); | |
69 | |||
69 | cfg.setGroup("mimetypes"); | 70 | cfg.setGroup("mimetypes"); |
70 | cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); | 71 | cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); |
71 | cfg.writeEntry("image",CheckBoxImage->isChecked() ); | 72 | cfg.writeEntry("image",CheckBoxImage->isChecked() ); |
72 | cfg.writeEntry("text",CheckBoxImage->isChecked() ); | 73 | cfg.writeEntry("text",CheckBoxImage->isChecked() ); |
73 | cfg.writeEntry("video",CheckBoxVideo->isChecked() ); | 74 | cfg.writeEntry("video",CheckBoxVideo->isChecked() ); |
74 | 75 | ||
75 | cfg.setGroup("dirs"); | 76 | cfg.setGroup("dirs"); |
76 | cfg.writeEntry("dirs", "/"); | 77 | cfg.writeEntry("dirs", ""); |
77 | 78 | ||
78 | 79 | ||
79 | if (checkmimeaudio) { | 80 | if (checkmimeaudio) { |
80 | mimeTypeList += ("audio//*"); | 81 | mimeTypeList += ("audio//*"); |
81 | } | 82 | } |
82 | if (checkmimetext) { | 83 | if (checkmimetext) { |
83 | mimeTypeList += ("text//*"); | 84 | mimeTypeList += ("text//*"); |
84 | } | 85 | } |
85 | if (checkmimeaudio) { | 86 | if (checkmimeaudio) { |
86 | mimeTypeList += ("video//*"); | 87 | mimeTypeList += ("video//*"); |
87 | } | 88 | } |
88 | if (checkmimeaudio) { | 89 | if (checkmimeaudio) { |
89 | mimeTypeList += ("image//*"); | 90 | mimeTypeList += ("image//*"); |
90 | } | 91 | } |
91 | 92 | ||
92 | } | 93 | } |
93 | 94 | ||
94 | void MediumMountGui::startGui() { | 95 | void MediumMountGui::startGui() { |
95 | 96 | ||
96 | QPixmap image = Resource::loadPixmap( "HelpBrowser"); | 97 | QPixmap image = Resource::loadPixmap( "HelpBrowser"); |
97 | 98 | ||
98 | Text_2 = new QLabel( this ); | 99 | Text_2 = new QLabel( this ); |
99 | Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); | 100 | Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); |
100 | Text_2->setPixmap( image ); | 101 | Text_2->setPixmap( image ); |
101 | 102 | ||
102 | Text = new QLabel( this, "Text" ); | 103 | Text = new QLabel( this, "Text" ); |
103 | Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) ); | 104 | Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) ); |
104 | 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?" ) ); |
105 | 106 | ||
106 | // media box | 107 | // media box |
107 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); | 108 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); |
108 | GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 60 ) ); | 109 | GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 60 ) ); |
109 | GroupBox1->setTitle( tr( "Which media files" ) ); | 110 | GroupBox1->setTitle( tr( "Which media files" ) ); |
110 | 111 | ||
111 | CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); | 112 | CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); |
112 | CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) ); | 113 | CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) ); |
113 | CheckBoxAudio->setText( tr( "Audio" ) ); | 114 | CheckBoxAudio->setText( tr( "Audio" ) ); |
114 | 115 | ||
115 | CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); | 116 | CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); |
116 | CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) ); | 117 | CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) ); |
117 | CheckBoxImage->setText( tr( "Image" ) ); | 118 | CheckBoxImage->setText( tr( "Image" ) ); |
118 | 119 | ||
119 | CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); | 120 | CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); |
120 | CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) ); | 121 | CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) ); |
121 | CheckBoxText->setText( tr( "Text" ) ); | 122 | CheckBoxText->setText( tr( "Text" ) ); |
122 | 123 | ||
123 | CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); | 124 | CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); |
124 | CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); | 125 | CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); |
125 | CheckBoxVideo->setText( tr( "Video" ) ); | 126 | CheckBoxVideo->setText( tr( "Video" ) ); |
126 | 127 | ||
127 | // select dirs | 128 | // select dirs |
128 | 129 | ||
129 | DirSelectText = new QLabel( this, "DirSelectText" ); | 130 | DirSelectText = new QLabel( this, "DirSelectText" ); |
130 | DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) ); | 131 | DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) ); |
131 | DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) ); | 132 | DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) ); |
132 | 133 | ||
133 | LineEdit1 = new QLineEdit( this ); | 134 | LineEdit1 = new QLineEdit( this ); |
134 | LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) ); | 135 | LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) ); |
135 | 136 | ||
136 | PushButton3 = new QPushButton( this ); | 137 | PushButton3 = new QPushButton( this ); |
137 | PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) ); | 138 | PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) ); |
138 | PushButton3->setText( tr( "Add" ) ); | 139 | PushButton3->setText( tr( "Add" ) ); |
139 | 140 | ||
140 | 141 | ||
141 | // decision | 142 | // decision |
142 | DirSelectText_2 = new QLabel( this ); | 143 | DirSelectText_2 = new QLabel( this ); |
143 | DirSelectText_2->setGeometry( QRect( 10,240,this->width(), 15 ) ); | 144 | DirSelectText_2->setGeometry( QRect( 10,240,this->width(), 15 ) ); |
144 | DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) ); | 145 | DirSelectText_2->setText( tr( "Your decision will be stored on the medium." ) ); |
145 | 146 | ||
146 | // ask again | 147 | // ask again |
147 | AskBox = new QCheckBox( this ); | 148 | AskBox = new QCheckBox( this ); |
148 | AskBox->setGeometry( QRect( 10, 215, (this->width())-15 , 15 ) ); | 149 | AskBox->setGeometry( QRect( 10, 215, (this->width())-15 , 15 ) ); |
149 | AskBox->setText( tr( "Do not ask again for this medium" ) ); | 150 | AskBox->setText( tr( "Do not ask again for this medium" ) ); |
150 | 151 | ||
151 | 152 | ||
152 | AskBox->setChecked(checkagain); | 153 | AskBox->setChecked(checkagain); |
153 | CheckBoxAudio->setChecked(checkmimeaudio); | 154 | CheckBoxAudio->setChecked(checkmimeaudio); |
154 | CheckBoxImage->setChecked(checkmimeimage); | 155 | CheckBoxImage->setChecked(checkmimeimage); |
155 | CheckBoxText->setChecked(checkmimetext); | 156 | CheckBoxText->setChecked(checkmimetext); |
156 | CheckBoxVideo->setChecked(checkmimevideo); | 157 | CheckBoxVideo->setChecked(checkmimevideo); |
157 | 158 | ||
158 | // buttons | 159 | // buttons |
159 | quit = new QPushButton( this ); | 160 | quit = new QPushButton( this ); |
160 | quit->setGeometry( QRect( (this->width()/2)- 90 , 260, 80, 22 ) ); | 161 | quit->setGeometry( QRect( (this->width()/2)- 90 , 260, 80, 22 ) ); |
161 | quit->setFocus(); | 162 | quit->setFocus(); |
162 | quit->setText( tr( "Yes" ) ); | 163 | quit->setText( tr( "Yes" ) ); |
163 | 164 | ||
164 | quit_2 = new QPushButton( this ); | 165 | quit_2 = new QPushButton( this ); |
165 | quit_2->setGeometry( QRect((this->width()/2) , 260, 80, 22 ) ); | 166 | quit_2->setGeometry( QRect((this->width()/2) , 260, 80, 22 ) ); |
166 | quit_2->setText( tr( "No" ) ); | 167 | quit_2->setText( tr( "No" ) ); |
167 | 168 | ||
168 | QObject::connect( (QObject*)quit, SIGNAL( clicked() ), this, SLOT(yesPressed() ) ); | 169 | QObject::connect( (QObject*)quit, SIGNAL( clicked() ), this, SLOT(yesPressed() ) ); |
169 | QObject::connect( (QObject*)quit_2, SIGNAL( clicked() ), this, SLOT(noPressed() ) ); | 170 | QObject::connect( (QObject*)quit_2, SIGNAL( clicked() ), this, SLOT(noPressed() ) ); |
170 | 171 | ||
171 | 172 | ||
172 | } | 173 | } |
173 | 174 | ||
174 | void MediumMountGui::yesPressed() { | 175 | void MediumMountGui::yesPressed() { |
175 | writeConfig(); | 176 | writeConfig(true); |
176 | // and do something | 177 | // and do something |
178 | accept(); | ||
177 | } | 179 | } |
178 | 180 | ||
179 | 181 | ||
180 | QStringList MediumMountGui::mimeTypes(){ | 182 | QStringList MediumMountGui::mimeTypes(){ |
181 | return mimeTypeList; | 183 | return mimeTypeList; |
182 | } | 184 | } |
183 | 185 | ||
184 | void MediumMountGui::noPressed() { | 186 | void MediumMountGui::noPressed() { |
185 | close(); | 187 | writeConfig(false); |
188 | reject(); | ||
186 | } | 189 | } |
187 | 190 | ||
188 | MediumMountGui::~MediumMountGui(){ | 191 | MediumMountGui::~MediumMountGui(){ |
189 | } | 192 | } |
190 | 193 | ||
diff --git a/core/launcher/mediummountgui.h b/core/launcher/mediummountgui.h index a7f3701..9802b29 100644 --- a/core/launcher/mediummountgui.h +++ b/core/launcher/mediummountgui.h | |||
@@ -1,64 +1,65 @@ | |||
1 | #ifndef MEDIUMMOUNTGUI_H | 1 | #ifndef MEDIUMMOUNTGUI_H |
2 | #define MEDIUMMOUNTGUI_H | 2 | #define MEDIUMMOUNTGUI_H |
3 | 3 | ||
4 | #include <qvariant.h> | 4 | #include <qvariant.h> |
5 | #include <qdialog.h> | 5 | #include <qdialog.h> |
6 | class QVBoxLayout; | 6 | class QVBoxLayout; |
7 | class QHBoxLayout; | 7 | class QHBoxLayout; |
8 | class QGridLayout; | 8 | class QGridLayout; |
9 | class QCheckBox; | 9 | class QCheckBox; |
10 | class QGroupBox; | 10 | class QGroupBox; |
11 | class QLabel; | 11 | class QLabel; |
12 | class QLineEdit; | 12 | class QLineEdit; |
13 | class QPushButton; | 13 | class QPushButton; |
14 | 14 | ||
15 | class MediumMountGui : public QDialog | 15 | class MediumMountGui : public QDialog |
16 | { | 16 | { |
17 | Q_OBJECT | 17 | Q_OBJECT |
18 | 18 | ||
19 | public: | 19 | public: |
20 | MediumMountGui( const QString &path = "/tmp/", QWidget* parent = 0, const char* name = 0, bool modal = FALSE ,WFlags fl = 0 ); | 20 | MediumMountGui( const QString &path = "tmp/", QWidget* parent = 0, const char* name = 0, bool modal = FALSE ,WFlags fl = 0 ); |
21 | ~MediumMountGui(); | 21 | ~MediumMountGui(); |
22 | 22 | ||
23 | protected: | 23 | protected: |
24 | QPushButton* quit; | 24 | QPushButton* quit; |
25 | QPushButton* quit_2; | 25 | QPushButton* quit_2; |
26 | QLabel* DirSelectText_2; | 26 | QLabel* DirSelectText_2; |
27 | QLineEdit* LineEdit1; | 27 | QLineEdit* LineEdit1; |
28 | QPushButton* PushButton3; | 28 | QPushButton* PushButton3; |
29 | QLabel* DirSelectText; | 29 | QLabel* DirSelectText; |
30 | QLabel* Text_2; | 30 | QLabel* Text_2; |
31 | QLabel* Text; | 31 | QLabel* Text; |
32 | QGroupBox* GroupBox1; | 32 | QGroupBox* GroupBox1; |
33 | QCheckBox* CheckBoxAudio; | 33 | QCheckBox* CheckBoxAudio; |
34 | QCheckBox* CheckBoxImage; | 34 | QCheckBox* CheckBoxImage; |
35 | QCheckBox* CheckBoxText; | 35 | QCheckBox* CheckBoxText; |
36 | QCheckBox* CheckBoxVideo; | 36 | QCheckBox* CheckBoxVideo; |
37 | QCheckBox* AskBox; | 37 | QCheckBox* AskBox; |
38 | 38 | ||
39 | public: | 39 | public: |
40 | bool check(); | 40 | bool check(); |
41 | QStringList mimeTypes(); | 41 | QStringList mimeTypes(); |
42 | QStringList dirs(); | 42 | QStringList dirs(); |
43 | private: | 43 | private: |
44 | void startGui(); | 44 | void startGui(); |
45 | void readConfig(); | 45 | void readConfig(); |
46 | void writeConfig(); | 46 | void writeConfig(bool checkagain); |
47 | 47 | ||
48 | private slots: | 48 | private slots: |
49 | void yesPressed(); | 49 | void yesPressed(); |
50 | void noPressed(); | 50 | void noPressed(); |
51 | |||
51 | private: | 52 | private: |
52 | QString mediumPath; | 53 | QString mediumPath; |
53 | 54 | ||
54 | bool checkagain; | 55 | bool checkagain; |
55 | bool checkmimeaudio; | 56 | bool checkmimeaudio; |
56 | bool checkmimeimage; | 57 | bool checkmimeimage; |
57 | bool checkmimetext; | 58 | bool checkmimetext; |
58 | bool checkmimevideo; | 59 | bool checkmimevideo; |
59 | QString limittodirs; | 60 | QString limittodirs; |
60 | QStringList mimeTypeList; | 61 | QStringList mimeTypeList; |
61 | 62 | ||
62 | }; | 63 | }; |
63 | 64 | ||
64 | #endif \ No newline at end of file | 65 | #endif |