summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-11-07 12:24:10 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-11-09 16:51:56 +0100
commit46673b5c3215d05877043a81470b2a059c2eef75 (patch)
tree11fd0cf56e6b01c6098b7016dfc3877f03cbb04e /cui
parent4a26dcac8e4f3ff3cbc3c356ad0a34968ef9d8fe (diff)
tdf#146386 cui: remove FTP UI, SvxHyperlinkInternetTp
Change-Id: Ib55d6609e0bea4033533e3211c04888e52b86bb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159071 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/hlinettp.cxx117
-rw-r--r--cui/source/inc/hlinettp.hxx20
-rw-r--r--cui/uiconfig/ui/hyperlinkinternetpage.ui109
3 files changed, 10 insertions, 236 deletions
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 8ffdb2053f5b..21cf34b3c7b6 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -24,7 +24,6 @@
#include <hlinettp.hxx>
#include <hlmarkwn_def.hxx>
-constexpr OUString sAnonymous = u"anonymous"_ustr;
/*************************************************************************
|*
@@ -38,14 +37,8 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp(weld::Container* pParent,
pItemSet)
, m_bMarkWndOpen(false)
, m_xRbtLinktypInternet(xBuilder->weld_radio_button("linktyp_internet"))
- , m_xRbtLinktypFTP(xBuilder->weld_radio_button("linktyp_ftp"))
, m_xCbbTarget(new SvxHyperURLBox(xBuilder->weld_combo_box("target")))
, m_xFtTarget(xBuilder->weld_label("target_label"))
- , m_xFtLogin(xBuilder->weld_label("login_label"))
- , m_xEdLogin(xBuilder->weld_entry("login"))
- , m_xFtPassword(xBuilder->weld_label("password_label"))
- , m_xEdPassword(xBuilder->weld_entry("password"))
- , m_xCbAnonymous(xBuilder->weld_check_button("anonymous"))
{
// gtk_size_group_set_ignore_hidden, "Measuring the size of hidden widgets
// ... they will report a size of 0 nowadays, and thus, their size will
@@ -69,9 +62,6 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp(weld::Container* pParent,
// set handlers
Link<weld::Toggleable&, void> aLink( LINK ( this, SvxHyperlinkInternetTp, Click_SmartProtocol_Impl ) );
m_xRbtLinktypInternet->connect_toggled( aLink );
- m_xRbtLinktypFTP->connect_toggled( aLink );
- m_xCbAnonymous->connect_toggled( LINK ( this, SvxHyperlinkInternetTp, ClickAnonymousHdl_Impl ) );
- m_xEdLogin->connect_changed( LINK ( this, SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl ) );
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 ) );
@@ -91,19 +81,6 @@ void SvxHyperlinkInternetTp::FillDlgFields(const OUString& rStrURL)
INetURLObject aURL(rStrURL);
OUString aStrScheme(GetSchemeFromURL(rStrURL));
- // set additional controls for FTP: Username / Password
- if (aStrScheme.startsWith(INET_FTP_SCHEME))
- {
- if ( aURL.GetUser().toAsciiLowerCase().startsWith( sAnonymous ) )
- setAnonymousFTPUser();
- else
- setFTPUser(aURL.GetUser(), aURL.GetPass());
-
- //do not show password and user in url
- if(!aURL.GetUser().isEmpty() || !aURL.GetPass().isEmpty() )
- aURL.SetUserAndPass(u"", u"");
- }
-
// set URL-field
// Show the scheme, #72740
if ( aURL.GetProtocol() != INetProtocol::NotValid )
@@ -114,31 +91,6 @@ void SvxHyperlinkInternetTp::FillDlgFields(const OUString& rStrURL)
SetScheme(aStrScheme);
}
-void SvxHyperlinkInternetTp::setAnonymousFTPUser()
-{
- m_xEdLogin->set_text(sAnonymous);
- SvAddressParser aAddress(SvtUserOptions().GetEmail());
- m_xEdPassword->set_text(aAddress.Count() ? aAddress.GetEmailAddress(0) : OUString());
-
- m_xFtLogin->set_sensitive(false);
- m_xFtPassword->set_sensitive(false);
- m_xEdLogin->set_sensitive(false);
- m_xEdPassword->set_sensitive(false);
- m_xCbAnonymous->set_active(true);
-}
-
-void SvxHyperlinkInternetTp::setFTPUser(const OUString& rUser, const OUString& rPassword)
-{
- m_xEdLogin->set_text(rUser);
- m_xEdPassword->set_text(rPassword);
-
- m_xFtLogin->set_sensitive(true);
- m_xFtPassword->set_sensitive(true);
- m_xEdLogin->set_sensitive(true);
- m_xEdPassword->set_sensitive(true);
- m_xCbAnonymous->set_active(false);
-}
-
/*************************************************************************
|*
|* retrieve and prepare data from dialog-fields
@@ -160,10 +112,6 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const
INetURLObject aURL(aStrURL, GetSmartProtocolFromButtons());
- // username and password for ftp-url
- if( aURL.GetProtocol() == INetProtocol::Ftp && !m_xEdLogin->get_text().isEmpty() )
- aURL.SetUserAndPass ( m_xEdLogin->get_text(), m_xEdPassword->get_text() );
-
if ( aURL.GetProtocol() != INetProtocol::NotValid )
return aURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri );
else //#105788# always create a URL even if it is not valid
@@ -217,42 +165,18 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, TimeoutHdl_Impl, Timer *, void)
RefreshMarkWindow();
}
-/*************************************************************************
-|*
-|* Contents of editfield "Login" modified
-|*
-|************************************************************************/
-IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ModifiedLoginHdl_Impl, weld::Entry&, void)
-{
- OUString aStrLogin ( m_xEdLogin->get_text() );
- if ( aStrLogin.equalsIgnoreAsciiCase( sAnonymous ) )
- {
- m_xCbAnonymous->set_active(true);
- ClickAnonymousHdl_Impl(*m_xCbAnonymous);
- }
-}
-
void SvxHyperlinkInternetTp::SetScheme(std::u16string_view rScheme)
{
//if rScheme is empty or unknown the default behaviour is like it where HTTP
- bool bFTP = o3tl::starts_with(rScheme, INET_FTP_SCHEME);
- bool bInternet = !bFTP;
+ bool bInternet = true;
//update protocol button selection:
- m_xRbtLinktypFTP->set_active(bFTP);
m_xRbtLinktypInternet->set_active(bInternet);
//update target:
RemoveImproperProtocol(rScheme);
m_xCbbTarget->SetSmartProtocol( GetSmartProtocolFromButtons() );
- //show/hide special fields for FTP:
- m_xFtLogin->set_visible( bFTP );
- m_xFtPassword->set_visible( bFTP );
- m_xEdLogin->set_visible( bFTP );
- m_xEdPassword->set_visible( bFTP );
- m_xCbAnonymous->set_visible( bFTP );
-
//update 'link target in document'-window and opening-button
if (o3tl::starts_with(rScheme, INET_HTTP_SCHEME) || rScheme.empty())
{
@@ -287,25 +211,19 @@ void SvxHyperlinkInternetTp::RemoveImproperProtocol(std::u16string_view aProperS
}
}
-OUString SvxHyperlinkInternetTp::GetSchemeFromButtons() const
+OUString SvxHyperlinkInternetTp::GetSchemeFromButtons()
{
- if( m_xRbtLinktypFTP->get_active() )
- return INET_FTP_SCHEME;
return INET_HTTP_SCHEME;
}
-INetProtocol SvxHyperlinkInternetTp::GetSmartProtocolFromButtons() const
+INetProtocol SvxHyperlinkInternetTp::GetSmartProtocolFromButtons()
{
- if( m_xRbtLinktypFTP->get_active() )
- {
- return INetProtocol::Ftp;
- }
return INetProtocol::Http;
}
/*************************************************************************
|*
-|* Click on Radiobutton : Internet or FTP
+|* Click on Radiobutton : WWW or ...
|*
|************************************************************************/
IMPL_LINK(SvxHyperlinkInternetTp, Click_SmartProtocol_Impl, weld::Toggleable&, rButton, void)
@@ -318,33 +236,6 @@ IMPL_LINK(SvxHyperlinkInternetTp, Click_SmartProtocol_Impl, weld::Toggleable&, r
/*************************************************************************
|*
-|* Click on Checkbox : Anonymous user
-|*
-|************************************************************************/
-IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ClickAnonymousHdl_Impl, weld::Toggleable&, void)
-{
- // disable login-editfields if checked
- if ( m_xCbAnonymous->get_active() )
- {
- if ( m_xEdLogin->get_text().toAsciiLowerCase().startsWith( sAnonymous ) )
- {
- maStrOldUser.clear();
- maStrOldPassword.clear();
- }
- else
- {
- maStrOldUser = m_xEdLogin->get_text();
- maStrOldPassword = m_xEdPassword->get_text();
- }
-
- setAnonymousFTPUser();
- }
- else
- setFTPUser(maStrOldUser, maStrOldPassword);
-}
-
-/*************************************************************************
-|*
|* Combobox Target lost the focus
|*
|************************************************************************/
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index 8f0dfdcc6bc6..a164063150de 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -40,18 +40,10 @@ private:
bool m_bMarkWndOpen;
std::unique_ptr<weld::RadioButton> m_xRbtLinktypInternet;
- std::unique_ptr<weld::RadioButton> m_xRbtLinktypFTP;
std::unique_ptr<SvxHyperURLBox> m_xCbbTarget;
std::unique_ptr<weld::Label> m_xFtTarget;
- std::unique_ptr<weld::Label> m_xFtLogin;
- std::unique_ptr<weld::Entry> m_xEdLogin;
- std::unique_ptr<weld::Label> m_xFtPassword;
- std::unique_ptr<weld::Entry> m_xEdPassword;
- std::unique_ptr<weld::CheckButton> m_xCbAnonymous;
-
- DECL_LINK( Click_SmartProtocol_Impl, weld::Toggleable&, void ); ///< Radiobutton toggled: Type HTTP or FTP
- DECL_LINK( ClickAnonymousHdl_Impl, weld::Toggleable&, void ); ///< Checkbox : Anonymous User
- DECL_LINK( ModifiedLoginHdl_Impl, weld::Entry&, void ); ///< Contents of editfield "Login" modified
+
+ DECL_LINK( Click_SmartProtocol_Impl, weld::Toggleable&, void ); ///< Radiobutton toggled: Type HTTP or
DECL_LINK( LostFocusTargetHdl_Impl, weld::Widget&, void ); ///< Combobox "Target" lost its focus
DECL_LINK( ModifiedTargetHdl_Impl, weld::ComboBox&, void ); ///< Contents of editfield "Target" modified
@@ -60,13 +52,11 @@ private:
void SetScheme(std::u16string_view rScheme);
void RemoveImproperProtocol(std::u16string_view rProperScheme);
- OUString GetSchemeFromButtons() const;
- INetProtocol GetSmartProtocolFromButtons() const;
+ static OUString GetSchemeFromButtons();
+ static INetProtocol GetSmartProtocolFromButtons();
OUString CreateAbsoluteURL() const;
- void setAnonymousFTPUser();
- void setFTPUser(const OUString& rUser, const OUString& rPassword);
void RefreshMarkWindow();
protected:
@@ -74,7 +64,7 @@ protected:
virtual void GetCurrentItemData ( OUString& rStrURL, OUString& aStrName,
OUString& aStrIntName, OUString& aStrFrame,
SvxLinkInsertMode& eMode ) override;
- virtual bool ShouldOpenMarkWnd () override {return ( m_bMarkWndOpen && m_xRbtLinktypInternet->get_active() );}
+ virtual bool ShouldOpenMarkWnd () override { return false; }
virtual void SetMarkWndShouldOpen (bool bOpen) override {m_bMarkWndOpen=bOpen;}
public:
diff --git a/cui/uiconfig/ui/hyperlinkinternetpage.ui b/cui/uiconfig/ui/hyperlinkinternetpage.ui
index 63978b8d0396..6a6a191a6b91 100644
--- a/cui/uiconfig/ui/hyperlinkinternetpage.ui
+++ b/cui/uiconfig/ui/hyperlinkinternetpage.ui
@@ -53,26 +53,6 @@
<property name="top_attach">0</property>
</packing>
</child>
- <child>
- <object class="GtkRadioButton" id="linktyp_ftp">
- <property name="label" translatable="yes" context="hyperlinkinternetpage|linktyp_ftp">_FTP</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="draw_indicator">True</property>
- <property name="group">linktyp_internet</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="linktyp_ftp-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hyperlinkinternetpage|extended_tip|linktyp_ftp">Creates an "FTP://" hyperlink.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -95,91 +75,6 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="login_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="hyperlinkinternetpage|login_label">_Login name:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">login</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="password_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" context="hyperlinkinternetpage|password_label">_Password:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">password</property>
- <property name="xalign">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="login">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="activates_default">True</property>
- <property name="truncate-multiline">True</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="login-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hyperlinkinternetpage|extended_tip|login">Specifies your login name, if you are working with FTP addresses.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="password">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="activates_default">True</property>
- <property name="truncate-multiline">True</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="password-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hyperlinkinternetpage|extended_tip|password">Specifies your password, if you are working with FTP addresses.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="anonymous">
- <property name="label" translatable="yes" context="hyperlinkinternetpage|anonymous">Anonymous _user</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="draw_indicator">True</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="anonymous-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hyperlinkinternetpage|extended_tip|anonymous">Allows you to log in to the FTP address as an anonymous user.</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">5</property>
- </packing>
- </child>
- <child>
<object class="GtkComboBoxText" id="target">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -434,15 +329,13 @@
</child>
<child internal-child="accessible">
<object class="AtkObject" id="HyperlinkInternetPage-atkobject">
- <property name="AtkObject::accessible-description" translatable="yes" context="hyperlinkinternetpage|extended_tip|HyperlinkInternetPage">Use the Internet page of the Hyperlink dialog to edit hyperlinks with WWW or FTP addresses.</property>
+ <property name="AtkObject::accessible-description" translatable="yes" context="hyperlinkinternetpage|extended_tip|HyperlinkInternetPage">Use the Internet page of the Hyperlink dialog to edit hyperlinks with WWW addresses.</property>
</object>
</child>
</object>
<object class="GtkSizeGroup" id="sizegroup1">
<widgets>
<widget name="target_label"/>
- <widget name="login_label"/>
- <widget name="password_label"/>
<widget name="frame_label"/>
<widget name="indication_label"/>
<widget name="name_label"/>