Esempio n. 1
0
SettingsDialog::SettingsDialog(QWidget* parent)
    : QDialog(parent)
{
    setupUi(this);

    this->stylesheet = qApp->styleSheet();

    bool startFullscreen = (DatabaseManager::getInstance().getConfigurationByName("StartFullscreen").getValue() == "true") ? true : false;
    this->checkBoxFullscreen->setChecked(startFullscreen);

    this->comboBoxTheme->setCurrentIndex(this->comboBoxTheme->findText(DatabaseManager::getInstance().getConfigurationByName("Theme").getValue()));
    this->spinBoxFontSize->setValue(DatabaseManager::getInstance().getConfigurationByName("FontSize").getValue().toInt());

    bool autoRefreshLibrary = (DatabaseManager::getInstance().getConfigurationByName("AutoRefreshLibrary").getValue() == "true") ? true : false;
    this->checkBoxAutoRefresh->setChecked(autoRefreshLibrary);
    this->labelInterval->setEnabled(autoRefreshLibrary);
    this->spinBoxRefreshInterval->setEnabled(autoRefreshLibrary);
    this->labelSeconds->setEnabled(autoRefreshLibrary);

    this->spinBoxRefreshInterval->setValue(DatabaseManager::getInstance().getConfigurationByName("RefreshLibraryInterval").getValue().toInt());

    bool showThumbnailTooltip = (DatabaseManager::getInstance().getConfigurationByName("ShowThumbnailTooltip").getValue() == "true") ? true : false;
    this->checkBoxShowThumbnailTooltip->setChecked(showThumbnailTooltip);

    bool reverseOscTime = (DatabaseManager::getInstance().getConfigurationByName("ReverseOscTime").getValue() == "true") ? true : false;
    this->checkBoxReverseOscTime->setChecked(reverseOscTime);

    bool enableOscInput = (DatabaseManager::getInstance().getConfigurationByName("EnableOscInput").getValue() == "true") ? true : false;
    this->checkBoxEnableOscInput->setChecked(enableOscInput);
    this->labelOscPort->setEnabled(enableOscInput);
    this->lineEditOscInputPort->setEnabled(enableOscInput);

    bool disableInAndOutPoints = (DatabaseManager::getInstance().getConfigurationByName("DisableInAndOutPoints").getValue() == "true") ? true : false;
    this->checkBoxDisableInAndOutPoints->setChecked(disableInAndOutPoints);

    this->comboBoxDelayType->setCurrentIndex(this->comboBoxDelayType->findText(DatabaseManager::getInstance().getConfigurationByName("DelayType").getValue()));

    this->lineEditOscInputPort->setPlaceholderText(QString("%1").arg(Osc::DEFAULT_PORT));
    QString oscPort = DatabaseManager::getInstance().getConfigurationByName("OscPort").getValue();
    if (!oscPort.isEmpty())
        this->lineEditOscInputPort->setText(oscPort);

    loadDevice();
    loadTriCasterDevice();
    loadAtemDevice();
    loadGpi();
    loadOscOutput();
    loadTriCasterProduct();

    this->comboBoxTriCasterProduct->setCurrentIndex(this->comboBoxTriCasterProduct->findText(DatabaseManager::getInstance().getConfigurationByName("TriCasterProduct").getValue()));
}
Esempio n. 2
0
QList<QSharedPointer<DeviceInfo>> DeviceInfoParser::loadFromDir(const QString& dirName)
{
  QList<QSharedPointer<DeviceInfo>> result;

  if (dirName.isEmpty() == false) {
    QDir dir(dirName);
    foreach (const QFileInfo& finfo, dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
      QSharedPointer<DeviceInfo> devinfo = loadDevice(finfo.absoluteFilePath());
      if (   devinfo.isNull() == false
          && devinfo->portsCount() > 0) {
        result.append(devinfo);
      }
    }
  }
bool HbXmlLoaderBaseSyntax::load( QIODevice *device, const QString &section )
{
    return loadDevice(device, section);
}