sw/UIConfig_swriter.mk | 1 sw/inc/dbui.hrc | 1 sw/inc/helpid.h | 1 sw/source/ui/dbui/createaddresslistdialog.cxx | 45 ++---- sw/source/ui/dbui/createaddresslistdialog.hrc | 8 - sw/source/ui/dbui/createaddresslistdialog.hxx | 23 +-- sw/source/ui/dbui/createaddresslistdialog.src | 59 -------- sw/uiconfig/swriter/ui/findentrydialog.ui | 190 ++++++++++++++++++++++++++ vcl/inc/svids.hrc | 1 vcl/source/src/btntext.src | 5 vcl/source/window/builder.cxx | 2 11 files changed, 229 insertions(+), 107 deletions(-)
New commits: commit 780887431209af99743f1bece265118dfb340988 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Sep 9 12:18:10 2013 +0100 convert find entry dialog to .ui Change-Id: I0d8ef363e45f9032676a161c63d7cf9bcbe417fd diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index d05381b..fed58d3 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -96,6 +96,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/envprinterpage \ sw/uiconfig/swriter/ui/exchangedatabases \ sw/uiconfig/swriter/ui/fielddialog \ + sw/uiconfig/swriter/ui/findentrydialog \ sw/uiconfig/swriter/ui/flddbpage \ sw/uiconfig/swriter/ui/flddocinfopage \ sw/uiconfig/swriter/ui/flddocumentpage \ diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc index a03816e..1bb029f0 100644 --- a/sw/inc/dbui.hrc +++ b/sw/inc/dbui.hrc @@ -36,7 +36,6 @@ #define DLG_MM_SELECTDBTABLEDDIALOG (RC_DBUI_BEGIN + 12) #define DLG_MM_DBTABLEPREVIEWDIALOG (RC_DBUI_BEGIN + 13) #define DLG_MM_CREATEADDRESSLIST (RC_DBUI_BEGIN + 14) -#define DLG_MM_FIND_ENTRY (RC_DBUI_BEGIN + 15) #define DLG_MM_CUSTOMIZE_ADDRESS_LIST (RC_DBUI_BEGIN + 17) #define DLG_MM_CUSTOMIZEADDRESSBLOCK (RC_DBUI_BEGIN + 18) #define DLG_MM_SELECTADDRESSBLOCK (RC_DBUI_BEGIN + 19) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index bc96436..4536ec1 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -380,7 +380,6 @@ #define HID_MM_SELECTDBTABLEDDIALOG_LISTBOX "SW_HID_MM_SELECTDBTABLEDDIALOG_LISTBOX" #define HID_MM_DBTABLEPREVIEWDIALOG "SW_HID_MM_DBTABLEPREVIEWDIALOG" #define HID_MM_CREATEADDRESSLIST "SW_HID_MM_CREATEADDRESSLIST" -#define HID_MM_FIND_ENTRY "SW_HID_MM_FIND_ENTRY" #define HID_MM_CUSTOMIZE_ADDRESS_LIST "SW_HID_MM_CUSTOMIZE_ADDRESS_LIST" #define HID_MM_CUSTOMIZEADDRESSBLOCK "SW_HID_MM_CUSTOMIZEADDRESSBLOCK" #define HID_MM_SELECTADDRESSBLOCK "SW_HID_MM_SELECTADDRESSBLOCK" diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index d1ba639..02bcac3 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -526,6 +526,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl) ++aHeaderIter) rColumnBox.InsertEntry(*aHeaderIter); rColumnBox.SelectEntryPos( 0 ); + m_pFindDlg->Show(); } else m_pFindDlg->Show(!m_pFindDlg->IsVisible()); @@ -717,46 +718,34 @@ void SwCreateAddressListDialog::Find(const String& rSearch, sal_Int32 nColumn) } } -SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) : - ModelessDialog(pParent, SW_RES(DLG_MM_FIND_ENTRY)), -#ifdef _MSC_VER -#pragma warning (disable : 4355) -#endif - m_aFindFT( this, SW_RES( FT_FIND )), - m_aFindED( this, SW_RES( ED_FIND )), - m_aFindOnlyCB( this, SW_RES( CB_FINDONLY )), - m_aFindOnlyLB( this, SW_RES( LB_FINDONLY )), - m_aFindPB( this, SW_RES( PB_FIND)), - m_aCancel( this, SW_RES( PB_CANCEL)), - m_aHelp( this, SW_RES( PB_HELP)), -#ifdef _MSC_VER -#pragma warning (default : 4355) -#endif - m_pParent(pParent) -{ - FreeResource(); - m_aFindPB.SetClickHdl(LINK(this, SwFindEntryDialog, FindHdl_Impl)); - m_aFindED.SetModifyHdl(LINK(this, SwFindEntryDialog, FindEnableHdl_Impl)); - m_aCancel.SetClickHdl(LINK(this, SwFindEntryDialog, CloseHdl_Impl)); -} - -SwFindEntryDialog::~SwFindEntryDialog() +SwFindEntryDialog::SwFindEntryDialog(SwCreateAddressListDialog* pParent) + : ModelessDialog(pParent, "FindEntryDialog", + "modules/swriter/ui/findentrydialog.ui") + , m_pParent(pParent) { + get(m_pCancel, "cancel"); + get(m_pFindPB, "find"); + get(m_pFindOnlyLB, "area"); + get(m_pFindOnlyCB, "findin"); + get(m_pFindED, "entry"); + m_pFindPB->SetClickHdl(LINK(this, SwFindEntryDialog, FindHdl_Impl)); + m_pFindED->SetModifyHdl(LINK(this, SwFindEntryDialog, FindEnableHdl_Impl)); + m_pCancel->SetClickHdl(LINK(this, SwFindEntryDialog, CloseHdl_Impl)); } IMPL_LINK_NOARG(SwFindEntryDialog, FindHdl_Impl) { sal_Int32 nColumn = -1; - if(m_aFindOnlyCB.IsChecked()) - nColumn = m_aFindOnlyLB.GetSelectEntryPos(); + if(m_pFindOnlyCB->IsChecked()) + nColumn = m_pFindOnlyLB->GetSelectEntryPos(); if(nColumn != LISTBOX_ENTRY_NOTFOUND) - m_pParent->Find(m_aFindED.GetText(), nColumn); + m_pParent->Find(m_pFindED->GetText(), nColumn); return 0; } IMPL_LINK_NOARG(SwFindEntryDialog, FindEnableHdl_Impl) { - m_aFindPB.Enable(!m_aFindED.GetText().isEmpty()); + m_pFindPB->Enable(!m_pFindED->GetText().isEmpty()); return 0; } diff --git a/sw/source/ui/dbui/createaddresslistdialog.hrc b/sw/source/ui/dbui/createaddresslistdialog.hrc index 1ec8a41..2a3ea76 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hrc +++ b/sw/source/ui/dbui/createaddresslistdialog.hrc @@ -41,14 +41,6 @@ #define SCR_1 1 #define WIN_DATA 2 -#define FT_FIND 1 -#define ED_FIND 2 -#define CB_FINDONLY 3 -#define LB_FINDONLY 4 - -#define PB_FIND 5 - - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/createaddresslistdialog.hxx b/sw/source/ui/dbui/createaddresslistdialog.hxx index 98ad7c9..78c6b78 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hxx +++ b/sw/source/ui/dbui/createaddresslistdialog.hxx @@ -88,14 +88,12 @@ public: class SwFindEntryDialog : public ModelessDialog { - FixedText m_aFindFT; - Edit m_aFindED; - CheckBox m_aFindOnlyCB; - ListBox m_aFindOnlyLB; + Edit* m_pFindED; + CheckBox* m_pFindOnlyCB; + ListBox* m_pFindOnlyLB; - PushButton m_aFindPB; - CancelButton m_aCancel; - HelpButton m_aHelp; + PushButton* m_pFindPB; + CancelButton* m_pCancel; SwCreateAddressListDialog* m_pParent; @@ -105,10 +103,15 @@ class SwFindEntryDialog : public ModelessDialog public: SwFindEntryDialog(SwCreateAddressListDialog* pParent); - ~SwFindEntryDialog(); - ListBox& GetFieldsListBox(){return m_aFindOnlyLB;} - String GetFindString() const {return m_aFindED.GetText();} + ListBox& GetFieldsListBox() + { + return *m_pFindOnlyLB; + } + OUString GetFindString() const + { + return m_pFindED->GetText(); + } }; #endif diff --git a/sw/source/ui/dbui/createaddresslistdialog.src b/sw/source/ui/dbui/createaddresslistdialog.src index aa090ff..2febd88 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.src +++ b/sw/source/ui/dbui/createaddresslistdialog.src @@ -162,63 +162,4 @@ ModalDialog DLG_MM_CREATEADDRESSLIST }; }; -ModelessDialog DLG_MM_FIND_ENTRY -{ - OutputSize = TRUE ; - SVLook = TRUE ; - HelpID = HID_MM_FIND_ENTRY; - Size = MAP_APPFONT ( 188 , 63 ) ; - Moveable = TRUE ; - - Text [ en-US ] = "Find Entry"; - - FixedText FT_FIND - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "F~ind"; - }; - Edit ED_FIND - { - HelpID = "sw:Edit:DLG_MM_FIND_ENTRY:ED_FIND"; - Pos = MAP_APPFONT ( 6 , 14) ; - Size = MAP_APPFONT ( 120 , 12 ) ; - Border = TRUE; - }; - CheckBox CB_FINDONLY - { - HelpID = "sw:CheckBox:DLG_MM_FIND_ENTRY:CB_FINDONLY"; - Pos = MAP_APPFONT ( 6 , 32 ) ; - Size = MAP_APPFONT ( 120 , 10 ) ; - Text [ en-US ] = "Find ~only in"; - }; - ListBox LB_FINDONLY - { - HelpID = "sw:ListBox:DLG_MM_FIND_ENTRY:LB_FINDONLY"; - Pos = MAP_APPFONT ( 12 , 45 ) ; - Size = MAP_APPFONT ( 114 , 50 ) ; - Border = TRUE; - DropDown = TRUE; - }; - PushButton PB_FIND - { - HelpID = "sw:PushButton:DLG_MM_FIND_ENTRY:PB_FIND"; - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE; - Text [ en-US ] = "~Find"; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 132 , 20 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Close"; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 132 , 40 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/findentrydialog.ui b/sw/uiconfig/swriter/ui/findentrydialog.ui new file mode 100644 index 0000000..cedcf38 --- /dev/null +++ b/sw/uiconfig/swriter/ui/findentrydialog.ui @@ -0,0 +1,190 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="FindEntryDialog"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Find Entry</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="visible">True</property> + <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="visible">True</property> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="find"> + <property name="label">gtk-find</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> + <property name="image_position">top</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-close</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="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">12</property> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">F_ind</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">entry</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="GtkEntry" id="entry"> + <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">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </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="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkCheckButton" id="findin"> + <property name="label" translatable="yes">Find _only in</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.019999999552965164</property> + <property name="draw_indicator">True</property> + <accessibility> + <relation type="label-for" target="area"/> + </accessibility> + </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="GtkComboBoxText" id="area"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">12</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + <accessibility> + <relation type="labelled-by" target="findin"/> + </accessibility> + </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> + </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> + </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">find</action-widget> + <action-widget response="0">cancel</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index 0a59f80..b9c2d74 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -166,6 +166,7 @@ #define SV_BUTTONTEXT_CLEAR 10126 #define SV_BUTTONTEXT_OPEN 10127 #define SV_BUTTONTEXT_PLAY 10128 +#define SV_BUTTONTEXT_FIND 10129 #define SV_STDTEXT_FIRST SV_STDTEXT_SERVICENOTAVAILABLE #define SV_STDTEXT_SERVICENOTAVAILABLE 10210 diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src index e4f4d94..d348de1 100644 --- a/vcl/source/src/btntext.src +++ b/vcl/source/src/btntext.src @@ -171,4 +171,9 @@ String SV_BUTTONTEXT_PLAY Text [ en-US ] = "~Play" ; }; +String SV_BUTTONTEXT_FIND +{ + Text [ en-US ] = "~Find" ; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 99e0b85..1baf1c0 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -639,6 +639,8 @@ namespace return (VclResId(SV_BUTTONTEXT_CLEAR).toString()); else if (rType == "gtk-media-play") return (VclResId(SV_BUTTONTEXT_PLAY).toString()); + else if (rType == "gtk-find") + return (VclResId(SV_BUTTONTEXT_FIND).toString()); SAL_WARN("vcl.layout", "unknown stock type: " << rType.getStr()); return OUString(); }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits