From 3211831da3d3730e1924c6b89b6b8010e4592bc8 Mon Sep 17 00:00:00 2001 From: mezz Date: Mon, 4 Jan 2021 09:38:43 -1000 Subject: [PATCH] Create and use new signal: PalettePresetsChange --- src/app/app.h | 1 + src/app/commands/cmd_save_palette.cpp | 3 +-- src/app/extensions.cpp | 2 +- src/app/extensions.h | 2 +- src/app/ui/palettes_listbox.cpp | 3 +++ src/app/ui/palettes_listbox.h | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/app.h b/src/app/app.h index f255fae2a..e178ee519 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -124,6 +124,7 @@ namespace app { obs::signal Exit; obs::signal PaletteChange; obs::signal ColorSpaceChange; + obs::signal PalettePresetsChange; private: class CoreModules; diff --git a/src/app/commands/cmd_save_palette.cpp b/src/app/commands/cmd_save_palette.cpp index 82f5d2ba0..9e53dc9d4 100644 --- a/src/app/commands/cmd_save_palette.cpp +++ b/src/app/commands/cmd_save_palette.cpp @@ -13,7 +13,6 @@ #include "app/commands/commands.h" #include "app/commands/params.h" #include "app/context.h" -#include "app/extensions.h" #include "app/file/palette_file.h" #include "app/file_selector.h" #include "app/i18n/strings.h" @@ -80,7 +79,7 @@ void SavePaletteCommand::onExecute(Context* context) set_current_palette(palette, false); } if (m_save_as_preset) { - App::instance()->extensions().PalettesChange(); + App::instance()->PalettePresetsChange(); } } diff --git a/src/app/extensions.cpp b/src/app/extensions.cpp index 2a247d82e..cde81cd99 100644 --- a/src/app/extensions.cpp +++ b/src/app/extensions.cpp @@ -1132,7 +1132,7 @@ void Extensions::generateExtensionSignals(Extension* extension) { if (extension->hasLanguages()) LanguagesChange(extension); if (extension->hasThemes()) ThemesChange(extension); - if (extension->hasPalettes()) PalettesChange(); + if (extension->hasPalettes()) PalettesChange(extension); if (extension->hasDitheringMatrices()) DitheringMatricesChange(extension); #ifdef ENABLE_SCRIPTING if (extension->hasScripts()) ScriptsChange(extension); diff --git a/src/app/extensions.h b/src/app/extensions.h index 898ab6ae7..ab2e7492b 100644 --- a/src/app/extensions.h +++ b/src/app/extensions.h @@ -182,7 +182,7 @@ namespace app { obs::signal NewExtension; obs::signal LanguagesChange; obs::signal ThemesChange; - obs::signal PalettesChange; + obs::signal PalettesChange; obs::signal DitheringMatricesChange; obs::signal ScriptsChange; diff --git a/src/app/ui/palettes_listbox.cpp b/src/app/ui/palettes_listbox.cpp index e23896d82..8cbe66b01 100644 --- a/src/app/ui/palettes_listbox.cpp +++ b/src/app/ui/palettes_listbox.cpp @@ -124,6 +124,9 @@ PalettesListBox::PalettesListBox() m_extPaletteChanges = App::instance()->extensions().PalettesChange.connect( base::Bind(&PalettesListBox::reload, this)); + m_extPresetsChanges = + App::instance()->PalettePresetsChange.connect( + base::Bind(&PalettesListBox::reload, this)); } doc::Palette* PalettesListBox::selectedPalette() diff --git a/src/app/ui/palettes_listbox.h b/src/app/ui/palettes_listbox.h index 57af50fa5..26247148b 100644 --- a/src/app/ui/palettes_listbox.h +++ b/src/app/ui/palettes_listbox.h @@ -34,6 +34,7 @@ namespace app { ui::TooltipManager m_tooltips; obs::scoped_connection m_extPaletteChanges; + obs::scoped_connection m_extPresetsChanges; }; } // namespace app