diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8d0f28a7..9207f6ec 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -103,8 +103,7 @@ MainWindow::MainWindow() , m_analyzerPanel(0) , m_historyBackMenu(0) , m_encodingMenu(new KMenu(this)) -// , m_mainBar(new KToolBar(QString("MainToolBar"), this, Qt::TopToolBarArea, true, true, true)) -// , m_bmBar(new KToolBar(QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, true)) + , m_bookmarksBar(new BookmarkToolBar(QString("BookmarkToolBar"), this, Qt::TopToolBarArea, true, false, true)) , m_popup(new KPassivePopup(this)) , m_hidePopup(new QTimer(this)) { @@ -150,27 +149,6 @@ MainWindow::MainWindow() // no more status bar.. setStatusBar(0); - KToolBar *mainBar = toolBar("mainToolBar"); - - QToolButton *bookmarksButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); - if(bookmarksButton) - { - connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); - } - - QToolButton *toolsButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); - if(toolsButton) - { - connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); - } - - // setting popup notification - m_popup->setAutoDelete(false); - connect(Application::instance(), SIGNAL(focusChanged(QWidget*, QWidget*)), m_popup, SLOT(hide())); - m_popup->setFrameShape(QFrame::NoFrame); - m_popup->setLineWidth(0); - connect(m_hidePopup, SIGNAL(timeout()), m_popup, SLOT(hide())); - QTimer::singleShot(0, this, SLOT(postLaunch())); kDebug() << "MainWindow ctor...DONE"; @@ -179,8 +157,7 @@ MainWindow::MainWindow() MainWindow::~MainWindow() { - KToolBar *bookBar = toolBar("bookmarksToolBar"); - Application::bookmarkProvider()->removeToolBar(bookBar); + Application::bookmarkProvider()->removeToolBar(m_bookmarksBar); Application::bookmarkProvider()->removeBookmarkPanel(m_bookmarksPanel); Application::instance()->removeMainWindow(this); @@ -195,6 +172,8 @@ MainWindow::~MainWindow() delete m_historyBackMenu; delete m_encodingMenu; + delete m_bookmarksBar; + delete m_zoomSlider; delete m_popup; @@ -210,27 +189,46 @@ void MainWindow::setupToolbars() // location bar a = new KAction(i18n("Location Bar"), this); - a->setShortcut(KShortcut(Qt::Key_F6)); a->setDefaultWidget(m_view->widgetBar()); actionCollection()->addAction( QL1S("url_bar"), a); KToolBar *mainBar = toolBar("mainToolBar"); - KToolBar *bookBar = toolBar("bookmarksToolBar"); - + // bookmarks bar - KAction *bookmarkBarAction = Application::bookmarkProvider()->bookmarkToolBarAction(bookBar); + KAction *bookmarkBarAction = Application::bookmarkProvider()->bookmarkToolBarAction(m_bookmarksBar); a = actionCollection()->addAction( QL1S("bookmarks_bar"), bookmarkBarAction); mainBar->show(); // this just to fix reopening rekonq after fullscreen close // =========== Bookmarks ToolBar ================================ - bookBar->setAcceptDrops(true); - Application::bookmarkProvider()->setupBookmarkBar(bookBar); + m_bookmarksBar->setAcceptDrops(true); + Application::bookmarkProvider()->setupBookmarkBar(m_bookmarksBar); } void MainWindow::postLaunch() { + KToolBar *mainBar = toolBar("mainToolBar"); + + QToolButton *bookmarksButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("bookmarksActionMenu") ))); + if(bookmarksButton) + { + connect(actionByName(QL1S("bookmarksActionMenu")), SIGNAL(triggered()), bookmarksButton, SLOT(showMenu())); + } + + QToolButton *toolsButton = qobject_cast<QToolButton*>(mainBar->widgetForAction(actionByName( QL1S("rekonq_tools") ))); + if(toolsButton) + { + connect(actionByName(QL1S("rekonq_tools")), SIGNAL(triggered()), toolsButton, SLOT(showMenu())); + } + + // setting popup notification + m_popup->setAutoDelete(false); + connect(Application::instance(), SIGNAL(focusChanged(QWidget*, QWidget*)), m_popup, SLOT(hide())); + m_popup->setFrameShape(QFrame::NoFrame); + m_popup->setLineWidth(0); + connect(m_hidePopup, SIGNAL(timeout()), m_popup, SLOT(hide())); + // notification system connect(m_view, SIGNAL(showStatusBarMessage(const QString&, Rekonq::Notify)), this, SLOT(notifyMessage(const QString&, Rekonq::Notify))); connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); |