diff options
Diffstat (limited to 'src/kile/configstructure.cpp')
-rw-r--r-- | src/kile/configstructure.cpp | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/src/kile/configstructure.cpp b/src/kile/configstructure.cpp index 15bd3d7..31e23c7 100644 --- a/src/kile/configstructure.cpp +++ b/src/kile/configstructure.cpp @@ -22,66 +22,66 @@ #include <klocale.h> #include <kiconloader.h> -#include <qlayout.h> -#include <qtabwidget.h> -#include <qgroupbox.h> -#include <qvgroupbox.h> -#include <qframe.h> -#include <qstringlist.h> -#include <qpushbutton.h> -#include <qcombobox.h> -#include <qspinbox.h> -#include <qpainter.h> -#include <qrect.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqtabwidget.h> +#include <tqgroupbox.h> +#include <tqvgroupbox.h> +#include <tqframe.h> +#include <tqstringlist.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> +#include <tqspinbox.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqlabel.h> namespace KileStructure { //////////////////// KileCenteredTableItem //////////////////// -void KileCenteredTableItem::paint(QPainter* p,const QColorGroup& cg,const QRect& cr,bool selected) +void KileCenteredTableItem::paint(TQPainter* p,const TQColorGroup& cg,const TQRect& cr,bool selected) { int w = cr.width(); int h = cr.height(); if (selected && colSpan()==1 ) { - p->fillRect( 0,0,w,h, cg.brush( QColorGroup::Highlight ) ); + p->fillRect( 0,0,w,h, cg.brush( TQColorGroup::Highlight ) ); p->setPen( cg.highlightedText() ); } else { - p->fillRect( 0,0,w,h, Qt::white ); - p->setPen( Qt::black ); + p->fillRect( 0,0,w,h, TQt::white ); + p->setPen( TQt::black ); /* - QFont f( p->font() ); + TQFont f( p->font() ); f.setBold(true); p->setFont(f); */ } - p->drawText( 2,0,w-4,h, Qt::AlignHCenter|AlignVCenter, text() ); + p->drawText( 2,0,w-4,h, TQt::AlignHCenter|AlignVCenter, text() ); } //////////////////// KileTable //////////////////// -KileTable::KileTable(QWidget *dialog, QWidget *parent, const char *name) : QTable(parent,name) +KileTable::KileTable(TQWidget *dialog, TQWidget *tqparent, const char *name) : TQTable(tqparent,name) { setShowGrid(false); - setSelectionMode(QTable::NoSelection); - setFocusStyle(QTable::FollowStyle); + setSelectionMode(TQTable::NoSelection); + setFocusStyle(TQTable::FollowStyle); verticalHeader()->hide(); setLeftMargin(0); - setVScrollBarMode(QScrollView::AlwaysOff); - setHScrollBarMode(QScrollView::AlwaysOff); - setFocusPolicy(QWidget::NoFocus); + setVScrollBarMode(TQScrollView::AlwaysOff); + setHScrollBarMode(TQScrollView::AlwaysOff); + setFocusPolicy(TQ_NoFocus); horizontalHeader()->setResizeEnabled(false); horizontalHeader()->setClickEnabled(false); - connect(this,SIGNAL(clickedCell(KileTable *,int,int)),dialog,SLOT(clickedTable(KileTable *,int,int))); + connect(this,TQT_SIGNAL(clickedCell(KileTable *,int,int)),dialog,TQT_SLOT(clickedTable(KileTable *,int,int))); } -void KileTable::contentsMousePressEvent(QMouseEvent *ev) +void KileTable::contentsMousePressEvent(TQMouseEvent *ev) { ev->accept(); emit( clickedCell( this,rowAt(ev->y()), columnAt(ev->x()) )); @@ -89,18 +89,18 @@ void KileTable::contentsMousePressEvent(QMouseEvent *ev) //////////////////// ConfigStructure //////////////////// -ConfigStructure::ConfigStructure(QWidget *parent, const char *name ) - : QWidget(parent,name) +ConfigStructure::ConfigStructure(TQWidget *tqparent, const char *name ) + : TQWidget(tqparent,name) { m_entries << i18n( "Files" ) << i18n( "Labels" ) << i18n( "References" ) << i18n( "Index" ) << i18n( "Graphics" ) << i18n( "Sectioning" ); - QHBoxLayout *hbox = new QHBoxLayout(this, 5,KDialog::spacingHint() ); + TQHBoxLayout *hbox = new TQHBoxLayout(this, 5,KDialog::spacingHint() ); // Groupbox with entries - QVGroupBox *gb_entries= new QVGroupBox(i18n("Entries"), this ); - QWidget *widget1 = new QWidget(gb_entries); - QVBoxLayout *vbox1 = new QVBoxLayout(widget1, 5,KDialog::spacingHint() ); + TQVGroupBox *gb_entries= new TQVGroupBox(i18n("Entries"), this ); + TQWidget *widget1 = new TQWidget(gb_entries); + TQVBoxLayout *vbox1 = new TQVBoxLayout(widget1, 5,KDialog::spacingHint() ); // table with entries m_entriestable = new KileTable(this,widget1); @@ -108,31 +108,31 @@ ConfigStructure::ConfigStructure(QWidget *parent, const char *name ) m_entriestable->setNumRows(6); m_entriestable->setColumnReadOnly(0,true); - QStringList list1; + TQStringList list1; list1 << i18n( "Title" ) << i18n( "Visible" ) << i18n( "Open" ); m_entriestable->setColumnLabels(list1); m_entriestable->horizontalHeader()->setLabel(1,SmallIcon("structure"), i18n( "Visible" )); m_entriestable->horizontalHeader()->setLabel(2,SmallIcon("structure"), i18n( "Node" )); for ( uint i=0; i<m_entries.count(); ++i ) { - QTableItem *item = new QTableItem(m_entriestable,QTableItem::Never, m_entries[i]); + TQTableItem *item = new TQTableItem(m_entriestable,TQTableItem::Never, m_entries[i]); m_entriestable->setItem( i,0,item ); - m_visible[i] = new QCheckTableItem(m_entriestable,""); + m_visible[i] = new TQCheckTableItem(m_entriestable,""); m_entriestable->setItem( i,1, m_visible[i] ); - m_defaultopen[i] = new QCheckTableItem(m_entriestable,"close"); + m_defaultopen[i] = new TQCheckTableItem(m_entriestable,"close"); m_entriestable->setItem( i,2, m_defaultopen[i] ); } // groupbox with sectioning - QVGroupBox *gb_sectioning= new QVGroupBox(i18n("Sectioning"), this ); - QWidget *widget2 = new QWidget(gb_sectioning); - QVBoxLayout *vbox2 = new QVBoxLayout(widget2, 5,KDialog::spacingHint() ); + TQVGroupBox *gb_sectioning= new TQVGroupBox(i18n("Sectioning"), this ); + TQWidget *widget2 = new TQWidget(gb_sectioning); + TQVBoxLayout *vbox2 = new TQVBoxLayout(widget2, 5,KDialog::spacingHint() ); // document class - QWidget *widget3 = new QWidget(widget2); - QHBoxLayout *hbox3 = new QHBoxLayout(widget3, 5,KDialog::spacingHint() ); - QLabel *label7 = new QLabel(i18n("Document class:"), widget3); - comboclasses = new QComboBox(widget3); + TQWidget *widget3 = new TQWidget(widget2); + TQHBoxLayout *hbox3 = new TQHBoxLayout(widget3, 5,KDialog::spacingHint() ); + TQLabel *label7 = new TQLabel(i18n("Document class:"), widget3); + comboclasses = new TQComboBox(widget3); hbox3->addWidget(label7); hbox3->addSpacing(10); hbox3->addWidget(comboclasses); @@ -145,33 +145,33 @@ ConfigStructure::ConfigStructure(QWidget *parent, const char *name ) m_sectioningtable->setColumnReadOnly(0,true); m_sectioningtable->setColumnReadOnly(1,true); - QStringList list2; + TQStringList list2; list2 << i18n( "Level" ) << i18n( "LaTeX Command" ) << i18n( "Structure Node" ); m_sectioningtable->setColumnLabels(list2); m_sectioningtable->horizontalHeader()->setLabel(2,SmallIcon("structure"),"Structure Node"); // default structure level - QGroupBox *structGroup = new QGroupBox(2, Qt::Horizontal, i18n("Structure View"), widget2); - QLabel *label9 = new QLabel(i18n("Default expansion &level: "),structGroup); - m_structurelevel = new QSpinBox(1,5, 1, structGroup); + TQGroupBox *structGroup = new TQGroupBox(2, Qt::Horizontal, i18n("Structure View"), widget2); + TQLabel *label9 = new TQLabel(i18n("Default expansion &level: "),structGroup); + m_structurelevel = new TQSpinBox(1,5, 1, structGroup); label9->setBuddy(m_structurelevel); - QGroupBox *classGroup = new QGroupBox(1,Qt::Horizontal,i18n("Document Classes"), widget2); - QWidget *widget4 = new QWidget(classGroup); - QHBoxLayout *hbox4 = new QHBoxLayout(widget4, 5,KDialog::spacingHint() ); - QLabel *label10 = new QLabel("Manage classes:",widget4); - add = new QPushButton(i18n("Add"), widget4); - remove = new QPushButton(i18n("Remove"), widget4); + TQGroupBox *classGroup = new TQGroupBox(1,Qt::Horizontal,i18n("Document Classes"), widget2); + TQWidget *widget4 = new TQWidget(classGroup); + TQHBoxLayout *hbox4 = new TQHBoxLayout(widget4, 5,KDialog::spacingHint() ); + TQLabel *label10 = new TQLabel("Manage classes:",widget4); + add = new TQPushButton(i18n("Add"), widget4); + remove = new TQPushButton(i18n("Remove"), widget4); hbox4->addWidget(label10); hbox4->addStretch(); hbox4->addWidget(add); hbox4->addWidget(remove); - // add widgets to the left vertical layout + // add widgets to the left vertical tqlayout vbox1->addWidget(m_entriestable); vbox1->addStretch(); - // add widgets to the right vertical layout + // add widgets to the right vertical tqlayout vbox2->addWidget(widget3); vbox2->addSpacing(10); vbox2->addWidget(m_sectioningtable); @@ -180,7 +180,7 @@ ConfigStructure::ConfigStructure(QWidget *parent, const char *name ) vbox2->addWidget(classGroup); vbox2->addStretch(); - // add both groupboxes to horizontal layout + // add both groupboxes to horizontal tqlayout hbox->addWidget(gb_entries); hbox->addWidget(gb_sectioning); hbox->setStretchFactor(gb_entries,3); @@ -188,37 +188,37 @@ ConfigStructure::ConfigStructure(QWidget *parent, const char *name ) // set default sectioning commands comboclasses->insertItem("latex"); - QStringList *sectcommands = new QStringList; + TQStringList *sectcommands = new TQStringList; *sectcommands << "part" << "chapter" << "section" << "subsection" << "subsubsection"; m_docclasses["latex"] = sectcommands; showSectioning(m_docclasses["latex"]); remove->setEnabled(false); - connect(m_structurelevel,SIGNAL(valueChanged(int)),this,SLOT(spinboxChanged(int))); - connect(comboclasses,SIGNAL(activated(const QString &)),this,SLOT(comboboxChanged(const QString &))); - connect(add,SIGNAL(clicked()),this,SLOT(clickedAdd())); + connect(m_structurelevel,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(spinboxChanged(int))); + connect(comboclasses,TQT_SIGNAL(activated(const TQString &)),this,TQT_SLOT(comboboxChanged(const TQString &))); + connect(add,TQT_SIGNAL(clicked()),this,TQT_SLOT(clickedAdd())); add->setEnabled(false); } ConfigStructure::~ConfigStructure() { - QMap<QString, const QStringList*>::Iterator it, end = m_docclasses.end(); + TQMap<TQString, const TQStringList*>::Iterator it, end = m_docclasses.end(); for(it = m_docclasses.begin() ; it != end ; ++it) delete *it; } void ConfigStructure::polish() { - // QWidget::polish(); + // TQWidget::polish(); - uint w = m_entriestable->sizeHint().width(); + uint w = m_entriestable->tqsizeHint().width(); m_entriestable->setColumnWidth(0,3*w/7); m_entriestable->setColumnWidth(1,2*w/7); m_entriestable->setColumnWidth(2,2*w/7+1); m_entriestable->setColumnStretchable(2,true); - w = m_sectioningtable->sizeHint().width(); + w = m_sectioningtable->tqsizeHint().width(); m_sectioningtable->setColumnWidth(0,w/6); m_sectioningtable->setColumnWidth(1,3*w/6); m_sectioningtable->setColumnWidth(2,2*w/6+1); @@ -245,44 +245,44 @@ void ConfigStructure::clickedTable(KileTable *table,int row, int col) void ConfigStructure::spinboxChanged(int) { - if ( m_docclasses.contains( comboclasses->currentText() ) ) { + if ( m_docclasses.tqcontains( comboclasses->currentText() ) ) { changeSectioning(m_docclasses[comboclasses->currentText()]); } } -void ConfigStructure::comboboxChanged(const QString &name) +void ConfigStructure::comboboxChanged(const TQString &name) { - if ( m_docclasses.contains(name) ) { + if ( m_docclasses.tqcontains(name) ) { showSectioning(m_docclasses[name]); remove->setEnabled( name != "latex" ); } } -void ConfigStructure::changeSectioning(const QStringList *list) +void ConfigStructure::changeSectioning(const TQStringList *list) { for (uint i=0; i<list->count(); ++i) { - QString label = ( i < (uint)m_structurelevel->value() ) ? "open" : "close"; + TQString label = ( i < (uint)m_structurelevel->value() ) ? "open" : "close"; m_sectioningtable->setText(i,2,label); } } -void ConfigStructure::showSectioning(const QStringList *list) +void ConfigStructure::showSectioning(const TQStringList *list) { - QString label1,label2,label3; + TQString label1,label2,label3; for (uint i=0; i<5; ++i) { if ( i < list->count() ) { - label1 = QString("%1").arg(i+1); + label1 = TQString("%1").tqarg(i+1); label2 = (*list)[i]; label3 = ( i < (uint)m_structurelevel->value() ) ? "open" : "close"; } else { - label1 = label2 = label3 = QString::null; + label1 = label2 = label3 = TQString(); } KileCenteredTableItem *item1 = new KileCenteredTableItem(m_sectioningtable, - QTableItem::Never,label1); + TQTableItem::Never,label1); m_sectioningtable->setItem( i,0,item1 ); m_sectioningtable->setText( i,1,label2 ); KileCenteredTableItem *item3 = new KileCenteredTableItem(m_sectioningtable, - QTableItem::Never,label3); + TQTableItem::Never,label3); m_sectioningtable->setItem( i,2,item3 ); } } @@ -309,13 +309,13 @@ void ConfigStructure::readConfig(KConfig *config) } config->setGroup( "Structure Sectioning" ); - QStringList classlist = config->readListEntry("classes"); + TQStringList classlist = config->readListEntry("classes"); classlist.sort(); for ( uint i=0; i<classlist.count(); ++i ) { - QStringList list = config->readListEntry(classlist[i]); + TQStringList list = config->readListEntry(classlist[i]); if ( list.count() > 0 ) { comboclasses->insertItem(classlist[i]); - QStringList *sectioningcommands = new QStringList(list); + TQStringList *sectioningcommands = new TQStringList(list); m_docclasses[classlist[i]] = sectioningcommands; } } @@ -335,12 +335,12 @@ void ConfigStructure::writeConfig(KConfig *config) } config->setGroup( "Structure Sectioning" ); - QStringList classlist; + TQStringList classlist; for ( int i=0; i<comboclasses->count(); ++i ) { - QString entry = comboclasses->text(i); + TQString entry = comboclasses->text(i); if ( entry != "latex" ) { classlist << entry; - QString entrylist = m_docclasses[entry]->join(","); + TQString entrylist = m_docclasses[entry]->join(","); config->writeEntry( entry, entrylist ); } } |