diff options
| author | 2008-09-16 11:43:31 +0000 | |
|---|---|---|
| committer | 2008-09-16 11:43:31 +0000 | |
| commit | f4da8086b4ab698510290f92aa679a305a537a27 (patch) | |
| tree | 22a91b1dcb8f71c78ea364bfbcc5a42f545abbbe /src/modules/tip | |
| parent | windowlist: fixed background color under win32 (diff) | |
| download | KVIrc-f4da8086b4ab698510290f92aa679a305a537a27.tar.gz KVIrc-f4da8086b4ab698510290f92aa679a305a537a27.tar.bz2 KVIrc-f4da8086b4ab698510290f92aa679a305a537a27.zip | |
pop in some EOL and svn properties fixes.
- all textfiles were converted to unix line endings
- svn:eol-style native has been set on that files so noone has to care about it again, now the svn client does take care of that, a checkout on unix will get unix lineendings, a checkout on windows will get windows lineendings
- svn:executable fixup (some file had the executable bit set were they shouldn't)
- svn:mime-type fixes for most of the files, which will probaly only affect trac in viewing that files
- some typo fixup, the manpage seems to need some love, though.
this will be pushed to the branches once i get to it today.
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2469 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/tip')
| -rw-r--r-- | src/modules/tip/libkvitip.cpp | 610 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/modules/tip/tip.vcproj | 0 | ||||
| -rw-r--r-- | src/modules/tip/tip_QT4_vc05.vcproj | 506 |
3 files changed, 558 insertions, 558 deletions
diff --git a/src/modules/tip/libkvitip.cpp b/src/modules/tip/libkvitip.cpp index 3fb817ed2..b718c93b0 100644 --- a/src/modules/tip/libkvitip.cpp +++ b/src/modules/tip/libkvitip.cpp @@ -1,305 +1,305 @@ -//
-// File : libkvitip.cpp
-// Creation date : Thu May 10 2001 13:50:11 CEST by Szymon Stefanek
-//
-// This file is part of the KVirc irc client distribution
-// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)
-//
-// This program is FREE software. You can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your opinion) any later version.
-//
-// This program is distributed in the HOPE that it will be USEFUL,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-// See the GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, write to the Free Software Foundation,
-// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//
-
-#include "libkvitip.h"
-
-#include "kvi_module.h"
-#include "kvi_locale.h"
-#include "kvi_app.h"
-#include "kvi_iconmanager.h"
-#include "kvi_options.h"
-#include "kvi_fileutils.h"
-
-#include <QPushButton>
-#include <QFont>
-#include <QTextCodec>
-#include <QPainter>
-#include <QDesktopWidget>
-#include <QCloseEvent>
-#include <QTextDocument>
-
-
-KviTipWindow * g_pTipWindow = 0;
-
-#define KVI_TIP_WINDOW_HEIGHT 200
-#define KVI_TIP_WINDOW_WIDTH 500
-#define KVI_TIP_WINDOW_BUTTON_WIDTH 80
-#define KVI_TIP_WINDOW_BUTTON_HEIGHT 30
-#define KVI_TIP_WINDOW_BORDER 5
-#define KVI_TIP_WINDOW_DOUBLE_BORDER 10
-#define KVI_TIP_WINDOW_SPACING 2
-
-
-KviTipFrame::KviTipFrame(QWidget * par)
-: QFrame(par)
-{
- m_pText=0;
- QString buffer;
- g_pApp->findImage(buffer,"kvi_tip.png");
- m_pTipPixmap = new QPixmap(buffer);
- setFrameStyle(QFrame::Sunken | QFrame::WinPanel);
-}
-
-KviTipFrame::~KviTipFrame()
-{
- if (m_pText) delete m_pText;
- delete m_pTipPixmap;
-}
-
-void KviTipFrame::setText(const QString &text)
-{
- QString szText= "<center><font color=\"#FFFFFF\">";
- szText += text;
- szText += "</font></center>";
- if (m_pText) delete m_pText;
- m_pText = new QTextDocument();
- QFont f = font();
- f.setStyleHint(QFont::SansSerif);
- f.setPointSize(12);
- m_pText->setHtml(szText);
- m_pText->setDefaultFont(f);
- update();
-}
-
-void KviTipFrame::paintEvent(QPaintEvent *e)
-{
- QPainter p(this);
- SET_ANTI_ALIASING(p);
- p.fillRect(contentsRect(),QColor(0,0,0));
- p.drawPixmap(5,(height() - m_pTipPixmap->height()) / 2,*m_pTipPixmap);
-
- int www = width() - m_pTipPixmap->width();
- p.translate(m_pTipPixmap->width(),5);
- m_pText->setPageSize(QSizeF(www,height() /2));
- m_pText->drawContents(&p);
-
-}
-
-KviTipWindow::KviTipWindow()
-{
- setObjectName("kvirc_tip_window");
- /*,WStyle_Customize | WStyle_Title | WStyle_DialogBorder | WStyle_StaysOnTop*/
- m_pConfig = 0;
-
- m_pTipFrame = new KviTipFrame(this);
- m_pTipFrame->setGeometry(
- KVI_TIP_WINDOW_BORDER,
- KVI_TIP_WINDOW_BORDER,
- KVI_TIP_WINDOW_WIDTH - KVI_TIP_WINDOW_DOUBLE_BORDER,
- KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_DOUBLE_BORDER + KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_SPACING));
-
- QPushButton * pb = new QPushButton(">>",this);
- pb->setGeometry(
- KVI_TIP_WINDOW_WIDTH - ((KVI_TIP_WINDOW_BUTTON_WIDTH * 2)+ KVI_TIP_WINDOW_BORDER + KVI_TIP_WINDOW_SPACING),
- KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER),
- KVI_TIP_WINDOW_BUTTON_WIDTH,
- KVI_TIP_WINDOW_BUTTON_HEIGHT
- );
- connect(pb,SIGNAL(clicked()),this,SLOT(nextTip()));
-
- pb = new QPushButton(__tr2qs("Close"),this);
- pb->setGeometry(
- KVI_TIP_WINDOW_WIDTH - (KVI_TIP_WINDOW_BUTTON_WIDTH + KVI_TIP_WINDOW_BORDER),
- KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER),
- KVI_TIP_WINDOW_BUTTON_WIDTH,
- KVI_TIP_WINDOW_BUTTON_HEIGHT
- );
- connect(pb,SIGNAL(clicked()),this,SLOT(close()));
- pb->setDefault(true);
-
- m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show at startup"),this);
- m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup));
- m_pShowAtStartupCheck->setGeometry(
- KVI_TIP_WINDOW_BORDER,
- KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER),
- KVI_TIP_WINDOW_WIDTH - ((KVI_TIP_WINDOW_BORDER + KVI_TIP_WINDOW_BUTTON_WIDTH + KVI_TIP_WINDOW_SPACING) * 2),
- KVI_TIP_WINDOW_BUTTON_HEIGHT
- );
-
- setFixedSize(KVI_TIP_WINDOW_WIDTH,KVI_TIP_WINDOW_HEIGHT);
-
- setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IDEA)));
-
- setWindowTitle(__tr2qs("Did you know..."));
-
- pb->setFocus();
-
-}
-
-KviTipWindow::~KviTipWindow()
-{
- KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup) = m_pShowAtStartupCheck->isChecked();
- if(m_pConfig)closeConfig();
-}
-
-bool KviTipWindow::openConfig(QString filename,bool bEnsureExists)
-{
- if(m_pConfig)closeConfig();
-
- m_szConfigFileName = filename;
-// m_szConfigFileName.cutToLast('/');
-
- QString buffer;
- g_pApp->getReadOnlyConfigPath(buffer,m_szConfigFileName.toUtf8().data(),KviApp::ConfigPlugins,true);
- debug("Check path %s and file %s",buffer.toUtf8().data(),m_szConfigFileName.toUtf8().data());
- if(bEnsureExists)
- {
- if(!KviFileUtils::fileExists(buffer))return false;
- }
-
- m_pConfig = new KviConfig(buffer,KviConfig::Read);
-
- return true;
-}
-
-void KviTipWindow::closeConfig()
-{
- QString buffer;
- g_pApp->getLocalKvircDirectory(buffer,KviApp::ConfigPlugins,m_szConfigFileName);
- m_pConfig->setSavePath(buffer);
- delete m_pConfig;
- m_pConfig = 0;
-}
-
-void KviTipWindow::nextTip()
-{
- if(!m_pConfig)
- {
- KviStr szLocale = KviLocale::localeName();
- KviStr szFile;
- szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr());
- if(!openConfig(szFile.ptr(),true))
- {
- szLocale.cutFromFirst('.');
- szLocale.cutFromFirst('_');
- szLocale.cutFromFirst('@');
- szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr());
- if(!openConfig(szFile.ptr(),true))
- {
- openConfig("libkvitip.kvc",false);
- }
- }
- }
-
- unsigned int uNumTips = m_pConfig->readUIntEntry("uNumTips",0);
- unsigned int uNextTip = m_pConfig->readUIntEntry("uNextTip",0);
-
-
- KviStr tmp(KviStr::Format,"%u",uNextTip);
- QString szTip = m_pConfig->readEntry(tmp.ptr(),__tr2qs("<b>Can't find any tip... :(</b>"));
-
- //qDebug("REDECODED=%s",szTip.toUtf8().data());
-
- uNextTip++;
- if(uNextTip >= uNumTips)uNextTip = 0;
- m_pConfig->writeEntry("uNextTip",uNextTip);
-
- m_pTipFrame->setText(szTip);
-}
-
-void KviTipWindow::showEvent(QShowEvent *e)
-{
- resize(KVI_TIP_WINDOW_WIDTH,KVI_TIP_WINDOW_HEIGHT);
- move((g_pApp->desktop()->width() - KVI_TIP_WINDOW_WIDTH) / 2,
- (g_pApp->desktop()->height() - KVI_TIP_WINDOW_HEIGHT) / 2);
- QWidget::showEvent(e);
-}
-
-void KviTipWindow::closeEvent(QCloseEvent *e)
-{
- e->ignore();
- delete this;
- g_pTipWindow = 0;
-}
-
-/*
- @doc: tip.open
- @type:
- command
- @title:
- tip.open
- @short:
- Opens the "did you know..." tip window
- @syntax:
- tip.open [tip_file_name:string]
- @description:
- Opens the "did you know..." tip window.<br>
- If <tip_file_name> is specified , that tip is used instead of
- the default tips provided with kvirc.<br>
- <tip_file_name> must be a file name with no path and must refer to a
- standard KVIrc configuration file found in the global or local
- KVIrc plugin configuration directory ($KVIrcDir/config/modules).<br>
- Once the window has been opened, the next tip avaiable in the config file is shown.<br>
- This command works even if the tip window is already opened.<br>
-*/
-
-static bool tip_kvs_cmd_open(KviKvsModuleCommandCall * c)
-{
- QString szTipfilename;
- KVSM_PARAMETERS_BEGIN(c)
- KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szTipfilename)
- KVSM_PARAMETERS_END(c)
-
- if(!g_pTipWindow)g_pTipWindow = new KviTipWindow();
- bool error=false;
- if (!szTipfilename.isEmpty()){
- debug("Loading config tip");
- error=g_pTipWindow->openConfig(szTipfilename);
- if (!error) debug ("Not opened");
- else debug("Opened");
- }
- g_pTipWindow->nextTip();
- g_pTipWindow->show();
- return true;
-}
-
-static bool tip_module_init(KviModule *m)
-{
- KVSM_REGISTER_SIMPLE_COMMAND(m,"open",tip_kvs_cmd_open);
- return true;
-}
-
-static bool tip_module_cleanup(KviModule *m)
-{
- if(g_pTipWindow)g_pTipWindow->close();
- return true;
-}
-
-static bool tip_module_can_unload(KviModule *m)
-{
- return (g_pTipWindow == 0);
-}
-
-KVIRC_MODULE(
- "Tip", // module name
- "4.0.0", // module version
- "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C)
- "\"Did you know...\" tip",
- tip_module_init,
- tip_module_can_unload,
- 0,
- tip_module_cleanup
-)
-
-#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
-#include "libkvitip.moc"
-#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES
+// +// File : libkvitip.cpp +// Creation date : Thu May 10 2001 13:50:11 CEST by Szymon Stefanek +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) +// +// This program is FREE software. You can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your opinion) any later version. +// +// This program is distributed in the HOPE that it will be USEFUL, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, write to the Free Software Foundation, +// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// + +#include "libkvitip.h" + +#include "kvi_module.h" +#include "kvi_locale.h" +#include "kvi_app.h" +#include "kvi_iconmanager.h" +#include "kvi_options.h" +#include "kvi_fileutils.h" + +#include <QPushButton> +#include <QFont> +#include <QTextCodec> +#include <QPainter> +#include <QDesktopWidget> +#include <QCloseEvent> +#include <QTextDocument> + + +KviTipWindow * g_pTipWindow = 0; + +#define KVI_TIP_WINDOW_HEIGHT 200 +#define KVI_TIP_WINDOW_WIDTH 500 +#define KVI_TIP_WINDOW_BUTTON_WIDTH 80 +#define KVI_TIP_WINDOW_BUTTON_HEIGHT 30 +#define KVI_TIP_WINDOW_BORDER 5 +#define KVI_TIP_WINDOW_DOUBLE_BORDER 10 +#define KVI_TIP_WINDOW_SPACING 2 + + +KviTipFrame::KviTipFrame(QWidget * par) +: QFrame(par) +{ + m_pText=0; + QString buffer; + g_pApp->findImage(buffer,"kvi_tip.png"); + m_pTipPixmap = new QPixmap(buffer); + setFrameStyle(QFrame::Sunken | QFrame::WinPanel); +} + +KviTipFrame::~KviTipFrame() +{ + if (m_pText) delete m_pText; + delete m_pTipPixmap; +} + +void KviTipFrame::setText(const QString &text) +{ + QString szText= "<center><font color=\"#FFFFFF\">"; + szText += text; + szText += "</font></center>"; + if (m_pText) delete m_pText; + m_pText = new QTextDocument(); + QFont f = font(); + f.setStyleHint(QFont::SansSerif); + f.setPointSize(12); + m_pText->setHtml(szText); + m_pText->setDefaultFont(f); + update(); +} + +void KviTipFrame::paintEvent(QPaintEvent *e) +{ + QPainter p(this); + SET_ANTI_ALIASING(p); + p.fillRect(contentsRect(),QColor(0,0,0)); + p.drawPixmap(5,(height() - m_pTipPixmap->height()) / 2,*m_pTipPixmap); + + int www = width() - m_pTipPixmap->width(); + p.translate(m_pTipPixmap->width(),5); + m_pText->setPageSize(QSizeF(www,height() /2)); + m_pText->drawContents(&p); + +} + +KviTipWindow::KviTipWindow() +{ + setObjectName("kvirc_tip_window"); + /*,WStyle_Customize | WStyle_Title | WStyle_DialogBorder | WStyle_StaysOnTop*/ + m_pConfig = 0; + + m_pTipFrame = new KviTipFrame(this); + m_pTipFrame->setGeometry( + KVI_TIP_WINDOW_BORDER, + KVI_TIP_WINDOW_BORDER, + KVI_TIP_WINDOW_WIDTH - KVI_TIP_WINDOW_DOUBLE_BORDER, + KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_DOUBLE_BORDER + KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_SPACING)); + + QPushButton * pb = new QPushButton(">>",this); + pb->setGeometry( + KVI_TIP_WINDOW_WIDTH - ((KVI_TIP_WINDOW_BUTTON_WIDTH * 2)+ KVI_TIP_WINDOW_BORDER + KVI_TIP_WINDOW_SPACING), + KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER), + KVI_TIP_WINDOW_BUTTON_WIDTH, + KVI_TIP_WINDOW_BUTTON_HEIGHT + ); + connect(pb,SIGNAL(clicked()),this,SLOT(nextTip())); + + pb = new QPushButton(__tr2qs("Close"),this); + pb->setGeometry( + KVI_TIP_WINDOW_WIDTH - (KVI_TIP_WINDOW_BUTTON_WIDTH + KVI_TIP_WINDOW_BORDER), + KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER), + KVI_TIP_WINDOW_BUTTON_WIDTH, + KVI_TIP_WINDOW_BUTTON_HEIGHT + ); + connect(pb,SIGNAL(clicked()),this,SLOT(close())); + pb->setDefault(true); + + m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show at startup"),this); + m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup)); + m_pShowAtStartupCheck->setGeometry( + KVI_TIP_WINDOW_BORDER, + KVI_TIP_WINDOW_HEIGHT - (KVI_TIP_WINDOW_BUTTON_HEIGHT + KVI_TIP_WINDOW_BORDER), + KVI_TIP_WINDOW_WIDTH - ((KVI_TIP_WINDOW_BORDER + KVI_TIP_WINDOW_BUTTON_WIDTH + KVI_TIP_WINDOW_SPACING) * 2), + KVI_TIP_WINDOW_BUTTON_HEIGHT + ); + + setFixedSize(KVI_TIP_WINDOW_WIDTH,KVI_TIP_WINDOW_HEIGHT); + + setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_IDEA))); + + setWindowTitle(__tr2qs("Did you know...")); + + pb->setFocus(); + +} + +KviTipWindow::~KviTipWindow() +{ + KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup) = m_pShowAtStartupCheck->isChecked(); + if(m_pConfig)closeConfig(); +} + +bool KviTipWindow::openConfig(QString filename,bool bEnsureExists) +{ + if(m_pConfig)closeConfig(); + + m_szConfigFileName = filename; +// m_szConfigFileName.cutToLast('/'); + + QString buffer; + g_pApp->getReadOnlyConfigPath(buffer,m_szConfigFileName.toUtf8().data(),KviApp::ConfigPlugins,true); + debug("Check path %s and file %s",buffer.toUtf8().data(),m_szConfigFileName.toUtf8().data()); + if(bEnsureExists) + { + if(!KviFileUtils::fileExists(buffer))return false; + } + + m_pConfig = new KviConfig(buffer,KviConfig::Read); + + return true; +} + +void KviTipWindow::closeConfig() +{ + QString buffer; + g_pApp->getLocalKvircDirectory(buffer,KviApp::ConfigPlugins,m_szConfigFileName); + m_pConfig->setSavePath(buffer); + delete m_pConfig; + m_pConfig = 0; +} + +void KviTipWindow::nextTip() +{ + if(!m_pConfig) + { + KviStr szLocale = KviLocale::localeName(); + KviStr szFile; + szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr()); + if(!openConfig(szFile.ptr(),true)) + { + szLocale.cutFromFirst('.'); + szLocale.cutFromFirst('_'); + szLocale.cutFromFirst('@'); + szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr()); + if(!openConfig(szFile.ptr(),true)) + { + openConfig("libkvitip.kvc",false); + } + } + } + + unsigned int uNumTips = m_pConfig->readUIntEntry("uNumTips",0); + unsigned int uNextTip = m_pConfig->readUIntEntry("uNextTip",0); + + + KviStr tmp(KviStr::Format,"%u",uNextTip); + QString szTip = m_pConfig->readEntry(tmp.ptr(),__tr2qs("<b>Can't find any tip... :(</b>")); + + //qDebug("REDECODED=%s",szTip.toUtf8().data()); + + uNextTip++; + if(uNextTip >= uNumTips)uNextTip = 0; + m_pConfig->writeEntry("uNextTip",uNextTip); + + m_pTipFrame->setText(szTip); +} + +void KviTipWindow::showEvent(QShowEvent *e) +{ + resize(KVI_TIP_WINDOW_WIDTH,KVI_TIP_WINDOW_HEIGHT); + move((g_pApp->desktop()->width() - KVI_TIP_WINDOW_WIDTH) / 2, + (g_pApp->desktop()->height() - KVI_TIP_WINDOW_HEIGHT) / 2); + QWidget::showEvent(e); +} + +void KviTipWindow::closeEvent(QCloseEvent *e) +{ + e->ignore(); + delete this; + g_pTipWindow = 0; +} + +/* + @doc: tip.open + @type: + command + @title: + tip.open + @short: + Opens the "did you know..." tip window + @syntax: + tip.open [tip_file_name:string] + @description: + Opens the "did you know..." tip window.<br> + If <tip_file_name> is specified , that tip is used instead of + the default tips provided with kvirc.<br> + <tip_file_name> must be a file name with no path and must refer to a + standard KVIrc configuration file found in the global or local + KVIrc plugin configuration directory ($KVIrcDir/config/modules).<br> + Once the window has been opened, the next tip avaiable in the config file is shown.<br> + This command works even if the tip window is already opened.<br> +*/ + +static bool tip_kvs_cmd_open(KviKvsModuleCommandCall * c) +{ + QString szTipfilename; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szTipfilename) + KVSM_PARAMETERS_END(c) + + if(!g_pTipWindow)g_pTipWindow = new KviTipWindow(); + bool error=false; + if (!szTipfilename.isEmpty()){ + debug("Loading config tip"); + error=g_pTipWindow->openConfig(szTipfilename); + if (!error) debug ("Not opened"); + else debug("Opened"); + } + g_pTipWindow->nextTip(); + g_pTipWindow->show(); + return true; +} + +static bool tip_module_init(KviModule *m) +{ + KVSM_REGISTER_SIMPLE_COMMAND(m,"open",tip_kvs_cmd_open); + return true; +} + +static bool tip_module_cleanup(KviModule *m) +{ + if(g_pTipWindow)g_pTipWindow->close(); + return true; +} + +static bool tip_module_can_unload(KviModule *m) +{ + return (g_pTipWindow == 0); +} + +KVIRC_MODULE( + "Tip", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "\"Did you know...\" tip", + tip_module_init, + tip_module_can_unload, + 0, + tip_module_cleanup +) + +#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES +#include "libkvitip.moc" +#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES diff --git a/src/modules/tip/tip.vcproj b/src/modules/tip/tip.vcproj index acc51d096..acc51d096 100755..100644 --- a/src/modules/tip/tip.vcproj +++ b/src/modules/tip/tip.vcproj diff --git a/src/modules/tip/tip_QT4_vc05.vcproj b/src/modules/tip/tip_QT4_vc05.vcproj index 4ed70381d..308dfc60b 100644 --- a/src/modules/tip/tip_QT4_vc05.vcproj +++ b/src/modules/tip/tip_QT4_vc05.vcproj @@ -1,253 +1,253 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="tip"
- ProjectGUID="{EB28029D-5A2E-4BC5-B855-22F460294E57}"
- RootNamespace="tip"
- Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)\win32build\bin\modules\"
- IntermediateDirectory="Debug"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib kvilib.lib kvirc.lib"
- OutputFile="$(OutDir)/kvi$(ProjectName).dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)""
- GenerateManifest="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/tip.pdb"
- SubSystem="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TurnOffAssemblyGeneration="true"
- ImportLibrary="$(OutDir)/tip.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest"
- EmbedManifest="true"
- VerboseOutput="true"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)\win32build\bin\modules"
- IntermediateDirectory="Release"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="1"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- EnableFiberSafeOptimizations="true"
- WholeProgramOptimization="true"
- AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
- StringPooling="true"
- MinimalRebuild="true"
- ExceptionHandling="1"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qtmain.lib kvilib.lib kvirc.lib qt3support4.lib qtcore4.lib qtgui4.lib"
- OutputFile="$(OutDir)/kvi$(ProjectName).dll"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)""
- GenerateManifest="true"
- IgnoreAllDefaultLibraries="false"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- LinkTimeCodeGeneration="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TurnOffAssemblyGeneration="true"
- ImportLibrary="$(OutDir)/tip.lib"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest"
- EmbedManifest="false"
- VerboseOutput="true"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\libkvitip.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\libkvitip.h"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)"
"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)"
"
- Outputs="$(InputDir)\$(InputName).moc"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="tip" + ProjectGUID="{EB28029D-5A2E-4BC5-B855-22F460294E57}" + RootNamespace="tip" + Keyword="Win32Proj" + TargetFrameworkVersion="131072" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules\" + IntermediateDirectory="Debug" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TIP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="false" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qt3support4.lib qtcore4.lib qtgui4.lib qtmain.lib kvilib.lib kvirc.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="2" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" + GenerateManifest="true" + GenerateDebugInformation="true" + ProgramDatabaseFile="$(OutDir)/tip.pdb" + SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TurnOffAssemblyGeneration="true" + ImportLibrary="$(OutDir)/tip.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" + EmbedManifest="true" + VerboseOutput="true" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)\win32build\bin\modules" + IntermediateDirectory="Release" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="1" + InlineFunctionExpansion="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + OmitFramePointers="true" + EnableFiberSafeOptimizations="true" + WholeProgramOptimization="true" + AdditionalIncludeDirectories=""$(ProjectDir)\..\..\kvilib\tal";"$(ProjectDir)\..\..\kvilib\system";"$(ProjectDir)\..\..\kvilib\irc";"$(ProjectDir)\..\..\kvilib\file";"$(ProjectDir)\..\..\kvilib\ext";"$(ProjectDir)\..\..\kvilib\net";"$(ProjectDir)\..\..\kvilib\core\wstring";"$(ProjectDir)\..\..\kvilib\core";"$(ProjectDir)\..\..\kvilib\config";"$(SSLINCDIR)";"$(QTDIR)\include";"$(ProjectDir)\..\..\kvirc\kvs";"$(ProjectDir)\..\..\kvirc\module";"$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar";"$(ProjectDir)\..\..\kvirc\uparser";"$(ProjectDir)\..\..\kvirc\sparser";"$(ProjectDir)\..\..\kvirc\kernel";"$(ProjectDir)\..\..\kvirc\ui";"$(QTDIR)\include\Qt3Support";"$(QTDIR)\include\QtCore\";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtNetwork";"$(QTDIR)\include\QtXml";" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TIP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;" + StringPooling="true" + MinimalRebuild="true" + ExceptionHandling="1" + RuntimeLibrary="2" + UsePrecompiledHeader="0" + WarningLevel="3" + Detect64BitPortabilityProblems="false" + DebugInformationFormat="0" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="qtmain.lib kvilib.lib kvirc.lib qt3support4.lib qtcore4.lib qtgui4.lib" + OutputFile="$(OutDir)/kvi$(ProjectName).dll" + LinkIncremental="1" + AdditionalLibraryDirectories=""$(SSLLIBDIR)";"$(PERLDIR)\lib\CORE";"$(QTDIR)\lib";"$(SolutionDir)\win32build\bin";"$(ZLIBLIBDIR)"" + GenerateManifest="true" + IgnoreAllDefaultLibraries="false" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + OptimizeForWindows98="1" + LinkTimeCodeGeneration="1" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" + TurnOffAssemblyGeneration="true" + ImportLibrary="$(OutDir)/tip.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + AdditionalManifestFiles="$(SolutionDir)/data/manifests/commctrl.manifest" + EmbedManifest="false" + VerboseOutput="true" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\libkvitip.cpp" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath=".\libkvitip.h" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCustomBuildTool" + CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)"
" + Outputs="$(InputDir)\$(InputName).moc" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCustomBuildTool" + CommandLine="$(QTDIR)\bin\moc -o "$(InputDir)\$(InputName).moc" "$(InputDir)\$(InputFileName)"
" + Outputs="$(InputDir)\$(InputName).moc" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> |
