diff options
Diffstat (limited to 'kword/KWStatisticsDialog.cpp')
-rw-r--r-- | kword/KWStatisticsDialog.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/kword/KWStatisticsDialog.cpp b/kword/KWStatisticsDialog.cpp index d323992de..a95154f54 100644 --- a/kword/KWStatisticsDialog.cpp +++ b/kword/KWStatisticsDialog.cpp @@ -20,24 +20,24 @@ #include "KWDocument.h" #include "KWFrameSet.h" #include <klocale.h> -#include <qtabwidget.h> -#include <qvbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qprogressdialog.h> -#include <qcheckbox.h> - -KWStatisticsDialog::KWStatisticsDialog( QWidget *parent, KWDocument *document ) - : KDialogBase(parent, "statistics", true, i18n("Statistics"),KDialogBase::Ok, KDialogBase::Ok, false ) +#include <tqtabwidget.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqprogressdialog.h> +#include <tqcheckbox.h> + +KWStatisticsDialog::KWStatisticsDialog( TQWidget *tqparent, KWDocument *document ) + : KDialogBase(tqparent, "statistics", true, i18n("Statistics"),KDialogBase::Ok, KDialogBase::Ok, false ) { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setMainWidget(page); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, KDialog::spacingHint() ); - QTabWidget *tab = new QTabWidget( page ); - QFrame *pageAll = 0; - QFrame *pageGeneral = 0; - QFrame *pageSelected = 0; + TQTabWidget *tab = new TQTabWidget( page ); + TQFrame *pageAll = 0; + TQFrame *pageGeneral = 0; + TQFrame *pageSelected = 0; for (int i=0; i < 7; ++i) { m_resultLabelAll[i] = 0; m_resultLabelSelected[i] = 0; @@ -45,25 +45,25 @@ KWStatisticsDialog::KWStatisticsDialog( QWidget *parent, KWDocument *document ) m_resultGeneralLabel[i]=0; } m_doc = document; - m_parent = parent; + m_parent = tqparent; m_canceled = true; // add Tab "General" - pageGeneral = new QFrame( this ); + pageGeneral = new TQFrame( this ); tab->addTab( pageGeneral, i18n( "General" ) ); addBoxGeneral( pageGeneral, m_resultGeneralLabel ); calcGeneral( m_resultGeneralLabel ); // add Tab "All" - pageAll = new QFrame( this ); + pageAll = new TQFrame( this ); tab->addTab( pageAll, i18n( "Text" ) ); addBox( pageAll, m_resultLabelAll, true ); m_canceled = true; - pageSelected = new QFrame( this ); + pageSelected = new TQFrame( this ); tab->addTab( pageSelected, i18n( "Selected Text" ) ); // let's see if there's selected text bool b = docHasSelection(); @@ -108,7 +108,7 @@ void KWStatisticsDialog::slotRefreshValue(bool state) m_canceled = false; } -void KWStatisticsDialog::calcGeneral( QLabel **resultLabel ) +void KWStatisticsDialog::calcGeneral( TQLabel **resultLabel ) { KLocale *locale = KGlobal::locale(); @@ -118,7 +118,7 @@ void KWStatisticsDialog::calcGeneral( QLabel **resultLabel ) int part = 0; int nbFrameset = 0; int nbFormula = 0; - QPtrListIterator<KWFrameSet> framesetIt( m_doc->framesetsIterator() ); + TQPtrListIterator<KWFrameSet> framesetIt( m_doc->framesetsIterator() ); for ( framesetIt.toFirst(); framesetIt.current(); ++framesetIt ) { KWFrameSet *frameSet = framesetIt.current(); if ( frameSet && frameSet->isVisible()) @@ -142,7 +142,7 @@ void KWStatisticsDialog::calcGeneral( QLabel **resultLabel ) resultLabel[5]->setText( locale->formatNumber( nbFormula, 0 ) ); } -bool KWStatisticsDialog::calcStats( QLabel **resultLabel, bool selection, bool useFootEndNote ) +bool KWStatisticsDialog::calcStats( TQLabel **resultLabel, bool selection, bool useFootEndNote ) { ulong charsWithSpace = 0L; ulong charsWithoutSpace = 0L; @@ -161,7 +161,7 @@ bool KWStatisticsDialog::calcStats( QLabel **resultLabel, bool selection, bool u // count paragraphs for progress dialog: ulong paragraphs = 0L; - QPtrListIterator<KWFrameSet> framesetIt( m_doc->framesetsIterator() ); + TQPtrListIterator<KWFrameSet> framesetIt( m_doc->framesetsIterator() ); for ( framesetIt.toFirst(); framesetIt.current(); ++framesetIt ) { KWFrameSet *frameSet = framesetIt.current(); if ( (frameSet->frameSetInfo() == KWFrameSet::FI_FOOTNOTE || frameSet->frameSetInfo() == KWFrameSet::FI_BODY) && frameSet->isVisible() ) @@ -172,7 +172,7 @@ bool KWStatisticsDialog::calcStats( QLabel **resultLabel, bool selection, bool u } } } - QProgressDialog progress( i18n( "Counting..." ), i18n( "Cancel" ), paragraphs, this, "count", true ); + TQProgressDialog progress( i18n( "Counting..." ), i18n( "Cancel" ), paragraphs, this, "count", true ); progress.setMinimumDuration( 1000 ); progress.setProgress( 0 ); @@ -203,10 +203,10 @@ bool KWStatisticsDialog::calcStats( QLabel **resultLabel, bool selection, bool u resultLabel[5]->setText( locale->formatNumber( lines, 0 ) ); // add flesch double f = calcFlesch( sentences, words, syllables ); - QString flesch = locale->formatNumber( f , 1 ); + TQString flesch = locale->formatNumber( f , 1 ); if( words < 200 ) { // a kind of warning if too few words: - flesch = i18n("approximately %1").arg( flesch ); + flesch = i18n("approximately %1").tqarg( flesch ); } resultLabel[6]->setText( flesch ); return true; @@ -221,12 +221,12 @@ double KWStatisticsDialog::calcFlesch( ulong sentences, ulong words, ulong sylla return flesch_score; } -void KWStatisticsDialog::addBoxGeneral( QFrame *page, QLabel **resultLabel ) +void KWStatisticsDialog::addBoxGeneral( TQFrame *page, TQLabel **resultLabel ) { // Layout Managers - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, 7 ); - QGroupBox *box = new QGroupBox( i18n( "Statistics" ), page ); - QGridLayout *grid = new QGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, 7 ); + TQGroupBox *box = new TQGroupBox( i18n( "Statistics" ), page ); + TQGridLayout *grid = new TQGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() ); grid->setRowStretch (9, 1); // margins int fHeight = box->fontMetrics().height(); @@ -235,57 +235,57 @@ void KWStatisticsDialog::addBoxGeneral( QFrame *page, QLabel **resultLabel ) grid->addRowSpacing( 0, fHeight ); // insert labels - QLabel *label1 = new QLabel( i18n( "Number of pages:" ), box ); + TQLabel *label1 = new TQLabel( i18n( "Number of pages:" ), box ); grid->addWidget( label1, 1, 0, 1 ); - resultLabel[0] = new QLabel( "", box ); + resultLabel[0] = new TQLabel( "", box ); grid->addWidget( resultLabel[0], 1, 2, 2 ); - QLabel *label2 = new QLabel( i18n( "Number of frames:" ), box ); + TQLabel *label2 = new TQLabel( i18n( "Number of frames:" ), box ); grid->addWidget( label2, 2, 0, 1 ); - resultLabel[1] = new QLabel( "", box ); + resultLabel[1] = new TQLabel( "", box ); grid->addWidget( resultLabel[1], 2, 2, 2 ); - QLabel *label3 = new QLabel( i18n( "Number of pictures:" ), box ); + TQLabel *label3 = new TQLabel( i18n( "Number of pictures:" ), box ); grid->addWidget( label3, 3, 0, 1 ); - resultLabel[2] = new QLabel( "", box ); + resultLabel[2] = new TQLabel( "", box ); grid->addWidget( resultLabel[2], 3, 2, 2 ); - QLabel *label4 = new QLabel( i18n( "Number of tables:" ), box ); + TQLabel *label4 = new TQLabel( i18n( "Number of tables:" ), box ); grid->addWidget( label4, 4, 0, 1 ); - resultLabel[3] = new QLabel( "", box ); + resultLabel[3] = new TQLabel( "", box ); grid->addWidget( resultLabel[3], 4, 2, 2 ); - QLabel *label5 = new QLabel( i18n( "Number of embedded objects:" ), box ); + TQLabel *label5 = new TQLabel( i18n( "Number of embedded objects:" ), box ); grid->addWidget( label5, 5, 0, 1 ); - resultLabel[4] = new QLabel( "", box ); + resultLabel[4] = new TQLabel( "", box ); grid->addWidget( resultLabel[4], 5, 2, 2 ); - QLabel *label6 = new QLabel( i18n( "Number of formula frameset:" ), box ); + TQLabel *label6 = new TQLabel( i18n( "Number of formula frameset:" ), box ); grid->addWidget( label6, 6, 0, 1 ); - resultLabel[5] = new QLabel( "", box ); + resultLabel[5] = new TQLabel( "", box ); grid->addWidget( resultLabel[5], 6, 2, 2 ); topLayout->addWidget( box ); } -void KWStatisticsDialog::addBox( QFrame *page, QLabel **resultLabel, bool calcWithFootNoteCheckbox ) +void KWStatisticsDialog::addBox( TQFrame *page, TQLabel **resultLabel, bool calcWithFootNoteCheckbox ) { // Layout Managers - QVBoxLayout *topLayout = new QVBoxLayout( page, 0, 7 ); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, 7 ); if ( calcWithFootNoteCheckbox ) { - QWidget *w = new QWidget(page); + TQWidget *w = new TQWidget(page); topLayout->addWidget( w ); - QVBoxLayout *noteLayout = new QVBoxLayout( w, KDialog::marginHint(), 0 ); - QCheckBox *calcWithFootNote = new QCheckBox( i18n("&Include text from foot- and endnotes"), w); + TQVBoxLayout *noteLayout = new TQVBoxLayout( w, KDialog::marginHint(), 0 ); + TQCheckBox *calcWithFootNote = new TQCheckBox( i18n("&Include text from foot- and endnotes"), w); noteLayout->addWidget( calcWithFootNote ); - connect( calcWithFootNote, SIGNAL(toggled ( bool )), this, SLOT( slotRefreshValue(bool))); + connect( calcWithFootNote, TQT_SIGNAL(toggled ( bool )), this, TQT_SLOT( slotRefreshValue(bool))); } - QGroupBox *box = new QGroupBox( i18n( "Statistics" ), page ); - QGridLayout *grid = new QGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() ); + TQGroupBox *box = new TQGroupBox( i18n( "Statistics" ), page ); + TQGridLayout *grid = new TQGridLayout( box, 9, 3, KDialog::marginHint(), KDialog::spacingHint() ); grid->setRowStretch (9, 1); // margins @@ -295,43 +295,43 @@ void KWStatisticsDialog::addBox( QFrame *page, QLabel **resultLabel, bool calcWi grid->addRowSpacing( 0, fHeight ); //maximum size for result column (don't know how to do this better..) - QString init = i18n("approximately %1").arg( "00000000" ); + TQString init = i18n("approximately %1").tqarg( "00000000" ); // insert labels - QLabel *label1 = new QLabel( i18n( "Characters including spaces:" ), box ); + TQLabel *label1 = new TQLabel( i18n( "Characters including spaces:" ), box ); grid->addWidget( label1, 1, 0, 1 ); - resultLabel[0] = new QLabel( "", box ); + resultLabel[0] = new TQLabel( "", box ); grid->addWidget( resultLabel[0], 1, 2, 2 ); - QLabel *label2 = new QLabel( i18n( "Characters without spaces:" ), box ); + TQLabel *label2 = new TQLabel( i18n( "Characters without spaces:" ), box ); grid->addWidget( label2, 2, 0, 1 ); - resultLabel[1] = new QLabel( "", box ); + resultLabel[1] = new TQLabel( "", box ); grid->addWidget( resultLabel[1], 2, 2, 2 ); - QLabel *label3 = new QLabel( i18n( "Syllables:" ), box ); + TQLabel *label3 = new TQLabel( i18n( "Syllables:" ), box ); grid->addWidget( label3, 3, 0, 1 ); - resultLabel[2] = new QLabel( "", box ); + resultLabel[2] = new TQLabel( "", box ); grid->addWidget( resultLabel[2], 3, 2, 2 ); - QLabel *label4 = new QLabel( i18n( "Words:" ), box ); + TQLabel *label4 = new TQLabel( i18n( "Words:" ), box ); grid->addWidget( label4, 4, 0, 1 ); - resultLabel[3] = new QLabel( "", box ); + resultLabel[3] = new TQLabel( "", box ); grid->addWidget( resultLabel[3], 4, 2, 2 ); - QLabel *label5 = new QLabel( i18n( "Sentences:" ), box ); + TQLabel *label5 = new TQLabel( i18n( "Sentences:" ), box ); grid->addWidget( label5, 5, 0, 1 ); - resultLabel[4] = new QLabel( "", box ); + resultLabel[4] = new TQLabel( "", box ); grid->addWidget( resultLabel[4], 5, 2, 2 ); - QLabel *label6 = new QLabel( i18n( "Lines:" ), box ); + TQLabel *label6 = new TQLabel( i18n( "Lines:" ), box ); grid->addWidget( label6, 6, 0, 1 ); - resultLabel[5] = new QLabel( "", box ); + resultLabel[5] = new TQLabel( "", box ); grid->addWidget( resultLabel[5], 6, 2, 2 ); - QLabel *label7 = new QLabel( i18n( "Flesch reading ease:" ), box ); + TQLabel *label7 = new TQLabel( i18n( "Flesch reading ease:" ), box ); grid->addWidget( label7, 7, 0, 1 ); - resultLabel[6] = new QLabel( init, box ); + resultLabel[6] = new TQLabel( init, box ); grid->addWidget( resultLabel[6], 7, 2, 2 ); topLayout->addWidget( box ); @@ -339,7 +339,7 @@ void KWStatisticsDialog::addBox( QFrame *page, QLabel **resultLabel, bool calcWi bool KWStatisticsDialog::docHasSelection()const { - QPtrListIterator<KWFrameSet> fsIt( m_doc->framesetsIterator() ); + TQPtrListIterator<KWFrameSet> fsIt( m_doc->framesetsIterator() ); for ( ; fsIt.current(); ++fsIt ) { KWFrameSet *fs = fsIt.current(); |