示例#1
0
//---------------------------------------------------------
//   valueChanged
//---------------------------------------------------------
void EditDrumset::valueChanged()
      {
      if(!pitchList->currentItem())
            return;
      int pitch = pitchList->currentItem()->data(Column::PITCH, Qt::UserRole).toInt();
      nDrumset.drum(pitch).name          = name->text();
      if (customGbox->isChecked() || noteHead->currentIndex() == noteHead->findData(int(NoteHead::Group::HEAD_CUSTOM))) {
            fillCustomNoteheadsDataFromComboboxes(pitch);
            setCustomNoteheadsGUIEnabled(true);
            }
      else {
            nDrumset.drum(pitch).notehead = NoteHead::Group(noteHead->currentData().toInt());
            fillNoteheadsComboboxes(false, pitch);
            setCustomNoteheadsGUIEnabled(false);
      }
      
      nDrumset.drum(pitch).line          = staffLine->value();
      nDrumset.drum(pitch).voice         = voice->currentIndex();
      nDrumset.drum(pitch).stemDirection = Direction(stemDirection->currentIndex());
      if (QString(QChar(nDrumset.drum(pitch).shortcut)) != shortcut->currentText()) {
            if (shortcut->currentText().isEmpty())
                  nDrumset.drum(pitch).shortcut = 0;
            else
                  nDrumset.drum(pitch).shortcut = shortcut->currentText().at(0).toLatin1();
            }
      updateExample();
      }
void NSettingsDownload::addGridRow(
  QGridLayout *g,
  const QString& text,
  QComboBox **c,
  QLineEdit **e,
  const char *slot)
{
  QLabel *l = new QLabel(text);
  *e = new QLineEdit;
  l->setBuddy(*e);

  if (c)
    *c = new QComboBox;

  if (slot)
    {
      connect(*c, SIGNAL(currentIndexChanged(int)),
              this, slot);
    }

  connect(*e, SIGNAL(editingFinished()),
          this, SLOT(updateExample()));

  const int row = g->rowCount() + 1;

  g->addWidget(l,  row, 0);
  g->addWidget(*e, row, 1);
  if (c)
    g->addWidget(*c, row, 2);
}
示例#3
0
//---------------------------------------------------------
//   itemChanged
//---------------------------------------------------------
void EditDrumset::itemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous)
      {
      if (previous) {
            int pitch = previous->data(0, Qt::UserRole).toInt();
            nDrumset.drum(pitch).name          = name->text();
            if (customGbox->isChecked())
                  fillCustomNoteheadsDataFromComboboxes(pitch);
            else {
                  const QVariant currData = noteHead->currentData();
                  if (currData.isValid())
                        nDrumset.drum(pitch).notehead = NoteHead::Group(currData.toInt());
                  }

            nDrumset.drum(pitch).line          = staffLine->value();
            nDrumset.drum(pitch).voice         = voice->currentIndex();
            if (shortcut->currentIndex() == 7)
                  nDrumset.drum(pitch).shortcut = 0;
            else
                  nDrumset.drum(pitch).shortcut = "ABCDEFG"[shortcut->currentIndex()];
            nDrumset.drum(pitch).stemDirection = Direction(stemDirection->currentIndex());
            previous->setText(Column::NAME, qApp->translate("drumset", nDrumset.name(pitch).toUtf8().constData()));
            }
      if (current == 0)
            return;

      staffLine->blockSignals(true);
      voice->blockSignals(true);
      stemDirection->blockSignals(true);
      noteHead->blockSignals(true);

      int pitch = current->data(0, Qt::UserRole).toInt();
      name->setText(qApp->translate("drumset", nDrumset.name(pitch).toUtf8().constData()));
      staffLine->setValue(nDrumset.line(pitch));
      qDebug("BEFORE %d", nDrumset.voice(pitch));
      voice->setCurrentIndex(nDrumset.voice(pitch));
      qDebug("AFTER %d", nDrumset.voice(pitch));
      stemDirection->setCurrentIndex(int(nDrumset.stemDirection(pitch)));

      NoteHead::Group nh = nDrumset.noteHead(pitch);
      bool isCustomGroup = (nh == NoteHead::Group::HEAD_CUSTOM);
      if (nDrumset.isValid(pitch))
            setCustomNoteheadsGUIEnabled(isCustomGroup);
      noteHead->setCurrentIndex(noteHead->findData(int(nh)));
      fillNoteheadsComboboxes(isCustomGroup, pitch);

      if (nDrumset.shortcut(pitch) == 0)
            shortcut->setCurrentIndex(7);
      else
            shortcut->setCurrentIndex(nDrumset.shortcut(pitch) - 'A');

      staffLine->blockSignals(false);
      voice->blockSignals(false);
      stemDirection->blockSignals(false);
      noteHead->blockSignals(false);

      updateExample();
      }
void NSettingsDownload::init()
{
  if (fnfmtEdit->text().isEmpty())
    fnfmtChanged(0);

  if (regexpEdit->text().isEmpty())
    regexpChanged(0);

  updateExample();

  if (savedirEdit->text().isEmpty())
    savedirEdit->setText(QDir::homePath());
}
示例#5
0
void EditDrumset::valueChanged()
      {
      int pitch = pitchList->currentItem()->data(COL_PITCH, Qt::UserRole).toInt();
      nDrumset.drum(pitch).name          = name->text();
      nDrumset.drum(pitch).notehead      = noteHead->currentIndex() - 1;
      nDrumset.drum(pitch).line          = staffLine->value();
      nDrumset.drum(pitch).voice         = voice->value() - 1;
      nDrumset.drum(pitch).stemDirection = Direction(stemDirection->currentIndex());
      if (QString(QChar(nDrumset.drum(pitch).shortcut)) != shortcut->currentText()) {
            if (shortcut->currentText().isEmpty())
                  nDrumset.drum(pitch).shortcut = 0;
            else
                  nDrumset.drum(pitch).shortcut = shortcut->currentText().at(0).toAscii();
            }
      updateExample();
      }
