From 9dc07f24c01c152d23c22cefab50db43fe517e95 Mon Sep 17 00:00:00 2001 From: Nikhil Marathe Date: Mon, 24 May 2010 16:48:49 +0530 Subject: Added actions to switch to Tab #n BUG: 235107 --- src/mainview.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mainview.cpp') diff --git a/src/mainview.cpp b/src/mainview.cpp index 1c36adcf..01f0e1a4 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -657,6 +657,17 @@ void MainView::openClosedTab() } } +void MainView::switchToTab() +{ + // uses the sender to determine the tab index + QAction *sender = static_cast(QObject::sender()); + int index = sender->data().toInt(); + index -= 1; // to compensate for off by 1 presented to the user + if( index < 0 || index >= count() ) + return; + setCurrentIndex( index ); +} + QLabel *MainView::animatedLoading(int index, bool addMovie) { if (index == -1) -- cgit v1.2.1