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

List:       kde-devel
Subject:    [PATCH] need an advice
From:       Raffaele Sandrini <sandrini () kde ! org>
Date:       2002-05-31 17:55:18
[Download RAW message or body]

Hi

Here is a patch atached wich adds a Messagebox to Kmenuedit if data is changed 
but not saved. The problem is that if the messagebox is closed again i have 
the item on the left side on the cursor like i would move or copy it. How can 
i disable this or send a signal to the list wich drops the drang and drop 
there?

cheers,
Raffaele
-- 
Raffaele Sandrini <sandrini@kde.org>
["desktopfileeditor.cpp.diff" (text/x-diff)]

Index: desktopfileeditor.cpp
===================================================================
RCS file: /home/kde/kdebase/kmenuedit/desktopfileeditor.cpp,v
retrieving revision 1.6
diff -u -3 -p -r1.6 desktopfileeditor.cpp
--- desktopfileeditor.cpp	2001/06/07 14:26:30	1.6
+++ desktopfileeditor.cpp	2002/05/31 17:50:39
@@ -22,6 +22,7 @@
 #include <klocale.h>
 #include <kglobal.h>
 #include <kseparator.h>
+#include <kmessagebox.h>
 
 #include "basictab.h"
 #include "desktopfileeditor.h"
@@ -58,6 +59,18 @@ DesktopFileEditor::DesktopFileEditor( QW
 
 void DesktopFileEditor::setDesktopFile(const QString& desktopFile)
 {
+		if (_desktopFileNeedsSave){
+			switch (KMessageBox::warningYesNoCancel(0, i18n("There are unsaved changes in the \
active item.\nDo you want to apply the changes or forget them?"), i18n("Unsaved \
changes"), i18n("&Apply"), i18n("&Discard"))) { +				case 3:
+					slotApply();
+					break;
+				case 2:
+					return;
+					break;
+				default:
+					break;
+			}
+		}
     _basicTab->setDesktopFile(desktopFile);
     _apply->setEnabled(false);
     _reset->setEnabled(false);


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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