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

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/protocols/jabber/googletalk
From:       Pali Rohár <pali.rohar () gmail ! com>
Date:       2013-05-19 9:07:13
Message-ID: 20130519090713.A77A7AC85D () svn ! kde ! org
[Download RAW message or body]

SVN commit 1355444 by pali:

Correctly handle window manager close button on Google Talk Call Dialog


 M  +9 -0      googletalk.cpp  
 M  +5 -0      googletalk.h  
 M  +7 -0      googletalkcalldialog.cpp  
 M  +14 -0     googletalkcalldialog.h  


--- trunk/KDE/kdenetwork/kopete/protocols/jabber/googletalk/googletalk.cpp #1355443:1355444
@@ -64,6 +64,7 @@
 	connect( callDialog->acceptButton, SIGNAL(pressed()), this, SLOT(acceptCall()) );
 	connect( callDialog->hangupButton, SIGNAL(pressed()), this, SLOT(hangupCall()) );
 	connect( callDialog->rejectButton, SIGNAL(pressed()), this, SLOT(rejectCall()) );
+	connect( callDialog, SIGNAL(closed()), this, SLOT(cancelCall()) );
 
 }
 
@@ -434,6 +435,14 @@
 
 }
 
+void GoogleTalk::cancelCall() {
+
+//	qDebug() << "GoogleTalk::cancelCall";
+	hangupCall();
+	rejectCall();
+
+}
+
 void GoogleTalk::muteCall(bool b) {
 
 //	qDebug() << "GoogleTalk::muteCall";
--- trunk/KDE/kdenetwork/kopete/protocols/jabber/googletalk/googletalk.h #1355443:1355444
@@ -111,6 +111,11 @@
 		void hangupCall();
 
 		/**
+		 * Call both hangupCall() and rejectCall()
+		 */
+		void cancelCall();
+
+		/**
 		 * Mute or unmute active call
 		 * @param b true for mute, false for unmute
 		 */
--- trunk/KDE/kdenetwork/kopete/protocols/jabber/googletalk/googletalkcalldialog.cpp #1355443:1355444
@@ -13,11 +13,18 @@
     *************************************************************************
 */
 
+#include <QCloseEvent>
+
 #include "googletalkcalldialog.h"
 
 GoogleTalkCallDialog::GoogleTalkCallDialog(QWidget *parent): QDialog(parent) {
 	setupUi(this);
 }
 
+void GoogleTalkCallDialog::closeEvent(QCloseEvent * e) {
+	e->ignore();
+	emit(closed());
+}
+
 #include "googletalkcalldialog.moc"
 
--- trunk/KDE/kdenetwork/kopete/protocols/jabber/googletalk/googletalkcalldialog.h #1355443:1355444
@@ -18,6 +18,8 @@
 
 #include "ui_googletalkcalldialog.h"
 
+class QCloseEvent;
+
 /**
  * @author Pali Rohár
  * @short Dialog for voice call
@@ -37,6 +39,18 @@
 		 */
 		GoogleTalkCallDialog(QWidget *parent = 0);
 
+	protected:
+
+		/**
+		 * Reimplement close event
+		 * Do not close and do not delete this call dialog, but emit signal closed()
+		 */
+		virtual void closeEvent(QCloseEvent * e);
+
+	signals:
+
+		void closed();
+
 };
 
 #endif // GoogleTalkCallDialog_H
[prev in list] [next in list] [prev in thread] [next in thread] 

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