summaryrefslogtreecommitdiffstats
path: root/karm/taskview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'karm/taskview.cpp')
-rw-r--r--karm/taskview.cpp170
1 files changed, 85 insertions, 85 deletions
diff --git a/karm/taskview.cpp b/karm/taskview.cpp
index 590744408..0af5c7bd4 100644
--- a/karm/taskview.cpp
+++ b/karm/taskview.cpp
@@ -1,14 +1,14 @@
-#include <qclipboard.h>
-#include <qfile.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qlistview.h>
-#include <qptrlist.h>
-#include <qptrstack.h>
-#include <qstring.h>
-#include <qtextstream.h>
-#include <qtimer.h>
-#include <qxml.h>
+#include <tqclipboard.h>
+#include <tqfile.h>
+#include <tqlayout.h>
+#include <tqlistbox.h>
+#include <tqlistview.h>
+#include <tqptrlist.h>
+#include <tqptrstack.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
+#include <tqtimer.h>
+#include <tqxml.h>
#include "kapplication.h" // kapp
#include <kconfig.h>
@@ -37,15 +37,15 @@
class DesktopTracker;
-TaskView::TaskView(QWidget *parent, const char *name, const QString &icsfile ):KListView(parent,name)
+TaskView::TaskView(TQWidget *parent, const char *name, const TQString &icsfile ):KListView(parent,name)
{
_preferences = Preferences::instance( icsfile );
_storage = KarmStorage::instance();
- connect( this, SIGNAL( expanded( QListViewItem * ) ),
- this, SLOT( itemStateChanged( QListViewItem * ) ) );
- connect( this, SIGNAL( collapsed( QListViewItem * ) ),
- this, SLOT( itemStateChanged( QListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( expanded( TQListViewItem * ) ),
+ this, TQT_SLOT( itemStateChanged( TQListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( collapsed( TQListViewItem * ) ),
+ this, TQT_SLOT( itemStateChanged( TQListViewItem * ) ) );
// setup default values
previousColumnWidths[0] = previousColumnWidths[1]
@@ -64,50 +64,50 @@ TaskView::TaskView(QWidget *parent, const char *name, const QString &icsfile ):K
setAllColumnsShowFocus( true );
// set up the minuteTimer
- _minuteTimer = new QTimer(this);
- connect( _minuteTimer, SIGNAL( timeout() ), this, SLOT( minuteUpdate() ));
+ _minuteTimer = new TQTimer(this);
+ connect( _minuteTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( minuteUpdate() ));
_minuteTimer->start(1000 * secsPerMinute);
// React when user changes iCalFile
- connect(_preferences, SIGNAL(iCalFile(QString)),
- this, SLOT(iCalFileChanged(QString)));
+ connect(_preferences, TQT_SIGNAL(iCalFile(TQString)),
+ this, TQT_SLOT(iCalFileChanged(TQString)));
// resize columns when config is changed
- connect(_preferences, SIGNAL( setupChanged() ), this,SLOT( adaptColumns() ));
+ connect(_preferences, TQT_SIGNAL( setupChanged() ), this,TQT_SLOT( adaptColumns() ));
_minuteTimer->start(1000 * secsPerMinute);
// Set up the idle detection.
_idleTimeDetector = new IdleTimeDetector( _preferences->idlenessTimeout() );
- connect( _idleTimeDetector, SIGNAL( extractTime(int) ),
- this, SLOT( extractTime(int) ));
- connect( _idleTimeDetector, SIGNAL( stopAllTimersAt(QDateTime) ),
- this, SLOT( stopAllTimersAt(QDateTime) ));
- connect( _preferences, SIGNAL( idlenessTimeout(int) ),
- _idleTimeDetector, SLOT( setMaxIdle(int) ));
- connect( _preferences, SIGNAL( detectIdleness(bool) ),
- _idleTimeDetector, SLOT( toggleOverAllIdleDetection(bool) ));
+ connect( _idleTimeDetector, TQT_SIGNAL( extractTime(int) ),
+ this, TQT_SLOT( extractTime(int) ));
+ connect( _idleTimeDetector, TQT_SIGNAL( stopAllTimersAt(TQDateTime) ),
+ this, TQT_SLOT( stopAllTimersAt(TQDateTime) ));
+ connect( _preferences, TQT_SIGNAL( idlenessTimeout(int) ),
+ _idleTimeDetector, TQT_SLOT( setMaxIdle(int) ));
+ connect( _preferences, TQT_SIGNAL( detectIdleness(bool) ),
+ _idleTimeDetector, TQT_SLOT( toggleOverAllIdleDetection(bool) ));
if (!_idleTimeDetector->isIdleDetectionPossible())
_preferences->disableIdleDetection();
// Setup auto save timer
- _autoSaveTimer = new QTimer(this);
- connect( _preferences, SIGNAL( autoSave(bool) ),
- this, SLOT( autoSaveChanged(bool) ));
- connect( _preferences, SIGNAL( autoSavePeriod(int) ),
- this, SLOT( autoSavePeriodChanged(int) ));
- connect( _autoSaveTimer, SIGNAL( timeout() ), this, SLOT( save() ));
+ _autoSaveTimer = new TQTimer(this);
+ connect( _preferences, TQT_SIGNAL( autoSave(bool) ),
+ this, TQT_SLOT( autoSaveChanged(bool) ));
+ connect( _preferences, TQT_SIGNAL( autoSavePeriod(int) ),
+ this, TQT_SLOT( autoSavePeriodChanged(int) ));
+ connect( _autoSaveTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( save() ));
// Setup manual save timer (to save changes a little while after they happen)
- _manualSaveTimer = new QTimer(this);
- connect( _manualSaveTimer, SIGNAL( timeout() ), this, SLOT( save() ));
+ _manualSaveTimer = new TQTimer(this);
+ connect( _manualSaveTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( save() ));
// Connect desktop tracker events to task starting/stopping
_desktopTracker = new DesktopTracker();
- connect( _desktopTracker, SIGNAL( reachedtActiveDesktop( Task* ) ),
- this, SLOT( startTimerFor(Task*) ));
- connect( _desktopTracker, SIGNAL( leftActiveDesktop( Task* ) ),
- this, SLOT( stopTimerFor(Task*) ));
+ connect( _desktopTracker, TQT_SIGNAL( reachedtActiveDesktop( Task* ) ),
+ this, TQT_SLOT( startTimerFor(Task*) ));
+ connect( _desktopTracker, TQT_SIGNAL( leftActiveDesktop( Task* ) ),
+ this, TQT_SLOT( stopTimerFor(Task*) ));
new TaskViewWhatsThis( this );
}
@@ -116,7 +116,7 @@ KarmStorage* TaskView::storage()
return _storage;
}
-void TaskView::contentsMousePressEvent ( QMouseEvent * e )
+void TaskView::contentsMousePressEvent ( TQMouseEvent * e )
{
kdDebug(5970) << "entering contentsMousePressEvent" << endl;
KListView::contentsMousePressEvent(e);
@@ -139,7 +139,7 @@ void TaskView::contentsMousePressEvent ( QMouseEvent * e )
}
}
-void TaskView::contentsMouseDoubleClickEvent ( QMouseEvent * e )
+void TaskView::contentsMouseDoubleClickEvent ( TQMouseEvent * e )
// if the user double-clicks onto a tasks, he says "I am now working exclusively
// on that task". That means, on a doubleclick, we check if it occurs on an item
// not in the blank space, if yes, stop all other tasks and start the new timer.
@@ -184,12 +184,12 @@ Task* TaskView::item_at_index(int i)
return static_cast<Task*>(itemAtIndex(i));
}
-void TaskView::load( QString fileName )
+void TaskView::load( TQString fileName )
{
// if the program is used as an embedded plugin for konqueror, there may be a need
// to load from a file without touching the preferences.
_isloading = true;
- QString err = _storage->load(this, _preferences, fileName);
+ TQString err = _storage->load(this, _preferences, fileName);
if (!err.isEmpty())
{
@@ -207,13 +207,13 @@ void TaskView::load( QString fileName )
setSelected(first_child(), true);
setCurrentItem(first_child());
- if ( _desktopTracker->startTracking() != QString() )
+ if ( _desktopTracker->startTracking() != TQString() )
KMessageBox::error( 0, i18n("You are on a too high logical desktop, desktop tracking will not work") );
_isloading = false;
refresh();
}
-void TaskView::restoreItemState( QListViewItem *item )
+void TaskView::restoreItemState( TQListViewItem *item )
{
while( item )
{
@@ -224,7 +224,7 @@ void TaskView::restoreItemState( QListViewItem *item )
}
}
-void TaskView::itemStateChanged( QListViewItem *item )
+void TaskView::itemStateChanged( TQListViewItem *item )
{
if ( !item || _isloading ) return;
Task *t = (Task *)item;
@@ -278,10 +278,10 @@ void TaskView::loadFromFlatFile()
//KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
- QString fileName(KFileDialog::getOpenFileName(QString::null, QString::null,
+ TQString fileName(KFileDialog::getOpenFileName(TQString::null, TQString::null,
0));
if (!fileName.isEmpty()) {
- QString err = _storage->loadFromFlatFile(this, fileName);
+ TQString err = _storage->loadFromFlatFile(this, fileName);
if (!err.isEmpty())
{
KMessageBox::error(this, err);
@@ -300,26 +300,26 @@ void TaskView::loadFromFlatFile()
setSelected(first_child(), true);
setCurrentItem(first_child());
- if ( _desktopTracker->startTracking() != QString() )
+ if ( _desktopTracker->startTracking() != TQString() )
KMessageBox::error(0, i18n("You are on a too high logical desktop, desktop tracking will not work") );
}
}
-QString TaskView::importPlanner(QString fileName)
+TQString TaskView::importPlanner(TQString fileName)
{
kdDebug(5970) << "entering importPlanner" << endl;
PlannerParser* handler=new PlannerParser(this);
- if (fileName.isEmpty()) fileName=KFileDialog::getOpenFileName(QString::null, QString::null, 0);
- QFile xmlFile( fileName );
- QXmlInputSource source( xmlFile );
- QXmlSimpleReader reader;
+ if (fileName.isEmpty()) fileName=KFileDialog::getOpenFileName(TQString::null, TQString::null, 0);
+ TQFile xmlFile( fileName );
+ TQXmlInputSource source( xmlFile );
+ TQXmlSimpleReader reader;
reader.setContentHandler( handler );
reader.parse( source );
refresh();
return "";
}
-QString TaskView::report( const ReportCriteria& rc )
+TQString TaskView::report( const ReportCriteria& rc )
{
return _storage->report( this, rc );
}
@@ -333,15 +333,15 @@ void TaskView::exportcsvFile()
dialog.enableTasksToExportQuestion();
dialog.urlExportTo->KURLRequester::setMode(KFile::File);
if ( dialog.exec() ) {
- QString err = _storage->report( this, dialog.reportCriteria() );
+ TQString err = _storage->report( this, dialog.reportCriteria() );
if ( !err.isEmpty() ) KMessageBox::error( this, i18n(err.ascii()) );
}
}
-QString TaskView::exportcsvHistory()
+TQString TaskView::exportcsvHistory()
{
kdDebug(5970) << "TaskView::exportcsvHistory()" << endl;
- QString err;
+ TQString err;
CSVExportDialog dialog( ReportCriteria::CSVHistoryExport, this );
if ( current_item() && current_item()->isRoot() )
@@ -362,11 +362,11 @@ void TaskView::scheduleSave()
Preferences* TaskView::preferences() { return _preferences; }
-QString TaskView::save()
+TQString TaskView::save()
// This saves the tasks. If they do not yet have an endDate, their startDate is also not saved.
{
kdDebug(5970) << "Entering TaskView::save" << endl;
- QString err = _storage->save(this);
+ TQString err = _storage->save(this);
emit(setStatusBar(err));
return err;
}
@@ -383,10 +383,10 @@ long TaskView::count()
return n;
}
-void TaskView::startTimerFor(Task* task, QDateTime startTime )
+void TaskView::startTimerFor(Task* task, TQDateTime startTime )
{
kdDebug(5970) << "Entering TaskView::startTimerFor" << endl;
- if (save()==QString())
+ if (save()==TQString())
{
if (task != 0 && activeTasks.findRef(task) == -1)
{
@@ -423,7 +423,7 @@ void TaskView::stopAllTimers()
emit tasksChanged( activeTasks );
}
-void TaskView::stopAllTimersAt(QDateTime qdt)
+void TaskView::stopAllTimersAt(TQDateTime qdt)
// stops all timers for the time qdt. This makes sense, if the idletimedetector detected
// the last work has been done 50 minutes ago.
{
@@ -443,7 +443,7 @@ void TaskView::stopAllTimersAt(QDateTime qdt)
void TaskView::startNewSession()
{
- QListViewItemIterator item( first_child());
+ TQListViewItemIterator item( first_child());
for ( ; item.current(); ++item ) {
Task * task = (Task *) item.current();
task->startNewSession();
@@ -452,7 +452,7 @@ void TaskView::startNewSession()
void TaskView::resetTimeForAllTasks()
{
- QListViewItemIterator item( first_child());
+ TQListViewItemIterator item( first_child());
for ( ; item.current(); ++item ) {
Task * task = (Task *) item.current();
task->resetTimes();
@@ -495,15 +495,15 @@ void TaskView::newTask()
newTask(i18n("New Task"), 0);
}
-void TaskView::newTask(QString caption, Task *parent)
+void TaskView::newTask(TQString caption, Task *parent)
{
EditTaskDialog *dialog = new EditTaskDialog(caption, false);
long total, totalDiff, session, sessionDiff;
DesktopList desktopList;
int result = dialog->exec();
- if ( result == QDialog::Accepted ) {
- QString taskName = i18n( "Unnamed Task" );
+ if ( result == TQDialog::Accepted ) {
+ TQString taskName = i18n( "Unnamed Task" );
if ( !dialog->taskName().isEmpty()) taskName = dialog->taskName();
total = totalDiff = session = sessionDiff = 0;
@@ -514,7 +514,7 @@ void TaskView::newTask(QString caption, Task *parent)
if ( desktopList.size() == ( unsigned int ) _desktopTracker->desktopCount() )
desktopList.clear();
- QString uid = addTask( taskName, total, session, desktopList, parent );
+ TQString uid = addTask( taskName, total, session, desktopList, parent );
if ( uid.isNull() )
{
KMessageBox::error( 0, i18n(
@@ -525,8 +525,8 @@ void TaskView::newTask(QString caption, Task *parent)
}
}
-QString TaskView::addTask
-( const QString& taskname, long total, long session,
+TQString TaskView::addTask
+( const TQString& taskname, long total, long session,
const DesktopList& desktops, Task* parent )
{
Task *task;
@@ -536,7 +536,7 @@ QString TaskView::addTask
else task = new Task( taskname, total, session, desktops, this );
task->setUid( _storage->addTask( task, parent ) );
- QString taskuid=task->uid();
+ TQString taskuid=task->uid();
if ( ! taskuid.isNull() )
{
_desktopTracker->registerForDesktops( task, desktops );
@@ -574,8 +574,8 @@ void TaskView::editTask()
task->time(),
task->sessionTime() );
int result = dialog->exec();
- if (result == QDialog::Accepted) {
- QString taskName = i18n("Unnamed Task");
+ if (result == TQDialog::Accepted) {
+ TQString taskName = i18n("Unnamed Task");
if (!dialog->taskName().isEmpty()) {
taskName = dialog->taskName();
}
@@ -612,9 +612,9 @@ void TaskView::editTask()
// return;
// bool ok;
-// QString comment = KLineEditDlg::getText(i18n("Comment"),
+// TQString comment = KLineEditDlg::getText(i18n("Comment"),
// i18n("Log comment for task '%1':").arg(task->name()),
-// QString(), &ok, this);
+// TQString(), &ok, this);
// if ( ok )
// task->addComment( comment, _storage );
//}
@@ -681,7 +681,7 @@ void TaskView::deleteTask(bool markingascomplete)
}
else
{
- QString uid=task->uid();
+ TQString uid=task->uid();
task->remove(activeTasks, _storage);
task->removeFromView();
if( _preferences ) _preferences->deleteEntry( uid ); // forget if the item was expanded or collapsed
@@ -741,14 +741,14 @@ void TaskView::adaptColumns()
{
setColumnWidth( x, previousColumnWidths[x-1] );
previousColumnWidths[x-1] = HIDDEN_COLUMN;
- setColumnWidthMode( x, QListView::Maximum );
+ setColumnWidthMode( x, TQListView::Maximum );
}
// the column was visible before and were switching it off now
else
if( ! _preferences->displayColumn(x-1)
&& previousColumnWidths[x-1] == HIDDEN_COLUMN )
{
- setColumnWidthMode( x, QListView::Manual ); // we don't want update()
+ setColumnWidthMode( x, TQListView::Manual ); // we don't want update()
// to resize/unhide the col
previousColumnWidths[x-1] = columnWidth( x );
setColumnWidth( x, 0 );
@@ -766,7 +766,7 @@ void TaskView::deletingTask(Task* deletedTask)
emit tasksChanged( activeTasks);
}
-void TaskView::iCalFileChanged(QString file)
+void TaskView::iCalFileChanged(TQString file)
// User might have picked a new file in the preferences dialog.
// This is not iCalFileModified.
{
@@ -779,8 +779,8 @@ void TaskView::iCalFileChanged(QString file)
}
}
-QValueList<HistoryEvent> TaskView::getHistory(const QDate& from,
- const QDate& to) const
+TQValueList<HistoryEvent> TaskView::getHistory(const TQDate& from,
+ const TQDate& to) const
{
return _storage->getHistory(from, to);
}
@@ -860,7 +860,7 @@ void TaskView::clipSession()
void TaskView::clipHistory()
{
PrintDialog dialog;
- if (dialog.exec()== QDialog::Accepted)
+ if (dialog.exec()== TQDialog::Accepted)
{
TimeKard t;
KApplication::clipboard()->