Skip to content

Commit

Permalink
moved files from userscores to project module
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Aug 16, 2021
1 parent 36f3ea7 commit 839cd65
Show file tree
Hide file tree
Showing 84 changed files with 265 additions and 879 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ option(BUILD_SHORTCUTS_MODULE "Build shortcuts module" ON)
option(BUILD_SYSTEM_MODULE "Build system module" ON)
option(BUILD_NETWORK_MODULE "Build network module" ON)
option(BUILD_AUDIO_MODULE "Build audio module" ON)
option(BUILD_USERSCORES_MODULE "Build userscores module" ON)
option(BUILD_LEARN_MODULE "Build learn module" ON)
option(BUILD_WORKSPACE_MODULE "Build workspace module" ON)
option(BUILD_CLOUD_MODULE "Build cloud module" ON)
Expand Down
1 change: 0 additions & 1 deletion build/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#cmakedefine BUILD_SYSTEM_MODULE
#cmakedefine BUILD_NETWORK_MODULE
#cmakedefine BUILD_AUDIO_MODULE
#cmakedefine BUILD_USERSCORES_MODULE
#cmakedefine BUILD_LEARN_MODULE
#cmakedefine BUILD_WORKSPACE_MODULE
#cmakedefine BUILD_CLOUD_MODULE
Expand Down
6 changes: 1 addition & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ add_subdirectory(context)
add_subdirectory(notation)
add_subdirectory(project)

if (BUILD_USERSCORES_MODULE)
add_subdirectory(userscores)
endif (BUILD_USERSCORES_MODULE)

if (BUILD_LEARN_MODULE)
add_subdirectory(learn)
endif (BUILD_LEARN_MODULE)
Expand Down Expand Up @@ -106,7 +102,7 @@ add_subdirectory(stubs)

if (BUILD_UNIT_TESTS)
# add_subdirectory(notation/tests) no tests at moment
add_subdirectory(userscores/tests)
add_subdirectory(project/tests)

add_subdirectory(engraving/tests)
add_subdirectory(engraving/utests)
Expand Down
2 changes: 1 addition & 1 deletion src/appshell/qml/HomePage/HomePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0
import MuseScore.Dock 1.0

import MuseScore.UserScores 1.0
import MuseScore.Project 1.0
import MuseScore.Cloud 1.0
import MuseScore.Learn 1.0

Expand Down
4 changes: 2 additions & 2 deletions src/autobot/internal/steps/abscoreloadstep.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

#include "../abbasestep.h"
#include "modularity/ioc.h"
#include "userscores/ifilescorecontroller.h"
#include "project/iprojectfilescontroller.h"
#include "io/path.h"

