2012-05-26 14:49:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
2016-06-30 15:34:02 +02:00
|
|
|
// $Id: inspector.cpp
|
2012-05-26 14:49:10 +02:00
|
|
|
//
|
2016-06-30 15:34:02 +02:00
|
|
|
// Copyright (C) 2011-2016 Werner Schweer
|
2012-05-26 14:49:10 +02:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENSE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#include "inspector.h"
|
|
|
|
#include "inspectorBeam.h"
|
|
|
|
#include "inspectorImage.h"
|
2012-07-12 15:35:35 +02:00
|
|
|
#include "inspectorLasso.h"
|
2012-05-26 14:49:10 +02:00
|
|
|
#include "inspectorGroupElement.h"
|
2012-09-17 15:37:31 +02:00
|
|
|
#include "inspectorVolta.h"
|
2012-09-17 17:35:49 +02:00
|
|
|
#include "inspectorOttava.h"
|
2012-09-17 18:09:30 +02:00
|
|
|
#include "inspectorTrill.h"
|
2012-09-18 09:28:28 +02:00
|
|
|
#include "inspectorHairpin.h"
|
2013-05-02 16:12:17 +02:00
|
|
|
#include "inspectorTextLine.h"
|
2013-02-25 18:15:28 +01:00
|
|
|
#include "inspectorMarker.h"
|
|
|
|
#include "inspectorJump.h"
|
2013-02-28 15:06:54 +01:00
|
|
|
#include "inspectorGlissando.h"
|
2015-07-06 18:16:52 +02:00
|
|
|
#include "inspectorArpeggio.h"
|
2013-03-07 13:31:14 +01:00
|
|
|
#include "inspectorNote.h"
|
2013-11-25 12:17:12 +01:00
|
|
|
#include "inspectorAmbitus.h"
|
2015-01-15 14:50:50 +01:00
|
|
|
#include "inspectorFret.h"
|
2015-02-27 13:32:56 +01:00
|
|
|
#include "inspectorText.h"
|
2016-12-29 13:42:55 +01:00
|
|
|
#include "inspectorBarline.h"
|
2017-01-05 14:53:21 +01:00
|
|
|
#include "inspectorFingering.h"
|
2012-05-26 14:49:10 +02:00
|
|
|
#include "musescore.h"
|
2012-06-04 12:57:26 +02:00
|
|
|
#include "scoreview.h"
|
2015-11-04 13:22:17 +01:00
|
|
|
#include "bendproperties.h"
|
2012-06-04 12:57:26 +02:00
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
#include "libmscore/element.h"
|
|
|
|
#include "libmscore/score.h"
|
|
|
|
#include "libmscore/box.h"
|
|
|
|
#include "libmscore/undo.h"
|
|
|
|
#include "libmscore/spacer.h"
|
|
|
|
#include "libmscore/note.h"
|
|
|
|
#include "libmscore/chord.h"
|
|
|
|
#include "libmscore/segment.h"
|
|
|
|
#include "libmscore/rest.h"
|
|
|
|
#include "libmscore/beam.h"
|
|
|
|
#include "libmscore/clef.h"
|
|
|
|
#include "libmscore/notedot.h"
|
|
|
|
#include "libmscore/hook.h"
|
|
|
|
#include "libmscore/stem.h"
|
2012-07-27 18:35:37 +02:00
|
|
|
#include "libmscore/keysig.h"
|
2012-11-18 00:28:38 +01:00
|
|
|
#include "libmscore/barline.h"
|
|
|
|
#include "libmscore/staff.h"
|
|
|
|
#include "libmscore/measure.h"
|
2014-09-28 13:15:45 +02:00
|
|
|
#include "libmscore/tuplet.h"
|
2015-11-04 13:22:17 +01:00
|
|
|
#include "libmscore/bend.h"
|
|
|
|
#include "libmscore/tremolobar.h"
|
2016-03-26 15:16:31 +01:00
|
|
|
#include "libmscore/slur.h"
|
2016-06-26 13:52:33 +02:00
|
|
|
#include "libmscore/breath.h"
|
2016-08-24 18:08:53 +02:00
|
|
|
#include "libmscore/lyrics.h"
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// showInspector
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void MuseScore::showInspector(bool visible)
|
|
|
|
{
|
|
|
|
QAction* a = getAction("inspector");
|
2014-08-29 19:18:39 +02:00
|
|
|
if (!_inspector) {
|
|
|
|
_inspector = new Inspector();
|
|
|
|
connect(_inspector, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool)));
|
|
|
|
addDockWidget(Qt::RightDockWidgetArea, _inspector);
|
2013-04-30 23:55:32 +02:00
|
|
|
}
|
2014-08-29 19:18:39 +02:00
|
|
|
if (_inspector)
|
|
|
|
_inspector->setVisible(visible);
|
2016-03-10 00:02:51 +01:00
|
|
|
if (visible)
|
|
|
|
updateInspector();
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// Inspector
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
Inspector::Inspector(QWidget* parent)
|
2016-06-30 15:34:02 +02:00
|
|
|
: QDockWidget(parent)
|
2012-05-26 14:49:10 +02:00
|
|
|
{
|
|
|
|
setObjectName("inspector");
|
2013-05-13 18:49:17 +02:00
|
|
|
setAllowedAreas(Qt::DockWidgetAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea));
|
2013-03-07 13:31:14 +01:00
|
|
|
sa = new QScrollArea;
|
2013-09-16 16:33:48 +02:00
|
|
|
sa->setFrameShape(QFrame::NoFrame);
|
2016-10-18 15:41:00 +02:00
|
|
|
sa->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
2013-03-11 11:36:29 +01:00
|
|
|
sa->setWidgetResizable(true);
|
2016-10-18 15:41:00 +02:00
|
|
|
|
|
|
|
// setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
|
|
|
|
// sa->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
|
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
setWidget(sa);
|
2014-06-10 23:41:30 +02:00
|
|
|
sa->setFocusPolicy(Qt::NoFocus);
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2013-01-22 12:02:22 +01:00
|
|
|
_inspectorEdit = false;
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = 0;
|
|
|
|
_element = 0;
|
2016-06-30 15:34:02 +02:00
|
|
|
retranslate();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// retranslate
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Inspector::retranslate()
|
|
|
|
{
|
|
|
|
setWindowTitle(tr("Inspector"));
|
|
|
|
sa->setAccessibleName(tr("Inspector Subwindow"));
|
|
|
|
QList<Element*> el = _el;
|
|
|
|
setElements(QList<Element*>());
|
|
|
|
setElements(el);
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// reset
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Inspector::reset()
|
|
|
|
{
|
2013-03-06 18:08:22 +01:00
|
|
|
if (ie)
|
|
|
|
ie->setElement();
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// setElement
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Inspector::setElement(Element* e)
|
|
|
|
{
|
2013-03-06 18:08:22 +01:00
|
|
|
QList<Element*> el;
|
|
|
|
if (e)
|
|
|
|
el.append(e);
|
|
|
|
setElements(el);
|
|
|
|
}
|
2013-02-25 18:15:28 +01:00
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// setElements
|
|
|
|
//---------------------------------------------------------
|
2013-01-22 12:02:22 +01:00
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
void Inspector::setElements(const QList<Element*>& l)
|
|
|
|
{
|
2013-03-13 12:19:27 +01:00
|
|
|
if (_inspectorEdit) // if within an inspector-originated edit
|
|
|
|
return;
|
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
Element* e = l.isEmpty() ? 0 : l[0];
|
|
|
|
if (e == 0 || _element == 0 || (_el != l)) {
|
|
|
|
_el = l;
|
2012-05-26 14:49:10 +02:00
|
|
|
ie = 0;
|
|
|
|
_element = e;
|
|
|
|
|
|
|
|
if (_element == 0)
|
2013-08-02 10:47:20 +02:00
|
|
|
ie = new InspectorEmpty(this);
|
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
bool sameTypes = true;
|
2016-06-06 15:04:03 +02:00
|
|
|
for (Element* ee : _el) {
|
2017-01-03 18:22:28 +01:00
|
|
|
if (((_element->type() != ee->type()) && // different and
|
|
|
|
(!_element->isSlurTieSegment() || !ee->isSlurTieSegment())) || // neither Slur nor Tie either side, or
|
|
|
|
(ee->isNote() && toNote(ee)->chord()->isGrace() != toNote(_element)->chord()->isGrace())) // HACK
|
2013-03-06 18:08:22 +01:00
|
|
|
sameTypes = false;
|
|
|
|
}
|
|
|
|
if (!sameTypes)
|
|
|
|
ie = new InspectorGroupElement(this);
|
2013-08-02 10:47:20 +02:00
|
|
|
else if (_element) {
|
2013-03-06 18:08:22 +01:00
|
|
|
switch(_element->type()) {
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::FBOX:
|
|
|
|
case ElementType::VBOX:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorVBox(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TBOX:
|
2015-06-17 14:19:47 +02:00
|
|
|
ie = new InspectorTBox(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::HBOX:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorHBox(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::ARTICULATION:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorArticulation(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::SPACER:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorSpacer(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::NOTE:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorNote(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::ACCIDENTAL:
|
2013-03-12 11:18:25 +01:00
|
|
|
ie = new InspectorAccidental(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::REST:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorRest(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::CLEF:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorClef(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TIMESIG:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorTimeSig(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::KEYSIG:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorKeySig(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TUPLET:
|
2013-03-11 14:15:42 +01:00
|
|
|
ie = new InspectorTuplet(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::BEAM:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorBeam(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::IMAGE:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorImage(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::LASSO:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorLasso(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::VOLTA_SEGMENT:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorVolta(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::OTTAVA_SEGMENT:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorOttava(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TRILL_SEGMENT:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorTrill(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::HAIRPIN_SEGMENT:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorHairpin(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TEXTLINE_SEGMENT:
|
|
|
|
case ElementType::PEDAL_SEGMENT:
|
2013-05-02 16:12:17 +02:00
|
|
|
ie = new InspectorTextLine(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::SLUR_SEGMENT:
|
|
|
|
case ElementType::TIE_SEGMENT:
|
2016-11-17 09:46:58 +01:00
|
|
|
ie = new InspectorSlurTie(this);
|
2013-07-01 16:57:44 +02:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::BAR_LINE:
|
2016-12-30 10:58:53 +01:00
|
|
|
ie = new InspectorBarLine(this);
|
2013-03-06 18:08:22 +01:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::JUMP:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorJump(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::MARKER:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorMarker(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::GLISSANDO:
|
|
|
|
case ElementType::GLISSANDO_SEGMENT:
|
2013-03-06 18:08:22 +01:00
|
|
|
ie = new InspectorGlissando(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TEMPO_TEXT:
|
2013-03-27 13:56:46 +01:00
|
|
|
ie = new InspectorTempoText(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::DYNAMIC:
|
2013-03-27 13:56:46 +01:00
|
|
|
ie = new InspectorDynamic(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::AMBITUS:
|
2013-11-25 12:17:12 +01:00
|
|
|
ie = new InspectorAmbitus(this);
|
2013-10-29 23:41:38 +01:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::FRET_DIAGRAM:
|
2015-11-02 11:20:40 +01:00
|
|
|
ie = new InspectorFretDiagram(this);
|
2015-01-15 14:50:50 +01:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::LAYOUT_BREAK:
|
2015-02-25 10:48:39 +01:00
|
|
|
ie = new InspectorBreak(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::BEND:
|
2015-06-15 17:02:35 +02:00
|
|
|
ie = new InspectorBend(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::TREMOLOBAR:
|
2015-11-04 13:22:17 +01:00
|
|
|
ie = new InspectorTremoloBar(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::ARPEGGIO:
|
2015-07-06 18:16:52 +02:00
|
|
|
ie = new InspectorArpeggio(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::BREATH:
|
2016-05-25 19:19:29 +02:00
|
|
|
ie = new InspectorCaesura(this);
|
2016-03-27 14:41:33 +02:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::LYRICS:
|
2016-08-24 14:49:34 +02:00
|
|
|
ie = new InspectorLyric(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::STAFF_TEXT:
|
2017-01-16 20:51:12 +01:00
|
|
|
ie = new InspectorStaffText(this);
|
2016-08-25 17:34:25 +02:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::STAFFTYPE_CHANGE:
|
2016-12-18 14:31:13 +01:00
|
|
|
ie = new InspectorStaffTypeChange(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::BRACKET:
|
2016-12-29 19:46:40 +01:00
|
|
|
ie = new InspectorBracket(this);
|
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::INSTRUMENT_NAME:
|
2016-12-30 10:58:53 +01:00
|
|
|
ie = new InspectorIname(this);
|
2016-12-29 19:46:40 +01:00
|
|
|
break;
|
2017-01-18 14:16:33 +01:00
|
|
|
case ElementType::FINGERING:
|
2017-01-05 14:53:21 +01:00
|
|
|
ie = new InspectorFingering(this);
|
|
|
|
break;
|
2013-03-06 18:08:22 +01:00
|
|
|
default:
|
2016-12-29 19:46:40 +01:00
|
|
|
if (_element->isText())
|
|
|
|
ie = new InspectorText(this);
|
|
|
|
else
|
|
|
|
ie = new InspectorElement(this);
|
2013-03-06 18:08:22 +01:00
|
|
|
break;
|
|
|
|
}
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
2014-08-12 09:26:17 +02:00
|
|
|
QWidget* ww = sa->takeWidget();
|
|
|
|
if (ww)
|
|
|
|
ww->deleteLater();
|
2013-03-07 13:31:14 +01:00
|
|
|
sa->setWidget(ie);
|
2014-06-15 15:08:14 +02:00
|
|
|
|
2014-05-29 21:28:20 +02:00
|
|
|
//focus policies were set by hand in each inspector_*.ui. this code just helps keeping them like they are
|
|
|
|
//also fixes mac problem. on Mac Qt::TabFocus doesn't work, but Qt::StrongFocus works
|
2014-06-15 15:08:14 +02:00
|
|
|
QList<QWidget*> widgets = ie->findChildren<QWidget*>();
|
2014-08-12 10:48:58 +02:00
|
|
|
for (int i = 0; i < widgets.size(); i++) {
|
2014-06-06 14:17:19 +02:00
|
|
|
QWidget* currentWidget = widgets.at(i);
|
2014-08-12 10:48:58 +02:00
|
|
|
switch (currentWidget->focusPolicy()) {
|
2014-06-06 14:17:19 +02:00
|
|
|
case Qt::WheelFocus:
|
|
|
|
case Qt::StrongFocus:
|
2014-12-04 22:20:22 +01:00
|
|
|
if (currentWidget->inherits("QComboBox") ||
|
|
|
|
currentWidget->parent()->inherits("QAbstractSpinBox") ||
|
2014-05-29 21:28:20 +02:00
|
|
|
currentWidget->inherits("QAbstractSpinBox") ||
|
|
|
|
currentWidget->inherits("QLineEdit")) ; //leave it like it is
|
|
|
|
else
|
|
|
|
currentWidget->setFocusPolicy(Qt::TabFocus);
|
2014-06-10 23:41:30 +02:00
|
|
|
break;
|
2014-06-06 14:17:19 +02:00
|
|
|
case Qt::NoFocus:
|
2014-05-29 21:28:20 +02:00
|
|
|
case Qt::ClickFocus:
|
|
|
|
currentWidget->setFocusPolicy(Qt::NoFocus);
|
2014-06-06 14:17:19 +02:00
|
|
|
break;
|
2014-12-04 22:20:22 +01:00
|
|
|
case Qt::TabFocus:
|
|
|
|
break;
|
2014-06-06 14:17:19 +02:00
|
|
|
}
|
|
|
|
}
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
_element = e;
|
2013-03-06 18:08:22 +01:00
|
|
|
ie->setElement();
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
2016-06-30 15:34:02 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// changeEvent
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void Inspector::changeEvent(QEvent *event)
|
|
|
|
{
|
|
|
|
QDockWidget::changeEvent(event);
|
|
|
|
if (event->type() == QEvent::LanguageChange)
|
|
|
|
retranslate();
|
|
|
|
}
|
|
|
|
|
2013-07-22 16:21:19 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// setupUi
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-01-16 20:51:12 +01:00
|
|
|
void UiInspectorElement::setupUi(QWidget* inspectorElement)
|
2013-06-28 19:41:54 +02:00
|
|
|
{
|
2017-01-16 20:51:12 +01:00
|
|
|
Ui::InspectorElement::setupUi(inspectorElement);
|
2013-06-28 19:41:54 +02:00
|
|
|
|
|
|
|
QAction* a = getAction("hraster");
|
|
|
|
a->setCheckable(true);
|
|
|
|
hRaster->setDefaultAction(a);
|
|
|
|
hRaster->setContextMenuPolicy(Qt::ActionsContextMenu);
|
|
|
|
hRaster->addAction(getAction("config-raster"));
|
|
|
|
|
|
|
|
a = getAction("vraster");
|
|
|
|
a->setCheckable(true);
|
|
|
|
vRaster->setDefaultAction(a);
|
|
|
|
vRaster->setContextMenuPolicy(Qt::ActionsContextMenu);
|
|
|
|
vRaster->addAction(getAction("config-raster"));
|
2013-07-22 16:21:19 +02:00
|
|
|
}
|
2013-06-28 19:41:54 +02:00
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
//---------------------------------------------------------
|
2016-06-03 18:49:46 +02:00
|
|
|
// InspectorElementBase
|
2012-05-26 14:49:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-06-03 18:49:46 +02:00
|
|
|
InspectorElementBase::InspectorElementBase(QWidget* parent)
|
2012-05-26 14:49:10 +02:00
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
2016-06-03 18:49:46 +02:00
|
|
|
e.setupUi(addWidget());
|
2013-03-06 18:08:22 +01:00
|
|
|
iList = {
|
2016-06-03 18:49:46 +02:00
|
|
|
{ P_ID::VISIBLE, 0, 0, e.visible, e.resetVisible },
|
2016-08-07 11:04:14 +02:00
|
|
|
{ P_ID::Z, 0, 0, e.z, e.resetZ },
|
|
|
|
{ P_ID::COLOR, 0, 0, e.color, e.resetColor },
|
2016-06-03 18:49:46 +02:00
|
|
|
{ P_ID::USER_OFF, 0, 0, e.offsetX, e.resetX },
|
|
|
|
{ P_ID::USER_OFF, 1, 0, e.offsetY, e.resetY },
|
|
|
|
{ P_ID::AUTOPLACE, 0, 0, e.autoplace, e.resetAutoplace },
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
pList = { { e.title, e.panel } };
|
2016-06-13 17:39:10 +02:00
|
|
|
connect(e.resetAutoplace, SIGNAL(clicked()), SLOT(resetAutoplace()));
|
|
|
|
connect(e.autoplace, SIGNAL(toggled(bool)), SLOT(autoplaceChanged(bool)));
|
2016-06-03 18:49:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// setElement
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorElementBase::setElement()
|
|
|
|
{
|
|
|
|
InspectorBase::setElement();
|
2016-06-13 17:39:10 +02:00
|
|
|
autoplaceChanged(inspector->element()->autoplace());
|
2016-06-03 18:49:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// autoplaceChanged
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorElementBase::autoplaceChanged(bool val)
|
|
|
|
{
|
2016-06-13 17:39:10 +02:00
|
|
|
for (auto i : std::vector<QWidget*> { e.offsetX, e.offsetY, e.resetX, e.resetY, e.hRaster, e.vRaster })
|
|
|
|
i->setEnabled(!val);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// resetAutoplace
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorElementBase::resetAutoplace()
|
|
|
|
{
|
|
|
|
autoplaceChanged(true);
|
2016-06-03 18:49:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorElement
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorElement::InspectorElement(QWidget* parent)
|
|
|
|
: InspectorElementBase(parent)
|
|
|
|
{
|
2013-03-06 18:08:22 +01:00
|
|
|
mapSignals();
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
2015-02-25 10:48:39 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorBreak
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorBreak::InspectorBreak(QWidget* parent)
|
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
|
|
|
b.setupUi(addWidget());
|
|
|
|
|
|
|
|
iList = { // currently empty
|
|
|
|
};
|
|
|
|
|
|
|
|
mapSignals();
|
|
|
|
}
|
|
|
|
|
2016-12-18 14:31:13 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorStaffTypeChange
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorStaffTypeChange::InspectorStaffTypeChange(QWidget* parent)
|
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
|
|
|
sl.setupUi(addWidget());
|
|
|
|
|
|
|
|
iList = {
|
2016-12-23 12:05:18 +01:00
|
|
|
{ P_ID::STAFF_YOFFSET, 0, 0, sl.yoffset, sl.resetYoffset },
|
|
|
|
{ P_ID::SMALL, 0, 0, sl.small, sl.resetSmall },
|
|
|
|
{ P_ID::MAG, 0, 0, sl.scale, sl.resetScale },
|
2016-12-18 14:31:13 +01:00
|
|
|
{ P_ID::STAFF_LINES, 0, 0, sl.lines, sl.resetLines },
|
|
|
|
{ P_ID::STEP_OFFSET, 0, 0, sl.stepOffset, sl.resetStepOffset },
|
|
|
|
{ P_ID::LINE_DISTANCE, 0, 0, sl.lineDistance, sl.resetLineDistance },
|
|
|
|
{ P_ID::STAFF_SHOW_BARLINES, 0, 0, sl.showBarlines, sl.resetShowBarlines },
|
|
|
|
{ P_ID::STAFF_SHOW_LEDGERLINES, 0, 0, sl.showLedgerlines, sl.resetShowLedgerlines },
|
|
|
|
{ P_ID::STAFF_SLASH_STYLE, 0, 0, sl.slashStyle, sl.resetSlashStyle },
|
|
|
|
{ P_ID::STAFF_NOTEHEAD_SCHEME, 0, 0, sl.noteheadScheme, sl.resetNoteheadScheme },
|
|
|
|
{ P_ID::STAFF_GEN_CLEF, 0, 0, sl.genClefs, sl.resetGenClefs },
|
|
|
|
{ P_ID::STAFF_GEN_TIMESIG, 0, 0, sl.genTimesig, sl.resetGenTimesig },
|
|
|
|
{ P_ID::STAFF_GEN_KEYSIG, 0, 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();
|
|
|
|
}
|
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorVBox
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorVBox::InspectorVBox(QWidget* parent)
|
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
vb.setupUi(addWidget());
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
iList = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ P_ID::TOP_GAP, 0, 0, vb.topGap, vb.resetTopGap },
|
|
|
|
{ P_ID::BOTTOM_GAP, 0, 0, vb.bottomGap, vb.resetBottomGap },
|
|
|
|
{ P_ID::LEFT_MARGIN, 0, 0, vb.leftMargin, vb.resetLeftMargin },
|
|
|
|
{ P_ID::RIGHT_MARGIN, 0, 0, vb.rightMargin, vb.resetRightMargin },
|
|
|
|
{ P_ID::TOP_MARGIN, 0, 0, vb.topMargin, vb.resetTopMargin },
|
|
|
|
{ P_ID::BOTTOM_MARGIN, 0, 0, vb.bottomMargin, vb.resetBottomMargin },
|
2016-12-01 10:49:03 +01:00
|
|
|
{ P_ID::BOX_HEIGHT, 0, 0, vb.height, 0 }
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
2012-05-26 14:49:10 +02:00
|
|
|
mapSignals();
|
|
|
|
}
|
|
|
|
|
2015-06-17 14:19:47 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorTBox
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorTBox::InspectorTBox(QWidget* parent)
|
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
|
|
|
tb.setupUi(addWidget());
|
|
|
|
|
|
|
|
iList = {
|
|
|
|
{ P_ID::TOP_GAP, 0, 0, tb.topGap, tb.resetTopGap },
|
|
|
|
{ P_ID::BOTTOM_GAP, 0, 0, tb.bottomGap, tb.resetBottomGap },
|
|
|
|
{ P_ID::LEFT_MARGIN, 0, 0, tb.leftMargin, tb.resetLeftMargin },
|
|
|
|
{ P_ID::RIGHT_MARGIN, 0, 0, tb.rightMargin, tb.resetRightMargin },
|
|
|
|
{ P_ID::TOP_MARGIN, 0, 0, tb.topMargin, tb.resetTopMargin },
|
|
|
|
{ P_ID::BOTTOM_MARGIN, 0, 0, tb.bottomMargin, tb.resetBottomMargin },
|
|
|
|
};
|
|
|
|
mapSignals();
|
|
|
|
}
|
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorHBox
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorHBox::InspectorHBox(QWidget* parent)
|
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
hb.setupUi(addWidget());
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
iList = {
|
2016-12-12 10:31:37 +01:00
|
|
|
{ P_ID::TOP_GAP, 0, 0, hb.leftGap, hb.resetLeftGap },
|
|
|
|
{ P_ID::BOTTOM_GAP, 0, 0, hb.rightGap, hb.resetRightGap },
|
|
|
|
{ P_ID::BOX_WIDTH, 0, 0, hb.width, 0 },
|
|
|
|
{ P_ID::CREATE_SYSTEM_HEADER, 0, 0, hb.createSystemHeader, hb.resetCreateSystemHeader }
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
2012-05-26 14:49:10 +02:00
|
|
|
|
|
|
|
mapSignals();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorArticulation
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorArticulation::InspectorArticulation(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2012-05-26 14:49:10 +02:00
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
ar.setupUi(addWidget());
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2016-12-06 13:40:28 +01:00
|
|
|
{ P_ID::ARTICULATION_ANCHOR, 0, 0, ar.anchor, ar.resetAnchor },
|
|
|
|
{ P_ID::DIRECTION, 0, 0, ar.direction, ar.resetDirection },
|
|
|
|
{ P_ID::TIME_STRETCH, 0, 0, ar.timeStretch, ar.resetTimeStretch },
|
|
|
|
{ P_ID::ORNAMENT_STYLE, 0, 0, ar.ornamentStyle, ar.resetOrnamentStyle },
|
|
|
|
{ P_ID::PLAY, 0, 0, ar.playArticulation, ar.resetPlayArticulation }
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { { ar.title, ar.panel } };
|
|
|
|
mapSignals(iiList, ppList);
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorSpacer
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorSpacer::InspectorSpacer(QWidget* parent)
|
|
|
|
: InspectorBase(parent)
|
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
sp.setupUi(addWidget());
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2013-03-06 18:08:22 +01:00
|
|
|
iList = {
|
2016-12-06 13:40:28 +01:00
|
|
|
{ P_ID::SPACE, 0, false, sp.height, 0 }
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
|
|
|
mapSignals();
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorRest
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorRest::InspectorRest(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2012-05-26 14:49:10 +02:00
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
s.setupUi(addWidget());
|
|
|
|
r.setupUi(addWidget());
|
2013-03-06 18:08:22 +01:00
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ P_ID::LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace },
|
2016-09-20 12:26:24 +02:00
|
|
|
{ P_ID::SMALL, 0, 0, r.small, r.resetSmall },
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ s.title, s.panel },
|
|
|
|
{ r.title, r.panel }
|
|
|
|
};
|
|
|
|
mapSignals(iiList, ppList);
|
2014-09-28 13:15:45 +02:00
|
|
|
|
|
|
|
//
|
|
|
|
// 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;
|
|
|
|
tuplet = new QToolButton(this);
|
|
|
|
tuplet->setText(tr("Tuplet"));
|
|
|
|
tuplet->setEnabled(false);
|
|
|
|
hbox->addWidget(tuplet);
|
|
|
|
_layout->addLayout(hbox);
|
|
|
|
|
2015-01-05 10:20:20 +01:00
|
|
|
e.offsetY->setSingleStep(1.0); // step in spatium units
|
|
|
|
|
2014-09-28 13:15:45 +02:00
|
|
|
connect(tuplet, SIGNAL(clicked()), SLOT(tupletClicked()));
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// setElement
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorRest::setElement()
|
|
|
|
{
|
2016-06-09 09:26:13 +02:00
|
|
|
Rest* rest = toRest(inspector->element());
|
2014-09-28 13:15:45 +02:00
|
|
|
tuplet->setEnabled(rest->tuplet());
|
2016-09-20 12:26:24 +02:00
|
|
|
InspectorElementBase::setElement();
|
2014-09-28 13:15:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// tupletClicked
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorRest::tupletClicked()
|
|
|
|
{
|
2016-06-09 09:26:13 +02:00
|
|
|
Rest* rest = toRest(inspector->element());
|
2014-09-28 13:15:45 +02:00
|
|
|
if (rest == 0)
|
|
|
|
return;
|
|
|
|
Tuplet* tuplet = rest->tuplet();
|
|
|
|
if (tuplet) {
|
|
|
|
rest->score()->select(tuplet);
|
|
|
|
inspector->setElement(tuplet);
|
2016-04-18 18:11:51 +02:00
|
|
|
rest->score()->update();
|
2014-09-28 13:15:45 +02:00
|
|
|
}
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
|
|
|
|
2012-07-27 18:01:15 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorTimeSig
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorTimeSig::InspectorTimeSig(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2012-07-27 18:01:15 +02:00
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
s.setupUi(addWidget());
|
|
|
|
t.setupUi(addWidget());
|
2012-07-27 18:01:15 +02:00
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ P_ID::LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace },
|
|
|
|
{ P_ID::SHOW_COURTESY, 0, 0, t.showCourtesy, t.resetShowCourtesy },
|
|
|
|
// { P_ID::TIMESIG, 0, 0, t.timesigZ, t.resetTimesig },
|
|
|
|
// { P_ID::TIMESIG, 1, 0, t.timesigN, t.resetTimesig },
|
|
|
|
// { P_ID::TIMESIG_GLOBAL, 0, 0, t.globalTimesigZ, t.resetGlobalTimesig },
|
|
|
|
// { P_ID::TIMESIG_GLOBAL, 1, 0, t.globalTimesigN, t.resetGlobalTimesig }
|
2013-03-06 20:45:10 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ s.title, s.panel },
|
|
|
|
{ t.title, t.panel }
|
|
|
|
};
|
|
|
|
mapSignals(iiList, ppList);
|
2012-07-27 18:01:15 +02:00
|
|
|
}
|
|
|
|
|
2014-12-30 21:55:19 +01:00
|
|
|
// InspectorTimeSig::setElement
|
|
|
|
|
|
|
|
void InspectorTimeSig::setElement()
|
|
|
|
{
|
2016-09-20 12:26:24 +02:00
|
|
|
InspectorElementBase::setElement();
|
2016-06-09 09:26:13 +02:00
|
|
|
TimeSig* ts = toTimeSig(inspector->element());
|
2014-12-30 21:55:19 +01:00
|
|
|
if (ts->generated())
|
|
|
|
t.showCourtesy->setEnabled(false);
|
|
|
|
}
|
|
|
|
|
2012-07-27 18:35:37 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorKeySig
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorKeySig::InspectorKeySig(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2012-07-27 18:35:37 +02:00
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
s.setupUi(addWidget());
|
|
|
|
k.setupUi(addWidget());
|
2012-07-27 18:35:37 +02:00
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ P_ID::LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace },
|
|
|
|
{ P_ID::SHOW_COURTESY, 0, 0, k.showCourtesy, k.resetShowCourtesy },
|
|
|
|
// { P_ID::SHOW_NATURALS, 0, 0, k.showNaturals, k.resetShowNaturals }
|
2013-03-06 20:45:10 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ s.title, s.panel },
|
|
|
|
{ k.title, k.panel }
|
|
|
|
};
|
|
|
|
mapSignals(iiList, ppList);
|
2012-07-27 18:35:37 +02:00
|
|
|
}
|
|
|
|
|
2014-12-30 21:55:19 +01:00
|
|
|
// InspectorKeySig::setElement
|
|
|
|
|
|
|
|
void InspectorKeySig::setElement()
|
|
|
|
{
|
2016-09-20 12:26:24 +02:00
|
|
|
InspectorElementBase::setElement();
|
2016-06-09 09:26:13 +02:00
|
|
|
KeySig* ks = toKeySig(inspector->element());
|
2014-12-30 21:55:19 +01:00
|
|
|
if (ks->generated())
|
|
|
|
k.showCourtesy->setEnabled(false);
|
|
|
|
}
|
|
|
|
|
2013-03-11 14:15:42 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorTuplet
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorTuplet::InspectorTuplet(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2013-03-11 14:15:42 +01:00
|
|
|
{
|
|
|
|
t.setupUi(addWidget());
|
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ 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 }
|
2013-03-11 14:15:42 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { {t.title, t.panel} };
|
2016-07-08 19:33:17 +02:00
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
mapSignals(iiList, ppList);
|
2013-03-11 14:15:42 +01:00
|
|
|
}
|
|
|
|
|
2013-03-12 11:18:25 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorAccidental
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorAccidental::InspectorAccidental(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2013-03-12 11:18:25 +01:00
|
|
|
{
|
|
|
|
a.setupUi(addWidget());
|
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2016-05-20 13:51:40 +02:00
|
|
|
{ P_ID::SMALL, 0, 0, a.small, a.resetSmall },
|
|
|
|
{ P_ID::ACCIDENTAL_BRACKET, 0, 0, a.hasBracket, a.resetHasBracket }
|
2013-03-12 11:18:25 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { { a.title, a.panel } };
|
|
|
|
mapSignals(iiList, ppList);
|
2013-03-12 11:18:25 +01:00
|
|
|
}
|
|
|
|
|
2015-06-15 17:02:35 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorBend
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorBend::InspectorBend(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2015-06-15 17:02:35 +02:00
|
|
|
{
|
|
|
|
g.setupUi(addWidget());
|
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2015-07-07 20:33:31 +02:00
|
|
|
{ P_ID::PLAY, 0, 0, g.playBend, g.resetPlayBend }
|
2015-06-15 17:02:35 +02:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { {g.title, g.panel} };
|
|
|
|
mapSignals(iiList, ppList);
|
2015-11-04 13:22:17 +01:00
|
|
|
connect(g.properties, SIGNAL(clicked()), SLOT(propertiesClicked()));
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// propertiesClicked
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorBend::propertiesClicked()
|
|
|
|
{
|
2016-06-09 09:26:13 +02:00
|
|
|
Bend* b = toBend(inspector->element());
|
2015-11-04 13:22:17 +01:00
|
|
|
Score* score = b->score();
|
|
|
|
score->startCmd();
|
|
|
|
mscore->currentScoreView()->editBendProperties(b);
|
2016-03-02 13:20:19 +01:00
|
|
|
score->setLayoutAll();
|
2015-11-04 13:22:17 +01:00
|
|
|
score->endCmd();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorTremoloBar
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorTremoloBar::InspectorTremoloBar(QWidget* parent)
|
2016-09-20 14:44:43 +02:00
|
|
|
: InspectorElementBase(parent)
|
2015-11-04 13:22:17 +01:00
|
|
|
{
|
|
|
|
g.setupUi(addWidget());
|
|
|
|
|
2016-09-20 14:44:43 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2016-09-20 17:13:54 +02:00
|
|
|
{ P_ID::PLAY, 0, 0, g.play, g.resetPlay },
|
|
|
|
{ P_ID::LINE_WIDTH, 0, 0, g.lineWidth, g.resetLineWidth },
|
2015-11-04 13:22:17 +01:00
|
|
|
{ P_ID::MAG, 0, 0, g.mag, g.resetMag }
|
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { { g.title, g.panel } };
|
2015-11-04 13:22:17 +01:00
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
mapSignals(iiList, ppList);
|
2015-11-04 13:22:17 +01:00
|
|
|
connect(g.properties, SIGNAL(clicked()), SLOT(propertiesClicked()));
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// propertiesClicked
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorTremoloBar::propertiesClicked()
|
|
|
|
{
|
2016-09-20 14:44:43 +02:00
|
|
|
TremoloBar* b = toTremoloBar(inspector->element());
|
2015-11-04 13:22:17 +01:00
|
|
|
Score* score = b->score();
|
|
|
|
score->startCmd();
|
2016-09-20 14:44:43 +02:00
|
|
|
mscore->currentScoreView()->editTremoloBarProperties(b);
|
2016-03-02 13:20:19 +01:00
|
|
|
score->setLayoutAll();
|
2015-11-04 13:22:17 +01:00
|
|
|
score->endCmd();
|
2015-06-15 17:02:35 +02:00
|
|
|
}
|
|
|
|
|
2012-05-26 14:49:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorClef
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorClef::InspectorClef(QWidget* parent)
|
2016-09-20 12:26:24 +02:00
|
|
|
: InspectorElementBase(parent)
|
2012-05-26 14:49:10 +02:00
|
|
|
{
|
2013-03-07 20:01:22 +01:00
|
|
|
s.setupUi(addWidget());
|
|
|
|
c.setupUi(addWidget());
|
2013-03-06 18:08:22 +01:00
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
const std::vector<InspectorItem> iiList = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ P_ID::LEADING_SPACE, 0, 1, s.leadingSpace, s.resetLeadingSpace },
|
|
|
|
{ P_ID::SHOW_COURTESY, 0, 0, c.showCourtesy, c.resetShowCourtesy }
|
2013-03-06 18:08:22 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ s.title, s.panel },
|
|
|
|
{ c.title, c.panel }
|
|
|
|
};
|
|
|
|
mapSignals(iiList, ppList);
|
2012-05-26 14:49:10 +02:00
|
|
|
}
|
2013-12-24 20:11:51 +01:00
|
|
|
|
2016-09-20 12:26:24 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// setElement
|
|
|
|
//---------------------------------------------------------
|
2013-12-24 20:11:51 +01:00
|
|
|
|
|
|
|
void InspectorClef::setElement()
|
|
|
|
{
|
|
|
|
otherClef = nullptr; // no 'other clef' yet
|
2016-09-20 12:26:24 +02:00
|
|
|
InspectorElementBase::setElement();
|
2013-12-24 20:11:51 +01:00
|
|
|
|
|
|
|
// try to locate the 'other clef' of a courtesy / main pair
|
2016-06-09 09:26:13 +02:00
|
|
|
Clef* clef = toClef(inspector->element());
|
2013-12-24 20:11:51 +01:00
|
|
|
// if not in a clef-segment-measure hierachy, do nothing
|
2017-01-18 14:16:33 +01:00
|
|
|
if (!clef->parent() || clef->parent()->type() != ElementType::SEGMENT)
|
2013-12-24 20:11:51 +01:00
|
|
|
return;
|
2016-06-09 09:26:13 +02:00
|
|
|
Segment* segm = toSegment(clef->parent());
|
2013-12-24 20:11:51 +01:00
|
|
|
int segmTick = segm->tick();
|
2017-01-18 14:16:33 +01:00
|
|
|
if (!segm->parent() || segm->parent()->type() != ElementType::MEASURE)
|
2013-12-24 20:11:51 +01:00
|
|
|
return;
|
|
|
|
|
2016-06-09 09:26:13 +02:00
|
|
|
Measure* meas = toMeasure(segm->parent());
|
2013-12-24 20:11:51 +01:00
|
|
|
Measure* otherMeas = nullptr;
|
|
|
|
Segment* otherSegm = nullptr;
|
|
|
|
if (segmTick == meas->tick()) // if clef segm is measure-initial
|
|
|
|
otherMeas = meas->prevMeasure(); // look for a previous measure
|
|
|
|
else if (segmTick == meas->tick()+meas->ticks()) // if clef segm is measure-final
|
|
|
|
otherMeas = meas->nextMeasure(); // look for a next measure
|
|
|
|
// look for a clef segment in the 'other' measure at the same tick of this clef segment
|
|
|
|
if (otherMeas)
|
2014-06-25 11:46:10 +02:00
|
|
|
otherSegm = otherMeas->findSegment(Segment::Type::Clef, segmTick);
|
2013-12-24 20:11:51 +01:00
|
|
|
// if any 'other' segment found, look for a clef in the same track as this
|
|
|
|
if (otherSegm)
|
2016-06-09 09:26:13 +02:00
|
|
|
otherClef = toClef(otherSegm->element(clef->track()));
|
2013-12-24 20:11:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void InspectorClef::valueChanged(int idx)
|
|
|
|
{
|
|
|
|
// copy into 'other clef' the ShowCouretsy ser of this clef
|
|
|
|
if (idx == 6 && otherClef)
|
|
|
|
otherClef->setShowCourtesy(c.showCourtesy->isChecked());
|
|
|
|
InspectorBase::valueChanged(idx);
|
|
|
|
}
|
2012-05-26 14:49:10 +02:00
|
|
|
|
2013-03-27 13:56:46 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorTempoText
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorTempoText::InspectorTempoText(QWidget* parent)
|
2016-08-18 09:15:08 +02:00
|
|
|
: InspectorElementBase(parent)
|
2013-03-27 13:56:46 +01:00
|
|
|
{
|
|
|
|
t.setupUi(addWidget());
|
2014-04-18 06:59:30 +02:00
|
|
|
tt.setupUi(addWidget());
|
2013-03-27 13:56:46 +01:00
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorItem> il = {
|
2014-05-26 18:18:01 +02:00
|
|
|
{ P_ID::TEMPO, 0, 0, tt.tempo, tt.resetTempo },
|
|
|
|
{ P_ID::TEMPO_FOLLOW_TEXT, 0, 0, tt.followText, tt.resetFollowText }
|
2013-03-27 13:56:46 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ t.title, t.panel },
|
|
|
|
{ tt.title, tt.panel }
|
|
|
|
};
|
|
|
|
mapSignals(il, ppList);
|
2016-01-14 09:24:46 +01:00
|
|
|
connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle()));
|
2014-04-18 06:59:30 +02:00
|
|
|
connect(tt.followText, SIGNAL(toggled(bool)), tt.tempo, SLOT(setDisabled(bool)));
|
|
|
|
}
|
|
|
|
|
2013-07-22 16:21:19 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// postInit
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2013-04-10 17:31:22 +02:00
|
|
|
void InspectorTempoText::postInit()
|
|
|
|
{
|
2015-05-27 15:53:45 +02:00
|
|
|
bool followText = tt.followText->isChecked();
|
|
|
|
//tt.resetFollowText->setDisabled(followText);
|
|
|
|
tt.tempo->setDisabled(followText);
|
2016-06-06 15:04:03 +02:00
|
|
|
tt.resetTempo->setDisabled(followText || tt.tempo->value() == 120.0); // a default of 120 BPM is assumed all over the place
|
2013-03-27 13:56:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorDynamic
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorDynamic::InspectorDynamic(QWidget* parent)
|
2016-06-14 16:00:16 +02:00
|
|
|
: InspectorElementBase(parent)
|
2013-03-27 13:56:46 +01:00
|
|
|
{
|
2013-07-22 16:21:19 +02:00
|
|
|
t.setupUi(addWidget());
|
2013-03-27 13:56:46 +01:00
|
|
|
d.setupUi(addWidget());
|
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorItem> il = {
|
2017-01-16 20:51:12 +01:00
|
|
|
{ P_ID::FONT_FACE, 0, 0, t.fontFace, t.resetFontFace },
|
|
|
|
{ P_ID::FONT_SIZE, 0, 0, t.fontSize, t.resetFontSize },
|
|
|
|
{ P_ID::FONT_BOLD, 0, 0, t.bold, t.resetBold },
|
|
|
|
{ P_ID::FONT_ITALIC, 0, 0, t.italic, t.resetItalic },
|
|
|
|
{ P_ID::FONT_UNDERLINE, 0, 0, t.underline, t.resetUnderline },
|
|
|
|
{ P_ID::FRAME, 0, 0, t.hasFrame, t.resetHasFrame },
|
|
|
|
{ P_ID::FRAME_FG_COLOR, 0, 0, t.frameColor, t.resetFrameColor },
|
|
|
|
{ P_ID::FRAME_BG_COLOR, 0, 0, t.bgColor, t.resetBgColor },
|
|
|
|
{ P_ID::FRAME_CIRCLE, 0, 0, t.circle, t.resetCircle },
|
|
|
|
{ P_ID::FRAME_SQUARE, 0, 0, t.square, t.resetSquare },
|
|
|
|
{ P_ID::FRAME_WIDTH, 0, 0, t.frameWidth, t.resetFrameWidth },
|
|
|
|
{ P_ID::FRAME_PADDING, 0, 0, t.paddingWidth, t.resetPaddingWidth },
|
|
|
|
{ P_ID::FRAME_ROUND, 0, 0, t.frameRound, t.resetFrameRound },
|
|
|
|
{ P_ID::ALIGN, 0, 0, t.align, t.resetAlign },
|
|
|
|
{ P_ID::DYNAMIC_RANGE, 0, 0, d.dynRange, d.resetDynRange },
|
|
|
|
{ P_ID::VELOCITY, 0, 0, d.velocity, 0 },
|
|
|
|
{ P_ID::PLACEMENT, 0, 0, d.placement, d.resetPlacement }
|
2013-03-27 13:56:46 +01:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ t.title, t.panel },
|
|
|
|
{ d.title, d.panel }
|
|
|
|
};
|
2016-06-14 18:30:10 +02:00
|
|
|
d.placement->clear();
|
|
|
|
d.placement->addItem(tr("Above"), 0);
|
|
|
|
d.placement->addItem(tr("Below"), 1);
|
2016-12-19 11:02:12 +01:00
|
|
|
mapSignals(il, ppList);
|
2016-01-14 09:24:46 +01:00
|
|
|
connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle()));
|
2013-03-27 13:56:46 +01:00
|
|
|
}
|
|
|
|
|
2013-07-01 16:57:44 +02:00
|
|
|
//---------------------------------------------------------
|
2016-08-24 14:49:34 +02:00
|
|
|
// InspectorLyric
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorLyric::InspectorLyric(QWidget* parent)
|
|
|
|
: InspectorElementBase(parent)
|
|
|
|
{
|
|
|
|
t.setupUi(addWidget());
|
|
|
|
l.setupUi(addWidget());
|
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorItem> il = {
|
2016-08-24 18:08:53 +02:00
|
|
|
{ P_ID::PLACEMENT, 0, 0, l.placement, l.resetPlacement },
|
2016-11-29 13:31:40 +01:00
|
|
|
{ P_ID::VERSE, 0, 0, l.verse, l.resetVerse }
|
2016-08-24 14:49:34 +02:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ t.title, t.panel },
|
|
|
|
{ l.title, l.panel }
|
|
|
|
};
|
2016-08-24 14:49:34 +02:00
|
|
|
l.placement->clear();
|
|
|
|
l.placement->addItem(tr("Above"), 0);
|
|
|
|
l.placement->addItem(tr("Below"), 1);
|
2016-12-19 11:02:12 +01:00
|
|
|
mapSignals(il, ppList);
|
2016-08-24 14:49:34 +02:00
|
|
|
connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle()));
|
|
|
|
}
|
|
|
|
|
2016-08-24 18:08:53 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// valueChanged
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void InspectorLyric::valueChanged(int idx)
|
|
|
|
{
|
|
|
|
if (iList[idx].t == P_ID::VERSE) {
|
|
|
|
int val = getValue(iList[idx]).toInt();
|
|
|
|
Lyrics* l = toLyrics(inspector->element());
|
|
|
|
printf("value changed %d old %d\n", val, l->no());
|
|
|
|
Lyrics* nl = l->chordRest()->lyrics(val, l->placement());
|
|
|
|
if (nl) {
|
|
|
|
printf(" move away %d -> %d\n", nl->no(), l->no());
|
|
|
|
nl->undoChangeProperty(P_ID::VERSE, l->no());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
InspectorBase::valueChanged(idx);
|
|
|
|
}
|
|
|
|
|
2016-08-24 14:49:34 +02:00
|
|
|
//---------------------------------------------------------
|
2017-01-16 20:51:12 +01:00
|
|
|
// InspectorStaffText
|
2016-08-25 17:34:25 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2017-01-16 20:51:12 +01:00
|
|
|
InspectorStaffText::InspectorStaffText(QWidget* parent)
|
2016-08-25 17:34:25 +02:00
|
|
|
: InspectorElementBase(parent)
|
|
|
|
{
|
|
|
|
t.setupUi(addWidget());
|
|
|
|
s.setupUi(addWidget());
|
|
|
|
|
2016-08-25 23:00:12 +02:00
|
|
|
Element* e = inspector->element();
|
|
|
|
Text* te = static_cast<Text*>(e);
|
2017-01-03 18:22:28 +01:00
|
|
|
bool sameTypes = true;
|
2016-08-25 23:00:12 +02:00
|
|
|
|
|
|
|
for (const auto& ee : inspector->el()) {
|
|
|
|
Text* tt = static_cast<Text*>(ee);
|
|
|
|
|
|
|
|
if (tt->systemFlag() != te->systemFlag()) {
|
2017-01-03 18:22:28 +01:00
|
|
|
sameTypes = false;
|
2016-08-25 23:00:12 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-01-19 10:10:42 +01:00
|
|
|
if (sameTypes)
|
|
|
|
s.title->setText(te->systemFlag() ? tr("System Text") : tr("Staff Text"));
|
2016-08-25 23:00:12 +02:00
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorItem> il = {
|
2017-01-16 20:51:12 +01:00
|
|
|
{ P_ID::FONT_FACE, 0, 0, t.fontFace, t.resetFontFace },
|
|
|
|
{ P_ID::FONT_SIZE, 0, 0, t.fontSize, t.resetFontSize },
|
|
|
|
{ P_ID::FONT_BOLD, 0, 0, t.bold, t.resetBold },
|
|
|
|
{ P_ID::FONT_ITALIC, 0, 0, t.italic, t.resetItalic },
|
|
|
|
{ P_ID::FONT_UNDERLINE, 0, 0, t.underline, t.resetUnderline },
|
|
|
|
{ P_ID::FRAME, 0, 0, t.hasFrame, t.resetHasFrame },
|
|
|
|
{ P_ID::FRAME_FG_COLOR, 0, 0, t.frameColor, t.resetFrameColor },
|
|
|
|
{ P_ID::FRAME_BG_COLOR, 0, 0, t.bgColor, t.resetBgColor },
|
|
|
|
{ P_ID::FRAME_CIRCLE, 0, 0, t.circle, t.resetCircle },
|
|
|
|
{ P_ID::FRAME_SQUARE, 0, 0, t.square, t.resetSquare },
|
|
|
|
{ P_ID::FRAME_WIDTH, 0, 0, t.frameWidth, t.resetFrameWidth },
|
|
|
|
{ P_ID::FRAME_PADDING, 0, 0, t.paddingWidth, t.resetPaddingWidth },
|
|
|
|
{ P_ID::FRAME_ROUND, 0, 0, t.frameRound, t.resetFrameRound },
|
|
|
|
{ P_ID::ALIGN, 0, 0, t.align, t.resetAlign },
|
2017-01-19 10:10:42 +01:00
|
|
|
{ P_ID::PLACEMENT, 0, 0, s.placement, s.resetPlacement },
|
|
|
|
{ P_ID::SUB_STYLE, 0, 0, s.subStyle, s.resetSubStyle }
|
2016-08-25 17:34:25 +02:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = {
|
|
|
|
{ t.title, t.panel },
|
|
|
|
{ s.title, s.panel }
|
|
|
|
};
|
2016-08-25 17:34:25 +02:00
|
|
|
s.placement->clear();
|
|
|
|
s.placement->addItem(tr("Above"), 0);
|
|
|
|
s.placement->addItem(tr("Below"), 1);
|
2017-01-19 10:10:42 +01:00
|
|
|
|
|
|
|
s.subStyle->clear();
|
|
|
|
if (te->systemFlag())
|
|
|
|
s.subStyle->addItem(subStyleUserName(SubStyle::SYSTEM), int(SubStyle::SYSTEM));
|
|
|
|
else
|
|
|
|
s.subStyle->addItem(subStyleUserName(SubStyle::STAFF), int(SubStyle::STAFF));
|
|
|
|
for (auto ss : { SubStyle::TEMPO, SubStyle::METRONOME, SubStyle::REHEARSAL_MARK, SubStyle::REPEAT_LEFT,
|
|
|
|
SubStyle::REPEAT_RIGHT, SubStyle::VOLTA, SubStyle::USER1, SubStyle::USER2 } )
|
|
|
|
{
|
|
|
|
s.subStyle->addItem(subStyleUserName(ss), int(ss));
|
|
|
|
}
|
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
mapSignals(il, ppList);
|
2016-08-25 17:34:25 +02:00
|
|
|
connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle()));
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2016-11-17 09:46:58 +01:00
|
|
|
// InspectorSlurTie
|
2013-07-01 16:57:44 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-11-17 09:46:58 +01:00
|
|
|
InspectorSlurTie::InspectorSlurTie(QWidget* parent)
|
2016-06-09 09:26:13 +02:00
|
|
|
: InspectorElementBase(parent)
|
2013-07-01 16:57:44 +02:00
|
|
|
{
|
|
|
|
s.setupUi(addWidget());
|
|
|
|
|
2016-06-09 09:26:13 +02:00
|
|
|
Element* e = inspector->element();
|
2017-01-03 18:22:28 +01:00
|
|
|
bool sameTypes = true;
|
2016-06-09 09:26:13 +02:00
|
|
|
|
|
|
|
for (const auto& ee : inspector->el()) {
|
2016-06-26 15:02:48 +02:00
|
|
|
if (ee->accessibleInfo() != e->accessibleInfo()) {
|
2017-01-03 18:22:28 +01:00
|
|
|
sameTypes = false;
|
2016-06-09 09:26:13 +02:00
|
|
|
break;
|
2016-03-26 15:16:31 +01:00
|
|
|
}
|
|
|
|
}
|
2017-01-03 18:22:28 +01:00
|
|
|
if (sameTypes)
|
2016-12-19 11:02:12 +01:00
|
|
|
s.title->setText(e->accessibleInfo());
|
2016-06-09 09:26:13 +02:00
|
|
|
|
|
|
|
const std::vector<InspectorItem> iiList = {
|
2016-03-10 09:40:05 +01:00
|
|
|
{ P_ID::LINE_TYPE, 0, 0, s.lineType, s.resetLineType },
|
|
|
|
{ P_ID::SLUR_DIRECTION, 0, 0, s.slurDirection, s.resetSlurDirection }
|
2013-07-01 16:57:44 +02:00
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { { s.title, s.panel } };
|
|
|
|
mapSignals(iiList, ppList);
|
2013-07-01 16:57:44 +02:00
|
|
|
}
|
|
|
|
|
2013-08-02 10:47:20 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorEmpty
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorEmpty::InspectorEmpty(QWidget* parent)
|
|
|
|
:InspectorBase(parent)
|
|
|
|
{
|
2014-10-30 10:05:07 +01:00
|
|
|
e.setupUi(addWidget());
|
2013-08-02 10:47:20 +02:00
|
|
|
}
|
2013-07-01 16:57:44 +02:00
|
|
|
|
2014-12-21 23:09:40 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// sizeHint
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
QSize InspectorEmpty::sizeHint() const
|
|
|
|
{
|
|
|
|
return QSize(255 * guiScaling, 170 * guiScaling);
|
|
|
|
}
|
|
|
|
|
2016-03-27 14:41:33 +02:00
|
|
|
//---------------------------------------------------------
|
2016-06-26 13:52:33 +02:00
|
|
|
// InspectorCaesura
|
2016-03-27 14:41:33 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2016-09-20 19:37:58 +02:00
|
|
|
InspectorCaesura::InspectorCaesura(QWidget* parent) : InspectorElementBase(parent)
|
2016-03-27 14:41:33 +02:00
|
|
|
{
|
|
|
|
c.setupUi(addWidget());
|
|
|
|
|
2016-06-26 13:52:33 +02:00
|
|
|
Breath* b = toBreath(inspector->element());
|
2017-01-03 18:22:28 +01:00
|
|
|
bool sameTypes = true;
|
2016-06-26 13:52:33 +02:00
|
|
|
for (const auto& ee : inspector->el()) {
|
|
|
|
if (ee->accessibleInfo() != b->accessibleInfo()) {
|
2017-01-03 18:22:28 +01:00
|
|
|
sameTypes = false;
|
2016-06-26 13:52:33 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-01-03 18:22:28 +01:00
|
|
|
if (sameTypes)
|
2016-12-19 11:02:12 +01:00
|
|
|
c.title->setText(b->accessibleInfo());
|
2016-06-26 13:52:33 +02:00
|
|
|
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorItem> il = {
|
2016-03-27 14:41:33 +02:00
|
|
|
{ P_ID::PAUSE, 0, 0, c.pause, c.resetPause }
|
|
|
|
};
|
2016-12-19 11:02:12 +01:00
|
|
|
const std::vector<InspectorPanel> ppList = { {c.title, c.panel} };
|
|
|
|
mapSignals(il, ppList);
|
2016-03-27 14:41:33 +02:00
|
|
|
}
|
|
|
|
|
2016-12-29 19:46:40 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorBracket
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorBracket::InspectorBracket(QWidget* parent) : InspectorBase(parent)
|
|
|
|
{
|
|
|
|
b.setupUi(addWidget());
|
|
|
|
|
|
|
|
const std::vector<InspectorItem> il = {
|
|
|
|
{ P_ID::BRACKET_COLUMN, 0, 0, b.column, b.resetColumn }
|
|
|
|
};
|
|
|
|
mapSignals(il);
|
|
|
|
}
|
|
|
|
|
2016-12-30 10:58:53 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// InspectorIname
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
InspectorIname::InspectorIname(QWidget* parent) : InspectorBase(parent)
|
|
|
|
{
|
|
|
|
i.setupUi(addWidget());
|
|
|
|
|
|
|
|
const std::vector<InspectorItem> il = {
|
|
|
|
{ P_ID::INAME_LAYOUT_POSITION, 0, 0, i.layoutPosition, i.resetLayoutPosition }
|
|
|
|
};
|
|
|
|
mapSignals(il);
|
|
|
|
}
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
}
|
2012-11-18 00:28:38 +01:00
|
|
|
|