diff --git a/src/app/commands/cmd_canvas_size.cpp b/src/app/commands/cmd_canvas_size.cpp index 8f79ead11..91b5e5d2a 100644 --- a/src/app/commands/cmd_canvas_size.cpp +++ b/src/app/commands/cmd_canvas_size.cpp @@ -80,7 +80,7 @@ public: m_editor->backToPreviousState(); } - bool pressedOk() { return getKiller() == ok(); } + bool pressedOk() { return closer() == ok(); } int getWidth() { return width()->textInt(); } int getHeight() { return height()->textInt(); } diff --git a/src/app/commands/cmd_color_quantization.cpp b/src/app/commands/cmd_color_quantization.cpp index 39be8fa40..11d777a38 100644 --- a/src/app/commands/cmd_color_quantization.cpp +++ b/src/app/commands/cmd_color_quantization.cpp @@ -123,7 +123,7 @@ void ColorQuantizationCommand::onExecute(Context* context) } window.openWindowInForeground(); - if (window.getKiller() != window.ok()) + if (window.closer() != window.ok()) return; bool withAlpha = window.alphaChannel()->isSelected(); diff --git a/src/app/commands/cmd_duplicate_sprite.cpp b/src/app/commands/cmd_duplicate_sprite.cpp index d599fc551..f43434888 100644 --- a/src/app/commands/cmd_duplicate_sprite.cpp +++ b/src/app/commands/cmd_duplicate_sprite.cpp @@ -68,7 +68,7 @@ void DuplicateSpriteCommand::onExecute(Context* context) // Open the window window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { set_config_bool("DuplicateSprite", "Flatten", window.flatten()->isSelected()); // Make a copy of the document diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp index bc8a1b757..1f320c0fc 100644 --- a/src/app/commands/cmd_export_sprite_sheet.cpp +++ b/src/app/commands/cmd_export_sprite_sheet.cpp @@ -402,7 +402,7 @@ public: } bool ok() const { - return getKiller() == exportButton(); + return closer() == exportButton(); } app::SpriteSheetType spriteSheetTypeValue() const { diff --git a/src/app/commands/cmd_frame_properties.cpp b/src/app/commands/cmd_frame_properties.cpp index 30212cf2d..d1b34fe3e 100644 --- a/src/app/commands/cmd_frame_properties.cpp +++ b/src/app/commands/cmd_frame_properties.cpp @@ -118,7 +118,7 @@ void FramePropertiesCommand::onExecute(Context* context) window.frlen()->setTextf("%d", sprite->frameDuration(firstFrame)); window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { int num = window.frlen()->textInt(); ContextWriter writer(reader); diff --git a/src/app/commands/cmd_goto_frame.cpp b/src/app/commands/cmd_goto_frame.cpp index 09528547b..5fc89ccfc 100644 --- a/src/app/commands/cmd_goto_frame.cpp +++ b/src/app/commands/cmd_goto_frame.cpp @@ -122,7 +122,7 @@ protected: window.frame()->setTextf("%d", editor->frame()+1); window.openWindowInForeground(); - if (window.getKiller() != window.ok()) + if (window.closer() != window.ok()) return editor->frame(); m_frame = window.frame()->textInt(); diff --git a/src/app/commands/cmd_grid.cpp b/src/app/commands/cmd_grid.cpp index 0930b345d..e091b2c02 100644 --- a/src/app/commands/cmd_grid.cpp +++ b/src/app/commands/cmd_grid.cpp @@ -168,7 +168,7 @@ void GridSettingsCommand::onExecute(Context* context) window->openWindowInForeground(); - if (window->getKiller() == button_ok) { + if (window->closer() == button_ok) { bounds.x = grid_x->textInt(); bounds.y = grid_y->textInt(); bounds.w = grid_w->textInt(); diff --git a/src/app/commands/cmd_import_sprite_sheet.cpp b/src/app/commands/cmd_import_sprite_sheet.cpp index c53430af3..5aea5b53e 100644 --- a/src/app/commands/cmd_import_sprite_sheet.cpp +++ b/src/app/commands/cmd_import_sprite_sheet.cpp @@ -93,7 +93,7 @@ public: } bool ok() const { - return getKiller() == import(); + return closer() == import(); } Document* document() const { diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp index 3ce5891b3..d03a8f26b 100644 --- a/src/app/commands/cmd_keyboard_shortcuts.cpp +++ b/src/app/commands/cmd_keyboard_shortcuts.cpp @@ -544,7 +544,7 @@ void KeyboardShortcutsCommand::onExecute(Context* context) window.setVisible(true); window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { // Save keyboard shortcuts in configuration file { ResourceFinder rf; diff --git a/src/app/commands/cmd_mask_by_color.cpp b/src/app/commands/cmd_mask_by_color.cpp index e981371ac..3ddba6e4c 100644 --- a/src/app/commands/cmd_mask_by_color.cpp +++ b/src/app/commands/cmd_mask_by_color.cpp @@ -151,7 +151,7 @@ void MaskByColorCommand::onExecute(Context* context) // Open the window m_window->openWindowInForeground(); - bool apply = (m_window->getKiller() == button_ok); + bool apply = (m_window->closer() == button_ok); ContextWriter writer(reader); Document* document(writer.document()); diff --git a/src/app/commands/cmd_new_file.cpp b/src/app/commands/cmd_new_file.cpp index 95ceca962..2f28a85c2 100644 --- a/src/app/commands/cmd_new_file.cpp +++ b/src/app/commands/cmd_new_file.cpp @@ -105,7 +105,7 @@ void NewFileCommand::onExecute(Context* context) // Open the window window.openWindowInForeground(); - if (window.getKiller() == window.okButton()) { + if (window.closer() == window.okButton()) { bool ok = false; // Get the options diff --git a/src/app/commands/cmd_new_layer.cpp b/src/app/commands/cmd_new_layer.cpp index b33c485d4..8c6b16ba0 100644 --- a/src/app/commands/cmd_new_layer.cpp +++ b/src/app/commands/cmd_new_layer.cpp @@ -96,7 +96,7 @@ void NewLayerCommand::onExecute(Context* context) window->openWindowInForeground(); - if (window->getKiller() != window->findChild("ok")) + if (window->closer() != window->findChild("ok")) return; name = window->findChild("name")->text(); diff --git a/src/app/commands/cmd_new_layer_set.cpp b/src/app/commands/cmd_new_layer_set.cpp index 1eb1263a2..f7c257acb 100644 --- a/src/app/commands/cmd_new_layer_set.cpp +++ b/src/app/commands/cmd_new_layer_set.cpp @@ -61,7 +61,7 @@ void NewLayerSetCommand::onExecute(Context* context) window->openWindowInForeground(); - if (window->getKiller() != window->findChild("ok")) + if (window->closer() != window->findChild("ok")) return; std::string name = window->findChild("name")->text(); diff --git a/src/app/commands/cmd_options.cpp b/src/app/commands/cmd_options.cpp index f6bedc3b7..b7fa837b2 100644 --- a/src/app/commands/cmd_options.cpp +++ b/src/app/commands/cmd_options.cpp @@ -169,7 +169,7 @@ public: } bool ok() { - return (getKiller() == buttonOk()); + return (closer() == buttonOk()); } void saveConfig() { diff --git a/src/app/commands/cmd_palette_size.cpp b/src/app/commands/cmd_palette_size.cpp index 2c1b66830..4b38564b5 100644 --- a/src/app/commands/cmd_palette_size.cpp +++ b/src/app/commands/cmd_palette_size.cpp @@ -60,7 +60,7 @@ void PaletteSizeCommand::onExecute(Context* context) app::gen::PaletteSize window; window.colors()->setTextf("%d", palette.size()); window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { int ncolors = window.colors()->textInt(); if (ncolors == palette.size()) return; diff --git a/src/app/commands/cmd_paste_text.cpp b/src/app/commands/cmd_paste_text.cpp index 389b1d309..7b8a928c0 100644 --- a/src/app/commands/cmd_paste_text.cpp +++ b/src/app/commands/cmd_paste_text.cpp @@ -156,7 +156,7 @@ void PasteTextCommand::onExecute(Context* ctx) window.userText()->setText(last_text_used); window.openWindowInForeground(); - if (window.getKiller() != window.ok()) + if (window.closer() != window.ok()) return; last_text_used = window.userText()->text(); diff --git a/src/app/commands/cmd_sprite_properties.cpp b/src/app/commands/cmd_sprite_properties.cpp index 5d8f7d090..9e1ee6a69 100644 --- a/src/app/commands/cmd_sprite_properties.cpp +++ b/src/app/commands/cmd_sprite_properties.cpp @@ -121,7 +121,7 @@ void SpritePropertiesCommand::onExecute(Context* context) window.setVisible(true); window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { if (color_button) { ContextWriter writer(context); Sprite* sprite(writer.sprite()); diff --git a/src/app/commands/cmd_sprite_size.cpp b/src/app/commands/cmd_sprite_size.cpp index 20fae3c0e..eb92807b0 100644 --- a/src/app/commands/cmd_sprite_size.cpp +++ b/src/app/commands/cmd_sprite_size.cpp @@ -310,7 +310,7 @@ void SpriteSizeCommand::onExecute(Context* context) window.openWindowInForeground(); save_window_pos(&window, "SpriteSize"); - if (window.getKiller() != window.ok()) + if (window.closer() != window.ok()) return; new_width = window.widthPx()->textInt(); diff --git a/src/app/commands/filters/color_curve_editor.cpp b/src/app/commands/filters/color_curve_editor.cpp index 7e7e9cf69..31d39a73d 100644 --- a/src/app/commands/filters/color_curve_editor.cpp +++ b/src/app/commands/filters/color_curve_editor.cpp @@ -266,14 +266,14 @@ bool ColorCurveEditor::editNodeManually(gfx::Point& viewPt) window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { viewPt.x = int(window.x()->textDouble()); viewPt.y = int(window.y()->textDouble()); viewPt.x = MID(0, viewPt.x, 255); viewPt.y = MID(0, viewPt.y, 255); return true; } - else if (window.getKiller() == window.deleteButton()) { + else if (window.closer() == window.deleteButton()) { removePoint(&viewPt); return true; } diff --git a/src/app/commands/filters/filter_window.cpp b/src/app/commands/filters/filter_window.cpp index 0a0bdfbcb..89e920a69 100644 --- a/src/app/commands/filters/filter_window.cpp +++ b/src/app/commands/filters/filter_window.cpp @@ -100,7 +100,7 @@ bool FilterWindow::doModal() openWindowInForeground(); // Did the user press OK? - if (getKiller() == &m_okButton) { + if (closer() == &m_okButton) { m_preview.stop(); // Apply the filter in background diff --git a/src/app/file/gif_format.cpp b/src/app/file/gif_format.cpp index c1e742c75..c702102bd 100644 --- a/src/app/file/gif_format.cpp +++ b/src/app/file/gif_format.cpp @@ -1326,7 +1326,7 @@ base::SharedPtr GifFormat::onGetFormatOptions(FileOp* fop) win.openWindowInForeground(); - if (win.getKiller() == win.ok()) { + if (win.closer() == win.ok()) { gif_options->setInterlaced(win.interlaced()->isSelected()); gif_options->setLoop(win.loop()->isSelected()); diff --git a/src/app/file/jpeg_format.cpp b/src/app/file/jpeg_format.cpp index 8c865d079..5147ce3c9 100644 --- a/src/app/file/jpeg_format.cpp +++ b/src/app/file/jpeg_format.cpp @@ -376,7 +376,7 @@ base::SharedPtr JpegFormat::onGetFormatOptions(FileOp* fop) window->openWindowInForeground(); - if (window->getKiller() == ok) { + if (window->closer() == ok) { jpeg_options->quality = slider_quality->getValue() / 10.0f; set_config_float("JPEG", "Quality", jpeg_options->quality); } diff --git a/src/app/file/webp_format.cpp b/src/app/file/webp_format.cpp index ea1551847..d52a88998 100644 --- a/src/app/file/webp_format.cpp +++ b/src/app/file/webp_format.cpp @@ -349,7 +349,7 @@ base::SharedPtr WebPFormat::onGetFormatOptions(FileOp* fop) win.openWindowInForeground(); - if (win.getKiller() == win.ok()) { + if (win.closer() == win.ok()) { webp_options->setQuality(win.quality()->getValue()); webp_options->setMethod(win.compression()->getValue()); webp_options->setLossless(win.lossless()->isSelected()); diff --git a/src/app/send_crash.cpp b/src/app/send_crash.cpp index cc6cfa1f6..654a48b58 100644 --- a/src/app/send_crash.cpp +++ b/src/app/send_crash.cpp @@ -66,7 +66,7 @@ void SendCrash::notificationClick() dlg.filename()->Click.connect(Bind(&SendCrash::onClickFilename, this)); dlg.openWindowInForeground(); - if (dlg.getKiller() == dlg.deleteFile()) { + if (dlg.closer() == dlg.deleteFile()) { try { base::delete_file(m_dumpFilename); m_dumpFilename = ""; diff --git a/src/app/ui/file_selector.cpp b/src/app/ui/file_selector.cpp index ecec82e33..e79ab4641 100644 --- a/src/app/ui/file_selector.cpp +++ b/src/app/ui/file_selector.cpp @@ -445,8 +445,8 @@ std::string FileSelector::show( // open the window and run... the user press ok? again: openWindowInForeground(); - if (getKiller() == ok || - getKiller() == m_fileList) { + if (closer() == ok || + closer() == m_fileList) { // open the selected file IFileItem* folder = m_fileList->getCurrentFolder(); ASSERT(folder); @@ -732,7 +732,7 @@ void FileSelector::onNewFolder() app::gen::NewFolderWindow window; window.openWindowInForeground(); - if (window.getKiller() == window.ok()) { + if (window.closer() == window.ok()) { IFileItem* currentFolder = m_fileList->getCurrentFolder(); if (currentFolder) { std::string dirname = window.name()->text(); diff --git a/src/app/ui/frame_tag_window.cpp b/src/app/ui/frame_tag_window.cpp index bcf3faac0..8bf17d21e 100644 --- a/src/app/ui/frame_tag_window.cpp +++ b/src/app/ui/frame_tag_window.cpp @@ -40,7 +40,7 @@ FrameTagWindow::FrameTagWindow(const doc::Sprite* sprite, const doc::FrameTag* f bool FrameTagWindow::show() { openWindowInForeground(); - return (getKiller() == ok()); + return (closer() == ok()); } std::string FrameTagWindow::nameValue() diff --git a/src/ui/alert.cpp b/src/ui/alert.cpp index c755ade84..40b7f8533 100644 --- a/src/ui/alert.cpp +++ b/src/ui/alert.cpp @@ -112,11 +112,11 @@ int Alert::show(const char* format, ...) // Open it window->openWindowInForeground(); - // Check the killer + // Check the closer int ret = 0; - if (Widget* killer = window->getKiller()) { + if (Widget* closer = window->closer()) { for (int i=0; i<(int)buttons.size(); ++i) { - if (killer == buttons[i]) { + if (closer == buttons[i]) { ret = i+1; break; } diff --git a/src/ui/window.cpp b/src/ui/window.cpp index e2890a330..09e7b587b 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -41,7 +41,7 @@ static gfx::Rect* clickedWindowPos = NULL; Window::Window(Type type, const std::string& text) : Widget(kWindowWidget) { - m_killer = NULL; + m_closer = NULL; m_isDesktop = (type == DesktopWindow); m_isMoveable = !m_isDesktop; m_isSizeable = !m_isDesktop; @@ -63,11 +63,6 @@ Window::~Window() manager()->_closeWindow(this, false); } -Widget* Window::getKiller() const -{ - return m_killer; -} - void Window::setAutoRemap(bool state) { m_isAutoRemap = state; @@ -252,14 +247,14 @@ void Window::openWindowInForeground() m_isForeground = false; } -void Window::closeWindow(Widget* killer) +void Window::closeWindow(Widget* closer) { - m_killer = killer; + m_closer = closer; manager()->_closeWindow(this, true); // Close event - CloseEvent ev(killer); + CloseEvent ev(closer); onClose(ev); } @@ -277,7 +272,7 @@ bool Window::onProcessMessage(Message* msg) switch (msg->type()) { case kOpenMessage: - m_killer = NULL; + m_closer = NULL; break; case kCloseMessage: diff --git a/src/ui/window.h b/src/ui/window.h index 108022404..48017b0c2 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -24,7 +24,7 @@ namespace ui { explicit Window(Type type, const std::string& text = ""); ~Window(); - Widget* getKiller() const; + Widget* closer() const { return m_closer; } void setAutoRemap(bool state); void setMoveable(bool state); @@ -39,7 +39,7 @@ namespace ui { void openWindow(); void openWindowInForeground(); - void closeWindow(Widget* killer); + void closeWindow(Widget* closer); bool isTopLevel(); bool isForeground() const { return m_isForeground; } @@ -74,7 +74,7 @@ namespace ui { void limitSize(int* w, int* h); void moveWindow(const gfx::Rect& rect, bool use_blit); - Widget* m_killer; + Widget* m_closer; bool m_isDesktop : 1; bool m_isMoveable : 1; bool m_isSizeable : 1;