diff -r 5db69f4c3d06 -r b048e15729d6 filebrowser/ui/src/fbmainwindow.cpp --- a/filebrowser/ui/src/fbmainwindow.cpp Mon Aug 23 15:50:54 2010 +0300 +++ b/filebrowser/ui/src/fbmainwindow.cpp Fri Sep 03 17:11:21 2010 +0300 @@ -21,9 +21,10 @@ #include "enginewrapper.h" #include "fbfileview.h" #include "fbdriveview.h" -#include "settingsview.h" -#include "editorview.h" -#include "searchview.h" +#include "fbsettingsview.h" +#include "fbeditorview.h" +#include "fbsearchview.h" +#include "fbattributesview.h" FbMainWindow::FbMainWindow(QWidget *parent) : HbMainWindow(parent), @@ -33,6 +34,7 @@ mSettingsView(0), mEditorView(0), mSearchView(0), + mAttributesView(0), mPreviousView(0) { } @@ -66,23 +68,26 @@ addView(mFileView); // Create settings view - mSettingsView = new SettingsView(*mEngineWrapper); + mSettingsView = new FbSettingsView(*mEngineWrapper); connect(mSettingsView, SIGNAL(finished(bool)), this, SLOT(openPreviousBrowserView())); addView(mSettingsView); // Create editor view - mEditorView = new EditorView(); + mEditorView = new FbEditorView(); connect(mFileView, SIGNAL(aboutToShowEditorView(const QString &, bool)), this, SLOT(openEditorView(const QString &, bool))); connect(mEditorView, SIGNAL(finished(bool)), this, SLOT(openFileView())); addView(mEditorView); // Create Search view - mSearchView = new SearchView(*mEngineWrapper); + mSearchView = new FbSearchView(*mEngineWrapper); connect(mDriveView, SIGNAL(aboutToShowSearchView(QString)), this, SLOT(openSearchView(QString))); connect(mFileView, SIGNAL(aboutToShowSearchView(QString)), this, SLOT(openSearchView(QString))); connect(mSearchView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView(bool))); addView(mSearchView); + connect(mFileView, SIGNAL(aboutToShowAttributesView(const QString &, quint32 &, quint32 &, bool &)), + this, SLOT(openAttributesView(const QString &, quint32 &, quint32 &, bool &))); + // Show ApplicationView at startup setCurrentView(mDriveView); mPreviousView = mDriveView; @@ -143,3 +148,31 @@ mSearchView->open(path); setCurrentView(mSearchView); } + +void FbMainWindow::openAttributesView(const QString &attributesViewTitle, + quint32 &setAttributesMask, + quint32 &clearAttributesMask, + bool &recurse) +{ + if (!mAttributesView) { + // Create attributes view + mAttributesView = new FbAttributesView(setAttributesMask, clearAttributesMask, recurse); + connect(mAttributesView, SIGNAL(finished(bool)), this, SLOT(closeAttributesView(bool))); + mAttributesView->setTitle(attributesViewTitle); + addView(mAttributesView); + setCurrentView(mAttributesView); + } +} + +void FbMainWindow::closeAttributesView(bool accepted) +{ + if (accepted) { + mEngineWrapper->setAttributes(mAttributesView->setAttributesMask(), mAttributesView->clearAttributesMask(), mAttributesView->recurse()); + } + openFileView(); + removeView(mAttributesView); + mAttributesView->deleteLater(); + mAttributesView = 0; +} + +// End of file