summaryrefslogtreecommitdiffstats
path: root/karm/karm_part.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'karm/karm_part.cpp')
-rw-r--r--karm/karm_part.cpp222
1 files changed, 111 insertions, 111 deletions
diff --git a/karm/karm_part.cpp b/karm/karm_part.cpp
index c7729f0fa..c535bec41 100644
--- a/karm/karm_part.cpp
+++ b/karm/karm_part.cpp
@@ -15,14 +15,14 @@
#include <kglobal.h>
#include <klocale.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qmultilineedit.h>
-#include <qpopupmenu.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqmultilineedit.h>
+#include <tqpopupmenu.h>
#include "mainwindow.h"
-karmPart::karmPart( QWidget *parentWidget, const char *widgetName,
- QObject *parent, const char *name )
+karmPart::karmPart( TQWidget *parentWidget, const char *widgetName,
+ TQObject *parent, const char *name )
: DCOPObject ( "KarmDCOPIface" ), KParts::ReadWritePart(parent, name),
_accel ( new KAccel( parentWidget ) ),
_watcher ( new KAccelMenuWatch( _accel, parentWidget ) )
@@ -40,9 +40,9 @@ karmPart::karmPart( QWidget *parentWidget, const char *widgetName,
setWidget(_taskView);
// create our actions
- KStdAction::open(this, SLOT(fileOpen()), actionCollection());
- KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
- KStdAction::save(this, SLOT(save()), actionCollection());
+ KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
+ KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection());
+ KStdAction::save(this, TQT_SLOT(save()), actionCollection());
makeMenus();
@@ -50,29 +50,29 @@ karmPart::karmPart( QWidget *parentWidget, const char *widgetName,
// connections
- connect( _taskView, SIGNAL( totalTimesChanged( long, long ) ),
- this, SLOT( updateTime( long, long ) ) );
- connect( _taskView, SIGNAL( selectionChanged ( QListViewItem * )),
- this, SLOT(slotSelectionChanged()));
- connect( _taskView, SIGNAL( updateButtons() ),
- this, SLOT(slotSelectionChanged()));
+ connect( _taskView, TQT_SIGNAL( totalTimesChanged( long, long ) ),
+ this, TQT_SLOT( updateTime( long, long ) ) );
+ connect( _taskView, TQT_SIGNAL( selectionChanged ( TQListViewItem * )),
+ this, TQT_SLOT(slotSelectionChanged()));
+ connect( _taskView, TQT_SIGNAL( updateButtons() ),
+ this, TQT_SLOT(slotSelectionChanged()));
// Setup context menu request handling
connect( _taskView,
- SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int )),
+ TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint&, int )),
this,
- SLOT( contextMenuRequest( QListViewItem*, const QPoint&, int )));
+ TQT_SLOT( contextMenuRequest( TQListViewItem*, const TQPoint&, int )));
_tray = new KarmTray( this );
- connect( _tray, SIGNAL( quitSelected() ), SLOT( quit() ) );
+ connect( _tray, TQT_SIGNAL( quitSelected() ), TQT_SLOT( quit() ) );
- connect( _taskView, SIGNAL( timersActive() ), _tray, SLOT( startClock() ) );
- connect( _taskView, SIGNAL( timersActive() ), this, SLOT( enableStopAll() ));
- connect( _taskView, SIGNAL( timersInactive() ), _tray, SLOT( stopClock() ) );
- connect( _taskView, SIGNAL( timersInactive() ), this, SLOT( disableStopAll()));
- connect( _taskView, SIGNAL( tasksChanged( QPtrList<Task> ) ),
- _tray, SLOT( updateToolTip( QPtrList<Task> ) ));
+ connect( _taskView, TQT_SIGNAL( timersActive() ), _tray, TQT_SLOT( startClock() ) );
+ connect( _taskView, TQT_SIGNAL( timersActive() ), this, TQT_SLOT( enableStopAll() ));
+ connect( _taskView, TQT_SIGNAL( timersInactive() ), _tray, TQT_SLOT( stopClock() ) );
+ connect( _taskView, TQT_SIGNAL( timersInactive() ), this, TQT_SLOT( disableStopAll()));
+ connect( _taskView, TQT_SIGNAL( tasksChanged( TQPtrList<Task> ) ),
+ _tray, TQT_SLOT( updateToolTip( TQPtrList<Task> ) ));
_taskView->load();
@@ -113,119 +113,119 @@ void karmPart::makeMenus()
*actionNew,
*actionNewSub;
- (void) KStdAction::quit( this, SLOT( quit() ), actionCollection());
- (void) KStdAction::print( this, SLOT( print() ), actionCollection());
- actionKeyBindings = KStdAction::keyBindings( this, SLOT( keyBindings() ),
+ (void) KStdAction::quit( this, TQT_SLOT( quit() ), actionCollection());
+ (void) KStdAction::print( this, TQT_SLOT( print() ), actionCollection());
+ actionKeyBindings = KStdAction::keyBindings( this, TQT_SLOT( keyBindings() ),
actionCollection() );
actionPreferences = KStdAction::preferences(_preferences,
- SLOT(showDialog()),
+ TQT_SLOT(showDialog()),
actionCollection() );
- (void) KStdAction::save( this, SLOT( save() ), actionCollection() );
+ (void) KStdAction::save( this, TQT_SLOT( save() ), actionCollection() );
KAction* actionStartNewSession = new KAction( i18n("Start &New Session"),
0,
this,
- SLOT( startNewSession() ),
+ TQT_SLOT( startNewSession() ),
actionCollection(),
"start_new_session");
KAction* actionResetAll = new KAction( i18n("&Reset All Times"),
0,
this,
- SLOT( resetAllTimes() ),
+ TQT_SLOT( resetAllTimes() ),
actionCollection(),
"reset_all_times");
actionStart = new KAction( i18n("&Start"),
- QString::fromLatin1("1rightarrow"), Key_S,
+ TQString::fromLatin1("1rightarrow"), Key_S,
_taskView,
- SLOT( startCurrentTimer() ), actionCollection(),
+ TQT_SLOT( startCurrentTimer() ), actionCollection(),
"start");
actionStop = new KAction( i18n("S&top"),
- QString::fromLatin1("stop"), 0,
+ TQString::fromLatin1("stop"), 0,
_taskView,
- SLOT( stopCurrentTimer() ), actionCollection(),
+ TQT_SLOT( stopCurrentTimer() ), actionCollection(),
"stop");
actionStopAll = new KAction( i18n("Stop &All Timers"),
Key_Escape,
_taskView,
- SLOT( stopAllTimers() ), actionCollection(),
+ TQT_SLOT( stopAllTimers() ), actionCollection(),
"stopAll");
actionStopAll->setEnabled(false);
actionNew = new KAction( i18n("&New..."),
- QString::fromLatin1("filenew"), CTRL+Key_N,
+ TQString::fromLatin1("filenew"), CTRL+Key_N,
_taskView,
- SLOT( newTask() ), actionCollection(),
+ TQT_SLOT( newTask() ), actionCollection(),
"new_task");
actionNewSub = new KAction( i18n("New &Subtask..."),
- QString::fromLatin1("kmultiple"), CTRL+ALT+Key_N,
+ TQString::fromLatin1("kmultiple"), CTRL+ALT+Key_N,
_taskView,
- SLOT( newSubTask() ), actionCollection(),
+ TQT_SLOT( newSubTask() ), actionCollection(),
"new_sub_task");
actionDelete = new KAction( i18n("&Delete"),
- QString::fromLatin1("editdelete"), Key_Delete,
+ TQString::fromLatin1("editdelete"), Key_Delete,
_taskView,
- SLOT( deleteTask() ), actionCollection(),
+ TQT_SLOT( deleteTask() ), actionCollection(),
"delete_task");
actionEdit = new KAction( i18n("&Edit..."),
- QString::fromLatin1("edit"), CTRL + Key_E,
+ TQString::fromLatin1("edit"), CTRL + Key_E,
_taskView,
- SLOT( editTask() ), actionCollection(),
+ TQT_SLOT( editTask() ), actionCollection(),
"edit_task");
// actionAddComment = new KAction( i18n("&Add Comment..."),
-// QString::fromLatin1("document"),
+// TQString::fromLatin1("document"),
// CTRL+ALT+Key_E,
// _taskView,
-// SLOT( addCommentToTask() ),
+// TQT_SLOT( addCommentToTask() ),
// actionCollection(),
// "add_comment_to_task");
actionMarkAsComplete = new KAction( i18n("&Mark as Complete"),
- QString::fromLatin1("document"),
+ TQString::fromLatin1("document"),
CTRL+Key_M,
_taskView,
- SLOT( markTaskAsComplete() ),
+ TQT_SLOT( markTaskAsComplete() ),
actionCollection(),
"mark_as_complete");
actionMarkAsIncomplete = new KAction( i18n("&Mark as Incomplete"),
- QString::fromLatin1("document"),
+ TQString::fromLatin1("document"),
CTRL+Key_M,
_taskView,
- SLOT( markTaskAsIncomplete() ),
+ TQT_SLOT( markTaskAsIncomplete() ),
actionCollection(),
"mark_as_incomplete");
actionClipTotals = new KAction( i18n("&Copy Totals to Clipboard"),
- QString::fromLatin1("klipper"),
+ TQString::fromLatin1("klipper"),
CTRL+Key_C,
_taskView,
- SLOT( clipTotals() ),
+ TQT_SLOT( clipTotals() ),
actionCollection(),
"clip_totals");
actionClipHistory = new KAction( i18n("Copy &History to Clipboard"),
- QString::fromLatin1("klipper"),
+ TQString::fromLatin1("klipper"),
CTRL+ALT+Key_C,
_taskView,
- SLOT( clipHistory() ),
+ TQT_SLOT( clipHistory() ),
actionCollection(),
"clip_history");
new KAction( i18n("Import &Legacy Flat File..."), 0,
- _taskView, SLOT(loadFromFlatFile()), actionCollection(),
+ _taskView, TQT_SLOT(loadFromFlatFile()), actionCollection(),
"import_flatfile");
new KAction( i18n("&Export to CSV File..."), 0,
- _taskView, SLOT(exportcsvFile()), actionCollection(),
+ _taskView, TQT_SLOT(exportcsvFile()), actionCollection(),
"export_csvfile");
new KAction( i18n("Export &History to CSV File..."), 0,
- this, SLOT(exportcsvHistory()), actionCollection(),
+ this, TQT_SLOT(exportcsvHistory()), actionCollection(),
"export_csvhistory");
new KAction( i18n("Import Tasks From &Planner..."), 0,
- _taskView, SLOT(importPlanner()), actionCollection(),
+ _taskView, TQT_SLOT(importPlanner()), actionCollection(),
"import_planner");
new KAction( i18n("Configure KArm..."), 0,
- _preferences, SLOT(showDialog()), actionCollection(),
+ _preferences, TQT_SLOT(showDialog()), actionCollection(),
"configure_karm");
/*
new KAction( i18n("Import E&vents"), 0,
_taskView,
- SLOT( loadFromKOrgEvents() ), actionCollection(),
+ TQT_SLOT( loadFromKOrgEvents() ), actionCollection(),
"import_korg_events");
*/
@@ -287,12 +287,12 @@ void karmPart::setReadWrite(bool rw)
{
// notify your internal widget of the read-write state
if (rw)
- connect(_taskView, SIGNAL(textChanged()),
- this, SLOT(setModified()));
+ connect(_taskView, TQT_SIGNAL(textChanged()),
+ this, TQT_SLOT(setModified()));
else
{
- disconnect(_taskView, SIGNAL(textChanged()),
- this, SLOT(setModified()));
+ disconnect(_taskView, TQT_SIGNAL(textChanged()),
+ this, TQT_SLOT(setModified()));
}
ReadWritePart::setReadWrite(rw);
@@ -318,7 +318,7 @@ void karmPart::setModified(bool modified)
bool karmPart::openFile()
{
- // m_file is always local so we can use QFile on it
+ // m_file is always local so we can use TQFile on it
_taskView->load(m_file);
// just for fun, set the status bar
@@ -334,12 +334,12 @@ bool karmPart::saveFile()
return false;
// m_file is always local, so we use QFile
- QFile file(m_file);
+ TQFile file(m_file);
if (file.open(IO_WriteOnly) == false)
return false;
- // use QTextStream to dump the text to the file
- QTextStream stream(&file);
+ // use TQTextStream to dump the text to the file
+ TQTextStream stream(&file);
file.close();
@@ -351,7 +351,7 @@ void karmPart::fileOpen()
// this slot is called whenever the File->Open menu is selected,
// the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
// button is clicked
- QString file_name = KFileDialog::getOpenFileName();
+ TQString file_name = KFileDialog::getOpenFileName();
if (file_name.isEmpty() == false)
openURL(file_name);
@@ -360,7 +360,7 @@ void karmPart::fileOpen()
void karmPart::fileSaveAs()
{
// this slot is called whenever the File->Save As menu is selected,
- QString file_name = KFileDialog::getSaveFileName();
+ TQString file_name = KFileDialog::getSaveFileName();
if (file_name.isEmpty() == false)
saveAs(file_name);
}
@@ -387,15 +387,15 @@ karmPartFactory::~karmPartFactory()
s_instance = 0L;
}
-KParts::Part* karmPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
- QObject *parent, const char *name,
- const char *classname, const QStringList &args )
+KParts::Part* karmPartFactory::createPartObject( TQWidget *parentWidget, const char *widgetName,
+ TQObject *parent, const char *name,
+ const char *classname, const TQStringList &args )
{
// Create an instance of our Part
karmPart* obj = new karmPart( parentWidget, widgetName, parent, name );
// See if we are to be read-write or not
- if (QCString(classname) == "KParts::ReadOnlyPart")
+ if (TQCString(classname) == "KParts::ReadOnlyPart")
obj->setReadWrite(false);
return obj;
@@ -421,9 +421,9 @@ extern "C"
}
}
-void karmPart::contextMenuRequest( QListViewItem*, const QPoint& point, int )
+void karmPart::contextMenuRequest( TQListViewItem*, const TQPoint& point, int )
{
- QPopupMenu* pop = dynamic_cast<QPopupMenu*>(
+ TQPopupMenu* pop = dynamic_cast<TQPopupMenu*>(
factory()->container( i18n( "task_popup" ), this ) );
if ( pop )
pop->popup( point );
@@ -435,12 +435,12 @@ void karmPart::contextMenuRequest( QListViewItem*, const QPoint& point, int )
//
//----------------------------------------------------------------------------
-QString karmPart::version() const
+TQString karmPart::version() const
{
return KARM_VERSION;
}
-QString karmPart::deletetodo()
+TQString karmPart::deletetodo()
{
_taskView->deleteTask();
return "";
@@ -451,15 +451,15 @@ bool karmPart::getpromptdelete()
return _preferences->promptDelete();
}
-QString karmPart::setpromptdelete( bool prompt )
+TQString karmPart::setpromptdelete( bool prompt )
{
_preferences->setPromptDelete( prompt );
return "";
}
-QString karmPart::taskIdFromName( const QString &taskname ) const
+TQString karmPart::taskIdFromName( const TQString &taskname ) const
{
- QString rval = "";
+ TQString rval = "";
Task* task = _taskView->first_child();
while ( rval.isEmpty() && task )
@@ -479,17 +479,17 @@ void karmPart::quit()
bool karmPart::save()
{
kdDebug(5970) << "Saving time data to disk." << endl;
- QString err=_taskView->save(); // untranslated error msg.
+ TQString err=_taskView->save(); // untranslated error msg.
// TODO:
/* if (err.isEmpty()) statusBar()->message(i18n("Successfully saved tasks and history"),1807);
else statusBar()->message(i18n(err.ascii()),7707); // no msgbox since save is called when exiting */
return true;
}
-int karmPart::addTask( const QString& taskname )
+int karmPart::addTask( const TQString& taskname )
{
DesktopList desktopList;
- QString uid = _taskView->addTask( taskname, 0, 0, desktopList );
+ TQString uid = _taskView->addTask( taskname, 0, 0, desktopList );
kdDebug(5970) << "MainWindow::addTask( " << taskname << " ) returns " << uid << endl;
if ( uid.length() > 0 ) return 0;
else
@@ -500,20 +500,20 @@ int karmPart::addTask( const QString& taskname )
}
}
-QString karmPart::setPerCentComplete( const QString& taskName, int perCent )
+TQString karmPart::setPerCentComplete( const TQString& taskName, int perCent )
{
int index = 0;
- QString err="no such task";
+ TQString err="no such task";
for (int i=0; i<_taskView->count(); i++)
{
if ((_taskView->item_at_index(i)->name()==taskName))
{
index=i;
- if (err==QString::null) err="task name is abigious";
- if (err=="no such task") err=QString::null;
+ if (err==TQString::null) err="task name is abigious";
+ if (err=="no such task") err=TQString::null;
}
}
- if (err==QString::null)
+ if (err==TQString::null)
{
_taskView->item_at_index(index)->setPercentComplete( perCent, _taskView->storage() );
}
@@ -521,12 +521,12 @@ QString karmPart::setPerCentComplete( const QString& taskName, int perCent )
}
int karmPart::bookTime
-( const QString& taskId, const QString& datetime, long minutes )
+( const TQString& taskId, const TQString& datetime, long minutes )
{
int rval = 0;
- QDate startDate;
- QTime startTime;
- QDateTime startDateTime;
+ TQDate startDate;
+ TQTime startTime;
+ TQDateTime startDateTime;
Task *task, *t;
if ( minutes <= 0 ) rval = KARM_ERR_INVALID_DURATION;
@@ -544,15 +544,15 @@ int karmPart::bookTime
// Parse datetime
if ( !rval )
{
- startDate = QDate::fromString( datetime, Qt::ISODate );
+ startDate = TQDate::fromString( datetime, Qt::ISODate );
if ( datetime.length() > 10 ) // "YYYY-MM-DD".length() = 10
{
- startTime = QTime::fromString( datetime, Qt::ISODate );
+ startTime = TQTime::fromString( datetime, Qt::ISODate );
}
- else startTime = QTime( 12, 0 );
+ else startTime = TQTime( 12, 0 );
if ( startDate.isValid() && startTime.isValid() )
{
- startDateTime = QDateTime( startDate, startTime );
+ startDateTime = TQDateTime( startDate, startTime );
}
else rval = KARM_ERR_INVALID_DATE;
@@ -573,13 +573,13 @@ int karmPart::bookTime
// There was something really bad going on with DCOP when I used a particular
// argument name; if I recall correctly, the argument name was errno.
-QString karmPart::getError( int mkb ) const
+TQString karmPart::getError( int mkb ) const
{
if ( mkb <= KARM_MAX_ERROR_NO ) return m_error[ mkb ];
else return i18n( "Invalid error number: %1" ).arg( mkb );
}
-int karmPart::totalMinutesForTaskId( const QString& taskId )
+int karmPart::totalMinutesForTaskId( const TQString& taskId )
{
int rval = 0;
Task *task, *t;
@@ -608,9 +608,9 @@ int karmPart::totalMinutesForTaskId( const QString& taskId )
return rval;
}
-QString karmPart::_hasTask( Task* task, const QString &taskname ) const
+TQString karmPart::_hasTask( Task* task, const TQString &taskname ) const
{
- QString rval = "";
+ TQString rval = "";
if ( task->name() == taskname )
{
rval = task->uid();
@@ -627,7 +627,7 @@ QString karmPart::_hasTask( Task* task, const QString &taskname ) const
return rval;
}
-Task* karmPart::_hasUid( Task* task, const QString &uid ) const
+Task* karmPart::_hasUid( Task* task, const TQString &uid ) const
{
Task *rval = NULL;
@@ -646,9 +646,9 @@ Task* karmPart::_hasUid( Task* task, const QString &uid ) const
return rval;
}
-QString karmPart::starttimerfor( const QString& taskname )
+TQString karmPart::starttimerfor( const TQString& taskname )
{
- QString err="no such task";
+ TQString err="no such task";
for (int i=0; i<_taskView->count(); i++)
{
if ((_taskView->item_at_index(i)->name()==taskname))
@@ -660,9 +660,9 @@ QString karmPart::starttimerfor( const QString& taskname )
return err;
}
-QString karmPart::stoptimerfor( const QString& taskname )
+TQString karmPart::stoptimerfor( const TQString& taskname )
{
- QString err="no such task";
+ TQString err="no such task";
for (int i=0; i<_taskView->count(); i++)
{
if ((_taskView->item_at_index(i)->name()==taskname))
@@ -674,21 +674,21 @@ QString karmPart::stoptimerfor( const QString& taskname )
return err;
}
-QString karmPart::exportcsvfile( QString filename, QString from, QString to, int type, bool decimalMinutes, bool allTasks, QString delimiter, QString quote )
+TQString karmPart::exportcsvfile( TQString filename, TQString from, TQString to, int type, bool decimalMinutes, bool allTasks, TQString delimiter, TQString quote )
{
ReportCriteria rc;
rc.allTasks=allTasks;
rc.decimalMinutes=decimalMinutes;
rc.delimiter=delimiter;
- rc.from=QDate::fromString( from );
+ rc.from=TQDate::fromString( from );
rc.quote=quote;
rc.reportType=(ReportCriteria::REPORTTYPE) type;
- rc.to=QDate::fromString( to );
+ rc.to=TQDate::fromString( to );
rc.url=filename;
return _taskView->report( rc );
}
-QString karmPart::importplannerfile( QString fileName )
+TQString karmPart::importplannerfile( TQString fileName )
{
return _taskView->importPlanner(fileName);
}
@@ -699,5 +699,5 @@ void karmPart::startNewSession()
_taskView->save();
}
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include "karm_part.moc"