From e654398e46e37abf457b2b1122ab898d2c51c49f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:43:15 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- arts/builder/main.cpp | 150 +++++++++++++++++++++++++------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) (limited to 'arts/builder/main.cpp') diff --git a/arts/builder/main.cpp b/arts/builder/main.cpp index 9cc300ed..4630f2f7 100644 --- a/arts/builder/main.cpp +++ b/arts/builder/main.cpp @@ -54,8 +54,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -78,7 +78,7 @@ protected: public: ArtsBuilderApp(); - ArtsBuilderApp(QString filename); + ArtsBuilderApp(TQString filename); void start(); void end(); }; @@ -146,7 +146,7 @@ ArtsBuilderWindow::ArtsBuilderWindow(const char *name) arts_debug("PORT: modulewidget"); modulewidget = new ModuleWidget(structure, mainDock, "mwidget"); mainDock->setWidget(modulewidget); - connect(modulewidget, SIGNAL(modified(bool)), SLOT(setModified(bool))); + connect(modulewidget, TQT_SIGNAL(modified(bool)), TQT_SLOT(setModified(bool))); arts_debug("PORT: modulewidget ok"); // allow others to dock to the 4 sides @@ -167,20 +167,20 @@ ArtsBuilderWindow::ArtsBuilderWindow(const char *name) 80); // relation target/this (in percent) // selection - connect(modulewidget, SIGNAL(portSelected(ModulePort *)), - propertyPanel, SLOT (setSelectedPort(ModulePort *))); - connect(propertyPanel, SIGNAL(portSelected(ModulePort *)), - modulewidget, SLOT (selectPort(ModulePort *))); - connect(modulewidget, SIGNAL(componentSelected(StructureComponent *)), - propertyPanel, SLOT (setSelectedComponent(StructureComponent *))); + connect(modulewidget, TQT_SIGNAL(portSelected(ModulePort *)), + propertyPanel, TQT_SLOT (setSelectedPort(ModulePort *))); + connect(propertyPanel, TQT_SIGNAL(portSelected(ModulePort *)), + modulewidget, TQT_SLOT (selectPort(ModulePort *))); + connect(modulewidget, TQT_SIGNAL(componentSelected(StructureComponent *)), + propertyPanel, TQT_SLOT (setSelectedComponent(StructureComponent *))); // connection - connect(propertyPanel, SIGNAL(startConnection(ModulePort *)), - modulewidget, SLOT (startConnection(ModulePort *))); + connect(propertyPanel, TQT_SIGNAL(startConnection(ModulePort *)), + modulewidget, TQT_SLOT (startConnection(ModulePort *))); // port properties changed - connect(propertyPanel, SIGNAL(portPropertiesChanged(ModulePort *)), - modulewidget, SLOT (portPropertiesChanged(ModulePort *))); + connect(propertyPanel, TQT_SIGNAL(portPropertiesChanged(ModulePort *)), + modulewidget, TQT_SLOT (portPropertiesChanged(ModulePort *))); arts_debug("PORT: setcanvas"); structure->setCanvas(modulewidget); @@ -251,25 +251,25 @@ ArtsBuilderWindow::ArtsBuilderWindow(const char *name) */ #if 000 - connect(menubar, SIGNAL(highlighted(int)), this, SLOT(activateMenu(int))); - connect(m_view, SIGNAL(activated(int)), modulewidget, SLOT(setZoom(int))); - connect(m_ports, SIGNAL(activated(int)), this, SLOT(addPort(int))); - connect(m_file_new, SIGNAL(activated(int)), this, SLOT(fileNew(int))); + connect(menubar, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(activateMenu(int))); + connect(m_view, TQT_SIGNAL(activated(int)), modulewidget, TQT_SLOT(setZoom(int))); + connect(m_ports, TQT_SIGNAL(activated(int)), this, TQT_SLOT(addPort(int))); + connect(m_file_new, TQT_SIGNAL(activated(int)), this, TQT_SLOT(fileNew(int))); - //connect(m_modules, SIGNAL(activated(int)), this, SLOT(addModule(int))); + //connect(m_modules, TQT_SIGNAL(activated(int)), this, TQT_SLOT(addModule(int))); /* - connect(m_modules_synth, SIGNAL(activated(int)), this, SLOT(addModule(int))); - connect(m_modules_gui, SIGNAL(activated(int)), this, SLOT(addModule(int))); - connect(m_modules_instruments, SIGNAL(activated(int)), this, SLOT(addModule(int))); - connect(m_modules_other, SIGNAL(activated(int)), this, SLOT(addModule(int))); + connect(m_modules_synth, TQT_SIGNAL(activated(int)), this, TQT_SLOT(addModule(int))); + connect(m_modules_gui, TQT_SIGNAL(activated(int)), this, TQT_SLOT(addModule(int))); + connect(m_modules_instruments, TQT_SIGNAL(activated(int)), this, TQT_SLOT(addModule(int))); + connect(m_modules_other, TQT_SIGNAL(activated(int)), this, TQT_SLOT(addModule(int))); */ - connect(kapp, SIGNAL(lastWindowClosed()), this , SLOT(quit())); + connect(kapp, TQT_SIGNAL(lastWindowClosed()), this , TQT_SLOT(quit())); // update the modules menu once for the start #endif arts_debug("PORT: activatemenu"); - connect(menumaker, SIGNAL(activated(const char *)), this, SLOT(addModule(const char *))); + connect(menumaker, TQT_SIGNAL(activated(const char *)), this, TQT_SLOT(addModule(const char *))); fillModuleMenu(); arts_debug("PORT: activatemenu ok"); setupActions(); @@ -277,13 +277,13 @@ ArtsBuilderWindow::ArtsBuilderWindow(const char *name) createGUI(); // connect to aboutToShow to correctly show state of dockwidget there: - QPopupMenu *viewmenu = (QPopupMenu*)factory()->container("view", this); + TQPopupMenu *viewmenu = (TQPopupMenu*)factory()->container("view", this); if (viewmenu) - connect(viewmenu, SIGNAL(aboutToShow()), this, SLOT(viewMenuAboutToShow())); + connect(viewmenu, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(viewMenuAboutToShow())); else arts_debug("view menu not found!"); - m_filename = QString::null; + m_filename = TQString::null; setModified(false); installEventFilter(propertyPanel); @@ -292,55 +292,55 @@ ArtsBuilderWindow::ArtsBuilderWindow(const char *name) void ArtsBuilderWindow::setupActions() { // File menu - KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection()); - (void)new KAction(i18n("Open Session..."), 0, this, SLOT(openSession()), + (void)new KAction(i18n("Open Session..."), 0, this, TQT_SLOT(openSession()), actionCollection(), "file_open_session"); - KStdAction::open(this, SLOT(open()), actionCollection()); - (void)new KAction(i18n("Open E&xample..."), Qt::CTRL + Qt::Key_X, this, SLOT(openExample()), + KStdAction::open(this, TQT_SLOT(open()), actionCollection()); + (void)new KAction(i18n("Open E&xample..."), Qt::CTRL + Qt::Key_X, this, TQT_SLOT(openExample()), actionCollection(), "file_open_example"); - KStdAction::save(this, SLOT(save()), actionCollection()); - KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - (void)new KAction(i18n("&Retrieve From Server..."), Qt::CTRL + Qt::Key_R, this, SLOT(retrieve()), + KStdAction::save(this, TQT_SLOT(save()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + (void)new KAction(i18n("&Retrieve From Server..."), Qt::CTRL + Qt::Key_R, this, TQT_SLOT(retrieve()), actionCollection(), "file_retrieve_from_server"); - (void)new KAction(i18n("&Execute Structure"), "artsbuilderexecute", Qt::CTRL + Qt::Key_E, this, SLOT(execute()), + (void)new KAction(i18n("&Execute Structure"), "artsbuilderexecute", Qt::CTRL + Qt::Key_E, this, TQT_SLOT(execute()), actionCollection(), "file_execute_structure"); - (void)new KAction(i18n("&Rename Structure..."), Qt::CTRL + Qt::Key_R, this, SLOT(rename()), + (void)new KAction(i18n("&Rename Structure..."), Qt::CTRL + Qt::Key_R, this, TQT_SLOT(rename()), actionCollection(), "file_rename_structure"); - (void)new KAction(i18n("&Publish Structure"), Qt::CTRL + Qt::Key_P, this, SLOT(publish()), + (void)new KAction(i18n("&Publish Structure"), Qt::CTRL + Qt::Key_P, this, TQT_SLOT(publish()), actionCollection(), "file_publish_structure"); - KStdAction::quit(this, SLOT(close()), actionCollection()); + KStdAction::quit(this, TQT_SLOT(close()), actionCollection()); // Edit menu - (void)new KAction(i18n("&Delete"), Qt::Key_Delete, modulewidget, SLOT(delModule()), + (void)new KAction(i18n("&Delete"), Qt::Key_Delete, modulewidget, TQT_SLOT(delModule()), actionCollection(), "edit_delete"); - KStdAction::selectAll(modulewidget, SLOT(selectAll()), actionCollection()); + KStdAction::selectAll(modulewidget, TQT_SLOT(selectAll()), actionCollection()); // View menu viewPropertiesAction= new KToggleAction(i18n("&Property Panel"), 0, - propertyDock, SLOT(changeHideShowState()), + propertyDock, TQT_SLOT(changeHideShowState()), actionCollection(), "view_properties"); - (void)new KAction(i18n("200%"), 0, this, SLOT(viewAt200()), + (void)new KAction(i18n("200%"), 0, this, TQT_SLOT(viewAt200()), actionCollection(), "view_200"); - (void)new KAction(i18n("150%"), 0, this, SLOT(viewAt150()), + (void)new KAction(i18n("150%"), 0, this, TQT_SLOT(viewAt150()), actionCollection(), "view_150"); - (void)new KAction(i18n("100%"), 0, this, SLOT(viewAt100()), + (void)new KAction(i18n("100%"), 0, this, TQT_SLOT(viewAt100()), actionCollection(), "view_100"); - (void)new KAction(i18n("50%"), 0, this, SLOT(viewAt50()), + (void)new KAction(i18n("50%"), 0, this, TQT_SLOT(viewAt50()), actionCollection(), "view_50"); // Ports menu - (void)new KAction(i18n("Create IN Audio Signal"), 0, this, SLOT(createInAudioSignal()), + (void)new KAction(i18n("Create IN Audio Signal"), 0, this, TQT_SLOT(createInAudioSignal()), actionCollection(), "ports_create_in_audio_signal"); - (void)new KAction(i18n("Create OUT Audio Signal"), 0, this, SLOT(createOutAudioSignal()), + (void)new KAction(i18n("Create OUT Audio Signal"), 0, this, TQT_SLOT(createOutAudioSignal()), actionCollection(), "ports_create_out_audio_signal"); - (void)new KAction(i18n("Create IN String Property"), 0, this, SLOT(createInStringProperty()), + (void)new KAction(i18n("Create IN String Property"), 0, this, TQT_SLOT(createInStringProperty()), actionCollection(), "ports_create_in_string_property"); - (void)new KAction(i18n("Create IN Audio Property"), 0, this, SLOT(createInAudioProperty()), + (void)new KAction(i18n("Create IN Audio Property"), 0, this, TQT_SLOT(createInAudioProperty()), actionCollection(), "ports_create_in_audio_property"); - (void)new KAction(i18n("Implement Interface..."), 0, this, SLOT(addInterface()), + (void)new KAction(i18n("Implement Interface..."), 0, this, TQT_SLOT(addInterface()), actionCollection(), "ports_implement_interface"); - (void)new KAction(i18n("Change Positions/Names..."), 0, this, SLOT(changePortPositions()), + (void)new KAction(i18n("Change Positions/Names..."), 0, this, TQT_SLOT(changePortPositions()), actionCollection(), "ports_change_positions"); } @@ -444,10 +444,10 @@ void ArtsBuilderWindow::publish() i18n("The structure has been published as: '%1' on the server.").arg( structure->name().c_str() )); } -QString ArtsBuilderWindow::getOpenFilename(const char *pattern, const char *initialDir) +TQString ArtsBuilderWindow::getOpenFilename(const char *pattern, const char *initialDir) { arts_debug(">>>>> getOpenFilename"); - QString filename = KFileDialog::getOpenFileName(initialDir, pattern, this); + TQString filename = KFileDialog::getOpenFileName(initialDir, pattern, this); arts_debug(">>>>> opendlg closed"); if(!filename.isEmpty()) { @@ -455,7 +455,7 @@ QString ArtsBuilderWindow::getOpenFilename(const char *pattern, const char *init // check that the file is ok: - FILE *infile = fopen(QFile::encodeName(filename), "r"); + FILE *infile = fopen(TQFile::encodeName(filename), "r"); if(infile) { @@ -463,7 +463,7 @@ QString ArtsBuilderWindow::getOpenFilename(const char *pattern, const char *init return(filename); } } - return QString(""); + return TQString(""); } void ArtsBuilderWindow::fileNew() @@ -474,7 +474,7 @@ void ArtsBuilderWindow::fileNew() propertyPanel->setSelectedComponent(0); structure->clear(); modulewidget->reInit(); - m_filename = QString::null; + m_filename = TQString::null; setModified(false); } @@ -486,14 +486,14 @@ void ArtsBuilderWindow::open() open(getOpenFilename("*.arts", DirManager::structureDir())); } -void ArtsBuilderWindow::open(QString filename) +void ArtsBuilderWindow::open(TQString filename) { if(!promptToSave()) return; if(!filename.isEmpty()) { - structure->load(QFile::encodeName(filename)); + structure->load(TQFile::encodeName(filename)); modulewidget->reInit(); if(!structure->valid()) { @@ -514,12 +514,12 @@ void ArtsBuilderWindow::openSession() if(!promptToSave()) return; - QString filename = getOpenFilename("*.arts-session", DirManager::sessionDir()); + TQString filename = getOpenFilename("*.arts-session", DirManager::sessionDir()); if(!filename.isEmpty()) { Session *session = new Session(); - session->loadSession(QFile::encodeName(filename)); + session->loadSession(TQFile::encodeName(filename)); assert(!execDlg); execDlg = new ExecDlg(0, session); @@ -532,7 +532,7 @@ void ArtsBuilderWindow::openSession() execDlg->start(); execDlg->show(); - connect(execDlg, SIGNAL(ready()), this, SLOT(endexecute())); + connect(execDlg, TQT_SIGNAL(ready()), this, TQT_SLOT(endexecute())); hide(); // m_filename = filename; FIXME: DOESN'T THIS BELONG HERE? @@ -545,14 +545,14 @@ void ArtsBuilderWindow::openExample() if(!promptToSave()) return; - QString dir = locate("data", "artsbuilder/examples/"); + TQString dir = locate("data", "artsbuilder/examples/"); if(!dir) KMessageBox::sorry( this, i18n("Unable to find the examples folder.\nUsing the current folder instead."), i18n("aRts Warning")); - open(getOpenFilename("*.arts", QFile::encodeName(dir))); + open(getOpenFilename("*.arts", TQFile::encodeName(dir))); } void ArtsBuilderWindow::saveAs() @@ -566,19 +566,19 @@ void ArtsBuilderWindow::saveAs() dlg->setSelection(defaultname.c_str()); dlg->setCaption(i18n("Save As")); - QString filename; - if(dlg->exec() == QDialog::Accepted) + TQString filename; + if(dlg->exec() == TQDialog::Accepted) filename = dlg->selectedFile(); delete dlg; - // QString filename = KFileDialog::getSaveFileName(0, "*.arts", this); + // TQString filename = KFileDialog::getSaveFileName(0, "*.arts", this); // filename.detach(); if(!filename.isEmpty()) save(filename); } -bool ArtsBuilderWindow::save(QString filename) +bool ArtsBuilderWindow::save(TQString filename) { arts_debug("trying to save structure as '%s'", filename.local8Bit().data()); @@ -629,7 +629,7 @@ void ArtsBuilderWindow::rename() { bool ok; - QString name = KInputDialog::getText( i18n( "Rename Structure" ), + TQString name = KInputDialog::getText( i18n( "Rename Structure" ), i18n( "Enter structure name:" ), structure->name().c_str(), &ok, this ); if (ok) { @@ -649,7 +649,7 @@ void ArtsBuilderWindow::retrieve() if(rd.exec()) { - QString result = rd.result(); + TQString result = rd.result(); if(!result.isEmpty()) { structure->retrieve(result.local8Bit()); @@ -674,7 +674,7 @@ void ArtsBuilderWindow::execute() execDlg->start(); execDlg->show(); - connect(execDlg, SIGNAL(ready()), this, SLOT(endexecute())); + connect(execDlg, TQT_SIGNAL(ready()), this, TQT_SLOT(endexecute())); hide(); } @@ -838,7 +838,7 @@ bool ArtsBuilderWindow::promptToSave() return true; query = KMessageBox::warningYesNoCancel(this, - i18n("The current structure has been modified.\nWould you like to save it?"), QString::null, KStdGuiItem::save(), KStdGuiItem::discard()); + i18n("The current structure has been modified.\nWould you like to save it?"), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()); result = false; switch(query) @@ -864,10 +864,10 @@ ArtsBuilderApp::ArtsBuilderApp() start(); } -ArtsBuilderApp::ArtsBuilderApp(QString filename) +ArtsBuilderApp::ArtsBuilderApp(TQString filename) { start(); - if(QFile::exists(filename)) + if(TQFile::exists(filename)) { mainWindow->open(filename); } else { @@ -946,7 +946,7 @@ int main(int argc, char **argv) } if(args->count() > 0) { - ArtsBuilderApp Application(QFile::decodeName(args->arg(0))); + ArtsBuilderApp Application(TQFile::decodeName(args->arg(0))); args->clear(); return Application.exec(); } else { -- cgit v1.2.1