-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 @@ -6,32 +6,33 @@ ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "documentlist.h" #include "serverinterface.h" +#include "mediadlg.h" #include <opie2/oglobal.h> #include <qtopia/config.h> #include <qtopia/mimetype.h> #include <qtopia/resource.h> #include <qtopia/private/categories.h> #include <qtopia/qpeapplication.h> #include <qtopia/applnk.h> #include <qtopia/storage.h> #ifdef Q_WS_QWS #include <qtopia/qcopenvelope_qws.h> #endif #include <qtimer.h> #include <qfileinfo.h> @@ -421,36 +422,36 @@ DocumentListPrivate::DocumentListPrivate( ServerInterface *gui ) sendDocLnks = false; } for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { listDirs[i] = 0; lists[i] = 0; listPositions[i] = 0; } initialize(); tid = 0; } 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"); bool read_all = conf.readBoolEntry("wholemedia",true); if (read_all) { docPaths+=fs->path(); return; } QStringList subDirs = conf.readListEntry("subdirs",':'); if (subDirs.isEmpty()) { if (defPath.exists()) { docPaths+=defPath.path(); } return; } for (unsigned c = 0; c < subDirs.count();++c) { 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 @@ -34,33 +34,35 @@ HEADERS += server.h \ $$(OPIEDIR)/rsync/netint.h \ $$(OPIEDIR)/rsync/protocol.h \ $$(OPIEDIR)/rsync/prototab.h \ $$(OPIEDIR)/rsync/rsync.h \ $$(OPIEDIR)/rsync/search.h \ $$(OPIEDIR)/rsync/stream.h \ $$(OPIEDIR)/rsync/sumset.h \ $$(OPIEDIR)/rsync/trace.h \ $$(OPIEDIR)/rsync/types.h \ $$(OPIEDIR)/rsync/util.h \ $$(OPIEDIR)/rsync/whole.h \ $$(OPIEDIR)/rsync/config_rsync.h \ $$(OPIEDIR)/rsync/qrsync.h \ syncdialog.h \ serverapp.h \ qprocess.h \ - screensaver.h + screensaver.h \ + $$(OPIEDIR)/noncore/settings/mediummount/mediumwidget.h \ + mediadlg.h SOURCES += server.cpp \ serverinterface.cpp \ launchertab.cpp \ documentlist.cpp \ appicons.cpp \ taskbar.cpp \ runningappbar.cpp \ applauncher.cpp \ stabmon.cpp \ inputmethods.cpp \ systray.cpp \ wait.cpp \ shutdownimpl.cpp \ launcher.cpp \ launcherview.cpp \ @@ -89,36 +91,42 @@ SOURCES += server.cpp \ $$(OPIEDIR)/rsync/readsums.c \ $$(OPIEDIR)/rsync/scoop.c \ $$(OPIEDIR)/rsync/search.c \ $$(OPIEDIR)/rsync/stats.c \ $$(OPIEDIR)/rsync/stream.c \ $$(OPIEDIR)/rsync/sumset.c \ $$(OPIEDIR)/rsync/trace.c \ $$(OPIEDIR)/rsync/tube.c \ $$(OPIEDIR)/rsync/util.c \ $$(OPIEDIR)/rsync/version.c \ $$(OPIEDIR)/rsync/whole.c \ $$(OPIEDIR)/rsync/qrsync.cpp \ syncdialog.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 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 CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) contains( CONFTEST, y ){ LIBS += -lqpe -lopiecore2 -lopieui2 }else{ LIBS += -lcrypt -lqpe -lopiecore2 -lopieui2 } include ( $(OPIEDIR)/include.pro ) |