From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- atlantik/client/eventlogwidget.cpp | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'atlantik/client/eventlogwidget.cpp') diff --git a/atlantik/client/eventlogwidget.cpp b/atlantik/client/eventlogwidget.cpp index b0f77ab8..6bc81b04 100644 --- a/atlantik/client/eventlogwidget.cpp +++ b/atlantik/client/eventlogwidget.cpp @@ -16,9 +16,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -35,30 +35,30 @@ EventLog::EventLog() { } -void EventLog::addEvent(const QString &description, const QString &icon) +void EventLog::addEvent(const TQString &description, const TQString &icon) { - Event *event = new Event(QDateTime::currentDateTime(), description, icon); + Event *event = new Event(TQDateTime::currentDateTime(), description, icon); m_events.append(event); emit newEvent(event); } -QPtrList EventLog::events() +TQPtrList EventLog::events() { return m_events; } -EventLogWidget::EventLogWidget(EventLog *eventLog, QWidget *parent, const char *name) - : QWidget(parent, name, +EventLogWidget::EventLogWidget(EventLog *eventLog, TQWidget *parent, const char *name) + : TQWidget(parent, name, WType_Dialog | WStyle_Customize | WStyle_DialogBorder | WStyle_Title | WStyle_Minimize | WStyle_ContextHelp ) { m_eventLog = eventLog; - connect(m_eventLog, SIGNAL(newEvent(Event *)), this, SLOT(addEvent(Event *))); + connect(m_eventLog, TQT_SIGNAL(newEvent(Event *)), this, TQT_SLOT(addEvent(Event *))); setCaption(i18n("Event Log")); - QVBoxLayout *listCompBox = new QVBoxLayout(this, KDialog::marginHint()); + TQVBoxLayout *listCompBox = new TQVBoxLayout(this, KDialog::marginHint()); m_eventList = new KListView(this, "eventList"); listCompBox->addWidget(m_eventList); @@ -67,19 +67,19 @@ EventLogWidget::EventLogWidget(EventLog *eventLog, QWidget *parent, const char * m_eventList->addColumn(i18n("Description")); m_eventList->header()->setClickEnabled( false ); - QHBoxLayout *actionBox = new QHBoxLayout(this, 0, KDialog::spacingHint()); + TQHBoxLayout *actionBox = new TQHBoxLayout(this, 0, KDialog::spacingHint()); listCompBox->addItem(actionBox); - actionBox->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); + actionBox->addItem(new TQSpacerItem(20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum)); m_saveButton = new KPushButton(BarIcon("filesave", KIcon::SizeSmall), i18n("&Save As..."), this); actionBox->addWidget(m_saveButton); - connect(m_saveButton, SIGNAL(clicked()), this, SLOT(save())); + connect(m_saveButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(save())); // Populate - QPtrList events = m_eventLog->events(); - for (QPtrListIterator it( events ); (*it) ; ++it) + TQPtrList events = m_eventLog->events(); + for (TQPtrListIterator it( events ); (*it) ; ++it) addEvent( (*it) ); } @@ -91,32 +91,32 @@ void EventLogWidget::addEvent(Event *event) if ( m_eventList->childCount() >= 25 ) delete m_eventList->firstChild(); - QString description = KStringHandler::rsqueeze( event->description(), 200 ); + TQString description = KStringHandler::rsqueeze( event->description(), 200 ); KListViewItem *item = new KListViewItem(m_eventList, event->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz"), description); if (event->icon().isEmpty()) - item->setPixmap(1, QPixmap(SmallIcon("atlantik"))); + item->setPixmap(1, TQPixmap(SmallIcon("atlantik"))); else - item->setPixmap(1, QPixmap(SmallIcon(event->icon()))); + item->setPixmap(1, TQPixmap(SmallIcon(event->icon()))); m_eventList->ensureItemVisible(item); } -void EventLogWidget::closeEvent(QCloseEvent *e) +void EventLogWidget::closeEvent(TQCloseEvent *e) { e->accept(); } void EventLogWidget::save() { - QFile file( KFileDialog::getSaveFileName() ); + TQFile file( KFileDialog::getSaveFileName() ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream(&file); + TQTextStream stream(&file); - stream << i18n( "Atlantik log file, saved at %1." ).arg( QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; + stream << i18n( "Atlantik log file, saved at %1." ).arg( TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") ) << endl; - QPtrList events = m_eventLog->events(); - for (QPtrListIterator it( events ); (*it) ; ++it) + TQPtrList events = m_eventLog->events(); + for (TQPtrListIterator it( events ); (*it) ; ++it) stream << (*it)->dateTime().toString("yyyy-MM-dd hh:mm:ss") << " " << (*it)->description() << endl; file.close(); } -- cgit v1.2.1