SVN commit 944338 by dinkar:

Added 'Close All Other Tabs' to KopeteChatWindow
FEATURE: 100589
BUG: 100589
GUI: Added A New String.

 M  +22 -0     kopetechatwindow.cpp  
 M  +3 -1      kopetechatwindow.h  
 M  +2 -1      kopetechatwindow.rc  


--- trunk/KDE/kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp 
#944337:944338
@@ -336,6 +336,7 @@
        popup->addAction( actionTabPlacementMenu );
        popup->addAction( tabDetach );
        popup->addAction( actionDetachMenu );
+       popup->addAction( tabCloseAllOthers );
        popup->addAction( tabClose );
        popup->exec( pos );
 
@@ -406,6 +407,11 @@
        tabDetach->setEnabled( false );
        connect( tabDetach, SIGNAL(triggered(bool)), this, SLOT( 
slotDetachChat() ));
 
+       tabCloseAllOthers = new KAction( KIcon("tab-close"), i18n( "Close &All 
But This Tab" ), coll );
+       coll->addAction( "tabs_close_others", tabCloseAllOthers );
+       tabCloseAllOthers->setEnabled( true );
+       connect( tabCloseAllOthers, SIGNAL(triggered(bool)), this, SLOT( 
slotCloseAllOtherTabs() ));
+
        actionDetachMenu = new KActionMenu( KIcon("tab-detach"), i18n( "&Move 
Tab to Window" ), coll );
        coll->addAction( "tabs_detachmove", actionDetachMenu );
        actionDetachMenu->setDelayed( false );
@@ -763,6 +769,7 @@
 void KopeteChatWindow::checkDetachEnable()
 {
        bool haveTabs = (chatViewList.count() > 1);
+       tabCloseAllOthers->setEnabled( haveTabs );
        tabDetach->setEnabled( haveTabs );
        tabLeft->setEnabled( haveTabs );
        tabRight->setEnabled( haveTabs );
@@ -845,6 +852,21 @@
        newWindow->attachChatView( detachedView );
 }
 
+void KopeteChatWindow::slotCloseAllOtherTabs()
+{
+       ChatView *detachedView;
+
+       if( m_popupView )
+               detachedView = m_popupView;
+       else
+               detachedView = m_activeView;
+
+       foreach(ChatView *view, chatViewList) {
+               if (view != detachedView)
+                       view->closeView();
+       }
+}
+
 void KopeteChatWindow::slotPreviousTab()
 {
        int curPage = m_tabBar->currentIndex();
--- trunk/KDE/kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.h 
#944337:944338
@@ -163,7 +163,8 @@
        KAction *tabLeft;
        KAction *tabRight;
        KAction *tabDetach;
-       KAction* tabClose;
+       KAction *tabClose;
+       KAction *tabCloseAllOthers;
 
        KToggleAction* toggleAutoSpellCheck;
 
@@ -215,6 +216,7 @@
        void slotNextActiveTab();
        void slotDetachChat(QAction* = 0);
        void slotPlaceTabs( QAction* );
+       void slotCloseAllOtherTabs();
 
        void slotEnableUpdateBg() { updateBg = true; }
 
--- trunk/KDE/kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.rc 
#944337:944338
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartgui version="44" name="kopetechatwindow">
+<kpartgui version="45" name="kopetechatwindow">
        <MenuBar>
                <Menu noMerge="1" name="file">
                        <text>&amp;Chat</text>
@@ -11,6 +11,7 @@
                        <Action name="contacts_menu"/>
                        <Merge/>
                        <Separator lineSeparator="true"/>
+                       <Action name="tabs_close_others"/>
                        <Action name="tabs_close"/>
                        <Action name="file_quit" />
                </Menu>

Reply via email to