summaryrefslogtreecommitdiff
authorzecke <zecke>2002-03-22 16:14:18 (UTC)
committer zecke <zecke>2002-03-22 16:14:18 (UTC)
commitf6f0cd02ceec72a971616de253d736a94a730397 (patch) (unidiff)
treec89241377d61bd568b5381b0880ac9c04a55d1a8
parent3e2720971a92079e56f61ad257ef6c2df2a2b0b4 (diff)
downloadopie-f6f0cd02ceec72a971616de253d736a94a730397.zip
opie-f6f0cd02ceec72a971616de253d736a94a730397.tar.gz
opie-f6f0cd02ceec72a971616de253d736a94a730397.tar.bz2
make something kewl possible
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.pro4
-rw-r--r--core/launcher/mediummountgui.cpp17
-rw-r--r--core/launcher/mediummountgui.h15
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,21 +1,22 @@
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 \
@@ -38,24 +39,25 @@ HEADERS = background.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 \
@@ -98,16 +100,16 @@ INTERFACES = shutdown.ui syncdialog.ui
98 100
99INCLUDEPATH += $(OPIEDIR)/include 101INCLUDEPATH += $(OPIEDIR)/include
100 DEPENDPATH+= $(OPIEDIR)/include . 102 DEPENDPATH+= $(OPIEDIR)/include .
101 103
102INCLUDEPATH += $(OPIEDIR)/calibrate 104INCLUDEPATH += $(OPIEDIR)/calibrate
103 DEPENDPATH+= $(OPIEDIR)/calibrate 105 DEPENDPATH+= $(OPIEDIR)/calibrate
104 106
105INCLUDEPATH += $(OPIEDIR)/rsync 107INCLUDEPATH += $(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
112TRANSLATIONS = ../i18n/de/qpe.ts 114TRANSLATIONS = ../i18n/de/qpe.ts
113TRANSLATIONS += ../i18n/pt_BR/qpe.ts 115TRANSLATIONS += ../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
@@ -33,56 +33,57 @@ MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const cha
33 mediumPath = path; 33 mediumPath = path;
34 readConfig(); 34 readConfig();
35 startGui(); 35 startGui();
36} 36}
37 37
38void MediumMountGui::readConfig(){ 38void 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
54bool MediumMountGui::check() { 54bool MediumMountGui::check() {
55 return checkagain; 55 return checkagain;
56} 56}
57 57
58QStringList MediumMountGui::dirs() { 58QStringList MediumMountGui::dirs() {
59 QStringList list = QStringList::split(",", limittodirs ); 59 QStringList list = QStringList::split(",", limittodirs );
60 return list; 60 return list;
61} 61}
62 62
63void MediumMountGui::writeConfig() { 63void 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) {
@@ -163,28 +164,30 @@ void MediumMountGui::startGui() {
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
174void MediumMountGui::yesPressed() { 175void MediumMountGui::yesPressed() {
175 writeConfig(); 176 writeConfig(true);
176 // and do something 177 // and do something
178 accept();
177} 179}
178 180
179 181
180QStringList MediumMountGui::mimeTypes(){ 182QStringList MediumMountGui::mimeTypes(){
181 return mimeTypeList; 183 return mimeTypeList;
182} 184}
183 185
184void MediumMountGui::noPressed() { 186void MediumMountGui::noPressed() {
185 close(); 187 writeConfig(false);
188 reject();
186} 189}
187 190
188MediumMountGui::~MediumMountGui(){ 191MediumMountGui::~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
@@ -8,25 +8,25 @@ class QHBoxLayout;
8class QGridLayout; 8class QGridLayout;
9class QCheckBox; 9class QCheckBox;
10class QGroupBox; 10class QGroupBox;
11class QLabel; 11class QLabel;
12class QLineEdit; 12class QLineEdit;
13class QPushButton; 13class QPushButton;
14 14
15class MediumMountGui : public QDialog 15class MediumMountGui : public QDialog
16{ 16{
17 Q_OBJECT 17 Q_OBJECT
18 18
19public: 19public:
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
23protected: 23protected:
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;
@@ -34,31 +34,32 @@ protected:
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
39public: 39public:
40 bool check(); 40 bool check();
41 QStringList mimeTypes(); 41 QStringList mimeTypes();
42 QStringList dirs(); 42 QStringList dirs();
43private: 43private:
44 void startGui(); 44 void startGui();
45 void readConfig(); 45 void readConfig();
46 void writeConfig(); 46 void writeConfig(bool checkagain);
47 47
48private slots: 48private slots:
49 void yesPressed(); 49 void yesPressed();
50 void noPressed(); 50 void noPressed();
51
51private: 52private:
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;
59QString limittodirs; 60 QString limittodirs;
60QStringList mimeTypeList; 61 QStringList mimeTypeList;
61 62
62}; 63};
63 64
64#endif \ No newline at end of file 65#endif