summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/statistics/statisticsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/plugins/statistics/statisticsdialog.cpp')
-rw-r--r--kopete/plugins/statistics/statisticsdialog.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/kopete/plugins/statistics/statisticsdialog.cpp b/kopete/plugins/statistics/statisticsdialog.cpp
index 461dd696..59b2da59 100644
--- a/kopete/plugins/statistics/statisticsdialog.cpp
+++ b/kopete/plugins/statistics/statisticsdialog.cpp
@@ -40,9 +40,9 @@
#include "statisticsplugin.h"
#include "statisticsdb.h"
-StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, TQWidget* parent,
- const char* name) : KDialogBase(parent, name, false,
- i18n("Statistics for %1").arg(contact->metaContact()->displayName()), Close, Close), m_db(db), m_contact(contact)
+StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db, TQWidget* tqparent,
+ const char* name) : KDialogBase(tqparent, name, false,
+ i18n("Statistics for %1").tqarg(contact->metaContact()->displayName()), Close, Close), m_db(db), m_contact(contact)
{
mainWidget = new StatisticsWidget(this);
setMainWidget(mainWidget);
@@ -63,7 +63,7 @@ StatisticsDialog::StatisticsDialog(StatisticsContact *contact, StatisticsDB *db,
mainWidget->tabWidget->setCurrentPage(0);
mainWidget->timePicker->setTime(TQTime::currentTime());
- mainWidget->datePicker->setDate(TQDate::currentDate());
+ mainWidget->datePicker->setDate(TQDate::tqcurrentDate());
connect(mainWidget->askButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAskButtonClicked()));
setFocus();
@@ -107,7 +107,7 @@ void StatisticsDialog::slotOpenURLRequest(const KURL& url, const KParts::URLArgs
void StatisticsDialog::generatePageForMonth(const int monthOfYear)
{
TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend "
- "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").arg(m_contact->statisticsContactId()));
+ "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").tqarg(m_contact->statisticsContactId()));
TQStringList values2;
@@ -123,13 +123,13 @@ void StatisticsDialog::generatePageForMonth(const int monthOfYear)
values2.push_back(values[i+2]);
}
}
- generatePageFromQStringList(values2, TQDate::longMonthName(monthOfYear));
+ generatePageFromTQStringList(values2, TQDate::longMonthName(monthOfYear));
}
void StatisticsDialog::generatePageForDay(const int dayOfWeek)
{
TQStringList values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend "
- "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").arg(m_contact->statisticsContactId()));
+ "FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;").tqarg(m_contact->statisticsContactId()));
TQStringList values2;
@@ -161,12 +161,12 @@ void StatisticsDialog::generatePageForDay(const int dayOfWeek)
}
}
}
- generatePageFromQStringList(values2, TQDate::longDayName(dayOfWeek));
+ generatePageFromTQStringList(values2, TQDate::longDayName(dayOfWeek));
}
/// @todo chart problem at midnight.
-void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQString & subTitle)
+void StatisticsDialog::generatePageFromTQStringList(TQStringList values, const TQString & subTitle)
{
generalHTMLPart->begin();
generalHTMLPart->write(TQString("<html><head><style>.bar { margin:0px;} "
@@ -190,8 +190,8 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
"margin-right: 5px;"
"padding:3px 3px 3px 10px;}"
"</style></head><body>" +
- i18n("<h1>Statistics for %1</h1>").arg(m_contact->metaContact()->displayName()) +
- "<h3>%1</h3><hr>").arg(subTitle));
+ i18n("<h1>Statistics for %1</h1>").tqarg(m_contact->metaContact()->displayName()) +
+ "<h3>%1</h3><hr>").tqarg(subTitle));
generalHTMLPart->write(i18n("<div class=\"statgroup\"><b><a href=\"main:generalinfo\" title=\"General summary view\">General</a></b><br>"
"<span title=\"Select the a day or a month to view the stat for\"><b>Days: </b>"
@@ -217,14 +217,14 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
"<a href=\"monthofyear:12\">December</a>&nbsp;"
"</span></div><br>"));
-// mainWidget->listView->addColumn(i18n("Status"));
+// mainWidget->listView->addColumn(i18n("tqStatus"));
// mainWidget->listView->addColumn(i18n("Start Date"));
// mainWidget->listView->addColumn(i18n("End Date"));
// mainWidget->listView->addColumn(i18n("Start Date"));
// mainWidget->listView->addColumn(i18n("End Date"));
TQString todayString;
- todayString.append(i18n("<div class=\"statgroup\" title=\"Contact status history for today\"><h2>Today</h2><table width=\"100%\"><tr><td>Status</td><td>From</td><td>To</td></tr>"));
+ todayString.append(i18n("<div class=\"statgroup\" title=\"Contact status history for today\"><h2>Today</h2><table width=\"100%\"><tr><td>tqStatus</td><td>From</td><td>To</td></tr>"));
bool today;
@@ -265,7 +265,7 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
TQDateTime dateTime2;
dateTime2.setTime_t(values[i+2].toInt());
- if (dateTime1.date() == TQDate::currentDate() || dateTime2.date() == TQDate::currentDate())
+ if (dateTime1.date() == TQDate::tqcurrentDate() || dateTime2.date() == TQDate::tqcurrentDate())
today = true;
else today = false;
@@ -351,7 +351,7 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
}
else color="white";
- todayString.append(TQString("<tr style=\"color:%1\"><td>%2</td><td>%3</td><td>%4</td></tr>").arg(color, status, dateTime1.time().toString(), dateTime2.time().toString()));
+ todayString.append(TQString("<tr style=\"color:%1\"><td>%2</td><td>%3</td><td>%4</td></tr>").tqarg(color, status, dateTime1.time().toString(), dateTime2.time().toString()));
}
@@ -386,11 +386,11 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
// Some "total times"
generalHTMLPart->write(i18n("<div class=\"statgroup\">"));
generalHTMLPart->write(i18n("<b title=\"The total time I have been able to see %1 status\">"
- "Total seen time :</b> %2 hour(s)<br>").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalTime)));
+ "Total seen time :</b> %2 hour(s)<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalTime)));
generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 online\">"
- "Total online time :</b> %2 hour(s)<br>").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalOnlineTime)));
- generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 away\">Total busy time :</b> %2 hour(s)<br>").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalAwayTime)));
- generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 offline\">Total offline time :</b> %2 hour(s)").arg(m_contact->metaContact()->displayName()).arg(stringFromSeconds(totalOfflineTime)));
+ "Total online time :</b> %2 hour(s)<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalOnlineTime)));
+ generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 away\">Total busy time :</b> %2 hour(s)<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalAwayTime)));
+ generalHTMLPart->write(i18n("<b title=\"The total time I have seen %1 offline\">Total offline time :</b> %2 hour(s)").tqarg(m_contact->metaContact()->displayName()).tqarg(stringFromSeconds(totalOfflineTime)));
generalHTMLPart->write(TQString("</div>"));
if (subTitle == i18n("General information"))
@@ -399,25 +399,25 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
*/
{
generalHTMLPart->write(TQString("<div class=\"statgroup\">"));
- generalHTMLPart->write(i18n("<b>Average message length :</b> %1 characters<br>").arg(m_contact->messageLength()));
- generalHTMLPart->write(i18n("<b>Time between two messages : </b> %1 second(s)").arg(m_contact->timeBetweenTwoMessages()));
+ generalHTMLPart->write(i18n("<b>Average message length :</b> %1 characters<br>").tqarg(m_contact->messageLength()));
+ generalHTMLPart->write(i18n("<b>Time between two messages : </b> %1 second(s)").tqarg(m_contact->timeBetweenTwoMessages()));
generalHTMLPart->write(TQString("</div>"));
generalHTMLPart->write(TQString("<div class=\"statgroup\">"));
- generalHTMLPart->write(i18n("<b title=\"The last time you talked with %1\">Last talk :</b> %2<br>").arg(m_contact->metaContact()->displayName()).arg(KGlobal::locale()->formatDateTime(m_contact->lastTalk())));
- generalHTMLPart->write(i18n("<b title=\"The last time I have seen %1 online or away\">Last time contact was present :</b> %2").arg(m_contact->metaContact()->displayName()).arg(KGlobal::locale()->formatDateTime(m_contact->lastPresent())));
+ generalHTMLPart->write(i18n("<b title=\"The last time you talked with %1\">Last talk :</b> %2<br>").tqarg(m_contact->metaContact()->displayName()).tqarg(KGlobal::locale()->formatDateTime(m_contact->lastTalk())));
+ generalHTMLPart->write(i18n("<b title=\"The last time I have seen %1 online or away\">Last time contact was present :</b> %2").tqarg(m_contact->metaContact()->displayName()).tqarg(KGlobal::locale()->formatDateTime(m_contact->lastPresent())));
generalHTMLPart->write(TQString("</div>"));
//generalHTMLPart->write(TQString("<div class=\"statgroup\">"));
- //generalHTMLPart->write(i18n("<b title=\"%1 uses to set his status online at these hours (EXPERIMENTAL)\">Main online events :</b><br>").arg(m_contact->metaContact()->displayName()));
+ //generalHTMLPart->write(i18n("<b title=\"%1 uses to set his status online at these hours (EXPERIMENTAL)\">Main online events :</b><br>").tqarg(m_contact->metaContact()->displayName()));
//TQValueList<TQTime> mainEvents = m_contact->mainEvents(Kopete::OnlineStatus::Online);
//for (uint i=0; i<mainEvents.count(); i++)
- //generalHTMLPart->write(TQString("%1<br>").arg(mainEvents[i].toString()));
+ //generalHTMLPart->write(TQString("%1<br>").tqarg(mainEvents[i].toString()));
//generalHTMLPart->write(TQString("</div>"));
generalHTMLPart->write("<div title=\"" +i18n("Current status") + "\" class=\"statgroup\">");
- generalHTMLPart->write(i18n("Is <b>%1</b> since <b>%2</b>").arg(
- Kopete::OnlineStatus(m_contact->oldStatus()).description(),
+ generalHTMLPart->write(i18n("Is <b>%1</b> since <b>%2</b>").tqarg(
+ Kopete::OnlineStatus(m_contact->oldtqStatus()).description(),
KGlobal::locale()->formatDateTime(m_contact->oldStatusDateTime())));
generalHTMLPart->write(TQString("</div>"));
}
@@ -434,13 +434,13 @@ void StatisticsDialog::generatePageFromQStringList(TQStringList values, const TQ
for (uint i=0; i<24; i++)
{
- int hrWidth = qRound((double)hours[i]/(double)hours[iMaxHours]*100.);
+ int hrWidth = tqRound((double)hours[i]/(double)hours[iMaxHours]*100.);
chartString += TQString("<img class=\"margin:0px;\" height=\"")
+(totalTime ? TQString::number(hrWidth) : TQString::number(0))
+TQString("\" src=\"file://")
+colorPath
+"\" width=\"4%\" title=\""
- +i18n("Between %1:00 and %2:00, I was able to see %3 status %4% of the hour.").arg(i).arg((i+1)%24).arg(m_contact->metaContact()->displayName()).arg(hrWidth)
+ +i18n("Between %1:00 and %2:00, I was able to see %3 status %4% of the hour.").tqarg(i).tqarg((i+1)%24).tqarg(m_contact->metaContact()->displayName()).tqarg(hrWidth)
+TQString("\">");
}
generalHTMLPart->write(chartString);
@@ -478,8 +478,8 @@ void StatisticsDialog::generatePageGeneral()
TQStringList values;
values = m_db->query(TQString("SELECT status, datetimebegin, datetimeend "
"FROM contactstatus WHERE metacontactid LIKE '%1' ORDER BY datetimebegin;")
- .arg(m_contact->statisticsContactId()));
- generatePageFromQStringList(values, i18n("General information"));
+ .tqarg(m_contact->statisticsContactId()));
+ generatePageFromTQStringList(values, i18n("General information"));
}
TQString StatisticsDialog::generateHTMLChart(const int *hours, const int *hours2, const int *hours3, const TQString & caption, const TQString & color)
@@ -493,7 +493,7 @@ TQString StatisticsDialog::generateHTMLChart(const int *hours, const int *hours2
{
int totalTime = hours[i] + hours2[i] + hours3[i];
- int hrWidth = qRound((double)hours[i]/(double)totalTime*100.);
+ int hrWidth = tqRound((double)hours[i]/(double)totalTime*100.);
chartString += TQString("<img class=\"margin:0px;\" height=\"")
+(totalTime ? TQString::number(hrWidth) : TQString::number(0))
+TQString("\" src=\"file://")
@@ -524,9 +524,9 @@ void StatisticsDialog::slotAskButtonClicked()
if (mainWidget->questionComboBox->currentItem()==0)
{
TQString text = i18n("1 is date, 2 is contact name, 3 is online status", "%1, %2 was %3")
- .arg(KGlobal::locale()->formatDateTime(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time())))
- .arg(m_contact->metaContact()->displayName())
- .arg(m_contact->statusAt(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time())));
+ .tqarg(KGlobal::locale()->formatDateTime(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time())))
+ .tqarg(m_contact->metaContact()->displayName())
+ .tqarg(m_contact->statusAt(TQDateTime(mainWidget->datePicker->date(), mainWidget->timePicker->time())));
mainWidget->answerEdit->setText(text);
}
else if (mainWidget->questionComboBox->currentItem()==1)