diff options
Diffstat (limited to 'kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp')
-rw-r--r-- | kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp b/kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp index 870abd5..6490b7f 100644 --- a/kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp +++ b/kmymoney2/widgets/kmymoneyscheduleddatetbl.cpp @@ -42,13 +42,13 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qpen.h> -#include <qpainter.h> -#include <qdialog.h> -#include <qdrawutil.h> -#include <qcursor.h> -#include <qapplication.h> +#include <tqstring.h> +#include <tqpen.h> +#include <tqpainter.h> +#include <tqdialog.h> +#include <tqdrawutil.h> +#include <tqcursor.h> +#include <tqapplication.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -62,34 +62,34 @@ #include "kmymoneyscheduleddatetbl.h" #include "../mymoney/mymoneyfile.h" -kMyMoneyScheduledDateTbl::kMyMoneyScheduledDateTbl(QWidget *parent, QDate date_, const char* name, WFlags f ) - : kMyMoneyDateTbl(parent, date_, name, f), +kMyMoneyScheduledDateTbl::kMyMoneyScheduledDateTbl(TQWidget *tqparent, TQDate date_, const char* name, WFlags f ) + : kMyMoneyDateTbl(tqparent, date_, name, f), m_filterBills(false), m_filterDeposits(false), m_filterTransfers(false) { - connect(&briefWidget, SIGNAL(enterClicked(const MyMoneySchedule&, const QDate&)), this, SIGNAL(enterClicked(const MyMoneySchedule&, const QDate&))); - connect(&briefWidget, SIGNAL(skipClicked(const MyMoneySchedule&, const QDate&)), this, SIGNAL(skipClicked(const MyMoneySchedule&, const QDate&))); + connect(&briefWidget, TQT_SIGNAL(enterClicked(const MyMoneySchedule&, const TQDate&)), this, TQT_SIGNAL(enterClicked(const MyMoneySchedule&, const TQDate&))); + connect(&briefWidget, TQT_SIGNAL(skipClicked(const MyMoneySchedule&, const TQDate&)), this, TQT_SIGNAL(skipClicked(const MyMoneySchedule&, const TQDate&))); } kMyMoneyScheduledDateTbl::~kMyMoneyScheduledDateTbl() { } -void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, int /*col*/, const QDate& theDate) +void kMyMoneyScheduledDateTbl::drawCellContents(TQPainter *painter, int /*row*/, int /*col*/, const TQDate& theDate) { - QRect rect; - QString text; + TQRect rect; + TQString text; int w=cellWidth(); int h=cellHeight(); - QPen pen; - QBrush brushBlue(KGlobalSettings::activeTitleColor()); - QBrush brushLightblue(KGlobalSettings::baseColor()); - QFont font=KGlobalSettings::generalFont(); + TQPen pen; + TQBrush brushBlue(KGlobalSettings::activeTitleColor()); + TQBrush brushLightblue(KGlobalSettings::baseColor()); + TQFont font=KGlobalSettings::generalFont(); MyMoneyFile *file = MyMoneyFile::instance(); // ----- font.setPointSize(fontsize); - QFont fontLarge(font); - QFont fontSmall(font); + TQFont fontLarge(font); + TQFont fontSmall(font); fontLarge.setPointSize(fontsize*2); fontSmall.setPointSize(fontsize-1); @@ -101,11 +101,11 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, if (theDate.month() != date.month()) { painter->setFont(fontSmall); - pen = lightGray; + pen = TQPen(lightGray); } else { - pen = gray; + pen = TQPen(gray); } if (theDate == date) @@ -114,11 +114,11 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, { // draw the currently selected date painter->setPen(KGlobalSettings::highlightColor()); painter->setBrush(KGlobalSettings::highlightColor()); - pen=white; + pen=TQPen(white); } else { painter->setPen(KGlobalSettings::calculateAlternateBackgroundColor(KGlobalSettings::highlightColor())); painter->setBrush(KGlobalSettings::calculateAlternateBackgroundColor(KGlobalSettings::highlightColor())); - pen=white; + pen=TQPen(white); } } else { painter->setBrush(KGlobalSettings::baseColor()); @@ -126,12 +126,12 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, } painter->drawRect(0, 0, w, h); painter->setPen(pen); - text = QString::number(theDate.day()); + text = TQString::number(theDate.day()); addDayPostfix(text); painter->drawText(0, 0, w-2, h, AlignRight, text, -1, &rect); MyMoneyFile *file = MyMoneyFile::instance(); - QValueList<MyMoneySchedule> schedules; + TQValueList<MyMoneySchedule> schedules; try { @@ -171,12 +171,12 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, if (schedules.count() >= 1) { - QValueList<MyMoneySchedule>::Iterator iter; + TQValueList<MyMoneySchedule>::Iterator iter; bool anyOverdue=false; for (iter=schedules.begin(); iter!=schedules.end(); ++iter) { MyMoneySchedule schedule = *iter; - if (theDate < QDate::currentDate()) + if (theDate < TQDate::tqcurrentDate()) { if (schedule.isOverdue()) { @@ -192,12 +192,12 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, painter->setPen(darkGray); painter->setFont(fontLarge); - painter->drawText(0, 0, w, h, AlignCenter, QString::number(schedules.count()), + painter->drawText(0, 0, w, h, AlignCenter, TQString::number(schedules.count()), -1, &rect); } painter->setPen(lightGray); - painter->setBrush(Qt::NoBrush); + painter->setBrush(TQt::NoBrush); painter->drawRect(0, 0, w, h); } else if (m_type == WEEKLY) @@ -216,17 +216,17 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, painter->setPen(lightGray); painter->drawRect(0, 0, w, h); - text = QString::number(theDate.day()); + text = TQString::number(theDate.day()); addDayPostfix(text); - painter->drawText(0, 0, w-2, h, AlignRight, QDate::shortDayName(theDate.dayOfWeek()) + " " + text, -1, &rect); + painter->drawText(0, 0, w-2, h, AlignRight, TQDate::shortDayName(theDate.dayOfWeek()) + " " + text, -1, &rect); - QValueList<MyMoneySchedule> billSchedules; - QValueList<MyMoneySchedule> depositSchedules; - QValueList<MyMoneySchedule> transferSchedules; + TQValueList<MyMoneySchedule> billSchedules; + TQValueList<MyMoneySchedule> depositSchedules; + TQValueList<MyMoneySchedule> transferSchedules; try { - text = QString(); + text = TQString(); if (!m_filterBills) { @@ -238,7 +238,7 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, if (billSchedules.count() >= 1) { - text += i18n("%1 Bills.").arg(QString::number(billSchedules.count())); + text += i18n("%1 Bills.").tqarg(TQString::number(billSchedules.count())); } } @@ -254,7 +254,7 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, { if(!text.isEmpty()) text += " "; - text += i18n("%1 Deposits.").arg(QString::number(depositSchedules.count())); + text += i18n("%1 Deposits.").tqarg(TQString::number(depositSchedules.count())); } } @@ -270,7 +270,7 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, { if(!text.isEmpty()) text += " "; - text += i18n("%1 Transfers.").arg(QString::number(transferSchedules.count())); + text += i18n("%1 Transfers.").tqarg(TQString::number(transferSchedules.count())); } } } @@ -282,11 +282,11 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, } bool anyOverdue=false; - QValueList<MyMoneySchedule>::Iterator iter; + TQValueList<MyMoneySchedule>::Iterator iter; for (iter=transferSchedules.begin(); iter!=transferSchedules.end(); ++iter) { MyMoneySchedule schedule = *iter; - if (theDate < QDate::currentDate()) + if (theDate < TQDate::tqcurrentDate()) { if (schedule.isOverdue()) { @@ -301,7 +301,7 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, for (iter=depositSchedules.begin(); iter!=depositSchedules.end(); ++iter) { MyMoneySchedule schedule = *iter; - if (theDate < QDate::currentDate()) + if (theDate < TQDate::tqcurrentDate()) { if (schedule.isOverdue()) { @@ -316,7 +316,7 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, for (iter=billSchedules.begin(); iter!=billSchedules.end(); ++iter) { MyMoneySchedule schedule = *iter; - if (theDate < QDate::currentDate()) + if (theDate < TQDate::tqcurrentDate()) { if (schedule.isOverdue()) { @@ -337,7 +337,7 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, painter->drawText(0, 0, w, h, AlignCenter, text, -1, &rect); } - else if (m_type == QUARTERLY) + else if (m_type == TQUARTERLY) { painter->setBrush(KGlobalSettings::baseColor()); @@ -346,26 +346,26 @@ void kMyMoneyScheduledDateTbl::drawCellContents(QPainter *painter, int /*row*/, } } -void kMyMoneyScheduledDateTbl::addDayPostfix(QString& text) +void kMyMoneyScheduledDateTbl::addDayPostfix(TQString& text) { int d = text.toInt(); if (d >= 1 && d <= 31) { - QStringList postfixList = QStringList::split("-", i18n("st-nd-rd-th-th-th-th-th-th-th-th-th-th-th-th-th-th-th-th-th-st-nd-rd-th-th-th-th-th-th-th-st"), true); + TQStringList postfixList = TQStringList::split("-", i18n("st-nd-rd-th-th-th-th-th-th-th-th-th-th-th-th-th-th-th-th-th-st-nd-rd-th-th-th-th-th-th-th-st"), true); text += postfixList[d-1]; } } void kMyMoneyScheduledDateTbl::refresh() { - repaintContents(false); + tqrepaintContents(false); } -void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(QMouseEvent* e) +void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(TQMouseEvent* e) { int row, col, pos; - QPoint mouseCoord; + TQPoint mouseCoord; if (isActiveWindow() || briefWidget.isVisible()) { @@ -383,8 +383,8 @@ void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(QMouseEvent* e) int firstWeekDay = KGlobal::locale()->weekStartDay(); #endif - QDate drawDate(date); - QString text; + TQDate drawDate(date); + TQString text; if (m_type == MONTHLY) { @@ -417,7 +417,7 @@ void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(QMouseEvent* e) else if (m_type == WEEKLY) { // TODO: Handle other start weekdays than Monday - text = QDate::shortDayName(row); + text = TQDate::shortDayName(row); text += " "; int dayOfWeek = date.dayOfWeek(); @@ -434,13 +434,13 @@ void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(QMouseEvent* e) drawDate = date.addDays(diff); } - else if (m_type == QUARTERLY) + else if (m_type == TQUARTERLY) { } m_drawDateOrig = drawDate; MyMoneyFile *file = MyMoneyFile::instance(); - QValueList<MyMoneySchedule> schedules; + TQValueList<MyMoneySchedule> schedules; try { @@ -484,15 +484,15 @@ void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(QMouseEvent* e) // Take off five pixels so the mouse cursor // will be over the widget - QPoint p = QCursor::pos(); - if (p.y() + h > QApplication::desktop()->height()) + TQPoint p = TQCursor::pos(); + if (p.y() + h > TQApplication::desktop()->height()) { p.setY(p.y() - (h-5)); } else p.setY(p.y() - 5); - if (p.x() + w > QApplication::desktop()->width()) + if (p.x() + w > TQApplication::desktop()->width()) { p.setX(p.x() - (w-5)); } @@ -512,19 +512,19 @@ void kMyMoneyScheduledDateTbl::contentsMouseMoveEvent(QMouseEvent* e) void kMyMoneyScheduledDateTbl::filterBills(bool enable) { m_filterBills = enable; - repaintContents(false); + tqrepaintContents(false); } void kMyMoneyScheduledDateTbl::filterDeposits(bool enable) { m_filterDeposits = enable; - repaintContents(false); + tqrepaintContents(false); } void kMyMoneyScheduledDateTbl::filterTransfers(bool enable) { m_filterTransfers = enable; - repaintContents(false); + tqrepaintContents(false); } #include "kmymoneyscheduleddatetbl.moc" |