|
21 | 21 | */ |
22 | 22 |
|
23 | 23 | #include "welcomedialogmodel.h" |
| 24 | + |
| 25 | +#include "translation.h" |
24 | 26 | #include "log.h" |
25 | 27 |
|
26 | 28 | using namespace mu::appshell; |
27 | 29 |
|
| 30 | +static std::vector<QVariantMap> welcomeDialogData() |
| 31 | +{ |
| 32 | + QVariantMap item1; |
| 33 | + item1.insert("title", muse::qtrc("appshell/welcome", "Enjoy free cloud storage")); |
| 34 | + item1.insert("imageUrl", "qrc:/resources/welcomedialog/MuseScoreCom.png"); |
| 35 | + item1.insert("description", muse::qtrc("appshell/welcome", |
| 36 | + "Save your scores privately on MuseScore.com to revisit past versions and invite others to view and comment – and when you’re ready, share your music with the world.")); |
| 37 | + item1.insert("buttonText", muse::qtrc("appshell/welcome", "View my scores online")); |
| 38 | + item1.insert("destinationUrl", |
| 39 | + "https://musescore.com/my-scores?utm_source=mss-app-welcome-musescore-com&utm_medium=mss-app-welcome-musescore-com&utm_campaign=mss-app-welcome-musescore-com"); |
| 40 | + |
| 41 | + QVariantMap item2; |
| 42 | + item2.insert("title", muse::qtrc("appshell/welcome", "What’s new in MuseScore Studio")); |
| 43 | + item2.insert("imageUrl", "qrc:/resources/welcomedialog/WhatsNew.png"); |
| 44 | + item2.insert("description", muse::qtrc("appshell/welcome", |
| 45 | + "Includes a new system for hiding empty staves, a new text editing widget, guitar notation improvements, engraving improvements and more.")); |
| 46 | + item2.insert("buttonText", muse::qtrc("appshell/welcome", "Watch video")); |
| 47 | + item2.insert("destinationUrl", |
| 48 | + "https://www.youtube.com/watch?v=J2gY9CbMuoI&utm_source=mss-app-yt-4.6-release&utm_medium=mss-app-yt-4.6-release&utm_campaign=mss-app-yt-4.6-release"); |
| 49 | + |
| 50 | + QVariantMap item3; |
| 51 | + item3.insert("title", muse::qtrc("appshell/welcome", "Install our free MuseSounds libraries")); |
| 52 | + item3.insert("imageUrl", "qrc:/resources/welcomedialog/MuseSounds.png"); |
| 53 | + item3.insert("description", muse::qtrc("appshell/welcome", |
| 54 | + "Explore our collection of realistic sample libraries, including solo instruments, marching percussion, and full orchestra - available for free on MuseHub.")); |
| 55 | + item3.insert("buttonText", muse::qtrc("appshell/welcome", "Get it on MuseHub")); |
| 56 | + item3.insert("destinationUrl", |
| 57 | + "https://www.musehub.com/free-musesounds?utm_source=mss-app-welcome-free-musesounds&utm_medium=mss-app-welcome-free-musesounds&utm_campaign=mss-app-welcome-free-musesounds&utm_id=mss-app-welcome-free-musesounds"); |
| 58 | + |
| 59 | + QVariantMap item4; |
| 60 | + item4.insert("title", muse::qtrc("appshell/welcome", "Explore our tutorials")); |
| 61 | + item4.insert("imageUrl", "qrc:/resources/welcomedialog/ExploreTutorials.png"); |
| 62 | + item4.insert("description", muse::qtrc("appshell/welcome", |
| 63 | + "We’ve put together a playlist of tutorials to help both beginners and experienced users get the most out of MuseScore Studio.")); |
| 64 | + item4.insert("buttonText", muse::qtrc("appshell/welcome", "View tutorials")); |
| 65 | + item4.insert("destinationUrl", |
| 66 | + "https://www.youtube.com/playlist?list=PLTYuWi2LmaPECOZrC6bkPHBkYY9_WEexT&utm_source=mss-app-welcome-tutorials&utm_medium=mss-app-welcome-tutorials&utm_campaign=mss-app-welcome-tutorials&utm_id=mss-app-welcome-tutorials"); |
| 67 | + |
| 68 | + return { item1, item2, item3, item4 }; |
| 69 | +} |
| 70 | + |
28 | 71 | WelcomeDialogModel::WelcomeDialogModel() |
29 | 72 | : muse::Contextable(muse::iocCtxForQmlObject(this)) |
30 | 73 | { |
31 | 74 | } |
32 | 75 |
|
33 | 76 | void WelcomeDialogModel::init() |
34 | 77 | { |
35 | | - IF_ASSERT_FAILED(startupScenario() && configuration()) { |
| 78 | + IF_ASSERT_FAILED(configuration()) { |
36 | 79 | return; |
37 | 80 | } |
38 | 81 |
|
39 | | - m_items = startupScenario()->welcomeDialogData(); |
| 82 | + m_items = welcomeDialogData(); |
40 | 83 |
|
41 | 84 | m_currentIndex = configuration()->welcomeDialogLastShownIndex(); |
42 | 85 | nextItem(); |
@@ -99,6 +142,10 @@ bool WelcomeDialogModel::showOnStartup() const |
99 | 142 |
|
100 | 143 | void WelcomeDialogModel::setShowOnStartup(bool show) |
101 | 144 | { |
| 145 | + if (show == showOnStartup()) { |
| 146 | + return; |
| 147 | + } |
| 148 | + |
102 | 149 | configuration()->setWelcomeDialogShowOnStartup(show); |
103 | 150 | emit showOnStartupChanged(); |
104 | 151 | } |
0 commit comments