Skip to content

Commit 421da11

Browse files
authored
Merge branch 'powertab:master' into patch-1
2 parents ca0f261 + 4af24cc commit 421da11

File tree

13 files changed

+162
-65
lines changed

13 files changed

+162
-65
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-22.04
1616

1717
steps:
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@v6
1919
- name: Install Apt Dependencies
2020
run: sudo apt update && sudo apt install ninja-build qt6-base-dev libglx-dev libgl1-mesa-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libboost-dev libboost-date-time-dev libboost-iostreams-dev nlohmann-json3-dev libasound2-dev librtmidi-dev libpugixml-dev libminizip-dev doctest-dev
2121
- name: Create Build Directory
@@ -31,10 +31,10 @@ jobs:
3131

3232
build-osx:
3333

34-
runs-on: macos-13
34+
runs-on: macos-15-intel
3535

3636
steps:
37-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
3838

3939
- name: Version number
4040
id: version
@@ -66,7 +66,7 @@ jobs:
6666
# Skip building the installer for PRs, since code signing / notarizing requires access to the repo's secrets.
6767
- name: Add Certificates to Keychain
6868
if: github.event_name != 'pull_request'
69-
uses: apple-actions/import-codesign-certs@v5
69+
uses: apple-actions/import-codesign-certs@v6
7070
with:
7171
p12-file-base64: ${{ secrets.MAC_CERTS_BASE64 }}
7272
p12-password: ${{ secrets.MAC_CERTS_PASSWORD }}
@@ -79,7 +79,7 @@ jobs:
7979

8080
- name: Upload Installer
8181
if: github.event_name != 'pull_request'
82-
uses: actions/upload-artifact@v5
82+
uses: actions/upload-artifact@v6
8383
with:
8484
name: powertabeditor-osx-${{ steps.version.outputs.VERSION_ID }}.dmg
8585
path: ${{runner.workspace}}/build/powertabeditor-osx.dmg
@@ -90,7 +90,7 @@ jobs:
9090
runs-on: windows-2022
9191

9292
steps:
93-
- uses: actions/checkout@v5
93+
- uses: actions/checkout@v6
9494

9595
- name: Version number
9696
id: version
@@ -121,7 +121,7 @@ jobs:
121121
mv installer/windows/powertabeditor.exe installer/windows/powertabeditor-windows-${{ steps.version.outputs.VERSION_ID }}.exe
122122
123123
- name: Upload Installer
124-
uses: actions/upload-artifact@v5
124+
uses: actions/upload-artifact@v6
125125
with:
126126
name: powertabeditor-windows-${{ steps.version.outputs.VERSION_ID }}.exe
127127
path: installer/windows/powertabeditor-windows-${{ steps.version.outputs.VERSION_ID }}.exe

.github/workflows/snap.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2020
with:
2121
ref: ${{ github.event.inputs.branch }}
2222

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ All notable changes to this project will be documented in this file.
55

66
Thanks to the following contributors who worked on this release:
77
- @cameronwhite
8+
- @sbonaime
89

