From kde-devel Fri May 31 17:55:18 2002 From: Raffaele Sandrini Date: Fri, 31 May 2002 17:55:18 +0000 To: kde-devel Subject: [PATCH] need an advice X-MARC-Message: https://marc.info/?l=kde-devel&m=102286783717966 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_6SLZEE0RF0Y10W7N732B" --------------Boundary-00=_6SLZEE0RF0Y10W7N732B Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit 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 --------------Boundary-00=_6SLZEE0RF0Y10W7N732B Content-Type: text/x-diff; charset="us-ascii"; name="desktopfileeditor.cpp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="desktopfileeditor.cpp.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 #include #include +#include #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); --------------Boundary-00=_6SLZEE0RF0Y10W7N732B-- >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<