diff options
Diffstat (limited to 'quanta/src/quantaview.cpp')
-rw-r--r-- | quanta/src/quantaview.cpp | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/quanta/src/quantaview.cpp b/quanta/src/quantaview.cpp index 39cff3bc..51f93294 100644 --- a/quanta/src/quantaview.cpp +++ b/quanta/src/quantaview.cpp @@ -16,20 +16,20 @@ ***************************************************************************/ // include files for Qt -#include <qprinter.h> -#include <qpainter.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qtimer.h> -#include <qlayout.h> -#include <qwidgetstack.h> -#include <qdom.h> -#include <qfile.h> -#include <qevent.h> -#include <qwidget.h> -#include <qsplitter.h> -#include <qpoint.h> -#include <qscrollview.h> +#include <tqprinter.h> +#include <tqpainter.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> +#include <tqtimer.h> +#include <tqlayout.h> +#include <tqwidgetstack.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqevent.h> +#include <tqwidget.h> +#include <tqsplitter.h> +#include <tqpoint.h> +#include <tqscrollview.h> // include files for KDE #include <kaction.h> @@ -74,9 +74,9 @@ #include "tagdialog.h" extern int NN; -extern QValueList<Node*> nodes; +extern TQValueList<Node*> nodes; -QuantaView::QuantaView(QWidget *parent, const char *name, const QString &caption ) +QuantaView::QuantaView(TQWidget *parent, const char *name, const TQString &caption ) : KMdiChildView(parent, name) , m_document(0L) , m_plugin(0L) @@ -86,21 +86,21 @@ QuantaView::QuantaView(QWidget *parent, const char *name, const QString &caption { setMDICaption(caption); //Connect the VPL update timers - connect(&m_sourceUpdateTimer, SIGNAL(timeout()), this, SLOT(sourceUpdateTimerTimeout())); - connect(&m_VPLUpdateTimer, SIGNAL(timeout()), this, SLOT(VPLUpdateTimerTimeout())); + connect(&m_sourceUpdateTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(sourceUpdateTimerTimeout())); + connect(&m_VPLUpdateTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(VPLUpdateTimerTimeout())); //create the source and VPL holding widgets - m_documentArea = new QWidget(this); + m_documentArea = new TQWidget(this); //get the reference to the user toolbar holding widget ToolbarTabWidget *m_toolbarTab = ToolbarTabWidget::ref(); - m_toolbarTab->reparent(this, 0, QPoint(), true); - m_toolbarTab ->setFocusPolicy( QWidget::NoFocus ); + m_toolbarTab->reparent(this, 0, TQPoint(), true); + m_toolbarTab ->setFocusPolicy( TQWidget::NoFocus ); //create a splitter to separate the VPL and document area - m_splitter = new QSplitter(Qt::Vertical, this); + m_splitter = new TQSplitter(Qt::Vertical, this); //place the widgets in a grid - m_viewLayout = new QGridLayout(this, 2, 0); + m_viewLayout = new TQGridLayout(this, 2, 0); m_viewLayout->setRowStretch(0, 0); m_viewLayout->setRowStretch(1,1); m_viewLayout->addWidget( m_toolbarTab, 0, 0); @@ -118,7 +118,7 @@ QuantaView::~QuantaView() quantaApp->slotFileClosed(m_document); if (m_document) { - m_document->view()->reparent(0L, 0, QPoint(), false); + m_document->view()->reparent(0L, 0, TQPoint(), false); if (quantaApp) emit documentClosed(m_document->url()); } @@ -138,7 +138,7 @@ bool QuantaView::mayRemove() if (m_document && m_document->isUntitled() && !m_document->isModified()) unmodifiedUntitled = true; if (m_customWidget) - m_customWidget->reparent(0L, 0, QPoint(), false); + m_customWidget->reparent(0L, 0, TQPoint(), false); if (!saveModified()) return false; slotSetSourceLayout(); @@ -149,8 +149,8 @@ bool QuantaView::mayRemove() Node::deleteNode(baseNode); baseNode = 0L; kdDebug(24000) << "Node objects after delete = " << NN << " ; list count = " << nodes.count() << endl; - QValueList<Node*> nList = nodes; -/* for (QValueList<Node*>::ConstIterator it = nList.constBegin(); it != nList.constEnd(); ++it) + TQValueList<Node*> nList = nodes; +/* for (TQValueList<Node*>::ConstIterator it = nList.constBegin(); it != nList.constEnd(); ++it) Node::deleteNode(*it); kdDebug(24000) << "Node objects after cleanup = " << NN << " ; list count = " << nodes.count() << endl;*/ } @@ -159,7 +159,7 @@ bool QuantaView::mayRemove() KURL url = m_document->url(); Project::ref()->saveBookmarks(url, dynamic_cast<KTextEditor::MarkInterface*>(m_document->doc())); if (!unmodifiedUntitled) - emit eventHappened("before_close", url.url(), QString::null); + emit eventHappened("before_close", url.url(), TQString::null); m_currentViewsLayout = -1; // m_document->closeTempFile(); if (!m_document->isUntitled() && url.isLocalFile()) @@ -172,7 +172,7 @@ bool QuantaView::mayRemove() quantaApp->menuBar()->activateItemAt(-1); quantaApp->guiFactory()->removeClient(m_document->view()); if (!unmodifiedUntitled) - emit eventHappened("after_close", url.url(), QString::null); + emit eventHappened("after_close", url.url(), TQString::null); } /* kdDebug(24000) << "Calling reparse from close " << endl; parser->setSAParserEnabled(true); @@ -186,18 +186,18 @@ void QuantaView::addDocument(Document *document) if (!document) return; m_document = document; - connect(m_document, SIGNAL(editorGotFocus()), this, SLOT(slotSourceGetFocus())); - connect(m_document->view(), SIGNAL(cursorPositionChanged()), this, SIGNAL(cursorPositionChanged())); + connect(m_document, TQT_SIGNAL(editorGotFocus()), this, TQT_SLOT(slotSourceGetFocus())); + connect(m_document->view(), TQT_SIGNAL(cursorPositionChanged()), this, TQT_SIGNAL(cursorPositionChanged())); m_kafkaDocument = KafkaDocument::ref(); - connect(m_kafkaDocument->getKafkaWidget(), SIGNAL(hasFocus(bool)), - this, SLOT(slotVPLGetFocus(bool))); - connect(m_kafkaDocument, SIGNAL(newCursorPosition(int,int)), - this, SLOT(slotSetCursorPositionInSource(int, int))); - connect(m_kafkaDocument, SIGNAL(loadingError(Node *)), - this, SLOT(slotVPLLoadingError(Node *))); + connect(m_kafkaDocument->getKafkaWidget(), TQT_SIGNAL(hasFocus(bool)), + this, TQT_SLOT(slotVPLGetFocus(bool))); + connect(m_kafkaDocument, TQT_SIGNAL(newCursorPosition(int,int)), + this, TQT_SLOT(slotSetCursorPositionInSource(int, int))); + connect(m_kafkaDocument, TQT_SIGNAL(loadingError(Node *)), + this, TQT_SLOT(slotVPLLoadingError(Node *))); m_kafkaReloadingEnabled = true; m_quantaReloadingEnabled = true; @@ -215,29 +215,29 @@ void QuantaView::addDocument(Document *document) void QuantaView::addPlugin(QuantaPlugin *plugin) { ToolbarTabWidget *m_toolbarTab = ToolbarTabWidget::ref(); - m_toolbarTab->reparent(0, 0, QPoint(), false); + m_toolbarTab->reparent(0, 0, TQPoint(), false); m_plugin = plugin; m_splitter->hide(); - QWidget *w = m_plugin->widget(); + TQWidget *w = m_plugin->widget(); if (w) { - w->reparent(m_documentArea, 0, QPoint(), true); + w->reparent(m_documentArea, 0, TQPoint(), true); w->resize(m_documentArea->size()); } - m_documentArea->reparent(this, 0, QPoint(), true); + m_documentArea->reparent(this, 0, TQPoint(), true); m_viewLayout->addWidget(m_documentArea, 1, 0); activated(); updateTab(); } -void QuantaView::addCustomWidget(QWidget *widget, const QString &label) +void QuantaView::addCustomWidget(TQWidget *widget, const TQString &label) { if (widget) { - ToolbarTabWidget::ref()->reparent(0, 0, QPoint(), false); + ToolbarTabWidget::ref()->reparent(0, 0, TQPoint(), false); m_customWidget = widget; m_splitter->hide(); - widget->reparent(m_documentArea, 0, QPoint(), true); + widget->reparent(m_documentArea, 0, TQPoint(), true); widget->resize(m_documentArea->size()); if (!label.isEmpty()) { @@ -249,7 +249,7 @@ void QuantaView::addCustomWidget(QWidget *widget, const QString &label) } else if (m_customWidget) { - ToolbarTabWidget::ref()->reparent(this, 0, QPoint(), qConfig.enableDTDToolbar); + ToolbarTabWidget::ref()->reparent(this, 0, TQPoint(), qConfig.enableDTDToolbar); m_viewLayout->addWidget(ToolbarTabWidget::ref(), 0 , 0); m_customWidget = 0L; //avoid infinite recursion reloadLayout(); @@ -287,10 +287,10 @@ void QuantaView::updateTab() if (m_document) { // try to set the icon from mimetype - QIconSet mimeIcon (KMimeType::pixmapForURL(m_document->url(), 0, KIcon::Small)); + TQIconSet mimeIcon (KMimeType::pixmapForURL(m_document->url(), 0, KIcon::Small)); if (mimeIcon.isNull()) - mimeIcon = QIconSet(SmallIcon("document")); - QString urlStr = QExtFileInfo::shortName(m_document->url().path()); + mimeIcon = TQIconSet(SmallIcon("document")); + TQString urlStr = QExtFileInfo::shortName(m_document->url().path()); if (m_document->isModified()) { if (qConfig.showCloseButtons == "ShowAlways") @@ -330,7 +330,7 @@ void QuantaView::updateTab() } } -QString QuantaView::tabName() +TQString QuantaView::tabName() { if (m_document) { @@ -371,8 +371,8 @@ void QuantaView::slotSetSourceLayout() //show the document if full size m_splitter->hide(); - m_kafkaDocument->getKafkaWidget()->view()->reparent(0, 0, QPoint(), false); - m_document->view()->reparent(m_documentArea, 0, QPoint(), true); + m_kafkaDocument->getKafkaWidget()->view()->reparent(0, 0, TQPoint(), false); + m_document->view()->reparent(m_documentArea, 0, TQPoint(), true); m_document->view()->resize(m_documentArea->size()); m_viewLayout->addWidget(m_documentArea, 1, 0); m_document->view()->setFocus(); @@ -412,9 +412,9 @@ void QuantaView::slotSetSourceAndVPLLayout() { reloadSourceView(); } - m_kafkaDocument->getKafkaWidget()->view()->reparent(m_splitter, 0, QPoint(), true); + m_kafkaDocument->getKafkaWidget()->view()->reparent(m_splitter, 0, TQPoint(), true); m_splitter->moveToFirst(m_kafkaDocument->getKafkaWidget()->view()); - m_document->view()->reparent(m_splitter, 0, QPoint(), true); + m_document->view()->reparent(m_splitter, 0, TQPoint(), true); m_viewLayout->addWidget(m_splitter, 1, 0); m_splitter->setSizes(m_splitterSizes); m_splitter->show(); @@ -458,7 +458,7 @@ void QuantaView::slotSetVPLOnlyLayout() if (!m_kafkaDocument->isLoaded()) m_kafkaDocument->loadDocument(m_document); - m_kafkaDocument->getKafkaWidget()->view()->reparent(m_documentArea, 0, QPoint(), true); + m_kafkaDocument->getKafkaWidget()->view()->reparent(m_documentArea, 0, TQPoint(), true); m_kafkaDocument->getKafkaWidget()->view()->resize(m_documentArea->size()); m_viewLayout->addWidget(m_documentArea, 1, 0); m_kafkaDocument->getKafkaWidget()->view()->setFocus(); @@ -672,19 +672,19 @@ void QuantaView::slotSetCursorPositionInSource(int col, int line) m_document->viewCursorIf->setCursorPositionReal(line, col); } -void QuantaView::dragEnterEvent(QDragEnterEvent *e) +void QuantaView::dragEnterEvent(TQDragEnterEvent *e) { e->accept(KURLDrag::canDecode(e)); } -void QuantaView::dropEvent(QDropEvent *e) +void QuantaView::dropEvent(TQDropEvent *e) { emit dragInsert(e); } -void QuantaView::resizeEvent(QResizeEvent *e) +void QuantaView::resizeEvent(TQResizeEvent *e) { - QWidget::resizeEvent(e); + TQWidget::resizeEvent(e); resize(m_documentArea->width(), m_documentArea->height()); } @@ -719,12 +719,12 @@ void QuantaView::insertTag(const char *tag) { if (!m_document ) return; - QString tagStr = QuantaCommon::tagCase(tag); + TQString tagStr = QuantaCommon::tagCase(tag); const DTDStruct *dtd = m_document->currentDTD(true); bool single = QuantaCommon::isSingleTag(dtd->name, tagStr); bool optional = QuantaCommon::isOptionalTag(dtd->name, tagStr); - QString startTag = tagStr; + TQString startTag = tagStr; startTag.prepend("<"); if ( dtd->singleTagStyle == "xml" && ( single || (optional && !qConfig.closeOptionalTags)) @@ -737,7 +737,7 @@ void QuantaView::insertTag(const char *tag) if ( (qConfig.closeTags && !single && !optional) || (qConfig.closeOptionalTags && optional) ) { - m_document->insertTag( startTag, QString("</")+tagStr+">"); + m_document->insertTag( startTag, TQString("</")+tagStr+">"); } else { @@ -747,7 +747,7 @@ void QuantaView::insertTag(const char *tag) //FIXME: Move out from here?? /** Insert a new tag by bringing up the TagDialog. */ -void QuantaView::insertNewTag(const QString &tag, const QString &attr, bool insertInLine) +void QuantaView::insertNewTag(const TQString &tag, const TQString &attr, bool insertInLine) { if (m_document) { @@ -756,7 +756,7 @@ void QuantaView::insertNewTag(const QString &tag, const QString &attr, bool inse insertOutputInTheNodeTree("", "", quantaApp->showTagDialogAndReturnNode(tag, attr)); else { - QString selection; + TQString selection; if (m_document->selectionIf) selection = m_document->selectionIf->selection(); TagDialog *dlg = new TagDialog(QuantaCommon::tagFromDTD(m_document->getDTDIdentifier(), tag), selection, attr, baseURL()); @@ -770,7 +770,7 @@ void QuantaView::insertNewTag(const QString &tag, const QString &attr, bool inse } } -void QuantaView::insertOutputInTheNodeTree(const QString &str1, const QString &str2, Node *node) +void QuantaView::insertOutputInTheNodeTree(const TQString &str1, const TQString &str2, Node *node) { if (!m_document) return; @@ -785,14 +785,14 @@ void QuantaView::insertOutputInTheNodeTree(const QString &str1, const QString &s KafkaWidget *kafkaPart = m_kafkaDocument->getKafkaWidget(); NodeModifsSet *modifs; DOM::Node domNode, domStartContainer, domEndContainer; - QString tagName; + TQString tagName; QTag *nodeQTag, *qTag, *nodeParentQTag; Node *nodeCursor, *startContainer, *endContainer, *nodeParent, *dummy; - QPtrList<QTag> qTagList; + TQPtrList<QTag> qTagList; int startCol, startLine, endCol, endLine; bool specialTagInsertion = false; long nodeOffset, startOffset, endOffset, domNodeOffset; - QValueList<int> loc; + TQValueList<int> loc; uint line, col; bool smartTagInsertion, hasSelection, nodeTreeModified; @@ -1018,7 +1018,7 @@ void QuantaView::activated() refreshWindow(); return; } - ToolbarTabWidget::ref()->reparent(this, 0, QPoint(), qConfig.enableDTDToolbar); + ToolbarTabWidget::ref()->reparent(this, 0, TQPoint(), qConfig.enableDTDToolbar); m_viewLayout->addWidget(ToolbarTabWidget::ref(), 0 , 0); quantaApp->partManager()->setActivePart(m_document->doc(), m_document->view()); m_document->checkDirtyStatus(); @@ -1055,7 +1055,7 @@ bool QuantaView::saveModified(bool ask) return true; bool completed=true; - QString fileName = m_document->url().fileName(); + TQString fileName = m_document->url().fileName(); if (m_document->isModified() ) { @@ -1108,7 +1108,7 @@ bool QuantaView::saveDocument(const KURL& url) if (url.isEmpty()) return false; - emit eventHappened("before_save", url.url(), QString::null); + emit eventHappened("before_save", url.url(), TQString::null); m_saveResult = true; KURL oldURL = m_document->url(); if (!m_document->isUntitled() && oldURL.isLocalFile()) @@ -1134,8 +1134,8 @@ bool QuantaView::saveDocument(const KURL& url) { KTextEditor::Document *doc = m_document->doc(); m_eventLoopStarted = false; - connect(doc, SIGNAL(canceled(const QString &)), this, SLOT(slotSavingFailed(const QString &))); - connect(doc, SIGNAL(completed()), this, SLOT(slotSavingCompleted())); + connect(doc, TQT_SIGNAL(canceled(const TQString &)), this, TQT_SLOT(slotSavingFailed(const TQString &))); + connect(doc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotSavingCompleted())); m_saveResult = m_document->saveAs(url); if (m_saveResult) { @@ -1144,8 +1144,8 @@ bool QuantaView::saveDocument(const KURL& url) m_eventLoopStarted = true; internalFileInfo.enter_loop(); } - disconnect(doc, SIGNAL(canceled(const QString &)), this, SLOT(slotSavingFailed(const QString &))); - disconnect(doc, SIGNAL(completed()), this, SLOT(slotSavingCompleted())); + disconnect(doc, TQT_SIGNAL(canceled(const TQString &)), this, TQT_SLOT(slotSavingFailed(const TQString &))); + disconnect(doc, TQT_SIGNAL(completed()), this, TQT_SLOT(slotSavingCompleted())); if (!m_saveResult) //there was an error while saving { if (oldURL.isLocalFile()) @@ -1161,11 +1161,11 @@ bool QuantaView::saveDocument(const KURL& url) { setCaption(m_document->url().fileName()); } - emit eventHappened("after_save", m_document->url().url(), QString::null); + emit eventHappened("after_save", m_document->url().url(), TQString::null); return true; } -void QuantaView::slotSavingFailed(const QString &error) +void QuantaView::slotSavingFailed(const TQString &error) { Q_UNUSED(error); m_saveResult = false; |