parts/tipofday/tipofday_part.cpp
Go to the documentation of this file.00001
#include "tipofday_part.h"
00002
00003
#include <qcheckbox.h>
00004
#include <qpushbutton.h>
00005
#include <qwhatsthis.h>
00006
00007
#include <kaboutdata.h>
00008
#include <kaction.h>
00009
#include <kapplication.h>
00010
#include <kconfig.h>
00011
#include <kdevgenericfactory.h>
00012
#include <kiconloader.h>
00013
#include <klocale.h>
00014
#include <kstandarddirs.h>
00015
#include <ktextbrowser.h>
00016
#include <ktip.h>
00017
00018
#include "kdevapi.h"
00019
#include "kdevcore.h"
00020
00021
static const KAboutData data(
"kdevtipofday",
I18N_NOOP(
"A tip how to use KDevelop"),
"1.0");
00022
00023 typedef KDevGenericFactory<TipOfDayPart> TipOfDayFactory;
00024 K_EXPORT_COMPONENT_FACTORY( libkdevtipofday,
TipOfDayFactory( &data ) )
00025
00026
TipOfDayPart::
TipOfDayPart(
QObject *parent, const
char *name, const
QStringList &)
00027 :
KDevPlugin("TopOfDay", "tipofday", parent, name ? name : "
TipOfDayPart")
00028 {
00029 setInstance(TipOfDayFactory::instance());
00030
00031 setXMLFile(
"kdevpart_tipofday.rc");
00032
00033
KAction *action;
00034
00035 action =
new KAction(i18n(
"&Tip of the Day"),
"idea", 0,
00036
this, SLOT(showTip()), actionCollection(),
"help_tipofday");
00037 action->setToolTip(i18n(
"A tip how to use KDevelop"));
00038 action->setWhatsThis(i18n(
"<b>Tip of the day</b><p>"
00039
"Will display another good tip \n"
00040
"contributed by KDevelop users."));
00041
00042 connect(core(), SIGNAL(coreInitialized()),
this, SLOT(showOnStart()));
00043 }
00044
00045
00046 void TipOfDayPart::showTip()
00047 {
00048 KTipDialog::showTip(
"kdevtipofday/tips",
true);
00049 }
00050
00051
00052 void TipOfDayPart::showOnStart()
00053 {
00054 KTipDialog::showTip(
"kdevtipofday/tips");
00055 }
00056
00057
00058
#include "tipofday_part.moc"
This file is part of the documentation for KDevelop Version 3.0.4.