summaryrefslogtreecommitdiffstats
path: root/quanta/src/quanta.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/src/quanta.cpp')
-rw-r--r--quanta/src/quanta.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/quanta/src/quanta.cpp b/quanta/src/quanta.cpp
index ee054cbe..e74240ca 100644
--- a/quanta/src/quanta.cpp
+++ b/quanta/src/quanta.cpp
@@ -32,9 +32,9 @@
#include <tqradiobutton.h>
#include <tqimage.h>
#include <tqtimer.h>
-#include <tqtextcodec.h>
-#include <tqtextstream.h>
-#include <tqtextedit.h>
+#include <textcodec.h>
+#include <textstream.h>
+#include <textedit.h>
#include <tqiodevice.h>
#include <tqcombobox.h>
#include <tqdockarea.h>
@@ -42,7 +42,7 @@
#include <tqspinbox.h>
#include <tqeventloop.h>
#include <tqfontmetrics.h>
-#include <tqclipboard.h>
+#include <clipboard.h>
#include <tqptrlist.h>
#include <tqbuffer.h>
#include <tqdatetime.h>
@@ -258,7 +258,7 @@ QuantaApp::QuantaApp(int mdiMode) : DCOPObject("WindowManagerIf"), KMdiMainFrm(
m_parserEnabled = true;
cursorLine = 0;
cursorCol = 0;
- emit eventHappened("quanta_start", TQDateTime::tqcurrentDateTime().toString(Qt::ISODate), TQString());
+ emit eventHappened("quanta_start", TQDateTime::currentDateTime().toString(Qt::ISODate), TQString());
setAcceptDrops(true);
tabWidget()->installEventFilter(this);
}
@@ -375,7 +375,7 @@ void QuantaApp::slotFileOpen(const KURL::List &urls, const TQString& encoding)
{
if (!QExtFileInfo::exists(*i, true, this))
{
- KMessageBox::error(this, i18n("<qt>The file <b>%1</b> does not exist or is not a recognized mime type.</qt>").tqarg((*i).prettyURL(0, KURL::StripFileProtocol)));
+ KMessageBox::error(this, i18n("<qt>The file <b>%1</b> does not exist or is not a recognized mime type.</qt>").arg((*i).prettyURL(0, KURL::StripFileProtocol)));
} else
{
@@ -412,7 +412,7 @@ void QuantaApp::slotFileOpenRecent(const KURL &url)
if (!QExtFileInfo::exists(url, true, this))
{
if (KMessageBox::questionYesNo(this,
- i18n("The file %1 does not exist.\n Do you want to remove it from the list?").tqarg(url.prettyURL(0, KURL::StripFileProtocol)), TQString(), KStdGuiItem::del(), i18n("Keep"))
+ i18n("The file %1 does not exist.\n Do you want to remove it from the list?").arg(url.prettyURL(0, KURL::StripFileProtocol)), TQString(), KStdGuiItem::del(), i18n("Keep"))
== KMessageBox::Yes)
{
fileRecent->removeURL(url);
@@ -433,7 +433,7 @@ void QuantaApp::slotFileSave()
Document *w = view->document();
if (w)
{
- w->checkDirtytqStatus();
+ w->checkDirtyStatus();
if (w->isUntitled())
slotFileSaveAs();
else
@@ -457,7 +457,7 @@ bool QuantaApp::slotFileSaveAs(QuantaView *viewToSave)
if (w)
{
KURL oldURL = w->url();
- w->checkDirtytqStatus();
+ w->checkDirtyStatus();
if (!w->isUntitled() && oldURL.isLocalFile())
{
fileWatcher->removeFile(oldURL.path());
@@ -523,7 +523,7 @@ bool QuantaApp::slotFileSaveAs(QuantaView *viewToSave)
{
oldURL = saveUrl;
if (Project::ref()->hasProject() && !Project::ref()->contains(saveUrl) &&
- KMessageBox::Yes == KMessageBox::questionYesNo(0,i18n("<qt>Do you want to add the<br><b>%1</b><br>file to project?</qt>").tqarg(saveUrl.prettyURL(0, KURL::StripFileProtocol)), TQString(), KStdGuiItem::add(), i18n("Do Not Add"))
+ KMessageBox::Yes == KMessageBox::questionYesNo(0,i18n("<qt>Do you want to add the<br><b>%1</b><br>file to project?</qt>").arg(saveUrl.prettyURL(0, KURL::StripFileProtocol)), TQString(), KStdGuiItem::add(), i18n("Do Not Add"))
)
{
if (saveUrl.isLocalFile())
@@ -557,7 +557,7 @@ void QuantaApp::saveAsTemplate(bool projectTemplate, bool selectionOnly)
KURL url;
int query;
KURL projectTemplateURL;
- w->checkDirtytqStatus();
+ w->checkDirtyStatus();
TQString localTemplateDir = locateLocal("data", resourceDir + "templates/");
do {
@@ -584,7 +584,7 @@ void QuantaApp::saveAsTemplate(bool projectTemplate, bool selectionOnly)
{
if (projectTemplate)
localTemplateDir = projectTemplateURL.path(1);
- KMessageBox::sorry(this,i18n("You must save the templates in the following folder: \n\n%1").tqarg(localTemplateDir));
+ KMessageBox::sorry(this,i18n("You must save the templates in the following folder: \n\n%1").arg(localTemplateDir));
query = KMessageBox::No;
}
} while (query != KMessageBox::Yes);
@@ -603,7 +603,7 @@ void QuantaApp::saveAsTemplate(bool projectTemplate, bool selectionOnly)
tempFile->file()->flush();
tempFile->close();
if (!QExtFileInfo::copy(KURL::fromPathOrURL(tempFile->name()), url, -1, true, false, this))
- KMessageBox::error(this, i18n("<qt>There was an error while creating the template file.<br>Check that you have write access to <i>%1</i>.</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("Template Creation Error"));
+ KMessageBox::error(this, i18n("<qt>There was an error while creating the template file.<br>Check that you have write access to <i>%1</i>.</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol)), i18n("Template Creation Error"));
delete tempFile;
} else
{
@@ -684,7 +684,7 @@ void QuantaApp::slotFileCloseAll()
part->write(" ");
part->end();
- slotNewtqStatus();
+ slotNewStatus();
}
void QuantaApp::slotFileQuit()
@@ -710,12 +710,12 @@ void QuantaApp::slotStatusMsg(const TQString &msg)
{
statusbarTimer->stop();
statusBar()->changeItem(" " + KStringHandler::cPixelSqueeze(msg, statusBar()->fontMetrics(), progressBar->x() - 20), IDS_STATUS);
- statusBar()->tqrepaint();
- kapp->tqprocessEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers);
+ statusBar()->repaint();
+ kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers);
statusbarTimer->start(10000, true);
}
-/** tqrepaint preview */
+/** repaint preview */
void QuantaApp::slotRepaintPreview()
{
Document *w = ViewManager::ref()->activeDocument();
@@ -915,7 +915,7 @@ void QuantaApp::slotInsertTag(const KURL& url, DirInfo dirInfo)
}
}
-void QuantaApp::slotNewtqStatus()
+void QuantaApp::slotNewStatus()
{
fileRecent->setEnabled(true);
actionCollection()->action("project_open_recent")->setEnabled(true);
@@ -1348,7 +1348,7 @@ void QuantaApp::slotOptions()
if (previewSettingsChanged)
slotShowPreviewWidget(true);
qConfig.docPosition = uiOptions->docPosition();
- qConfig.windowLayout = uiOptions->tqlayout();
+ qConfig.windowLayout = uiOptions->layout();
m_htmlPart->closeURL();
m_htmlPart->begin( Project::ref()->projectBaseURL());
@@ -1356,7 +1356,7 @@ void QuantaApp::slotOptions()
m_htmlPart->end();
reparse(true);
- slotNewtqStatus();
+ slotNewStatus();
}
m_config->sync();
@@ -1437,7 +1437,7 @@ void QuantaApp::slotShowPreviewWidget(bool show)
}
}
-void QuantaApp::slotChangePreviewtqStatus()
+void QuantaApp::slotChangePreviewStatus()
{
if (qConfig.previewPosition == "Editor")
{
@@ -1446,7 +1446,7 @@ void QuantaApp::slotChangePreviewtqStatus()
if (m_previewToolView && m_htmlPart->view()->isVisible())
{
//hiding the preview when it's in a toolview means that the current tab has changed,
- //so we just tqrepaint the content and restore the document on the disc.
+ //so we just repaint the content and restore the document on the disc.
m_previewVisible = true;
if (m_previewedDocument)
{
@@ -1511,7 +1511,7 @@ void QuantaApp::newCursorPosition(const TQString &file, int lineNumber, int colu
startIdleTimer();
// updateTreeViews();
TQString linenumber;
- linenumber = i18n("Line: %1 Col: %2").tqarg(lineNumber).tqarg(columnNumber);
+ linenumber = i18n("Line: %1 Col: %2").arg(lineNumber).arg(columnNumber);
statusBar()->changeItem(linenumber, IDS_STATUS_CLM);
statusBar()->changeItem(i18n(" R/O "),IDS_INS_OVR);
statusBar()->changeItem("",IDS_MODIFIED);
@@ -1525,7 +1525,7 @@ void QuantaApp::newDebuggerPosition(const TQString &file, int lineNumber)
void QuantaApp::openFile(const TQString &file, int lineNumber, int columnNumber)
{
gotoFileAndLine(file, lineNumber, columnNumber);
- slotNewtqStatus();
+ slotNewStatus();
}
void QuantaApp::slotNewLineColumn()
@@ -1539,7 +1539,7 @@ void QuantaApp::slotNewLineColumn()
Document *w = ViewManager::ref()->activeDocument();
if (w)
w->viewCursorIf->cursorPosition(&cursorLine, &cursorCol);
- linenumber = i18n("Line: %1 Col: %2").tqarg(cursorLine+1).tqarg(cursorCol+1);
+ linenumber = i18n("Line: %1 Col: %2").arg(cursorLine+1).arg(cursorCol+1);
statusBar()->changeItem(linenumber, IDS_STATUS_CLM);
}
@@ -1795,7 +1795,7 @@ TQWidget* QuantaApp::createContainer( TQWidget *parent, int index, const TQDomEl
TQWidget *w = new TQWidget(toolbarTab, TQString("ToolbarHoldingWidget" + element.attribute("name")).ascii());
QuantaToolBar *tb = new QuantaToolBar(w, element.attribute("name").ascii(), true, true);
tb->loadState(element);
- tb->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum);
+ tb->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum);
//kdDebug(24000) << "tb->iconSize() " << tb->iconSize() << endl;
if (toolbarTab->iconText() == KToolBar::IconTextBottom)
@@ -1968,7 +1968,7 @@ void QuantaApp::slotContextMenuAboutToShow()
urlUnderCursor = baseUrl;
QuantaCommon::setUrl(urlUnderCursor, name.stripWhiteSpace());
urlUnderCursor = QExtFileInfo::toAbsolute(urlUnderCursor, baseUrl);
- action->setText(i18n("Open File: %1").tqarg(KStringHandler::lsqueeze(urlUnderCursor.prettyURL(0, KURL::StripFileProtocol), 80)));
+ action->setText(i18n("Open File: %1").arg(KStringHandler::lsqueeze(urlUnderCursor.prettyURL(0, KURL::StripFileProtocol), 80)));
action->setEnabled(true);
} else
{
@@ -2027,7 +2027,7 @@ void QuantaApp::slotContextMenuAboutToShow()
action = actionCollection()->action("debug_addwatch");
if(action)
{
- action->setText(i18n("Add Watch: '%1'").tqarg(word));
+ action->setText(i18n("Add Watch: '%1'").arg(word));
action->setEnabled(!word.isEmpty());
if(!action->isPlugged(popup))
@@ -2038,7 +2038,7 @@ void QuantaApp::slotContextMenuAboutToShow()
action = actionCollection()->action("debug_variable_set");
if(action)
{
- action->setText(i18n("Set Value of '%1'").tqarg(word));
+ action->setText(i18n("Set Value of '%1'").arg(word));
action->setEnabled(!word.isEmpty());
if(!action->isPlugged(popup))
@@ -2049,7 +2049,7 @@ void QuantaApp::slotContextMenuAboutToShow()
action = actionCollection()->action("debug_conditional_break");
if(action)
{
- action->setText(i18n("Break When '%1'...").tqarg(word));
+ action->setText(i18n("Break When '%1'...").arg(word));
action->setEnabled(!word.isEmpty());
if(!action->isPlugged(popup))
@@ -2087,7 +2087,7 @@ void QuantaApp::slotOpenFileUnderCursor()
}
} else
{
- KMessageBox::error(this, i18n("<qt>The file <b>%1</b> does not exist or is not a recognized mime type.</qt>").tqarg(urlUnderCursor.prettyURL(0, KURL::StripFileProtocol)));
+ KMessageBox::error(this, i18n("<qt>The file <b>%1</b> does not exist or is not a recognized mime type.</qt>").arg(urlUnderCursor.prettyURL(0, KURL::StripFileProtocol)));
}
}
@@ -2166,8 +2166,8 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url)
{
if ((nodeList.item(i).cloneNode().toElement().attribute("name").lower() ) == name.lower())
{
- newName = origName + TQString(" (%1)").tqarg(count);
- i18nName = i18n(origName.utf8()) + TQString(" (%1)").tqarg(count);
+ newName = origName + TQString(" (%1)").arg(count);
+ i18nName = i18n(origName.utf8()) + TQString(" (%1)").arg(count);
nameModified = true;
count++;
found = true;
@@ -2199,7 +2199,7 @@ void QuantaApp::slotLoadToolbarFile(const KURL& url)
int n = 1;
while (m_toolbarList.find(toolbarId) != 0L)
{
- toolbarId = s + TQString("%1").tqarg(n);
+ toolbarId = s + TQString("%1").arg(n);
toolbarId.replace(rx, "_");
n++;
}
@@ -2438,7 +2438,7 @@ KURL QuantaApp::saveToolbarToFile(const TQString& toolbarName, const KURL& destF
TQString error;
int el, ec;
if (!dom->setContent(s, &error, &el, &ec))
- kdError(24000) << TQString("Error %1 at (%2, %3)").tqarg(error).tqarg(el).tqarg(ec)<<endl;
+ kdError(24000) << TQString("Error %1 at (%2, %3)").arg(error).arg(el).arg(ec)<<endl;
p_toolbar->dom = dom;
TQTextStream bufferStr(&buffer);
@@ -2461,7 +2461,7 @@ KURL QuantaApp::saveToolbarToFile(const TQString& toolbarName, const KURL& destF
if (!QExtFileInfo::copy(KURL::fromPathOrURL(tempFile->name()), tarFile, -1, true, false, this))
{
KMessageBox::error(this, i18n("<qt>An error happened while saving the <b>%1</b> toolbar.<br>"
- "Check that you have write permissions for<br><b>%2</b>.<br><br>This might happen if you tried save to save a global toolbar as a simple user. Use <i>Save As</i> or <i>Toolbars->Save Toolbars->Save as Local Toolbar</i> in this case. </qt>").tqarg(p_toolbar->name).tqarg(tarFile.prettyURL(0, KURL::StripFileProtocol)), i18n("Toolbar Saving Error"));
+ "Check that you have write permissions for<br><b>%2</b>.<br><br>This might happen if you tried save to save a global toolbar as a simple user. Use <i>Save As</i> or <i>Toolbars->Save Toolbars->Save as Local Toolbar</i> in this case. </qt>").arg(p_toolbar->name).arg(tarFile.prettyURL(0, KURL::StripFileProtocol)), i18n("Toolbar Saving Error"));
tarFile = KURL();
delete p_toolbar->dom;
p_toolbar->dom = oldDom;
@@ -2554,7 +2554,7 @@ bool QuantaApp::saveToolbar(bool localToolbar, const TQString& toolbarToSave, co
if (!localToolbar)
localToolbarsDir = projectToolbarsURL.prettyURL();
KMessageBox::sorry(0,i18n("<qt>You must save the toolbars to the following folder: <br><br><b>%1</b></qt>")
- .tqarg(localToolbarsDir));
+ .arg(localToolbarsDir));
query = KMessageBox::No;
}
} while (query != KMessageBox::Yes);
@@ -2591,7 +2591,7 @@ void QuantaApp::slotSaveProjectToolbar()
void QuantaApp::slotAddToolbar()
{
bool ok;
- TQString name = KInputDialog::getText(i18n("New Toolbar"), i18n("Enter toolbar name:"), i18n("User_%1").tqarg(userToolbarsCount), &ok, this);
+ TQString name = KInputDialog::getText(i18n("New Toolbar"), i18n("Enter toolbar name:"), i18n("User_%1").arg(userToolbarsCount), &ok, this);
if (ok)
{
userToolbarsCount++;
@@ -2600,7 +2600,7 @@ void QuantaApp::slotAddToolbar()
int n = 1;
while (m_toolbarList.find(toolbarId) != 0L)
{
- toolbarId = name + TQString("%1").tqarg(n);
+ toolbarId = name + TQString("%1").arg(n);
n++;
}
toolbarId = toolbarId.lower();
@@ -2609,7 +2609,7 @@ void QuantaApp::slotAddToolbar()
tempFile->setAutoDelete(true);
tempFile->textStream()->setEncoding(TQTextStream::UnicodeUTF8);
* (tempFile->textStream()) << TQString("<!DOCTYPE kpartgui SYSTEM \"kpartgui.dtd\">\n<kpartgui name=\"quanta\" version=\"2\">\n<ToolBar name=\"%1\" tabname=\"%2\" i18ntabname=\"%3\" id=\"%4\">\n<text>%5</text>\n</ToolBar>\n</kpartgui>\n")
- .tqarg(name.lower()).tqarg(name).tqarg(name).tqarg(toolbarId).tqarg(name);
+ .arg(name.lower()).arg(name).arg(name).arg(toolbarId).arg(name);
tempFile->close();
ToolbarXMLGUI * toolbarGUI = new ToolbarXMLGUI(tempFile->name());
@@ -3122,7 +3122,7 @@ void QuantaApp::focusInEvent(TQFocusEvent* e)
if (w)
{
w->view()->setFocus();
- w->checkDirtytqStatus();
+ w->checkDirtyStatus();
}
}
@@ -3318,12 +3318,12 @@ bool QuantaApp::slotRemoveToolbar(const TQString& a_name)
int result;
if (p_toolbar->url.isEmpty())
{
- result = KMessageBox::warningYesNoCancel(this, i18n("<qt>Toolbar <b>%1</b> is new and unsaved. Do you want to save it before it is removed?</qt>").tqarg(p_toolbar->name),
+ result = KMessageBox::warningYesNoCancel(this, i18n("<qt>Toolbar <b>%1</b> is new and unsaved. Do you want to save it before it is removed?</qt>").arg(p_toolbar->name),
i18n("Save Toolbar"), KStdGuiItem::save(), KStdGuiItem::discard());
} else
{
FourButtonMessageBox dlg(this, 0, true);
- dlg.textLabel->setText(i18n("<qt>The toolbar <b>%1</b> was modified. Do you want to save it before it is removed?</qt>").tqarg(p_toolbar->name));
+ dlg.textLabel->setText(i18n("<qt>The toolbar <b>%1</b> was modified. Do you want to save it before it is removed?</qt>").arg(p_toolbar->name));
dlg.setCaption(i18n("Save Toolbar"));
dlg.pixmapLabel->setPixmap(BarIcon("messagebox_info", KIcon::SizeMedium));
dlg.exec();
@@ -3784,7 +3784,7 @@ TQStringList QuantaApp::openedURLs() const
Document *w = qView->document();
if ( w )
{
- list.prepend( TQString("%1:%2").tqarg(w->editIf->editInterfaceNumber()).tqarg(w->url().url()));
+ list.prepend( TQString("%1:%2").arg(w->editIf->editInterfaceNumber()).arg(w->url().url()));
}
}
}
@@ -4160,7 +4160,7 @@ bool QuantaApp::queryClose()
{
saveOptions();
// kdDebug(24000) << "Quanta will exit" << endl;
- emit eventHappened("quanta_exit", TQDateTime::tqcurrentDateTime().toString(Qt::ISODate), TQString());
+ emit eventHappened("quanta_exit", TQDateTime::currentDateTime().toString(Qt::ISODate), TQString());
} else
slotFileNew();
return canExit;
@@ -4200,7 +4200,7 @@ void QuantaApp::saveOptions()
m_config->writeEntry("Smart Tag Insertion", qConfig.smartTagInsertion);
- m_config->writeEntry("Window tqlayout", qConfig.windowLayout);
+ m_config->writeEntry("Window layout", qConfig.windowLayout);
m_config->writeEntry("Follow Cursor", StructTreeView::ref()->followCursor() );
//If user choose the timer interval, it needs to restart the timer too
m_config->writeEntry("Autosave interval", qConfig.autosaveInterval);
@@ -4327,7 +4327,7 @@ void QuantaApp::slotEditCurrentTag()
slotEnableIdleTimer(true);
if (isUnknown)
{
- TQString message = i18n("Unknown tag: %1").tqarg(tagName);
+ TQString message = i18n("Unknown tag: %1").arg(tagName);
slotStatusMsg( message );
}
}
@@ -4840,7 +4840,7 @@ void QuantaApp::slotPasteHTMLQuoted()
Document *w = ViewManager::ref()->activeDocument();
if (w)
{
- TQClipboard *cb = tqApp->tqclipboard();
+ TQClipboard *cb = tqApp->clipboard();
TQString text = cb->text();
if ( ( !text.isNull() ) && (!text.isEmpty() ) )
@@ -4869,7 +4869,7 @@ void QuantaApp::slotPasteHTMLQuoted()
int code = s.toInt(&ok);
if (!ok || code < 191)
continue;
- text.replace(TQChar(code), TQString("&#%1;").tqarg(s));
+ text.replace(TQChar(code), TQString("&#%1;").arg(s));
}
}
unsigned int line, col;
@@ -4885,7 +4885,7 @@ void QuantaApp::slotPasteURLEncoded()
Document *w = ViewManager::ref()->activeDocument();
if (w)
{
- TQClipboard *cb = tqApp->tqclipboard();
+ TQClipboard *cb = tqApp->clipboard();
TQString text = cb->text();
if ( ( !text.isNull() ) && (!text.isEmpty() ) )
@@ -5004,14 +5004,14 @@ void QuantaApp::slotCopy()
if (m_htmlPart->view()->hasFocus())
{
TQString selection = m_htmlPart->selectedText();
- TQClipboard *cb = TQApplication::tqclipboard();
+ TQClipboard *cb = TQApplication::clipboard();
cb->setText(selection, TQClipboard::Clipboard);
}
else
if (m_htmlPartDoc->view()->hasFocus())
{
TQString selection = m_htmlPartDoc->selectedText();
- TQClipboard *cb = TQApplication::tqclipboard();
+ TQClipboard *cb = TQApplication::clipboard();
cb->setText(selection, TQClipboard::Clipboard);
}