author | alwin <alwin> | 2004-02-22 21:40:20 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-22 21:40:20 (UTC) |
commit | caa64a311d665e4d5c75cc9d45e0b3cd8ef2fdf1 (patch) (unidiff) | |
tree | ef464310a07582a7179a4d136b555b806f43fe1a | |
parent | 936fc191ac5756a4de2e8b2a83c8bc910f918b95 (diff) | |
download | opie-caa64a311d665e4d5c75cc9d45e0b3cd8ef2fdf1.zip opie-caa64a311d665e4d5c75cc9d45e0b3cd8ef2fdf1.tar.gz opie-caa64a311d665e4d5c75cc9d45e0b3cd8ef2fdf1.tar.bz2 |
when inserting a new media without .opiestorage.cf a dialog comes
setting up this file.
-rw-r--r-- | core/launcher/documentlist.cpp | 7 | ||||
-rw-r--r-- | core/launcher/mediadlg.cpp | 31 | ||||
-rw-r--r-- | core/launcher/mediadlg.h | 29 | ||||
-rw-r--r-- | core/launcher/server.pro | 12 |
4 files changed, 74 insertions, 5 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index 9736e65..39dc7c9 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp | |||
@@ -19,6 +19,7 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "documentlist.h" | 20 | #include "documentlist.h" |
21 | #include "serverinterface.h" | 21 | #include "serverinterface.h" |
22 | #include "mediadlg.h" | ||
22 | 23 | ||
23 | #include <opie2/oglobal.h> | 24 | #include <opie2/oglobal.h> |
24 | 25 | ||
@@ -434,10 +435,10 @@ void DocumentListPrivate::appendDocpath(FileSystem*fs) | |||
434 | QDir defPath(fs->path()+"/Documents"); | 435 | QDir defPath(fs->path()+"/Documents"); |
435 | QFileInfo f(fs->path()+"/.opiestorage.cf"); | 436 | QFileInfo f(fs->path()+"/.opiestorage.cf"); |
436 | if (!f.exists()) { | 437 | if (!f.exists()) { |
437 | if (defPath.exists()) { | 438 | Mediadlg dlg(fs); |
438 | docPaths+=defPath.path(); | 439 | if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) { |
440 | return; | ||
439 | } | 441 | } |
440 | return; | ||
441 | } | 442 | } |
442 | Config conf(f.filePath(), Config::File ); | 443 | Config conf(f.filePath(), Config::File ); |
443 | conf.setGroup("subdirs"); | 444 | conf.setGroup("subdirs"); |
diff --git a/core/launcher/mediadlg.cpp b/core/launcher/mediadlg.cpp new file mode 100644 index 0000000..6448863 --- a/dev/null +++ b/core/launcher/mediadlg.cpp | |||
@@ -0,0 +1,31 @@ | |||
1 | #include "mediadlg.h" | ||
2 | #include "mediumwidget.h" | ||
3 | #include <qtopia/storage.h> | ||
4 | #include <qpixmap.h> | ||
5 | #include <qlayout.h> | ||
6 | |||
7 | Mediadlg::Mediadlg(FileSystem*fs,QWidget *parent, const char *name, bool modal, WFlags fl) | ||
8 | : QDialog(parent,name,modal,fl) | ||
9 | { | ||
10 | m_fs = fs; | ||
11 | m_widget = 0; | ||
12 | init(); | ||
13 | } | ||
14 | |||
15 | Mediadlg::~Mediadlg() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | void Mediadlg::init() | ||
20 | { | ||
21 | if (!m_fs) return; | ||
22 | m_lay = new QVBoxLayout( this ); | ||
23 | m_widget = new MediumMountSetting::MediumMountWidget(m_fs->path(),QPixmap(),this); | ||
24 | m_lay->addWidget(m_widget); | ||
25 | } | ||
26 | |||
27 | void Mediadlg::accept() | ||
28 | { | ||
29 | if (m_widget) m_widget->writeConfig(); | ||
30 | QDialog::accept(); | ||
31 | } | ||
diff --git a/core/launcher/mediadlg.h b/core/launcher/mediadlg.h new file mode 100644 index 0000000..f4d552d --- a/dev/null +++ b/core/launcher/mediadlg.h | |||
@@ -0,0 +1,29 @@ | |||
1 | #ifndef __MEDIA_DLG_H | ||
2 | #define __MEDIA_DLG_H | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | |||
6 | namespace MediumMountSetting { | ||
7 | class MediumMountWidget; | ||
8 | } | ||
9 | class FileSystem; | ||
10 | class QVBoxLayout; | ||
11 | |||
12 | class Mediadlg:public QDialog | ||
13 | { | ||
14 | Q_OBJECT | ||
15 | public: | ||
16 | Mediadlg(FileSystem*,QWidget *parent = 0, const char *name = 0 , bool modal = TRUE, WFlags fl = 0); | ||
17 | virtual ~Mediadlg(); | ||
18 | protected slots: | ||
19 | virtual void accept(); | ||
20 | |||
21 | protected: | ||
22 | MediumMountSetting::MediumMountWidget*m_widget; | ||
23 | FileSystem*m_fs; | ||
24 | QVBoxLayout *m_lay; | ||
25 | void init(); | ||
26 | }; | ||
27 | |||
28 | #endif | ||
29 | |||
diff --git a/core/launcher/server.pro b/core/launcher/server.pro index f82c741..e341e1a 100644 --- a/core/launcher/server.pro +++ b/core/launcher/server.pro | |||
@@ -47,7 +47,9 @@ HEADERS += server.h \ | |||
47 | syncdialog.h \ | 47 | syncdialog.h \ |
48 | serverapp.h \ | 48 | serverapp.h \ |
49 | qprocess.h \ | 49 | qprocess.h \ |
50 | screensaver.h | 50 | screensaver.h \ |
51 | $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.h \ | ||
52 | mediadlg.h | ||
51 | 53 | ||
52 | SOURCES += server.cpp \ | 54 | SOURCES += server.cpp \ |
53 | serverinterface.cpp \ | 55 | serverinterface.cpp \ |
@@ -102,7 +104,9 @@ SOURCES += server.cpp \ | |||
102 | serverapp.cpp \ | 104 | serverapp.cpp \ |
103 | qprocess.cpp \ | 105 | qprocess.cpp \ |
104 | qprocess_unix.cpp \ | 106 | qprocess_unix.cpp \ |
105 | screensaver.cpp | 107 | screensaver.cpp \ |
108 | $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.cc \ | ||
109 | mediadlg.cpp | ||
106 | 110 | ||
107 | 111 | ||
108 | INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate | 112 | INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate |
@@ -111,6 +115,10 @@ DEPENDPATH += $(OPIEDIR)/core/apps/calibrate | |||
111 | INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync | 115 | INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync |
112 | DEPENDPATH+= $(OPIEDIR)/rsync | 116 | DEPENDPATH+= $(OPIEDIR)/rsync |
113 | 117 | ||
118 | INCLUDEPATH += $(OPIEDIR)/noncore/settings/mediummount | ||
119 | DEPENDPATH+= $(OPIEDIR)/noncore/settings/mediummount | ||
120 | |||
121 | |||
114 | TARGET = qpe | 122 | TARGET = qpe |
115 | 123 | ||
116 | #needs OWait and ODevice | 124 | #needs OWait and ODevice |