22 #include "filebrowsermainwindow.h" |
22 #include "filebrowsermainwindow.h" |
23 #include "enginewrapper.h" |
23 #include "enginewrapper.h" |
24 #include "filebrowserview.h" |
24 #include "filebrowserview.h" |
25 #include "settingsview.h" |
25 #include "settingsview.h" |
26 #include "editorview.h" |
26 #include "editorview.h" |
|
27 #include "searchview.h" |
27 |
28 |
28 FileBrowserMainWindow::FileBrowserMainWindow(QWidget *parent) : |
29 FileBrowserMainWindow::FileBrowserMainWindow(QWidget *parent) |
29 HbMainWindow( parent ) |
30 : HbMainWindow(parent), |
30 ,mEngineWrapper(0) |
31 mEngineWrapper(0), |
31 ,mFileBrowserView(0) |
32 mFileBrowserView(0), |
32 ,mSettingsView(0) |
33 mSettingsView(0), |
33 ,mEditorView(0) |
34 mEditorView(0), |
|
35 mSearchView(0) |
34 { |
36 { |
35 } |
37 } |
36 |
38 |
37 FileBrowserMainWindow::~FileBrowserMainWindow () |
39 FileBrowserMainWindow::~FileBrowserMainWindow () |
38 { |
40 { |
63 mEditorView = new EditorView(*this); |
65 mEditorView = new EditorView(*this); |
64 connect(mFileBrowserView, SIGNAL(aboutToShowEditorView(const QString &, bool)), this, SLOT(openEditorView(const QString &, bool))); |
66 connect(mFileBrowserView, SIGNAL(aboutToShowEditorView(const QString &, bool)), this, SLOT(openEditorView(const QString &, bool))); |
65 connect(mEditorView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView())); |
67 connect(mEditorView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView())); |
66 addView(mEditorView); |
68 addView(mEditorView); |
67 |
69 |
|
70 // Create Search view |
|
71 mSearchView = new SearchView(*mEngineWrapper); |
|
72 connect(mFileBrowserView, SIGNAL(aboutToShowSearchView(QString)), this, SLOT(openSearchView(QString))); |
|
73 connect(mSearchView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView())); |
|
74 addView(mSearchView); |
|
75 |
68 // Show ApplicationView at startup |
76 // Show ApplicationView at startup |
69 setCurrentView(mFileBrowserView); |
77 setCurrentView(mFileBrowserView); |
|
78 |
70 // Show HbMainWindow |
79 // Show HbMainWindow |
71 show(); |
80 show(); |
72 } |
81 } |
73 |
82 |
74 void FileBrowserMainWindow::openFileBrowserView() |
83 void FileBrowserMainWindow::openFileBrowserView() |
75 { |
84 { |
|
85 mFileBrowserView->refreshList(); |
76 setCurrentView(mFileBrowserView); |
86 setCurrentView(mFileBrowserView); |
77 } |
87 } |
78 |
88 |
79 void FileBrowserMainWindow::openSettingsView() |
89 void FileBrowserMainWindow::openSettingsView() |
80 { |
90 { |
84 void FileBrowserMainWindow::openEditorView(const QString &fileName, bool flagReadOnly) |
94 void FileBrowserMainWindow::openEditorView(const QString &fileName, bool flagReadOnly) |
85 { |
95 { |
86 mEditorView->open(fileName, flagReadOnly); |
96 mEditorView->open(fileName, flagReadOnly); |
87 setCurrentView(mEditorView); |
97 setCurrentView(mEditorView); |
88 } |
98 } |
|
99 |
|
100 void FileBrowserMainWindow::openSearchView(const QString &path) |
|
101 { |
|
102 mSearchView->open(path); |
|
103 setCurrentView(mSearchView); |
|
104 } |