10#include <officecfg/Office/Common.hxx>
20 : GenericDialogController(pParent,
"cui/ui/tsaurldialog.ui",
"TSAURLDialog")
21 , m_xAddBtn(m_xBuilder->weld_button(
"add"))
22 , m_xDeleteBtn(m_xBuilder->weld_button(
"delete"))
23 , m_xOKBtn(m_xBuilder->weld_button(
"ok"))
24 , m_xURLListBox(m_xBuilder->weld_tree_view(
"urls"))
25 , m_xEnterAUrl(m_xBuilder->weld_label(
"enteraurl"))
38 std::optional<css::uno::Sequence<OUString>> aUserSetTSAURLs(
39 officecfg::Office::Common::Security::Scripting::TSAURLs::get());
42 const css::uno::Sequence<OUString>& rUserSetTSAURLs = *aUserSetTSAURLs;
43 for (
auto const& userSetTSAURL : rUserSetTSAURLs)
49 catch (
const uno::Exception&)
62 std::shared_ptr<comphelper::ConfigurationChanges> batch(
65 officecfg::Office::Common::Security::Scripting::TSAURLs::set(
92 OUString aDesc(m_xEnterAUrl->get_label());
98 if (pDlg->Execute() ==
RET_OK)
102 m_xOKBtn->set_sensitive(
true);
104 m_xURLListBox->unselect_all();
106 m_xDeleteBtn->set_sensitive(
false);
111 m_xDeleteBtn->set_sensitive(
true);
116 int nSel = m_xURLListBox->get_selected_index();
120 m_aURLs.erase(m_xURLListBox->get_text(nSel));
121 m_xURLListBox->remove(nSel);
122 m_xURLListBox->unselect_all();
124 m_xDeleteBtn->set_sensitive(
false);
125 m_xOKBtn->set_sensitive(
true);
Reference< XExecutableDialog > m_xDialog
virtual VclPtr< AbstractSvxNameDialog > CreateSvxNameDialog(weld::Window *pParent, const OUString &rName, const OUString &rDesc)=0
static SvxAbstractDialogFactory * Create()
std::unique_ptr< weld::Button > m_xOKBtn
std::set< OUString > m_aURLs
void AddTSAURL(const OUString &rURL)
virtual ~TSAURLsDialog() override
std::unique_ptr< weld::TreeView > m_xURLListBox
std::unique_ptr< weld::Button > m_xAddBtn
std::unique_ptr< weld::Button > m_xDeleteBtn
TSAURLsDialog(weld::Window *pParent)
static std::shared_ptr< ConfigurationChanges > create()
#define TOOLS_WARN_EXCEPTION(area, stream)
#define LINK(Instance, Class, Member)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
IMPL_LINK_NOARG(TSAURLsDialog, OKHdl_Impl, weld::Button &, void)