InspectorImage::InspectorImage(QWidget* parent) : InspectorElementBase(parent) { b.setupUi(addWidget()); Element* e = inspector->element(); bool inFrame = e->parent()->isHBox() || e->parent()->isVBox(); bool sameTypes = true; for (const auto& ee : *inspector->el()) { if ((ee->parent()->isHBox() || ee->parent()->isVBox()) != inFrame) { sameTypes = false; break; } } if (sameTypes) { b.autoscale->setDisabled(!inFrame); b.resetAutoscale->setDisabled(!inFrame); } const std::vector<InspectorItem> iiList = { { Pid::AUTOSCALE, 0, b.autoscale, b.resetAutoscale }, { Pid::SIZE, 0, b.size, b.resetSize }, { Pid::LOCK_ASPECT_RATIO, 0, b.lockAspectRatio, b.resetLockAspectRatio }, { Pid::SIZE_IS_SPATIUM, 0, b.sizeIsSpatium, b.resetSizeIsSpatium } }; const std::vector<InspectorPanel> ppList = { { b.title, b.panel } }; mapSignals(iiList, ppList); }
FileTransferHandler::FileTransferHandler(PsiAccount *pa, FileTransfer *ft) { d = new Private; d->pa = pa; d->c = 0; if(ft) { d->sending = false; d->peer = ft->peer(); d->fileName = clean_filename(ft->fileName()); d->fileSize = ft->fileSize(); d->desc = ft->description(); d->shift = calcShift(d->fileSize); d->complement = calcComplement(d->fileSize, d->shift); d->ft = ft; Jid proxy = d->pa->userAccount().dtProxy; if(proxy.isValid()) d->ft->setProxy(proxy); mapSignals(); } else { d->sending = true; d->ft = 0; } }
InspectorStaffTypeChange::InspectorStaffTypeChange(QWidget* parent) : InspectorBase(parent) { sl.setupUi(addWidget()); iList = { { Pid::STAFF_YOFFSET, 0, sl.yoffset, sl.resetYoffset }, { Pid::SMALL, 0, sl.small, sl.resetSmall }, { Pid::MAG, 0, sl.scale, sl.resetScale }, { Pid::STAFF_LINES, 0, sl.lines, sl.resetLines }, { Pid::STEP_OFFSET, 0, sl.stepOffset, sl.resetStepOffset }, { Pid::LINE_DISTANCE, 0, sl.lineDistance, sl.resetLineDistance }, { Pid::STAFF_SHOW_BARLINES, 0, sl.showBarlines, sl.resetShowBarlines }, { Pid::STAFF_SHOW_LEDGERLINES, 0, sl.showLedgerlines, sl.resetShowLedgerlines }, { Pid::STAFF_SLASH_STYLE, 0, sl.slashStyle, sl.resetSlashStyle }, { Pid::STAFF_NOTEHEAD_SCHEME, 0, sl.noteheadScheme, sl.resetNoteheadScheme }, { Pid::STAFF_GEN_CLEF, 0, sl.genClefs, sl.resetGenClefs }, { Pid::STAFF_GEN_TIMESIG, 0, sl.genTimesig, sl.resetGenTimesig }, { Pid::STAFF_GEN_KEYSIG, 0, sl.genKeysig, sl.resetGenKeysig }, }; sl.noteheadScheme->clear(); for (auto i : { NoteHeadScheme::HEAD_NORMAL, NoteHeadScheme::HEAD_PITCHNAME, NoteHeadScheme::HEAD_PITCHNAME_GERMAN, NoteHeadScheme::HEAD_SOLFEGE, NoteHeadScheme::HEAD_SOLFEGE_FIXED, NoteHeadScheme::HEAD_SHAPE_NOTE_4, NoteHeadScheme::HEAD_SHAPE_NOTE_7_AIKIN, NoteHeadScheme::HEAD_SHAPE_NOTE_7_FUNK, NoteHeadScheme::HEAD_SHAPE_NOTE_7_WALKER} ) { sl.noteheadScheme->addItem(StaffType::scheme2userName(i), int(i)); } mapSignals(); }
InspectorHairpin::InspectorHairpin(QWidget* parent) : InspectorElementBase(parent) { l.setupUi(addWidget()); setupLineStyle(l.lineStyle); h.setupUi(addWidget()); h.hairpinType->clear(); h.hairpinType->addItem(tr("Crescendo Hairpin"), int(HairpinType::CRESC_HAIRPIN)); h.hairpinType->addItem(tr("Decrescendo Hairpin"), int(HairpinType::DECRESC_HAIRPIN) ); h.hairpinType->addItem(tr("Crescendo Line"), int(HairpinType::CRESC_LINE)); h.hairpinType->addItem(tr("Decrescendo Line"), int(HairpinType::DECRESC_LINE)); std::vector<InspectorItem> il = { { P_ID::LINE_VISIBLE, 0, 0, l.lineVisible, l.resetLineVisible }, { P_ID::DIAGONAL, 0, 0, l.diagonal, l.resetDiagonal }, { P_ID::LINE_COLOR, 0, 0, l.lineColor, l.resetLineColor }, { P_ID::LINE_WIDTH, 0, 0, l.lineWidth, l.resetLineWidth }, { P_ID::LINE_STYLE, 0, 0, l.lineStyle, l.resetLineStyle }, { P_ID::DASH_LINE_LEN, 0, 0, l.dashLineLength, l.resetDashLineLength }, { P_ID::DASH_GAP_LEN, 0, 0, l.dashGapLength, l.resetDashGapLength }, { P_ID::HAIRPIN_CIRCLEDTIP, 0, 0, h.hairpinCircledTip, h.resetHairpinCircledTip }, { P_ID::HAIRPIN_TYPE, 0, 0, h.hairpinType, 0 }, { P_ID::PLACEMENT, 0, 0, h.placement, h.resetPlacement }, { P_ID::DYNAMIC_RANGE, 0, 0, h.dynRange, h.resetDynRange }, { P_ID::VELO_CHANGE, 0, 0, h.veloChange, h.resetVeloChange }, { P_ID::HAIRPIN_HEIGHT, 0, 0, h.hairpinHeight, h.resetHairpinHeight }, { P_ID::HAIRPIN_CONT_HEIGHT, 0, 0, h.hairpinContHeight, h.resetHairpinContHeight } }; mapSignals(il); }
InspectorRest::InspectorRest(QWidget* parent) : InspectorElementBase(parent) { s.setupUi(addWidget()); r.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::LEADING_SPACE, 1, s.leadingSpace, s.resetLeadingSpace }, { Pid::SMALL, 0, r.small, r.resetSmall }, }; const std::vector<InspectorPanel> ppList = { { s.title, s.panel }, { r.title, r.panel } }; mapSignals(iiList, ppList); // // Select // QLabel* l = new QLabel; l->setText(tr("Select")); QFont font(l->font()); font.setBold(true); l->setFont(font); l->setAlignment(Qt::AlignHCenter); _layout->addWidget(l); QFrame* f = new QFrame; f->setFrameStyle(QFrame::HLine | QFrame::Raised); f->setLineWidth(2); _layout->addWidget(f); QHBoxLayout* hbox = new QHBoxLayout; dot1 = new QToolButton(this); dot1->setText(tr("Dot 1")); hbox->addWidget(dot1); dot2 = new QToolButton(this); dot2->setText(tr("Dot 2")); hbox->addWidget(dot2); dot3 = new QToolButton(this); dot3->setText(tr("Dot 3")); hbox->addWidget(dot3); dot4 = new QToolButton(this); dot4->setText(tr("Dot 4")); hbox->addWidget(dot4); _layout->addLayout(hbox); hbox = new QHBoxLayout; tuplet = new QToolButton(this); tuplet->setText(tr("Tuplet")); tuplet->setEnabled(false); hbox->addWidget(tuplet); _layout->addLayout(hbox); //TODO e.offset->setSingleStep(1.0); // step in spatium units connect(dot1, SIGNAL(clicked()), SLOT(dot1Clicked())); connect(dot2, SIGNAL(clicked()), SLOT(dot2Clicked())); connect(dot3, SIGNAL(clicked()), SLOT(dot3Clicked())); connect(dot4, SIGNAL(clicked()), SLOT(dot4Clicked())); connect(tuplet, SIGNAL(clicked()), SLOT(tupletClicked())); }
InspectorHairpin::InspectorHairpin(QWidget* parent) : InspectorBase(parent) { e.setupUi(addWidget()); l.setupUi(addWidget()); setupLineStyle(l.lineStyle); h.setupUi(addWidget()); iList = { { P_ID::COLOR, 0, 0, e.color, e.resetColor }, { P_ID::VISIBLE, 0, 0, e.visible, e.resetVisible }, { P_ID::USER_OFF, 0, 0, e.offsetX, e.resetX }, { P_ID::USER_OFF, 1, 0, e.offsetY, e.resetY }, { P_ID::DIAGONAL, 0, 0, l.diagonal, l.resetDiagonal }, { P_ID::LINE_VISIBLE, 0, 0, l.lineVisible, l.resetLineVisible }, { P_ID::LINE_COLOR, 0, 0, l.lineColor, l.resetLineColor }, { P_ID::LINE_WIDTH, 0, 0, l.lineWidth, l.resetLineWidth }, { P_ID::LINE_STYLE, 0, 0, l.lineStyle, l.resetLineStyle }, { P_ID::HAIRPIN_TEXTLINE, 0, 0, h.useTextLine, h.resetUseTextLine }, { P_ID::HAIRPIN_CIRCLEDTIP, 0, 0, h.hairpinCircledTip, h.resetHairpinCircledTip }, { P_ID::HAIRPIN_TYPE, 0, 0, h.hairpinType, h.resetHairpinType }, { P_ID::DYNAMIC_RANGE, 0, 0, h.dynRange, h.resetDynRange }, { P_ID::VELO_CHANGE, 0, 0, h.veloChange, h.resetVeloChange }, { P_ID::HAIRPIN_HEIGHT, 0, 0, h.hairpinHeight, h.resetHairpinHeight }, { P_ID::HAIRPIN_CONT_HEIGHT, 0, 0, h.hairpinContHeight, h.resetHairpinContHeight } }; mapSignals(); }
InspectorVolta::InspectorVolta(QWidget* parent) : InspectorElementBase(parent) { l.setupUi(addWidget()); setupLineStyle(l.lineStyle); //tl.setupUi(addWidget()); v.setupUi(addWidget()); const std::vector<InspectorItem> il = { { P_ID::LINE_VISIBLE, 0, 0, l.lineVisible, l.resetLineVisible }, { P_ID::DIAGONAL, 0, 0, l.diagonal, l.resetDiagonal }, { P_ID::LINE_COLOR, 0, 0, l.lineColor, l.resetLineColor }, { P_ID::LINE_WIDTH, 0, 0, l.lineWidth, l.resetLineWidth }, { P_ID::LINE_STYLE, 0, 0, l.lineStyle, l.resetLineStyle }, { P_ID::DASH_LINE_LEN, 0, 0, l.dashLineLength, l.resetDashLineLength }, { P_ID::DASH_GAP_LEN, 0, 0, l.dashGapLength, l.resetDashGapLength }, // tl { P_ID::VOLTA_TYPE, 0, 0, v.voltaType, v.resetVoltaType }, { P_ID::BEGIN_TEXT, 0, 0, v.voltaText, 0 }, { P_ID::VOLTA_ENDING, 0, 0, v.voltaRepeatList, 0 } }; const std::vector<InspectorPanel> ppList = { { l.title, l.panel }, { v.title, v.panel } }; mapSignals(il, ppList); }
InspectorOttava::InspectorOttava(QWidget* parent) : InspectorBase(parent) { e.setupUi(addWidget()); l.setupUi(addWidget()); setupLineStyle(l.lineStyle); tl.setupUi(addWidget()); o.setupUi(addWidget()); iList = { { P_COLOR, 0, 0, e.color, e.resetColor }, { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, { P_DIAGONAL, 0, 0, l.diagonal, l.resetDiagonal }, { P_LINE_COLOR, 0, 0, l.lineColor, l.resetLineColor }, { P_LINE_WIDTH, 0, 0, l.lineWidth, l.resetLineWidth }, { P_LINE_STYLE, 0, 0, l.lineStyle, l.resetLineStyle }, // tl missing { P_OTTAVA_TYPE, 0, 0, o.ottavaType, o.resetOttavaType }, { P_PLACEMENT, 0, 0, o.placement, o.resetPlacement }, { P_NUMBERS_ONLY, 0, 0, o.numbersOnly, o.resetNumbersOnly } }; mapSignals(); }
InspectorStaffText::InspectorStaffText(QWidget* parent) : InspectorTextBase(parent) { s.setupUi(addWidget()); Element* e = inspector->element(); bool sameTypes = true; for (const auto& ee : *inspector->el()) { if (e->isSystemText() != ee->isSystemText()) { sameTypes = false; break; } } if (sameTypes) s.title->setText(e->isSystemText() ? tr("System Text") : tr("Staff Text")); const std::vector<InspectorItem> il = { { Pid::PLACEMENT, 0, s.placement, s.resetPlacement }, { Pid::SUB_STYLE, 0, s.style, s.resetStyle } }; const std::vector<InspectorPanel> ppList = { { s.title, s.panel } }; populatePlacement(s.placement); s.style->clear(); for (auto ss : { Tid::SYSTEM, Tid::STAFF, Tid::TEMPO, Tid::METRONOME, Tid::REHEARSAL_MARK, Tid::EXPRESSION, Tid::REPEAT_LEFT, Tid::REPEAT_RIGHT, Tid::FRAME, Tid::TITLE, Tid::SUBTITLE, Tid::COMPOSER, Tid::POET, Tid::INSTRUMENT_EXCERPT, Tid::TRANSLATOR, Tid::HEADER, Tid::FOOTER, Tid::USER1, Tid::USER2, Tid::USER3, Tid::USER4, Tid::USER5, Tid::USER6 } ) { s.style->addItem(textStyleUserName(ss), int(ss)); } mapSignals(il, ppList); }
InspectorBracket::InspectorBracket(QWidget* parent) : InspectorBase(parent) { b.setupUi(addWidget()); const std::vector<InspectorItem> il = { { Pid::BRACKET_COLUMN, 0, b.column, b.resetColumn } }; mapSignals(il); }
InspectorIname::InspectorIname(QWidget* parent) : InspectorTextBase(parent) { i.setupUi(addWidget()); const std::vector<InspectorItem> il = { { Pid::INAME_LAYOUT_POSITION, 0, i.layoutPosition, i.resetLayoutPosition } }; mapSignals(il); }
InspectorText::InspectorText(QWidget* parent) : InspectorElementBase(parent) { t.setupUi(addWidget()); iList.push_back({ P_ID::TEXT_STYLE_TYPE, 0, 0, t.style, t.resetStyle }); pList.push_back({ t.title, t.panel }); connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle())); mapSignals(); }
InspectorBreak::InspectorBreak(QWidget* parent) : InspectorBase(parent) { b.setupUi(addWidget()); iList = { // currently empty }; mapSignals(); }
InspectorSpacer::InspectorSpacer(QWidget* parent) : InspectorBase(parent) { sp.setupUi(addWidget()); iList = { { Pid::SPACE, 0, sp.height, 0 } }; mapSignals(); }
InspectorStem::InspectorStem(QWidget* parent) : InspectorElementBase(parent) { s.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::LINE_WIDTH, 0, s.lineWidth, s.resetLineWidth }, { Pid::USER_LEN, 0, s.userLength, s.resetUserLength }, }; mapSignals(iiList); }
InspectorBend::InspectorBend(QWidget* parent) : InspectorElementBase(parent) { g.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { P_ID::PLAY, 0, 0, g.playBend, g.resetPlayBend } }; const std::vector<InspectorPanel> ppList = { {g.title, g.panel} }; mapSignals(iiList, ppList); connect(g.properties, SIGNAL(clicked()), SLOT(propertiesClicked())); }
InspectorAccidental::InspectorAccidental(QWidget* parent) : InspectorElementBase(parent) { a.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { P_ID::SMALL, 0, 0, a.small, a.resetSmall }, { P_ID::ACCIDENTAL_BRACKET, 0, 0, a.hasBracket, a.resetHasBracket } }; const std::vector<InspectorPanel> ppList = { { a.title, a.panel } }; mapSignals(iiList, ppList); }
InspectorFermata::InspectorFermata(QWidget* parent) : InspectorElementBase(parent) { f.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::PLACEMENT, 0, f.placement, f.resetPlacement }, { Pid::TIME_STRETCH, 0, f.timeStretch, f.resetTimeStretch }, { Pid::PLAY, 0, f.playArticulation, f.resetPlayArticulation } }; const std::vector<InspectorPanel> ppList = { { f.title, f.panel } }; mapSignals(iiList, ppList); }
InspectorTuplet::InspectorTuplet(QWidget* parent) : InspectorElementBase(parent) { t.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { P_ID::DIRECTION, 0, 0, t.direction, t.resetDirection }, { P_ID::NUMBER_TYPE, 0, 0, t.numberType, t.resetNumberType }, { P_ID::BRACKET_TYPE, 0, 0, t.bracketType, t.resetBracketType } }; const std::vector<InspectorPanel> ppList = { {t.title, t.panel} }; mapSignals(iiList, ppList); }
InspectorHBox::InspectorHBox(QWidget* parent) : InspectorBase(parent) { hb.setupUi(addWidget()); iList = { { Pid::TOP_GAP, 0, hb.leftGap, hb.resetLeftGap }, { Pid::BOTTOM_GAP, 0, hb.rightGap, hb.resetRightGap }, { Pid::BOX_WIDTH, 0, hb.width, 0 }, { Pid::CREATE_SYSTEM_HEADER, 0, hb.createSystemHeader, hb.resetCreateSystemHeader } }; mapSignals(); }
InspectorArticulation::InspectorArticulation(QWidget* parent) : InspectorElementBase(parent) { ar.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::ARTICULATION_ANCHOR, 0, ar.anchor, ar.resetAnchor }, { Pid::DIRECTION, 0, ar.direction, ar.resetDirection }, { Pid::TIME_STRETCH, 0, ar.timeStretch, ar.resetTimeStretch }, { Pid::ORNAMENT_STYLE, 0, ar.ornamentStyle, ar.resetOrnamentStyle }, { Pid::PLAY, 0, ar.playArticulation, ar.resetPlayArticulation } }; const std::vector<InspectorPanel> ppList = { { ar.title, ar.panel } }; mapSignals(iiList, ppList); }
InspectorTBox::InspectorTBox(QWidget* parent) : InspectorBase(parent) { tb.setupUi(addWidget()); iList = { { Pid::TOP_GAP, 0, tb.topGap, tb.resetTopGap }, { Pid::BOTTOM_GAP, 0, tb.bottomGap, tb.resetBottomGap }, { Pid::LEFT_MARGIN, 0, tb.leftMargin, tb.resetLeftMargin }, { Pid::RIGHT_MARGIN, 0, tb.rightMargin, tb.resetRightMargin }, { Pid::TOP_MARGIN, 0, tb.topMargin, tb.resetTopMargin }, { Pid::BOTTOM_MARGIN, 0, tb.bottomMargin, tb.resetBottomMargin }, }; mapSignals(); }
InspectorLetRing::InspectorLetRing(QWidget* parent) : InspectorTextLineBase(parent) { lr.setupUi(addWidget()); const std::vector<InspectorItem> il = { { Pid::PLACEMENT, 0, lr.placement, lr.resetPlacement }, }; const std::vector<InspectorPanel> ppList = { { lr.title, lr.panel }, }; populatePlacement(lr.placement); mapSignals(il, ppList); }
InspectorLasso::InspectorLasso(QWidget* parent) : InspectorBase(parent) { b.setupUi(addWidget()); iList = { { P_ID::LASSO_POS, 0, b.pos, 0 }, { P_ID::LASSO_SIZE, 0, b.size, 0 }, }; b.pos->setSuffix(tr("mm")); b.size->setSuffix(tr("mm")); mapSignals(); }
InspectorTremoloBar::InspectorTremoloBar(QWidget* parent) : InspectorElementBase(parent) { g.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::PLAY, 0, g.play, g.resetPlay }, { Pid::LINE_WIDTH, 0, g.lineWidth, g.resetLineWidth }, { Pid::MAG, 0, g.mag, g.resetMag } }; const std::vector<InspectorPanel> ppList = { { g.title, g.panel } }; mapSignals(iiList, ppList); connect(g.properties, SIGNAL(clicked()), SLOT(propertiesClicked())); }
InspectorOttava::InspectorOttava(QWidget* parent) : InspectorBase(parent) { e.setupUi(addWidget()); o.setupUi(addWidget()); iList = { { P_COLOR, 0, 0, e.color, e.resetColor }, { P_VISIBLE, 0, 0, e.visible, e.resetVisible }, { P_USER_OFF, 0, 0, e.offsetX, e.resetX }, { P_USER_OFF, 1, 0, e.offsetY, e.resetY }, { P_OTTAVA_TYPE, 0, 0, o.ottavaType, o.resetOttavaType } }; mapSignals(); }
InspectorFret::InspectorFret(QWidget* parent) : InspectorBase(parent) { e.setupUi(addWidget()); f.setupUi(addWidget()); iList = { { P_ID::COLOR, 0, 0, e.color, e.resetColor }, { P_ID::VISIBLE, 0, 0, e.visible, e.resetVisible }, { P_ID::USER_OFF, 0, 0, e.offsetX, e.resetX }, { P_ID::USER_OFF, 1, 0, e.offsetY, e.resetY }, { P_ID::MAG, 0, 0, f.mag, f.resetMag }, }; mapSignals(); }
InspectorLyric::InspectorLyric(QWidget* parent) : InspectorTextBase(parent) { l.setupUi(addWidget()); const std::vector<InspectorItem> il = { { Pid::PLACEMENT, 0, l.placement, l.resetPlacement }, { Pid::VERSE, 0, l.verse, l.resetVerse } }; const std::vector<InspectorPanel> ppList = { { l.title, l.panel } }; populatePlacement(l.placement); mapSignals(il, ppList); connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle())); }
InspectorClef::InspectorClef(QWidget* parent) : InspectorElementBase(parent) { s.setupUi(addWidget()); c.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::LEADING_SPACE, 1, s.leadingSpace, s.resetLeadingSpace }, { Pid::SHOW_COURTESY, 0, c.showCourtesy, c.resetShowCourtesy } }; const std::vector<InspectorPanel> ppList = { { s.title, s.panel }, { c.title, c.panel } }; mapSignals(iiList, ppList); }
InspectorFingering::InspectorFingering(QWidget* parent) : InspectorTextBase(parent) { f.setupUi(addWidget()); const std::vector<InspectorItem> iiList = { { Pid::SUB_STYLE, 0, f.style, f.resetStyle }, }; const std::vector<InspectorPanel> ppList = { { f.title, f.panel } }; populateStyle(f.style); mapSignals(iiList, ppList); }