910
### Added
11+
- Added preference for whether the outline around each system is drawn (#550)
1012

1113
### Changed
1214

@@ -24,6 +26,7 @@ Thanks to the following contributors who worked on this release:
2426
- Fixed issues with overriding the application's language on macOS via the system settings (#507)
2527
- Fixed an issue which could cause a secondary language to be used for translations rather than the primary system language (#527, #528)
2628
- Added missing German and Chinese (Simplified) translations which previously were not being packaged
29+
- Fixed crash when loading an invalid tuning dictionary file (#543, #535)
2730

2831
## [2.0.21] - 2024-11-20
2932

source/app/scorearea.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU General Public License
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
17-
17+
1818
#include "scorearea.h"
1919

2020
#include <app/documentmanager.h>
@@ -65,11 +65,13 @@ ScoreArea::ScoreArea(SettingsManager &settings_manager, QWidget *parent)
6565
// changes.
6666
loadTheme(settings_manager, /* redraw */ false);
6767
loadSystemSpacing(settings_manager, false);
68+
loadDrawSystemOutline(settings_manager, false);
6869
mySettingsListener = settings_manager.subscribeToChanges(
6970
[&]()
7071
{
7172
loadTheme(settings_manager);
7273
loadSystemSpacing(settings_manager);
74+
loadDrawSystemOutline(settings_manager);
7375
});
7476

7577
// Connect the click event handler to our public signals.
@@ -371,3 +373,18 @@ ScoreArea::loadSystemSpacing(const SettingsManager &settings_manager, bool redra
371373
if (redraw && mySystemSpacing != prev_spacing)
372374
this->renderDocument(*myDocument);
373375
}
376+
377+
void
378+
ScoreArea::loadDrawSystemOutline(const SettingsManager &settings_manager, bool redraw)
379+
{
380+
auto settings = settings_manager.getReadHandle();
381+
const bool prev_value = myDrawSystemOutline;
382+
myDrawSystemOutline = settings->get(Settings::DrawSystemOutline);
383+
if (redraw && myDrawSystemOutline != prev_value)
384+
this->renderDocument(*myDocument);
385+
}
386+
387+
bool ScoreArea::getDrawSystemOutline() const
388+
{
389+
return myDrawSystemOutline;
390+
}

source/app/scorearea.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU General Public License
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
17-
17+
1818
#ifndef APP_SCOREAREA_H
1919
#define APP_SCOREAREA_H
2020

@@ -65,6 +65,9 @@ class ScoreArea : public QGraphicsView
6565
/// returns the palette used by scorearea
6666
const QPalette *getPalette() const;
6767

68+
/// Check if system outline should be drawn
69+
bool getDrawSystemOutline() const;
70+
6871
signals:
6972
void itemClicked(ScoreItem item, const ConstScoreLocation &location,
7073
ScoreItemAction action);
@@ -81,13 +84,15 @@ class ScoreArea : public QGraphicsView
8184
/// Load the user's preferred color scheme for the score.
8285
void loadTheme(const SettingsManager &settings_manager, bool redraw = true);
8386
void loadSystemSpacing(const SettingsManager &settings_manager, bool redraw = true);
87+
void loadDrawSystemOutline(const SettingsManager &settings_manager, bool redraw = true);
8488

8589
Scene myScene;
8690
const Document *myDocument;
8791
QGraphicsItem *myScoreInfoBlock;
8892
QGraphicsItem *myChordDiagramList;
8993
double myHeaderSize = 0;
9094
double mySystemSpacing = 0;
95+
bool myDrawSystemOutline = true;
9196
QList<QGraphicsItem *> myRenderedSystems;
9297
CaretPainter *myCaretPainter;
9398
/// The color palette from the parent widget.

source/app/settings.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const Setting<std::vector<std::string>> RecentFiles("app/recent_files", {});
3939
const Setting<bool> OpenFilesInNewWindow("app/open_files_in_new_window",
4040
false);
4141

42+
const Setting<bool> DrawSystemOutline("app/draw_system_outline", true);
43+
4244
const Setting<int> SystemSpacing("app/system_spacing", 50);
4345

4446
const Setting<ScoreTheme> Theme("app/score_theme", ScoreTheme::SystemDefault);

source/app/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ namespace Settings
4242
extern const Setting<std::vector<std::string>> RecentFiles;
4343
extern const Setting<ScoreTheme> Theme;
4444
extern const Setting<bool> OpenFilesInNewWindow;
45+
extern const Setting<bool> DrawSystemOutline;
4546
extern const Setting<int> SystemSpacing;
4647

4748
extern const Setting<std::string> DefaultInstrumentName;

source/app/tuningdictionary.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <algorithm>
2121
#include <app/appinfo.h>
2222
#include <app/paths.h>
23+
#include <exception>
2324
#include <filesystem>
2425
#include <fstream>
2526
#include <iostream>
@@ -51,7 +52,16 @@ TuningDictionary::load()
5152
std::ifstream file(path);
5253

5354
std::vector<Tuning> tunings;
54-
ScoreUtils::load(file, "tunings", tunings);
55+
try
56+
{
57+
ScoreUtils::load(file, "tunings", tunings);
58+
}
59+
catch (const std::exception &e)
60+
{
61+
std::cerr << "Failed to load tunings from file " << path << std::endl;
62+
std::cerr << "Error: " << e.what() << std::endl;
63+
continue;
64+
}
5565

5666
const bool writeable = (dir == user_data_dir);
5767
for (const Tuning &tuning: tunings)

source/dialogs/preferencesdialog.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU General Public License
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
17-
17+
1818
#include "preferencesdialog.h"
1919
#include "ui_preferencesdialog.h"
2020

@@ -134,6 +134,9 @@ void PreferencesDialog::loadCurrentSettings()
134134
ui->openInNewWindowCheckBox->setChecked(
135135
settings->get(Settings::OpenFilesInNewWindow));
136136

137+
ui->drawSystemOutlineCheckBox->setChecked(
138+
settings->get(Settings::DrawSystemOutline));
139+
137140
ui->systemSpacingSpinBox->setValue(
138141
settings->get(Settings::SystemSpacing));
139142

@@ -198,6 +201,9 @@ void PreferencesDialog::accept()
198201
settings->set(Settings::OpenFilesInNewWindow,
199202
ui->openInNewWindowCheckBox->isChecked());
200203

204+
settings->set(Settings::DrawSystemOutline,
205+
ui->drawSystemOutlineCheckBox->isChecked());
206+
201207
settings->set(Settings::SystemSpacing,
202208
ui->systemSpacingSpinBox->value());
203209

source/dialogs/preferencesdialog.ui

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<rect>
1010
<x>0</x>
1111
<y>0</y>
12-
<width>404</width>
12+
<width>550</width>
1313
<height>574</height>
1414
</rect>
1515
</property>
@@ -41,9 +41,15 @@
4141
<layout class="QVBoxLayout" name="verticalLayout_3">
4242
<item>
4343
<layout class="QFormLayout" name="formLayout">
44-
<property name="fieldGrowthPolicy">
44+
<property name="fieldGrowthPolicy">
4545
<enum>QFormLayout::FieldGrowthPolicy::ExpandingFieldsGrow</enum>
4646
</property>
47+
<property name="formAlignment">
48+
<set>Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
49+
</property>
50+
<property name="labelAlignment">
51+
<set>Qt::AlignmentFlag::AlignLeft</set>
52+
</property>
4753
<item row="0" column="0">
4854
<widget class="QLabel" name="midiOutputDeviceLabel">
4955
<property name="text">
@@ -103,9 +109,15 @@
103109
<layout class="QVBoxLayout" name="verticalLayout_2">
104110
<item>
105111
<layout class="QFormLayout" name="formLayout_2">
106-
<property name="fieldGrowthPolicy">
112+
<property name="fieldGrowthPolicy">
107113
<enum>QFormLayout::FieldGrowthPolicy::ExpandingFieldsGrow</enum>
108114
</property>
115+
<property name="formAlignment">
116+
<set>Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
117+
</property>
118+
<property name="labelAlignment">
119+
<set>Qt::AlignmentFlag::AlignLeft</set>
120+
</property>
109121
<item row="0" column="0">
110122
<widget class="QLabel" name="metronomeEnabledLabel">
111123
<property name="text">
@@ -165,9 +177,15 @@
165177
<layout class="QVBoxLayout" name="verticalLayout_5">
166178
<item>
167179
<layout class="QFormLayout" name="formLayout_4">
168-
<property name="fieldGrowthPolicy">
180+
<property name="fieldGrowthPolicy">
169181
<enum>QFormLayout::FieldGrowthPolicy::ExpandingFieldsGrow</enum>
170182
</property>
183+
<property name="formAlignment">
184+
<set>Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
185+
</property>
186+
<property name="labelAlignment">
187+
<set>Qt::AlignmentFlag::AlignLeft</set>
188+
</property>
171189
<item row="0" column="0">
172190
<widget class="QLabel" name="countInEnabledLabel">
173191
<property name="minimumSize">
@@ -179,9 +197,6 @@
179197
<property name="text">
180198
<string>Enabled:</string>
181199
</property>
182-
<property name="alignment">
183-
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
184-
</property>
185200
</widget>
186201
</item>
187202
<item row="0" column="1">
@@ -227,6 +242,12 @@
227242
<layout class="QVBoxLayout" name="verticalLayout_7">
228243
<item>
229244
<layout class="QFormLayout" name="formLayout_5">
245+
<property name="formAlignment">
246+
<set>Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
247+
</property>
248+
<property name="labelAlignment">
249+
<set>Qt::AlignmentFlag::AlignLeft</set>
250+
</property>
230251
<item row="1" column="0">
231252
<widget class="QLabel" name="openInNewWindowLabel">
232253
<property name="minimumSize">
@@ -285,6 +306,16 @@
285306
<item row="2" column="1">
286307
<widget class="QSpinBox" name="systemSpacingSpinBox"/>
287308
</item>
309+
<item row="3" column="0">
310+
<widget class="QLabel" name="drawSystemOutlineLabel">
311+
<property name="text">
312+
<string>Draw System Outline:</string>
313+
</property>
314+
</widget>
315+
</item>
316+
<item row="3" column="1">
317+
<widget class="QCheckBox" name="drawSystemOutlineCheckBox"/>
318+
</item>
288319
</layout>
289320
</item>
290321
</layout>
@@ -298,6 +329,12 @@
298329
<layout class="QVBoxLayout" name="verticalLayout_8">
299330
<item>
300331
<layout class="QFormLayout" name="formLayout_6">
332+
<property name="formAlignment">
333+
<set>Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
334+
</property>
335+
<property name="labelAlignment">
336+
<set>Qt::AlignmentFlag::AlignLeft</set>
337+
</property>
301338
<item row="0" column="0">
302339
<widget class="QLabel" name="enableAutoBackupLabel">
303340
<property name="text">
@@ -339,6 +376,12 @@
339376
</rect>
340377
</property>
341378
<layout class="QFormLayout" name="formLayout_3">
379+
<property name="formAlignment">
380+
<set>Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
381+
</property>
382+
<property name="labelAlignment">
383+
<set>Qt::AlignmentFlag::AlignLeft</set>
384+
</property>
342385
<item row="0" column="0">
343386
<widget class="QLabel" name="defaultInstrumentNameLabel">
344387
<property name="text">

0 commit comments

Comments
 (0)