Esempio n. 1
0
void KPAOS4Checker::check()
{
    QString inPort(Settings::get().getMidiInPort());
    QString outPort(Settings::get().getMidiOutPort());

    if(inPort.isEmpty() || outPort.isEmpty())
    {
        SettingsDialog settingsDialog(nullptr);
        settingsDialog.exec();
        inPort = Settings::get().getMidiInPort();
        outPort = Settings::get().getMidiOutPort();
    }

    if(Midi::get().openPorts(inPort, outPort))
    {
        QEventLoop el;
        el.connect(this, &KPAOS4Checker::stopLoop, &el, &QEventLoop::quit);
        el.connect(&stompDelayObj, &Stomp::onOffReceived, this, &KPAOS4Checker::onOfReceived);
        el.connect(mTimer, &QTimer::timeout, this, &KPAOS4Checker::timerTimeout);
        mTimer->start(500);
        stompDelayObj.requestOnOff();
        el.exec();
        el.disconnect(this, &KPAOS4Checker::stopLoop, &el, &QEventLoop::quit);
        el.disconnect(&stompDelayObj, &Stomp::onOffReceived, this, &KPAOS4Checker::onOfReceived);
        el.disconnect(mTimer, &QTimer::timeout, this, &KPAOS4Checker::timerTimeout);
    }
}
Esempio n. 2
0
void MainWindow::actionSettings() {
    // Open preferences dialog
    QString htmlIndex = settings->htmlIndex();
    QString defaultLanguage = settings->defaultLanguage();
    // Supported list of languages
    QStringList languageList;
    languageList << "en-GB" << "ca-ES" << "es-ES" << "eu-ES"
                 << "fr-FR" << "gl-ES" << "it-IT" << "pl-PL"
                 << "pt-BR" << "pt-PT" << "ru";
    SettingsDialog settingsDialog(settings, languageList, this);
    int result = settingsDialog.exec();
    if (result && settingsDialog.changed()) {
        // Reload blockly page
        if (htmlIndex != settings->htmlIndex()
                || defaultLanguage != settings->defaultLanguage()) {
            // Refresh workspace with new language
            xmlLoadContent = getXml();
            loadBlockly();
            connect(ui->webView,
                    SIGNAL(loadFinished(bool)),
                    SLOT(onLoadFinished(bool)));

            // Reload app warning
            QMessageBox msgBox;
            msgBox.setText(tr("Please, restart the application to display "
                              "the selected language."));
            msgBox.exec();
        }
    }
Esempio n. 3
0
static void config(HWND hwndParent)
{
	if (settingsDialog(mod.hDllInstance, hwndParent)) {
		writeIniInt("song_length", song_length);
		writeIniInt("silence_seconds", silence_seconds);
		writeIniInt("play_loops", play_loops);
		writeIniInt("mute_mask", mute_mask);
	}
}
Esempio n. 4
0
static void WINAPI asapShowConfigDlg(HWND hwndParent)
{
	if (settingsDialog(hInstance, hwndParent)) {
		HKEY hKey;
		if (RegCreateKeyEx(HKEY_CURRENT_USER, REG_KEY, 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
			return;
		RegSetValueEx(hKey, _T("SongLength"), 0, REG_DWORD, (LPBYTE) &song_length, sizeof(int));
		RegSetValueEx(hKey, _T("SilenceSeconds"), 0, REG_DWORD, (LPBYTE) &silence_seconds, sizeof(int));
		RegSetValueEx(hKey, _T("PlayLoops"), 0, REG_DWORD, (LPBYTE) &play_loops, sizeof(int));
		RegSetValueEx(hKey, _T("MuteMask"), 0, REG_DWORD, (LPBYTE) &mute_mask, sizeof(int));
		RegCloseKey(hKey);
	}
}
Esempio n. 5
0
void RunDialog::on_editButton_clicked()
{
    activateConfiguration();
    Configuration* pConfig = Configuration::getConfig();
    pConfig->setString("contigFileName", ui->contigFileName->text().toStdString());

    SettingsDialog settingsDialog(this);
    settingsDialog.exec();

    if(settingsDialog.result() == QDialog::Accepted) {
        fillComboBox();
        int index = ui->configurationComboBox->findText(QString::fromStdString(pConfig->getName()));
        ui->configurationComboBox->setCurrentIndex(index);
    }
}
Esempio n. 6
0
/**
 * @brief Raspbed::openSettings
 */
void Raspbed::openSettings() {
    std::unique_ptr<Settings> settingsDialog(new Settings);

    QStringList serialPortOptions;
    for (std::string device : bed.getSerialPort()->getDevices()) {
        qDebug() << "Serial option: " << QString::fromStdString(device);

        if(device.find("USB") != std::string::npos){
            qDebug() << "Found:  " << QString::fromStdString(device);
            serialPortOptions.push_back(QString::fromStdString(device));
        }
    }

    settingsDialog->setSerialPorts(serialPortOptions);
    settingsDialog->setPort(settings.getPort());
    settingsDialog->setContact(settings.getContact());
    settingsDialog->setBordered(settings.isBordered());
    settingsDialog->setButtonMode(settings.isButtonMode());
    settingsDialog->setDarkHighlight(settings.isDarkHighlight());
    settingsDialog->setButtonHoldTime(
        QString::number(settings.getButtonHoldTime()));
    settingsDialog->populateSettings();
    settingsDialog->exec();

    if (settingsDialog->result() == QDialog::Accepted) {
        settings.setContact(settingsDialog->getContact());
        settings.setPort(settingsDialog->getPort());
        settings.setBordered(settingsDialog->isBordered());
        settings.setDarkHighlight(settingsDialog->isDarkHighlight());
        settings.setButtonMode(settingsDialog->isButtonMode());
        settings.setButtonHoldTime(settingsDialog->getButtonHoldTime().toInt());
        settings.saveSettings();

        setupDisplay();

        resetBed();
    }
}
void DesktopMainWindow::editSettings()
{
  AppSettingsDialog settingsDialog(_app.get());
	if (settingsDialog.exec() == QDialog::Accepted)
	{
    _app->setSunMode(settingsDialog.getSunMode());

    double sunLat, sunLon;
    settingsDialog.getSunPosition(sunLat, sunLon);
    _app->setSunPosition(sunLat, sunLon);


    QDir cachePath(QString(settingsDialog.getCachePath().c_str()));

    osgEarth::Drivers::Sqlite3CacheOptions newOpt;
    newOpt.path() = cachePath.absolutePath().toUtf8().data();
    newOpt.maxSize() = settingsDialog.getCacheMax();

    _app->setCache(newOpt);

		_app->setCacheEnabled(settingsDialog.getCacheEnabled());
	}
}
Esempio n. 8
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    logFile = NULL;
    logIndex = 0;
    process = NULL;
    triggerCount = 0;
    volumeMeterWidget = NULL;

    QCoreApplication::setOrganizationName("VU Meter");
    QCoreApplication::setOrganizationDomain("https://garage.maemo.org/projects/vumeter");
    QCoreApplication::setApplicationName("VU Meter");

    QSettings settings;
    meter = settings.value(SettingsDialog::METER,
                           SettingsDialog::METER_DEFAULT).toInt();
    interpolationLevel = settings.value(SettingsDialog::INTERPOLATION_LEVEL,
                                        SettingsDialog::INTERPOLATION_LEVEL_DEFAULT).toInt();

    ui->setupUi(this);

    adapter = new PulseAudioAdapter();

    changeMeter();
    setDbScale();

    ui->currentVolume->setNum(0);
    ui->maximumVolume->setNum(0);

#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
    sources = new QStringList();
    sources->append("Microphone");
    sources->append("Bluetooth");
    sources->append("Monitor");
#else
    sources = adapter->getAvailableSources();
#endif
    ui->sourcesComboBox->addItems(*sources);

    /*
#ifdef Q_WS_MAEMO_5
    ui->sourcesComboBox->setEditable(true);
    ui->sourcesComboBox->lineEdit()->setAlignment(Qt::AlignHCenter);
    ui->sourcesComboBox->lineEdit()->setReadOnly(true);
#endif
    */

    connect(ui->sourcesComboBox, SIGNAL(activated(int)), this, SLOT(sourceChanged(int)));

#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
    adapter->connectAudioStream("source.hw0");
    //connect_to_vu_meter_stream("source.hw0", this, pow(2, interpolationLevel));
#else
    adapter->connectAudioStream(sources->at(0));
//    connect_to_vu_meter_stream(sources->at(0).toLocal8Bit().constData(), this, pow(2, interpolationLevel));
#endif

    connect(adapter, SIGNAL(audioDataReceived(float)), this, SLOT(updateValues(float)), Qt::QueuedConnection);
    connect(ui->maxLabel, SIGNAL(linkActivated(QString)), this, SLOT(resetMaxValue()));

    connect(ui->radioButtonDb, SIGNAL(clicked()), this, SLOT(setDbScale()));
    connect(ui->radioButtonLinear, SIGNAL(clicked()), this, SLOT(setLinearScale()));

    connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(settingsDialog()));
}
Esempio n. 9
0
	void __cdecl Config()
	{
		settingsDialog(hInstance, GetActiveWindow());
	}
Esempio n. 10
0
/* GUI BUTTON ACTIONS */
void BitSplit::editSettings(){
    EditSettings settingsDialog(this);
    settingsDialog.exec();
}
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted)
{
    QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension...
    ACTION->setStatusTip(statusTip);
    ACTION->setObjectName(icon);
    // TODO: Set What's This Context Help to statusTip for now so there is some infos there.
    // Make custom whats this context help popup with more descriptive help than just
    // the status bar/tip one liner(short but not real long) with a hyperlink in the custom popup
    // at the bottom to open full help file description. Ex: like wxPython AGW's SuperToolTip.
    ACTION->setWhatsThis(statusTip);
    // TODO: Finish All Commands ... <.<

    if     (icon == "donothing")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing()));
    else if(icon == "new")                      { ACTION->setShortcut(QKeySequence::New);      connect(ACTION, SIGNAL(triggered()), this, SLOT(newFile()));         }
    else if(icon == "open")                     { ACTION->setShortcut(QKeySequence::Open);     connect(ACTION, SIGNAL(triggered()), this, SLOT(openFile()));        }
    else if(icon == "save")                     { ACTION->setShortcut(QKeySequence::Save);     connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile()));        }
    else if(icon == "saveas")                   { ACTION->setShortcut(QKeySequence::SaveAs);   connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile()));      }
    else if(icon == "print")                    { ACTION->setShortcut(QKeySequence::Print);    connect(ACTION, SIGNAL(triggered()), this, SLOT(print()));           }
    else if(icon == "designdetails")            { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails()));   }
    else if(icon == "exit")                     { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit()));            }

    else if(icon == "cut")                      { ACTION->setShortcut(QKeySequence::Cut);   connect(ACTION, SIGNAL(triggered()), this, SLOT(cut()));   }
    else if(icon == "copy")                     { ACTION->setShortcut(QKeySequence::Copy);  connect(ACTION, SIGNAL(triggered()), this, SLOT(copy()));  }
    else if(icon == "paste")                    { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); }

    else if(icon == "windowcascade")              connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade()));
    else if(icon == "windowtile")                 connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile()));
    else if(icon == "windowclose")              { ACTION->setShortcut(QKeySequence::Close);    connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow()));   }
    else if(icon == "windowcloseall")             connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows()));
    else if(icon == "windownext")               { ACTION->setShortcut(QKeySequence::NextChild);     connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow()));     }
    else if(icon == "windowprevious")           { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }

    else if(icon == "help")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(help()));
    else if(icon == "changelog")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog()));
    else if(icon == "tipoftheday")                connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay()));
    else if(icon == "about")                      connect(ACTION, SIGNAL(triggered()), this, SLOT(about()));
    else if(icon == "whatsthis")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(whatsThisContextHelp()));

    else if(icon == "icon16")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16()));
    else if(icon == "icon24")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24()));
    else if(icon == "icon32")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32()));
    else if(icon == "icon48")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48()));
    else if(icon == "icon64")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64()));
    else if(icon == "icon128")                    connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128()));

    else if(icon == "settingsdialog")             connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog()));

    else if(icon == "undo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(undo()));
    else if(icon == "redo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(redo()));

    else if(icon == "makelayercurrent")           connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive()));
    else if(icon == "layers")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager()));
    else if(icon == "layerprevious")              connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious()));

    else if(icon == "textbold")                 { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool)));   }