示例#6
0
void EditDrumset::itemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous)
      {
      if (previous) {
            int pitch = previous->data(0, Qt::UserRole).toInt();
            nDrumset.drum(pitch).name          = name->text();
            nDrumset.drum(pitch).notehead      = Note::NoteHeadGroup(noteHead->currentIndex() - 1);
            nDrumset.drum(pitch).line          = staffLine->value();
            nDrumset.drum(pitch).voice         = voice->currentIndex();
            if (shortcut->currentIndex() == 7)
                  nDrumset.drum(pitch).shortcut = 0;
            else
                  nDrumset.drum(pitch).shortcut = "ABCDEFG"[shortcut->currentIndex()];
            nDrumset.drum(pitch).stemDirection = MScore::Direction(stemDirection->currentIndex());
            previous->setText(COL_NAME, qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
            }
      if (current == 0)
            return;
      name->blockSignals(true);
      staffLine->blockSignals(true);
      voice->blockSignals(true);
      stemDirection->blockSignals(true);
      noteHead->blockSignals(true);

      int pitch = current->data(0, Qt::UserRole).toInt();
      name->setText(qApp->translate("drumset", qPrintable(nDrumset.name(pitch))));
      staffLine->setValue(nDrumset.line(pitch));
      qDebug("BEFORE %d", nDrumset.voice(pitch));
      voice->setCurrentIndex(nDrumset.voice(pitch));
      qDebug("AFTER %d", nDrumset.voice(pitch));
      stemDirection->setCurrentIndex(int(nDrumset.stemDirection(pitch)));
      int nh = nDrumset.noteHead(pitch);
      noteHead->setCurrentIndex(nh + 1);
      if (nDrumset.shortcut(pitch) == 0)
            shortcut->setCurrentIndex(7);
      else
            shortcut->setCurrentIndex(nDrumset.shortcut(pitch) - 'A');

      name->blockSignals(false);
      staffLine->blockSignals(false);
      voice->blockSignals(false);
      stemDirection->blockSignals(false);
      noteHead->blockSignals(false);

      updateExample();
      }
示例#7
0
void EditDrumset::valueChanged()
      {
      if(!pitchList->currentItem())
            return;
      int pitch = pitchList->currentItem()->data(Column::PITCH, Qt::UserRole).toInt();
      nDrumset.drum(pitch).name          = name->text();
      nDrumset.drum(pitch).notehead      = NoteHead::Group(noteHead->currentIndex() - 1);
      nDrumset.drum(pitch).line          = staffLine->value();
      nDrumset.drum(pitch).voice         = voice->currentIndex();
      nDrumset.drum(pitch).stemDirection = MScore::Direction(stemDirection->currentIndex());
      if (QString(QChar(nDrumset.drum(pitch).shortcut)) != shortcut->currentText()) {
            if (shortcut->currentText().isEmpty())
                  nDrumset.drum(pitch).shortcut = 0;
            else
                  nDrumset.drum(pitch).shortcut = shortcut->currentText().at(0).toLatin1();
            }
      updateExample();
      }
示例#8
0
void KioskConfigDialog::init()
{
   QString prefix = KioskRun::self()->getProfilePrefix();

   if (prefix.isEmpty())
   {
      w->checkProfilePrefix->setChecked(false);
      w->lineProfilePrefix->setUrl(KUrl( "/etc/kde-profile/" ));
   }
   else
   {
      w->checkProfilePrefix->setChecked(true);
      w->lineProfilePrefix->setUrl(prefix);
   }

   KConfigGroup grp(KGlobal::config(), "General");

   // Deprecated JH
   /*
   QString uploadURL = grp.readEntry("uploadURL");
   if (uploadURL.isEmpty())
   {
      w->checkUpload->setChecked(false);
      w->lineUpload->setUrl(KUrl( "fish://root@host/" ));
   }
   else
   {
      w->checkUpload->setChecked(true);
      w->lineUpload->setUrl(uploadURL);
   }
   w->lineUploadPrefix->setText(grp.readEntry("uploadPrefix"));
   */

   // FIXME: get rid of magic values. the default here should be configurable by the packagers
   w->checkUID->setChecked(grp.readEntry("filterUID", true));
   w->numUID->setValue(grp.readEntry("FirstUIDShown", DEFAULT_MIN_UID));

   w->checkGID->setChecked(grp.readEntry("filterGID", true));
   w->numGID->setValue(grp.readEntry("FirstGIDShown", DEFAULT_MIN_GID));

   updateExample();
}
示例#9
0
//---------------------------------------------------------
//   customQuarterChanged
//---------------------------------------------------------
void EditDrumset::customQuarterChanged(int)
      {
      updateExample();
      }
示例#10
0
void NSettingsDownload::regexpChanged(int n)
{
  regexpEdit->setText(regexpCombo->itemData(n).toString());
  updateExample();
}
示例#11
0
void NSettingsDownload::fnfmtChanged(int n)
{
  fnfmtEdit->setText(fnfmtCombo->itemData(n).toString());
  updateExample();
}