aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Elvio Basello2008-04-08 00:54:25 +0000
committerGravatar Elvio Basello2008-04-08 00:54:25 +0000
commitaa923fe89c8fe5c1d5d024b4a1c06236c36ab8f6 (patch)
tree54cfa8986455612f9fb056e11c07e1a6c10d3041
parentquick fix (diff)
downloadKVIrc-aa923fe89c8fe5c1d5d024b4a1c06236c36ab8f6.tar.gz
KVIrc-aa923fe89c8fe5c1d5d024b4a1c06236c36ab8f6.tar.bz2
KVIrc-aa923fe89c8fe5c1d5d024b4a1c06236c36ab8f6.zip
code clean and fixes
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1422 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--TODO-Qt43
-rw-r--r--src/kvirc/CMakeLists.txt2
-rw-r--r--src/kvirc/ui/kvi_styled_controls.cpp61
-rw-r--r--src/kvirc/ui/kvi_styled_controls.h23
-rw-r--r--src/modules/addon/libkviaddon.cpp14
-rw-r--r--src/modules/addon/managementdialog.cpp12
-rw-r--r--src/modules/addon/managementdialog.h21
-rw-r--r--src/modules/regchan/libkviregchan.cpp18
8 files changed, 68 insertions, 86 deletions
diff --git a/TODO-Qt4 b/TODO-Qt4
index abb50a339..dfbe692ae 100644
--- a/TODO-Qt4
+++ b/TODO-Qt4
@@ -81,9 +81,8 @@ src/modules
notifier
objects
options
+ reguser - q3support in dialog.*
- regchan
- reguser
setup
theme
diff --git a/src/kvirc/CMakeLists.txt b/src/kvirc/CMakeLists.txt
index b7e36a9d2..ae0209d6f 100644
--- a/src/kvirc/CMakeLists.txt
+++ b/src/kvirc/CMakeLists.txt
@@ -54,7 +54,7 @@ SET(kvirc_MOC_HDRS
ui/kvi_splash.h
ui/kvi_statusbar.h
ui/kvi_statusbarapplet.h
- #ui/kvi_styled_controls.h
+ ui/kvi_styled_controls.h
ui/kvi_taskbar.h
ui/kvi_texticonwin.h
ui/kvi_themedlabel.h
diff --git a/src/kvirc/ui/kvi_styled_controls.cpp b/src/kvirc/ui/kvi_styled_controls.cpp
index e250c11c6..cfe51fb68 100644
--- a/src/kvirc/ui/kvi_styled_controls.cpp
+++ b/src/kvirc/ui/kvi_styled_controls.cpp
@@ -26,20 +26,18 @@
#define __KVIRC__
#include "kvi_styled_controls.h"
-
-#ifndef COMPILE_USE_QT4
-
#include "kvi_iconmanager.h"
#include "kvi_app.h"
#include "kvi_options.h"
#include "kvi_doublebuffer.h"
#include "kvi_tal_toolbar.h"
-#include <qcheckbox.h>
-#include <qpainter.h>
-#include <qimage.h>
-#include <qevent.h>
-#include <qtimer.h>
+#include <QCheckBox>
+#include <QPainter>
+#include <QImage>
+#include <QEvent>
+#include <QTimer>
+#include <QPaintEvent>
KviStyledControlInternal::KviStyledControlInternal( KviStyledControl* control)
@@ -145,14 +143,14 @@ void KviStyledControl::leaveEvent ( QEvent * )
KviStyledCheckBox::KviStyledCheckBox ( QWidget * parent, const char * name )
: QCheckBox(parent,name), KviStyledControl(this)
{
- setWFlags(WNoAutoErase);
+ //setWFlags(WNoAutoErase);
}
KviStyledCheckBox::KviStyledCheckBox ( const QString & text, QWidget * parent, const char * name )
: QCheckBox(text,parent,name), KviStyledControl(this)
{
- setWFlags(WNoAutoErase);
+ //setWFlags(WNoAutoErase);
}
KviStyledCheckBox::~KviStyledCheckBox()
@@ -160,7 +158,6 @@ KviStyledCheckBox::~KviStyledCheckBox()
}
-
void KviStyledCheckBox::paintEvent ( QPaintEvent * event)
{
//debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber);
@@ -170,9 +167,11 @@ void KviStyledCheckBox::paintEvent ( QPaintEvent * event)
QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
QRect rect=event->rect();
- pDoubleBufferPixmap->fill(this, rect.topLeft());
+ //pDoubleBufferPixmap->fill(this, rect.topLeft());
- QPainter p(pDoubleBufferPixmap, this);
+ QPainter p( this);
+ //p.drawRect(rect.topLeft());
+ //pDoubleBufferPixmap,
p.translate(-rect.x(), -rect.y());
QPixmap* pStoredPix = 0;
@@ -225,7 +224,7 @@ void KviStyledCheckBox::paintEvent ( QPaintEvent * event)
QString szText=text();
szText=szText.remove("&");
p.drawText(pix.width()+3,0,width(),height(),0,szText);
- bitBlt(this, rect.x(), rect.y(), pDoubleBufferPixmap, 0, 0, rect.width(), rect.height());
+ // bitBlt(this, rect.x(), rect.y(), pDoubleBufferPixmap, 0, 0, rect.width(), rect.height());
//debug("%s %s %i %i %i",__FILE__,__FUNCTION__,__LINE__,m_bMouseEnter,m_iStepNumber);
} else {
QCheckBox::paintEvent(event);
@@ -237,14 +236,14 @@ void KviStyledCheckBox::paintEvent ( QPaintEvent * event)
KviStyledToolButton::KviStyledToolButton( QWidget * parent, const char * name )
: QToolButton(parent,name), KviStyledControl(this), bShowSubmenuIndicator(false)
{
- setWFlags(WNoAutoErase);
+ //setWFlags(WNoAutoErase);
resizeEvent(0);
}
KviStyledToolButton::KviStyledToolButton ( const QIconSet & iconSet, const QString & textLabel, const QString & grouptext, QObject * receiver, const char * slot, KviTalToolBar * parent, const char * name )
: QToolButton(iconSet,textLabel,grouptext,receiver,slot,parent,name), KviStyledControl(this), bShowSubmenuIndicator(false)
{
- setWFlags(WNoAutoErase);
+// setWFlags(WNoAutoErase);
resizeEvent(0);
}
@@ -272,26 +271,32 @@ void KviStyledToolButton::paintEvent ( QPaintEvent * event)
iPixWidth=pArrowPix->width();
}
bool bActive= isOn() || m_bMouseEnter;
- KviDoubleBuffer doublebuffer(event->rect().width(),event->rect().height());
- QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
+ //KviDoubleBuffer doublebuffer(event->rect().width(),event->rect().height());
+ //QPixmap * pDoubleBufferPixmap = doublebuffer.pixmap();
QRect rect=event->rect();
- pDoubleBufferPixmap->fill(
+ /*pDoubleBufferPixmap->fill(
bActive ? QColor(206,215,223) :
colorGroup().background()
);
-
-
- QPainter p(pDoubleBufferPixmap, this);
- p.translate(-rect.x(), -rect.y());
-
+ */
+ QPainter p(this);
+ p.setPen(bActive ? QColor(206,215,223) :
+ colorGroup().background()
+ );
+ p.setBrush(bActive ? QColor(206,215,223) :
+ colorGroup().background()
+ );
+
+ p.drawRect(event->rect());
if(bActive)
{
p.setPen(QColor(185,190,195));
p.drawRect(0,0,iWidth,height());
}
-
+
+ p.translate(-rect.x(), -rect.y());
QPixmap pix=iconSet().pixmap(
usesBigPixmap() ? QIconSet::Large : QIconSet::Small,
isEnabled() ? QIconSet::Normal :
@@ -345,7 +350,7 @@ void KviStyledToolButton::paintEvent ( QPaintEvent * event)
p.drawPixmap(pos,*pArrowPix);
}
- bitBlt(this, rect.x(), rect.y(), pDoubleBufferPixmap, 0, 0, rect.width(), rect.height());
+ // bitBlt(this, rect.x(), rect.y(), pDoubleBufferPixmap, 0, 0, rect.width(), rect.height());
} else {
QToolButton::paintEvent(event);
@@ -368,6 +373,6 @@ void KviStyledToolButton::resizeEvent ( QResizeEvent * e)
}
}
+#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
#include "kvi_styled_controls.moc"
-
-#endif
+#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES
diff --git a/src/kvirc/ui/kvi_styled_controls.h b/src/kvirc/ui/kvi_styled_controls.h
index b2bdf599f..fb185b5e8 100644
--- a/src/kvirc/ui/kvi_styled_controls.h
+++ b/src/kvirc/ui/kvi_styled_controls.h
@@ -26,29 +26,20 @@
///////////////////////////////////////////////////////////////////////////////
#include "kvi_settings.h"
-
-#ifdef COMPILE_USE_QT4
- // we use internal Qt4 styles for now
- #include <qcheckbox.h>
- #include <qtoolbutton.h>
-
- #define KviStyledCheckBox QCheckBox
- #define KviStyledToolButton QToolButton
-#else
-
-#include <qcheckbox.h>
-#include <qtoolbutton.h>
-#include <qevent.h>
-#include <qtimer.h>
#include "kvi_heapobject.h"
+#include <QCheckBox>
+#include <QToolButton>
+#include <QEvent>
+#include <QTimer>
+
+class KviStyledControl;
class KviTalToolBar;
#define KVI_STYLE_NUM_STEPS 20
#define KVI_STYLE_COLOR_DIFF 60
#define KVI_STYLE_TIMER_STEP 18
-class KviStyledControl;
class KVIRC_API KviStyledControlInternal : public QObject
{
@@ -109,5 +100,3 @@ protected:
};
#endif
-
-#endif
diff --git a/src/modules/addon/libkviaddon.cpp b/src/modules/addon/libkviaddon.cpp
index 04157ded9..c96e06793 100644
--- a/src/modules/addon/libkviaddon.cpp
+++ b/src/modules/addon/libkviaddon.cpp
@@ -22,6 +22,8 @@
//
///////////////////////////////////////////////////////////////////////////////
+#include "managementdialog.h"
+
#include "kvi_module.h"
#include "kvi_kvs_scriptaddonmanager.h"
#include "kvi_locale.h"
@@ -37,10 +39,6 @@
#include "kvi_sourcesdate.h"
#include "kvi_miscutils.h"
-#include "managementdialog.h"
-
-
-
QRect g_rectManagementDialogGeometry(0,0,0,0);
/*
@@ -61,7 +59,7 @@ QRect g_rectManagementDialogGeometry(0,0,0,0);
*/
static bool addon_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
-{
+{
QString szId;
QString szVersion;
KVSM_PARAMETERS_BEGIN(c)
@@ -101,7 +99,7 @@ static bool addon_kvs_fnc_exists(KviKvsModuleFunctionCall * c)
*/
static bool addon_kvs_fnc_version(KviKvsModuleFunctionCall * c)
-{
+{
QString szId;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId)
@@ -648,8 +646,8 @@ static bool addon_module_can_unload(KviModule * m)
KVIRC_MODULE(
- "addon", // module name
- "1.0.0", // module version
+ "Addon", // module name
+ "4.0.0", // module version
"Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net)", // author & (C)
"Script management functions for the KVS engine",
addon_module_init,
diff --git a/src/modules/addon/managementdialog.cpp b/src/modules/addon/managementdialog.cpp
index 15f7045ea..3d9905eb1 100644
--- a/src/modules/addon/managementdialog.cpp
+++ b/src/modules/addon/managementdialog.cpp
@@ -30,16 +30,13 @@
#include "kvi_iconmanager.h"
#include "kvi_kvs_scriptaddonmanager.h"
#include "kvi_window.h"
-
#include "kvi_filedialog.h"
#include "kvi_fileutils.h"
#include "kvi_kvs_script.h"
#include "kvi_sourcesdate.h"
-
-#include "kvi_tal_scrollview.h"
#include "kvi_draganddrop.h"
+#include "kvi_tal_scrollview.h"
-#include <Q3Header>
#include <QPainter>
#include <QPixmap>
#include <QMessageBox>
@@ -53,6 +50,9 @@
#include <QLabel>
#include <QFrame>
+// FIXME: Qt4 #include <QHeaderView>
+#include <q3header.h>
+
KviScriptManagementDialog * KviScriptManagementDialog::m_pInstance = 0;
extern QRect g_rectManagementDialogGeometry;
@@ -134,7 +134,10 @@ KviScriptAddonListView::KviScriptAddonListView(QWidget * pParent)
QPixmap * p = g_pIconManager->getImage("kvi_dialog_addons.png");
if(p)setBackgroundOverlayPixmap(p,Qt::AlignRight | Qt::AlignBottom);
setSelectionMode(Single);
+
+ // FIXME: doesn't work in Qt4
header()->hide();
+
int iWidth = visibleWidth();
if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH;
addColumn("",iWidth);
@@ -363,4 +366,3 @@ void KviScriptManagementDialog::closeEvent(QCloseEvent * e)
e->ignore();
delete this;
}
-
diff --git a/src/modules/addon/managementdialog.h b/src/modules/addon/managementdialog.h
index cc6658eb9..cd5aa82da 100644
--- a/src/modules/addon/managementdialog.h
+++ b/src/modules/addon/managementdialog.h
@@ -24,25 +24,20 @@
//
//=============================================================================
-#include <qdialog.h>
-
#include "kvi_listview.h"
#include "kvi_settings.h"
-#include <qwidget.h>
-#include <qlabel.h>
-#include <qdialog.h>
-#include <qcolor.h>
#include "kvi_tal_listview.h"
+#include <QWidget>
+#include <QLabel>
+#include <QDialog>
+#include <QColor>
+#include <QTextDocument>
+
class QPushButton;
class QPixmap;
class KviKvsScriptAddon;
-#ifdef COMPILE_USE_QT4
- #include <QTextDocument>
-#else
- #include <qsimplerichtext.h>
-#endif
class KviScriptAddonListViewItem : public KviTalListViewItem
{
@@ -51,11 +46,7 @@ public:
~KviScriptAddonListViewItem();
protected:
KviKvsScriptAddon * m_pAddon;
-#ifdef COMPILE_USE_QT4
QTextDocument * m_pText;
-#else
- QSimpleRichText * m_pText;
-#endif
QPixmap * m_pIcon;
KviTalListView * m_pListView;
QString m_szKey;
diff --git a/src/modules/regchan/libkviregchan.cpp b/src/modules/regchan/libkviregchan.cpp
index d33d1879d..489605717 100644
--- a/src/modules/regchan/libkviregchan.cpp
+++ b/src/modules/regchan/libkviregchan.cpp
@@ -23,8 +23,6 @@
//======================================================================================
// incomplete
#include "kvi_module.h"
-
-
#include "kvi_regchan.h"
#include "kvi_locale.h"
#include "kvi_out.h"
@@ -66,7 +64,7 @@ extern KVIRC_API KviRegisteredChannelDataBase * g_pRegisteredChannelDataBase;
*/
static bool regchan_kvs_cmd_add(KviKvsModuleCommandCall * c)
-{
+{
QString szChan,szNetmask;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("channel name",KVS_PT_NONEMPTYSTRING,0,szChan)
@@ -105,7 +103,7 @@ static bool regchan_kvs_cmd_add(KviKvsModuleCommandCall * c)
[cmd]regchan.add[/cmd]
*/
static bool regchan_kvs_cmd_remove(KviKvsModuleCommandCall * c)
-{
+{
QString szChan,szNetwork;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("channel name",KVS_PT_NONEMPTYSTRING,0,szChan)
@@ -155,7 +153,7 @@ static bool regchan_kvs_cmd_remove(KviKvsModuleCommandCall * c)
*/
static bool regchan_kvs_cmd_setProperty(KviKvsModuleCommandCall * c)
-{
+{
QString szChan,szNetwork,szProperty,szValue;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("channel name",KVS_PT_NONEMPTYSTRING,0,szChan)
@@ -194,7 +192,7 @@ static bool regchan_kvs_cmd_setProperty(KviKvsModuleCommandCall * c)
*/
static bool regchan_kvs_cmd_showlist(KviKvsModuleCommandCall * c)
-{
+{
c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Registered channel list:"));
int tot = 0;
@@ -243,7 +241,7 @@ static bool regchan_kvs_cmd_showlist(KviKvsModuleCommandCall * c)
*/
static bool regchan_kvs_fnc_list(KviKvsModuleFunctionCall * c)
-{
+{
QString szChan,szNetmask;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("channel name",KVS_PT_STRING,KVS_PF_OPTIONAL,szChan)
@@ -304,7 +302,7 @@ static bool regchan_kvs_fnc_list(KviKvsModuleFunctionCall * c)
*/
static bool regchan_kvs_fnc_property(KviKvsModuleFunctionCall * c)
-{
+{
QString szChan,szNetwork,szPropertyName;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("channel name",KVS_PT_STRING,0,szChan)
@@ -379,7 +377,7 @@ static bool regchan_kvs_fnc_match(KviKvsModuleFunctionCall * c)
*/
static bool regchan_kvs_fnc_find(KviKvsModuleFunctionCall * c)
-{
+{
QString szChan,szNetmask;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("channel name",KVS_PT_STRING,0,szChan)
@@ -416,7 +414,7 @@ static bool regchan_module_can_unload(KviModule *)
KVIRC_MODULE(
"RegChan", // module name
- "1.0.0", // module version
+ "4.0.0", // module version
"Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C)
"Script interface to the registered channels database",
regchan_module_init,