diff options
Diffstat (limited to 'kpilot/kpilot/memoWidget.cc')
-rw-r--r-- | kpilot/kpilot/memoWidget.cc | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/kpilot/kpilot/memoWidget.cc b/kpilot/kpilot/memoWidget.cc index 0b5e16b4..143167ae 100644 --- a/kpilot/kpilot/memoWidget.cc +++ b/kpilot/kpilot/memoWidget.cc @@ -35,18 +35,18 @@ #include <pi-macros.h> #include <pi-dlp.h> -#include <qdir.h> -#include <qptrlist.h> -#include <qlistbox.h> -#include <qfile.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qdom.h> -#include <qtextstream.h> -#include <qwhatsthis.h> -#include <qlabel.h> -#include <qdatetime.h> -#include <qptrlist.h> +#include <tqdir.h> +#include <tqptrlist.h> +#include <tqlistbox.h> +#include <tqfile.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqdom.h> +#include <tqtextstream.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> +#include <tqdatetime.h> +#include <tqptrlist.h> #include <kapplication.h> #include <kmessagebox.h> @@ -70,12 +70,12 @@ public: ~Private() { KPILOT_DELETE(fMemoAppInfo); } ; PilotMemoInfo *fMemoAppInfo; - QPtrList<PilotMemo> fMemoList; + TQPtrList<PilotMemo> fMemoList; } ; -MemoWidget::MemoWidget(QWidget * parent, - const QString & path) : +MemoWidget::MemoWidget(TQWidget * parent, + const TQString & path) : PilotComponent(parent, "component_memo", path), fTextWidget(0L), d(new Private()), @@ -221,74 +221,74 @@ void MemoWidget::setupWidget() { FUNCTIONSETUP; - QLabel *label = NULL; - QPushButton *button = NULL; - QGridLayout *grid = new QGridLayout(this, 5, 4, SPACING); - QString wt; + TQLabel *label = NULL; + TQPushButton *button = NULL; + TQGridLayout *grid = new TQGridLayout(this, 5, 4, SPACING); + TQString wt; - fCatList = new QComboBox(this); + fCatList = new TQComboBox(this); grid->addWidget(fCatList, 0, 1); - connect(fCatList, SIGNAL(activated(int)), - this, SLOT(slotSetCategory(int))); - QWhatsThis::add(fCatList, + connect(fCatList, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotSetCategory(int))); + TQWhatsThis::add(fCatList, i18n("Select the category of addresses\n" "to display here.")); (void) i18n("Memos:"); - label = new QLabel(i18n("Category:"), this); + label = new TQLabel(i18n("Category:"), this); label->setBuddy(fCatList); grid->addWidget(label, 0, 0); - fListBox = new QListBox(this); + fListBox = new TQListBox(this); grid->addMultiCellWidget(fListBox, 1, 1, 0, 1); - connect(fListBox, SIGNAL(highlighted(int)), - this, SLOT(slotShowMemo(int))); - connect(fListBox, SIGNAL(selectionChanged()), - this,SLOT(slotUpdateButtons())); - QWhatsThis::add(fListBox, + connect(fListBox, TQT_SIGNAL(highlighted(int)), + this, TQT_SLOT(slotShowMemo(int))); + connect(fListBox, TQT_SIGNAL(selectionChanged()), + this,TQT_SLOT(slotUpdateButtons())); + TQWhatsThis::add(fListBox, i18n("This list displays all the memos\n" "in the selected category. Click on\n" "one to display it to the right.")); - label = new QLabel(i18n("Memo text:"), this); + label = new TQLabel(i18n("Memo text:"), this); grid->addWidget(label, 0, 2); fTextWidget = new KTextEdit(this, "textArea"); fTextWidget->setWordWrap(KTextEdit::WidgetWidth); fTextWidget->setTextFormat(Qt::PlainText); grid->addMultiCellWidget(fTextWidget, 1, 4, 2, 2); - QWhatsThis::add(fTextWidget, + TQWhatsThis::add(fTextWidget, i18n("The text of the selected memo appears here.")); fTextWidget->setReadOnly(!KPilotSettings::internalEditors()); - button = new QPushButton(i18n("Import Memo..."), this); + button = new TQPushButton(i18n("Import Memo..."), this); grid->addWidget(button, 2, 0); - connect(button, SIGNAL(clicked()), this, SLOT(slotImportMemo())); + connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotImportMemo())); wt = KPilotSettings::internalEditors() ? i18n ("Read a text file and add it to the Pilot's memo database.") : i18n("<qt><i>Import is disabled by the 'internal editors' setting.</i></qt>"); - QWhatsThis::add(button,wt); + TQWhatsThis::add(button,wt); - fExportButton = new QPushButton(i18n("Export Memo..."), this); + fExportButton = new TQPushButton(i18n("Export Memo..."), this); grid->addWidget(fExportButton, 2, 1); - connect(fExportButton, SIGNAL(clicked()), this, - SLOT(slotExportMemo())); - QWhatsThis::add(fExportButton, + connect(fExportButton, TQT_SIGNAL(clicked()), this, + TQT_SLOT(slotExportMemo())); + TQWhatsThis::add(fExportButton, i18n("Write the selected memo to a file.")); - fDeleteButton = new QPushButton(i18n("Delete Memo"), this); + fDeleteButton = new TQPushButton(i18n("Delete Memo"), this); grid->addWidget(fDeleteButton, 3, 1); - connect(fDeleteButton, SIGNAL(clicked()), this, - SLOT(slotDeleteMemo())); + connect(fDeleteButton, TQT_SIGNAL(clicked()), this, + TQT_SLOT(slotDeleteMemo())); wt = KPilotSettings::internalEditors() ? i18n("Delete the selected memo.") : i18n("<qt><i>Deleting is disabled by the 'internal editors' setting.</i></qt>") ; - QWhatsThis::add(fDeleteButton, wt); + TQWhatsThis::add(fDeleteButton, wt); - button = new QPushButton(i18n("Add Memo"), this); + button = new TQPushButton(i18n("Add Memo"), this); grid->addWidget(button, 3, 0); - connect(button, SIGNAL(clicked()), this, SLOT(slotAddMemo())); - QWhatsThis::add(button,i18n("Add a new memo to the database.")); + connect(button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddMemo())); + TQWhatsThis::add(button,i18n("Add a new memo to the database.")); } void MemoWidget::slotUpdateButtons() @@ -552,14 +552,14 @@ void MemoWidget::saveChangedMemo() writeMemo(currentMemo); } -/* virtual */ bool MemoWidget::preHotSync(QString &) +/* virtual */ bool MemoWidget::preHotSync(TQString &) { FUNCTIONSETUP; saveChangedMemo(); return true; } -bool MemoWidget::addMemo(const QString &s, int category) +bool MemoWidget::addMemo(const TQString &s, int category) { FUNCTIONSETUP; @@ -591,7 +591,7 @@ void MemoWidget::slotAddMemo() FUNCTIONSETUP; int currentCatID = findSelectedCategory(fCatList, d->fMemoAppInfo->categoryInfo(), true); - addMemo(QDateTime::currentDateTime().toString(), currentCatID); + addMemo(TQDateTime::currentDateTime().toString(), currentCatID); } void MemoWidget::slotImportMemo() @@ -602,11 +602,11 @@ void MemoWidget::slotImportMemo() int currentCatID = findSelectedCategory(fCatList, d->fMemoAppInfo->categoryInfo(), true); - QString fileName = KFileDialog::getOpenFileName(); + TQString fileName = KFileDialog::getOpenFileName(); if (!fileName.isEmpty()) { - QFile importFile(fileName); + TQFile importFile(fileName); if (importFile.open(IO_ReadOnly) == FALSE) { @@ -620,8 +620,8 @@ void MemoWidget::slotImportMemo() return; } - QTextStream stream(&importFile); - QString memoText = stream.read(); + TQTextStream stream(&importFile); + TQString memoText = stream.read(); addMemo(memoText, currentCatID); } } @@ -635,22 +635,22 @@ void MemoWidget::slotExportMemo() if (index == 0) return; - QString data; + TQString data; - const QString filter = CSL1("*|Plain text output\n*.xml|XML output"); - QString fileName; + const TQString filter = CSL1("*|Plain text output\n*.xml|XML output"); + TQString fileName; - KFileDialog kfile( QString::null , filter, fExportButton , "memoSave" , true ); + KFileDialog kfile( TQString::null , filter, fExportButton , "memoSave" , true ); kfile.setOperationMode( KFileDialog::Saving ); - if ( kfile.exec() == QDialog::Accepted ) { + if ( kfile.exec() == TQDialog::Accepted ) { fileName = kfile.selectedFile(); } if (fileName.isEmpty()) return; - QPtrList<PilotListItem> menu_items; + TQPtrList<PilotListItem> menu_items; for (int x = 0; x < index; x++){ if (fListBox->item(x)->isSelected()){ @@ -671,12 +671,12 @@ void MemoWidget::slotExportMemo() return; } -bool MemoWidget::saveAsText(const QString &fileName,const QPtrList<PilotListItem> &memo_list) +bool MemoWidget::saveAsText(const TQString &fileName,const TQPtrList<PilotListItem> &memo_list) { - QFile f( fileName ); - QTextStream stream(&f); + TQFile f( fileName ); + TQTextStream stream(&f); - if ( QFile::exists( fileName ) ) + if ( TQFile::exists( fileName ) ) { if( !f.open(IO_ReadWrite | IO_Append) ) { @@ -691,7 +691,7 @@ bool MemoWidget::saveAsText(const QString &fileName,const QPtrList<PilotListItem } } - QPtrListIterator<PilotListItem> it(memo_list); + TQPtrListIterator<PilotListItem> it(memo_list); for ( ; it.current(); ++it ) { PilotListItem *p = it.current(); @@ -703,12 +703,12 @@ bool MemoWidget::saveAsText(const QString &fileName,const QPtrList<PilotListItem return true; } -bool MemoWidget::saveAsXML(const QString &fileName,const QPtrList<PilotListItem> &memo_list) +bool MemoWidget::saveAsXML(const TQString &fileName,const TQPtrList<PilotListItem> &memo_list) { - QDomDocument doc( CSL1("kpilotmemos") ); - QFile f( fileName ); - QTextStream stream( &f ); - QDomElement memos; + TQDomDocument doc( CSL1("kpilotmemos") ); + TQFile f( fileName ); + TQTextStream stream( &f ); + TQDomElement memos; int append = 0; @@ -755,7 +755,7 @@ bool MemoWidget::saveAsXML(const QString &fileName,const QPtrList<PilotListItem> f.close(); // These are temporary, and should be retrieved from the pilot stuff - QString mpilotid; + TQString mpilotid; mpilotid = "1"; // End of temp variables @@ -769,31 +769,31 @@ bool MemoWidget::saveAsXML(const QString &fileName,const QPtrList<PilotListItem> doc.appendChild ( memos ); } - QPtrListIterator<PilotListItem> it(memo_list); + TQPtrListIterator<PilotListItem> it(memo_list); for ( ; it.current(); ++it ) { PilotListItem *p = it.current(); PilotMemo *theMemo = (PilotMemo *) p->rec(); - QDomElement memo = doc.createElement( CSL1("memo") ); + TQDomElement memo = doc.createElement( CSL1("memo") ); memo.setAttribute ( CSL1("pilotid") , mpilotid ); memos.appendChild ( memo ); - //QDomElement category = doc.createElement( "category" ); + //TQDomElement category = doc.createElement( "category" ); //head.appendChild ( category ); // - //QDomText categorytext = doc.createTextNode( memo->category() ); + //TQDomText categorytext = doc.createTextNode( memo->category() ); //category.appendChild ( categorytext ); //FIXME - QDomElement title = doc.createElement(CSL1("title" )); + TQDomElement title = doc.createElement(CSL1("title" )); memo.appendChild ( title ); - QDomText titletext = doc.createTextNode( theMemo->shortTitle() ); + TQDomText titletext = doc.createTextNode( theMemo->shortTitle() ); title.appendChild ( titletext ); - QDomText body = doc.createTextNode( theMemo->text() ); + TQDomText body = doc.createTextNode( theMemo->text() ); memo.appendChild ( body ); } if ( !f.open(IO_WriteOnly ) ) return false; |