kexi

messageaction.cpp
1/***************************************************************************
2 * This file is part of the KDE project
3 * copyright (C) 2006 by Sebastian Sauer (mail@dipe.org)
4 * copyright (C) 2006 by Bernd Steindorff (bernd@itii.de)
5 * copyright (C) 2006 by Sascha Kupper (kusato@kfnv.de)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this program; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 ***************************************************************************/
20
21#include "messageaction.h"
22
23#include <core/keximainwindow.h>
24
25#include <tdelocale.h>
26#include <tdemessagebox.h>
27#include <kdebug.h>
28
29using namespace KexiMacro;
30
32 : KexiAction("message", i18n("Message"))
33{
34 setVariable("caption", i18n("Caption"), TQString(""));
35 setVariable("message", i18n("Message"), TQString(""));
36}
37
41
42void MessageAction::activate(TDESharedPtr<KoMacro::Context> context)
43{
44 kdDebug() << "MessageAction::activate(TDESharedPtr<Context>)" << endl;
45 const TQString caption = context->variable("caption")->variant().toString();
46 const TQString message = context->variable("message")->variant().toString();
47 KMessageBox::information(mainWin(), message, caption);
48}
49
50//#include "messageaction.moc"
KexiMainWindow * mainWin() const
KexiAction(const TQString &name, const TQString &text)
Constructor.
virtual ~MessageAction()
Destructor.
virtual void activate(TDESharedPtr< KoMacro::Context > context)
Called if the Action should be executed within the defined.
void setVariable(TDESharedPtr< Variable > variable)
Append the Variable variable to list of variables this Action provides.
Definition action.cpp:145