summaryrefslogtreecommitdiffstats
path: root/quanta/src/viewmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/src/viewmanager.cpp')
-rw-r--r--quanta/src/viewmanager.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/quanta/src/viewmanager.cpp b/quanta/src/viewmanager.cpp
index f02108e9..5d9ea103 100644
--- a/quanta/src/viewmanager.cpp
+++ b/quanta/src/viewmanager.cpp
@@ -13,7 +13,7 @@
***************************************************************************/
//qt includes
-#include <qdir.h>
+#include <tqdir.h>
//kde includes
#include <kdirwatch.h>
@@ -61,26 +61,26 @@
#define UPLOAD_ID 12
#define DELETE_ID 13
-ViewManager::ViewManager(QObject *parent, const char *name) : QObject(parent, name)
+ViewManager::ViewManager(TQObject *parent, const char *name) : TQObject(parent, name)
{
m_lastActiveView = 0L;
m_lastActiveEditorView = 0L;
m_documentationView = 0L;
m_tabPopup = new KPopupMenu(quantaApp);
- m_tabPopup->insertItem(SmallIcon("fileclose"), i18n("&Close"), this, SLOT(slotCloseView()));
- m_tabPopup->insertItem(i18n("Close &Other Tabs"), this, SLOT(slotCloseOtherTabs()));
- m_tabPopup->insertItem(i18n("Close &All"), this, SLOT(closeAll()));
- m_tabPopup->insertItem(SmallIcon("revert"), i18n("&Reload"), this, SLOT(slotReloadFile()), 0, RELOAD_ID);
- m_tabPopup->insertItem(SmallIcon("up"), i18n("&Upload File"), this, SLOT(slotUploadFile()), 0, UPLOAD_ID);
- m_tabPopup->insertItem(SmallIcon("editdelete"), i18n("&Delete File"), this, SLOT(slotDeleteFile()), 0, DELETE_ID);
+ m_tabPopup->insertItem(SmallIcon("fileclose"), i18n("&Close"), this, TQT_SLOT(slotCloseView()));
+ m_tabPopup->insertItem(i18n("Close &Other Tabs"), this, TQT_SLOT(slotCloseOtherTabs()));
+ m_tabPopup->insertItem(i18n("Close &All"), this, TQT_SLOT(closeAll()));
+ m_tabPopup->insertItem(SmallIcon("revert"), i18n("&Reload"), this, TQT_SLOT(slotReloadFile()), 0, RELOAD_ID);
+ m_tabPopup->insertItem(SmallIcon("up"), i18n("&Upload File"), this, TQT_SLOT(slotUploadFile()), 0, UPLOAD_ID);
+ m_tabPopup->insertItem(SmallIcon("editdelete"), i18n("&Delete File"), this, TQT_SLOT(slotDeleteFile()), 0, DELETE_ID);
m_tabPopup->insertSeparator();
m_fileListPopup = new KPopupMenu(quantaApp);
- connect(m_fileListPopup, SIGNAL(aboutToShow()), this, SLOT(slotFileListPopupAboutToShow()));
- connect(m_fileListPopup, SIGNAL(activated(int)), this, SLOT(slotFileListPopupItemActivated(int)));
+ connect(m_fileListPopup, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotFileListPopupAboutToShow()));
+ connect(m_fileListPopup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotFileListPopupItemActivated(int)));
m_bookmarks = new QuantaBookmarks(this, QuantaBookmarks::Position, true);
m_bookmarksMenu = new KPopupMenu(quantaApp);
m_bookmarks->setBookmarksMenu(m_bookmarksMenu);
- connect(m_bookmarks, SIGNAL(gotoFileAndLine(const QString&, int, int)), quantaApp, SLOT(gotoFileAndLine(const QString&, int, int)));
+ connect(m_bookmarks, TQT_SIGNAL(gotoFileAndLine(const TQString&, int, int)), quantaApp, TQT_SLOT(gotoFileAndLine(const TQString&, int, int)));
m_bookmarksMenuId = m_tabPopup->insertItem(SmallIconSet("bookmark"), i18n("&Bookmarks"), m_bookmarksMenu);
m_tabPopup->insertItem(i18n("&Switch To"), m_fileListPopup);
m_contextView = 0L;
@@ -88,18 +88,18 @@ ViewManager::ViewManager(QObject *parent, const char *name) : QObject(parent, na
m_separatorVisible = false;
}
-QuantaView* ViewManager::createView(const QString &caption)
+QuantaView* ViewManager::createView(const TQString &caption)
{
QuantaView *view = new QuantaView(quantaApp, "", caption);
quantaApp->addWindow(view);
- connect(view, SIGNAL(cursorPositionChanged()), quantaApp, SLOT(slotNewLineColumn()));
- connect(view, SIGNAL(title(const QString &)), quantaApp, SLOT(slotNewLineColumn()));
- connect(view, SIGNAL(dragInsert(QDropEvent*)), this, SIGNAL(dragInsert(QDropEvent *)));
- connect(view, SIGNAL(hidePreview()), quantaApp, SLOT(slotChangePreviewStatus()));
- disconnect(view, SIGNAL(childWindowCloseRequest( KMdiChildView *)), 0, 0 );
- connect(view, SIGNAL(childWindowCloseRequest( KMdiChildView*)), this, SLOT(slotCloseRequest(KMdiChildView*)));
- connect(view, SIGNAL(documentClosed(const KURL&)), this, SLOT(slotDocumentClosed(const KURL&)));
- connect(view, SIGNAL(eventHappened(const QString&, const QString&, const QString& )), QPEvents::ref(), SLOT(slotEventHappened(const QString&, const QString&, const QString& )));
+ connect(view, TQT_SIGNAL(cursorPositionChanged()), quantaApp, TQT_SLOT(slotNewLineColumn()));
+ connect(view, TQT_SIGNAL(title(const TQString &)), quantaApp, TQT_SLOT(slotNewLineColumn()));
+ connect(view, TQT_SIGNAL(dragInsert(TQDropEvent*)), this, TQT_SIGNAL(dragInsert(TQDropEvent *)));
+ connect(view, TQT_SIGNAL(hidePreview()), quantaApp, TQT_SLOT(slotChangePreviewStatus()));
+ disconnect(view, TQT_SIGNAL(childWindowCloseRequest( KMdiChildView *)), 0, 0 );
+ connect(view, TQT_SIGNAL(childWindowCloseRequest( KMdiChildView*)), this, TQT_SLOT(slotCloseRequest(KMdiChildView*)));
+ connect(view, TQT_SIGNAL(documentClosed(const KURL&)), this, TQT_SLOT(slotDocumentClosed(const KURL&)));
+ connect(view, TQT_SIGNAL(eventHappened(const TQString&, const TQString&, const TQString& )), QPEvents::ref(), TQT_SLOT(slotEventHappened(const TQString&, const TQString&, const TQString& )));
return view;
}
@@ -108,7 +108,7 @@ void ViewManager::createNewDocument()
{
int i = 1;
while (isOpened(KURL("file:"+i18n("Untitled%1").arg(i)))) i++;
- QString fname = i18n("Untitled%1").arg(i);
+ TQString fname = i18n("Untitled%1").arg(i);
QuantaView *view = createView(fname);
#ifdef ENABLE_EDITORS
@@ -121,8 +121,8 @@ void ViewManager::createNewDocument()
KTextEditor::Document *doc = KTextEditor::createDocument ("libkatepart", view, "KTextEditor::Document");
#endif
Document *w = new Document(doc, 0L);
- connect(w, SIGNAL(showAnnotation(uint, const QString&, const QPair<QString, QString>&)), quantaApp->annotationOutput(), SLOT(insertAnnotation(uint, const QString&, const QPair<QString, QString>&)));
- QString encoding = quantaApp->defaultEncoding();
+ connect(w, TQT_SIGNAL(showAnnotation(uint, const TQString&, const QPair<TQString, TQString>&)), quantaApp->annotationOutput(), TQT_SLOT(insertAnnotation(uint, const TQString&, const QPair<TQString, TQString>&)));
+ TQString encoding = quantaApp->defaultEncoding();
KTextEditor::EncodingInterface* encodingIf = dynamic_cast<KTextEditor::EncodingInterface*>(doc);
if (encodingIf)
encodingIf->setEncoding(encoding);
@@ -130,16 +130,16 @@ void ViewManager::createNewDocument()
KTextEditor::View * v = w->view();
//[MB02] connect all kate views for drag and drop
- connect(w->view(), SIGNAL(dropEventPass(QDropEvent *)), this, SIGNAL(dragInsert(QDropEvent *)));
+ connect(w->view(), TQT_SIGNAL(dropEventPass(TQDropEvent *)), this, TQT_SIGNAL(dragInsert(TQDropEvent *)));
w->setUntitledUrl( fname );
KTextEditor::PopupMenuInterface* popupIf = dynamic_cast<KTextEditor::PopupMenuInterface*>(w->view());
if (popupIf)
- popupIf->installPopup((QPopupMenu *)quantaApp->factory()->container("popup_editor", quantaApp));
+ popupIf->installPopup((TQPopupMenu *)quantaApp->factory()->container("popup_editor", quantaApp));
quantaApp->setFocusProxy(w->view());
- w->view()->setFocusPolicy(QWidget::WheelFocus);
- connect( v, SIGNAL(newStatus()), quantaApp, SLOT(slotNewStatus()));
+ w->view()->setFocusPolicy(TQWidget::WheelFocus);
+ connect( v, TQT_SIGNAL(newStatus()), quantaApp, TQT_SLOT(slotNewStatus()));
quantaApp->slotNewPart(doc, true); // register new part in partmanager and make active
view->addDocument(w);
@@ -154,7 +154,7 @@ bool ViewManager::removeView(QuantaView *view, bool force, bool createNew)
{
if (!view) return false;
int noOfViews = 0;
- QValueList<Document*> list;
+ TQValueList<Document*> list;
KMdiIterator<KMdiChildView*> *it = quantaApp->createIterator();
for (it->first(); !it->isDone(); it->next())
{
@@ -180,9 +180,9 @@ bool ViewManager::removeView(QuantaView *view, bool force, bool createNew)
if (view == m_lastActiveEditorView)
m_lastActiveEditorView = 0L;
if (view == activeView())
- ToolbarTabWidget::ref()->reparent(0L, 0, QPoint(), false);
+ ToolbarTabWidget::ref()->reparent(0L, 0, TQPoint(), false);
if (!createNew)
- disconnect(quantaApp, SIGNAL(lastChildViewClosed()), this, SLOT(slotLastViewClosed()));
+ disconnect(quantaApp, TQT_SIGNAL(lastChildViewClosed()), this, TQT_SLOT(slotLastViewClosed()));
quantaApp->closeWindow(view);
if (createNew)
{
@@ -191,7 +191,7 @@ bool ViewManager::removeView(QuantaView *view, bool force, bool createNew)
quantaApp->slotFileNew();
}
} else
- connect(quantaApp, SIGNAL(lastChildViewClosed()), this, SLOT(slotLastViewClosed()));
+ connect(quantaApp, TQT_SIGNAL(lastChildViewClosed()), this, TQT_SLOT(slotLastViewClosed()));
return true;
}
}
@@ -255,17 +255,17 @@ void ViewManager::slotCloseOtherTabs()
else
currentView = quantaApp->activeWindow();
if (dynamic_cast<QuantaView*>(currentView) && !static_cast<QuantaView*>(currentView)->document())
- ToolbarTabWidget::ref()->reparent(0, 0, QPoint(), false);
+ ToolbarTabWidget::ref()->reparent(0, 0, TQPoint(), false);
KMdiIterator<KMdiChildView*> *it = quantaApp->createIterator();
//save the children first to a list, as removing invalidates our iterator
- QValueList<KMdiChildView *> children;
+ TQValueList<KMdiChildView *> children;
for (it->first(); !it->isDone(); it->next())
{
children.append(it->currentItem());
}
delete it;
KURL::List modifiedList;
- QValueListIterator<KMdiChildView *> childIt;
+ TQValueListIterator<KMdiChildView *> childIt;
for (childIt = children.begin(); childIt != children.end(); ++childIt)
{
view = *childIt;
@@ -283,7 +283,7 @@ void ViewManager::slotCloseOtherTabs()
{
KURL::List filesToSave;
KSaveSelectDialog dlg(modifiedList, filesToSave /*empty ignore list */, quantaApp);
- if (dlg.exec() == QDialog::Accepted)
+ if (dlg.exec() == TQDialog::Accepted)
{
filesToSave = dlg.filesToSave();
for (childIt = children.begin(); childIt != children.end(); ++childIt)
@@ -328,7 +328,7 @@ QuantaView* ViewManager::isOpened(const KURL& url)
KURL url2 = url;
if (url2.isLocalFile() && !url.path().startsWith(i18n("Untitled")))
{
- QDir dir(url2.path());
+ TQDir dir(url2.path());
url2.setPath(dir.canonicalPath());
}
KMdiIterator<KMdiChildView*> *it = quantaApp->createIterator();
@@ -366,9 +366,9 @@ KURL::List ViewManager::openedFiles(bool noUntitled)
return list;
}
-QValueList<Document*> ViewManager::openedDocuments()
+TQValueList<Document*> ViewManager::openedDocuments()
{
- QValueList<Document*> list;
+ TQValueList<Document*> list;
KMdiIterator<KMdiChildView*> *it = quantaApp->createIterator();
QuantaView *view;
for (it->first(); !it->isDone(); it->next())
@@ -400,13 +400,13 @@ bool ViewManager::saveAll()
{
if (!w->isUntitled())
{
- emit eventHappened("before_save", w->url().url(), QString::null);
+ emit eventHappened("before_save", w->url().url(), TQString::null);
w->docUndoRedo->fileSaved();
w->save();
w->removeBackup(quantaApp->config());
if (w->isModified())
flagsave = false;
- emit eventHappened("after_save", w->url().url(), QString::null);
+ emit eventHappened("after_save", w->url().url(), TQString::null);
} else
{
if (!view->saveModified())
@@ -428,14 +428,14 @@ bool ViewManager::closeAll(bool createNew)
KMdiIterator<KMdiChildView*> *it = quantaApp->createIterator();
QuantaView *view;
//save the children first to a list, as removing invalidates our iterator
- QValueList<KMdiChildView *> children;
+ TQValueList<KMdiChildView *> children;
for (it->first(); !it->isDone(); it->next())
{
children.append(it->currentItem());
}
delete it;
KURL::List modifiedList;
- QValueListIterator<KMdiChildView *> childIt;
+ TQValueListIterator<KMdiChildView *> childIt;
for (childIt = children.begin(); childIt != children.end(); ++childIt)
{
view = dynamic_cast<QuantaView*>(*childIt);
@@ -452,7 +452,7 @@ bool ViewManager::closeAll(bool createNew)
{
KURL::List filesToSave;
KSaveSelectDialog dlg(modifiedList, filesToSave /*empty ignore list */, quantaApp);
- if (dlg.exec() == QDialog::Accepted)
+ if (dlg.exec() == TQDialog::Accepted)
{
filesToSave = dlg.filesToSave();
for (childIt = children.begin(); childIt != children.end(); ++childIt)
@@ -480,9 +480,9 @@ bool ViewManager::closeAll(bool createNew)
return false; //save aborted
}
}
- disconnect(quantaApp, SIGNAL(viewActivated (KMdiChildView *)), this, SLOT(slotViewActivated(KMdiChildView*)));
- disconnect(quantaApp, SIGNAL(lastChildViewClosed()), this, SLOT(slotLastViewClosed()));
- ToolbarTabWidget::ref()->reparent(0L, 0, QPoint(), false);
+ disconnect(quantaApp, TQT_SIGNAL(viewActivated (KMdiChildView *)), this, TQT_SLOT(slotViewActivated(KMdiChildView*)));
+ disconnect(quantaApp, TQT_SIGNAL(lastChildViewClosed()), this, TQT_SLOT(slotLastViewClosed()));
+ ToolbarTabWidget::ref()->reparent(0L, 0, TQPoint(), false);
for (childIt = children.begin(); childIt != children.end(); ++childIt)
{
@@ -508,8 +508,8 @@ bool ViewManager::closeAll(bool createNew)
} else
{
//actually this code should be never executed
- connect(quantaApp, SIGNAL(viewActivated (KMdiChildView *)), this, SLOT(slotViewActivated(KMdiChildView*)));
- connect(quantaApp, SIGNAL(lastChildViewClosed()), this, SLOT(slotLastViewClosed()));
+ connect(quantaApp, TQT_SIGNAL(viewActivated (KMdiChildView *)), this, TQT_SLOT(slotViewActivated(KMdiChildView*)));
+ connect(quantaApp, TQT_SIGNAL(lastChildViewClosed()), this, TQT_SLOT(slotLastViewClosed()));
view->activated();
emit filesClosed(false);
return false;
@@ -523,8 +523,8 @@ bool ViewManager::closeAll(bool createNew)
}
}
}
- connect(quantaApp, SIGNAL(viewActivated (KMdiChildView *)), this, SLOT(slotViewActivated(KMdiChildView*)));
- connect(quantaApp, SIGNAL(lastChildViewClosed()), this, SLOT(slotLastViewClosed()));
+ connect(quantaApp, TQT_SIGNAL(viewActivated (KMdiChildView *)), this, TQT_SLOT(slotViewActivated(KMdiChildView*)));
+ connect(quantaApp, TQT_SIGNAL(lastChildViewClosed()), this, TQT_SLOT(slotLastViewClosed()));
if (createNew)
{
createNewDocument();
@@ -561,7 +561,7 @@ QuantaView* ViewManager::documentationView(bool create)
if (!m_documentationView && create)
{
m_documentationView = createView();
- m_documentationView->addCustomWidget((QWidget*)quantaApp->documentationPart()->view(), i18n("Documentation"));
+ m_documentationView->addCustomWidget((TQWidget*)quantaApp->documentationPart()->view(), i18n("Documentation"));
}
return m_documentationView;
}
@@ -588,7 +588,7 @@ bool ViewManager::allEditorsClosed()
return true;
}
-void ViewManager::slotTabContextMenu(QWidget *widget, const QPoint& point)
+void ViewManager::slotTabContextMenu(TQWidget *widget, const TQPoint& point)
{
if (m_separatorVisible)
m_tabPopup->removeItemAt(SEPARATOR_INDEX);
@@ -627,8 +627,8 @@ void ViewManager::slotTabContextMenu(QWidget *widget, const QPoint& point)
if (w && w->markIf)
{
m_bookmarks->setDocument(w);
- QPtrList<KTextEditor::Mark> m = w->markIf->marks();
- QPtrListIterator<KTextEditor::Mark> it(m);
+ TQPtrList<KTextEditor::Mark> m = w->markIf->marks();
+ TQPtrListIterator<KTextEditor::Mark> it(m);
for(; *it; ++it)
{
if ((*it)->type & KTextEditor::MarkInterface::markType01)
@@ -667,7 +667,7 @@ void ViewManager::slotTabContextMenu(QWidget *widget, const QPoint& point)
void ViewManager::slotFileListPopupAboutToShow()
{
m_fileListPopup->clear();
- QStringList viewList;
+ TQStringList viewList;
KMdiIterator<KMdiChildView*> *it = quantaApp->createIterator();
QuantaView *view;
int id = 0;
@@ -736,7 +736,7 @@ void ViewManager::slotDocumentClosed(const KURL& url)
}
/** Return the URL of the currently active document */
-QString ViewManager::currentURL()
+TQString ViewManager::currentURL()
{
Document *w = activeDocument();
if (w)