diff options
Diffstat (limited to 'lib/kofficecore/KoDocumentInfoDlg.cpp')
-rw-r--r-- | lib/kofficecore/KoDocumentInfoDlg.cpp | 214 |
1 files changed, 107 insertions, 107 deletions
diff --git a/lib/kofficecore/KoDocumentInfoDlg.cpp b/lib/kofficecore/KoDocumentInfoDlg.cpp index f9ad8904..8fa70f07 100644 --- a/lib/kofficecore/KoDocumentInfoDlg.cpp +++ b/lib/kofficecore/KoDocumentInfoDlg.cpp @@ -33,12 +33,12 @@ #include <unistd.h> #include <assert.h> -#include <qlabel.h> -#include <qbuffer.h> -#include <qdom.h> -#include <qdir.h> -#include <qvbox.h> -#include <qdatetime.h> +#include <tqlabel.h> +#include <tqbuffer.h> +#include <tqdom.h> +#include <tqdir.h> +#include <tqvbox.h> +#include <tqdatetime.h> #include <kabc/addressee.h> #include <kabc/stdaddressbook.h> @@ -49,10 +49,10 @@ #include <kdebug.h> #include <ktempfile.h> #include <kmimetype.h> -#include <qlayout.h> +#include <tqlayout.h> #include <klistview.h> -#include <qgrid.h> -#include <qmap.h> +#include <tqgrid.h> +#include <tqmap.h> #include <kfilterdev.h> #include <klineedit.h> #include <ktextedit.h> @@ -79,9 +79,9 @@ public: KDialogBase *m_dialog; }; -KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent, const char *name, +KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, TQWidget *tqparent, const char *name, KDialogBase *dialog ) -: QObject( parent, "docinfodlg" ) +: TQObject( tqparent, "docinfodlg" ) { d = new KoDocumentInfoDlgPrivate; d->m_info = docInfo; @@ -94,14 +94,14 @@ KoDocumentInfoDlg::KoDocumentInfoDlg( KoDocumentInfo *docInfo, QWidget *parent, d->m_dialog = new KDialogBase( KDialogBase::Tabbed, i18n( "Document Information" ), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name, true, false ); - d->m_dialog->setInitialSize( QSize( 500, 500 ) ); + KDialogBase::Ok, tqparent, name, true, false ); + d->m_dialog->setInitialSize( TQSize( 500, 500 ) ); d->m_bDeleteDialog = true; } - QStringList pages = docInfo->pages(); - QStringList::ConstIterator it = pages.begin(); - QStringList::ConstIterator end = pages.end(); + TQStringList pages = docInfo->pages(); + TQStringList::ConstIterator it = pages.begin(); + TQStringList::ConstIterator end = pages.end(); for (; it != end; ++it ) { KoDocumentInfoPage *pg = docInfo->page( *it ); @@ -174,24 +174,24 @@ void KoDocumentInfoDlg::loadFromKABC() void KoDocumentInfoDlg::deleteInfo() { - d->m_authorWidget->leFullName->setText( QString::null ); - d->m_authorWidget->leInitial->setText( QString::null ); - d->m_authorWidget->leAuthorTitle->setText( QString::null ); - d->m_authorWidget->leCompany->setText( QString::null ); - d->m_authorWidget->leEmail->setText( QString::null ); - d->m_authorWidget->leTelephoneHome->setText( QString::null ); - d->m_authorWidget->leTelephoneWork->setText( QString::null ); - d->m_authorWidget->leFax->setText( QString::null ); - d->m_authorWidget->leCountry->setText( QString::null ); - d->m_authorWidget->lePostalCode->setText( QString::null ); - d->m_authorWidget->leCity->setText( QString::null ); - d->m_authorWidget->leStreet->setText( QString::null ); + d->m_authorWidget->leFullName->setText( TQString() ); + d->m_authorWidget->leInitial->setText( TQString() ); + d->m_authorWidget->leAuthorTitle->setText( TQString() ); + d->m_authorWidget->leCompany->setText( TQString() ); + d->m_authorWidget->leEmail->setText( TQString() ); + d->m_authorWidget->leTelephoneHome->setText( TQString() ); + d->m_authorWidget->leTelephoneWork->setText( TQString() ); + d->m_authorWidget->leFax->setText( TQString() ); + d->m_authorWidget->leCountry->setText( TQString() ); + d->m_authorWidget->lePostalCode->setText( TQString() ); + d->m_authorWidget->leCity->setText( TQString() ); + d->m_authorWidget->leStreet->setText( TQString() ); emit changed(); } void KoDocumentInfoDlg::resetMetaData() { - QString s = KGlobal::locale()->formatDateTime( QDateTime::currentDateTime() ); + TQString s = KGlobal::locale()->formatDateTime( TQDateTime::tqcurrentDateTime() ); d->m_aboutWidget->labelCreated->setText( s + ", " + d->m_info->creator() ); d->m_aboutWidget->labelModified->setText( "" ); d->m_aboutWidget->labelRevision->setText( "0" ); @@ -200,11 +200,11 @@ void KoDocumentInfoDlg::resetMetaData() void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "Author" ) ); d->m_authorWidget = new KoDocumentInfoAuthorWidget( page ); d->m_authorWidget->labelAuthor->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 48 ) ); - d->m_authorWidget->pbLoadKABC->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Small ) ) ); - d->m_authorWidget->pbDelete->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "eraser", KIcon::Small ) ) ); + d->m_authorWidget->pbLoadKABC->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Small ) ) ); + d->m_authorWidget->pbDelete->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "eraser", KIcon::Small ) ) ); d->m_authorWidget->leFullName->setText( authorInfo->fullName() ); d->m_authorWidget->leInitial->setText( authorInfo->initial() ); @@ -220,53 +220,53 @@ void KoDocumentInfoDlg::addAuthorPage( KoDocumentInfoAuthor *authorInfo ) d->m_authorWidget->leStreet->setText( authorInfo->street() ); d->m_authorWidget->leAuthorPosition->setText( authorInfo->position() ); - connect( d->m_authorWidget->leFullName, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leInitial, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leAuthorTitle, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCompany, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leEmail, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leTelephoneWork, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leTelephoneHome, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leFax, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCountry, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->lePostalCode, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leCity, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leStreet, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->leAuthorPosition, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_authorWidget->pbLoadKABC, SIGNAL( clicked() ), - this, SLOT( loadFromKABC() ) ); - connect( d->m_authorWidget->pbDelete, SIGNAL( clicked() ), - this, SLOT( deleteInfo() ) ); + connect( d->m_authorWidget->leFullName, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leInitial, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leAuthorTitle, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCompany, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leEmail, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leTelephoneWork, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leTelephoneHome, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leFax, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCountry, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->lePostalCode, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leCity, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leStreet, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->leAuthorPosition, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_authorWidget->pbLoadKABC, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( loadFromKABC() ) ); + connect( d->m_authorWidget->pbDelete, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( deleteInfo() ) ); } void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "General" ) ); d->m_aboutWidget = new KoDocumentInfoAboutWidget( page ); - d->m_aboutWidget->pbReset->setIconSet( QIconSet( KGlobal::iconLoader()->loadIcon( "reload", KIcon::Small ) ) ); - KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->parent() ); + d->m_aboutWidget->pbReset->setIconSet( TQIconSet( KGlobal::iconLoader()->loadIcon( "reload", KIcon::Small ) ) ); + KoDocument* doc = dynamic_cast< KoDocument* >( d->m_info->tqparent() ); if ( doc ) { d->m_aboutWidget->leDocFile->setText( doc->file() ); d->m_aboutWidget->labelType->setText( KMimeType::mimeType( doc->mimeType() )->comment() ); d->m_aboutWidget->pixmapLabel->setPixmap( KMimeType::mimeType( doc->mimeType() )->pixmap( KIcon::Desktop, 48 ) ); } - if ( aboutInfo->creationDate() != QString::null ) + if ( aboutInfo->creationDate() != TQString() ) d->m_aboutWidget->labelCreated->setText( aboutInfo->creationDate() + ", " + aboutInfo->initialCreator() ); - if ( aboutInfo->modificationDate() != QString::null ) + if ( aboutInfo->modificationDate() != TQString() ) d->m_aboutWidget->labelModified->setText( aboutInfo->modificationDate() + ", " + d->m_info->creator() ); d->m_aboutWidget->labelRevision->setText( aboutInfo->editingCycles() ); d->m_aboutWidget->leDocTitle->setText( aboutInfo->title() ); @@ -274,33 +274,33 @@ void KoDocumentInfoDlg::addAboutPage( KoDocumentInfoAbout *aboutInfo ) d->m_aboutWidget->leDocKeywords->setText( aboutInfo->keywords() ); d->m_aboutWidget->meDocAbstract->setText( aboutInfo->abstract() ); - connect( d->m_aboutWidget->leDocTitle, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->meDocAbstract, SIGNAL( textChanged() ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->leDocSubject, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->leDocKeywords, SIGNAL( textChanged( const QString & ) ), - this, SIGNAL( changed() ) ); - connect( d->m_aboutWidget->pbReset, SIGNAL( clicked() ), - aboutInfo, SLOT( resetMetaData() ) ); - connect( d->m_aboutWidget->pbReset, SIGNAL( clicked() ), - this, SLOT( resetMetaData() ) ); + connect( d->m_aboutWidget->leDocTitle, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->meDocAbstract, TQT_SIGNAL( textChanged() ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->leDocSubject, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->leDocKeywords, TQT_SIGNAL( textChanged( const TQString & ) ), + this, TQT_SIGNAL( changed() ) ); + connect( d->m_aboutWidget->pbReset, TQT_SIGNAL( clicked() ), + aboutInfo, TQT_SLOT( resetMetaData() ) ); + connect( d->m_aboutWidget->pbReset, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( resetMetaData() ) ); } void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMetadataInfo ) { - QVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) ); + TQVBox *page = d->m_dialog->addVBoxPage( i18n( "User-Defined Metadata" ) ); d->m_metaWidget = new KoDocumentInfoUserMetadataWidget( page ); d->m_metaWidget->metaListView->addColumn( "Name" ); d->m_metaWidget->metaListView->setFullWidth( true ); - QMap<QString, QString>::iterator it; + TQMap<TQString, TQString>::iterator it; for ( it = userMetadataInfo->metadataList()->begin(); it != userMetadataInfo->metadataList()->end(); ++it ) { - QString name = it.key(); - QString value = it.data(); + TQString name = it.key(); + TQString value = it.data(); KListViewItem* it = new KListViewItem( d->m_metaWidget->metaListView, name, value ); it->setPixmap( 0, KGlobal::iconLoader()->loadIcon( "text", KIcon::Small ) ); } @@ -308,9 +308,9 @@ void KoDocumentInfoDlg::addUserMetadataPage( KoDocumentInfoUserMetadata *userMet void KoDocumentInfoDlg::save() { - QStringList pages = d->m_info->pages(); - QStringList::ConstIterator it = pages.begin(); - QStringList::ConstIterator end = pages.end(); + TQStringList pages = d->m_info->pages(); + TQStringList::ConstIterator it = pages.begin(); + TQStringList::ConstIterator end = pages.end(); bool saveInfo=false; for (; it != end; ++it ) { @@ -385,7 +385,7 @@ public: KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props, const char *, - const QStringList & ) + const TQStringList & ) : KPropsDlgPlugin( props ) { d = new KoDocumentInfoPropsPagePrivate; @@ -416,18 +416,18 @@ KoDocumentInfoPropsPage::KoDocumentInfoPropsPage( KPropertiesDialog *props, { d->m_docInfoFile = static_cast<const KTarFile *>( entry ); - QBuffer buffer( d->m_docInfoFile->data() ); + TQBuffer buffer( d->m_docInfoFile->data() ); buffer.open( IO_ReadOnly ); - QDomDocument doc; + TQDomDocument doc; doc.setContent( &buffer ); d->m_info->load( doc ); } d->m_dlg = new KoDocumentInfoDlg( d->m_info, 0, 0, props ); - connect( d->m_dlg, SIGNAL( changed() ), - this, SIGNAL( changed() ) ); + connect( d->m_dlg, TQT_SIGNAL( changed() ), + this, TQT_SIGNAL( changed() ) ); } KoDocumentInfoPropsPage::~KoDocumentInfoPropsPage() @@ -447,10 +447,10 @@ void KoDocumentInfoPropsPage::applyChanges() struct stat statBuff; - if ( stat( QFile::encodeName( d->m_url.path() ), &statBuff ) != 0 ) + if ( stat( TQFile::encodeName( d->m_url.path() ), &statBuff ) != 0 ) return; - KTempFile tempFile( d->m_url.path(), QString::null, statBuff.st_mode ); + KTempFile tempFile( d->m_url.path(), TQString(), statBuff.st_mode ); tempFile.setAutoDelete( true ); @@ -468,7 +468,7 @@ void KoDocumentInfoPropsPage::applyChanges() KMimeType::Ptr mimeType = KMimeType::findByURL( d->m_url, 0, true ); if ( mimeType && dynamic_cast<KFilterDev *>( d->m_dst->device() ) != 0 ) { - QCString appIdentification( "KOffice " ); // We are limited in the number of chars. + TQCString appIdentification( "KOffice " ); // We are limited in the number of chars. appIdentification += mimeType->name().latin1(); appIdentification += '\004'; // Two magic bytes to make the identification appIdentification += '\006'; // more reliable (DF) @@ -477,9 +477,9 @@ void KoDocumentInfoPropsPage::applyChanges() bool docInfoSaved = false; - QStringList entries = root->entries(); - QStringList::ConstIterator it = entries.begin(); - QStringList::ConstIterator end = entries.end(); + TQStringList entries = root->entries(); + TQStringList::ConstIterator it = entries.begin(); + TQStringList::ConstIterator end = entries.end(); for (; it != end; ++it ) { const KTarEntry *entry = root->entry( *it ); @@ -487,13 +487,13 @@ void KoDocumentInfoPropsPage::applyChanges() assert( entry ); if ( entry->name() == "documentinfo.xml" || - ( !docInfoSaved && !entries.contains( "documentinfo.xml" ) ) ) + ( !docInfoSaved && !entries.tqcontains( "documentinfo.xml" ) ) ) { d->m_dlg->save(); - QBuffer buffer; + TQBuffer buffer; buffer.open( IO_WriteOnly ); - QTextStream str( &buffer ); + TQTextStream str( &buffer ); str << d->m_info->save(); buffer.close(); @@ -504,19 +504,19 @@ void KoDocumentInfoPropsPage::applyChanges() docInfoSaved = true; } else - copy( QString::null, entry ); + copy( TQString(), entry ); } d->m_dst->close(); - QDir dir; + TQDir dir; dir.rename( tempFile.name(), d->m_url.path() ); delete d->m_dst; d->m_dst = 0; } -void KoDocumentInfoPropsPage::copy( const QString &path, const KArchiveEntry *entry ) +void KoDocumentInfoPropsPage::copy( const TQString &path, const KArchiveEntry *entry ) { kdDebug( 30003 ) << "copy " << entry->name() << endl; if ( entry->isFile() ) @@ -534,16 +534,16 @@ void KoDocumentInfoPropsPage::copy( const QString &path, const KArchiveEntry *en kdDebug( 30003 ) << "dir : " << entry->name() << endl; kdDebug( 30003 ) << "full path is: " << path << entry->name() << endl; - QString p = path + entry->name(); + TQString p = path + entry->name(); if ( p != "/" ) { d->m_dst->writeDir( p, entry->user(), entry->group() ); p.append( "/" ); } - QStringList entries = dir->entries(); - QStringList::ConstIterator it = entries.begin(); - QStringList::ConstIterator end = entries.end(); + TQStringList entries = dir->entries(); + TQStringList::ConstIterator it = entries.begin(); + TQStringList::ConstIterator end = entries.end(); for (; it != end; ++it ) copy( p, dir->entry( *it ) ); } |