예제 #1
0
AdvancedSettings::AdvancedSettings()
{
    ui.setupUi (this);
    resize (0, 0);

    /* Main dialog buttons */
    connect (ui.ApplyButton, SIGNAL (clicked()), this, SLOT (onApplyClicked()));
    connect (ui.ResetButton, SIGNAL (clicked()), this, SLOT (onResetClicked()));
    connect (ui.CancelButton, SIGNAL (clicked()), this, SLOT (onCancelClicked()));

    /* Appearance tab */
    connect (ui.BaseButton, SIGNAL (clicked()), this, SLOT (onSelectorClicked()));
    connect (ui.HighlightButton, SIGNAL (clicked()), this,
             SLOT (onSelectorClicked()));
    connect (ui.BackgroundButton, SIGNAL (clicked()), this,
             SLOT (onSelectorClicked()));
    connect (ui.ForegroundButton, SIGNAL (clicked()), this,
             SLOT (onSelectorClicked()));
    connect (ui.BaseEdit, SIGNAL (textChanged (QString)), this,
             SLOT (onColorChanged (QString)));
    connect (ui.HighlightEdit, SIGNAL (textChanged (QString)), this,
             SLOT (onColorChanged (QString)));
    connect (ui.BackgroundEdit, SIGNAL (textChanged (QString)), this,
             SLOT (onColorChanged (QString)));
    connect (ui.ForegroundEdit, SIGNAL (textChanged (QString)), this,
             SLOT (onColorChanged (QString)));

    readSettings();
}
예제 #2
0
파일: interface.cpp 프로젝트: dwsaxton/quad
Interface::Interface()
{
  control_automatic_ = true;
  setupUi(this);
  
  m_propInputs[0] = prop1;
  m_propInputs[1] = prop2;
  m_propInputs[2] = prop3;
  m_propInputs[3] = prop4;
  
  for ( int i = 0; i < 4; ++i ) {
    connect( m_propInputs[i], SIGNAL(valueChanged(int)), this, SLOT(onPropSlidersAdjusted()) );
  }

  runPauseSimulationButton->setVisible(Globals::self().isSimulation());

  connect(controlAutomatic, SIGNAL(toggled(bool)), this, SLOT(setControlAutomatic(bool)));
  connect(goButton, SIGNAL(clicked()), this, SLOT(onAutoGoClicked()));
  connect(runPauseSimulationButton, SIGNAL(clicked()), this, SLOT(onRunPauseSimulationClicked()));
  connect(resetButton, SIGNAL(clicked()), this, SLOT(onResetClicked()));

  QTimer *timer = new QTimer(this);
  connect( timer, SIGNAL(timeout()), this, SLOT(updateLabels()) );
  timer->start( 50 );
}
예제 #3
0
void
ValuePage::init() {
  m_lTitle = new QLabel{this};
  m_lTitle->setWordWrap(true);

  auto line = new QFrame{this};
  line->setFrameShape(QFrame::HLine);
  line->setFrameShadow(QFrame::Sunken);

  m_lTypeLabel    = new QLabel{this};
  m_lType         = new QLabel{this};

  auto sizePolicy = QSizePolicy{QSizePolicy::Expanding, QSizePolicy::Preferred};
  sizePolicy.setHorizontalStretch(0);
  sizePolicy.setVerticalStretch(0);
  sizePolicy.setHeightForWidth(m_lType->sizePolicy().hasHeightForWidth());
  m_lType->setSizePolicy(sizePolicy);

  if (!m_description.get_untranslated().empty()) {
    m_lDescriptionLabel = new QLabel{this};
    m_lDescription      = new QLabel{this};
    sizePolicy.setHeightForWidth(m_lDescription->sizePolicy().hasHeightForWidth());
    m_lDescription->setSizePolicy(sizePolicy);
    m_lDescription->setWordWrap(true);
  }

  m_lStatusLabel  = new QLabel{this};
  m_lStatus       = new QLabel{this};
  m_cbAddOrRemove = new QCheckBox{this};

  if (m_present) {
    auto semantic = find_ebml_semantic(KaxSegment::ClassInfos, m_callbacks.GlobalId);
    if (semantic && semantic->Mandatory)
      m_cbAddOrRemove->setEnabled(false);
  }

  sizePolicy.setHeightForWidth(m_lStatus->sizePolicy().hasHeightForWidth());
  m_lStatus->setSizePolicy(sizePolicy);
  m_lStatus->setWordWrap(true);

  if (m_present) {
    m_lOriginalValueLabel = new QLabel{this};
    m_lOriginalValue      = new QLabel{this};
  }

  m_lValueLabel = new QLabel{this};
  m_input       = createInputControl();
  m_input->setEnabled(m_present);

  m_bReset = new QPushButton{this};

  // ----------------------------------------------------------------------

  auto statusLayout = new QVBoxLayout{};
  statusLayout->addWidget(m_lStatus);
  statusLayout->addWidget(m_cbAddOrRemove);

  auto row        = 0;
  auto gridLayout = new QGridLayout{};
  gridLayout->addWidget(m_lTypeLabel,            row,   0, 1, 1);
  gridLayout->addWidget(m_lType,                 row++, 1, 1, 1);

  if (!m_description.get_untranslated().empty()) {
    gridLayout->addWidget(m_lDescriptionLabel,   row,   0, 1, 1, Qt::AlignTop);
    gridLayout->addWidget(m_lDescription,        row++, 1, 1, 1, Qt::AlignTop);
  }

  gridLayout->addWidget(m_lStatusLabel,          row,   0, 1, 1, Qt::AlignTop);
  gridLayout->addLayout(statusLayout,            row++, 1, 1, 1, Qt::AlignTop);

  if (m_present) {
    gridLayout->addWidget(m_lOriginalValueLabel, row,   0, 1, 1);
    gridLayout->addWidget(m_lOriginalValue,      row++, 1, 1, 1);
  }

  gridLayout->addWidget(m_lValueLabel,           row,   0, 1, 1);
  gridLayout->addWidget(m_input,                 row++, 1, 1, 1);

  auto resetLayout = new QHBoxLayout{};
  resetLayout->addItem(new QSpacerItem{0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum});
  resetLayout->addWidget(m_bReset);

  auto widgetLayout = new QVBoxLayout{this};
  widgetLayout->addWidget(m_lTitle);
  widgetLayout->addWidget(line);
  widgetLayout->addLayout(gridLayout);
  widgetLayout->addItem(new QSpacerItem{0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding});
  widgetLayout->addLayout(resetLayout);

  // ----------------------------------------------------------------------

  connect(m_cbAddOrRemove, SIGNAL(toggled(bool)), this, SLOT(onAddOrRemoveChecked()));
  connect(m_bReset,        SIGNAL(clicked()),     this, SLOT(onResetClicked()));

  // ----------------------------------------------------------------------

  m_parent.appendPage(this, m_topLevelPage.m_pageIdx);

  m_topLevelPage.m_children << this;

  retranslateUi();
}