cui/source/customize/cfgutil.cxx | 41 ++-------- cui/source/customize/macropg.cxx | 2 cui/source/factory/dlgfact.cxx | 2 cui/source/inc/cfgutil.hxx | 5 - cui/uiconfig/ui/macroselectordialog.ui | 132 ++++----------------------------- 5 files changed, 31 insertions(+), 151 deletions(-)
New commits: commit fe902aa8f3b7e6d43bc0d7ea3e6f77d25da40311 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Mar 11 09:11:38 2021 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Thu Mar 11 11:49:22 2021 +0100 Remove unused code from Macro Selector dialog Change-Id: I9930fd7eaf2410447f84aa4798478a10915ea738 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112316 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index a980d4b7fa3f..fa9d9139d1f5 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -1050,37 +1050,27 @@ void CuiConfigGroupListBox::SelectMacro( const OUString& rBasic, */ SvxScriptSelectorDialog::SvxScriptSelectorDialog( - weld::Window* pParent, bool bShowSlots, const css::uno::Reference< css::frame::XFrame >& xFrame) + weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& xFrame) : GenericDialogController(pParent, "cui/ui/macroselectordialog.ui", "MacroSelectorDialog") - , m_bShowSlots(bShowSlots) - , m_xDialogDescription(m_xBuilder->weld_label(bShowSlots ? "helptoolbar" : "helpmacro")) + , m_xDialogDescription(m_xBuilder->weld_label("helpmacro")) , m_xCategories(new CuiConfigGroupListBox(m_xBuilder->weld_tree_view("categories"))) , m_xCommands(new CuiConfigFunctionListBox(m_xBuilder->weld_tree_view("commands"))) , m_xLibraryFT(m_xBuilder->weld_label("libraryft")) - , m_xCategoryFT(m_xBuilder->weld_label("categoryft")) , m_xMacronameFT(m_xBuilder->weld_label("macronameft")) - , m_xCommandsFT(m_xBuilder->weld_label("commandsft")) - , m_xOKButton(m_xBuilder->weld_button(bShowSlots ? "add" : "ok")) - , m_xCancelButton(m_xBuilder->weld_button(bShowSlots ? "close" : "cancel")) + , m_xOKButton(m_xBuilder->weld_button("ok")) + , m_xCancelButton(m_xBuilder->weld_button("cancel")) , m_xDescriptionText(m_xBuilder->weld_text_view("description")) { - if (m_bShowSlots) - { - // If we are showing Slot API commands update labels in the UI - m_xDialog->set_title(CuiResId(RID_SVXSTR_SELECTOR_ADD_COMMANDS)); - } m_xCancelButton->show(); m_xDialogDescription->show(); m_xOKButton->show(); - m_xLibraryFT->set_visible(!m_bShowSlots); - m_xCategoryFT->set_visible(m_bShowSlots); - m_xMacronameFT->set_visible(!m_bShowSlots); - m_xCommandsFT->set_visible(m_bShowSlots); + m_xLibraryFT->set_visible(true); + m_xMacronameFT->set_visible(true); const OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); m_xCategories->SetFunctionListBox(m_xCommands.get()); - m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, bShowSlots); + m_xCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, /*bShowSlots*/false); m_xCategories->connect_changed( LINK( this, SvxScriptSelectorDialog, SelectHdl ) ); @@ -1104,6 +1094,9 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog( m_xCategories->SetStylesInfo(&m_aStylesInfo); UpdateUI(); + + if (comphelper::LibreOfficeKit::isActive()) + m_xDescriptionText->hide(); } SvxScriptSelectorDialog::~SvxScriptSelectorDialog() @@ -1154,19 +1147,7 @@ IMPL_LINK(SvxScriptSelectorDialog, ClickHdl, weld::Button&, rButton, void) } else if (&rButton == m_xOKButton.get()) { - // If we are displaying Slot API commands then this the dialog is being - // run from Tools/Configure and we should not close it - if ( !m_bShowSlots ) - { - m_xDialog->response(RET_OK); - } - else - { - // Select the next entry in the list if possible - std::unique_ptr<weld::TreeIter> xIter = m_xCommands->make_iterator(); - if (m_xCommands->get_selected(xIter.get()) && m_xCommands->iter_next_sibling(*xIter)) - m_xCommands->select(*xIter); - } + m_xDialog->response(RET_OK); } } diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 2fb442dbdb24..cdf07498f83e 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -460,7 +460,7 @@ void SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld:: else if( bAssEnabled ) { // assign pressed - SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), false, pThis->GetFrame()); + SvxScriptSelectorDialog aDlg(pThis->GetFrameWeld(), pThis->GetFrame()); short ret = aDlg.run(); if ( ret ) { diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index f8399d259071..bdff2b9b0451 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1137,7 +1137,7 @@ VclPtr<VclAbstractDialog> AbstractDialogFactory_Impl::CreateScriptErrorDialog(co VclPtr<AbstractScriptSelectorDialog> AbstractDialogFactory_Impl::CreateScriptSelectorDialog(weld::Window* pParent, const Reference<frame::XFrame>& rxFrame) { - return VclPtr<AbstractScriptSelectorDialog_Impl>::Create(std::make_shared<SvxScriptSelectorDialog>(pParent, false/*bShowSlots*/, rxFrame)); + return VclPtr<AbstractScriptSelectorDialog_Impl>::Create(std::make_shared<SvxScriptSelectorDialog>(pParent, rxFrame)); } OUString AbstractScriptSelectorDialog_Impl::GetScriptURL() const diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index e930c24ac3ec..885ccd8df8e7 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -234,15 +234,12 @@ class SvxScriptSelectorDialog : public weld::GenericDialogController { OUString m_sDefaultDesc; SfxStylesInfo_Impl m_aStylesInfo; - bool m_bShowSlots; std::unique_ptr<weld::Label> m_xDialogDescription; std::unique_ptr<CuiConfigGroupListBox> m_xCategories; std::unique_ptr<CuiConfigFunctionListBox> m_xCommands; std::unique_ptr<weld::Label> m_xLibraryFT; - std::unique_ptr<weld::Label> m_xCategoryFT; std::unique_ptr<weld::Label> m_xMacronameFT; - std::unique_ptr<weld::Label> m_xCommandsFT; std::unique_ptr<weld::Button> m_xOKButton; std::unique_ptr<weld::Button> m_xCancelButton; std::unique_ptr<weld::TextView> m_xDescriptionText; @@ -254,7 +251,7 @@ class SvxScriptSelectorDialog : public weld::GenericDialogController void UpdateUI(); public: - SvxScriptSelectorDialog(weld::Window* pParent, bool bShowSlots, + SvxScriptSelectorDialog(weld::Window* pParent, const css::uno::Reference< css::frame::XFrame >& xFrame); virtual ~SvxScriptSelectorDialog() override; diff --git a/cui/uiconfig/ui/macroselectordialog.ui b/cui/uiconfig/ui/macroselectordialog.ui index a04ebbd37dc8..4e65088cf94f 100644 --- a/cui/uiconfig/ui/macroselectordialog.ui +++ b/cui/uiconfig/ui/macroselectordialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.20.4 --> <interface domain="cui"> <requires lib="gtk+" version="3.18"/> <object class="GtkTreeStore" id="liststore1"> @@ -28,9 +28,6 @@ <property name="default_width">0</property> <property name="default_height">0</property> <property name="type_hint">dialog</property> - <child> - <placeholder/> - </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -40,24 +37,10 @@ <object class="GtkButtonBox" id="dialog-action_area1"> <property name="can_focus">False</property> <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="add"> - <property name="label" translatable="yes" context="macroselectordialog|add">Add</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="no_show_all">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> <child> <object class="GtkButton" id="ok"> <property name="label">gtk-ok</property> + <property name="visible">True</property> <property name="can_focus">True</property> <property name="can_default">True</property> <property name="has_default">True</property> @@ -74,6 +57,7 @@ <child> <object class="GtkButton" id="cancel"> <property name="label">gtk-cancel</property> + <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> <property name="no_show_all">True</property> @@ -85,20 +69,6 @@ <property name="position">2</property> </packing> </child> - <child> - <object class="GtkButton" id="close"> - <property name="label">gtk-close</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="no_show_all">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> <child> <object class="GtkButton" id="help"> <property name="label">gtk-help</property> @@ -146,22 +116,6 @@ <property name="position">0</property> </packing> </child> - <child> - <object class="GtkLabel" id="helptoolbar"> - <property name="can_focus">False</property> - <property name="no_show_all">True</property> - <property name="hexpand">True</property> - <property name="label" translatable="yes" context="macroselectordialog|helptoolbar">To add a command to a toolbar, select the category and then the command. Then drag the command to the Commands list of the Toolbars tab page in the Customize dialog.</property> - <property name="wrap">True</property> - <property name="max_width_chars">60</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> <child> <object class="GtkBox" id="box2"> <property name="visible">True</property> @@ -228,39 +182,13 @@ </object> </child> <child type="label"> - <object class="GtkBox" id="box3"> + <object class="GtkLabel" id="libraryft"> <property name="visible">True</property> <property name="can_focus">False</property> - <child> - <object class="GtkLabel" id="libraryft"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="macroselectordialog|libraryft">Library</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="categoryft"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="macroselectordialog|categoryft">Category</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> + <property name="label" translatable="yes" context="macroselectordialog|libraryft">Library</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -321,41 +249,14 @@ </object> </child> <child type="label"> - <object class="GtkBox" id="box4"> + <object class="GtkLabel" id="macronameft"> <property name="visible">True</property> <property name="can_focus">False</property> - <child> - <object class="GtkLabel" id="macronameft"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="macroselectordialog|macronameft">Macro Name</property> - <property name="track_visited_links">False</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="commandsft"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="macroselectordialog|commandsft">Commands</property> - <property name="track_visited_links">False</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> + <property name="label" translatable="yes" context="macroselectordialog|macronameft">Macro Name</property> + <property name="track_visited_links">False</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -434,11 +335,12 @@ </object> </child> <action-widgets> - <action-widget response="101">add</action-widget> <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> - <action-widget response="-7">close</action-widget> <action-widget response="-11">help</action-widget> </action-widgets> + <child> + <placeholder/> + </child> </object> </interface> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits