You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
#include "tipofday_part.h"
|
|
|
|
#include <tqcheckbox.h>
|
|
#include <tqpushbutton.h>
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tdeaboutdata.h>
|
|
#include <tdeaction.h>
|
|
#include <tdeapplication.h>
|
|
#include <tdeconfig.h>
|
|
#include <tdevgenericfactory.h>
|
|
#include <tdevplugininfo.h>
|
|
#include <kiconloader.h>
|
|
#include <tdelocale.h>
|
|
#include <kstandarddirs.h>
|
|
#include <ktextbrowser.h>
|
|
#include <ktip.h>
|
|
|
|
#include "tdevapi.h"
|
|
#include "tdevcore.h"
|
|
|
|
static const TDevPluginInfo data("tdevtipofday");
|
|
|
|
typedef TDevGenericFactory<TipOfDayPart> TipOfDayFactory;
|
|
K_EXPORT_COMPONENT_FACTORY( libtdevtipofday, TipOfDayFactory( data ) )
|
|
|
|
TipOfDayPart::TipOfDayPart(TQObject *parent, const char *name, const TQStringList &)
|
|
: TDevPlugin(&data, parent, name ? name : "TipOfDayPart")
|
|
{
|
|
setInstance(TipOfDayFactory::instance());
|
|
|
|
setXMLFile("tdevpart_tipofday.rc");
|
|
|
|
TDEAction *action;
|
|
|
|
action = new TDEAction(i18n("&Tip of the Day"), "idea", 0,
|
|
this, TQT_SLOT(showTip()), actionCollection(), "help_tipofday");
|
|
action->setToolTip(i18n("A tip how to use TDevelop"));
|
|
action->setWhatsThis(i18n("<b>Tip of the day</b><p>"
|
|
"Will display another good tip \n"
|
|
"contributed by KDevelop users."));
|
|
|
|
connect(core(), TQT_SIGNAL(coreInitialized()), this, TQT_SLOT(showOnStart()));
|
|
}
|
|
|
|
|
|
TQString TipOfDayPart::getFilename()
|
|
{
|
|
TDEConfig * config = TDEApplication::kApplication()->config();
|
|
config->setGroup("Tip of day plugin");
|
|
return config->readEntry("TipsFile", "kdevtipofday/tips");
|
|
}
|
|
|
|
void TipOfDayPart::showTip()
|
|
{
|
|
KTipDialog::showTip(getFilename(), true);
|
|
}
|
|
|
|
|
|
void TipOfDayPart::showOnStart()
|
|
{
|
|
KTipDialog::showTip(getFilename());
|
|
}
|
|
|
|
|
|
|
|
#include "tipofday_part.moc"
|