Exemplo n.º 1
0
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()));
}
Exemplo n.º 2
0
DMXLogWidget::DMXLogWidget(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
    setWindowFlags(windowFlags() | Qt::Tool);

    //setup slots
    connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(saveButtonClicked()));
}
Exemplo n.º 3
0
bool KickViewHeaderedWidget::canClose()
{
  if(undo.empty())
    return true;
  switch(QMessageBox::warning(this, tr("KickView"), tr("Do you want to save changes to %1?").arg(fileName), QMessageBox::Save  | QMessageBox::Discard | QMessageBox::Cancel))
  {
  case QMessageBox::Save:
    saveButtonClicked();
    break;
  case QMessageBox::Discard:
    break;
  default:
    return false;
  }
  return 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;
}
Exemplo n.º 5
0
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;
}
Exemplo n.º 6
0
void KoTagFilterWidget::onSaveButtonClicked()
{
    emit saveButtonClicked();
    clear();
}
Exemplo n.º 7
0
/****************************************************************************
**
** 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();
    }

    //****************************************************************************/
    void QtResourceMain::doSaveHToolbarAction(void)
    {
        emit saveButtonClicked();
    }
Exemplo n.º 8
0
MainW::MainW(QWidget *parent)
	: QMainWindow(parent)
{
	this->resize(1024, 768);
	this->currentFocusWordPadLineEdit = nullptr;
	this->wordListWidget = new WordlistWidget(this);
	this->wordPadWidget = new WordPadWidget(this);
	this->kanaPadWidget = new KanaPadWidget(this);
	this->previewWidget = new PreviewWidget(this);

	this->setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
	this->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
	this->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
	this->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);

	this->wordListDockWidget = new QDockWidget(tr("Word List"), this);
	wordListDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	wordListDockWidget->setWidget(this->wordListWidget);
	wordListDockWidget->setFeatures(/*QDockWidget::DockWidgetClosable |*/ QDockWidget::DockWidgetMovable);
	this->addDockWidget(Qt::LeftDockWidgetArea, wordListDockWidget);
	connect(this->wordListWidget, SIGNAL(hideSig()), this, SLOT(wordListCloseSlot()));

	this->wordPadDockWidget = new QDockWidget(tr("Word"), this);
	wordPadDockWidget->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
	wordPadDockWidget->setWidget(this->wordPadWidget);
	wordPadDockWidget->setFeatures(/*QDockWidget::DockWidgetClosable |*/ QDockWidget::DockWidgetMovable);
	this->addDockWidget(Qt::TopDockWidgetArea, wordPadDockWidget);
	connect(this->wordPadWidget, SIGNAL(lostFocus(QLineEdit*)), this, SLOT(wordPadLostFocus(QLineEdit*)));
	connect(this->wordPadWidget, SIGNAL(hideSig()), this, SLOT(wordPadCloseSlot()));

	this->kanaPadDockWidget = new QDockWidget(tr("Kana Pad"), this);
	kanaPadDockWidget->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
	kanaPadDockWidget->setWidget(this->kanaPadWidget);
	kanaPadDockWidget->setFeatures(/*QDockWidget::DockWidgetClosable |*/ QDockWidget::DockWidgetMovable);
	this->addDockWidget(Qt::BottomDockWidgetArea, kanaPadDockWidget);
	connect(this->kanaPadWidget, SIGNAL(kanaClicked(QString,bool)), this, SLOT(kanaPadClickedSlot(QString,bool)));
	connect(this->kanaPadWidget, SIGNAL(hideSig()), this, SLOT(kanaPadCloseSlot()));

	this->setCentralWidget(this->previewWidget);

	this->createMenus();

#ifdef __DEBUG__
	//QWidget *w = new QWidget(this);
	//this->setCentralWidget(w);

	//connect(this->kanaPadWidget, SIGNAL(kanaClicked(QString,bool)), this, SLOT(kanaClickedSlot(QString,bool)));
	//connect(this->wordPadWidget, SIGNAL(lostFocus(QLineEdit*)), this, SLOT(wordLostFocus(QLineEdit*)));
