Exemplo n.º 1
0
RecipeExtrasWidget::RecipeExtrasWidget(QWidget* parent)
   : QWidget(parent), recipe(0)
{
   setupUi(this);

   ratingChanged = false;

   connect( lineEdit_age,        SIGNAL(textModified()), this, SLOT(updateAge()));
   connect( lineEdit_ageTemp,    SIGNAL(textModified()), this, SLOT(updateAgeTemp()));
   connect( lineEdit_asstBrewer, SIGNAL(textModified()), this, SLOT(updateBrewerAsst()) );
   connect( lineEdit_brewer,     SIGNAL(textModified()), this, SLOT(updateBrewer()) );
   connect( lineEdit_carbVols,   SIGNAL(textModified()), this, SLOT(updateCarbonation()) );
   connect( lineEdit_primaryAge, SIGNAL(textModified()), this, SLOT(updatePrimaryAge()) );
   connect( lineEdit_primaryTemp,SIGNAL(textModified()), this, SLOT(updatePrimaryTemp()) );
   connect( lineEdit_secAge,     SIGNAL(textModified()), this, SLOT(updateSecondaryAge()) );
   connect( lineEdit_secTemp,    SIGNAL(textModified()), this, SLOT(updateSecondaryTemp()) );
   connect( lineEdit_tertAge,    SIGNAL(textModified()), this, SLOT(updateTertiaryAge()) );
   connect( lineEdit_tertTemp,   SIGNAL(textModified()), this, SLOT(updateTertiaryTemp()) );

   connect( spinBox_tasteRating, SIGNAL(valueChanged(int)), this, SLOT(changeRatings(int)) );
   connect( spinBox_tasteRating, SIGNAL(editingFinished()), this, SLOT(updateTasteRating()) );

   connect( dateEdit_date, SIGNAL(dateChanged(const QDate& )), this, SLOT(updateDate(const QDate&)) );

   connect(btTextEdit_notes, SIGNAL(textModified()), this, SLOT(updateNotes()));
   connect(btTextEdit_tasteNotes, SIGNAL(textModified()), this, SLOT(updateTasteNotes()));

}
Exemplo n.º 2
0
void PianoView::setStaff(Staff* s, Pos* l)
      {
      staff    = s;
      _locator = l;
      setEnabled(staff != nullptr);
      if (!staff) {
            scene()->blockSignals(true);  // block changeSelection()
            scene()->clear();
            scene()->blockSignals(false);
            return;
            }

      pos.setContext(staff->score()->tempomap(), staff->score()->sigmap());
      Measure* lm = staff->score()->lastMeasure();
      ticks       = lm->tick() + lm->ticks();
      scene()->setSceneRect(0.0, 0.0, double(ticks + 960), keyHeight * 75);

      updateNotes();

      //
      // move to something interesting
      //
      QList<QGraphicsItem*> items = scene()->selectedItems();
      QRectF boundingRect;
      foreach (QGraphicsItem* item, items) {
            if (item->type() == PianoItemType)
                  boundingRect |= item->mapToScene(item->boundingRect()).boundingRect();
            }
      centerOn(boundingRect.center());
      horizontalScrollBar()->setValue(0);
      }
Exemplo n.º 3
0
void RecipeExtrasWidget::saveAll()
{
   //recObs->disableNotification();

   updateBrewer();
   updateBrewerAsst();
   updateTasteRating();
   updatePrimaryAge();
   updatePrimaryTemp();
   updateSecondaryAge();
   updateSecondaryTemp();
   updateTertiaryAge();
   updateTertiaryTemp();
   updateAge();
   updateAgeTemp();
   updateDate();
   updateCarbonation();
   updateTasteNotes();
   updateNotes();

   //recObs->reenableNotification();
   //recObs->forceNotify();

   hide();
}
Exemplo n.º 4
0
void PcapPort::init()
{
    if (!monitorTx_->isDirectional())
        transmitter_->useExternalStats(&stats_);

    transmitter_->setHandle(monitorRx_->handle());

    updateNotes();

    monitorRx_->start();
    monitorTx_->start();
}
Exemplo n.º 5
0
void NoteView::editClicked(){
    ui->bodyError->clear();
    if(ui->authorLabel->text().compare("Author: ")==0)
        ui->bodyError->setText("Note does not exist");
    else if(ui->bodyInput->toPlainText().compare("")==0)
        ui->bodyError->setText("Note body can not be empty");
    else{
        int commentID = this->_controller->returnNoteVector().at(this->_controller->getLocation()).getId();
        QString body = ui->bodyInput->toPlainText();
        this->_controller->editNote(commentID, body);
        QMessageBox::information(this, "Info", "The note body has been saved.");
    }
    updateNotes();
}
Exemplo n.º 6
0
void NoteView::prevClicked(){
    int size = this->_controller->returnNoteVector().size();
    if (size > 0){
    int current = this->_controller->getLocation();
    if (current != 0){
        this->_controller->decLocation();
        current--;
        int newID = this->_controller->returnNoteVector().at(current).getuserID();
        this->ui->authorLabel->setText("Author: " + this->_controller->getName(newID));
        this->ui->dateLabel->setText("Date: " + this->_controller->returnNoteVector().at(current).getCreatedAt().toString());
        this->ui->bodyInput->setText(this->_controller->returnNoteVector().at(current).getBody());
        }
    }
    updateNotes();
}
Exemplo n.º 7
0
void MidiArp::prepareCurrentNote(int askedTick)
{
    gotKbdTrig = false;
    currentTick = askedTick;
    int l1 = 0;
    updateNotes();
    returnTick = currentNoteTick;
    while ((currentNote[l1] >= 0) && (l1 < MAXCHORD - 1)) {
        returnNote.replace(l1, currentNote[l1]);
        returnVelocity.replace(l1, currentVelocity[l1]);
        l1++;
    }
    returnNote.replace(l1, -1); // mark end of chord
    returnLength = currentLength;
    returnIsNew = newCurrent;
    newCurrent = false;
}
Exemplo n.º 8
0
bool WinPcapPort::setExclusiveControl(bool exclusive) 
{
    QString portName(adapter_->Name + strlen("\\Device\\NPF_"));
    QString bindConfigFilePath(QCoreApplication::applicationDirPath()
                + "/bindconfig.exe");
    QString status;

    qDebug("%s: %s", __FUNCTION__, portName.toAscii().constData());

    if (!QFile::exists(bindConfigFilePath))
        return false;

    status = exclusive ? "disable" : "enable";

    QProcess::execute(bindConfigFilePath, 
            QStringList() << "comp" << portName << status);

    updateNotes(); 

    return (exclusive == hasExclusiveControl());
}