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

List:       kde-commits
Subject:    kdewebdev/quanta/utility
From:       Andras Mantia <amantia () kde ! org>
Date:       2004-07-12 17:36:36
Message-ID: 20040712173636.7598116B08 () office ! kde ! org
[Download RAW message or body]

CVS commit by amantia: 

List the affected files in the body of the mail.
Warn about the action execution.


  M +27 -4     qpevents.cpp   1.3


--- kdewebdev/quanta/utility/qpevents.cpp  #1.2:1.3
@@ -44,4 +44,14 @@ void QPEvents::slotEventHappened(const Q
   if (events && events->contains(name))
   {
+    EventAction ev = (*events)[name];
+    if (ev.type == EventAction::Internal)
+    {
+       if (KMessageBox::warningYesNo(0L, i18n("<qt>An  internal action (<i>%1</i>) \
associated with an event (<i>%2</i>) will be executed.  Do you want to allow the \
execution?</qt>").arg(ev.action).arg(name), i18n("Event Triggered"), i18n("&Allow"), \
KStdGuiItem::no(), "warn_about_internal_actions") == KMessageBox::No) +         \
return; +    } else
+    {
+       if (KMessageBox::warningYesNo(0L, i18n("<qt>An  external action (<i>%1</i>) \
associated with an event (<i>%2</i>) will be executed.  Do you want to allow the \
execution?</qt>").arg(ev.action).arg(name), i18n("Event Triggered"), i18n("&Allow"), \
KStdGuiItem::no(), "warn_about_external_actions") == KMessageBox::No) +         \
return; +    }
     if (name == "after_save")
     {
@@ -49,6 +59,16 @@ void QPEvents::slotEventHappened(const Q
         if (w && Project::ref()->contains(w->url()))
         {
-          EventAction ev = (*events)[name];
-          ev.arguments << i18n("The file %1 was \
saved").arg(QExtFileInfo::toRelative(w->url(), \
Project::ref()->projectBaseURL()).path()); +          ev.arguments << i18n("Document \
saved"); +          ev.arguments << QExtFileInfo::toRelative(w->url(), \
Project::ref()->projectBaseURL()).path(); +          handleEvent(ev);
+        }
+     } else
+     if (name == "before_save")
+     {
+        Document *w = ViewManager::ref()->activeDocument();
+        if (w && Project::ref()->contains(w->url()))
+        {
+          ev.arguments << i18n("About to save");
+          ev.arguments << QExtFileInfo::toRelative(w->url(), \
Project::ref()->projectBaseURL()).path();  handleEvent(ev);
         }
@@ -59,5 +79,4 @@ void QPEvents::slotEventHappened(const Q
 bool QPEvents::handleEvent(const EventAction& ev)
 {
-  return true;
   if (ev.type == EventAction::Internal)
   {
@@ -73,5 +92,9 @@ bool QPEvents::handleEvent(const EventAc
          member = Project::ref()->taskLeader(receiver.remove("taskleader-"));
 
-       kapp->invokeMailer(member.name + "<" + member.email + ">", ev.arguments[1], \
""); +       QString body;
+       for (uint i = 2; i < ev.arguments.count(); i++)
+          body += ev.arguments[i] + "\n";
+       kapp->invokeMailer(member.name + "<" + member.email + ">", "", "", \
ev.arguments[1], body, "", QStringList(), ""); +
        return true;
     } else


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

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