summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-03-16 15:45:45 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-03-16 15:45:45 +0100
commit84a93ab8a47c8e4546ae658b5400623cdccfe237 (patch)
treea320e2ba559bc5a4696e882cbc9e11796a4e1ab5
parentAdded some warning (diff)
downloadrekonq-84a93ab8a47c8e4546ae658b5400623cdccfe237.tar.xz
updated rekonq site
fixed tab actions.. really near rekonq 0.0.4! Perhaps this night!!
-rw-r--r--CMakeLists.txt7
-rw-r--r--rekonq.SlackBuild2
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainview.cpp4
-rw-r--r--src/tabbar.cpp61
-rw-r--r--src/tabbar.h10
6 files changed, 34 insertions, 52 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eea4c3e4..bb256387 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ PROJECT( rekonq )
# ===============================================================================================
# Informations to update before to release this package.
-# rekonq version
+# rekonq info
SET(REKONQ_MAJOR_VERSION "0")
SET(REKONQ_MINOR_VERSION "0")
SET(REKONQ_PATCH_VERSION "4")
@@ -15,6 +15,8 @@ SET(REKONQ_VERSION_STR
"${REKONQ_MAJOR_VERSION}.${REKONQ_MINOR_VERSION}.${REKONQ_PATCH_VERSION}"
)
+SET(REKONQ_SITE "http://rekonq.sourceforge.net")
+
# =================================================================================================
# minimum cmake required
@@ -37,8 +39,7 @@ INCLUDE(MacroLibrary)
MESSAGE(STATUS "")
MESSAGE(STATUS "----------------------------------------------------------------------------------")
-MESSAGE(STATUS " rekonq ${REKONQ_VERSION_STR} dependencies results <http://rekonq.adjam.org>")
-MESSAGE(STATUS "")
+MESSAGE(STATUS " rekonq ${REKONQ_VERSION_STR} dependencies results <${REKONQ_SITE}>")
# Require shared libraries results.
diff --git a/rekonq.SlackBuild b/rekonq.SlackBuild
index 000314ee..1ea4877a 100644
--- a/rekonq.SlackBuild
+++ b/rekonq.SlackBuild
@@ -4,7 +4,7 @@
# Written by Andrea Diamantini - adjam7_AT_gmail_DOT_com
NAME=rekonq
-VERSION=0.0.3
+VERSION=0.0.4
ARCH=${ARCH:-i486}
BUILD=1ad
diff --git a/src/main.cpp b/src/main.cpp
index a97bb0d5..5315a1d2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,7 +40,7 @@ int main(int argc, char **argv)
KAboutData::License_GPL,
ki18n("(C) 2008 Andrea Diamantini"),
KLocalizedString(),
- "http://rekonq.adjam.org",
+ "http://rekonq.soourceforge.net",
"adjam7@gmail.com"
);
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 9e23ae2d..d7e07e14 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -39,6 +39,7 @@
#include <KStandardShortcut>
#include <KMessageBox>
#include <KActionCollection>
+#include <KDebug>
// Qt Includes
#include <QtCore>
@@ -55,7 +56,7 @@ MainView::MainView(QWidget *parent)
, m_lineEdits(new QStackedWidget(this))
, m_tabBar(new TabBar(this))
{
- setElideMode(Qt::ElideRight);
+ setTabBar(m_tabBar);
connect(m_tabBar, SIGNAL(newTab()), this, SLOT(newTab()));
connect(m_tabBar, SIGNAL(closeTab(int)), this, SLOT(closeTab(int)));
@@ -64,7 +65,6 @@ MainView::MainView(QWidget *parent)
connect(m_tabBar, SIGNAL(reloadTab(int)), this, SLOT(reloadTab(int)));
connect(m_tabBar, SIGNAL(reloadAllTabs()), this, SLOT(reloadAllTabs()));
connect(m_tabBar, SIGNAL(tabMoveRequested(int, int)), this, SLOT(moveTab(int, int)));
- setTabBar(m_tabBar);
// Recently Closed Tab Action
m_recentlyClosedTabsMenu = new KMenu(this);
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index c28a390c..8f648f28 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -34,6 +34,7 @@
#include <KStandardShortcut>
#include <KMessageBox>
#include <KAction>
+#include <KDebug>
// Qt Includes
#include <QtGui>
@@ -48,18 +49,19 @@ TabBar::TabBar(QWidget *parent)
setAcceptDrops(true);
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contextMenuRequested(const QPoint &)));
- QString alt = QLatin1String("Alt+%1");
- for (int i = 1; i <= 10; ++i)
- {
- int key = i;
- if (key == 10)
- {
- key = 0;
- }
- QShortcut *shortCut = new QShortcut(alt.arg(key), this);
- m_tabShortcuts.append(shortCut);
- connect(shortCut, SIGNAL(activated()), this, SLOT(selectTabAction()));
- }
+// FIXME: not sure we need this..
+// QString alt = QLatin1String("Alt+%1");
+// for (int i = 1; i <= 10; ++i)
+// {
+// int key = i;
+// if (key == 10)
+// {
+// key = 0;
+// }
+// QShortcut *shortCut = new QShortcut(alt.arg(key), this);
+// m_tabShortcuts.append(shortCut);
+// connect(shortCut, SIGNAL(activated()), this, SLOT(selectTabAction()));
+// }
}
@@ -88,21 +90,14 @@ void TabBar::contextMenuRequested(const QPoint &position)
int index = tabAt(position);
if (-1 != index)
{
- KAction *action = (KAction * ) menu.addAction(i18n("Clone Tab"), this, SLOT(cloneTab()));
- action->setData(index);
+ m_actualIndex = index;
+ KAction *action = (KAction * ) menu.addAction(i18n("Clone Tab"), this, SLOT(cloneTab()));
menu.addSeparator();
-
action = (KAction * ) menu.addAction(i18n("&Close Tab"), this, SLOT(closeTab()), QKeySequence::Close);
- action->setData(index);
-
action = (KAction * ) menu.addAction(i18n("Close &Other Tabs"), this, SLOT(closeOtherTabs()));
- action->setData(index);
-
menu.addSeparator();
-
action = (KAction * ) menu.addAction(i18n("Reload Tab"), this, SLOT(reloadTab()), QKeySequence::Refresh);
- action->setData(index);
}
else
{
@@ -115,31 +110,19 @@ void TabBar::contextMenuRequested(const QPoint &position)
void TabBar::cloneTab()
{
- if (KAction *action = qobject_cast<KAction*>(sender()))
- {
- int index = action->data().toInt();
- emit cloneTab(index);
- }
+ emit cloneTab(m_actualIndex);
}
void TabBar::closeTab()
{
- if (KAction *action = qobject_cast<KAction*>(sender()))
- {
- int index = action->data().toInt();
- emit closeTab(index);
- }
+ emit closeTab(m_actualIndex);
}
void TabBar::closeOtherTabs()
{
- if (KAction *action = qobject_cast<KAction*>(sender()))
- {
- int index = action->data().toInt();
- emit closeOtherTabs(index);
- }
+ emit closeOtherTabs(m_actualIndex);
}
@@ -199,10 +182,6 @@ void TabBar::dropEvent(QDropEvent *event)
void TabBar::reloadTab()
{
- if (KAction *action = qobject_cast<KAction*>(sender()))
- {
- int index = action->data().toInt();
- emit reloadTab(index);
- }
+ emit reloadTab(m_actualIndex);
}
diff --git a/src/tabbar.h b/src/tabbar.h
index 0692fcd6..0dbdd004 100644
--- a/src/tabbar.h
+++ b/src/tabbar.h
@@ -36,6 +36,11 @@ class TabBar : public KTabBar
{
Q_OBJECT
+
+public:
+ TabBar(QWidget *parent = 0);
+ ~TabBar();
+
signals:
void newTab();
void cloneTab(int index);
@@ -45,10 +50,6 @@ signals:
void reloadAllTabs();
void tabMoveRequested(int fromIndex, int toIndex);
-public:
- TabBar(QWidget *parent = 0);
- ~TabBar();
-
protected:
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
@@ -69,6 +70,7 @@ private:
QPoint m_dragStartPos;
int m_dragCurrentIndex;
+ int m_actualIndex; // the index in which we are seeing a Context menu
};
#endif