Skip to content

Commit 1ae924c

Browse files
committed
remove volta property dialog, move properties to inspector
1 parent 367f445 commit 1ae924c

File tree

8 files changed

+67
-247
lines changed

8 files changed

+67
-247
lines changed

mscore/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ QT5_WRAP_UI (ui_headers
3939
insertmeasuresdialog.ui editinstrument.ui editstyle.ui instrdialog.ui instrwidget.ui
4040
measuresdialog.ui pagesettings.ui mixer.ui playpanel.ui prefsdialog.ui measureproperties.ui
4141
textpalette.ui timedialog.ui symboldialog.ui shortcutcapturedialog.ui editdrumset.ui
42-
editstaff.ui voltaproperties.ui timesigproperties.ui
42+
editstaff.ui timesigproperties.ui
4343
instrwizard.ui timesigwizard.ui newwizard.ui aboutbox.ui aboutmusicxmlbox.ui
4444
transposedialog.ui lineproperties.ui excerptsdialog.ui stafftext.ui tupletdialog.ui
4545
glissandoprop.ui articulation.ui metaedit.ui palette.ui select.ui
@@ -230,7 +230,7 @@ add_executable ( ${ExecutableName}
230230
seq.cpp textpalette.cpp
231231
timedialog.cpp symboldialog.cpp shortcutcapturedialog.cpp
232232
simplebutton.cpp musedata.cpp
233-
editdrumset.cpp editstaff.cpp voltaproperties.cpp
233+
editdrumset.cpp editstaff.cpp
234234
timesigproperties.cpp newwizard.cpp transposedialog.cpp
235235
excerptsdialog.cpp metaedit.cpp magbox.cpp
236236
capella.cpp capxml.cpp exportaudio.cpp palettebox.cpp

mscore/inspector/inspectorBase.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ QVariant InspectorBase::getValue(const InspectorItem& ii) const
9494
case P_TYPE::DIRECTION:
9595
v = QVariant::fromValue(Direction(v.toInt()));
9696
break;
97+
case P_TYPE::INT_LIST: {
98+
QStringList sl = v.toString().split(",", QString::SkipEmptyParts);
99+
QList<int> il;
100+
for (const QString& l : sl) {
101+
int i = l.simplified().toInt();
102+
il.append(i);
103+
}
104+
v = QVariant::fromValue(il);
105+
}
106+
break;
97107
default:
98108
break;
99109
}
@@ -127,6 +137,18 @@ void InspectorBase::setValue(const InspectorItem& ii, QVariant val)
127137
case P_TYPE::DIRECTION:
128138
val = int(val.value<Direction>());
129139
break;
140+
case P_TYPE::INT_LIST: {
141+
QString s;
142+
QList<int> il = val.value<QList<int>>();
143+
for (int i : il) {
144+
if (!s.isEmpty())
145+
s += ", ";
146+
s += QString("%1").arg(i);
147+
}
148+
val = s;
149+
}
150+
break;
151+
130152
default:
131153
break;
132154
}

mscore/inspector/inspectorVolta.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ InspectorVolta::InspectorVolta(QWidget* parent)
3939
{ P_ID::DASH_LINE_LEN, 0, 0, l.dashLineLength, l.resetDashLineLength },
4040
{ P_ID::DASH_GAP_LEN, 0, 0, l.dashGapLength, l.resetDashGapLength },
4141
// tl
42-
{ P_ID::VOLTA_TYPE, 0, 0, v.voltaType, v.resetVoltaType }
42+
{ P_ID::VOLTA_TYPE, 0, 0, v.voltaType, v.resetVoltaType },
43+
{ P_ID::BEGIN_TEXT, 0, 0, v.voltaText, 0 },
44+
{ P_ID::VOLTA_ENDING, 0, 0, v.voltaRepeatList, 0 }
4345
};
4446

4547
mapSignals(il);

mscore/inspector/inspector_volta.ui

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>287</width>
10-
<height>68</height>
9+
<width>1003</width>
10+
<height>212</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -97,6 +97,12 @@
9797
</item>
9898
<item row="0" column="0">
9999
<widget class="QLabel" name="label">
100+
<property name="sizePolicy">
101+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
102+
<horstretch>0</horstretch>
103+
<verstretch>0</verstretch>
104+
</sizepolicy>
105+
</property>
100106
<property name="text">
101107
<string>Type</string>
102108
</property>
@@ -119,6 +125,38 @@
119125
</property>
120126
</widget>
121127
</item>
128+
<item row="1" column="0">
129+
<widget class="QLabel" name="label_2">
130+
<property name="sizePolicy">
131+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
132+
<horstretch>0</horstretch>
133+
<verstretch>0</verstretch>
134+
</sizepolicy>
135+
</property>
136+
<property name="text">
137+
<string>Text</string>
138+
</property>
139+
</widget>
140+
</item>
141+
<item row="1" column="1" colspan="3">
142+
<widget class="QLineEdit" name="voltaText"/>
143+
</item>
144+
<item row="2" column="0">
145+
<widget class="QLabel" name="label_3">
146+
<property name="sizePolicy">
147+
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
148+
<horstretch>0</horstretch>
149+
<verstretch>0</verstretch>
150+
</sizepolicy>
151+
</property>
152+
<property name="text">
153+
<string>Repeat list</string>
154+
</property>
155+
</widget>
156+
</item>
157+
<item row="2" column="1" colspan="3">
158+
<widget class="QLineEdit" name="voltaRepeatList"/>
159+
</item>
122160
</layout>
123161
</item>
124162
</layout>

mscore/propertymenu.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include "articulationprop.h"
2424
#include "bendproperties.h"
25-
#include "voltaproperties.h"
2625
#include "lineproperties.h"
2726
#include "tremolobarprop.h"
2827
#include "timesigproperties.h"
@@ -174,7 +173,6 @@ void ScoreView::createElementPropertyMenu(Element* e, QMenu* popup)
174173
else if (e->type() == Element::Type::VOLTA_SEGMENT) {
175174
genPropertyMenu1(e, popup);
176175
popup->addAction(tr("Line Properties..."))->setData("l-props");
177-
popup->addAction(tr("Volta Properties..."))->setData("v-props");
178176
}
179177
else if (e->type() == Element::Type::TIMESIG) {
180178
genPropertyMenu1(e, popup);
@@ -411,21 +409,6 @@ void ScoreView::elementPropertyAction(const QString& cmd, Element* e)
411409
score()->select(s, SelectType::SINGLE, 0);
412410
startEdit(s);
413411
}
414-
else if (cmd == "v-props") {
415-
VoltaSegment* vs = static_cast<VoltaSegment*>(e);
416-
VoltaProperties vp;
417-
vp.setText(Text::unEscape(vs->volta()->text()));
418-
vp.setEndings(vs->volta()->endings());
419-
int rv = vp.exec();
420-
if (rv) {
421-
QString txt = vp.getText();
422-
QList<int> l = vp.getEndings();
423-
if (txt != vs->volta()->text())
424-
vs->volta()->undoChangeProperty(P_ID::BEGIN_TEXT, Text::tagEscape(txt));
425-
if (l != vs->volta()->endings())
426-
vs->volta()->undoChangeProperty(P_ID::VOLTA_ENDING, QVariant::fromValue(l));
427-
}
428-
}
429412
else if (cmd == "l-props") {
430413
TextLineSegment* vs = static_cast<TextLineSegment*>(e);
431414
LineProperties lp(vs->textLine());

mscore/voltaproperties.cpp

Lines changed: 0 additions & 67 deletions
This file was deleted.

mscore/voltaproperties.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

mscore/voltaproperties.ui

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)