void MainWindow::setupActions() { buildActions = new QActionGroup(this); buildActions->addAction(ui.action_Build); buildActions->addAction(ui.action_Upload); connect(ui.tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int))); connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabHasChanged())); connect(ui.action_New, SIGNAL(triggered()), this, SLOT(newProject())); connect(ui.action_Open, SIGNAL(triggered()), this, SLOT(open())); connect(ui.action_Save, SIGNAL(triggered()), this, SLOT(save())); connect(ui.action_Saveas, SIGNAL(triggered()), this, SLOT(save_as())); connect(ui.action_Close, SIGNAL(triggered()), this, SLOT(closeTab())); connect(ui.actionUpPastebin, SIGNAL(triggered()), this, SLOT(uploadToPastebin())); connect(ui.actionUndo, SIGNAL(triggered()), this, SLOT(undo())); connect(ui.actionRedo, SIGNAL(triggered()), this, SLOT(redo())); connect(ui.action_Copy, SIGNAL(triggered()), this, SLOT(copy())); connect(ui.action_Cut, SIGNAL(triggered()), this, SLOT(cut())); connect(ui.action_Find, SIGNAL(triggered(bool)), this, SLOT(showFindBox(bool))); connect(ui.action_Paste, SIGNAL(triggered()), this, SLOT(paste())); connect(ui.action_Build, SIGNAL(triggered()), this, SLOT(build())); connect(ui.action_Upload, SIGNAL(triggered()), this, SLOT(upload())); connect(ui.action_Utilities, SIGNAL(triggered()), this, SLOT(toggleDock())); connect(ui.actionGo_to_the_next_tab, SIGNAL(triggered()), this, SLOT(nextTab())); connect(ui.actionGo_to_the_previous_tab, SIGNAL(triggered()), this, SLOT(previousTab())); connect(ui.action_Configure_the_IDE, SIGNAL(triggered()), this, SLOT(configure())); connect(ui.action_Contextual_help, SIGNAL(triggered()), this, SLOT(contextualHelp())); connect(ui.actionCommunityArduinoCC, SIGNAL(triggered()), this, SLOT(openCommunityArduinoCC())); connect(ui.actionCommunityArduinoForums, SIGNAL(triggered()), this, SLOT(openCommunityArduinoForums())); connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(about())); connect(ui.actionAbout_Qt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(ui.lineFind, SIGNAL(returnPressed()), this, SLOT(find())); connect(ui.lineReplace, SIGNAL(returnPressed()), this, SLOT(find())); connect(ui.pushFind, SIGNAL(clicked()), this, SLOT(find())); connect(ui.pushReplace, SIGNAL(clicked()), this, SLOT(replace())); connect(ui.pushReplaceAll, SIGNAL(clicked()), this, SLOT(replaceAll())); connect(this, SIGNAL(tabChanged(bool)), ui.pushReplace, SLOT(setEnabled(bool))); connect(this, SIGNAL(tabChanged(bool)), ui.pushReplaceAll, SLOT(setEnabled(bool))); connect(this, SIGNAL(tabChanged(bool)), ui.checkRegExp, SLOT(setEnabled(bool))); connect(this, SIGNAL(tabChanged(bool)), ui.checkWordOnly, SLOT(setEnabled(bool))); connect(this, SIGNAL(tabChanged(bool)), ui.menu_Libraries, SLOT(setEnabled(bool))); connect(ui.action_Lib_Refresh, SIGNAL(triggered()), this, SLOT(refreshLibrariesMenu())); connect(browser, SIGNAL(newProjectRequested()), this, SLOT(newProject())); connect(browser, SIGNAL(newProjectRequested(const QString &, const QString &)), this, SLOT(newProject(const QString &, const QString &))); connect(browser, SIGNAL(openProjectRequested()), this, SLOT(open())); connect(browser, SIGNAL(openProjectRequested(const QString &)), this, SLOT(open(const QString &))); connect(browser, SIGNAL(newPageLoaded(QUrl)), this, SLOT(tabContentHasChanged())); connect(ui.action_Prev, SIGNAL(triggered()), browser, SLOT(back())); connect(ui.action_Next, SIGNAL(triggered()), browser, SLOT(forward())); connect(ideApp->projectHistory(), SIGNAL(historyUpdated(QString)), browser, SLOT(refresh())); connect(ideApp->settings(), SIGNAL(fontChanged(const QFont &)), this, SLOT(setFont(const QFont &))); connect(&pastebin, SIGNAL(finished(QNetworkReply*)), this, SLOT(pastebinUploadDone(QNetworkReply*))); }
/* -------------------------------------------------------------------------- * MainWindow::createDockWindows * * Create dock window. This will act as a specific interface for * interacting with the renderer. * -------------------------------------------------------------------------- */ void MainWindow::createDockWindows() { m_pDock = new QDockWidget( tr( "Color Picker" ) ); ObjectPanel *objPanel = new ObjectPanel( m_pRenderer, m_pDock ); m_pDock->setWidget( objPanel ); m_pDock->setAllowedAreas( Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea ); addDockWidget( Qt::BottomDockWidgetArea, m_pDock ); connect( m_Action["ToggleObjPanel"], SIGNAL( triggered() ), this, SLOT( toggleDock() ) ); }