From b7fd88eef6b70df7dc05011657187f8c2f3b83d8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 29 Dec 2008 02:52:20 +0100 Subject: Better menus, icons.. --- src/mainwindow.cpp | 30 +++++++++++++----------------- src/rekonqui.rc | 8 +++++--- src/settings.cpp | 8 ++++---- 3 files changed, 22 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index eb0543e9..152b2ec7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -137,6 +137,7 @@ void MainWindow::setupActions() KStandardAction::findPrev(this, SLOT( slotFindPrevious() ) , actionCollection() ); KStandardAction::fullScreen( this, SLOT( slotViewFullScreen(bool) ), this, actionCollection() ); KStandardAction::home( this, SLOT( slotHome() ), actionCollection() ); + KStandardAction::preferences( this, SLOT( slotPreferences() ), actionCollection() ); a = KStandardAction::redisplay( this, 0, actionCollection() ); m_tabWidget->addWebAction( a, QWebPage::Reload ); @@ -229,7 +230,7 @@ void MainWindow::setupActions() KAction *historyForward = new KAction( KIcon("go-next"), i18n("Forward"), this ); connect(historyForward, SIGNAL( triggered( bool ) ), this, SLOT( slotOpenNext() ) ); - actionCollection()->addAction( QLatin1String("history forward"), m_historyForward ); + actionCollection()->addAction( QLatin1String("history forward"), historyForward ); } @@ -240,7 +241,7 @@ void MainWindow::setupCustomMenu() connect(historyMenu, SIGNAL(openUrl(const KUrl&)), m_tabWidget, SLOT(loadUrlInCurrentTab(const KUrl&))); connect(historyMenu, SIGNAL(hovered(const QString&)), this, SLOT(slotUpdateStatusbar(const QString&))); historyMenu->setTitle( i18n("Hi&story") ); - menuBar()->addMenu(historyMenu); + menuBar()->insertMenu( actionCollection()->action("downloads"), historyMenu); QList historyActions; historyActions.append( actionCollection()->action("Back") ); @@ -254,7 +255,7 @@ void MainWindow::setupCustomMenu() // --------------------------------------------- BOOKMARKS MENU ----------------------------------------------------------------------------------------------------- BookmarksMenu *bookmarksMenu = new BookmarksMenu( this ); bookmarksMenu->setTitle( i18n("&Bookmarks") ); - menuBar()->addMenu(bookmarksMenu ); + menuBar()->insertMenu( actionCollection()->action("downloads"), bookmarksMenu ); // ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ } @@ -616,26 +617,21 @@ WebView *MainWindow::currentTab() const // FIXME: this actually doesn't work properly.. void MainWindow::slotLoadProgress(int progress) { + QAction *stop = actionCollection()->action( "stop" ); + QAction *reload = actionCollection()->action(" redisplay" ); if (progress < 100 && progress > 0) { -// disconnect(m_stopReload, SIGNAL( triggered( bool ) ), m_reload, SLOT( trigger() ) ); -// m_stopReload->setIcon( KIcon( "process-stop" ) ); -// connect(m_stopReload, SIGNAL( triggered( bool ) ), m_stop, SLOT( trigger() ) ); - - disconnect( m_stopReload, SIGNAL( triggered( bool ) ), actionCollection()->action( "redisplay" ) , SIGNAL( triggered() ) ); - m_stopReload->setIcon( KIcon( "process-stop" ) ); - connect(m_stopReload, SIGNAL( triggered(bool ) ), actionCollection()->action( "stop" ), SLOT( triggered() ) ); + disconnect( m_stopReload, SIGNAL( triggered( bool ) ), reload , SIGNAL( triggered(bool) ) ); + m_stopReload->setIcon( KIcon( "process-stop" ) ); + connect(m_stopReload, SIGNAL( triggered(bool ) ), stop, SIGNAL( triggered(bool) ) ); m_stopReload->setToolTip( i18n("Stop loading the current page") ); } else { -// disconnect(m_stopReload, SIGNAL( triggered( bool ) ), m_stop, SLOT( trigger() ) ); -// m_stopReload->setIcon( KIcon("view-refresh") ); -// connect(m_stopReload, SIGNAL( triggered( bool ) ), m_reload, SLOT( trigger() ) ); - disconnect( m_stopReload, SIGNAL( triggered( bool ) ), actionCollection()->action( "stop" ) , SIGNAL( triggered( ) ) ); - m_stopReload->setIcon( KIcon( "view-refresh" ) ); - connect(m_stopReload, SIGNAL( triggered( bool ) ), actionCollection()->action( "redisplay" ), SLOT( triggered() ) ); - m_stopReload->setToolTip( i18n("Reload the current page") ); + disconnect( m_stopReload, SIGNAL( triggered( bool ) ), stop , SIGNAL( triggered(bool ) ) ); + m_stopReload->setIcon( KIcon( "view-refresh" ) ); + connect(m_stopReload, SIGNAL( triggered( bool ) ), reload, SIGNAL( triggered(bool) ) ); + m_stopReload->setToolTip( i18n("Reload the current page") ); } } diff --git a/src/rekonqui.rc b/src/rekonqui.rc index 32397b16..5c4ef58e 100644 --- a/src/rekonqui.rc +++ b/src/rekonqui.rc @@ -48,20 +48,22 @@ + + + - - &Settings +&Settings - + diff --git a/src/settings.cpp b/src/settings.cpp index 3b82935f..23b04c83 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -77,8 +77,8 @@ Private::Private(SettingsDialog *parent) widget = new QWidget; appearanceUi.setupUi( widget ); widget->layout()->setMargin(0); - pageItem = parent->addPage( widget , i18n("Appearance") ); - pageItem->setIcon( KIcon("kfontview") ); + pageItem = parent->addPage( widget , i18n("Fonts") ); + pageItem->setIcon( KIcon("preferences-desktop-font") ); widget = new QWidget; privacyUi.setupUi( widget ); @@ -176,7 +176,7 @@ void SettingsDialog::loadFromSettings() // Appearance - KConfigGroup group2 = config.group("Appearance Settings"); + KConfigGroup group2 = config.group("Fonts Settings"); m_fixedFont = group2.readEntry( QString("fixedFont"), m_fixedFont ); m_standardFont = group2.readEntry( QString("standardFont"), m_standardFont ); @@ -262,7 +262,7 @@ void SettingsDialog::saveToSettings() } group1.writeEntry(QString("historyExpire"), idx ); - KConfigGroup group2 = config.group("Appearance Settings"); + KConfigGroup group2 = config.group("Fonts Settings"); group2.writeEntry(QString("fixedFont"), m_fixedFont); group2.writeEntry(QString("standardFont"), m_standardFont); -- cgit v1.2.1