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());
96 pFact->CreateSvxNameDialog(
m_xDialog.get(), aURL, aDesc));
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);
#define LINK(Instance, Class, Member)
TSAURLsDialog(weld::Window *pParent)
static SvxAbstractDialogFactory * Create()
std::unique_ptr< weld::Button > m_xAddBtn
static std::shared_ptr< ConfigurationChanges > create(css::uno::Reference< css::uno::XComponentContext > const &context=comphelper::getProcessComponentContext())
#define TOOLS_WARN_EXCEPTION(area, stream)
std::unique_ptr< weld::TreeView > m_xURLListBox
std::unique_ptr< weld::Button > m_xOKBtn
IMPL_LINK_NOARG(TSAURLsDialog, OKHdl_Impl, weld::Button &, void)
void AddTSAURL(const OUString &rURL)
std::unique_ptr< weld::Button > m_xDeleteBtn
std::set< OUString > m_aURLs
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
virtual ~TSAURLsDialog() override
Reference< XExecutableDialog > m_xDialog