mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-27 15:35:21 +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 -->
|
<!-- ASEPRITE -->
|
||||||
<!-- Copyright (C) 2001-2013 by David Capello -->
|
<!-- Copyright (C) 2001-2013, 2015 by David Capello -->
|
||||||
<gui>
|
<gui>
|
||||||
<window text="Warning - Important" id="advanced_mode_warning">
|
<window text="Warning - Important" id="advanced_mode">
|
||||||
<grid columns="1">
|
<grid columns="1">
|
||||||
<label text="You are going to enter in "Advanced Mode"." />
|
<label text="You are going to enter in "Advanced Mode"." />
|
||||||
<label text="" id="warning_label" />
|
<label text="" id="warning_label" />
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include "app/ui/main_window.h"
|
#include "app/ui/main_window.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
|
#include "advanced_mode.xml.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
@ -65,16 +67,14 @@ void AdvancedModeCommand::onExecute(Context* context)
|
|||||||
get_config_bool("AdvancedMode", "Warning", true)) {
|
get_config_bool("AdvancedMode", "Warning", true)) {
|
||||||
Key* key = KeyboardShortcuts::instance()->command(this->id().c_str());
|
Key* key = KeyboardShortcuts::instance()->command(this->id().c_str());
|
||||||
if (!key->accels().empty()) {
|
if (!key->accels().empty()) {
|
||||||
base::UniquePtr<Window> window(app::load_widget<Window>("advanced_mode.xml", "advanced_mode_warning"));
|
app::gen::AdvancedMode window;
|
||||||
Widget* warning_label = app::find_widget<Widget>(window, "warning_label");
|
|
||||||
Widget* donot_show = app::find_widget<Widget>(window, "donot_show");
|
|
||||||
|
|
||||||
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());
|
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…
x
Reference in New Issue
Block a user