diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/UIConfig_swriter.mk | 2 | ||||
-rw-r--r-- | sw/inc/dbui.hrc | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.hrc | 4 | ||||
-rw-r--r-- | sw/source/ui/dbui/customizeaddresslistdialog.cxx | 52 | ||||
-rw-r--r-- | sw/source/ui/dbui/customizeaddresslistdialog.hrc | 6 | ||||
-rw-r--r-- | sw/source/ui/dbui/customizeaddresslistdialog.hxx | 39 | ||||
-rw-r--r-- | sw/source/ui/dbui/customizeaddresslistdialog.src | 50 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/addentrydialog.ui | 119 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/renameentrydialog.ui | 119 |
10 files changed, 286 insertions, 107 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 83cf4087589c..d05381b8e164 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -60,6 +60,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swriter,\ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/abstractdialog \ + sw/uiconfig/swriter/ui/addentrydialog \ sw/uiconfig/swriter/ui/alreadyexistsdialog \ sw/uiconfig/swriter/ui/asciifilterdialog \ sw/uiconfig/swriter/ui/assignstylesdialog \ @@ -161,6 +162,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/printoptionspage \ sw/uiconfig/swriter/ui/privateuserpage \ sw/uiconfig/swriter/ui/renameautotextdialog \ + sw/uiconfig/swriter/ui/renameentrydialog \ sw/uiconfig/swriter/ui/renameobjectdialog \ sw/uiconfig/swriter/ui/rowheight \ sw/uiconfig/swriter/ui/saveashtmldialog \ diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc index 681a6e3be259..a03816ef3d00 100644 --- a/sw/inc/dbui.hrc +++ b/sw/inc/dbui.hrc @@ -37,7 +37,6 @@ #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_ADD_RENAME_ENTRY (RC_DBUI_BEGIN + 16) #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 56f931cb74c1..bc96436277c5 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -381,7 +381,6 @@ #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_ADD_RENAME_ENTRY "SW_HID_MM_ADD_RENAME_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.hrc b/sw/source/ui/dbui/createaddresslistdialog.hrc index dc436abfdbb9..1ec8a4187935 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.hrc +++ b/sw/source/ui/dbui/createaddresslistdialog.hrc @@ -46,10 +46,6 @@ #define CB_FINDONLY 3 #define LB_FINDONLY 4 -#define FT_FIELDNAME 1 -#define ED_FIELDNAME 2 -#define ST_RENAME_TITLE 3 -#define ST_ADD_BUTTON 4 #define PB_FIND 5 diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx index b4784e42a0ce..881458de5693 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx @@ -58,7 +58,7 @@ SwCustomizeAddressListDialog::SwCustomizeAddressListDialog( m_aUpPB.SetClickHdl(aUpDownLk); m_aDownPB.SetClickHdl(aUpDownLk); - ::std::vector< OUString >::iterator aHeaderIter; + std::vector< OUString >::iterator aHeaderIter; for(aHeaderIter = m_pNewData->aDBColumnHeaders.begin(); aHeaderIter != m_pNewData->aDBColumnHeaders.end(); ++aHeaderIter) @@ -85,8 +85,11 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) if(nPos == LISTBOX_ENTRY_NOTFOUND) nPos = 0; - SwAddRenameEntryDialog* pDlg = - new SwAddRenameEntryDialog(pButton, bRename, m_pNewData->aDBColumnHeaders); + SwAddRenameEntryDialog* pDlg; + if (bRename) + pDlg = new SwRenameEntryDialog(pButton, m_pNewData->aDBColumnHeaders); + else + pDlg = new SwAddEntryDialog(pButton, m_pNewData->aDBColumnHeaders); if(bRename) { String aTemp = m_aFieldsLB.GetEntry(nPos); @@ -108,7 +111,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton) m_pNewData->aDBColumnHeaders.insert(m_pNewData->aDBColumnHeaders.begin() + nPos, sNew); //add a new entry into all data arrays String sTemp; - ::std::vector< ::std::vector< OUString > >::iterator aDataIter; + std::vector< std::vector< OUString > >::iterator aDataIter; for( aDataIter = m_pNewData->aDBData.begin(); aDataIter != m_pNewData->aDBData.end(); ++aDataIter) aDataIter->insert(aDataIter->begin() + nPos, sTemp); @@ -131,7 +134,7 @@ IMPL_LINK_NOARG(SwCustomizeAddressListDialog, DeleteHdl_Impl) //remove the column m_pNewData->aDBColumnHeaders.erase(m_pNewData->aDBColumnHeaders.begin() + nPos); //remove the data - ::std::vector< ::std::vector< OUString > >::iterator aDataIter; + std::vector< std::vector< OUString > >::iterator aDataIter; for( aDataIter = m_pNewData->aDBData.begin(); aDataIter != m_pNewData->aDBData.end(); ++aDataIter) aDataIter->erase(aDataIter->begin() + nPos); @@ -155,7 +158,7 @@ IMPL_LINK(SwCustomizeAddressListDialog, UpDownHdl_Impl, PushButton*, pButton) OUString sHeader = m_pNewData->aDBColumnHeaders[nOldPos]; m_pNewData->aDBColumnHeaders.erase(m_pNewData->aDBColumnHeaders.begin() + nOldPos); m_pNewData->aDBColumnHeaders.insert(m_pNewData->aDBColumnHeaders.begin() + nPos, sHeader); - ::std::vector< ::std::vector< OUString > >::iterator aDataIter; + std::vector< std::vector< OUString > >::iterator aDataIter; for( aDataIter = m_pNewData->aDBData.begin(); aDataIter != m_pNewData->aDBData.end(); ++aDataIter) { OUString sData = (*aDataIter)[nOldPos]; @@ -183,32 +186,15 @@ SwCSVData* SwCustomizeAddressListDialog::GetNewData() } SwAddRenameEntryDialog::SwAddRenameEntryDialog( - Window* pParent, bool bRename, const ::std::vector< OUString >& rCSVHeader) : - SfxModalDialog(pParent, SW_RES(DLG_MM_ADD_RENAME_ENTRY)), -#ifdef _MSC_VER -#pragma warning (disable : 4355) -#endif - m_aFieldNameFT( this, SW_RES( FT_FIELDNAME)), - m_aFieldNameED( this, SW_RES( ED_FIELDNAME)), - m_aOK( this, SW_RES( PB_OK)), - m_aCancel( this, SW_RES( PB_CANCEL)), - m_aHelp( this, SW_RES( PB_HELP)), -#ifdef _MSC_VER -#pragma warning (default : 4355) -#endif - m_rCSVHeader(rCSVHeader) -{ - if(bRename) - SetText(String(SW_RES(ST_RENAME_TITLE))); - else - m_aOK.SetText(String(SW_RES(ST_ADD_BUTTON))); - FreeResource(); - m_aFieldNameED.SetModifyHdl(LINK(this, SwAddRenameEntryDialog, ModifyHdl_Impl)); - ModifyHdl_Impl( &m_aFieldNameED ); -} - -SwAddRenameEntryDialog::~SwAddRenameEntryDialog() + Window* pParent, const OString& rID, const OUString& rUIXMLDescription, + const std::vector< OUString >& rCSVHeader) + : SfxModalDialog(pParent, rID, rUIXMLDescription) + , m_rCSVHeader(rCSVHeader) { + get(m_pOK, "ok"); + get(m_pFieldNameED, "entry"); + m_pFieldNameED->SetModifyHdl(LINK(this, SwAddRenameEntryDialog, ModifyHdl_Impl)); + ModifyHdl_Impl(m_pFieldNameED); } IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) @@ -218,7 +204,7 @@ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) if(!bFound) { - ::std::vector< OUString >::const_iterator aHeaderIter; + std::vector< OUString >::const_iterator aHeaderIter; for(aHeaderIter = m_rCSVHeader.begin(); aHeaderIter != m_rCSVHeader.end(); ++aHeaderIter) @@ -228,7 +214,7 @@ IMPL_LINK(SwAddRenameEntryDialog, ModifyHdl_Impl, Edit*, pEdit) break; } } - m_aOK.Enable(!bFound); + m_pOK->Enable(!bFound); return 0; } diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hrc b/sw/source/ui/dbui/customizeaddresslistdialog.hrc index 67713ae60e59..4130046755cb 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hrc +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hrc @@ -32,12 +32,6 @@ #define PB_CANCEL 15 #define PB_HELP 16 -#define FT_FIELDNAME 1 -#define ED_FIELDNAME 2 -#define ST_RENAME_TITLE 3 -#define ST_ADD_BUTTON 4 - - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.hxx b/sw/source/ui/dbui/customizeaddresslistdialog.hxx index 3eec3fbb4e8e..ecea2dcf9943 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.hxx +++ b/sw/source/ui/dbui/customizeaddresslistdialog.hxx @@ -62,23 +62,38 @@ public: class SwAddRenameEntryDialog : public SfxModalDialog { - FixedText m_aFieldNameFT; - Edit m_aFieldNameED; - - OKButton m_aOK; - CancelButton m_aCancel; - HelpButton m_aHelp; - - const ::std::vector< OUString >& m_rCSVHeader; + Edit* m_pFieldNameED; + OKButton* m_pOK; + const std::vector< OUString >& m_rCSVHeader; DECL_LINK(ModifyHdl_Impl, Edit*); +protected: + SwAddRenameEntryDialog(Window* pParent, const OString& rID, + const OUString& rUIXMLDescription, const std::vector< OUString >& rCSVHeader); public: - SwAddRenameEntryDialog(Window* pParent, bool bRename, const ::std::vector< OUString >& aCSVHeader); - ~SwAddRenameEntryDialog(); + void SetFieldName(const OUString& rName) {m_pFieldNameED->SetText(rName);} + OUString GetFieldName() const {return m_pFieldNameED->GetText();}; + +}; - void SetFieldName(const String& rName) {m_aFieldNameED.SetText(rName);} - String GetFieldName() const {return m_aFieldNameED.GetText();}; +class SwAddEntryDialog : public SwAddRenameEntryDialog +{ +public: + SwAddEntryDialog(Window* pParent, const std::vector< OUString >& rCSVHeader) + : SwAddRenameEntryDialog(pParent, "AddEntryDialog", + "modules/swriter/ui/addentrydialog.ui", rCSVHeader) + { + } +}; +class SwRenameEntryDialog : public SwAddRenameEntryDialog +{ +public: + SwRenameEntryDialog(Window* pParent, const std::vector< OUString >& rCSVHeader) + : SwAddRenameEntryDialog(pParent, "RenameEntryDialog", + "modules/swriter/ui/renameentrydialog.ui", rCSVHeader) + { + } }; #endif diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.src b/sw/source/ui/dbui/customizeaddresslistdialog.src index b58ee959e62e..345f41156288 100644 --- a/sw/source/ui/dbui/customizeaddresslistdialog.src +++ b/sw/source/ui/dbui/customizeaddresslistdialog.src @@ -104,54 +104,4 @@ ModalDialog DLG_MM_CUSTOMIZE_ADDRESS_LIST }; }; -ModalDialog DLG_MM_ADD_RENAME_ENTRY -{ - OutputSize = TRUE ; - SVLook = TRUE ; - HelpID = HID_MM_ADD_RENAME_ENTRY; - Size = MAP_APPFONT ( 188 , 60 ) ; - Moveable = TRUE ; - - Text [ en-US ] = "Add Element"; - - FixedText FT_FIELDNAME - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Element ~name"; - }; - Edit ED_FIELDNAME - { - HelpID = "sw:Edit:DLG_MM_ADD_RENAME_ENTRY:ED_FIELDNAME"; - Pos = MAP_APPFONT ( 6 , 14 ) ; - Size = MAP_APPFONT ( 120 , 12 ) ; - Border = TRUE; - }; - - OKButton PB_OK - { - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 132 , 20 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 132 , 40 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - String ST_RENAME_TITLE - { - Text [ en-US ] = "Rename Element"; - }; - String ST_ADD_BUTTON - { - Text [ en-US ] = "Add"; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/addentrydialog.ui b/sw/uiconfig/swriter/ui/addentrydialog.ui new file mode 100644 index 000000000000..1fdc491ad475 --- /dev/null +++ b/sw/uiconfig/swriter/ui/addentrydialog.ui @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.6 --> + <object class="GtkDialog" id="AddEntryDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Add Element</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="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkEntry" id="entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="valign">start</property> + <property name="invisible_char">●</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Element name</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </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> +</interface> diff --git a/sw/uiconfig/swriter/ui/renameentrydialog.ui b/sw/uiconfig/swriter/ui/renameentrydialog.ui new file mode 100644 index 000000000000..9e2950b3413e --- /dev/null +++ b/sw/uiconfig/swriter/ui/renameentrydialog.ui @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.6 --> + <object class="GtkDialog" id="RenameEntryDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Rename Element</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="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkEntry" id="entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="valign">start</property> + <property name="invisible_char">●</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Element name</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </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> +</interface> |