Changeset 47

Show
Ignore:
Timestamp:
09/10/06 19:07:41 (2 years ago)
Author:
dmik
Message:

Psi: TabDlg?: Fixed: ChatDlg::closeEvent() result (accepted or rejected) is now obeyed when chats are in the tabbed mode.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psi/trunk/src/tabdlg.cpp

    r18 r47  
    201201} 
    202202 
    203 void TabDlg::closeChat(ChatDlg* chat, bool doclose=true) 
    204 
    205         chat->hide(); 
     203bool TabDlg::closeChat(ChatDlg* chat, bool doclose=true) 
     204
     205        if (doclose) { 
     206                if (!chat->close()) 
     207                        return false;  
     208        } else { 
     209                chat->hide(); 
     210        } 
    206211        disconnect ( chat, SIGNAL( captionChanged( ChatDlg*) ), this, SLOT( updateTab( ChatDlg* ) ) ); 
    207212        disconnect ( chat, SIGNAL( contactIsComposing(ChatDlg*, bool) ), this, SLOT( setTabComposing( ChatDlg*, bool) ) ); 
     
    212217        chats.remove(chat); 
    213218        chat->reparent(0,QPoint()); 
    214         if (doclose) 
    215                 chat->close(); 
    216219        if (tabs->count()>0) 
    217220                updateCaption(); 
    218221        checkHasChats(); 
     222        return true; 
    219223} 
    220224 
     
    275279        int count=tabs->count(); 
    276280        for (int i=0;i<count;++i) { 
    277                 closeChat(); 
     281                if (!closeChat((ChatDlg*)(tabs->currentPage()))) 
     282                        return; 
    278283        } 
    279284} 
  • psi/trunk/src/tabdlg.h

    r2 r47  
    7272        void addChat(ChatDlg *chat); 
    7373        void setLooks(); 
    74         void closeChat(ChatDlg*,bool); 
     74        bool closeChat(ChatDlg*,bool); 
    7575        void selectTab(ChatDlg*); 
    7676        void activated();