core.git: uui/source uui/uiconfig

2023-12-13 Thread Samuel Mehrbrodt (via logerrit)
 uui/source/secmacrowarnings.cxx|   13 +
 uui/source/secmacrowarnings.hxx|1 +
 uui/uiconfig/ui/macrowarnmedium.ui |   19 ++-
 3 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit a383794fba07cb6a356274febd55968fb25f77e4
Author: Samuel Mehrbrodt 
AuthorDate: Mon Dec 11 14:11:42 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Dec 14 08:19:35 2023 +0100

tdf#158576 This button shows a certificate when only one signature found

"Show signatures" should only be shown when there are multiple signatures,
otherwise the button label must be "Show certificate"

Change-Id: Iaed2d10b8e94bf6decad937dafef4795b7ed40dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160596
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index e5e1a46fdb97..e526b6da8b99 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -43,6 +43,7 @@ MacroWarning::MacroWarning(weld::Window* pParent, bool 
_bWithSignatures)
 , mxNotYetValid(m_xBuilder->weld_label("certNotYetValidLabel"))
 , mxNoLongerValid(m_xBuilder->weld_label("certNoLongerValidLabel"))
 , mxViewSignsBtn(m_xBuilder->weld_button("viewSignsButton"))
+, mxViewCertBtn(m_xBuilder->weld_button("viewCertButton"))
 , mxAlwaysTrustCB(m_xBuilder->weld_check_button("alwaysTrustCheckbutton"))
 , mxEnableBtn(m_xBuilder->weld_button("ok"))
 , mxDisableBtn(m_xBuilder->weld_button("cancel"))
@@ -131,10 +132,12 @@ void MacroWarning::InitControls()
 // show signature controls?
 if (mbShowSignatures)
 {
+mxAlwaysTrustCB->connect_toggled(LINK(this, MacroWarning, 
AlwaysTrustCheckHdl));
 mxAlwaysTrustCB->set_sensitive(false);
 mxViewSignsBtn->connect_clicked(LINK(this, MacroWarning, 
ViewSignsBtnHdl));
-mxViewSignsBtn->set_sensitive(false);
-mxAlwaysTrustCB->connect_toggled(LINK(this, MacroWarning, 
AlwaysTrustCheckHdl));
+mxViewSignsBtn->set_visible(false);
+mxViewCertBtn->connect_clicked(LINK(this, MacroWarning, 
ViewSignsBtnHdl));
+mxViewCertBtn->set_visible(false);
 
 mnActSecLevel = SvtSecurityOptions::GetMacroSecurityLevel();
 if ( mnActSecLevel >= 2 )
@@ -168,7 +171,8 @@ void MacroWarning::SetStorage( const css::uno::Reference < 
css::embed::XStorage
 }
 
 mxSignsFI->set_label(s.makeStringAndClear());
-mxViewSignsBtn->set_sensitive(true);
+mxViewSignsBtn->set_visible(true);
+mxViewCertBtn->set_visible(false);
 }
 
 void MacroWarning::SetCertificate( const css::uno::Reference< 
css::security::XCertificate >& _rxCert )
@@ -186,7 +190,8 @@ void MacroWarning::SetCertificate( const 
css::uno::Reference< css::security::XCe
 utl::typeConvert( mxCert->getNotValidAfter(), aDateTimeEnd );
 mxNotYetValid->set_visible(now < aDateTimeStart);
 mxNoLongerValid->set_visible(now > aDateTimeEnd);
-mxViewSignsBtn->set_sensitive(true);
+mxViewSignsBtn->set_visible(false);
+mxViewCertBtn->set_visible(true);
 }
 }
 
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 1a6e7f0b7380..80f1fb76599e 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -35,6 +35,7 @@ private:
 std::unique_ptr mxNotYetValid;
 std::unique_ptr mxNoLongerValid;
 std::unique_ptr mxViewSignsBtn;
+std::unique_ptr mxViewCertBtn;
 std::unique_ptr mxAlwaysTrustCB;
 std::unique_ptr mxEnableBtn;
 std::unique_ptr mxDisableBtn;
diff --git a/uui/uiconfig/ui/macrowarnmedium.ui 
b/uui/uiconfig/ui/macrowarnmedium.ui
index 810fbbb6d12b..4d7a416e83e9 100644
--- a/uui/uiconfig/ui/macrowarnmedium.ui
+++ b/uui/uiconfig/ui/macrowarnmedium.ui
@@ -125,7 +125,7 @@ Macros may contain viruses. Disabling macros for a document 
is always safe. If y
 
 
   
-_View Signatures…
+_Show Signatures…
 True
 True
 True
@@ -140,6 +140,23 @@ Macros may contain viruses. Disabling macros for a 
document is always safe. If y
 1
   
 
+
+  
+_Show Certificate…
+True
+True
+True
+end
+start
+True
+True
+  
+  
+False
+True
+2
+  
+
   
   
 0


[Libreoffice-commits] core.git: uui/source uui/uiconfig

2023-11-15 Thread Sarper Akdemir (via logerrit)
 uui/source/masterpasscrtdlg.cxx |   25 ++
 uui/source/masterpasscrtdlg.hxx |2 +
 uui/uiconfig/ui/setmasterpassworddlg.ui |   44 ++--
 3 files changed, 64 insertions(+), 7 deletions(-)

New commits:
commit fed7b3068dcea2ebf65314c4f212350720631706
Author: Sarper Akdemir 
AuthorDate: Mon Nov 13 17:19:01 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Nov 15 22:02:16 2023 +0100

tdf#157518: enforce password policy on setmasterpassworddlg

Change-Id: I7e7adde8f0d55808d16dc9247954a7645a1d3601
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159384
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 2216ea5a1d48..f0c456365646 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -33,10 +34,27 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, 
weld::Entry&, void)
 m_xOKBtn->set_sensitive(aPasswordText.getLength() >= 1);
 m_xPasswdStrengthBar->set_percentage(
 SvPasswordHelper::GetPasswordStrengthPercentage(aPasswordText));
