diff options
Diffstat (limited to 'src/citra_qt')
-rw-r--r-- | src/citra_qt/CMakeLists.txt | 27 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 1 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 1 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_tracing.cpp | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 2 | ||||
-rw-r--r-- | src/citra_qt/main.cpp | 18 | ||||
-rw-r--r-- | src/citra_qt/main.h | 8 |
7 files changed, 39 insertions, 20 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index bbf6ae001..9b3eb2cd6 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -79,7 +79,7 @@ if (APPLE) else() add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) endif() -target_link_libraries(citra-qt core video_core common qhexedit) +target_link_libraries(citra-qt core video_core audio_core common qhexedit) target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) target_link_libraries(citra-qt ${PLATFORM_LIBRARIES}) @@ -88,9 +88,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") endif() if (Qt5_FOUND AND MSVC) + include(WindowsCopyFiles) + set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin") set(Qt5_PLATFORMS_DIR "${Qt5_DIR}/../../../plugins/platforms/") - set(Qt5_DLLS + set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/") + set(PLATFORMS ${DLL_DEST}platforms/) + + windows_copy_files(citra-qt ${Qt5_DLL_DIR} ${DLL_DEST} icudt*.dll icuin*.dll icuuc*.dll @@ -99,24 +104,8 @@ if (Qt5_FOUND AND MSVC) Qt5OpenGL$<$<CONFIG:Debug>:d>.* Qt5Widgets$<$<CONFIG:Debug>:d>.* ) - set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/") - set(PLATFORMS ${DLL_DEST}platforms/) + windows_copy_files(citra-qt ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*) - # windows commandline expects the / to be \ so switch them - string(REPLACE "/" "\\\\" Qt5_DLL_DIR ${Qt5_DLL_DIR}) - string(REPLACE "/" "\\\\" Qt5_PLATFORMS_DIR ${Qt5_PLATFORMS_DIR}) - string(REPLACE "/" "\\\\" DLL_DEST ${DLL_DEST}) - string(REPLACE "/" "\\\\" PLATFORMS ${PLATFORMS}) - - # /NJH /NJS /NDL /NFL /NC /NS /NP - Silence any output - # cmake adds an extra check for command success which doesn't work too well with robocopy - # so trick it into thinking the command was successful with the || cmd /c "exit /b 0" - add_custom_command(TARGET citra-qt POST_BUILD - COMMAND robocopy ${Qt5_DLL_DIR} ${DLL_DEST} ${Qt5_DLLS} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0" - COMMAND if not exist ${PLATFORMS} mkdir ${PLATFORMS} 2> nul - COMMAND robocopy ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.* /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0" - ) - unset(Qt5_DLLS) unset(Qt5_DLL_DIR) unset(Qt5_PLATFORMS_DIR) unset(DLL_DEST) diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index ab97c8d2d..5186d2b44 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -21,6 +21,7 @@ #include "common/vector_math.h" #include "video_core/pica.h" +#include "video_core/pica_state.h" #include "video_core/debug_utils/debug_utils.h" QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) { diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index 80b32eaff..c30e75933 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp @@ -18,6 +18,7 @@ #include "core/hw/gpu.h" #include "video_core/pica.h" +#include "video_core/pica_state.h" #include "video_core/utils.h" GraphicsFramebufferWidget::GraphicsFramebufferWidget(std::shared_ptr<Pica::DebugContext> debug_context, diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics_tracing.cpp index b0bc782df..e06498744 100644 --- a/src/citra_qt/debugger/graphics_tracing.cpp +++ b/src/citra_qt/debugger/graphics_tracing.cpp @@ -22,7 +22,7 @@ #include "nihstro/float24.h" #include "video_core/pica.h" - +#include "video_core/pica_state.h" GraphicsTracingWidget::GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext> debug_context, QWidget* parent) diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index a5a5fe6b0..a11c61667 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp @@ -19,6 +19,8 @@ #include "citra_qt/debugger/graphics_vertex_shader.h" #include "citra_qt/util/util.h" +#include "video_core/pica.h" +#include "video_core/pica_state.h" #include "video_core/shader/shader.h" using nihstro::OpCode; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 144f11117..da9ea6c91 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -171,6 +171,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) } UpdateRecentFiles(); + confirm_before_closing = settings.value("confirmClose", true).toBool(); + // Setup connections connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString))); connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile())); @@ -497,7 +499,22 @@ void GMainWindow::OnConfigure() { //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this); } +bool GMainWindow::ConfirmClose() { + if (emu_thread == nullptr || !confirm_before_closing) + return true; + + auto answer = QMessageBox::question(this, tr("Citra"), + tr("Are you sure you want to close Citra?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + return answer != QMessageBox::No; +} + void GMainWindow::closeEvent(QCloseEvent* event) { + if (!ConfirmClose()) { + event->ignore(); + return; + } + // Save window layout QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra"); @@ -512,6 +529,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked()); settings.setValue("firstStart", false); + settings.setValue("confirmClose", confirm_before_closing); game_list->SaveInterfaceLayout(settings); SaveHotkeys(settings); diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index f6d429cd9..8c195f816 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -82,6 +82,13 @@ private: */ void UpdateRecentFiles(); + /** + * If the emulation is running, + * asks the user if he really want to close the emulator + * + * @return true if the user confirmed + */ + bool ConfirmClose(); void closeEvent(QCloseEvent* event) override; private slots: @@ -122,6 +129,7 @@ private: GPUCommandListWidget* graphicsCommandsWidget; QAction* actions_recent_files[max_recent_files_item]; + bool confirm_before_closing; }; #endif // _CITRA_QT_MAIN_HXX_ |