summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rekonq.desktop2
-rwxr-xr-xscripts/codingstyle.sh25
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainwindow.cpp90
-rw-r--r--src/mainwindow.h7
-rw-r--r--src/networkaccessmanager.cpp1
-rw-r--r--src/rekonqui.rc28
-rw-r--r--src/tabbar.cpp35
8 files changed, 77 insertions, 113 deletions
diff --git a/data/rekonq.desktop b/data/rekonq.desktop
index 2e9995dc..a2aeca1b 100644
--- a/data/rekonq.desktop
+++ b/data/rekonq.desktop
@@ -3,7 +3,7 @@ Name=rekonq
GenericName=Webkit KDE Browser
Icon=rekonq
Type=Application
-Exec=rekonq %u
+Exec=rekonq %i
DocPath=rekonq/index.html
Categories=Qt;KDE;Network;
Terminal=0
diff --git a/scripts/codingstyle.sh b/scripts/codingstyle.sh
index 0ed5fb17..f0fb984f 100755
--- a/scripts/codingstyle.sh
+++ b/scripts/codingstyle.sh
@@ -1,28 +1,13 @@
#!/bin/sh
#
-# apply rekonq coding style to all cpp and header files in src directory
-#
+# apply kdelibs coding style to all c, cpp and header files in src directory
# requirements: installed astyle
#
-# rekonq use kdelibs coding style, except for brackets, so while kdelibs coding style
-# is
-#
-# void foo() {
-# ...
-# }
-#
-# rekonq uses
-#
-# void foo()
-# {
-# ...
-# }
+# The coding style is defined in http://techbase.kde.org/Policies/Kdelibs_Coding_Style
#
-# I like this way, for me more readable.
-#
-# Kdelibs coding style is defined in http://techbase.kde.org/Policies/Kdelibs_Coding_Style
-
+# In rekonq we use some little different rules..
+{
PWD=$(pwd)
cd $PWD
@@ -39,4 +24,4 @@ astyle \
--convert-tabs \
--indent-preprocessor \
`find -type f -name '*.cpp'` `find -type f -name '*.h'`
-
+}
diff --git a/src/main.cpp b/src/main.cpp
index b7cfbb3b..9248aa14 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
ki18n("rekonq"),
version,
ki18n(description),
- KAboutData::License_GPL_V3,
+ KAboutData::License_GPL,
ki18n("(C) 2008 Andrea Diamantini"),
KLocalizedString(),
"http://rekonq.sourceforge.net",
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5dd8663e..d76b0d8d 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -76,7 +76,7 @@ MainWindow::MainWindow()
// creating a centralWidget containing m_view and the hidden findbar
QWidget *centralWidget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
- layout->setContentsMargins(0, 0, 0, 0);
+ layout->setMargin(0);
layout->addWidget(m_view);
// Find Bar
@@ -102,9 +102,6 @@ MainWindow::MainWindow()
connect(m_view, SIGNAL(statusBarVisibilityChangeRequested(bool)), statusBar(), SLOT(setVisible(bool)));
connect(m_view, SIGNAL(lastTabClosed()), m_view, SLOT(newTab()));
- connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions()));
- connect(m_view, SIGNAL(currentChanged(int)), this, SLOT(slotUpdateActions()));
-
slotUpdateWindowTitle();
// then, setup our actions
@@ -197,76 +194,76 @@ void MainWindow::setupActions()
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(slotWebStop()));
// stop reload Action
- m_stopReloadAction = new KAction(KIcon("view-refresh"), i18n("reload"), this);
- actionCollection()->addAction(QLatin1String("stop_reload") , m_stopReloadAction);
- m_stopReloadAction->setShortcutConfigurable(false);
+ m_stopReload = new KAction(KIcon("view-refresh"), i18n("reload"), this);
+ actionCollection()->addAction(QLatin1String("stop reload") , m_stopReload);
// ============== Custom Actions
a = new KAction(KIcon(), i18n("Open Location"), this);
- actionCollection()->addAction(QLatin1String("open_location"), a);
+ actionCollection()->addAction(QLatin1String("open location"), a);
connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotOpenLocation()));
a = new KAction(i18n("Private &Browsing..."), this);
a->setCheckable(true);
- actionCollection()->addAction(i18n("private_browsing"), a);
+ actionCollection()->addAction(i18n("private browsing"), a);
connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotPrivateBrowsing()));
a = new KAction(KIcon("zoom-in"), i18n("&Enlarge Font"), this);
a->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Plus));
- actionCollection()->addAction(QLatin1String("bigger_font"), a);
+ actionCollection()->addAction(QLatin1String("bigger font"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewTextBigger()));
a = new KAction(KIcon("zoom-original"), i18n("&Normal Font"), this);
a->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
- actionCollection()->addAction(QLatin1String("normal_font"), a);
+ actionCollection()->addAction(QLatin1String("normal font"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewTextNormal()));
a = new KAction(KIcon("zoom-out"), i18n("&Shrink Font"), this);
a->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Minus));
- actionCollection()->addAction(QLatin1String("smaller_font"), a);
+ actionCollection()->addAction(QLatin1String("smaller font"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewTextSmaller()));
a = new KAction(i18n("Page S&ource"), this);
- actionCollection()->addAction(QLatin1String("page_source"), a);
+ actionCollection()->addAction(QLatin1String("page source"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewPageSource()));
a = new KAction(KIcon("tools-report-bug"), i18n("Enable Web &Inspector"), this);
a->setCheckable(true);
- actionCollection()->addAction(QLatin1String("web_inspector"), a);
+ actionCollection()->addAction(QLatin1String("web inspector"), a);
connect(a, SIGNAL(triggered(bool)), this, SLOT(slotToggleInspector(bool)));
// ================ history related actions
- m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this);
+ KAction *historyBack = new KAction(KIcon("go-previous"), i18n("Back"), this);
m_historyBackMenu = new KMenu(this);
- m_historyBackAction->setMenu(m_historyBackMenu);
- connect(m_historyBackAction, SIGNAL(triggered(bool)), this, SLOT(slotOpenPrevious()));
+ historyBack->setMenu(m_historyBackMenu);
+ connect(historyBack, SIGNAL(triggered(bool)), this, SLOT(slotOpenPrevious()));
+// FIXME < --------------------------------------------------------------------------------------------------------------------------------------|
connect(m_historyBackMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowBackMenu()));
connect(m_historyBackMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenActionUrl(QAction *)));
- actionCollection()->addAction(QLatin1String("history_back"), m_historyBackAction);
+ actionCollection()->addAction(QLatin1String("history back"), historyBack);
- m_historyForwardAction = new KAction(KIcon("go-next"), i18n("Forward"), this);
- connect(m_historyForwardAction, SIGNAL(triggered(bool)), this, SLOT(slotOpenNext()));
- actionCollection()->addAction(QLatin1String("history_forward"), m_historyForwardAction);
+ KAction *historyForward = new KAction(KIcon("go-next"), i18n("Forward"), this);
+ connect(historyForward, SIGNAL(triggered(bool)), this, SLOT(slotOpenNext()));
+ actionCollection()->addAction(QLatin1String("history forward"), historyForward);
// =================== Tab Actions
a = new KAction(KIcon("tab-new"), i18n("New &Tab"), this);
a->setShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_N, Qt::CTRL + Qt::Key_T));
- actionCollection()->addAction(QLatin1String("new_tab"), a);
+ actionCollection()->addAction(QLatin1String("new tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(newTab()));
a = new KAction(KIcon("tab-close"), i18n("&Close Tab"), this);
a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_W));
- actionCollection()->addAction(QLatin1String("close_tab"), a);
+ actionCollection()->addAction(QLatin1String("close tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(closeTab()));
a = new KAction(i18n("Show Next Tab"), this);
a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabPrev() : KStandardShortcut::tabNext());
- actionCollection()->addAction(QLatin1String("show_next_tab"), a);
+ actionCollection()->addAction(QLatin1String("show next tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(nextTab()));
a = new KAction(i18n("Show Previous Tab"), this);
a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabNext() : KStandardShortcut::tabPrev());
- actionCollection()->addAction(QLatin1String("show_prev_tab"), a);
+ actionCollection()->addAction(QLatin1String("show prev tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(previousTab()));
}
@@ -275,14 +272,14 @@ void MainWindow::setupTabBar()
{
// Left corner button
QToolButton *addTabButton = new QToolButton(this);
- addTabButton->setDefaultAction(actionCollection()->action("new_tab"));
+ addTabButton->setDefaultAction(actionCollection()->action("new tab"));
addTabButton->setAutoRaise(true);
addTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_view->setCornerWidget(addTabButton, Qt::TopLeftCorner);
// right corner button
QToolButton *closeTabButton = new QToolButton(this);
- closeTabButton->setDefaultAction(actionCollection()->action("close_tab"));
+ closeTabButton->setDefaultAction(actionCollection()->action("close tab"));
closeTabButton->setAutoRaise(true);
closeTabButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_view->setCornerWidget(closeTabButton, Qt::TopRightCorner);
@@ -296,9 +293,19 @@ void MainWindow::setupHistoryMenu()
connect(historyMenu, SIGNAL(hovered(const QString&)), this, SLOT(slotUpdateStatusbar(const QString&)));
historyMenu->setTitle(i18n("&History"));
menuBar()->insertMenu(actionCollection()->action("bookmarks"), historyMenu);
+ QList<QAction*> historyActions;
+
+ historyActions.append(actionCollection()->action("history back"));
+ historyActions.append(actionCollection()->action("history forward"));
+ historyActions.append(m_view->recentlyClosedTabsAction());
+
+ historyMenu->setInitialActions(historyActions);
}
+// FIXME
+// check ALL variables: including alwaysShowTabbar..
+
void MainWindow::slotUpdateConf()
{
// ============== General ==================
@@ -444,13 +451,6 @@ void MainWindow::slotUpdateStatusbar(const QString &string)
}
-void MainWindow::slotUpdateActions()
-{
- m_historyBackAction->setEnabled(currentTab()->history()->canGoBack());
- m_historyForwardAction->setEnabled(currentTab()->history()->canGoForward());
-}
-
-
void MainWindow::slotUpdateWindowTitle(const QString &title)
{
if (title.isEmpty())
@@ -628,6 +628,7 @@ void MainWindow::slotViewTextSmaller()
}
+// TODO improve this
void MainWindow::slotViewFullScreen(bool makeFullScreen)
{
if (makeFullScreen == true)
@@ -707,25 +708,26 @@ 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("view_redisplay");
if (progress < 100 && progress > 0)
{
- disconnect(m_stopReloadAction, SIGNAL(triggered(bool)), reload , SIGNAL(triggered(bool)));
- m_stopReloadAction->setIcon(KIcon("process-stop"));
- m_stopReloadAction->setToolTip(i18n("Stop loading the current page"));
- m_stopReloadAction->setText(i18n("Stop"));
- connect(m_stopReloadAction, SIGNAL(triggered(bool)), stop, SIGNAL(triggered(bool)));
+ disconnect(m_stopReload, SIGNAL(triggered(bool)), reload , SIGNAL(triggered(bool)));
+ m_stopReload->setIcon(KIcon("process-stop"));
+ m_stopReload->setToolTip(i18n("Stop loading the current page"));
+ m_stopReload->setText(i18n("Stop"));
+ connect(m_stopReload, SIGNAL(triggered(bool)), stop, SIGNAL(triggered(bool)));
}
else
{
- disconnect(m_stopReloadAction, SIGNAL(triggered(bool)), stop , SIGNAL(triggered(bool)));
- m_stopReloadAction->setIcon(KIcon("view-refresh"));
- m_stopReloadAction->setToolTip(i18n("Reload the current page"));
- m_stopReloadAction->setText(i18n("Reload"));
- connect(m_stopReloadAction, SIGNAL(triggered(bool)), reload, SIGNAL(triggered(bool)));
+ disconnect(m_stopReload, SIGNAL(triggered(bool)), stop , SIGNAL(triggered(bool)));
+ m_stopReload->setIcon(KIcon("view-refresh"));
+ m_stopReload->setToolTip(i18n("Reload the current page"));
+ m_stopReload->setText(i18n("Reload"));
+ connect(m_stopReload, SIGNAL(triggered(bool)), reload, SIGNAL(triggered(bool)));
}
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index c9bec75e..220fceca 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -74,7 +74,6 @@ private slots:
void slotUpdateConf();
void slotLoadProgress(int);
void slotUpdateStatusbar(const QString &string);
- void slotUpdateActions();
void slotUpdateWindowTitle(const QString &title = QString());
void slotOpenLocation();
void slotAboutToShowBackMenu();
@@ -118,11 +117,7 @@ private:
FindBar *m_findBar;
KMenu *m_historyBackMenu;
KMenu *m_windowMenu;
- KAction *m_stopReloadAction;
- KAction *m_stopAction;
- KAction *m_reloadAction;
- KAction *m_historyBackAction;
- KAction *m_historyForwardAction;
+ QAction *m_stopReload;
QString m_lastSearch;
QString m_homePage;
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index 3c15bcf5..c0b05e6a 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -37,7 +37,6 @@
// KDE Includes
#include <KMessageBox>
#include <KDebug>
-#include <KStandardDirs>
// Qt Includes
#include <QDialog>
diff --git a/src/rekonqui.rc b/src/rekonqui.rc
index babf2c62..332e04fe 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="31">
<MenuBar>
@@ -8,17 +8,17 @@
<Menu name="file" noMerge="1"><text>&amp;File</text>
<Action name="file_new" />
<Action name="file_open" />
- <Action name="open_location" />
+ <Action name="open location" />
<Separator/>
- <Action name="new_tab" />
- <Action name="close_tab" />
+ <Action name="new tab" />
+ <Action name="close tab" />
<Separator/>
<Action name="file_save_as" />
<Separator/>
<Action name="file_print_preview" />
<Action name="file_print" />
<Separator/>
- <Action name="private_browsing" />
+ <Action name="private browsing" />
<Separator/>
<Action name="file_quit" />
</Menu>
@@ -39,14 +39,14 @@
<!-- ============ VIEW menu =========== -->
<Menu name="view" noMerge="1"><text>&amp;View</text>
- <Action name="stop_reload" />
+ <Action name="stop reload" />
<Action name="go_home" />
<Separator/>
- <Action name="bigger_font" />
- <Action name="normal_font" />
- <Action name="smaller_font" />
+ <Action name="bigger font" />
+ <Action name="normal font" />
+ <Action name="smaller font" />
<Separator/>
- <Action name="page_source" />
+ <Action name="page source" />
</Menu>
<!-- ============ GO menu =========== -->
@@ -59,7 +59,7 @@
<!-- ============ TOOLS menu =========== -->
<Menu name="tools">
<Action name="downloads" />
- <Action name="web_inspector" />
+ <Action name="web inspector" />
</Menu>
<!-- ============ SETTINGS menu =========== -->
@@ -69,9 +69,9 @@
<!-- ============ Main ToolBar =========== -->
<ToolBar name="mainToolBar" fullWidth="true" 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="history back" />
+ <Action name="history forward" />
+ <Action name="stop reload" />
<Action name="go_home" />
</ToolBar>
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index cf3a1988..43940f7d 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -50,14 +50,6 @@ TabBar::TabBar(QWidget *parent)
setAcceptDrops(true);
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &)));
- // we count to 9 because Ctrl+0 is already taken by Normal Font
- for (int i = 1; i < 10; ++i)
- {
- QShortcut *tabShortCut = new QShortcut(QString("Ctrl+%1").arg(i), this);
- connect(tabShortCut, SIGNAL(activated()), this, SLOT(selectTabAction()));
- m_tabShortcuts.append(tabShortCut);
- }
-
QFont standardFont = KGlobalSettings::generalFont();
QString fontFamily = standardFont.family();
int dim = standardFont.pointSize();
@@ -72,25 +64,16 @@ TabBar::~TabBar()
QSize TabBar::tabSizeHint(int index) const
{
+ Q_UNUSED(index);
QSize s = m_parent->sizeHint();
int w;
-
- int n = count();
-
- if(n > 6)
+ if (count() > 3)
{
- w = s.width() / 5;
+ w = s.width() / 4;
}
else
{
- if (n > 3)
- {
- w = s.width() / 4;
- }
- else
- {
- w = s.width() / 3;
- }
+ w = s.width() / 3;
}
int h = KTabBar::tabSizeHint(index).height();
@@ -98,22 +81,22 @@ QSize TabBar::tabSizeHint(int index) const
return ts;
}
-
+
void TabBar::selectTabAction()
{
if (QShortcut *shortCut = qobject_cast<QShortcut*>(sender()))
{
int index = m_tabShortcuts.indexOf(shortCut);
- if (index != 0)
- {
- setCurrentIndex(index);
- }
+ if (index == 0)
+ index = 10;
+ setCurrentIndex(index);
}
}
void TabBar::contextMenuRequested(const QPoint &position)
{
+ // FIXME: use right actions
KMenu menu;
menu.addAction(i18n("New &Tab"), this, SIGNAL(newTab()), QKeySequence::AddTab);
int index = tabAt(position);