summaryrefslogtreecommitdiffstats
path: root/kspread/plugins/insertcalendar
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kspread/plugins/insertcalendar
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspread/plugins/insertcalendar')
-rw-r--r--kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc40
-rw-r--r--kspread/plugins/insertcalendar/kspread_insertcalendardialog.h23
-rw-r--r--kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui18
-rw-r--r--kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc48
-rw-r--r--kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h9
5 files changed, 70 insertions, 68 deletions
diff --git a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc
index 541783b8..4a465eed 100644
--- a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc
+++ b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.cc
@@ -28,31 +28,31 @@
#include <kdatewidget.h>
#include <kdebug.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
namespace KSpread
{
-InsertCalendarDialog::InsertCalendarDialog(QWidget* parent, const char* name)
-: InsertCalendarDialogBase(parent,name)
+InsertCalendarDialog::InsertCalendarDialog(TQWidget* tqparent, const char* name)
+: InsertCalendarDialogBase(tqparent,name)
{
this->m_datePicker = NULL;
//we start with a default calendar for the current month;
- QDate first_day_in_month = QDate::currentDate();
+ TQDate first_day_in_month = TQDate::tqcurrentDate();
first_day_in_month.setYMD(first_day_in_month.year(),first_day_in_month.month(),1);
- QDate last_day_in_month(first_day_in_month.year(),first_day_in_month.month(),first_day_in_month.daysInMonth());
+ TQDate last_day_in_month(first_day_in_month.year(),first_day_in_month.month(),first_day_in_month.daysInMonth());
this->m_startDateWidget->setDate(first_day_in_month);
this->m_endDateWidget->setDate(last_day_in_month);
- connect(this->m_selectStartDateButton,SIGNAL(clicked()),this,SLOT(showStartDatePicker()));
- connect(this->m_selectEndDateButton,SIGNAL(clicked()),this,SLOT(showEndDatePicker()));
+ connect(this->m_selectStartDateButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showStartDatePicker()));
+ connect(this->m_selectEndDateButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showEndDatePicker()));
- connect(this->m_insertButton,SIGNAL(clicked()),this,SLOT(accept()));
- connect(this->m_cancelButton,SIGNAL(clicked()),this,SLOT(reject()));
+ connect(this->m_insertButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(accept()));
+ connect(this->m_cancelButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(reject()));
}
InsertCalendarDialog::~InsertCalendarDialog()
@@ -73,7 +73,7 @@ bool InsertCalendarDialog::buildDatePickerFrame()
if (!m_datePicker)
return false;
- connect(m_datePicker,SIGNAL(destroyed()),this,SLOT(datePickerDeleted()));
+ connect(m_datePicker,TQT_SIGNAL(destroyed()),this,TQT_SLOT(datePickerDeleted()));
m_datePicker->setCloseButton(true);
m_datePicker->move(this->x()+this->width(),this->y());
@@ -93,7 +93,7 @@ void InsertCalendarDialog::accept()
if (m_datePicker)
m_datePicker->deleteLater();
kdDebug() << "insert calendar dialog accepted (insert button clicked)" << endl;
- done(QDialog::Accepted);
+ done(TQDialog::Accepted);
emit insertCalendar(startDate(),endDate());
}
@@ -102,15 +102,15 @@ void InsertCalendarDialog::reject()
if (m_datePicker)
m_datePicker->deleteLater();
kdDebug() << "insert calendar dialog rejected (cancel button clicked)" << endl;
- done(QDialog::Rejected);
+ done(TQDialog::Rejected);
}
void InsertCalendarDialog::showStartDatePicker()
{
if (buildDatePickerFrame())
{
- connect(m_datePicker,SIGNAL(dateSelected(QDate)),this,SLOT(setStartDate(QDate)));
- connect(m_datePicker,SIGNAL(dateEntered(QDate)),this,SLOT(setStartDate(QDate)));
+ connect(m_datePicker,TQT_SIGNAL(dateSelected(TQDate)),this,TQT_SLOT(setStartDate(TQDate)));
+ connect(m_datePicker,TQT_SIGNAL(dateEntered(TQDate)),this,TQT_SLOT(setStartDate(TQDate)));
m_datePicker->setDate(startDate());
}
}
@@ -119,28 +119,28 @@ void InsertCalendarDialog::showEndDatePicker()
{
if (buildDatePickerFrame())
{
- connect(m_datePicker,SIGNAL(dateSelected(QDate)),this,SLOT(setEndDate(QDate)));
- connect(m_datePicker,SIGNAL(dateEntered(QDate)),this,SLOT(setEndDate(QDate)));
+ connect(m_datePicker,TQT_SIGNAL(dateSelected(TQDate)),this,TQT_SLOT(setEndDate(TQDate)));
+ connect(m_datePicker,TQT_SIGNAL(dateEntered(TQDate)),this,TQT_SLOT(setEndDate(TQDate)));
m_datePicker->setDate(endDate());
}
}
-void InsertCalendarDialog::setStartDate(QDate date)
+void InsertCalendarDialog::setStartDate(TQDate date)
{
this->m_startDateWidget->setDate(date);
}
-void InsertCalendarDialog::setEndDate(QDate date)
+void InsertCalendarDialog::setEndDate(TQDate date)
{
this->m_endDateWidget->setDate(date);
}
-QDate InsertCalendarDialog::startDate() const
+TQDate InsertCalendarDialog::startDate() const
{
return this->m_startDateWidget->date();
}
-QDate InsertCalendarDialog::endDate() const
+TQDate InsertCalendarDialog::endDate() const
{
return this->m_endDateWidget->date();
}
diff --git a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h
index f52c2e93..f68ab4c6 100644
--- a/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h
+++ b/kspread/plugins/insertcalendar/kspread_insertcalendardialog.h
@@ -28,7 +28,7 @@
#include <kspread_insertcalendardialogbase.h>
#include <koffice_export.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
class KDatePicker;
@@ -38,6 +38,7 @@ namespace KSpread
class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase
{
Q_OBJECT
+ TQ_OBJECT
private:
@@ -55,7 +56,7 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase
* The dates in the dialog initialize to a complete calendar for the
* current month.
*/
- InsertCalendarDialog(QWidget* parent = 0, const char* name = 0);
+ InsertCalendarDialog(TQWidget* tqparent = 0, const char* name = 0);
/**
* Virtual destructor.
@@ -85,25 +86,25 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase
void datePickerDeleted();
/**
- * This slot is reimplemented from QDialog and
+ * This slot is reimplemented from TQDialog and
* is connected to the insert button.
* It also emits a insertCalendar signal.
*
* The dialog is closed (not deleted) when
* this slot is called.
*
- * @see insertCalendar, reject, QDialog::done
+ * @see insertCalendar, reject, TQDialog::done
*/
virtual void accept();
/**
- * This slot is reimplemented from QDialog and
+ * This slot is reimplemented from TQDialog and
* is connected to the cancel button.
*
* The dialog is closed (not deleted) when
* this slot is called.
*
- * @see accept, QDialog::done
+ * @see accept, TQDialog::done
*/
virtual void reject();
@@ -125,13 +126,13 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase
* Slot for setting the start date in the KDateWidget.
* Normally this slot is activated by a KDatePicker widget.
*/
- void setStartDate(QDate);
+ void setStartDate(TQDate);
/**
* Slot for setting the end date in the KDateWidget.
* Normally this slot is activated by a KDatePicker widget.
*/
- void setEndDate(QDate);
+ void setEndDate(TQDate);
public:
@@ -140,12 +141,12 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase
/**
* @returns the selected start date.
*/
- QDate startDate() const;
+ TQDate startDate() const;
/**
* @returns the selected end date.
*/
- QDate endDate() const;
+ TQDate endDate() const;
signals:
@@ -157,7 +158,7 @@ class KSPREAD_EXPORT InsertCalendarDialog : public InsertCalendarDialogBase
* insert calendar plugin to actually insert
* the calendar with the selected dates.
*/
- void insertCalendar(const QDate &from, const QDate &to);
+ void insertCalendar(const TQDate &from, const TQDate &to);
};
}
diff --git a/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui b/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui
index 9315c38c..b2c82866 100644
--- a/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui
+++ b/kspread/plugins/insertcalendar/kspread_insertcalendardialogbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>KSpread::InsertCalendarDialogBase</class>
-<widget class="QDialog">
+<widget class="TQDialog">
<property name="name">
<cstring>KSpread::InsertCalendarDialogBase</cstring>
</property>
@@ -26,7 +26,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="2">
+ <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>m_startDateGroupBox</cstring>
</property>
@@ -56,7 +56,7 @@
</sizepolicy>
</property>
</widget>
- <widget class="QPushButton" row="0" column="1">
+ <widget class="TQPushButton" row="0" column="1">
<property name="name">
<cstring>m_selectStartDateButton</cstring>
</property>
@@ -77,7 +77,7 @@
</widget>
</grid>
</widget>
- <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2">
+ <widget class="TQGroupBox" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>m_endDateGroupBox</cstring>
</property>
@@ -113,7 +113,7 @@
</sizepolicy>
</property>
</widget>
- <widget class="QPushButton" row="0" column="1">
+ <widget class="TQPushButton" row="0" column="1">
<property name="name">
<cstring>m_selectEndDateButton</cstring>
</property>
@@ -144,14 +144,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>400</width>
<height>19</height>
</size>
</property>
</spacer>
- <widget class="QPushButton" row="3" column="0">
+ <widget class="TQPushButton" row="3" column="0">
<property name="name">
<cstring>m_insertButton</cstring>
</property>
@@ -175,7 +175,7 @@
<comment>What's this for the insert button of the insert calendar plugin</comment>
</property>
</widget>
- <widget class="QPushButton" row="3" column="1">
+ <widget class="TQPushButton" row="3" column="1">
<property name="name">
<cstring>m_cancelButton</cstring>
</property>
@@ -199,7 +199,7 @@
</widget>
</grid>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kdatewidget.h</includehint>
<includehint>kdatewidget.h</includehint>
diff --git a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
index 56388af8..558f59cb 100644
--- a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
+++ b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.cc
@@ -39,8 +39,8 @@
#include <kofficeversion.h>
#include <kmessagebox.h>
-#include <qpoint.h>
-#include <qrect.h>
+#include <tqpoint.h>
+#include <tqrect.h>
namespace KSpread
{
@@ -50,15 +50,15 @@ typedef KGenericFactory<PluginInsertCalendar> InsertCalendarFactory;
K_EXPORT_COMPONENT_FACTORY( libkspreadinsertcalendar, InsertCalendarFactory("kspreadinsertcalendar"))
-PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, const QStringList& /*args*/ )
-: Plugin(parent,name)
+PluginInsertCalendar::PluginInsertCalendar( TQObject *tqparent, const char *name, const TQStringList& /*args*/ )
+: Plugin(tqparent,name)
{
this->m_kspreadView = NULL;
- if (parent)
+ if (tqparent)
{
- if (parent->inherits("KSpread::View"))
+ if (tqparent->inherits("KSpread::View"))
{
- this->m_kspreadView = (View*)parent;
+ this->m_kspreadView = (View*)tqparent;
}
else
{
@@ -67,14 +67,14 @@ PluginInsertCalendar::PluginInsertCalendar( QObject *parent, const char *name, c
}
else
{
- kdWarning() << "Plugin created without a parent!!!" << endl;
+ kdWarning() << "Plugin created without a tqparent!!!" << endl;
}
this->m_dialog = NULL;
(void)new KAction( i18n("Insert Calendar..."), KShortcut::null(),
- this, SLOT( slotShowDialog() ), actionCollection(), "kspreadinsertcalendar");
+ this, TQT_SLOT( slotShowDialog() ), actionCollection(), "kspreadinsertcalendar");
}
PluginInsertCalendar::~PluginInsertCalendar()
@@ -107,8 +107,8 @@ void PluginInsertCalendar::slotShowDialog()
Q_ASSERT(m_dialog);
- connect(m_dialog,SIGNAL(insertCalendar(const QDate&, const QDate&)),
- this,SLOT(slotInsertCalendar(const QDate&, const QDate&)));
+ connect(m_dialog,TQT_SIGNAL(insertCalendar(const TQDate&, const TQDate&)),
+ this,TQT_SLOT(slotInsertCalendar(const TQDate&, const TQDate&)));
}
//@todo if anyone knows a better way to get a background window to foreground, please change this...
@@ -117,7 +117,7 @@ void PluginInsertCalendar::slotShowDialog()
}
-void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &end)
+void PluginInsertCalendar::slotInsertCalendar(const TQDate &start, const TQDate &end)
{
//@todo implement
kdDebug() << "slotInsert... still to be implemented" << endl;
@@ -158,7 +158,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
Q_ASSERT(selection_info);
- QPoint selection = selection_info->selection().topLeft();
+ TQPoint selection = selection_info->selection().topLeft();
Sheet* sheet = m_kspreadView->activeSheet();
@@ -175,12 +175,12 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
//@todo improve calendar size prediction!
int sizeY = 4 + (int)(0.5*(float)(start.daysTo(end)));
- if (!sheet->areaIsEmpty(QRect(selection,QSize(sizeX,sizeY))))
+ if (!sheet->areaIsEmpty(TQRect(selection,TQSize(sizeX,sizeY))))
{
if (KMessageBox::No == KMessageBox::warningYesNo(NULL,i18n("The area where the calendar is inserted is NOT empty, are you sure you want to continue, overwriting existing data? If you choose No the area that would be required for the desired calendar will be selected so you can see what data would be overwritten."),i18n("Warning")))
{
//select the area so the user knows what's in the way
- selection_info->initialize(QRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet);
+ selection_info->initialize(TQRect(selection.x(),selection.y(),sizeX,sizeY));//,sheet);
return;
}
}
@@ -194,16 +194,16 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
int row = selection.y();
int col = selection.x();
int colstart = col; //this is where we get back after each week
- sheet->setText(row,colstart,i18n("Calendar from %1 to %2").arg(start.toString()).arg(end.toString()));
+ sheet->setText(row,colstart,i18n("Calendar from %1 to %2").tqarg(start.toString()).tqarg(end.toString()));
- QDate current(start);
-// QDate previous(current);
+ TQDate current(start);
+// TQDate previous(current);
bool yearheader = true;
bool monthheader = true;
bool weekheader = true;
//this loop creates the actual calendar
- //@todo formatting of cells - each day occupies QRect(row,col,row,col+1)
+ //@todo formatting of cells - each day occupies TQRect(row,col,row,col+1)
while (current <= end)
{
@@ -229,7 +229,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
if (yearheader)
{
- kdDebug() << "inserting year " + QString::number(current.year()) << endl;
+ kdDebug() << "inserting year " + TQString::number(current.year()) << endl;
sheet->setText(row,colstart+6,cs->yearString(current,false));
row+=2;
@@ -237,7 +237,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
}
if (monthheader)
{
- kdDebug() << "inserting month " + QString::number(current.month()) << endl;
+ kdDebug() << "inserting month " + TQString::number(current.month()) << endl;
sheet->setText(row,colstart+6,cs->monthName(current,false));
row+=2;
//we always have the week number in the first column
@@ -251,7 +251,7 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
}
if (weekheader)
{
- sheet->setText(row,colstart,QString::number(cs->weekNumber(current)));
+ sheet->setText(row,colstart,TQString::number(cs->weekNumber(current)));
col++;
weekheader=false;
@@ -262,10 +262,10 @@ void PluginInsertCalendar::slotInsertCalendar(const QDate &start, const QDate &e
}
}
- sheet->setText(row,col,QString::number(cs->day(current)));
+ sheet->setText(row,col,TQString::number(cs->day(current)));
//go to the next date
//@todo isn't there a better way, like current++ or something??
- QDate next = current.addDays(1);
+ TQDate next = current.addDays(1);
current.setYMD(next.year(),next.month(),next.day());
col+=2;
diff --git a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h
index 9eb6060d..be93fea5 100644
--- a/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h
+++ b/kspread/plugins/insertcalendar/kspread_plugininsertcalendar.h
@@ -29,7 +29,7 @@
#include <koffice_export.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
class KAboutData;
@@ -52,11 +52,12 @@ class InsertCalendarDialog;
class KSPREAD_EXPORT PluginInsertCalendar : public KParts::Plugin
{
Q_OBJECT
+ TQ_OBJECT
protected:
/**
- * This is the parent part of the plugin. It is used
+ * This is the tqparent part of the plugin. It is used
* to access the spreadsheet and actually insert the
* calendar.
*
@@ -77,7 +78,7 @@ class KSPREAD_EXPORT PluginInsertCalendar : public KParts::Plugin
/**
* Constructor. This constructor is usable with KGenericFactory.
*/
- PluginInsertCalendar( QObject *parent, const char *name, const QStringList& args );
+ PluginInsertCalendar( TQObject *tqparent, const char *name, const TQStringList& args );
/**
* Virtual destructor.
@@ -105,7 +106,7 @@ class KSPREAD_EXPORT PluginInsertCalendar : public KParts::Plugin
* from the insert calendar dialog and builds an calendar in the
* spreadsheet accordingly.
*/
- void slotInsertCalendar(const QDate &start, const QDate &end);
+ void slotInsertCalendar(const TQDate &start, const TQDate &end);
};
}