Use advanced_mode.xml.h in cmd_advanced_mode.cpp

This commit is contained in:
David Capello 2015-09-22 17:27:47 -03:00
parent 52d091810b
commit d55017cd17
2 changed files with 8 additions and 8 deletions

View File

@ -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 &quot;Advanced Mode&quot;." />
<label text="" id="warning_label" />

View File

@ -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());
}
}
}