summaryrefslogtreecommitdiff
path: root/core
authoralwin <alwin>2004-02-22 21:40:20 (UTC)
committer alwin <alwin>2004-02-22 21:40:20 (UTC)
commitcaa64a311d665e4d5c75cc9d45e0b3cd8ef2fdf1 (patch) (side-by-side diff)
treeef464310a07582a7179a4d136b555b806f43fe1a /core
parent936fc191ac5756a4de2e8b2a83c8bc910f918b95 (diff)
downloadopie-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.
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp7
-rw-r--r--core/launcher/mediadlg.cpp31
-rw-r--r--core/launcher/mediadlg.h29
-rw-r--r--core/launcher/server.pro12
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 @@
**********************************************************************/
#include "documentlist.h"
#include "serverinterface.h"
+#include "mediadlg.h"
#include <opie2/oglobal.h>
@@ -434,10 +435,10 @@ void DocumentListPrivate::appendDocpath(FileSystem*fs)
QDir defPath(fs->path()+"/Documents");
QFileInfo f(fs->path()+"/.opiestorage.cf");
if (!f.exists()) {
- if (defPath.exists()) {
- docPaths+=defPath.path();
+ Mediadlg dlg(fs);
+ if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) {
+ return;
}
- return;
}
Config conf(f.filePath(), Config::File );
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 @@
+#include "mediadlg.h"
+#include "mediumwidget.h"
+#include <qtopia/storage.h>
+#include <qpixmap.h>
+#include <qlayout.h>
+
+Mediadlg::Mediadlg(FileSystem*fs,QWidget *parent, const char *name, bool modal, WFlags fl)
+ : QDialog(parent,name,modal,fl)
+{
+ m_fs = fs;
+ m_widget = 0;
+ init();
+}
+
+Mediadlg::~Mediadlg()
+{
+}
+
+void Mediadlg::init()
+{
+ if (!m_fs) return;
+ m_lay = new QVBoxLayout( this );
+ m_widget = new MediumMountSetting::MediumMountWidget(m_fs->path(),QPixmap(),this);
+ m_lay->addWidget(m_widget);
+}
+
+void Mediadlg::accept()
+{
+ if (m_widget) m_widget->writeConfig();
+ QDialog::accept();
+}
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 @@
+#ifndef __MEDIA_DLG_H
+#define __MEDIA_DLG_H
+
+#include <qdialog.h>
+
+namespace MediumMountSetting {
+ class MediumMountWidget;
+}
+class FileSystem;
+class QVBoxLayout;
+
+class Mediadlg:public QDialog
+{
+ Q_OBJECT
+public:
+ Mediadlg(FileSystem*,QWidget *parent = 0, const char *name = 0 , bool modal = TRUE, WFlags fl = 0);
+ virtual ~Mediadlg();
+protected slots:
+ virtual void accept();
+
+protected:
+ MediumMountSetting::MediumMountWidget*m_widget;
+ FileSystem*m_fs;
+ QVBoxLayout *m_lay;
+ void init();
+};
+
+#endif
+
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 \
syncdialog.h \
serverapp.h \
qprocess.h \
- screensaver.h
+ screensaver.h \
+ $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.h \
+ mediadlg.h
SOURCES += server.cpp \
serverinterface.cpp \
@@ -102,7 +104,9 @@ SOURCES += server.cpp \
serverapp.cpp \
qprocess.cpp \
qprocess_unix.cpp \
- screensaver.cpp
+ screensaver.cpp \
+ $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.cc \
+ mediadlg.cpp
INCLUDEPATH += $(OPIEDIR)/core/apps/calibrate
@@ -111,6 +115,10 @@ DEPENDPATH += $(OPIEDIR)/core/apps/calibrate
INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/rsync
DEPENDPATH += $(OPIEDIR)/rsync
+INCLUDEPATH += $(OPIEDIR)/noncore/settings/mediummount
+DEPENDPATH += $(OPIEDIR)/noncore/settings/mediummount
+
+
TARGET = qpe
#needs OWait and ODevice