mirror of https://github.com/AxioDL/amuse.git
Use manual Qt macros in CMake
This commit is contained in:
parent
57cbbf24b1
commit
c2a242022a
|
@ -1,9 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(AUTORCC ON)
|
||||
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5Network)
|
||||
|
@ -31,9 +28,28 @@ QT5_CREATE_TRANSLATION(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOUR
|
|||
QT5_ADD_RESOURCES(qrc_resources.cpp resources/resources.qrc)
|
||||
QT5_ADD_RESOURCES(qrc_translation_res.cpp ${CMAKE_CURRENT_BINARY_DIR}/translation_res.qrc OPTIONS -no-compress)
|
||||
|
||||
QT5_WRAP_UI(MAIN_WINDOW_UI MainWindow.ui)
|
||||
|
||||
QT5_WRAP_CPP(AMUSE_MOC
|
||||
Common.hpp
|
||||
MainWindow.hpp
|
||||
KeyboardWidget.hpp
|
||||
StatusBarWidget.hpp
|
||||
ProjectModel.hpp
|
||||
ProjectStatistics.hpp
|
||||
EditorWidget.hpp
|
||||
SoundMacroEditor.hpp
|
||||
ADSREditor.hpp
|
||||
CurveEditor.hpp
|
||||
KeymapEditor.hpp
|
||||
LayersEditor.hpp
|
||||
SampleEditor.hpp
|
||||
SoundGroupEditor.hpp
|
||||
SongGroupEditor.hpp)
|
||||
|
||||
add_executable(amuse-gui WIN32 MACOSX_BUNDLE
|
||||
Common.hpp Common.cpp
|
||||
MainWindow.ui MainWindow.hpp MainWindow.cpp
|
||||
MainWindow.ui ${MAIN_WINDOW_UI} MainWindow.hpp MainWindow.cpp
|
||||
KeyboardWidget.hpp KeyboardWidget.cpp
|
||||
StatusBarWidget.hpp
|
||||
ProjectModel.hpp ProjectModel.cpp
|
||||
|
@ -50,7 +66,7 @@ add_executable(amuse-gui WIN32 MACOSX_BUNDLE
|
|||
MIDIReader.hpp MIDIReader.cpp
|
||||
resources/resources.qrc qrc_resources.cpp
|
||||
${QM_FILES} qrc_translation_res.cpp
|
||||
${PLAT_SRCS}
|
||||
${AMUSE_MOC} ${PLAT_SRCS}
|
||||
main.cpp)
|
||||
if(COMMAND add_sanitizers)
|
||||
add_sanitizers(amuse-gui)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "Common.hpp"
|
||||
#include "MainWindow.hpp"
|
||||
#include <QMessageBox>
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
|
@ -31,8 +32,8 @@ bool MkPath(const QDir& dir, const QString& file, UIMessenger& messenger)
|
|||
{
|
||||
if (!dir.mkpath(file))
|
||||
{
|
||||
QString msg = QString(QObject::tr("A directory at '%1/%2' could not be created.")).arg(dir.path()).arg(file);
|
||||
messenger.critical(QObject::tr("Unable to create directory"), msg);
|
||||
QString msg = QString(MainWindow::tr("A directory at '%1/%2' could not be created.")).arg(dir.path()).arg(file);
|
||||
messenger.critical(MainWindow::tr("Unable to create directory"), msg);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -46,10 +47,8 @@ void ShowInGraphicalShell(QWidget* parent, const QString& pathIn)
|
|||
const FileName explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe"));
|
||||
if (explorer.isEmpty()) {
|
||||
QMessageBox::warning(parent,
|
||||
QApplication::translate("Core::Internal",
|
||||
"Launching Windows Explorer Failed"),
|
||||
QApplication::translate("Core::Internal",
|
||||
"Could not find explorer.exe in path to launch Windows Explorer."));
|
||||
MainWindow::tr("Launching Windows Explorer Failed"),
|
||||
MainWindow::tr("Could not find explorer.exe in path to launch Windows Explorer."));
|
||||
return;
|
||||
}
|
||||
QStringList param;
|
||||
|
@ -79,10 +78,10 @@ void ShowInGraphicalShell(QWidget* parent, const QString& pathIn)
|
|||
QString ShowInGraphicalShellString()
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
return QObject::tr("Show in Explorer");
|
||||
return MainWindow::tr("Show in Explorer");
|
||||
#elif defined(Q_OS_MAC)
|
||||
return QObject::tr("Show in Finder");
|
||||
return MainWindow::tr("Show in Finder");
|
||||
#else
|
||||
return QObject::tr("Show in Browser");
|
||||
return MainWindow::tr("Show in Browser");
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -431,7 +431,7 @@ class DeleteNodeUndoCommand : public QUndoCommand
|
|||
amuse::ObjToken<ProjectModel::INode> m_node;
|
||||
public:
|
||||
DeleteNodeUndoCommand(const QModelIndex& index)
|
||||
: QUndoCommand(QUndoStack::tr("Delete %1").arg(index.data().toString())), m_deleteIdx(index) {}
|
||||
: QUndoCommand(ProjectModel::tr("Delete %1").arg(index.data().toString())), m_deleteIdx(index) {}
|
||||
void undo()
|
||||
{
|
||||
g_MainWindow->projectModel()->_undoDel(m_deleteIdx, std::move(m_node));
|
||||
|
|
|
@ -456,7 +456,7 @@ class SampLoopUndoCommand : public EditorUndoCommand
|
|||
public:
|
||||
SampLoopUndoCommand(uint32_t redoStart, uint32_t redoEnd, const QString& fieldName,
|
||||
int fieldIdx, amuse::ObjToken<ProjectModel::SampleNode> node)
|
||||
: EditorUndoCommand(node.get(), QUndoStack::tr("Change %1").arg(fieldName)),
|
||||
: EditorUndoCommand(node.get(), SampleControls::tr("Change %1").arg(fieldName)),
|
||||
m_redoStartVal(redoStart), m_redoEndVal(redoEnd), m_fieldIdx(fieldIdx) {}
|
||||
void undo()
|
||||
{
|
||||
|
@ -574,7 +574,7 @@ class SampPitchUndoCommand : public EditorUndoCommand
|
|||
bool m_undid = false;
|
||||
public:
|
||||
SampPitchUndoCommand(atUint8 redoPitch, amuse::ObjToken<ProjectModel::SampleNode> node)
|
||||
: EditorUndoCommand(node.get(), QUndoStack::tr("Change Base Pitch")),
|
||||
: EditorUndoCommand(node.get(), SampleControls::tr("Change Base Pitch")),
|
||||
m_redoPitchVal(redoPitch) {}
|
||||
void undo()
|
||||
{
|
||||
|
|
|
@ -347,7 +347,7 @@ public:
|
|||
ValChangedUndoCommand(amuse::SoundMacro::ICmd* cmd, const QString& fieldName,
|
||||
const amuse::SoundMacro::CmdIntrospection::Field& field,
|
||||
int redoVal, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), QUndoStack::tr("Change %1").arg(fieldName)),
|
||||
: EditorUndoCommand(node.get(), CommandWidget::tr("Change %1").arg(fieldName)),
|
||||
m_cmd(cmd), m_field(field), m_redoVal(redoVal) {}
|
||||
void undo()
|
||||
{
|
||||
|
@ -673,7 +673,7 @@ class ReorderCommandsUndoCommand : public EditorUndoCommand
|
|||
bool m_undid = false;
|
||||
public:
|
||||
ReorderCommandsUndoCommand(int a, int b, const QString& text, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), QUndoStack::tr("Reorder %1").arg(text)), m_a(a), m_b(b) {}
|
||||
: EditorUndoCommand(node.get(), SoundMacroListing::tr("Reorder %1").arg(text)), m_a(a), m_b(b) {}
|
||||
void undo()
|
||||
{
|
||||
m_undid = true;
|
||||
|
@ -805,7 +805,7 @@ class InsertCommandUndoCommand : public EditorUndoCommand
|
|||
std::unique_ptr<amuse::SoundMacro::ICmd> m_cmd;
|
||||
public:
|
||||
InsertCommandUndoCommand(int insertIdx, const QString& text, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), QUndoStack::tr("Insert %1").arg(text)), m_insertIdx(insertIdx) {}
|
||||
: EditorUndoCommand(node.get(), SoundMacroListing::tr("Insert %1").arg(text)), m_insertIdx(insertIdx) {}
|
||||
void undo()
|
||||
{
|
||||
m_cmd = m_node.cast<ProjectModel::SoundMacroNode>()->m_obj->deleteCmd(m_insertIdx);
|
||||
|
@ -858,7 +858,7 @@ class DeleteCommandUndoCommand : public EditorUndoCommand
|
|||
bool m_undid = false;
|
||||
public:
|
||||
DeleteCommandUndoCommand(int deleteIdx, const QString& text, amuse::ObjToken<ProjectModel::SoundMacroNode> node)
|
||||
: EditorUndoCommand(node.get(), QUndoStack::tr("Delete %1").arg(text)), m_deleteIdx(deleteIdx) {}
|
||||
: EditorUndoCommand(node.get(), SoundMacroListing::tr("Delete %1").arg(text)), m_deleteIdx(deleteIdx) {}
|
||||
void undo()
|
||||
{
|
||||
m_undid = true;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue