diff options
author | Darrell Anderson <[email protected]> | 2013-03-02 21:09:16 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2013-03-02 21:09:16 -0600 |
commit | 33b2e52215d0733158fb32153c7d3b3ff2fa18d2 (patch) | |
tree | f7e7235d1f8c5990e4bd5f75bbd82e19681429dc | |
parent | 7255491dc1f581f57c8eeda25d411f4ecd6856f0 (diff) | |
download | tdebase-33b2e52215d0733158fb32153c7d3b3ff2fa18d2.tar.gz tdebase-33b2e52215d0733158fb32153c7d3b3ff2fa18d2.zip |
Update tab popup context menu to include Move Tab Left/Right options.
Work is needed to disable the respective Move Tab Left/Right menu options
when the tab is already the left-most/right-most tab.
This partially resolves bug report 1067.
-rw-r--r-- | konqueror/konq_tabs.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/konqueror/konq_tabs.cc b/konqueror/konq_tabs.cc index 1bf5115c0..252f80f3d 100644 --- a/konqueror/konq_tabs.cc +++ b/konqueror/konq_tabs.cc @@ -52,6 +52,8 @@ #define BREAKOFF_ID 5 #define CLOSETAB_ID 6 #define OTHERTABS_ID 7 +#define MOVE_LEFT_ID 8 +#define MOVE_RIGHT_ID 9 //################################################################### @@ -103,6 +105,19 @@ KonqFrameTabs::KonqFrameTabs(TQWidget* parent, KonqFrameContainerBase* parentCon m_pViewManager->mainWindow()->action("breakoffcurrenttab")->shortcut(), BREAKOFF_ID ); m_pPopupMenu->insertSeparator(); + m_pPopupMenu->insertItem( SmallIconSet( "tab_move_left" ), + i18n("Move Tab &Left"), + m_pViewManager->mainWindow(), + TQT_SLOT( slotMoveTabLeft() ), + m_pViewManager->mainWindow()->action("tab_move_left")->shortcut(), + MOVE_LEFT_ID ); + m_pPopupMenu->insertItem( SmallIconSet( "tab_move_right" ), + i18n("Move Tab &Right"), + m_pViewManager->mainWindow(), + TQT_SLOT( slotMoveTabRight() ), + m_pViewManager->mainWindow()->action("tab_move_right")->shortcut(), + MOVE_RIGHT_ID ); + m_pPopupMenu->insertSeparator(); m_pSubPopupMenuTab = new TQPopupMenu( this ); m_pPopupMenu->insertItem( i18n("Other Tabs" ), m_pSubPopupMenuTab, OTHERTABS_ID ); connect( m_pSubPopupMenuTab, TQT_SIGNAL( activated ( int ) ), @@ -364,10 +379,16 @@ void KonqFrameTabs::slotContextMenu( const TQPoint &p ) m_pPopupMenu->setItemEnabled( RELOAD_ID, false ); m_pPopupMenu->setItemEnabled( DUPLICATE_ID, false ); m_pPopupMenu->setItemEnabled( BREAKOFF_ID, false ); + m_pPopupMenu->setItemEnabled( MOVE_LEFT_ID, false ); + // The following line fails to build. Adapted from konq_mainwindow.cc: 4243. Help! + // m_pPopupMenu->setItemEnabled( MOVE_LEFT_ID, m_pViewManager->mainWindow()->currentView() ? m_pViewManager->mainWindow()->currentView()->frame()!=(TQApplication::reverseLayout() ? childFrameList->last() : childFrameList->first()) : false ); + m_pPopupMenu->setItemEnabled( MOVE_RIGHT_ID, false ); + // The following line fails to build. Adapted from konq_mainwindow.cc: 4245. Help! + // m_pPopupMenu->setItemEnabled( MOVE_RIGHT_ID, m_pViewManager->mainWindow()->currentView() ? m_pViewManager->mainWindow()->currentView()->frame()!=(TQApplication::reverseLayout() ? childFrameList->first() : childFrameList->last()) : false ); m_pPopupMenu->setItemEnabled( CLOSETAB_ID, false ); m_pPopupMenu->setItemEnabled( OTHERTABS_ID, true ); m_pSubPopupMenuTab->setItemEnabled( m_closeOtherTabsId, false ); - + m_pPopupMenu->exec( p ); } @@ -379,6 +400,8 @@ void KonqFrameTabs::slotContextMenu( TQWidget *w, const TQPoint &p ) m_pPopupMenu->setItemEnabled( RELOAD_ID, true ); m_pPopupMenu->setItemEnabled( DUPLICATE_ID, true ); m_pPopupMenu->setItemEnabled( BREAKOFF_ID, tabCount>1 ); + m_pPopupMenu->setItemEnabled( MOVE_LEFT_ID, tabCount>1 ); + m_pPopupMenu->setItemEnabled( MOVE_RIGHT_ID, tabCount>1 ); m_pPopupMenu->setItemEnabled( CLOSETAB_ID, tabCount>1 ); m_pPopupMenu->setItemEnabled( OTHERTABS_ID, tabCount>1 ); m_pSubPopupMenuTab->setItemEnabled( m_closeOtherTabsId, true ); @@ -520,6 +543,8 @@ void KonqFrameTabs::hideTabBar() setTabBarHidden(true); } m_pPopupMenu->setItemEnabled( BREAKOFF_ID, false ); + m_pPopupMenu->setItemEnabled( MOVE_LEFT_ID, false ); + m_pPopupMenu->setItemEnabled( MOVE_RIGHT_ID, false ); m_pPopupMenu->setItemEnabled( CLOSETAB_ID, false ); } |