[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Tabbed Browsing usability issue
From:       Randy Pearson <blueboy () bamafolks ! com>
Date:       2002-08-06 20:51:30
[Download RAW message or body]

Final stab at it...

I've modified the patch to include the improvements suggested by Dog and now 
use default keystrokes of CTRL+[ and CTRL+].

I searched my copy of KDE cvs source code and could not find any other 
programs that use of those particular keystroke combinations.

Since the shortcuts can be redefined by the user, if someone objects to those 
keys, they should be able to assign whatever keys they wish.

Anybody care to commit this time around?

Regards,
Randy


["konqtabbing.diff" (text/x-diff)]

Index: konqueror.rc
===================================================================
RCS file: /home/kdecvs/kde/kdebase/konqueror/konqueror.rc,v
retrieving revision 1.100
diff -u -3 -p -r1.100 konqueror.rc
--- konqueror.rc	3 Jul 2002 16:30:07 -0000	1.100
+++ konqueror.rc	6 Aug 2002 21:30:41 -0000
@@ -94,6 +94,8 @@
   <Action name="duplicatecurrenttab"/>
   <Action name="breakoffcurrenttab"/>
   <Action name="removecurrenttab"/>
+  <Action name="activatenexttab"/>
+  <Action name="activateprevtab"/>
   <Separator/>
   <ActionList name="toggleview" />
   <Separator/>
Index: konq_mainwindow.h
===================================================================
RCS file: /home/kdecvs/kde/kdebase/konqueror/konq_mainwindow.h,v
retrieving revision 1.365
diff -u -3 -p -r1.365 konq_mainwindow.h
--- konq_mainwindow.h	29 Jul 2002 17:32:04 -0000	1.365
+++ konq_mainwindow.h	6 Aug 2002 21:30:41 -0000
@@ -379,6 +379,8 @@ protected slots:
   void slotRemoveView();
   void slotRemoveTab();
   void slotRemoveTabPopup();
+  void slotActivateNextTab();
+  void slotActivatePrevTab();
   void slotDumpDebugInfo();
 
   void slotSaveViewProfile();
@@ -535,6 +537,8 @@ private:
   KAction *m_paBreakOffTab;
   KAction *m_paRemoveView;
   KAction *m_paRemoveTab;
+  KAction *m_paActivateNextTab;
+  KAction *m_paActivatePrevTab;
   KAction *m_paDumpDebugInfo;
 
   KAction *m_paSaveRemoveViewProfile;
Index: konq_mainwindow.cc
===================================================================
RCS file: /home/kdecvs/kde/kdebase/konqueror/konq_mainwindow.cc,v
retrieving revision 1.1035
diff -u -3 -p -r1.1035 konq_mainwindow.cc
--- konq_mainwindow.cc	5 Aug 2002 22:52:16 -0000	1.1035
+++ konq_mainwindow.cc	6 Aug 2002 21:30:43 -0000
@@ -2054,6 +2054,16 @@ void KonqMainWindow::slotRemoveTabPopup(
   m_pViewManager->removeTab( m_pWorkingTab );
 }
 
+void KonqMainWindow::slotActivateNextTab()
+{
+  m_pViewManager->activateNextTab();
+}
+
+void KonqMainWindow::slotActivatePrevTab()
+{
+  m_pViewManager->activatePrevTab();
+}
+
 void KonqMainWindow::slotDumpDebugInfo()
 {
 #ifndef NDEBUG
@@ -2891,6 +2901,8 @@ void KonqMainWindow::initActions()
   m_paBreakOffTab = new KAction( i18n( "Break Off Current Tab" ), "tab_breakoff", \
CTRL+SHIFT+Key_B, this, SLOT( slotBreakOffTab() ), actionCollection(), \
"breakoffcurrenttab" );  m_paRemoveView = new KAction( i18n( "&Remove Active View" \
),"view_remove", CTRL+SHIFT+Key_R, this, SLOT( slotRemoveView() ), \
actionCollection(), "removeview" );  m_paRemoveTab = new KAction( i18n( "Remove \
Current Tab" ), "tab_remove", CTRL+SHIFT+Key_W, this, SLOT( slotRemoveTab() ), \
actionCollection(), "removecurrenttab" ); +  m_paActivateNextTab = new KAction( i18n( \
"Activate Next Tab" ), "tab_next", CTRL+Key_BracketRight, this, SLOT( \
slotActivateNextTab() ), actionCollection(), "activatenexttab" ); +  \
m_paActivatePrevTab = new KAction( i18n( "Activate Previous Tab" ), "tab_previous", \
CTRL+Key_BracketLeft, this, SLOT( slotActivatePrevTab() ), actionCollection(), \
"activateprevtab" );  #ifndef NDEBUG
   m_paDumpDebugInfo = new KAction( i18n( "Dump Debug Info" ), \
"view_dump_debug_info", 0, this, SLOT( slotDumpDebugInfo() ), actionCollection(), \
"dumpdebuginfo" );  #endif
@@ -3058,6 +3070,8 @@ void KonqMainWindow::updateViewActions()
     m_paDuplicateTab->setEnabled( false );
     m_paRemoveTab->setEnabled( false );
     m_paBreakOffTab->setEnabled( false );
+    m_paActivateNextTab->setEnabled( false );
+    m_paActivatePrevTab->setEnabled( false );
   }
   else
   {
@@ -3067,11 +3081,15 @@ void KonqMainWindow::updateViewActions()
     {
       m_paRemoveTab->setEnabled( true );
       m_paBreakOffTab->setEnabled( true );
+      m_paActivateNextTab->setEnabled( true );
+      m_paActivatePrevTab->setEnabled( true );
     }
     else
     {
       m_paRemoveTab->setEnabled( false );
       m_paBreakOffTab->setEnabled( false );
+      m_paActivateNextTab->setEnabled( false );
+      m_paActivatePrevTab->setEnabled( false );
     }
   }
 
Index: konq_viewmgr.h
===================================================================
RCS file: /home/kdecvs/kde/kdebase/konqueror/konq_viewmgr.h,v
retrieving revision 1.63
diff -u -3 -p -r1.63 konq_viewmgr.h
--- konq_viewmgr.h	29 Jul 2002 15:27:42 -0000	1.63
+++ konq_viewmgr.h	6 Aug 2002 21:30:44 -0000
@@ -126,6 +126,18 @@ public:
   void removeTab( KonqFrameBase* tab = 0L );
 
   /**
+   * Locates and activates the next tab
+   *
+   */
+  void activateNextTab();
+
+  /**
+   * Locates and activates the previous tab
+   *
+   */
+  void activatePrevTab();
+
+  /**
    * Brings the tab specified by @p view to the front of the stack
    *
    */
Index: konq_viewmgr.cc
===================================================================
RCS file: /home/kdecvs/kde/kdebase/konqueror/konq_viewmgr.cc,v
retrieving revision 1.191
diff -u -3 -p -r1.191 konq_viewmgr.cc
--- konq_viewmgr.cc	29 Jul 2002 15:27:42 -0000	1.191
+++ konq_viewmgr.cc	6 Aug 2002 21:30:44 -0000
@@ -549,6 +549,42 @@ void KonqViewManager::removeTab( KonqFra
 #endif
 }
 
+void KonqViewManager::activateNextTab()
+{
+  if (m_pDocContainer == 0L) return;
+  if (m_pDocContainer->frameType() != "Tabs") return;
+
+  KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(m_pDocContainer);
+  if( tabContainer->count() == 1 ) return;
+  
+  int iTab = tabContainer->currentPageIndex();
+
+  iTab++;
+
+  if( iTab == tabContainer->count() )
+    iTab = 0;
+
+  tabContainer->setCurrentPage( iTab );
+}
+
+void KonqViewManager::activatePrevTab()
+{
+  if (m_pDocContainer == 0L) return;
+  if (m_pDocContainer->frameType() != "Tabs") return;
+
+  KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(m_pDocContainer);
+  if( tabContainer->count() == 1 ) return;
+  
+  int iTab = tabContainer->currentPageIndex();
+
+  iTab--;
+
+  if( iTab == -1 )
+    iTab = tabContainer->count() - 1;
+
+  tabContainer->setCurrentPage( iTab );
+}
+
 void KonqViewManager::showTab( KonqView *view )
 {
   static_cast<KonqFrameTabs*>( docContainer() )->showPage( view->frame() );


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic