Prevent to open multiple Theme Color Edit dialog

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: Ibf4db096b44ce941140a12d003b89b636f5e7224
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154514
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
Gülşah Köse
2023-07-17 13:53:20 +02:00
committed by Tomaž Vajngerl
parent e43d5776fe
commit e73b2bc4e6
+5
View File
@@ -88,7 +88,10 @@ void ThemeDialog::runThemeColorEditDialog()
auto pDialog = std::make_shared<svx::ThemeColorEditDialog>(mpWindow, *mpCurrentColorSet);
weld::DialogController::runAsync(pDialog, [this, pDialog](sal_uInt32 nResult) {
if (nResult != RET_OK)
{
mxAdd->set_sensitive(true);
return;
}
auto aColorSet = pDialog->getColorSet();
if (!aColorSet.getName().isEmpty())
{
@@ -102,6 +105,7 @@ void ThemeDialog::runThemeColorEditDialog()
mpCurrentColorSet
= std::make_shared<model::ColorSet>(maColorSets[maColorSets.size() - 1]);
}
mxAdd->set_sensitive(true);
});
}
@@ -110,6 +114,7 @@ IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, rButton, void)
if (mpCurrentColorSet && mxAdd.get() == &rButton)
{
runThemeColorEditDialog();
mxAdd->set_sensitive(false);
}
}