cui/source/dialogs/hlinettp.cxx          |   27 ----------------
 cui/source/inc/hlinettp.hxx              |    1 
 cui/uiconfig/ui/hyperlinkinternetpage.ui |   52 -------------------------------
 3 files changed, 2 insertions(+), 78 deletions(-)

New commits:
commit 8b50a615cbf6c09ed9cf6af6336e388cd32db28e
Author:     Julien Nabet <[email protected]>
AuthorDate: Sat Nov 25 09:58:49 2023 +0100
Commit:     Julien Nabet <[email protected]>
CommitDate: Sat Nov 25 12:08:24 2023 +0100

    tdf#158357: UI simplify Hyperlink dialog by removing Hyperlink type 
radiobutton
    
    + rename "Hyperlink Type" into "Hyperlink Settings"
    + remove "Protocol" since ther's only 1 now
    
    Change-Id: I9435606c6ac6eca87afc4c259fb1121f65638c0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159947
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <[email protected]>

diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 21cf34b3c7b6..c74d6ae10699 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -36,7 +36,6 @@ 
SvxHyperlinkInternetTp::SvxHyperlinkInternetTp(weld::Container* pParent,
     : SvxHyperlinkTabPageBase(pParent, pDlg, 
"cui/ui/hyperlinkinternetpage.ui", "HyperlinkInternetPage",
                               pItemSet)
     , m_bMarkWndOpen(false)
-    , m_xRbtLinktypInternet(xBuilder->weld_radio_button("linktyp_internet"))
     , m_xCbbTarget(new SvxHyperURLBox(xBuilder->weld_combo_box("target")))
     , m_xFtTarget(xBuilder->weld_label("target_label"))
 {
@@ -56,12 +55,7 @@ 
SvxHyperlinkInternetTp::SvxHyperlinkInternetTp(weld::Container* pParent,
 
     SetExchangeSupport ();
 
-    // set defaults
-    m_xRbtLinktypInternet->set_active(true);
-
     // set handlers
-    Link<weld::Toggleable&, void> aLink( LINK ( this, SvxHyperlinkInternetTp, 
Click_SmartProtocol_Impl ) );
-    m_xRbtLinktypInternet->connect_toggled( aLink );
     m_xCbbTarget->connect_focus_out( LINK ( this, SvxHyperlinkInternetTp, 
LostFocusTargetHdl_Impl ) );
     m_xCbbTarget->connect_changed( LINK ( this, SvxHyperlinkInternetTp, 
ModifiedTargetHdl_Impl ) );
     maTimer.SetInvokeHandler ( LINK ( this, SvxHyperlinkInternetTp, 
TimeoutHdl_Impl ) );
@@ -167,12 +161,6 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, TimeoutHdl_Impl, 
Timer *, void)
 
 void SvxHyperlinkInternetTp::SetScheme(std::u16string_view rScheme)
 {
-    //if rScheme is empty or unknown the default behaviour is like it where 
HTTP
-    bool bInternet = true;
-
-    //update protocol button selection:
-    m_xRbtLinktypInternet->set_active(bInternet);
-
     //update target:
     RemoveImproperProtocol(rScheme);
     m_xCbbTarget->SetSmartProtocol( GetSmartProtocolFromButtons() );
@@ -221,19 +209,6 @@ INetProtocol 
SvxHyperlinkInternetTp::GetSmartProtocolFromButtons()
     return INetProtocol::Http;
 }
 
-/*************************************************************************
-|*
-|* Click on Radiobutton : WWW or ...
-|*
-|************************************************************************/
-IMPL_LINK(SvxHyperlinkInternetTp, Click_SmartProtocol_Impl, weld::Toggleable&, 
rButton, void)
-{
-    if (!rButton.get_active())
-        return;
-    OUString aScheme = GetSchemeFromButtons();
-    SetScheme(aScheme);
-}
-
 /*************************************************************************
 |*
 |* Combobox Target lost the focus
@@ -246,7 +221,7 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, 
LostFocusTargetHdl_Impl, weld::Widget&,
 
 void SvxHyperlinkInternetTp::RefreshMarkWindow()
 {
-    if (m_xRbtLinktypInternet->get_active() && IsMarkWndVisible())
+    if (IsMarkWndVisible())
     {
         weld::WaitObject aWait(mpDialog->getDialog());
         OUString aStrURL( CreateAbsoluteURL() );
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index bb86dff9ca5e..ad308a401f45 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -36,7 +36,6 @@ class SvxHyperlinkInternetTp : public SvxHyperlinkTabPageBase
 private:
     bool                m_bMarkWndOpen;
 
-    std::unique_ptr<weld::RadioButton> m_xRbtLinktypInternet;
     std::unique_ptr<SvxHyperURLBox> m_xCbbTarget;
     std::unique_ptr<weld::Label> m_xFtTarget;
 
diff --git a/cui/uiconfig/ui/hyperlinkinternetpage.ui 
b/cui/uiconfig/ui/hyperlinkinternetpage.ui
index 6a6a191a6b91..0031207e8f51 100644
--- a/cui/uiconfig/ui/hyperlinkinternetpage.ui
+++ b/cui/uiconfig/ui/hyperlinkinternetpage.ui
@@ -25,40 +25,6 @@
             <property name="column_spacing">12</property>
             <property name="margin-start">12</property>
             <property name="margin-top">6</property>
-            <child>
-              <!-- n-columns=1 n-rows=1 -->
-              <object class="GtkGrid" id="grid2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <property name="row_spacing">6</property>
-                <property name="column_spacing">12</property>
-                <child>
-                  <object class="GtkRadioButton" id="linktyp_internet">
-                    <property name="label" translatable="yes" 
context="hyperlinkinternetpage|linktyp_internet">_Web</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="active">True</property>
-                    <property name="draw_indicator">True</property>
-                    <child internal-child="accessible">
-                      <object class="AtkObject" 
id="linktyp_internet-atkobject">
-                        <property name="AtkObject::accessible-description" 
translatable="yes" 
context="hyperlinkinternetpage|extended_tip|linktyp_internet">Creates an 
"http://"; hyperlink.</property>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkLabel" id="target_label">
                 <property name="visible">True</property>
@@ -129,21 +95,6 @@
                 <property name="top_attach">2</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkLabel" id="lbProtocol">
-                <property name="name">lbProtocol</property>
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes" 
context="hyperlinkinternetpage|protocol_label">Proto_col:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">linktyp_internet</property>
-                <property name="xalign">0</property>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
-              </packing>
-            </child>
             <child>
               <placeholder/>
             </child>
@@ -153,7 +104,7 @@
           <object class="GtkLabel" id="label2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label" translatable="yes" 
context="hyperlinkinternetpage|label2">Hyperlink Type</property>
+            <property name="label" translatable="yes" 
context="hyperlinkinternetpage|label2">Hyperlink Settings</property>
             <attributes>
               <attribute name="weight" value="bold"/>
             </attributes>
@@ -339,7 +290,6 @@
       <widget name="frame_label"/>
       <widget name="indication_label"/>
       <widget name="name_label"/>
-      <widget name="lbProtocol"/>
     </widgets>
   </object>
 </interface>

Reply via email to