namespace mu::autobot {
class AbScoreLoadStep : public AbBaseStep
{
INJECT(autobot, mu::userscores::IFileScoreController, fileScoreController)
INJECT(autobot, project::IFileScoreController, fileScoreController)
public:
AbScoreLoadStep() = default;

Expand Down
2 changes: 1 addition & 1 deletion src/learn/qml/MuseScore/Learn/internal/PlaylistItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import QtGraphicalEffects 1.0

import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0
import MuseScore.UserScores 1.0
import MuseScore.Project 1.0

FocusScope {
id: root
Expand Down
1 change: 0 additions & 1 deletion src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ set(LINK_LIB ${LINK_LIB}
audio
midi
midi_old
userscores
learn
notation
project
Expand Down
11 changes: 0 additions & 11 deletions src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@

#include "appshell/appshellmodule.h"
#include "context/contextmodule.h"
#ifdef BUILD_USERSCORES_MODULE
#include "userscores/userscoresmodule.h"
#else
#include "stubs/userscores/userscoresstubmodule.h"
#endif

#ifdef BUILD_LEARN_MODULE
#include "learn/learnmodule.h"
Expand Down Expand Up @@ -213,12 +208,6 @@ int main(int argc, char** argv)
#endif
app.addModule(new mu::midi::MidiModule());

#ifdef BUILD_USERSCORES_MODULE
app.addModule(new mu::userscores::UserScoresModule());
#else
app.addModule(new mu::userscores::UserScoresStubModule());
#endif

app.addModule(new mu::learn::LearnModule());

app.addModule(new mu::engraving::EngravingModule());
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/api/qmlpluginapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PluginAPI : public Ms::QmlPlugin
Q_OBJECT

INJECT(plugins, mu::shortcuts::IShortcutsController, shortcuts)
INJECT(userscores, mu::context::IGlobalContext, context)
INJECT(plugins, mu::context::IGlobalContext, context)

/** Path where the plugin is placed in menu */
Q_PROPERTY(QString menuPath READ menuPath WRITE setMenuPath)
Expand Down
17 changes: 15 additions & 2 deletions src/project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

set(MODULE project)

#set(MODULE_QRC project.qrc)
set(MODULE_QRC project.qrc)

#set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml )
set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml)

include(GetPlatformInfo)

Expand Down Expand Up @@ -97,13 +97,26 @@ set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/internal/recentprojectsprovider.h
${CMAKE_CURRENT_LIST_DIR}/internal/mscmetareader.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/mscmetareader.h
${CMAKE_CURRENT_LIST_DIR}/internal/itemplatesrepository.h
${CMAKE_CURRENT_LIST_DIR}/internal/templatesrepository.cpp
${CMAKE_CURRENT_LIST_DIR}/internal/templatesrepository.h

${PLATFORM_SRC}

${CMAKE_CURRENT_LIST_DIR}/view/exportdialogmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/exportdialogmodel.h
${CMAKE_CURRENT_LIST_DIR}/view/recentprojectsmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/recentprojectsmodel.h
${CMAKE_CURRENT_LIST_DIR}/view/newscoremodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/newscoremodel.h
${CMAKE_CURRENT_LIST_DIR}/view/additionalinfomodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/additionalinfomodel.h
${CMAKE_CURRENT_LIST_DIR}/view/scorethumbnail.cpp
${CMAKE_CURRENT_LIST_DIR}/view/scorethumbnail.h
${CMAKE_CURRENT_LIST_DIR}/view/templatesmodel.cpp
${CMAKE_CURRENT_LIST_DIR}/view/templatesmodel.h
${CMAKE_CURRENT_LIST_DIR}/view/templatepaintview.cpp
${CMAKE_CURRENT_LIST_DIR}/view/templatepaintview.h

)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef MU_USERSCORES_ITEMPLATESREPOSITORY_H
#define MU_USERSCORES_ITEMPLATESREPOSITORY_H
#ifndef MU_PROJECT_ITEMPLATESREPOSITORY_H
#define MU_PROJECT_ITEMPLATESREPOSITORY_H

#include "modularity/imoduleexport.h"
#include "userscores/userscorestypes.h"
#include "notation/notationtypes.h"
#include "project/projecttypes.h"

#include "retval.h"

namespace mu::userscores {
namespace mu::project {
class ITemplatesRepository : MODULE_EXPORT_INTERFACE
{
INTERFACE_ID(ITemplatesRepository)
Expand All @@ -41,4 +40,4 @@ class ITemplatesRepository : MODULE_EXPORT_INTERFACE
};
}

#endif // MU_USERSCORES_ITEMPLATESREPOSITORY_H
#endif // MU_PROJECT_ITEMPLATESREPOSITORY_H
2 changes: 1 addition & 1 deletion src/project/internal/projectconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace mu::notation;

static const std::string module_name("project");

static const Settings::Key RECENT_PROJECTS_PATHS(module_name, "userscores/recentList");
static const Settings::Key RECENT_PROJECTS_PATHS(module_name, "project/recentList");
static const Settings::Key USER_TEMPLATES_PATH(module_name, "application/paths/myTemplates");
static const Settings::Key USER_PROJECTS_PATH(module_name, "application/paths/myScores");
static const Settings::Key PREFERRED_SCORE_CREATION_MODE_KEY(module_name, "userscores/preferredScoreCreationMode");
Expand Down
4 changes: 2 additions & 2 deletions src/project/internal/projectfilescontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void ProjectFilesController::newProject()
return;
}

Ret ret = interactive()->open("musescore://userscores/newscore").ret;
Ret ret = interactive()->open("musescore://project/newscore").ret;

if (ret) {
ret = interactive()->open("musescore://notation").ret;
Expand Down Expand Up @@ -401,7 +401,7 @@ void ProjectFilesController::continueLastSession()

void ProjectFilesController::exportScore()
{
interactive()->open("musescore://userscores/export");
interactive()->open("musescore://project/export");
}

io::path ProjectFilesController::selectScoreOpeningFile()
Expand Down
16 changes: 8 additions & 8 deletions src/project/internal/projectfilescontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
namespace mu::project {
class ProjectFilesController : public IProjectFilesController, public actions::Actionable, public async::Asyncable
{
INJECT(userscores, actions::IActionsDispatcher, dispatcher)
INJECT(userscores, framework::IInteractive, interactive)
INJECT(userscores, IProjectCreator, projectCreator)
INJECT(userscores, context::IGlobalContext, globalContext)
INJECT(userscores, IProjectConfiguration, configuration)
INJECT(userscores, IPlatformRecentFilesController, platformRecentFilesController)
INJECT(userscores, mi::IMultiInstancesProvider, multiInstancesProvider)
INJECT(userscores, cloud::IUploadingService, uploadingService)
INJECT(project, actions::IActionsDispatcher, dispatcher)
INJECT(project, framework::IInteractive, interactive)
INJECT(project, IProjectCreator, projectCreator)
INJECT(project, context::IGlobalContext, globalContext)
INJECT(project, IProjectConfiguration, configuration)
INJECT(project, IPlatformRecentFilesController, platformRecentFilesController)
INJECT(project, mi::IMultiInstancesProvider, multiInstancesProvider)
INJECT(project, cloud::IUploadingService, uploadingService)

public:
void init();
Expand Down
14 changes: 7 additions & 7 deletions src/project/internal/projectuiactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using namespace mu::project;
using namespace mu::ui;

const UiActionList UserScoresUiActions::m_actions = {
const UiActionList ProjectUiActions::m_actions = {
UiAction("file-open",
mu::context::UiCtxAny,
QT_TRANSLATE_NOOP("action", "Open..."),
Expand Down Expand Up @@ -88,17 +88,17 @@ const UiActionList UserScoresUiActions::m_actions = {
)
};

UserScoresUiActions::UserScoresUiActions(std::shared_ptr<ProjectFilesController> controller)
ProjectUiActions::ProjectUiActions(std::shared_ptr<ProjectFilesController> controller)
: m_controller(controller)
{
}

const UiActionList& UserScoresUiActions::actionsList() const
const UiActionList& ProjectUiActions::actionsList() const
{
return m_actions;
}

bool UserScoresUiActions::actionEnabled(const UiAction& act) const
bool ProjectUiActions::actionEnabled(const UiAction& act) const
{
if (!m_controller->canReceiveAction(act.code)) {
return false;
Expand All @@ -107,17 +107,17 @@ bool UserScoresUiActions::actionEnabled(const UiAction& act) const
return true;
}

bool UserScoresUiActions::actionChecked(const UiAction&) const
bool ProjectUiActions::actionChecked(const UiAction&) const
{
return false;
}

mu::async::Channel<mu::actions::ActionCodeList> UserScoresUiActions::actionEnabledChanged() const
mu::async::Channel<mu::actions::ActionCodeList> ProjectUiActions::actionEnabledChanged() const
{
return m_actionEnabledChanged;
}

mu::async::Channel<mu::actions::ActionCodeList> UserScoresUiActions::actionCheckedChanged() const
mu::async::Channel<mu::actions::ActionCodeList> ProjectUiActions::actionCheckedChanged() const
{
return m_actionCheckedChanged;
}
4 changes: 2 additions & 2 deletions src/project/internal/projectuiactions.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include "context/iuicontextresolver.h"

namespace mu::project {
class UserScoresUiActions : public ui::IUiActionsModule
class ProjectUiActions : public ui::IUiActionsModule
{
INJECT(project, context::IUiContextResolver, uicontextResolver)
public:

UserScoresUiActions(std::shared_ptr<ProjectFilesController> controller);
ProjectUiActions(std::shared_ptr<ProjectFilesController> controller);

const ui::UiActionList& actionsList() const override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

using namespace mu;
using namespace mu::project;
using namespace mu::userscores;

RetVal<Templates> TemplatesRepository::templates() const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef MU_USERSCORES_TEMPLATESREPOSITORY_H
#define MU_USERSCORES_TEMPLATESREPOSITORY_H
#ifndef MU_PROJECT_TEMPLATESREPOSITORY_H
#define MU_PROJECT_TEMPLATESREPOSITORY_H

#include "modularity/ioc.h"

Expand All @@ -30,12 +30,12 @@
#include "project/imscmetareader.h"
#include "system/ifilesystem.h"

namespace mu::userscores {
namespace mu::project {
class TemplatesRepository : public ITemplatesRepository
{
INJECT(userscores, project::IProjectConfiguration, configuration)
INJECT(userscores, project::IMscMetaReader, mscReader)
INJECT(userscores, system::IFileSystem, fileSystem)
INJECT(project, IProjectConfiguration, configuration)
INJECT(project, IMscMetaReader, mscReader)
INJECT(project, system::IFileSystem, fileSystem)

public:
RetVal<Templates> templates() const override;
Expand All @@ -46,4 +46,4 @@ class TemplatesRepository : public ITemplatesRepository
};
}

#endif // MU_USERSCORES_TEMPLATESREPOSITORY_H
#endif // MU_PROJECT_TEMPLATESREPOSITORY_H
36 changes: 36 additions & 0 deletions src/project/project.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<RCC>
<qresource prefix="/">
<file>qml/MuseScore/Project/qmldir</file>
<file>qml/MuseScore/Project/NewScoreDialog.qml</file>
<file>qml/MuseScore/Project/ScoresPage.qml</file>
<file>qml/MuseScore/Project/ExportDialog.qml</file>
<file>qml/MuseScore/Project/internal/AdditionalInfoView.qml</file>
<file>qml/MuseScore/Project/internal/GeneralInfoItem.qml</file>
<file>qml/MuseScore/Project/internal/KeySignatureListView.qml</file>
<file>qml/MuseScore/Project/internal/KeySignatureSettings.qml</file>
<file>qml/MuseScore/Project/internal/KeySignature.qml</file>
<file>qml/MuseScore/Project/internal/MeasuresSettings.qml</file>
<file>qml/MuseScore/Project/internal/RecentScoresView.qml</file>
<file>qml/MuseScore/Project/internal/ScoreItem.qml</file>
<file>qml/MuseScore/Project/internal/TemplatePreview.qml</file>
<file>qml/MuseScore/Project/internal/TempoSettings.qml</file>
<file>qml/MuseScore/Project/internal/TimeSignatureFraction.qml</file>
<file>qml/MuseScore/Project/internal/TimeSignatureSettings.qml</file>
<file>qml/MuseScore/Project/internal/TimeSignatureView.qml</file>
<file>qml/MuseScore/Project/internal/TitleListView.qml</file>
<file>qml/MuseScore/Project/internal/GeneralInfoView.qml</file>
<file>qml/MuseScore/Project/internal/ChooseInstrumentsAndTemplatesPage.qml</file>
<file>qml/MuseScore/Project/internal/ChooseTemplatePage.qml</file>
<file>qml/MuseScore/Project/internal/ScoreInfoPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/ExportScoresListView.qml</file>
<file>qml/MuseScore/Project/internal/Export/ExportOptionsView.qml</file>
<file>qml/MuseScore/Project/internal/Export/ExportOptionItem.qml</file>
<file>qml/MuseScore/Project/internal/Export/PdfSettingsPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/PngSettingsPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/SvgSettingsPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/Mp3SettingsPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/AudioSettingsPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/MidiSettingsPage.qml</file>
<file>qml/MuseScore/Project/internal/Export/MusicXmlSettingsPage.qml</file>
</qresource>
</RCC>
Loading

0 comments on commit 839cd65

Please sign in to comment.