diff options
Diffstat (limited to 'korganizer/korgac/alarmdialog.cpp')
-rw-r--r-- | korganizer/korgac/alarmdialog.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/korganizer/korgac/alarmdialog.cpp b/korganizer/korgac/alarmdialog.cpp index 68e1822dc..6c9d62e90 100644 --- a/korganizer/korgac/alarmdialog.cpp +++ b/korganizer/korgac/alarmdialog.cpp @@ -22,15 +22,15 @@ without including the source code for Qt in the source distribution. */ -#include <qhbox.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qfile.h> -#include <qspinbox.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qcstring.h> -#include <qdatastream.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqfile.h> +#include <tqspinbox.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqcstring.h> +#include <tqdatastream.h> #include <kapplication.h> #include <kconfig.h> @@ -57,7 +57,7 @@ class AlarmListItem : public KListViewItem { public: - AlarmListItem( Incidence *incidence, QListView *parent ) : + AlarmListItem( Incidence *incidence, TQListView *parent ) : KListViewItem( parent ), mIncidence( incidence->clone() ), mNotified( false ) @@ -69,13 +69,13 @@ class AlarmListItem : public KListViewItem } Incidence *mIncidence; - QDateTime mRemindAt; + TQDateTime mRemindAt; bool mNotified; }; -typedef QValueList<AlarmListItem*> ItemList; +typedef TQValueList<AlarmListItem*> ItemList; -AlarmDialog::AlarmDialog( QWidget *parent, const char *name ) +AlarmDialog::AlarmDialog( TQWidget *parent, const char *name ) : KDialogBase( Plain, WType_TopLevel | WStyle_Customize | WStyle_StaysOnTop | WStyle_DialogBorder, parent, name, false, i18n("Reminder"), Ok | User1 | User2 | User3, User1/*3*/, @@ -85,11 +85,11 @@ AlarmDialog::AlarmDialog( QWidget *parent, const char *name ) KGlobal::iconLoader()->addAppDir( "kdepim" ); setButtonOK( i18n( "Dismiss" ) ); - QWidget *topBox = plainPage(); - QBoxLayout *topLayout = new QVBoxLayout( topBox ); + TQWidget *topBox = plainPage(); + TQBoxLayout *topLayout = new TQVBoxLayout( topBox ); topLayout->setSpacing( spacingHint() ); - QLabel *label = new QLabel( i18n("The following events triggered reminders:"), + TQLabel *label = new TQLabel( i18n("The following events triggered reminders:"), topBox ); topLayout->addWidget( label ); @@ -97,22 +97,22 @@ AlarmDialog::AlarmDialog( QWidget *parent, const char *name ) mIncidenceListView->addColumn( i18n( "Summary" ) ); mIncidenceListView->addColumn( i18n( "Due" ) ); mIncidenceListView->setAllColumnsShowFocus( true ); - mIncidenceListView->setSelectionMode( QListView::Extended ); + mIncidenceListView->setSelectionMode( TQListView::Extended ); topLayout->addWidget( mIncidenceListView ); - connect( mIncidenceListView, SIGNAL(selectionChanged()), SLOT(updateButtons()) ); - connect( mIncidenceListView, SIGNAL(doubleClicked(QListViewItem*)), SLOT(slotUser2()) ); - connect( mIncidenceListView, SIGNAL(currentChanged(QListViewItem*)), SLOT(showDetails()) ); - connect( mIncidenceListView, SIGNAL(selectionChanged()), SLOT(showDetails()) ); + connect( mIncidenceListView, TQT_SIGNAL(selectionChanged()), TQT_SLOT(updateButtons()) ); + connect( mIncidenceListView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(slotUser2()) ); + connect( mIncidenceListView, TQT_SIGNAL(currentChanged(TQListViewItem*)), TQT_SLOT(showDetails()) ); + connect( mIncidenceListView, TQT_SIGNAL(selectionChanged()), TQT_SLOT(showDetails()) ); mDetailView = new KOEventViewer( topBox ); topLayout->addWidget( mDetailView ); - QHBox *suspendBox = new QHBox( topBox ); + TQHBox *suspendBox = new TQHBox( topBox ); suspendBox->setSpacing( spacingHint() ); topLayout->addWidget( suspendBox ); - QLabel *l = new QLabel( i18n("Suspend &duration:"), suspendBox ); - mSuspendSpin = new QSpinBox( 1, 9999, 1, suspendBox ); + TQLabel *l = new TQLabel( i18n("Suspend &duration:"), suspendBox ); + mSuspendSpin = new TQSpinBox( 1, 9999, 1, suspendBox ); mSuspendSpin->setValue( 5 ); // default suspend duration l->setBuddy( mSuspendSpin ); @@ -121,7 +121,7 @@ AlarmDialog::AlarmDialog( QWidget *parent, const char *name ) mSuspendUnit->insertItem( i18n("hour(s)") ); mSuspendUnit->insertItem( i18n("day(s)") ); mSuspendUnit->insertItem( i18n("week(s)") ); - connect( &mSuspendTimer, SIGNAL(timeout()), SLOT(wakeUp()) ); + connect( &mSuspendTimer, TQT_SIGNAL(timeout()), TQT_SLOT(wakeUp()) ); // showButton( User2/*3*/, false ); @@ -133,7 +133,7 @@ AlarmDialog::~AlarmDialog() mIncidenceListView->clear(); } -void AlarmDialog::addIncidence( Incidence *incidence, const QDateTime &reminderAt ) +void AlarmDialog::addIncidence( Incidence *incidence, const TQDateTime &reminderAt ) { AlarmListItem *item = new AlarmListItem( incidence, mIncidenceListView ); item->setText( 0, incidence->summary() ); @@ -142,7 +142,7 @@ void AlarmDialog::addIncidence( Incidence *incidence, const QDateTime &reminderA if ( dynamic_cast<Event*>( incidence ) ) { item->setPixmap( 0, SmallIcon( "appointment" ) ); if ( incidence->doesRecur() ) { - QDateTime nextStart = incidence->recurrence()->getNextDateTime( reminderAt ); + TQDateTime nextStart = incidence->recurrence()->getNextDateTime( reminderAt ); if ( nextStart.isValid() ) item->setText( 1, KGlobal::locale()->formatDateTime( nextStart ) ); } @@ -202,12 +202,12 @@ void AlarmDialog::suspend() break; } - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { AlarmListItem * item = static_cast<AlarmListItem*>( it.current() ); if ( item->isSelected() && item->isVisible() ) { item->setVisible( false ); item->setSelected( false ); - item->mRemindAt = QDateTime::currentDateTime().addSecs( unit * mSuspendSpin->value() ); + item->mRemindAt = TQDateTime::currentDateTime().addSecs( unit * mSuspendSpin->value() ); item->mNotified = false; } } @@ -225,10 +225,10 @@ void AlarmDialog::suspend() void AlarmDialog::setTimer() { int nextReminderAt = -1; - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { AlarmListItem * item = static_cast<AlarmListItem*>( it.current() ); - if ( item->mRemindAt > QDateTime::currentDateTime() ) { - int secs = QDateTime::currentDateTime().secsTo( item->mRemindAt ); + if ( item->mRemindAt > TQDateTime::currentDateTime() ) { + int secs = TQDateTime::currentDateTime().secsTo( item->mRemindAt ); nextReminderAt = nextReminderAt <= 0 ? secs : QMIN( nextReminderAt, secs ); } } @@ -247,17 +247,17 @@ void AlarmDialog::slotUser2() Incidence *incidence = selection.first()->mIncidence; if ( !kapp->dcopClient()->isApplicationRegistered( "korganizer" ) ) { - if ( kapp->startServiceByDesktopName( "korganizer", QString::null ) ) + if ( kapp->startServiceByDesktopName( "korganizer", TQString::null ) ) KMessageBox::error( 0, i18n("Could not start KOrganizer.") ); } kapp->dcopClient()->send( "korganizer", "KOrganizerIface", - "editIncidence(QString)", + "editIncidence(TQString)", incidence->uid() ); // get desktop # where korganizer (or kontact) runs - QByteArray replyData; - QCString object, replyType; + TQByteArray replyData; + TQCString object, replyType; object = kapp->dcopClient()->isApplicationRegistered( "kontact" ) ? "kontact-mainwindow#1" : "KOrganizer MainWindow"; if (!kapp->dcopClient()->call( "korganizer", object, @@ -266,7 +266,7 @@ void AlarmDialog::slotUser2() if ( replyType == "int" ) { int desktop, window; - QDataStream ds( replyData, IO_ReadOnly ); + TQDataStream ds( replyData, IO_ReadOnly ); ds >> window; desktop = KWin::windowInfo( window ).desktop(); @@ -287,7 +287,7 @@ void AlarmDialog::slotUser3() void AlarmDialog::dismissAll() { - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ) { AlarmListItem *item = static_cast<AlarmListItem*>( it.current() ); if ( !item->isVisible() ) { ++it; @@ -316,8 +316,8 @@ void AlarmDialog::eventNotification() { bool beeped = false, found = false; - QValueList<AlarmListItem*> list; - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + TQValueList<AlarmListItem*> list; + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { AlarmListItem *item = static_cast<AlarmListItem*>( it.current() ); if ( !item->isVisible() || item->mNotified ) continue; @@ -332,12 +332,12 @@ void AlarmDialog::eventNotification() // FIXME: Add a message box asking whether the procedure should really be executed kdDebug(5890) << "Starting program: '" << alarm->programFile() << "'" << endl; KProcess proc; - proc << QFile::encodeName(alarm->programFile()); + proc << TQFile::encodeName(alarm->programFile()); proc.start(KProcess::DontCare); } else if (alarm->type() == Alarm::Audio) { beeped = true; - KAudioPlayer::play(QFile::encodeName(alarm->audioFile())); + KAudioPlayer::play(TQFile::encodeName(alarm->audioFile())); } } } @@ -350,9 +350,9 @@ void AlarmDialog::eventNotification() void AlarmDialog::wakeUp() { bool activeReminders = false; - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { AlarmListItem * item = static_cast<AlarmListItem*>( it.current() ); - if ( item->mRemindAt <= QDateTime::currentDateTime() ) { + if ( item->mRemindAt <= TQDateTime::currentDateTime() ) { if ( !item->isVisible() ) { item->setVisible( true ); item->setSelected( false ); @@ -380,9 +380,9 @@ void AlarmDialog::slotSave() config->setGroup( "General" ); int numReminders = config->readNumEntry("Reminders", 0); - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { AlarmListItem * item = static_cast<AlarmListItem*>( it.current() ); - config->setGroup( QString("Incidence-%1").arg(numReminders) ); + config->setGroup( TQString("Incidence-%1").arg(numReminders) ); config->writeEntry( "UID", item->mIncidence->uid() ); config->writeEntry( "RemindAt", item->mRemindAt ); ++numReminders; @@ -402,10 +402,10 @@ void AlarmDialog::updateButtons() enableButton( User3, selection.count() > 0 ); } -QValueList< AlarmListItem * > AlarmDialog::selectedItems() const +TQValueList< AlarmListItem * > AlarmDialog::selectedItems() const { - QValueList<AlarmListItem*> list; - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + TQValueList<AlarmListItem*> list; + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { if ( it.current()->isSelected() ) list.append( static_cast<AlarmListItem*>( it.current() ) ); } @@ -415,7 +415,7 @@ QValueList< AlarmListItem * > AlarmDialog::selectedItems() const int AlarmDialog::activeCount() { int count = 0; - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { AlarmListItem * item = static_cast<AlarmListItem*>( it.current() ); if ( item->isVisible() ) ++count; @@ -426,7 +426,7 @@ int AlarmDialog::activeCount() void AlarmDialog::suspendAll() { mIncidenceListView->clearSelection(); - for ( QListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( mIncidenceListView ) ; it.current() ; ++it ) { if ( it.current()->isVisible() ) it.current()->setSelected( true ); } |