[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:19:20 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=ee2298a
The following commit has been merged in the master branch:
commit ee2298a965fe5cd9457d02735a9b22106a657eb0
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date: Wed Jun 1 17:15:22 2011 +0200
ADD: keyboard shortcuts for next and previous tab switching
BUG: 272473
REVIEW: 101479
Reviewed by: David Edmundson
---
app/chat-window.cpp | 30 ++++++++++++++++++++++++++++++
app/chat-window.h | 2 ++
2 files changed, 32 insertions(+)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 149608d..00c6bf9 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -55,6 +55,18 @@ ChatWindow::ChatWindow()
KStandardAction::findNext(this, SLOT(onFindNextText()), actionCollection())->setEnabled(false);
KStandardAction::findPrev(this, SLOT(onFindPreviousText()), actionCollection())->setEnabled(false);
+ KAction *nextTabAction = new KAction(KIcon("go-next-view"), i18n("&Next Tab"), this);
+ nextTabAction->setShortcuts(KStandardShortcut::tabNext());
+ connect(nextTabAction, SIGNAL(triggered()), this, SLOT(onNextTabActionToggled()));
+
+ KAction *previousTabAction = new KAction(KIcon("go-previous-view"), i18n("&Previous Tab"), this);
+ previousTabAction->setShortcuts(KStandardShortcut::tabPrev());
+ connect(previousTabAction, SIGNAL(triggered()), this, SLOT(onPreviousTabActionToggled()));
+
+ // add custom actions to the collection
+ actionCollection()->addAction("next-tab", nextTabAction);
+ actionCollection()->addAction("previous-tab", previousTabAction);
+
// set up m_tabWidget
m_tabWidget = new KTabWidget(this);
m_tabWidget->setTabReorderingEnabled(true);
@@ -209,6 +221,24 @@ void ChatWindow::onFindPreviousText()
currChat->chatSearchBar()->onPreviousButtonClicked();
}
+void ChatWindow::onNextTabActionToggled()
+{
+ int currIndex = m_tabWidget->currentIndex();
+
+ if (currIndex < m_tabWidget->count() && m_tabWidget->count() != 1) {
+ m_tabWidget->setCurrentIndex(++currIndex);
+ }
+}
+
+void ChatWindow::onPreviousTabActionToggled()
+{
+ int currIndex = m_tabWidget->currentIndex();
+
+ if (currIndex > 0) {
+ m_tabWidget->setCurrentIndex(--currIndex);
+ }
+}
+
void ChatWindow::onSearchActionToggled()
{
ChatTab *currChat = qobject_cast<ChatTab*>(m_tabWidget->currentWidget());
diff --git a/app/chat-window.h b/app/chat-window.h
index f9c07da..010eea2 100644
--- a/app/chat-window.h
+++ b/app/chat-window.h
@@ -56,6 +56,8 @@ private slots:
void onEnableSearchActions(bool enable); /** enables/disables menu search actions */
void onFindNextText(); /** go to next text the user is searching for */
void onFindPreviousText(); /** go to previous text the user is searching for */
+ void onNextTabActionToggled(); /** go to next tab in the tabwidget */
+ void onPreviousTabActionToggled(); /** go to previous tab in the tabwidget */
void onSearchActionToggled(); /** toggle search bar visibility */
void onTabStateChanged();
void onTabTextChanged(const QString &newTitle);
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list