+
+if(m_oPasswordPolicy)
+{
+bool bPasswordMeetsPolicy
+= SvPasswordHelper::PasswordMeetsPolicy(aPasswordText, 
m_oPasswordPolicy);
+m_xEDMasterPasswordCrt->set_message_type(bPasswordMeetsPolicy ? 
weld::EntryMessageType::Normal
+ : 
weld::EntryMessageType::Error);
+m_xPasswordPolicyLabel->set_visible(!bPasswordMeetsPolicy);
+}
 }
 
 IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, weld::Button&, void)
 {
+if (m_oPasswordPolicy
+&& 
!SvPasswordHelper::PasswordMeetsPolicy(m_xEDMasterPasswordCrt->get_text(),
+  m_oPasswordPolicy))
+{
+m_xEDMasterPasswordCrt->grab_focus();
+return;
+}
+
 // compare both passwords and show message box if there are not equal!!
 if (m_xEDMasterPasswordCrt->get_text() == 
m_xEDMasterPasswordRepeat->get_text())
 m_xDialog->response(RET_OK);
@@ -57,13 +75,20 @@ 
MasterPasswordCreateDialog::MasterPasswordCreateDialog(weld::Window* pParent, co
 : GenericDialogController(pParent, "uui/ui/setmasterpassworddlg.ui", 
"SetMasterPasswordDialog")
 , rResLocale(rLocale)
 , m_xEDMasterPasswordCrt(m_xBuilder->weld_entry("password1"))
+, m_xPasswordPolicyLabel(m_xBuilder->weld_label("passpolicylabel"))
 , m_xEDMasterPasswordRepeat(m_xBuilder->weld_entry("password2"))
 , m_xOKBtn(m_xBuilder->weld_button("ok"))
 , m_xPasswdStrengthBar(m_xBuilder->weld_level_bar("password1levelbar"))
+, 
m_oPasswordPolicy(officecfg::Office::Common::Security::Scripting::PasswordPolicy::get())
 {
 m_xOKBtn->set_sensitive(false);
 m_xOKBtn->connect_clicked( LINK( this, MasterPasswordCreateDialog, 
OKHdl_Impl ) );
 m_xEDMasterPasswordCrt->connect_changed( LINK( this, 
MasterPasswordCreateDialog, EditHdl_Impl ) );
+if (m_oPasswordPolicy)
+{
+m_xPasswordPolicyLabel->set_label(
+
officecfg::Office::Common::Security::Scripting::PasswordPolicyErrorMessage::get());
+}
 }
 
 MasterPasswordCreateDialog::~MasterPasswordCreateDialog()
diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx
index f7f01cda79cc..83f981190bb1 100644
--- a/uui/source/masterpasscrtdlg.hxx
+++ b/uui/source/masterpasscrtdlg.hxx
@@ -27,9 +27,11 @@ private:
 const std::locale& rResLocale;
 
 std::unique_ptr m_xEDMasterPasswordCrt;
+std::unique_ptr m_xPasswordPolicyLabel;
 std::unique_ptr m_xEDMasterPasswordRepeat;
 std::unique_ptr m_xOKBtn;
 std::unique_ptr m_xPasswdStrengthBar;
+std::optional m_oPasswordPolicy;
 
 DECL_LINK(OKHdl_Impl, weld::Button&, void);
 DECL_LINK(EditHdl_Impl, weld::Entry&, void);
diff --git a/uui/uiconfig/ui/setmasterpassworddlg.ui 
b/uui/uiconfig/ui/setmasterpassworddlg.ui
index 52cec48eb30a..1fd06e0e5c57 100644
--- a/uui/uiconfig/ui/setmasterpassworddlg.ui
+++ b/uui/uiconfig/ui/setmasterpassworddlg.ui
@@ -95,14 +95,43 @@
   
 
 
-  
+  
+  
 True
-False
-6
-_Enter password:
-True
-password1
-0
+False
+12
+1
+
+  
+True
+False
+end
+6
+True
+_Enter password:
+True
+password1
+0
+  
+  
+0
+0
+

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-05-18 Thread Caolán McNamara
 uui/source/fltdlg.cxx   |   48 ++-
 uui/source/fltdlg.hxx   |   18 +++--
 uui/source/iahndl-filter.cxx|   15 +--
 uui/uiconfig/ui/filterselect.ui |   54 +---
 4 files changed, 77 insertions(+), 58 deletions(-)

New commits:
commit 8a8c384eeb8bc8dace6c77bad59e6d2654e8840b
Author: Caolán McNamara 
Date:   Thu May 17 10:53:29 2018 +0100

weld FilterDialog

I think this is theoretical and in practice this dialog never appears
anymore

Change-Id: I1c29432ecf0df215c686c228326183d9a3a422d3
Reviewed-on: https://gerrit.libreoffice.org/54489
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index e904fcdadb68..2911acb03b22 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -44,28 +44,18 @@ namespace uui
 @param  "pParentWindow"  , parent window for dialog
 @threadsafe no
 
*//*-*/
-FilterDialog::FilterDialog( vcl::Window* pParentWindow )
-:   ModalDialog  (pParentWindow, "FilterSelectDialog", 
"uui/ui/filterselect.ui" )
-,   m_pFilterNames(nullptr)
+FilterDialog::FilterDialog(weld::Window* pParentWindow)
+: GenericDialogController(pParentWindow, "uui/ui/filterselect.ui", 
"FilterSelectDialog")
+, m_pFilterNames(nullptr)
+, m_xFtURL(m_xBuilder->weld_label("url"))
+, m_xLbFilters(m_xBuilder->weld_tree_view("filters"))
 {
-get(m_pFtURL, "url");
-get(m_pLbFilters, "filters");
-Size aSize(pParentWindow->LogicToPixel(Size(182, 175), 
MapMode(MapUnit::MapAppFont)));
-m_pLbFilters->set_height_request(aSize.Height());
-m_pLbFilters->set_width_request(aSize.Width());
-m_pFtURL->SetSizePixel(Size(aSize.Width(), 
m_pFtURL->GetOptimalSize().Height()));
+m_xLbFilters->set_size_request(m_xLbFilters->get_approximate_digit_width() 
* 42,
+   m_xLbFilters->get_height_rows(15));
 }
 
 FilterDialog::~FilterDialog()
 {
-disposeOnce();
-}
-
-void FilterDialog::dispose()
-{
-m_pFtURL.clear();
-m_pLbFilters.clear();
-ModalDialog::dispose();
 }
 
 
/*-
@@ -77,7 +67,7 @@ void FilterDialog::dispose()
 void FilterDialog::SetURL( const OUString& sURL )
 {
 // convert it and use given pure string as fallback if conversion failed
-m_pFtURL->SetText( impl_buildUIFileName(sURL) );
+m_xFtURL->set_label(impl_buildUIFileName(sURL));
 }
 
 
/*-
@@ -100,14 +90,14 @@ void FilterDialog::SetURL( const OUString& sURL )
 void FilterDialog::ChangeFilters( const FilterNameList* pFilterNames )
 {
 m_pFilterNames = pFilterNames;
-m_pLbFilters->Clear();
+m_xLbFilters->clear();
 if( m_pFilterNames != nullptr )
 {
 for( FilterNameListPtr pItem  = m_pFilterNames->begin();
pItem != m_pFilterNames->end()  ;
++pItem )
 {
-m_pLbFilters->InsertEntry( pItem->sUI );
+m_xLbFilters->append_text(pItem->sUI);
 }
 }
 }
@@ -136,12 +126,12 @@ bool FilterDialog::AskForFilter( FilterNameListPtr& 
pSelectedItem )
 
 if( m_pFilterNames != nullptr )
 {
-if( ModalDialog::Execute() == RET_OK )
+if (m_xDialog->run() == RET_OK)
 {
-OUString sEntry = m_pLbFilters->GetSelectedEntry();
+OUString sEntry = m_xLbFilters->get_selected_text();
 if( !sEntry.isEmpty() )
 {
-int nPos = m_pLbFilters->GetSelectedEntryPos();
+int nPos = m_xLbFilters->get_selected_index();
 if( nPos < static_cast(m_pFilterNames->size()) )
 {
 pSelectedItem  = m_pFilterNames->begin();
@@ -167,18 +157,18 @@ bool FilterDialog::AskForFilter( FilterNameListPtr& 
pSelectedItem )
 class StringCalculator : public ::cppu::WeakImplHelper< 
css::util::XStringWidth >
 {
 public:
-explicit StringCalculator( const OutputDevice* pDevice )
-: m_pDevice( const_cast< OutputDevice * >( pDevice ) )
+explicit StringCalculator(weld::Widget* pDevice)
+: m_pDevice(pDevice)
 {
 }
 
 sal_Int32 SAL_CALL queryStringWidth( const OUString& sString ) override
 {
-return static_cast(m_pDevice->GetTextWidth(sString));
+return 
static_cast(m_pDevice->get_pixel_size(sString).Width());
 }
 
 private:
-VclPtr m_pDevice;
+weld::Widget* m_pDevice;
 };
 
 

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-05-17 Thread Caolán McNamara
 uui/source/authfallbackdlg.cxx   |   69 +--
 uui/source/authfallbackdlg.hxx   |   36 +++-
 uui/source/iahndl-authentication.cxx |8 -
 uui/uiconfig/ui/authfallback.ui  |  156 +--
 4 files changed, 122 insertions(+), 147 deletions(-)

New commits:
commit bf09cd79d3414d88ea6c1d348ed191a77e8c413e
Author: Caolán McNamara 
Date:   Thu May 17 10:16:55 2018 +0100

AuthFallbackDlg

Change-Id: I69676dd437caefca63805e86f4707527183f622f
Reviewed-on: https://gerrit.libreoffice.org/54487
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx
index b5d8b4f1c5a4..b7190107da2a 100644
--- a/uui/source/authfallbackdlg.cxx
+++ b/uui/source/authfallbackdlg.cxx
@@ -13,77 +13,60 @@
 
 using namespace boost;
 
-AuthFallbackDlg::AuthFallbackDlg(Window* pParent, const OUString& instructions,
+AuthFallbackDlg::AuthFallbackDlg(weld::Window* pParent, const OUString& 
instructions,
  const OUString& url)
-: ModalDialog(pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui")
+: GenericDialogController(pParent, "uui/ui/authfallback.ui", 
"AuthFallbackDlg")
 , m_bGoogleMode( false )
+, m_xTVInstructions(m_xBuilder->weld_label("instructions"))
+, m_xEDUrl(m_xBuilder->weld_entry("url"))
+, m_xEDCode(m_xBuilder->weld_entry("code"))
+, m_xEDGoogleCode(m_xBuilder->weld_entry("google_code"))
+, m_xBTOk(m_xBuilder->weld_button("ok"))
+, m_xBTCancel(m_xBuilder->weld_button("cancel"))
+, m_xGoogleBox(m_xBuilder->weld_widget("GDrive"))
+, m_xOneDriveBox(m_xBuilder->weld_widget("OneDrive"))
 {
-get( m_pTVInstructions, "instructions" );
-get( m_pEDUrl, "url" );
-get( m_pEDCode, "code" );
-get( m_pEDGoogleCode, "google_code" );
-get( m_pBTOk, "ok" );
-get( m_pBTCancel, "cancel" );
-get( m_pGoogleBox, "GDrive" );
-get( m_pOneDriveBox, "OneDrive" );
+m_xBTOk->connect_clicked( LINK( this, AuthFallbackDlg, OKHdl) );
+m_xBTCancel->connect_clicked( LINK( this, AuthFallbackDlg, CancelHdl) );
+m_xBTOk->set_sensitive(true);
 
-m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) );
-m_pBTCancel->SetClickHdl( LINK( this, AuthFallbackDlg, CancelHdl) );
-m_pBTOk->Enable();
-
-m_pTVInstructions->SetText( instructions );
-m_pTVInstructions->SetPaintTransparent(true);
+m_xTVInstructions->set_label(instructions);
 if( url.isEmpty() )
 {
 // Google 2FA
 m_bGoogleMode = true;
-m_pGoogleBox->Show();
-m_pOneDriveBox->Hide();
-m_pEDUrl->Hide();
+m_xGoogleBox->show();
+m_xOneDriveBox->hide();
+m_xEDUrl->hide();
 }
 else
 {
 // OneDrive
 m_bGoogleMode = false;
-m_pGoogleBox->Hide();
-m_pOneDriveBox->Show();
-m_pEDUrl->SetText( url );
+m_xGoogleBox->hide();
+m_xOneDriveBox->show();
+m_xEDUrl->set_text( url );
 }
 }
 
 AuthFallbackDlg::~AuthFallbackDlg()
 {
-disposeOnce();
 }
 
 OUString AuthFallbackDlg::GetCode() const
 {
 if( m_bGoogleMode )
-return m_pEDGoogleCode->GetText();
+return m_xEDGoogleCode->get_text();
 else
-return m_pEDCode->GetText();
-}
-
-
-void AuthFallbackDlg::dispose()
-{
-m_pTVInstructions.clear();
-m_pEDUrl.clear();
-m_pEDCode.clear();
-m_pEDGoogleCode.clear();
-m_pBTOk.clear();
-m_pBTCancel.clear();
-m_pGoogleBox.clear();
-m_pOneDriveBox.clear();
-ModalDialog::dispose();
+return m_xEDCode->get_text();
 }
 
-IMPL_LINK_NOARG ( AuthFallbackDlg,  OKHdl, Button *, void)
+IMPL_LINK_NOARG(AuthFallbackDlg,  OKHdl, weld::Button&, void)
 {
-EndDialog( RET_OK );
+m_xDialog->response(RET_OK);
 }
 
-IMPL_LINK_NOARG ( AuthFallbackDlg,  CancelHdl, Button *, void)
+IMPL_LINK_NOARG(AuthFallbackDlg,  CancelHdl, weld::Button&, void)
 {
-EndDialog();
+m_xDialog->response(RET_CANCEL);
 }
diff --git a/uui/source/authfallbackdlg.hxx b/uui/source/authfallbackdlg.hxx
index ff10407265b5..206cd87274a7 100644
--- a/uui/source/authfallbackdlg.hxx
+++ b/uui/source/authfallbackdlg.hxx
@@ -10,38 +10,32 @@
 #ifndef INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX
 #define INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-class AuthFallbackDlg : public ModalDialog
+#include 
+
+class AuthFallbackDlg : public weld::GenericDialogController
 {
 private:
-VclPtr m_pTVInstructions;
-VclPtr m_pEDUrl;
-VclPtr m_pEDCode;
-VclPtr m_pEDGoogleCode;
-VclPtr m_pBTOk;
-VclPtr m_pBTCancel;
-VclPtr m_pGoogleBox;
-VclPtr m_pOneDriveBox;
 bool m_bGoogleMode;
 
+std::unique_ptr m_xTVInstructions;
+std::unique_ptr m_xEDUrl;
+std::unique_ptr m_xEDCode;
+std::unique_ptr m_xEDGoogleCode;
+

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-05-17 Thread Caolán McNamara
 uui/source/iahndl.cxx  |   23 ++---
 uui/source/nameclashdlg.cxx|   64 +++--
 uui/source/nameclashdlg.hxx|   37 +
 uui/uiconfig/ui/simplenameclash.ui |   11 --
 4 files changed, 62 insertions(+), 73 deletions(-)

New commits:
commit 45112bfd091b8a14729f1010d2662c9064ba03e6
Author: Caolán McNamara 
Date:   Thu May 17 09:51:42 2018 +0100

weld NameClashDialog

Change-Id: I4c68bc92fa90ca4a9723f2664549f34b50213bfb
Reviewed-on: https://gerrit.libreoffice.org/54471
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 63e3fbdea28a..fa017aabadab 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1019,18 +1019,18 @@ executeMessageBox(
 return aResult;
 }
 
-NameClashResolveDialogResult executeSimpleNameClashResolveDialog( vcl::Window 
*pParent,
-  OUString 
const & rTargetFolderURL,
-  OUString 
const & rClashingName,
-  OUString & 
rProposedNewName,
-  bool 
bAllowOverwrite )
+NameClashResolveDialogResult executeSimpleNameClashResolveDialog(weld::Window 
*pParent,
+ OUString 
const & rTargetFolderURL,
+ OUString 
const & rClashingName,
+ OUString & 
rProposedNewName,
+ bool 
bAllowOverwrite)
 {
 std::locale aResLocale = Translate::Create("uui");
-ScopedVclPtrInstance aDialog(pParent, aResLocale, 
rTargetFolderURL,
-  rClashingName, 
rProposedNewName, bAllowOverwrite);
+NameClashDialog aDialog(pParent, aResLocale, rTargetFolderURL,
+rClashingName, rProposedNewName, bAllowOverwrite);
 
-NameClashResolveDialogResult eResult = 
static_cast(aDialog->Execute());
-rProposedNewName = aDialog->getNewName();
+NameClashResolveDialogResult eResult = 
static_cast(aDialog.run());
+rProposedNewName = aDialog.getNewName();
 return eResult;
 }
 
@@ -1063,11 +1063,12 @@ UUIInteractionHelper::handleNameClashResolveRequest(
 NameClashResolveDialogResult eResult = ABORT;
 OUString aProposedNewName( rRequest.ProposedNewName );
 
-eResult = executeSimpleNameClashResolveDialog( getParentProperty(),
+uno::Reference xParent = getParentXWindow();
+eResult = 
executeSimpleNameClashResolveDialog(Application::GetFrameWeld(xParent),
 rRequest.TargetFolderURL,
 rRequest.ClashingName,
 aProposedNewName,
-xReplaceExistingData.is() );
+xReplaceExistingData.is());
 
 switch ( eResult )
 {
diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx
index 9403c21af606..5c64583da46d 100644
--- a/uui/source/nameclashdlg.cxx
+++ b/uui/source/nameclashdlg.cxx
@@ -27,48 +27,47 @@
 
 // NameClashDialog -
 
-IMPL_LINK( NameClashDialog, ButtonHdl_Impl, Button *, pBtn, void )
+IMPL_LINK(NameClashDialog, ButtonHdl_Impl, weld::Button&, rBtn, void)
 {
 long nRet = long(ABORT);
-if ( m_pBtnRename == pBtn )
+if (m_xBtnRename.get() == )
 {
 nRet = long(RENAME);
-OUString aNewName = m_pEDNewName->GetText();
-if ( ( aNewName == maNewName ) || aNewName.isEmpty() )
+OUString aNewName = m_xEDNewName->get_text();
+if ( ( aNewName == m_aNewName ) || aNewName.isEmpty() )
 {
-std::unique_ptr 
xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+std::unique_ptr 
xErrorBox(Application::CreateMessageDialog(m_xDialog.get(),
   VclMessageType::Warning, 
VclButtonsType::Ok,
-  maSameName));
+  m_aSameName));
 xErrorBox->run();
 return;
 }
-maNewName = aNewName;
+m_aNewName = aNewName;
 }
-else if ( m_pBtnOverwrite == pBtn )
+else if (m_xBtnOverwrite.get() == )
 nRet = long(OVERWRITE);
 
-EndDialog( nRet );
+m_xDialog->response(nRet);
 }
 
 
-NameClashDialog::NameClashDialog( vcl::Window* pParent, const std::locale& 
rResLocale,
+NameClashDialog::NameClashDialog( weld::Window* pParent, const std::locale& 
rResLocale,
   OUString const & rTargetFolderURL,
 

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-05-17 Thread Caolán McNamara
 uui/source/iahndl-authentication.cxx|   22 
 uui/source/masterpasscrtdlg.cxx |   43 
 uui/source/masterpasscrtdlg.hxx |   28 +++-
 uui/source/masterpassworddlg.cxx|   26 +--
 uui/source/masterpassworddlg.hxx|   25 +++---
 uui/uiconfig/ui/masterpassworddlg.ui|   13 +++--
 uui/uiconfig/ui/setmasterpassworddlg.ui |   19 ++
 7 files changed, 80 insertions(+), 96 deletions(-)

New commits:
commit 3c8b38521aa584704cfa153c51fb15ca601daf9f
Author: Caolán McNamara 
Date:   Wed May 16 21:19:52 2018 +0100

weld MasterPasswordCreateDialog and MasterPasswordDialog

Change-Id: I4c235546590046b06a1fea9b62d91cf2da664227

diff --git a/uui/source/iahndl-authentication.cxx 
b/uui/source/iahndl-authentication.cxx
index b9d88b92e056..673a6e441f52 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -393,7 +393,7 @@ handleAuthenticationRequest_(
 
 void
 executeMasterPasswordDialog(
-vcl::Window * pParent,
+weld::Window* pParent,
 LoginErrorInfo & rInfo,
 task::PasswordRequestMode nMode)
 {
@@ -404,21 +404,19 @@ executeMasterPasswordDialog(
 std::locale aResLocale(Translate::Create("uui"));
 if( nMode == task::PasswordRequestMode_PASSWORD_CREATE )
 {
-ScopedVclPtrInstance< MasterPasswordCreateDialog > xDialog(
-pParent, aResLocale);
-rInfo.SetResult(xDialog->Execute()
+MasterPasswordCreateDialog aDialog(pParent, aResLocale);
+rInfo.SetResult(aDialog.run()
 == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel);
 aMaster = OUStringToOString(
-xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8);
+aDialog.GetMasterPassword(), RTL_TEXTENCODING_UTF8);
 }
 else
 {
-ScopedVclPtrInstance< MasterPasswordDialog > xDialog(
-pParent, nMode, aResLocale);
-rInfo.SetResult(xDialog->Execute()
+MasterPasswordDialog aDialog(pParent, nMode, aResLocale);
+rInfo.SetResult(aDialog.run()
 == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel);
 aMaster = OUStringToOString(
-xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8);
+aDialog.GetMasterPassword(), RTL_TEXTENCODING_UTF8);
 }
 }
 
@@ -446,7 +444,7 @@ executeMasterPasswordDialog(
 
 void
 handleMasterPasswordRequest_(
-vcl::Window * pParent,
+weld::Window * pParent,
 task::PasswordRequestMode nMode,
 uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
 rContinuations)
@@ -632,7 +630,9 @@ UUIInteractionHelper::handleMasterPasswordRequest(
 task::MasterPasswordRequest aMasterPasswordRequest;
 if (aAnyRequest >>= aMasterPasswordRequest)
 {
-handleMasterPasswordRequest_(getParentProperty(),
+uno::Reference xParent = getParentXWindow();
+
+handleMasterPasswordRequest_(Application::GetFrameWeld(xParent),
  aMasterPasswordRequest.Mode,
  rRequest->getContinuations());
 return true;
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 42d4a053bd95..8505e2cf7bfd 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -27,52 +27,43 @@
 // 
MasterPasswordCreateDialog---
 
 
-IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, Edit&, void)
+IMPL_LINK_NOARG(MasterPasswordCreateDialog, EditHdl_Impl, weld::Entry&, void)
 {
-m_pOKBtn->Enable( m_pEDMasterPasswordCrt->GetText().getLength() >= 1 );
+m_xOKBtn->set_sensitive(m_xEDMasterPasswordCrt->get_text().getLength() >= 
1);
 }
 
-IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl, weld::Button&, void)
 {
 // compare both passwords and show message box if there are not equal!!
-if( m_pEDMasterPasswordCrt->GetText() == 
m_pEDMasterPasswordRepeat->GetText() )
-EndDialog( RET_OK );
+if (m_xEDMasterPasswordCrt->get_text() == 
m_xEDMasterPasswordRepeat->get_text())
+m_xDialog->response(RET_OK);
 else
 {
 OUString aErrorMsg(Translate::get(STR_ERROR_PASSWORDS_NOT_IDENTICAL, 
rResLocale));
-std::unique_ptr 
xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
+std::unique_ptr 
xErrorBox(Application::CreateMessageDialog(m_xDialog.get(),
   VclMessageType::Warning, 
VclButtonsType::Ok,
   aErrorMsg));
 xErrorBox->run();
-m_pEDMasterPasswordCrt->SetText( OUString() );
-

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-04-11 Thread Caolán McNamara
 uui/source/iahndl-authentication.cxx |   41 +
 uui/source/logindlg.cxx  |  145 +++
 uui/source/logindlg.hxx  |   56 ++---
 uui/uiconfig/ui/logindialog.ui   |   35 ++--
 4 files changed, 136 insertions(+), 141 deletions(-)

New commits:
commit 9c0684c9efca25ab9a39002b34328fafc30cc8bd
Author: Caolán McNamara 
Date:   Wed Apr 11 15:24:46 2018 +0100

weld LoginDialog

Change-Id: I8f2af38bff24a0d4dc088eb1150220a8ea0f0fba
Reviewed-on: https://gerrit.libreoffice.org/52730
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/uui/source/iahndl-authentication.cxx 
b/uui/source/iahndl-authentication.cxx
index a9f0d8d3cca4..b9d88b92e056 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -58,7 +58,7 @@ namespace {
 
 void
 executeLoginDialog(
-vcl::Window * pParent,
+weld::Window* pParent,
 LoginErrorInfo & rInfo,
 OUString const & rRealm)
 {
@@ -82,40 +82,40 @@ executeLoginDialog(
 if (!bCanUseSysCreds)
 nFlags |= LoginFlags::NoUseSysCreds;
 
-ScopedVclPtrInstance< LoginDialog > xDialog(pParent, nFlags, 
rInfo.GetServer(), rRealm);
+LoginDialog aDialog(pParent, nFlags, rInfo.GetServer(), rRealm);
 if (!rInfo.GetErrorText().isEmpty())
-xDialog->SetErrorText(rInfo.GetErrorText());
-xDialog->SetName(rInfo.GetUserName());
+aDialog.SetErrorText(rInfo.GetErrorText());
+aDialog.SetName(rInfo.GetUserName());
 if (bAccount)
-xDialog->ClearAccount();
+aDialog.ClearAccount();
 else
-xDialog->ClearPassword();
-xDialog->SetPassword(rInfo.GetPassword());
+aDialog.ClearPassword();
+aDialog.SetPassword(rInfo.GetPassword());
 
 if (bSavePassword)
 {
 std::locale aLocale(Translate::Create("uui"));
-xDialog->SetSavePasswordText(
+aDialog.SetSavePasswordText(
 Translate::get(rInfo.GetIsRememberPersistent()
   ? RID_SAVE_PASSWORD
   : RID_KEEP_PASSWORD,
   aLocale));
 
-xDialog->SetSavePassword(rInfo.GetIsRememberPassword());
+aDialog.SetSavePassword(rInfo.GetIsRememberPassword());
 }
 
 if ( bCanUseSysCreds )
-xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() );
+aDialog.SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() );
 
-rInfo.SetResult(xDialog->Execute() == RET_OK ? DialogMask::ButtonsOk :
-   DialogMask::ButtonsCancel);
-rInfo.SetUserName(xDialog->GetName());
-rInfo.SetPassword(xDialog->GetPassword());
-rInfo.SetAccount(xDialog->GetAccount());
-rInfo.SetIsRememberPassword(xDialog->IsSavePassword());
+rInfo.SetResult(aDialog.run() == RET_OK ? DialogMask::ButtonsOk :
+  DialogMask::ButtonsCancel);
+rInfo.SetUserName(aDialog.GetName());
+rInfo.SetPassword(aDialog.GetPassword());
+rInfo.SetAccount(aDialog.GetAccount());
+rInfo.SetIsRememberPassword(aDialog.IsSavePassword());
 
 if ( bCanUseSysCreds )
-  rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() );
+  rInfo.SetIsUseSystemCredentials( aDialog.IsUseSystemCredentials() );
 }
 
 void getRememberModes(
@@ -172,7 +172,7 @@ void getRememberModes(
 
 void
 handleAuthenticationRequest_(
-vcl::Window * pParent,
+weld::Window * pParent,
 uno::Reference< task::XInteractionHandler2 > const & xIH,
 uno::Reference< uno::XComponentContext > const & xContext,
 ucb::AuthenticationRequest const & rRequest,
@@ -595,11 +595,12 @@ UUIInteractionHelper::handleAuthenticationRequest(
 uno::Reference< task::XInteractionRequest > const & rRequest)
 {
 uno::Any aAnyRequest(rRequest->getRequest());
+uno::Reference xParent = getParentXWindow();
 
 ucb::URLAuthenticationRequest aURLAuthenticationRequest;
 if (aAnyRequest >>= aURLAuthenticationRequest)
 {
-handleAuthenticationRequest_(getParentProperty(),
+handleAuthenticationRequest_(Application::GetFrameWeld(xParent),
  getInteractionHandler(),
  m_xContext,
  aURLAuthenticationRequest,
@@ -611,7 +612,7 @@ UUIInteractionHelper::handleAuthenticationRequest(
 ucb::AuthenticationRequest aAuthenticationRequest;
 if (aAnyRequest >>= aAuthenticationRequest)
 {
-handleAuthenticationRequest_(getParentProperty(),
+handleAuthenticationRequest_(Application::GetFrameWeld(xParent),
  getInteractionHandler(),
  m_xContext,
  aAuthenticationRequest,
diff --git 

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-03-16 Thread Caolán McNamara
 uui/source/iahndl-authentication.cxx |   12 ++---
 uui/source/passworddlg.cxx   |   74 +--
 uui/source/passworddlg.hxx   |   27 
 uui/uiconfig/ui/password.ui  |   15 +--
 4 files changed, 56 insertions(+), 72 deletions(-)

New commits:
commit d2f95590f478a68a4de6ef05018785523e46506b
Author: Caolán McNamara 
Date:   Fri Mar 16 16:07:22 2018 +

Related: tdf#115964 convert the problematic dialog to a native gtk3 one

Change-Id: I84e10f1c45dfbe267f9b350d74271ac149bdaf43
Reviewed-on: https://gerrit.libreoffice.org/51432
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/uui/source/iahndl-authentication.cxx 
b/uui/source/iahndl-authentication.cxx
index 12ed4ed7aff9..2d4d5362f169 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -518,11 +518,11 @@ executePasswordDialog(
 {
 if (bIsSimplePasswordRequest)
 {
-ScopedVclPtrInstance xDialog(pParent, nMode, 
aResLocale, aDocName,
-bIsPasswordToModify, bIsSimplePasswordRequest);
+std::unique_ptr xDialog(new 
PasswordDialog(pParent ? pParent->GetFrameWeld() : nullptr, nMode,
+aResLocale, aDocName, bIsPasswordToModify, 
bIsSimplePasswordRequest));
 xDialog->SetMinLen(0);
 
-rInfo.SetResult(xDialog->Execute() == RET_OK ? 
DialogMask::ButtonsOk : DialogMask::ButtonsCancel);
+rInfo.SetResult(xDialog->run() == RET_OK ? 
DialogMask::ButtonsOk : DialogMask::ButtonsCancel);
 rInfo.SetPassword(xDialog->GetPassword());
 }
 else
@@ -541,11 +541,11 @@ executePasswordDialog(
 }
 else // enter password or reenter password
 {
-ScopedVclPtrInstance xDialog(pParent, nMode, 
aResLocale, aDocName,
-bIsPasswordToModify, bIsSimplePasswordRequest);
+std::unique_ptr xDialog(new PasswordDialog(pParent 
? pParent->GetFrameWeld() : nullptr, nMode,
+aResLocale, aDocName, bIsPasswordToModify, 
bIsSimplePasswordRequest));
 xDialog->SetMinLen(0);
 
-rInfo.SetResult(xDialog->Execute() == RET_OK ? 
DialogMask::ButtonsOk : DialogMask::ButtonsCancel);
+rInfo.SetResult(xDialog->run() == RET_OK ? DialogMask::ButtonsOk : 
DialogMask::ButtonsCancel);
 rInfo.SetPassword(bIsPasswordToModify ? OUString() : 
xDialog->GetPassword());
 rInfo.SetPasswordToModify(bIsPasswordToModify ? 
xDialog->GetPassword() : OUString());
 }
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index eec9540de9a8..14cb63446eae 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -27,100 +27,84 @@
 
 using namespace ::com::sun::star;
 
-PasswordDialog::PasswordDialog(vcl::Window* _pParent,
+PasswordDialog::PasswordDialog(weld::Window* pParent,
 task::PasswordRequestMode nDlgMode, const std::locale& rLocale,
 const OUString& aDocURL, bool bOpenToModify, bool bIsSimplePasswordRequest)
-: ModalDialog(_pParent, "PasswordDialog", "uui/ui/password.ui")
+: GenericDialogController(pParent, "uui/ui/password.ui", "PasswordDialog")
+, m_xFTPassword(m_xBuilder->weld_label("newpassFT"))
+, m_xEDPassword(m_xBuilder->weld_entry("newpassEntry"))
+, m_xFTConfirmPassword(m_xBuilder->weld_label("confirmpassFT"))
+, m_xEDConfirmPassword(m_xBuilder->weld_entry("confirmpassEntry"))
+, m_xOKBtn(m_xBuilder->weld_button("ok"))
 , nMinLen(1)
 , aPasswdMismatch(Translate::get(STR_PASSWORD_MISMATCH, rLocale))
 , nDialogMode(nDlgMode)
 , rResLocale(rLocale)
 {
-get(m_pFTPassword, "newpassFT");
-get(m_pEDPassword, "newpassEntry");
-get(m_pFTConfirmPassword, "confirmpassFT");
-get(m_pEDConfirmPassword, "confirmpassEntry");
-get(m_pOKBtn, "ok");
-
 if( nDialogMode == task::PasswordRequestMode_PASSWORD_REENTER )
 {
 const char* pOpenToModifyErrStrId = bOpenToModify ? 
STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
 const char* pErrStrId = bIsSimplePasswordRequest ? 
STR_ERROR_SIMPLE_PASSWORD_WRONG : pOpenToModifyErrStrId;
 OUString aErrorMsg(Translate::get(pErrStrId, rResLocale));
-std::unique_ptr 
xBox(Application::CreateMessageDialog(_pParent ? _pParent->GetFrameWeld() : 
nullptr,
+std::unique_ptr 
xBox(Application::CreateMessageDialog(pParent,
   VclMessageType::Warning, 
VclButtonsType::Ok, aErrorMsg));
 xBox->run();
 }
 
 // default settings for enter password or reenter passwd...
 OUString aTitle(Translate::get(STR_TITLE_ENTER_PASSWORD, rResLocale));
-m_pFTConfirmPassword->Hide();
-

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2018-01-05 Thread Noel Grandin
 uui/source/iahndl-authentication.cxx |1 
 uui/source/logindlg.cxx  |   45 ---
 uui/source/logindlg.hxx  |7 
 uui/uiconfig/ui/logindialog.ui   |   50 ---
 4 files changed, 1 insertion(+), 102 deletions(-)

New commits:
commit f1d1854ffe2c1bc456855573b3ed4ad9852f4571
Author: Noel Grandin 
Date:   Thu Jan 4 16:54:27 2018 +0200

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/47403
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/uui/source/iahndl-authentication.cxx 
b/uui/source/iahndl-authentication.cxx
index b5ec2ed481fd..643e0e12a4e2 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -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)
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index c4a5c9d305cc..53011ff1ddf5 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -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 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 );
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index 8b6e7731e498..85b2ef3f1f99 100644
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -29,7 +29,6 @@
 
 enum class LoginFlags {
 NONE= 0x,
-NoPath  = 0x0001,  // hide "path"
 NoUsername  

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2016-08-18 Thread Yousuf Philips
 uui/source/authfallbackdlg.cxx  |   27 +-
 uui/source/authfallbackdlg.hxx  |9 ++-
 uui/uiconfig/ui/authfallback.ui |  102 ++--
 3 files changed, 108 insertions(+), 30 deletions(-)

New commits:
commit 32d160300e7bd51c0f273275a3d8872e55af9ad3
Author: Yousuf Philips 
Date:   Mon Aug 15 13:14:58 2016 +0400

tdf#87938 Add descriptive instructions to 2fa dialog

Change-Id: I0bbe3ae4591785e32467dec8554493f0b549d009
Reviewed-on: https://gerrit.libreoffice.org/28105
Reviewed-by: Szymon Kłos 
Tested-by: Szymon Kłos 

diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx
index 8911074..dedcdc8 100644
--- a/uui/source/authfallbackdlg.cxx
+++ b/uui/source/authfallbackdlg.cxx
@@ -17,29 +17,37 @@ using namespace boost;
 AuthFallbackDlg::AuthFallbackDlg(Window* pParent, const OUString& instructions,
  const OUString& url)
 : ModalDialog(pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui")
+, m_bGoogleMode( false )
 {
 get( m_pTVInstructions, "instructions" );
 get( m_pEDUrl, "url" );
 get( m_pEDCode, "code" );
+get( m_pEDGoogleCode, "google_code" );
 get( m_pBTOk, "ok" );
 get( m_pBTCancel, "cancel" );
-get( m_pFTGooglePrefixLabel, "google_prefix_label" );
+get( m_pGoogleBox, "GDrive" );
+get( m_pOneDriveBox, "OneDrive" );
 
 m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) );
 m_pBTCancel->SetClickHdl( LINK( this, AuthFallbackDlg, CancelHdl) );
 m_pBTOk->Enable();
 
 m_pTVInstructions->SetText( instructions );
+m_pTVInstructions->SetPaintTransparent(true);
 if( url.isEmpty() )
 {
 // Google 2FA
-m_pFTGooglePrefixLabel->Show();
+m_bGoogleMode = true;
+m_pGoogleBox->Show();
+m_pOneDriveBox->Hide();
 m_pEDUrl->Hide();
 }
 else
 {
 // OneDrive
-m_pFTGooglePrefixLabel->Hide();
+m_bGoogleMode = false;
+m_pGoogleBox->Hide();
+m_pOneDriveBox->Show();
 m_pEDUrl->SetText( url );
 }
 }
@@ -49,14 +57,25 @@ AuthFallbackDlg::~AuthFallbackDlg()
 disposeOnce();
 }
 
+OUString AuthFallbackDlg::GetCode() const
+{
+if( m_bGoogleMode )
+return m_pEDGoogleCode->GetText();
+else
+return m_pEDCode->GetText();
+}
+
+
 void AuthFallbackDlg::dispose()
 {
 m_pTVInstructions.clear();
 m_pEDUrl.clear();
 m_pEDCode.clear();
+m_pEDGoogleCode.clear();
 m_pBTOk.clear();
 m_pBTCancel.clear();
-m_pFTGooglePrefixLabel.clear();
+m_pGoogleBox.clear();
+m_pOneDriveBox.clear();
 ModalDialog::dispose();
 }
 
diff --git a/uui/source/authfallbackdlg.hxx b/uui/source/authfallbackdlg.hxx
index 9e5eb52..4df88dd 100644
--- a/uui/source/authfallbackdlg.hxx
+++ b/uui/source/authfallbackdlg.hxx
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-
+#include 
 
 class AuthFallbackDlg : public ModalDialog
 {
@@ -23,9 +23,12 @@ private:
 VclPtr m_pTVInstructions;
 VclPtr m_pEDUrl;
 VclPtr m_pEDCode;
+VclPtr m_pEDGoogleCode;
 VclPtr m_pBTOk;
 VclPtr m_pBTCancel;
-VclPtr m_pFTGooglePrefixLabel;
+VclPtr m_pGoogleBox;
+VclPtr m_pOneDriveBox;
+bool m_bGoogleMode;
 
 public:
 AuthFallbackDlg(Window* pParent, const OUString& instructions,
@@ -33,7 +36,7 @@ public:
 virtual ~AuthFallbackDlg();
 virtual void dispose() override;
 
-OUString GetCode() const { return m_pEDCode->GetText(); }
+OUString GetCode() const;
 
 private:
 
diff --git a/uui/uiconfig/ui/authfallback.ui b/uui/uiconfig/ui/authfallback.ui
index d99fa99..09b0dc8 100644
--- a/uui/uiconfig/ui/authfallback.ui
+++ b/uui/uiconfig/ui/authfallback.ui
@@ -64,13 +64,52 @@
 vertical
 6
 
-  
+  
 True
 False
-4
-False
-word
-False
+vertical
+6
+
+  
+True
+False
+4
+False
+word
+False
+  
+  
+False
+True
+0
+  
+
+
+  
+True
+True
+False
+●
+  
+  
+False
+True
+1
+  
+
+
+  
+True
+True
+●
+0
+  
+  
+False
+True
+2
+   

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2016-05-23 Thread Szymon Kłos
 uui/source/authfallbackdlg.cxx  |9 +
 uui/source/authfallbackdlg.hxx  |2 ++
 uui/uiconfig/ui/authfallback.ui |   26 --
 3 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 5dee1106703a14c0128880736db77cd7507df776
Author: Szymon Kłos 
Date:   Mon May 23 19:49:31 2016 +0200

Google 2FA: better info for user

Google sends SMS with code in format "G-XX".
User should enter only numbers wihout "G-".

+ added "G-" label which is shown in the Google
  authentication code request before PIN field

Change-Id: I8eaecbbe7b8803269444f947e97ee67c33db61b2

diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx
index a6383d1..db0448e 100644
--- a/uui/source/authfallbackdlg.cxx
+++ b/uui/source/authfallbackdlg.cxx
@@ -23,6 +23,7 @@ AuthFallbackDlg::AuthFallbackDlg(Window* pParent, const 
OUString& instructions,
 get( m_pEDCode, "code" );
 get( m_pBTOk, "ok" );
 get( m_pBTCancel, "cancel" );
+get( m_pFTGooglePrefixLabel, "google_prefix_label" );
 
 m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) );
 m_pBTCancel->SetClickHdl( LINK( this, AuthFallbackDlg, CancelHdl) );
@@ -30,9 +31,17 @@ AuthFallbackDlg::AuthFallbackDlg(Window* pParent, const 
OUString& instructions,
 
 m_pTVInstructions->SetText( instructions );
 if( url.isEmpty() )
+{
+// Google 2FA
+m_pFTGooglePrefixLabel->Show();
 m_pEDUrl->Hide();
+}
 else
+{
+// OneDrive
+m_pFTGooglePrefixLabel->Hide();
 m_pEDUrl->SetText( url );
+}
 }
 
 AuthFallbackDlg::~AuthFallbackDlg()
diff --git a/uui/source/authfallbackdlg.hxx b/uui/source/authfallbackdlg.hxx
index b90bb15..9e5eb52 100644
--- a/uui/source/authfallbackdlg.hxx
+++ b/uui/source/authfallbackdlg.hxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 class AuthFallbackDlg : public ModalDialog
@@ -24,6 +25,7 @@ private:
 VclPtr m_pEDCode;
 VclPtr m_pBTOk;
 VclPtr m_pBTCancel;
+VclPtr m_pFTGooglePrefixLabel;
 
 public:
 AuthFallbackDlg(Window* pParent, const OUString& instructions,
diff --git a/uui/uiconfig/ui/authfallback.ui b/uui/uiconfig/ui/authfallback.ui
index 6c99edf..dbeb5b5 100644
--- a/uui/uiconfig/ui/authfallback.ui
+++ b/uui/uiconfig/ui/authfallback.ui
@@ -92,10 +92,32 @@
   
 
 
-  
+  
 True
 False
-●
+
+  
+False
+G-
+  
+  
+False
+True
+0
+  
+
+
+  
+True
+False
+●
+  
+  
+False
+True
+1
+  
+
   
   
 False
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: uui/source uui/uiconfig

2016-05-02 Thread Stephan Bergmann
 uui/source/logindlg.cxx|   38 ++
 uui/source/logindlg.hxx|5 -
 uui/uiconfig/ui/logindialog.ui |   28 
 3 files changed, 58 insertions(+), 13 deletions(-)

New commits:
commit f88554edd46d2dc8d6c8eaba74c89ccd3e537104
Author: Stephan Bergmann 
Date:   Mon May 2 23:20:11 2016 +0200

Related tdf#98644: In login dialog, give a hint that the password was wrong

...by changing the dialog text from "Enter user name and password for..." 
to "Wrong
user name and password for..." when an old password is already given.

Change-Id: Ie167c5ea263e9f75e0269c528dc88b69270208f3

diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index 8cf4e58..740c847 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -61,6 +61,12 @@ void LoginDialog::dispose()
 ModalDialog::dispose();
 }
 
+void LoginDialog::SetPassword( const OUString& rNew )
+{
+m_pPasswordED->SetText( rNew );
+SetRequest();
+}
+
 void LoginDialog::HideControls_Impl( sal_uInt16 nFlags )
 {
 if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH )
@@ -128,6 +134,23 @@ void LoginDialog::EnableUseSysCredsControls_Impl( bool 
bUseSysCredsEnabled )
 m_pAccountED->Enable( !bUseSysCredsEnabled );
 }
 
+void LoginDialog::SetRequest()
+{
+bool oldPwd = !m_pPasswordED->GetText().isEmpty();
+OUString aRequest;
+if (m_pAccountFT->IsVisible() && !m_realm.isEmpty())
+{
+aRequest = get(oldPwd ? "wrongloginrealm" : "loginrealm")
+->GetText();
+aRequest = aRequest.replaceAll("%2", m_realm);
+}
+else
+aRequest = get(oldPwd ? "wrongrequestinfo" : "requestinfo")
+->GetText();
+aRequest = aRequest.replaceAll("%1", m_server);
+m_pRequestInfo->SetText(aRequest);
+}
+
 IMPL_LINK_NOARG_TYPED(LoginDialog, OKHdl_Impl, Button*, void)
 {
 // trim the strings
@@ -165,7 +188,8 @@ IMPL_LINK_NOARG_TYPED(LoginDialog, UseSysCredsHdl_Impl, 
Button*, void)
 
 LoginDialog::LoginDialog(vcl::Window* pParent, sal_uInt16 nFlags,
 const OUString& rServer, const OUString& rRealm)
-: ModalDialog(pParent, "LoginDialog", "uui/ui/logindialog.ui")
+: ModalDialog(pParent, "LoginDialog", "uui/ui/logindialog.ui"),
+  m_server(rServer), m_realm(rRealm)
 {
 get(m_pErrorFT, "errorft");
 get(m_pErrorInfo, "errorinfo");
@@ -183,20 +207,10 @@ LoginDialog::LoginDialog(vcl::Window* pParent, sal_uInt16 
nFlags,
 get(m_pUseSysCredsCB, "syscreds");
 get(m_pOKBtn, "ok");
 
-OUString aRequest;
-if ((nFlags & LF_NO_ACCOUNT) != 0 && !rRealm.isEmpty())
-{
-aRequest = get("loginrealm")->GetText();
-aRequest = aRequest.replaceAll("%2", rRealm);
-}
-else
-aRequest = m_pRequestInfo->GetText();
-
 if ( !( ( nFlags & LF_NO_USESYSCREDS ) == LF_NO_USESYSCREDS ) )
   EnableUseSysCredsControls_Impl( m_pUseSysCredsCB->IsChecked() );
 
-aRequest = aRequest.replaceAll("%1", rServer);
-m_pRequestInfo->SetText(aRequest);
+SetRequest();
 
 m_pPathED->SetMaxTextLen( _MAX_PATH );
 m_pNameED->SetMaxTextLen( _MAX_PATH );
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index 567c401..e5e7d98 100644
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -55,9 +55,12 @@ class LoginDialog : public ModalDialog
 VclPtr   m_pSavePasswdBtn;
 VclPtr   m_pUseSysCredsCB;
 VclPtr   m_pOKBtn;
+OUString m_server;
+OUString m_realm;
 
 voidHideControls_Impl( sal_uInt16 nFlags );
 voidEnableUseSysCredsControls_Impl( bool bUseSysCredsEnabled );
+voidSetRequest();
 
 DECL_LINK_TYPED(OKHdl_Impl, Button*, void);
 DECL_LINK_TYPED(PathHdl_Impl, Button*, void);
@@ -72,7 +75,7 @@ public:
 OUStringGetName() const { return 
m_pNameED->GetText(); }
 voidSetName( const OUString& rNewName )   { 
m_pNameED->SetText( rNewName ); }
 OUStringGetPassword() const { return 
m_pPasswordED->GetText(); }
-voidSetPassword( const OUString& rNew )   { 
m_pPasswordED->SetText( rNew ); }
+voidSetPassword( const OUString& rNew );
 OUStringGetAccount() const  { return 
m_pAccountED->GetText(); }
 boolIsSavePassword() const  { return 
m_pSavePasswdBtn->IsChecked(); }
 voidSetSavePassword( bool bSave )   { 
m_pSavePasswdBtn->Check( bSave ); }
diff --git a/uui/uiconfig/ui/logindialog.ui b/uui/uiconfig/ui/logindialog.ui
index ca47ea5..806d8f5 100644
--- a/uui/uiconfig/ui/logindialog.ui
+++ b/uui/uiconfig/ui/logindialog.ui
@@ -251,6 +251,34 @@
   
 
 
+  
+False
+True
+0
+Wrong user name and 

[Libreoffice-commits] core.git: uui/source uui/uiconfig

2015-05-14 Thread Andras Timar
 uui/source/secmacrowarnings.cxx|5 -
 uui/source/secmacrowarnings.hxx|1 +
 uui/uiconfig/ui/macrowarnmedium.ui |   14 ++
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit bf6a14e0ba4eb2a47da0146379ec905089ab3a6c
Author: Andras Timar andras.ti...@collabora.com
Date:   Thu May 14 10:32:26 2015 +0200

make hardcoded string localizable

Change-Id: Ie0bc8e8bd5e0770b85130496359e64358e34c836
Reviewed-on: https://gerrit.libreoffice.org/15727
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index cb32f76..8af1a4e 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -73,6 +73,7 @@ MacroWarning::MacroWarning( vcl::Window* _pParent, bool 
_bWithSignatures, ResMgr
 get(mpSymbolImg, symbolImage);
 get(mpDocNameFI, docNameLabel);
 get(mpDescr1FI, descr1Label);
+get(mpDescr1aFI, descr1aLabel);
 get(mpSignsFI, signsLabel);
 get(mpViewSignsBtn, viewSignsButton);
 get(mpDescr2FI, descr2Label);
@@ -96,6 +97,7 @@ void MacroWarning::dispose()
 {
 mpSymbolImg.clear();
 mpDocNameFI.clear();
+mpDescr1aFI.clear();
 mpDescr1FI.clear();
 mpSignsFI.clear();
 mpViewSignsBtn.clear();
@@ -191,7 +193,8 @@ void MacroWarning::InitControls()
 }
 else
 {
-mpDescr1FI-SetText(The document contains document macros.);
+mpDescr1FI-Hide();
+mpDescr1aFI-Show();
 mpSignsFI-Hide();
 mpViewSignsBtn-Hide();
 mpAlwaysTrustCB-Hide();
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 076916f..f51bb90 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -47,6 +47,7 @@ private:
 VclPtrFixedImage mpSymbolImg;
 VclPtrFixedText  mpDocNameFI;
 VclPtrFixedText  mpDescr1FI;
+VclPtrFixedText  mpDescr1aFI;
 VclPtrFixedText  mpSignsFI;
 VclPtrPushButton mpViewSignsBtn;
 VclPtrFixedText  mpDescr2FI;
diff --git a/uui/uiconfig/ui/macrowarnmedium.ui 
b/uui/uiconfig/ui/macrowarnmedium.ui
index 5519a4b..a9c49c3 100644
--- a/uui/uiconfig/ui/macrowarnmedium.ui
+++ b/uui/uiconfig/ui/macrowarnmedium.ui
@@ -133,6 +133,20 @@
   /packing
 /child
 child
+  object class=GtkLabel id=descr1aLabel
+property name=visibleFalse/property
+property name=can_focusFalse/property
+property name=halignstart/property
+property name=hexpandTrue/property
+property name=label translatable=yesThe document 
contains document macros./property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position1/property
+  /packing
+/child
+child
   object class=GtkBox id=box3
 property name=visibleTrue/property
 property name=can_focusFalse/property
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits