mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-12 15:40:36 +00:00
Use advanced_mode.xml.h in cmd_advanced_mode.cpp
This commit is contained in:
parent
52d091810b
commit
d55017cd17
@ -1,7 +1,7 @@
|
||||
<!-- ASEPRITE -->
|
||||
<!-- Copyright (C) 2001-2013 by David Capello -->
|
||||
<!-- Copyright (C) 2001-2013, 2015 by David Capello -->
|
||||
<gui>
|
||||
<window text="Warning - Important" id="advanced_mode_warning">
|
||||
<window text="Warning - Important" id="advanced_mode">
|
||||
<grid columns="1">
|
||||
<label text="You are going to enter in "Advanced Mode"." />
|
||||
<label text="" id="warning_label" />
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include "app/ui/main_window.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
#include "advanced_mode.xml.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace app {
|
||||
@ -65,16 +67,14 @@ void AdvancedModeCommand::onExecute(Context* context)
|
||||
get_config_bool("AdvancedMode", "Warning", true)) {
|
||||
Key* key = KeyboardShortcuts::instance()->command(this->id().c_str());
|
||||
if (!key->accels().empty()) {
|
||||
base::UniquePtr<Window> window(app::load_widget<Window>("advanced_mode.xml", "advanced_mode_warning"));
|
||||
Widget* warning_label = app::find_widget<Widget>(window, "warning_label");
|
||||
Widget* donot_show = app::find_widget<Widget>(window, "donot_show");
|
||||
app::gen::AdvancedMode window;
|
||||
|
||||
warning_label->setTextf("You can go back pressing \"%s\" key.",
|
||||
window.warningLabel()->setTextf("You can go back pressing \"%s\" key.",
|
||||
key->accels().front().toString().c_str());
|
||||
|
||||
window->openWindowInForeground();
|
||||
window.openWindowInForeground();
|
||||
|
||||
set_config_bool("AdvancedMode", "Warning", !donot_show->isSelected());
|
||||
set_config_bool("AdvancedMode", "Warning", !window.donotShow()->isSelected());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user