Esempio n. 12
0
void MainForm::settingsActivated()
{
	SettingsDialog settingsDialog(this, 0, false, Qt::WStyle_Customize | Qt::WStyle_Title);
	settingsDialog.exec();
}
Esempio n. 13
0
void MainWindow::actionSettings(){
    SettingsDialog settingsDialog(this);
    settingsDialog.exec();
}
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted)
{
    QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension...
    ACTION->setStatusTip(statusTip);
    ACTION->setObjectName(icon);
    // TODO: Finish All Commands ... <.<

    if     (icon == "donothing")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing()));
    else if(icon == "new")                      { ACTION->setShortcut(QKeySequence::New);      connect(ACTION, SIGNAL(triggered()), this, SLOT(newfile()));         }
    else if(icon == "open")                     { ACTION->setShortcut(QKeySequence::Open);     connect(ACTION, SIGNAL(triggered()), this, SLOT(openfile()));        }
    else if(icon == "save")                     { ACTION->setShortcut(QKeySequence::Save);     connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile()));        }
    else if(icon == "saveas")                   { ACTION->setShortcut(QKeySequence::SaveAs);   connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile()));      }
    else if(icon == "print")                    { ACTION->setShortcut(QKeySequence::Print);    connect(ACTION, SIGNAL(triggered()), this, SLOT(print()));           }
    else if(icon == "close")                    { ACTION->setShortcut(QKeySequence::Close);    connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow()));   }
    else if(icon == "designdetails")            { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails()));   }
    else if(icon == "exit")                     { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit()));            }

    else if(icon == "cut")                      { ACTION->setShortcut(QKeySequence::Cut);   connect(ACTION, SIGNAL(triggered()), this, SLOT(cut()));   }
    else if(icon == "copy")                     { ACTION->setShortcut(QKeySequence::Copy);  connect(ACTION, SIGNAL(triggered()), this, SLOT(copy()));  }
    else if(icon == "paste")                    { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); }

    else if(icon == "windowcascade")              connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade()));
    else if(icon == "windowtile")                 connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile()));
    else if(icon == "windowcloseall")             connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows()));
    else if(icon == "windownext")               { ACTION->setShortcut(QKeySequence::NextChild);     connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow()));     }
    else if(icon == "windowprevious")           { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); }

    else if(icon == "help")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(help()));
    else if(icon == "changelog")                  connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog()));
    else if(icon == "tipoftheday")                connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay()));
    else if(icon == "about")                      connect(ACTION, SIGNAL(triggered()), this, SLOT(about()));
    else if(icon == "aboutQt")                    connect(ACTION, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

    else if(icon == "icon16")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16()));
    else if(icon == "icon24")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24()));
    else if(icon == "icon32")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32()));
    else if(icon == "icon48")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48()));
    else if(icon == "icon64")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64()));
    else if(icon == "icon128")                    connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128()));

    else if(icon == "settingsdialog")             connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog()));

    else if(icon == "undo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(undo()));
    else if(icon == "redo")                       connect(ACTION, SIGNAL(triggered()), this, SLOT(redo()));

    else if(icon == "makelayercurrent")           connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive()));
    else if(icon == "layers")                     connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager()));
    else if(icon == "layerprevious")              connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious()));

    else if(icon == "textbold")                 { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool)));   }
void MainWindow::settingsPrompt()
{
    settingsDialog("Prompt");
}