SynthControl::SynthControl(QWidget* parent) : QWidget(parent, Qt::Dialog) { setupUi(this); _score = 0; setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); int idx = 0; for (Synthesizer* s : synti->synthesizer()) { if (strcmp(s->name(), "Aeolus") == 0) // no gui for aeolus continue; tabWidget->insertTab(idx++, s->gui(), tr(s->name())); s->gui()->synthesizerChanged(); connect(s->gui(), SIGNAL(valueChanged()), SLOT(setDirty())); } // effectA combo box // effectStackA widget stack effectA->clear(); for (Effect* e : synti->effectList(0)) { effectA->addItem(tr(e->name())); effectStackA->addWidget(QWidget::createWindowContainer(e->gui())); connect(e->gui(), SIGNAL(valueChanged()), SLOT(setDirty())); } effectB->clear(); for (Effect* e : synti->effectList(1)) { effectB->addItem(tr(e->name())); effectStackB->addWidget(QWidget::createWindowContainer(e->gui())); connect(e->gui(), SIGNAL(valueChanged()), SLOT(setDirty())); } if (!useFactorySettings) { QSettings settings; settings.beginGroup("SynthControl"); resize(settings.value("size", QSize(746, 268)).toSize()); move(settings.value("pos", QPoint(10, 10)).toPoint()); settings.endGroup(); } updateGui(); tabWidget->setCurrentIndex(0); storeButton->setEnabled(false); recallButton->setEnabled(false); changeTuningButton->setEnabled(false); connect(effectA, SIGNAL(currentIndexChanged(int)), SLOT(effectAChanged(int))); connect(effectB, SIGNAL(currentIndexChanged(int)), SLOT(effectBChanged(int))); connect(gain, SIGNAL(valueChanged(double,int)), SLOT(gainChanged(double,int))); connect(masterTuning, SIGNAL(valueChanged(double)), SLOT(masterTuningChanged(double))); connect(changeTuningButton, SIGNAL(clicked()), SLOT(changeMasterTuning())); connect(loadButton, SIGNAL(clicked()), SLOT(loadButtonClicked())); connect(saveButton, SIGNAL(clicked()), SLOT(saveButtonClicked())); connect(storeButton, SIGNAL(clicked()), SLOT(storeButtonClicked())); connect(recallButton, SIGNAL(clicked()), SLOT(recallButtonClicked())); connect(gain, SIGNAL(valueChanged(double,int)), SLOT(setDirty())); }
void WsTabManager::createWorkSpaceTab(QString clvFilePath){ clvFilePath_m = clvFilePath; messageBroker_m->messageWsTabManager_addWsWidget(WS_TAB_NAME, MEMO_TAB_NAME, getMemoWidget()); messageBroker_m->messageWsTabManager_enableSaveMenu(); messageBroker_m->messageWsTabManager_addWsWidget(WS_TAB_NAME, SEARCH_TAB_NAME, new DeepSearchWidget(NULL, clvFilePath_m)); messageBroker_m->messageWsTabManager_addWsWidget(WS_TAB_NAME, ALL_COMMAND_TAB_NAME, getCommandListWidget()); messageBroker_m->messageWsTabManager_addWsWidget(WS_TAB_NAME, NON_USED_COMMAND_TAB_NAME, getNonUsedCommandListWidget()); //load memo loadButtonClicked(); initialized_m = true; }
QWidget *WsTabManager::getMemoWidget(){ if(memoWidget_m){ return memoWidget_m; } memoWidget_m = new QWidget(NULL); QVBoxLayout *layout = new QVBoxLayout(memoWidget_m); memoArea_m = new QTextEdit(memoWidget_m); layout->addWidget(memoArea_m); QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->setAlignment(Qt::AlignRight); QPushButton *loadButton = new QPushButton("load", memoWidget_m); connect(loadButton, SIGNAL(clicked()), this, SLOT(loadButtonClicked())); loadButton->setFixedWidth(100); buttonLayout->addWidget(loadButton); QPushButton *saveButton = new QPushButton("save", memoWidget_m); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveButtonClicked())); saveButton->setFixedWidth(100); buttonLayout->addWidget(saveButton); layout->addLayout(buttonLayout); memoWidget_m->setLayout(layout); return memoWidget_m; }
QMenu* KickViewHeaderedWidget::createFileMenu() const { QMenu* menu = new QMenu(tr("&File")); QAction* newAct, * saveAct, * saveAsAct, * loadAct; newAct = new QAction(QIcon(":/Icons/kick_new.png"), tr("&New .kmc"), menu); newAct->setShortcut(tr("Shift+N")); newAct->setStatusTip(tr("Create a new Kick motion file")); saveAct = new QAction(QIcon(":/Icons/kick_save.png"), tr("&Save .kmc"), menu); saveAct->setShortcut(tr("Shift+S")); saveAct->setEnabled(!undo.empty()); saveAct->setStatusTip(tr("Save Kick motion file under its current name")); connect(this, SIGNAL(saveAvailable(bool)), saveAct, SLOT(setEnabled(bool))); saveAsAct = new QAction(QIcon(":/Icons/kick_save_as.png"), tr("Save .kmc &As"), menu); saveAsAct->setShortcut(tr("Shift+Alt+S")); saveAsAct->setStatusTip(tr("Save Kick motion file using a new name")); loadAct = new QAction(QIcon(":/Icons/kick_open.png"), tr("&Open .kmc"), menu); loadAct->setShortcut(tr("Shift+O")); loadAct->setStatusTip(tr("Open a Kick motion file")); connect(newAct, SIGNAL(triggered()), this, SLOT(newButtonClicked())); connect(saveAct, SIGNAL(triggered()), this, SLOT(saveButtonClicked())); connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAsButtonClicked())); connect(loadAct, SIGNAL(triggered()), this, SLOT(loadButtonClicked())); menu->addAction(newAct); menu->addAction(loadAct); menu->addAction(saveAct); menu->addAction(saveAsAct); return menu; }
AP2DataPlot2D::AP2DataPlot2D(QWidget *parent) : QWidget(parent), m_uas(NULL), m_logDownloadDialog(NULL), m_updateTimer(NULL), m_tlogReplayEnabled(false) { m_startIndex = 0; m_axisGroupingDialog = 0; m_logLoaderThread= 0; m_logLoaded = false; m_progressDialog=0; m_currentIndex=0; m_graphCount=0; m_showOnlyActive = false; ui.setupUi(this); QDateTime utc = QDateTime::currentDateTimeUtc(); utc.setTimeSpec(Qt::LocalTime); m_timeDiff = QDateTime::currentDateTime().msecsTo(utc); m_plot = new QCustomPlot(ui.widget); m_plot->setInteraction(QCP::iRangeDrag, true); m_plot->setInteraction(QCP::iRangeZoom, true); connect(m_plot,SIGNAL(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)),this,SLOT(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*))); connect(m_plot,SIGNAL(mouseMove(QMouseEvent*)),this,SLOT(plotMouseMove(QMouseEvent*))); //ui.horizontalLayout_3->addWidget(m_plot); ui.verticalLayout_5->insertWidget(0,m_plot); m_plot->show(); m_plot->plotLayout()->clear(); m_wideAxisRect = new QCPAxisRect(m_plot); m_wideAxisRect->setupFullAxesBox(true); m_wideAxisRect->axis(QCPAxis::atRight, 0)->setTickLabels(false); m_wideAxisRect->removeAxis(m_wideAxisRect->axis(QCPAxis::atLeft,0)); m_wideAxisRect->axis(QCPAxis::atBottom, 0)->setTickLabelType(QCPAxis::ltDateTime); m_wideAxisRect->axis(QCPAxis::atBottom, 0)->setDateTimeFormat("hh:mm:ss"); m_wideAxisRect->axis(QCPAxis::atBottom, 0)->setRange(m_timeDiff / 1000,(m_timeDiff / 1000) + 100); //Default range of 0-100 milliseconds? m_plot->plotLayout()->addElement(0, 0, m_wideAxisRect); QCPMarginGroup *marginGroup = new QCPMarginGroup(m_plot); m_wideAxisRect->setMarginGroup(QCP::msLeft | QCP::msRight, marginGroup); m_dataSelectionScreen = new DataSelectionScreen(this); connect( m_dataSelectionScreen,SIGNAL(itemEnabled(QString)),this,SLOT(itemEnabled(QString))); connect( m_dataSelectionScreen,SIGNAL(itemDisabled(QString)),this,SLOT(itemDisabled(QString))); ui.horizontalLayout_3->addWidget(m_dataSelectionScreen); ui.horizontalLayout_3->setStretch(0,5); ui.horizontalLayout_3->setStretch(1,1); connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUASSet(UASInterface*))); activeUASSet(UASManager::instance()->getActiveUAS()); ui.tableWidget->setContextMenuPolicy(Qt::ActionsContextMenu); m_addGraphAction = new QAction("Add To Graph",0); ui.tableWidget->addAction(m_addGraphAction); connect(m_addGraphAction,SIGNAL(triggered()),this,SLOT(addGraphLeft())); ui.tableWidget->setVisible(false); ui.hideExcelView->setVisible(false); connect(ui.loadOfflineLogButton,SIGNAL(clicked()),this,SLOT(loadButtonClicked())); connect(ui.autoScrollCheckBox,SIGNAL(clicked(bool)),this,SLOT(autoScrollClicked(bool))); connect(ui.hideExcelView,SIGNAL(clicked(bool)),ui.tableWidget,SLOT(setHidden(bool))); connect(ui.tableWidget,SIGNAL(cellClicked(int,int)),this,SLOT(tableCellClicked(int,int))); ui.logTypeLabel->setText("<p align=\"center\"><span style=\" font-size:24pt; color:#0000ff;\">Live Data</span></p>"); connect(ui.graphControlsPushButton,SIGNAL(clicked()),this,SLOT(graphControlsButtonClicked())); model = new QStandardItemModel(); connect(ui.toKMLPushButton, SIGNAL(clicked()), this, SIGNAL(toKMLClicked())); connect(ui.horizontalScrollBar,SIGNAL(sliderMoved(int)),this,SLOT(horizontalScrollMoved(int))); connect(ui.verticalScrollBar,SIGNAL(sliderMoved(int)),this,SLOT(verticalScrollMoved(int))); connect(ui.horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollMoved(int))); connect(ui.verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(verticalScrollMoved(int))); connect(m_wideAxisRect->axis(QCPAxis::atBottom), SIGNAL(rangeChanged(QCPRange)), this, SLOT(xAxisChanged(QCPRange))); m_plot->setPlottingHint(QCP::phFastPolylines,true); connect(ui.downloadPushButton, SIGNAL(clicked()), this, SLOT(showLogDownloadDialog())); ui.downloadPushButton->setEnabled(false); connect(ui.loadTLogButton,SIGNAL(clicked()),this,SLOT(replyTLogButtonClicked())); }
MainWindow::MainWindow(QWidget *parent) : QDialog(parent) { nextButton = new QPushButton(tr("next")); nextButton->setDisabled(true); connect(nextButton, SIGNAL(clicked()), this, SLOT(nextButtonClicked())); prevButton = new QPushButton(tr("prev")); connect(prevButton, SIGNAL(clicked()), this, SLOT(prevButtonClicked())); prevButton->setDisabled(true); plusButton = new QPushButton(tr("+")); connect(plusButton, SIGNAL(clicked()), this, SLOT(plusButtonClicked())); plusButton->setDisabled(true); minusButton = new QPushButton(tr("-")); connect(minusButton, SIGNAL(clicked()), this, SLOT(minusButtonClicked())); minusButton->setDisabled(true); tooOldButton = new QPushButton(tr("[:|||:]")); connect(tooOldButton, SIGNAL(clicked()), this, SLOT(toOldButtonClicked())); tooOldButton->setDisabled(true); gotoButton = new QPushButton(tr("Go to this quote")); connect(gotoButton, SIGNAL(clicked()), this, SLOT(gotoButtonClicked())); gotoButton->setDisabled(true); loadButton = new QPushButton(tr("load")); connect(loadButton, SIGNAL(clicked()), this, SLOT(loadButtonClicked())); NumberOfCurrentQuote = new QLineEdit; //NumberOfCurrentQuote->setDisabled(true); currentRating = new QLineEdit; currentRating->setDisabled(true); currentQuote = new QTextEdit; currentQuote->setDisabled(true); label1 = new QLabel; label2 = new QLabel; label1->setText("rating"); label2->setText("number of quote"); setWindowTitle(tr("Bash.im")); QHBoxLayout *buttonLayout1 = new QHBoxLayout; buttonLayout1->addWidget(minusButton); buttonLayout1->addWidget(tooOldButton); buttonLayout1->addWidget(plusButton); buttonLayout1->addWidget(label1); buttonLayout1->addWidget(currentRating); QHBoxLayout *buttonLayout2 = new QHBoxLayout; buttonLayout2->addWidget(loadButton); buttonLayout2->addWidget(prevButton); buttonLayout2->addWidget(nextButton); QHBoxLayout *buttonLayout3 = new QHBoxLayout; buttonLayout3->addWidget(label2); buttonLayout3->addWidget(NumberOfCurrentQuote); buttonLayout3->addWidget(gotoButton); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(buttonLayout1); mainLayout->addLayout(buttonLayout2); mainLayout->addWidget(currentQuote); mainLayout->addLayout(buttonLayout3); setLayout(mainLayout); }
/**************************************************************************** ** ** Copyright (C) 2016 ** ** This file is generated by the Magus toolkit ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ****************************************************************************/ // Include #include <QString> #include <QFile> #include <QMenuBar> #include "tool_resourcewidget_main.h" #include "tool_resourcewidget_assets.h" namespace Magus { //****************************************************************************/ QtResourceMain::QtResourceMain(const QString& iconDir, QWidget* parent) : QMainWindow(parent), mIsClosing(false) { mIconDir = iconDir; // Perform standard functions createActions(); createMenus(); createToolBars(); createStatusBar(); createDockWindows(); // Set the title setWindowTitle(QString("ContentBrowser")); showMaximized(); } //****************************************************************************/ QtResourceMain::~QtResourceMain(void) { } //****************************************************************************/ QVector<QtResourceInfo*>& QtResourceMain::getResources (void) { // Delegate to mSourcesDockWidget return mSourcesDockWidget->getResources(); } //****************************************************************************/ void QtResourceMain::setResources (const QVector<QtResourceInfo*>& resources) { // Clear the mAssetsDockWidget mAssetsDockWidget->clearContent(); // Delegate to mSourcesDockWidget; mSourcesDockWidget signals a 'resourceAdded', which results in the fact that // the resource (only in assets) is added to te mAssetsDockWidget. mSourcesDockWidget->setResources(resources); } //****************************************************************************/ void QtResourceMain::closeEvent(QCloseEvent* event) { mIsClosing = true; } //****************************************************************************/ void QtResourceMain::createActions(void) { mNewHToolbarAction = new QAction(QIcon(mIconDir + "new.png"), QString("Clear resource tree"), this); connect(mNewHToolbarAction, SIGNAL(triggered()), this, SLOT(doNewHToolbarAction())); mLoadHToolbarAction = new QAction(QIcon(mIconDir + "open.png"), QString("Load resource tree"), this); connect(mLoadHToolbarAction, SIGNAL(triggered()), this, SLOT(doLoadHToolbarAction())); mSaveHToolbarAction = new QAction(QIcon(mIconDir + "save.png"), QString("Save resource tree"), this); connect(mSaveHToolbarAction, SIGNAL(triggered()), this, SLOT(doSaveHToolbarAction())); mShowCollectionsHToolbarAction = new QAction(QIcon(mIconDir + "color.png"), QString("Show/hide Collections area"), this); connect(mShowCollectionsHToolbarAction, SIGNAL(triggered()), this, SLOT(doShowCollectionsHToolbarAction())); } //****************************************************************************/ void QtResourceMain::createMenus(void) { } //****************************************************************************/ void QtResourceMain::createToolBars(void) { mHToolBar = new QToolBar(); addToolBar(Qt::TopToolBarArea, mHToolBar); mHToolBar->setMinimumHeight(32); mHToolBar->setMinimumWidth(4 * 32); mHToolBar->addAction(mNewHToolbarAction); mHToolBar->addAction(mLoadHToolbarAction); mHToolBar->addAction(mSaveHToolbarAction); mHToolBar->addAction(mShowCollectionsHToolbarAction); } //****************************************************************************/ void QtResourceMain::createStatusBar(void) { } //****************************************************************************/ void QtResourceMain::createDockWindows(void) { // Sources (tree) mSourcesDockWidget = new QtSourcesDockWidget(mIconDir, QString("Sources"), this); connect(mSourcesDockWidget, SIGNAL(resourceSelected(int,int,int,const QString&,const QString&)), this, SLOT(handleResourceSelected(int,int,int,const QString&,const QString&))); connect(mSourcesDockWidget, SIGNAL(resourceAdded(int,int,int,const QString&,const QString&)), this, SLOT(handleResourceAdded(int,int,int,const QString&,const QString&))); connect(mSourcesDockWidget, SIGNAL(resourceDeleted(int,int,int,const QString&,const QString&)), this, SLOT(handleResourceDeleted(int,int,int,const QString&,const QString&))); connect(mSourcesDockWidget, SIGNAL(resourceSearched(QString)), this, SLOT(handleResourceSearched(QString))); connect(mSourcesDockWidget, SIGNAL(resourceSearchReset()), this, SLOT(handleResourceSearchReset())); addDockWidget(Qt::LeftDockWidgetArea, mSourcesDockWidget); // Assets mAssetsDockWidget = new QtAssetsDockWidget(mIconDir, QString("Assets"), this); connect(mAssetsDockWidget, SIGNAL(tabChanged(int)), this, SLOT(handleTabChanged(int))); connect(mAssetsDockWidget, SIGNAL(fileDropped(int,QString,QString)), this, SLOT(handleFileDropped(int,QString,QString))); connect(mAssetsDockWidget, SIGNAL(assetDeleted(int,QString,QString)), this, SLOT(handleAssetDeleted(int,QString,QString))); addDockWidget(Qt::RightDockWidgetArea, mAssetsDockWidget); // Collections mCollectionsDockWidget = new QtCollectionsDockWidget(mIconDir, QString("Collections"), this); addDockWidget(Qt::LeftDockWidgetArea, mCollectionsDockWidget); mCollectionsDockWidget->setMinimumHeight(100); mCollectionsDockWidget->hide(); } //****************************************************************************/ void QtResourceMain::doNewHToolbarAction(void) { QMessageBox::StandardButton reply; reply = QMessageBox::question(this, "Message", "Are you sure to clear the resource tree?", QMessageBox::Yes|QMessageBox::No); if (reply == QMessageBox::Yes) { mSourcesDockWidget->clearContent(); mAssetsDockWidget->clearContent(); } } //****************************************************************************/ void QtResourceMain::doLoadHToolbarAction(void) { emit loadButtonClicked(); }