sc/UIConfig_scalc.mk | 1 sc/inc/sc.hrc | 1 sc/source/ui/inc/retypepassdlg.hrc | 8 sc/source/ui/inc/retypepassdlg.hxx | 22 +- sc/source/ui/miscdlgs/retypepassdlg.cxx | 92 ++++------ sc/source/ui/miscdlgs/retypepassdlg.src | 91 ---------- sc/source/ui/view/tabvwshh.cxx | 6 sc/uiconfig/scalc/ui/retypepassworddialog.ui | 233 +++++++++++++++++++++++++++ 8 files changed, 285 insertions(+), 169 deletions(-)
New commits: commit 131a01e0beac937b9b7f1b2beb9b61e5b0f2a4aa Author: Caolán McNamara <caol...@redhat.com> Date: Mon Dec 30 20:16:03 2013 +0000 convert retype password input dialog to .ui Change-Id: I97940629f93a5a1948a8771b9d9668bc28c49a91 diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 7ab5ca2..bd785c9 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -119,6 +119,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/protectsheetdlg \ sc/uiconfig/scalc/ui/queryrunstreamscriptdialog \ sc/uiconfig/scalc/ui/randomnumbergenerator \ + sc/uiconfig/scalc/ui/retypepassworddialog \ sc/uiconfig/scalc/ui/rightfooterdialog \ sc/uiconfig/scalc/ui/rightheaderdialog \ sc/uiconfig/scalc/ui/rowheightdialog \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 1f38832..695bce6 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1096,7 +1096,6 @@ #define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146) #define RID_SCDLG_TABPROTECTION (SC_DIALOGS_START + 148) #define RID_SCDLG_RETYPEPASS (SC_DIALOGS_START + 150) -#define RID_SCDLG_RETYPEPASS_INPUT (SC_DIALOGS_START + 151) #define RID_POPUP_FILTER (SC_DIALOGS_START + 153) #define RID_COND_ENTRY (SC_DIALOGS_START + 156) diff --git a/sc/source/ui/inc/retypepassdlg.hrc b/sc/source/ui/inc/retypepassdlg.hrc index 2684a30..09c88ec 100644 --- a/sc/source/ui/inc/retypepassdlg.hrc +++ b/sc/source/ui/inc/retypepassdlg.hrc @@ -54,12 +54,4 @@ #define STR_HASH_GOOD 203 #define STR_HASH_REGENERATED 204 -#define FT_PASSWORD1 301 -#define ED_PASSWORD1 302 -#define FT_PASSWORD2 303 -#define ED_PASSWORD2 304 -#define BTN_MATCH_OLD_PASSWORD 305 -#define BTN_RETYPE_PASSWORD 306 -#define BTN_REMOVE_PASSWORD 307 - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/retypepassdlg.hxx b/sc/source/ui/inc/retypepassdlg.hxx index efb0872..90c4863 100644 --- a/sc/source/ui/inc/retypepassdlg.hxx +++ b/sc/source/ui/inc/retypepassdlg.hxx @@ -20,10 +20,11 @@ #ifndef SC_UI_RETYPEPASS_DLG_HXX #define SC_UI_RETYPEPASS_DLG_HXX -#include <vcl/dialog.hxx> #include <vcl/button.hxx> -#include <vcl/fixed.hxx> +#include <vcl/dialog.hxx> #include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/layout.hxx> #include <vcl/scrbar.hxx> #include <svx/checklbx.hxx> #include <svtools/stdctrl.hxx> @@ -140,20 +141,17 @@ private: void CheckPasswordInput(); private: - OKButton maBtnOk; - CancelButton maBtnCancel; - HelpButton maBtnHelp; + OKButton* m_pBtnOk; - RadioButton maBtnRetypePassword; + RadioButton* m_pBtnRetypePassword; - FixedText maPassword1Text; - Edit maPassword1Edit; - FixedText maPassword2Text; - Edit maPassword2Edit; + VclContainer* m_pPasswordGrid; + Edit* m_pPassword1Edit; + Edit* m_pPassword2Edit; - CheckBox maBtnMatchOldPass; + CheckBox* m_pBtnMatchOldPass; - RadioButton maBtnRemovePassword; + RadioButton* m_pBtnRemovePassword; DECL_LINK( OKHdl, void* ); DECL_LINK( RadioBtnHdl, RadioButton* ); diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index 7abf7e9..478b7f7 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -393,25 +393,19 @@ IMPL_LINK_NOARG(ScRetypePassDlg, ScrollHdl) // ============================================================================ -ScRetypePassInputDlg::ScRetypePassInputDlg(Window* pParent, ScPassHashProtectable* pProtected) : - ModalDialog(pParent, ScResId(RID_SCDLG_RETYPEPASS_INPUT)), - - maBtnOk (this, ScResId(BTN_OK)), - maBtnCancel (this, ScResId(BTN_CANCEL)), - maBtnHelp (this, ScResId(BTN_HELP)), - - maBtnRetypePassword(this, ScResId(BTN_RETYPE_PASSWORD)), - - maPassword1Text (this, ScResId(FT_PASSWORD1)), - maPassword1Edit (this, ScResId(ED_PASSWORD1)), - maPassword2Text (this, ScResId(FT_PASSWORD2)), - maPassword2Edit (this, ScResId(ED_PASSWORD2)), - maBtnMatchOldPass(this, ScResId(BTN_MATCH_OLD_PASSWORD)), - - maBtnRemovePassword(this, ScResId(BTN_REMOVE_PASSWORD)), - - mpProtected(pProtected) +ScRetypePassInputDlg::ScRetypePassInputDlg(Window* pParent, ScPassHashProtectable* pProtected) + : ModalDialog(pParent, "RetypePasswordDialog", + "modules/scalc/ui/retypepassworddialog.ui") + , mpProtected(pProtected) { + get(m_pBtnOk, "ok"); + get(m_pBtnRetypePassword, "retypepassword"); + get(m_pBtnRemovePassword, "removepassword"); + get(m_pPasswordGrid, "passwordgrid"); + get(m_pPassword1Edit, "newpassEntry"); + get(m_pPassword2Edit, "confirmpassEntry"); + get(m_pBtnMatchOldPass, "mustmatch"); + Init(); } @@ -426,67 +420,67 @@ short ScRetypePassInputDlg::Execute() bool ScRetypePassInputDlg::IsRemovePassword() const { - return maBtnRemovePassword.IsChecked(); + return m_pBtnRemovePassword->IsChecked(); } OUString ScRetypePassInputDlg::GetNewPassword() const { - return maPassword1Edit.GetText(); + return m_pPassword1Edit->GetText(); } void ScRetypePassInputDlg::Init() { Link aLink = LINK( this, ScRetypePassInputDlg, OKHdl ); - maBtnOk.SetClickHdl(aLink); + m_pBtnOk->SetClickHdl(aLink); aLink = LINK( this, ScRetypePassInputDlg, RadioBtnHdl ); - maBtnRetypePassword.SetClickHdl(aLink); - maBtnRemovePassword.SetClickHdl(aLink); + m_pBtnRetypePassword->SetClickHdl(aLink); + m_pBtnRemovePassword->SetClickHdl(aLink); aLink = LINK( this, ScRetypePassInputDlg, CheckBoxHdl ); - maBtnMatchOldPass.SetClickHdl(aLink); + m_pBtnMatchOldPass->SetClickHdl(aLink); aLink = LINK( this, ScRetypePassInputDlg, PasswordModifyHdl ); - maPassword1Edit.SetModifyHdl(aLink); - maPassword2Edit.SetModifyHdl(aLink); + m_pPassword1Edit->SetModifyHdl(aLink); + m_pPassword2Edit->SetModifyHdl(aLink); - maBtnOk.Disable(); - maBtnRetypePassword.Check(true); - maBtnMatchOldPass.Check(true); - maPassword1Edit.GrabFocus(); + m_pBtnOk->Disable(); + m_pBtnRetypePassword->Check(true); + m_pBtnMatchOldPass->Check(true); + m_pPassword1Edit->GrabFocus(); } void ScRetypePassInputDlg::CheckPasswordInput() { - OUString aPass1 = maPassword1Edit.GetText(); - OUString aPass2 = maPassword2Edit.GetText(); + OUString aPass1 = m_pPassword1Edit->GetText(); + OUString aPass2 = m_pPassword2Edit->GetText(); if (aPass1.isEmpty() || aPass2.isEmpty()) { // Empty password is not allowed. - maBtnOk.Disable(); + m_pBtnOk->Disable(); return; } if (aPass1 != aPass2) { // The two passwords differ. - maBtnOk.Disable(); + m_pBtnOk->Disable(); return; } - if (!maBtnMatchOldPass.IsChecked()) + if (!m_pBtnMatchOldPass->IsChecked()) { - maBtnOk.Enable(); + m_pBtnOk->Enable(); return; } if (!mpProtected) { // This should never happen! - maBtnOk.Disable(); + m_pBtnOk->Disable(); return; } bool bPassGood = mpProtected->verifyPassword(aPass1); - maBtnOk.Enable(bPassGood); + m_pBtnOk->Enable(bPassGood); } IMPL_LINK_NOARG(ScRetypePassInputDlg, OKHdl) @@ -497,25 +491,17 @@ IMPL_LINK_NOARG(ScRetypePassInputDlg, OKHdl) IMPL_LINK( ScRetypePassInputDlg, RadioBtnHdl, RadioButton*, pBtn ) { - if (pBtn == &maBtnRetypePassword) + if (pBtn == m_pBtnRetypePassword) { - maBtnRemovePassword.Check(false); - maPassword1Text.Enable(); - maPassword1Edit.Enable(); - maPassword2Text.Enable(); - maPassword2Edit.Enable(); - maBtnMatchOldPass.Enable(); + m_pBtnRemovePassword->Check(false); + m_pPasswordGrid->Enable(); CheckPasswordInput(); } - else if (pBtn == &maBtnRemovePassword) + else if (pBtn == m_pBtnRemovePassword) { - maBtnRetypePassword.Check(false); - maPassword1Text.Disable(); - maPassword1Edit.Disable(); - maPassword2Text.Disable(); - maPassword2Edit.Disable(); - maBtnMatchOldPass.Disable(); - maBtnOk.Enable(); + m_pBtnRetypePassword->Check(false); + m_pPasswordGrid->Disable(); + m_pBtnOk->Enable(); } return 0; diff --git a/sc/source/ui/miscdlgs/retypepassdlg.src b/sc/source/ui/miscdlgs/retypepassdlg.src index 6e0b550..c3014ba 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.src +++ b/sc/source/ui/miscdlgs/retypepassdlg.src @@ -222,95 +222,4 @@ ModalDialog RID_SCDLG_RETYPEPASS }; }; -// ---------------------------------------------------------------------------- - -ModalDialog RID_SCDLG_RETYPEPASS_INPUT -{ - HelpID = "sc:ModalDialog:RID_SCDLG_RETYPEPASS_INPUT"; - Text [ en-US ] = "Re-type Password" ; - Size = MAP_APPFONT ( 230 , 110 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 174, 6 ) ; - Size = MAP_APPFONT ( 50, 14 ) ; - DefButton = TRUE ; - }; - - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 174, 23 ) ; - Size = MAP_APPFONT ( 50, 14 ) ; - }; - - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 174, 43 ) ; - Size = MAP_APPFONT ( 50, 14 ) ; - }; - - RadioButton BTN_RETYPE_PASSWORD - { - HelpID = "sc:RadioButton:RID_SCDLG_RETYPEPASS_INPUT:BTN_RETYPE_PASSWORD"; - Pos = MAP_APPFONT ( 11, 10 ); - Size = MAP_APPFONT ( 150, 10 ); - - Text [ en-US ] = "Re-type password" ; - }; - - FixedText FT_PASSWORD1 - { - Pos = MAP_APPFONT ( 20, 30 ); - Size = MAP_APPFONT ( 42, 10 ); - - Text [ en-US ] = "~Password" ; - }; - - Edit ED_PASSWORD1 - { - HelpID = "sc:Edit:RID_SCDLG_RETYPEPASS_INPUT:ED_PASSWORD1"; - Border = TRUE; - PassWord = TRUE; - Pos = MAP_APPFONT ( 65, 29 ); - Size = MAP_APPFONT ( 75, 12 ); - }; - - FixedText FT_PASSWORD2 - { - Pos = MAP_APPFONT ( 20, 45 ); - Size = MAP_APPFONT ( 42, 10 ); - - Text [ en-US ] = "~Confirm" ; - }; - - Edit ED_PASSWORD2 - { - HelpID = "sc:Edit:RID_SCDLG_RETYPEPASS_INPUT:ED_PASSWORD2"; - Border = TRUE; - PassWord = TRUE; - Pos = MAP_APPFONT ( 65, 44 ); - Size = MAP_APPFONT ( 75, 12 ); - }; - - CheckBox BTN_MATCH_OLD_PASSWORD - { - HelpID = "sc:CheckBox:RID_SCDLG_RETYPEPASS_INPUT:BTN_MATCH_OLD_PASSWORD"; - Pos = MAP_APPFONT ( 20, 65 ); - Size = MAP_APPFONT ( 150, 10 ); - - Text [ en-US ] = "New password must match the original password." ; - }; - - RadioButton BTN_REMOVE_PASSWORD - { - HelpID = "sc:RadioButton:RID_SCDLG_RETYPEPASS_INPUT:BTN_REMOVE_PASSWORD"; - Pos = MAP_APPFONT ( 11, 90 ); - Size = MAP_APPFONT ( 150, 10 ); - - Text [ en-US ] = "Remove password from this protected item." ; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/uiconfig/scalc/ui/retypepassworddialog.ui b/sc/uiconfig/scalc/ui/retypepassworddialog.ui new file mode 100644 index 0000000..8493401 --- /dev/null +++ b/sc/uiconfig/scalc/ui/retypepassworddialog.ui @@ -0,0 +1,233 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="RetypePasswordDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Re-type Password</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <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> + <property name="receives_default">True</property> + <property name="use_stock">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="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="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkRadioButton" id="retypepassword"> + <property name="label" translatable="yes">Re-type password</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="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">removepassword</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="passwordgrid"> + <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="GtkEntry" id="newpassEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="visibility">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="confirmpassEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="visibility">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Pa_ssword</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">newpassEntry</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Confi_rm</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">confirmpassEntry</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="mustmatch"> + <property name="label" translatable="yes">New password must match the original password.</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="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="removepassword"> + <property name="label" translatable="yes">Remove password from this protected item.</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="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">retypepassword</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> + <object class="GtkSizeGroup" id="sizegroup1"> + <widgets> + <widget name="label4"/> + <widget name="label5"/> + </widgets> + </object> +</interface> commit 963970f3a3fded6d152cc4c6eefb61359adad567 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Dec 30 17:14:54 2013 +0000 std::auto_ptr->boost::scoped_ptr Change-Id: Icb67d5a39c8ae05947be9da950a1feaaa85bc9d8 diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index 84e805b..3dad53e 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -36,7 +36,7 @@ #include "retypepassdlg.hxx" #include "tabprotection.hxx" -#include <memory> +#include <boost/scoped_ptr.hpp> using namespace com::sun::star; @@ -261,11 +261,9 @@ sal_Bool ScTabViewShell::HasAccessibilityObjects() bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash) { - using ::std::auto_ptr; - ScDocument* pDoc = GetViewData()->GetDocument(); - auto_ptr<ScRetypePassDlg> pDlg(new ScRetypePassDlg(GetDialogParent())); + boost::scoped_ptr<ScRetypePassDlg> pDlg(new ScRetypePassDlg(GetDialogParent())); pDlg->SetDataFromDocument(*pDoc); pDlg->SetDesiredHash(eDesiredHash); if (pDlg->Execute() != RET_OK)
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits