diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-30 20:16:03 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-30 20:23:05 +0000 |
commit | 131a01e0beac937b9b7f1b2beb9b61e5b0f2a4aa (patch) | |
tree | f509c6ecf2680be546b9f9deb918a1dcf51a60ba /sc | |
parent | std::auto_ptr->boost::scoped_ptr (diff) | |
download | core-131a01e0beac937b9b7f1b2beb9b61e5b0f2a4aa.tar.gz core-131a01e0beac937b9b7f1b2beb9b61e5b0f2a4aa.zip |
convert retype password input dialog to .ui
Change-Id: I97940629f93a5a1948a8771b9d9668bc28c49a91
Diffstat (limited to 'sc')
-rw-r--r-- | sc/UIConfig_scalc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/retypepassdlg.hrc | 8 | ||||
-rw-r--r-- | sc/source/ui/inc/retypepassdlg.hxx | 22 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/retypepassdlg.cxx | 92 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/retypepassdlg.src | 91 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/retypepassworddialog.ui | 233 |
7 files changed, 283 insertions, 165 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 7ab5ca28de97..bd785c980123 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 1f388322147f..695bce6e86e3 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 2684a305269b..09c88ecfb1ed 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 efb0872922eb..90c4863ca87b 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 7abf7e98cc8f..478b7f710d73 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 6e0b550017ad..c3014bae6a8a 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 000000000000..84934012cf15 --- /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> |