Kaydet (Commit) f1d1854f authored tarafından Noel Grandin's avatar Noel Grandin

remove NoPath from LoginFlags

since it is always set when calling HideControls_Impl, and therefore
remove the now unused UI controls

Change-Id: I8a2a6a34b64dd7b0bf909c810bbd7fea8ad2c7a5
Reviewed-on: https://gerrit.libreoffice.org/47403Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 94fc02dd
......@@ -74,7 +74,6 @@ executeLoginDialog(
bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials();
LoginFlags nFlags = LoginFlags::NONE;
nFlags |= LoginFlags::NoPath;
if (rInfo.GetErrorText().isEmpty())
nFlags |= LoginFlags::NoErrorText;
if (!bAccount)
......
......@@ -45,9 +45,6 @@ void LoginDialog::dispose()
m_pErrorFT.clear();
m_pErrorInfo.clear();
m_pRequestInfo.clear();
m_pPathFT.clear();
m_pPathED.clear();
m_pPathBtn.clear();
m_pNameFT.clear();
m_pNameED.clear();
m_pPasswordFT.clear();
......@@ -68,18 +65,6 @@ void LoginDialog::SetPassword( const OUString& rNew )
void LoginDialog::HideControls_Impl( LoginFlags nFlags )
{
if ( nFlags & LoginFlags::NoPath )
{
m_pPathFT->Hide();
m_pPathED->Hide();
m_pPathBtn->Hide();
}
else if ( nFlags & LoginFlags::PathReadonly )
{
m_pPathED->Enable( false );
m_pPathBtn->Enable( false );
}
if ( nFlags & LoginFlags::NoUsername )
{
m_pNameFT->Hide();
......@@ -122,9 +107,6 @@ void LoginDialog::EnableUseSysCredsControls_Impl( bool bUseSysCredsEnabled )
m_pErrorInfo->Enable( !bUseSysCredsEnabled );
m_pErrorFT->Enable( !bUseSysCredsEnabled );
m_pRequestInfo->Enable( !bUseSysCredsEnabled );
m_pPathFT->Enable( !bUseSysCredsEnabled );
m_pPathED->Enable( !bUseSysCredsEnabled );
m_pPathBtn->Enable( !bUseSysCredsEnabled );
m_pNameFT->Enable( !bUseSysCredsEnabled );
m_pNameED->Enable( !bUseSysCredsEnabled );
m_pPasswordFT->Enable( !bUseSysCredsEnabled );
......@@ -158,28 +140,6 @@ IMPL_LINK_NOARG(LoginDialog, OKHdl_Impl, Button*, void)
EndDialog( RET_OK );
}
IMPL_LINK_NOARG(LoginDialog, PathHdl_Impl, Button*, void)
{
try
{
uno::Reference<ui::dialogs::XFolderPicker2> xFolderPicker = ui::dialogs::FolderPicker::create(comphelper::getProcessComponentContext());
OUString aPath( m_pPathED->GetText() );
osl::FileBase::getFileURLFromSystemPath( aPath, aPath );
xFolderPicker->setDisplayDirectory( aPath );
if (xFolderPicker->execute() == ui::dialogs::ExecutableDialogResults::OK)
{
osl::FileBase::getSystemPathFromFileURL( xFolderPicker->getDirectory(), aPath );
m_pPathED->SetText( aPath );
}
}
catch (uno::Exception & e)
{
SAL_WARN("uui", "LoginDialog::PathHdl_Impl: caught " << e);
}
}
IMPL_LINK_NOARG(LoginDialog, UseSysCredsHdl_Impl, Button*, void)
{
EnableUseSysCredsControls_Impl( m_pUseSysCredsCB->IsChecked() );
......@@ -193,9 +153,6 @@ LoginDialog::LoginDialog(vcl::Window* pParent, LoginFlags nFlags,
get(m_pErrorFT, "errorft");
get(m_pErrorInfo, "errorinfo");
get(m_pRequestInfo, "requestinfo");
get(m_pPathFT, "pathft");
get(m_pPathED, "pathed");
get(m_pPathBtn, "pathbtn");
get(m_pNameFT, "nameft");
get(m_pNameED, "nameed");
get(m_pPasswordFT, "passwordft");
......@@ -211,11 +168,9 @@ LoginDialog::LoginDialog(vcl::Window* pParent, LoginFlags nFlags,
SetRequest();
m_pPathED->SetMaxTextLen( _MAX_PATH );
m_pNameED->SetMaxTextLen( _MAX_PATH );
m_pOKBtn->SetClickHdl( LINK( this, LoginDialog, OKHdl_Impl ) );
m_pPathBtn->SetClickHdl( LINK( this, LoginDialog, PathHdl_Impl ) );
m_pUseSysCredsCB->SetClickHdl( LINK( this, LoginDialog, UseSysCredsHdl_Impl ) );
HideControls_Impl( nFlags );
......
......@@ -29,7 +29,6 @@
enum class LoginFlags {
NONE = 0x0000,
NoPath = 0x0001, // hide "path"
NoUsername = 0x0002, // hide "name"
NoPassword = 0x0004, // hide "password"
NoSavePassword = 0x0008, // hide "save password"
......@@ -40,7 +39,7 @@ enum class LoginFlags {
NoUseSysCreds = 0x0100, // hide "use system credentials"
};
namespace o3tl {
template<> struct typed_flags<LoginFlags> : is_typed_flags<LoginFlags, 0x01ff> {};
template<> struct typed_flags<LoginFlags> : is_typed_flags<LoginFlags, 0x01fe> {};
}
......@@ -49,9 +48,6 @@ class LoginDialog : public ModalDialog
VclPtr<FixedText> m_pErrorFT;
VclPtr<FixedText> m_pErrorInfo;
VclPtr<FixedText> m_pRequestInfo;
VclPtr<FixedText> m_pPathFT;
VclPtr<Edit> m_pPathED;
VclPtr<PushButton> m_pPathBtn;
VclPtr<FixedText> m_pNameFT;
VclPtr<Edit> m_pNameED;
VclPtr<FixedText> m_pPasswordFT;
......@@ -69,7 +65,6 @@ class LoginDialog : public ModalDialog
void SetRequest();
DECL_LINK(OKHdl_Impl, Button*, void);
DECL_LINK(PathHdl_Impl, Button*, void);
DECL_LINK(UseSysCredsHdl_Impl, Button*, void);
public:
......
......@@ -186,56 +186,6 @@
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="pathft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes" context="logindialog|pathft">_Path:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">pathed</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkEntry" id="pathed">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="pathbtn">
<property name="label" translatable="yes" context="logindialog|pathbtn">_Browse…</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="loginrealm">
<property name="can_focus">False</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment