@@ -1196,54 +1196,26 @@ InspectorRest::InspectorRest(QWidget* parent)
1196
1196
InspectorTimeSig::InspectorTimeSig (QWidget* parent)
1197
1197
: InspectorBase(parent)
1198
1198
{
1199
- iElement = new InspectorElementElement (this );
1200
- iSegment = new InspectorSegment (this );
1201
-
1202
- layout->addWidget (iElement);
1203
-
1204
- QHBoxLayout* l = new QHBoxLayout;
1205
- showCourtesy = new QCheckBox;
1206
- showCourtesy->setText (tr (" Show Courtesy Time Signature" ));
1207
- connect (showCourtesy, SIGNAL (toggled (bool )), SLOT (apply ()));
1208
- l->addWidget (showCourtesy);
1209
- layout->addLayout (l);
1210
- layout->addWidget (iSegment);
1211
- }
1212
-
1213
- // ---------------------------------------------------------
1214
- // setElement
1215
- // ---------------------------------------------------------
1216
-
1217
- void InspectorTimeSig::setElement ()
1218
- {
1219
- TimeSig* sig = static_cast <TimeSig*>(inspector->element ());
1220
- Segment* segment = sig->segment ();
1221
-
1222
- iElement->setElement (sig);
1223
- iSegment->setElement (segment);
1224
- showCourtesy->blockSignals (true );
1225
- showCourtesy->setChecked (sig->showCourtesySig ());
1226
- showCourtesy->blockSignals (false );
1227
- }
1228
-
1229
- // ---------------------------------------------------------
1230
- // apply
1231
- // ---------------------------------------------------------
1232
-
1233
- void InspectorTimeSig::apply ()
1234
- {
1235
- TimeSig* sig = static_cast <TimeSig*>(inspector->element ());
1199
+ QWidget* w1 = new QWidget;
1200
+ e.setupUi (w1);
1201
+ layout->addWidget (w1);
1202
+ QWidget* w2 = new QWidget;
1203
+ s.setupUi (w2);
1204
+ layout->addWidget (w2);
1205
+ QWidget* w3 = new QWidget;
1206
+ t.setupUi (w3);
1207
+ layout->addWidget (w3);
1236
1208
1237
- bool val = showCourtesy-> isChecked ();
1238
- if (val != sig-> showCourtesySig ()) {
1239
- mscore-> getInspector ()-> setInspectorEdit ( true ); // this edit is coming from within the inspector itself:
1240
- // do not set element values again
1241
- Score* score = sig-> score ();
1242
- score-> startCmd ();
1243
- score-> undoChangeProperty (sig, P_SHOW_COURTESY, val);
1244
- score-> endCmd ();
1245
- mscore-> endCmd () ;
1246
- }
1209
+ iList = {
1210
+ { P_COLOR, 0 , false , e. color , e. resetColor },
1211
+ { P_VISIBLE, 0 , false , e. visible , e. resetVisible },
1212
+ { P_USER_OFF, 0 , false , e. offsetX , e. resetX },
1213
+ { P_USER_OFF, 1 , false , e. offsetY , e. resetY },
1214
+ { P_LEADING_SPACE, 0 , true , s. leadingSpace , s. resetLeadingSpace },
1215
+ { P_TRAILING_SPACE, 0 , true , s. trailingSpace , s. resetTrailingSpace },
1216
+ { P_SHOW_COURTESY, 0 , false , t. showCourtesy , t. resetShowCourtesy }
1217
+ } ;
1218
+ mapSignals ();
1247
1219
}
1248
1220
1249
1221
// ---------------------------------------------------------
@@ -1253,68 +1225,27 @@ void InspectorTimeSig::apply()
1253
1225
InspectorKeySig::InspectorKeySig (QWidget* parent)
1254
1226
: InspectorBase(parent)
1255
1227
{
1256
- iElement = new InspectorElementElement (this );
1257
- iSegment = new InspectorSegment (this );
1258
- layout->addWidget (iElement);
1259
-
1260
- QHBoxLayout* l = new QHBoxLayout;
1261
- showCourtesy = new QCheckBox;
1262
- showCourtesy->setText (tr (" Show Courtesy Time Signature" ));
1263
- connect (showCourtesy, SIGNAL (toggled (bool )), SLOT (apply ()));
1264
- l->addWidget (showCourtesy);
1265
- layout->addLayout (l);
1266
-
1267
- l = new QHBoxLayout;
1268
- showNaturals = new QCheckBox;
1269
- showNaturals->setText (tr (" Show Naturals" ));
1270
- connect (showNaturals, SIGNAL (toggled (bool )), SLOT (apply ()));
1271
- l->addWidget (showNaturals);
1272
- layout->addLayout (l);
1273
-
1274
- layout->addWidget (iSegment);
1275
- }
1276
-
1277
- // ---------------------------------------------------------
1278
- // setElement
1279
- // ---------------------------------------------------------
1280
-
1281
- void InspectorKeySig::setElement ()
1282
- {
1283
- KeySig* sig = static_cast <KeySig*>(inspector->element ());
1284
- Segment* segment = sig->segment ();
1285
-
1286
- iElement->setElement (sig);
1287
- iSegment->setElement (segment);
1288
- showCourtesy->blockSignals (true );
1289
- showNaturals->blockSignals (true );
1290
- showCourtesy->setChecked (sig->showCourtesy ());
1291
- showNaturals->setChecked (sig->showNaturals ());
1292
- showCourtesy->blockSignals (false );
1293
- showNaturals->blockSignals (false );
1294
- }
1295
-
1296
- // ---------------------------------------------------------
1297
- // apply
1298
- // ---------------------------------------------------------
1299
-
1300
- void InspectorKeySig::apply ()
1301
- {
1302
- KeySig* sig = static_cast <KeySig*>(inspector->element ());
1228
+ QWidget* w1 = new QWidget;
1229
+ e.setupUi (w1);
1230
+ layout->addWidget (w1);
1231
+ QWidget* w2 = new QWidget;
1232
+ s.setupUi (w2);
1233
+ layout->addWidget (w2);
1234
+ QWidget* w3 = new QWidget;
1235
+ k.setupUi (w3);
1236
+ layout->addWidget (w3);
1303
1237
1304
- bool sc = showCourtesy->isChecked ();
1305
- bool sn = showNaturals->isChecked ();
1306
- if (sc != sig->showCourtesy () || sn != sig->showNaturals ()) {
1307
- mscore->getInspector ()->setInspectorEdit (true ); // this edit is coming from within the inspector itself:
1308
- // do not set element values again
1309
- Score* score = sig->score ();
1310
- score->startCmd ();
1311
- if (sc != sig->showCourtesy ())
1312
- score->undoChangeProperty (sig, P_SHOW_COURTESY, sc);
1313
- if (sn != sig->showNaturals ())
1314
- score->undoChangeProperty (sig, P_SHOW_NATURALS, sn);
1315
- score->endCmd ();
1316
- mscore->endCmd ();
1317
- }
1238
+ iList = {
1239
+ { P_COLOR, 0 , false , e.color , e.resetColor },
1240
+ { P_VISIBLE, 0 , false , e.visible , e.resetVisible },
1241
+ { P_USER_OFF, 0 , false , e.offsetX , e.resetX },
1242
+ { P_USER_OFF, 1 , false , e.offsetY , e.resetY },
1243
+ { P_LEADING_SPACE, 0 , true , s.leadingSpace , s.resetLeadingSpace },
1244
+ { P_TRAILING_SPACE, 0 , true , s.trailingSpace , s.resetTrailingSpace },
1245
+ { P_SHOW_COURTESY, 0 , false , k.showCourtesy , k.resetShowCourtesy },
1246
+ { P_SHOW_NATURALS, 0 , false , k.showNaturals , k.resetShowNaturals }
1247
+ };
1248
+ mapSignals ();
1318
1249
}
1319
1250
1320
1251
// ---------------------------------------------------------
0 commit comments