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

List:       kopete-devel
Subject:    [Kopete-devel] Patch for hiding instead of closing
From:       "Henrik \(Mauritz\) Johnson" <henrik () spinbox ! se>
Date:       2002-04-09 13:48:25
[Download RAW message or body]

Henrik (Mauritz) Johnson wrote:

> This patch wil make kopete hide in the systemtray when closing the 
> window instead of exiting. I think this is the behaviour most people 
> would expect. To quit you have to select Quit in the File menu. As 
> before, just give the word and I can commit this to the CVS.
> 
> /Mauritz
> Underscore AB
> 

The Quit command from the systray doesn't work with this patch. I'm not very familiar \
with kaccel and stuff (Mostly a Qt man myself). Perhaps someone can check it out.

/Mauritz
Underscore AB


["kopetehide.patch" (text/plain)]

Index: kopetewindow.cpp
===================================================================
RCS file: /home/kde/kdenonbeta/kopete/kopete/library/ui/kopetewindow.cpp,v
retrieving revision 1.25
diff -u -U5 -r1.25 kopetewindow.cpp
--- kopetewindow.cpp	2002/04/09 04:55:46	1.25
+++ kopetewindow.cpp	2002/04/09 08:09:48
@@ -27,10 +27,11 @@
 #include <qlayout.h>
 
 #include <kconfig.h>
 #include <kdebug.h>
 #include <klocale.h>
+#include <kmessagebox.h>
 #include <kstdaction.h>
 
 KopeteWindow::KopeteWindow(QWidget *parent, const char *name ): \
KMainWindow(parent,name)  {
 	kdDebug() << "[KopeteWindow] KopeteWindow()" << endl;
@@ -215,9 +216,21 @@
 void KopeteWindow::slotExecuted( QListViewItem *item )
 {
 	KopeteContactViewItem *contactvi = dynamic_cast<KopeteContactViewItem *>(item);
 	if ( contactvi )
 		contactvi->contact()->execute();
+}
+
+bool KopeteWindow::close(bool del)
+{
+	KConfig *config = KGlobal::config();
+	if (!config->readBoolEntry("hideOnCloseInfo",false)) {
+		KMessageBox::information(this,i18n("<qt>Closing the main window will keep kopete \
running in the system tray. Use Quit from the File menu to quit the \
application?</qt>"),i18n("Docking in system tray")); \
+		config->writeEntry("hideOnCloseInfo",true); +		config->sync();
+	}
+	hide();
+	return false;
 }
 
 // vim: set noet sw=4 ts=4 sts=4:
 
Index: kopetewindow.h
===================================================================
RCS file: /home/kde/kdenonbeta/kopete/kopete/library/ui/kopetewindow.h,v
retrieving revision 1.13
diff -u -U5 -r1.13 kopetewindow.h
--- kopetewindow.h	2002/04/07 09:17:17	1.13
+++ kopetewindow.h	2002/04/09 08:09:48
@@ -62,10 +62,11 @@
 //	KSelectAction* actionStatus;
 //	KAction* actionHide;
 
 	KopeteSystemTray *tray;
 
+	virtual bool close ( bool del );
 private:
 	void initView ( void );
 	void initActions ( void );
 	void initSystray ( void );
 	bool queryExit(void);


_______________________________________________
Kopete-devel mailing list
Kopete-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kopete-devel

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

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