#endif

	this->fileNotOpenStatement();

	this->wordListWidget->clearList();

	connect(this->wordListWidget, SIGNAL(clicked(int)), this, SLOT(wordListClicked(int)));
	connect(this->wordListWidget, SIGNAL(removed(int)), this, SLOT(wordListRemoved(int)));
	connect(this->wordListWidget, SIGNAL(movedUp(int)), this, SLOT(wordListMovedUp(int)));
	connect(this->wordListWidget, SIGNAL(movedDown(int)), this, SLOT(wordListMovedDown(int)));
	connect(this->wordListWidget, SIGNAL(draged(int,int)), this, SLOT(wordListDraged(int,int)));
	connect(this->wordListWidget, SIGNAL(add(int)), this, SLOT(wordListAdded(int)));
	connect(this->wordListWidget, SIGNAL(listEmpty()), this, SLOT(wordListEmpty()));

	connect(this->wordPadWidget, SIGNAL(saveButtonClicked()), this, SLOT(saveToList()));
	connect(this->wordPadWidget, SIGNAL(textChangedSig(QString)), this->previewWidget, SLOT(setKanjiSlot(QString)));
}
Exemplo n.º 9
0
void TextEditBox::handleSaveButtonClicked()
{
    emit saveButtonClicked(_textItem->toPlainText());
    this->deleteLater();
}
Exemplo n.º 10
0
void SavePRC::handleNotification (Field* field)
{
  if (field == _mlSaveFld) 
  {
    saveButtonClicked();
  } 

  if (field == _inPointPositionsFld)
  {
    ml::Base *inBaseValue = _inPointPositionsFld->getBaseValue();

    if (inBaseValue)
    {
      if (ML_BASE_IS_A(inBaseValue, ml::XMarkerList))
      {
        ml::XMarkerList* inList = ((ml::XMarkerList*)inBaseValue);
        _inPointPositions.fromXMarkerList(*inList);
      }
      else
      {
        ml::ColoredMarkerList* inList = ((ml::ColoredMarkerList*)inBaseValue);
         _inPointPositions = *inList;
      }
    }
    else
    {
      _inPointPositions.clear();
    }
  }

  if (field == _inLinePositionsFld)
  {
    ml::Base *inBaseValue = _inLinePositionsFld->getBaseValue();

    if (inBaseValue)
    {
      if (ML_BASE_IS_A(inBaseValue, ml::XMarkerList))
      {
        ml::XMarkerList* inList = ((ml::XMarkerList*)inBaseValue);
        _inLinePositions.fromXMarkerList(*inList);
      }
      else
      {
        ml::ColoredMarkerList* inList = ((ml::ColoredMarkerList*)inBaseValue);
         _inLinePositions = *inList;
      }
    }
    else
    {
      _inLinePositions.clear();
    }
  }

  if (field == _inLineConnectionsFld)
  {
    ml::IndexPairList* inList = ((ml::IndexPairList*)_inLineConnectionsFld->getBaseValue());

    if (inList != NULL)
    {
      _inLineConnections = (*inList);
    }
    else
    {
      _inLineConnections.clear();
    }

  }

  if (field == _newSpecificationAddFld)
  {
    AddNewSpecification();
  }

  if (field == _newSpecificationTypeFld)
  {
    UpdateObjectTypeTabView();
  }

  if ( (field == _newSpecificationTypeFld) ||
       (field == _newSpecificationObjectNameFld) ||
       (field == _newSpecificationGroupPathFld) ||
       (field == _newSpecificationUseDefaultColorFld) ||
       (field == _newSpecificationUseDefaultSpecularColorFld) ||
       (field == _newSpecificationColorFld) ||
       (field == _newSpecificationColorAlphaFld) ||
       (field == _newSpecificationSpecularColorFld) ||
       (field == _newSpecificationModelVisibilityFld) ||
       (field == _newSpecificationMetaDataKeyFld) ||
       (field == _newSpecificationMetaDataValueFld) ||
       (field == _newSpecificationWEMLabelFld) ||
       (field == _newSpecificationPositionTypesFld) ||
       (field == _newSpecificationConnectionTypesFld)  
     )
  {
    UpdateNewSpecification();
  }

  // call parent class and handle apply/autoApply and in/outputs
  WEMInspector::handleNotification(field);
}
Exemplo n.º 11
0
RawDataView::RawDataView(QWidget *parent) : QWidget(parent)
{
	ui.setupUi(this);
	connect(ui.saveChangesButton,SIGNAL(clicked()),this,SLOT(saveButtonClicked()));
}