diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-04-01 12:48:03 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-04-01 23:43:38 +0200 |
commit | fb612bbc722ef83c65c63961723f10969f9a6cee (patch) | |
tree | fd7020d835b1fb4f3a818c0b2aa318cd1c62c6c6 /src | |
parent | 99% fixed target _blank issue.. (diff) | |
download | rekonq-fb612bbc722ef83c65c63961723f10969f9a6cee.tar.xz |
Importing clones PART 1
I apologies for this "strange" way of importing code.
But we have 3 (or 4) different ideas about UIs.. and I have
to decide one.
So, best way I found is importing manually changes.
I'll write something about that soon. We basically need to better
learn git cooperation (I'm first).
Anyway, thank you a lot for your time and your ideas. I really
apprecciate your efforts ;)
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 51 | ||||
-rw-r--r-- | src/mainwindow.h | 9 | ||||
-rw-r--r-- | src/rekonqui.rc | 12 |
3 files changed, 49 insertions, 23 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2a5f9295..92040bfe 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -65,12 +65,14 @@ MainWindow::MainWindow() : KXmlGuiWindow() , m_view(new MainView(this)) , m_bookmarksProvider(new BookmarksProvider(this)) + , m_findBar(new FindBar(this)) + , m_searchBar(new SearchBar(this)) { // accept dnd setAcceptDrops(true); // updating rekonq configuration - slotUpdateConf(); + slotUpdateConfiguration(); // creating a centralWidget containing m_view and the hidden findbar QWidget *centralWidget = new QWidget; @@ -78,8 +80,7 @@ MainWindow::MainWindow() layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(m_view); - // Find Bar - m_findBar = new FindBar(this); + // Adding Find Bar connect(m_findBar, SIGNAL(searchString(const QString &)), this, SLOT(slotFind(const QString &))); layout->addWidget(m_findBar); @@ -112,6 +113,9 @@ MainWindow::MainWindow() // add a status bar statusBar()->show(); + // setting up toolbars: this has to be done BEFORE setupGUI!! + setupToolBars(); + // ----- BOOKMARKS MENU: this has to be done BEFORE setupGUI!! KAction *a = new KActionMenu(i18n("B&ookmarks"), this); actionCollection()->addAction(QLatin1String("bookmarks"), a); @@ -125,26 +129,14 @@ MainWindow::MainWindow() // toolbar position, icon size, etc. setupGUI(); - // setup history menu + // setup history menu: this has to be done AFTER setupGUI!! setupHistoryMenu(); // setup Tab Bar setupTabBar(); - // setting up custom widgets.. - KToolBar *navigationBar = toolBar("mainToolBar"); - navigationBar->addWidget(m_view->lineEditStack()); - - KToolBar *bmToolbar = toolBar("bookmarksToolBar"); - m_bookmarksProvider->provideBmToolbar(bmToolbar); - // setting up toolbars to NOT have context menu enabled setContextMenuPolicy(Qt::DefaultContextMenu); - - // search bar - m_searchBar = new SearchBar(this); - connect(m_searchBar, SIGNAL(search(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); - navigationBar->addWidget(m_searchBar); } @@ -162,6 +154,29 @@ QSize MainWindow::sizeHint() const } +void MainWindow::setupToolBars() +{ + KAction *a; + + // location bar + a = new KAction(i18n("Location Bar"), this); + a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_L, Qt::Key_F6)); + a->setDefaultWidget(m_view->lineEditStack()); + actionCollection()->addAction(QLatin1String("url_bar"), a); + + // search bar + a = new KAction(i18n("Search Bar"), this); + a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_K)); + a->setDefaultWidget(m_searchBar); + connect(m_searchBar, SIGNAL(search(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); + actionCollection()->addAction(QLatin1String("search_bar"), a); + + // bookmarks bar + KToolBar *bmToolbar = toolBar("bookmarksToolBar"); + m_bookmarksProvider->provideBmToolbar(bmToolbar); +} + + void MainWindow::setupActions() { KAction *a; @@ -298,7 +313,7 @@ void MainWindow::setupHistoryMenu() } -void MainWindow::slotUpdateConf() +void MainWindow::slotUpdateConfiguration() { // ============== General ================== m_homePage = ReKonfig::homePage(); @@ -334,7 +349,7 @@ void MainWindow::slotUpdateConf() void MainWindow::slotUpdateBrowser() { - slotUpdateConf(); + slotUpdateConfiguration(); mainView()->reloadAllTabs(); } diff --git a/src/mainwindow.h b/src/mainwindow.h index c9bec75e..c12f8fce 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -64,6 +64,7 @@ private: void setupActions(); void setupHistoryMenu(); void setupTabBar(); + void setupToolBars(); public slots: void slotHome(); @@ -71,7 +72,7 @@ public slots: void slotUpdateBrowser(); private slots: - void slotUpdateConf(); + void slotUpdateConfiguration(); void slotLoadProgress(int); void slotUpdateStatusbar(const QString &string); void slotUpdateActions(); @@ -114,20 +115,22 @@ private slots: void slotPreferences(); private: - SearchBar *m_searchBar; - FindBar *m_findBar; KMenu *m_historyBackMenu; KMenu *m_windowMenu; + KAction *m_stopReloadAction; KAction *m_stopAction; KAction *m_reloadAction; KAction *m_historyBackAction; KAction *m_historyForwardAction; + QString m_lastSearch; QString m_homePage; MainView *m_view; BookmarksProvider *m_bookmarksProvider; + FindBar *m_findBar; + SearchBar *m_searchBar; }; #endif // MAINWINDOW_H diff --git a/src/rekonqui.rc b/src/rekonqui.rc index babf2c62..bc4f9c37 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE gui SYSTEM "kpartgui.dtd"> -<gui name="rekonq" version="32"> +<gui name="rekonq" version="35"> <MenuBar> @@ -68,13 +68,21 @@ </MenuBar> <!-- ============ Main ToolBar =========== --> -<ToolBar name="mainToolBar" fullWidth="true" position="top" iconText="iconOnly" newline="true" noMerge="1"><text>Main Toolbar</text> +<ToolBar name="mainToolBar" position="top" iconText="iconOnly" newline="true" noMerge="1"> +<text>Main Toolbar</text> <Action name="history_back" /> <Action name="history_forward" /> <Action name="stop_reload" /> <Action name="go_home" /> </ToolBar> +<!-- ============ Location ToolBar =========== --> +<ToolBar noEdit="true" name="locationToolBar" iconText="iconOnly" newline="false"> +<text>Location Toolbar</text> + <Action name="url_bar" /> + <Action name="search_bar" /> +</ToolBar> + <!-- ============ Bookmarks ToolBar =========== --> <ToolBar noEdit="true" iconText="icontextright" fullWidth="true" name="bookmarksToolBar" iconSize="16" newline="true" hidden="true"> <text>Bookmark Toolbar</text> |