-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented stubs for userscores module
- Loading branch information
1 parent
d981e7c
commit b0ce85b
Showing
29 changed files
with
390 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#============================================================================= | ||
# MuseScore | ||
# Music Composition & Notation | ||
# | ||
# Copyright (C) 2020 MuseScore BVBA and others | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License version 2. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
#============================================================================= | ||
|
||
set(MODULE userscores) | ||
|
||
set(MODULE_QRC userscores.qrc) | ||
|
||
set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml) | ||
|
||
set(MODULE_SRC | ||
${CMAKE_CURRENT_LIST_DIR}/userscoresstubmodule.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/userscoresstubmodule.h | ||
${CMAKE_CURRENT_LIST_DIR}/filescorecontrollerstub.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/filescorecontrollerstub.h | ||
${CMAKE_CURRENT_LIST_DIR}/userscoresconfigurationstub.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/userscoresconfigurationstub.h | ||
) | ||
|
||
include(${PROJECT_SOURCE_DIR}/build/module.cmake) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// | ||
// Copyright (C) 2020 MuseScore BVBA and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
//============================================================================= | ||
#include "filescorecontrollerstub.h" | ||
|
||
using namespace mu::userscores; | ||
|
||
void FileScoreControllerStub::openScore(const mu::actions::ActionData&) | ||
{ | ||
} | ||
|
||
void FileScoreControllerStub::importScore() | ||
{ | ||
} | ||
|
||
void FileScoreControllerStub::newScore() | ||
{ | ||
} | ||
|
||
void FileScoreControllerStub::saveScore() | ||
{ | ||
} | ||
|
||
void FileScoreControllerStub::saveScoreAs() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// | ||
// Copyright (C) 2020 MuseScore BVBA and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
//============================================================================= | ||
#ifndef MU_USERSCORES_FILESCORECONTROLLERSTUB_H | ||
#define MU_USERSCORES_FILESCORECONTROLLERSTUB_H | ||
|
||
#include "userscores/ifilescorecontroller.h" | ||
|
||
namespace mu::userscores { | ||
class FileScoreControllerStub : public IFileScoreController | ||
{ | ||
public: | ||
void openScore(const actions::ActionData& args = actions::ActionData()) override; | ||
void importScore() override; | ||
void newScore() override; | ||
|
||
void saveScore() override; | ||
void saveScoreAs() override; | ||
}; | ||
} | ||
|
||
#endif // MU_USERSCORES_FILESCORECONTROLLERSTUB_H |
23 changes: 23 additions & 0 deletions
23
src/stubs/userscores/qml/MuseScore/UserScores/NewScoreDialog.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import QtQuick 2.15 | ||
|
||
import MuseScore.Ui 1.0 | ||
import MuseScore.UiComponents 1.0 | ||
|
||
QmlDialog { | ||
id: root | ||
|
||
height: 600 | ||
width: 1024 | ||
|
||
title: "New Score" | ||
|
||
Rectangle { | ||
anchors.fill: parent | ||
color: ui.theme.backgroundPrimaryColor | ||
|
||
StyledTextLabel { | ||
anchors.centerIn: parent | ||
text: "New Score Dialog Stub" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/stubs/userscores/qml/MuseScore/UserScores/ScoresPage.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import QtQuick 2.15 | ||
|
||
import MuseScore.UiComponents 1.0 | ||
|
||
Rectangle { | ||
color: ui.theme.backgroundPrimaryColor | ||
|
||
StyledTextLabel { | ||
anchors.centerIn: parent | ||
text: "Score Page Stub" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module MuseScore.UserScores | ||
ScoresPage 1.0 ScoresPage.qml | ||
NewScoreDialog 1.0 NewScoreDialog.qml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>qml/MuseScore/UserScores/qmldir</file> | ||
<file>qml/MuseScore/UserScores/NewScoreDialog.qml</file> | ||
<file>qml/MuseScore/UserScores/ScoresPage.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// | ||
// Copyright (C) 2020 MuseScore BVBA and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
//============================================================================= | ||
#include "userscoresconfigurationstub.h" | ||
|
||
using namespace mu::userscores; | ||
using namespace mu; | ||
|
||
ValCh<QStringList> UserScoresConfigurationStub::recentScoreList() const | ||
{ | ||
return ValCh<QStringList>(); | ||
} | ||
|
||
void UserScoresConfigurationStub::setRecentScoreList(const QStringList&) | ||
{ | ||
} | ||
|
||
io::paths UserScoresConfigurationStub::templatesDirPaths() const | ||
{ | ||
return {}; | ||
} | ||
|
||
io::path UserScoresConfigurationStub::scoresPath() const | ||
{ | ||
return io::path(); | ||
} | ||
|
||
io::path UserScoresConfigurationStub::defaultSavingFilePath(const std::string&) const | ||
{ | ||
return io::path(); | ||
} | ||
|
||
QColor UserScoresConfigurationStub::templatePreviewBackgroundColor() const | ||
{ | ||
return QColor(); | ||
} | ||
|
||
async::Channel<QColor> UserScoresConfigurationStub::templatePreviewBackgroundColorChanged() const | ||
{ | ||
return async::Channel<QColor>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// | ||
// Copyright (C) 2020 MuseScore BVBA and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
//============================================================================= | ||
#ifndef MU_USERSCORES_USERSCORESCONFIGURATIONSTUB_H | ||
#define MU_USERSCORES_USERSCORESCONFIGURATIONSTUB_H | ||
|
||
#include "userscores/iuserscoresconfiguration.h" | ||
|
||
namespace mu::userscores { | ||
class UserScoresConfigurationStub : public IUserScoresConfiguration | ||
{ | ||
public: | ||
ValCh<QStringList> recentScoreList() const override; | ||
void setRecentScoreList(const QStringList& recentScoreList) override; | ||
|
||
io::paths templatesDirPaths() const override; | ||
io::path scoresPath() const override; | ||
io::path defaultSavingFilePath(const std::string& fileName) const override; | ||
|
||
QColor templatePreviewBackgroundColor() const override; | ||
async::Channel<QColor> templatePreviewBackgroundColorChanged() const override; | ||
}; | ||
} | ||
|
||
#endif // MU_USERSCORES_USERSCORESCONFIGURATIONSTUB_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//============================================================================= | ||
// MuseScore | ||
// Music Composition & Notation | ||
// | ||
// Copyright (C) 2020 MuseScore BVBA and others | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
//============================================================================= | ||
#include "userscoresstubmodule.h" | ||
|
||
#include "modularity/ioc.h" | ||
#include "ui/iuiengine.h" | ||
|
||
#include "filescorecontrollerstub.h" | ||
#include "userscoresconfigurationstub.h" | ||
#include "ui/iinteractiveuriregister.h" | ||
|
||
using namespace mu::userscores; | ||
using namespace mu::framework; | ||
using namespace mu::ui; | ||
|
||
static void userscores_init_qrc() | ||
{ | ||
Q_INIT_RESOURCE(userscores); | ||
} | ||
|
||
std::string UserScoresStubModule::moduleName() const | ||
{ | ||
return "userscores_stub"; | ||
} | ||
|
||
void UserScoresStubModule::registerExports() | ||
{ | ||
ioc()->registerExport<IFileScoreController>(moduleName(), new FileScoreControllerStub()); | ||
ioc()->registerExport<IUserScoresConfiguration>(moduleName(), new UserScoresConfigurationStub()); | ||
} | ||
|
||
void UserScoresStubModule::resolveImports() | ||
{ | ||
auto ir = ioc()->resolve<IInteractiveUriRegister>(moduleName()); | ||
if (ir) { | ||
ir->registerUri(Uri("musescore://userscores/newscore"), | ||
ContainerMeta(ContainerType::QmlDialog, "MuseScore/UserScores/NewScoreDialog.qml")); | ||
} | ||
} | ||
|
||
void UserScoresStubModule::registerResources() | ||
{ | ||
userscores_init_qrc(); | ||
} | ||
|
||
void UserScoresStubModule::registerUiTypes() | ||
{ | ||
ioc()->resolve<ui::IUiEngine>(moduleName())->addSourceImportPath(userscores_QML_IMPORT); | ||
} |
Oops, something went wrong.