diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-17 15:43:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-17 15:51:02 +0100 |
commit | f34881370ac9d9f499e00143ca840ba88021843f (patch) | |
tree | 3d2935ce6528740606f1b97dbe0285848d964d49 /sw | |
parent | 5a66d854814edeb7183b76ceeeeba260cf0621fd (diff) |
convert continue queryboxes to .ui
Change-Id: I8e23eb484177ccd47b7780ccafbdf8b377ea57e1
Diffstat (limited to 'sw')
-rw-r--r-- | sw/UIConfig_swriter.mk | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/srcview.cxx | 24 | ||||
-rw-r--r-- | sw/source/ui/uiview/view.src | 12 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewsrch.cxx | 22 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/querycontinuebegindialog.ui | 35 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/querycontinueenddialog.ui | 35 |
6 files changed, 108 insertions, 22 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 907c2515044e..61f22dcc99cf 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -132,6 +132,8 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/outlinenumbering \ sw/uiconfig/swriter/ui/outlinenumberingpage \ sw/uiconfig/swriter/ui/outlinepositionpage \ + sw/uiconfig/swriter/ui/querycontinuebegindialog \ + sw/uiconfig/swriter/ui/querycontinueenddialog \ sw/uiconfig/swriter/ui/querydefaultcompatdialog \ sw/uiconfig/swriter/ui/querysavelabeldialog \ sw/uiconfig/swriter/ui/queryshowchangesdialog \ diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index b30560245c91..c3ceef353d87 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -633,12 +633,26 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, { InfoBox( 0, SW_RES(MSG_NOT_FOUND)).Execute(); } - else if(!bRecursive && RET_YES == - QueryBox(0, SW_RES( bForward ? MSG_SEARCH_END - : MSG_SEARCH_START)).Execute()) + else if(!bRecursive) { - pTextView->SetSelection( TextSelection( aPaM, aPaM ) ); - StartSearchAndReplace( rSearchItem, sal_False, sal_False, sal_True ); + int nRet; + + if (!bForward) + { + nRet = MessageDialog(0, "QueryContinueEndDialog", + "modules/swriter/ui/querycontinueenddialog.ui").Execute(); + } + else + { + nRet = MessageDialog(0, "QueryContinueBeginDialog", + "modules/swriter/ui/querycontinuebegindialog.ui").Execute(); + } + + if (nRet == RET_YES) + { + pTextView->SetSelection( TextSelection( aPaM, aPaM ) ); + StartSearchAndReplace( rSearchItem, sal_False, sal_False, sal_True ); + } } } } diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src index 2dafb93bb0a5..471a1765551a 100644 --- a/sw/source/ui/uiview/view.src +++ b/sw/source/ui/uiview/view.src @@ -53,18 +53,6 @@ QueryBox DLG_SPECIAL_FORCED DEFBUTTON = WB_DEF_NO ; Message [ en-US ] = "Check special regions is deactivated. Check anyway?" ; }; -QueryBox MSG_SEARCH_END -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_YES ; - Message [ en-US ] = "%PRODUCTNAME Writer has searched to the end of the document. Do you want to continue at the beginning?" ; -}; -QueryBox MSG_SEARCH_START -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_YES ; - Message [ en-US ] = "%PRODUCTNAME Writer has searched to the beginning of the document. Do you want to continue at the end?" ; -}; InfoBox MSG_NO_MERGE_ENTRY { Message [ en-US ] = "Could not merge documents." ; diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index e89b7ea61a69..2df0a383be7d 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -39,6 +39,7 @@ #include <svx/srchdlg.hxx> #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> +#include <vcl/layout.hxx> #include <vcl/msgbox.hxx> #include <vcl/wrkwin.hxx> #include "editeng/unolingu.hxx" @@ -501,11 +502,22 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi) m_pWrtShell->EndAllAction(); // Try again with WrapAround? - if( bApi || RET_NO == QueryBox( GetParentWindow( m_pSrchDlg ), - SW_RES( DOCPOS_START == aOpts.eEnd - ? MSG_SEARCH_START - : MSG_SEARCH_END ) - ).Execute() ) + int nRet = RET_NO; + if( !bApi ) + { + if (DOCPOS_START == aOpts.eEnd) + { + nRet = MessageDialog(GetParentWindow(m_pSrchDlg), "QueryContinueEndDialog", + "modules/swriter/ui/querycontinueenddialog.ui").Execute(); + } + else + { + nRet = MessageDialog(GetParentWindow(m_pSrchDlg), "QueryContinueBeginDialog", + "modules/swriter/ui/querycontinuebegindialog.ui").Execute(); + } + } + + if (nRet == RET_NO) { m_bFound = sal_False; m_pWrtShell->Pop(); diff --git a/sw/uiconfig/swriter/ui/querycontinuebegindialog.ui b/sw/uiconfig/swriter/ui/querycontinuebegindialog.ui new file mode 100644 index 000000000000..23c72f7a1e50 --- /dev/null +++ b/sw/uiconfig/swriter/ui/querycontinuebegindialog.ui @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkMessageDialog" id="QueryContinueBeginDialog"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">Continue at the beginning?</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="message_type">question</property> + <property name="buttons">yes-no</property> + <property name="text" translatable="yes">Do you want to continue at the beginning?</property> + <property name="secondary_text" translatable="yes">%PRODUCTNAME Writer has searched to the end of the document.</property> + <child internal-child="vbox"> + <object class="GtkBox" id="messagedialog-vbox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">24</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="messagedialog-action_area"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + </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> + </object> + </child> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/querycontinueenddialog.ui b/sw/uiconfig/swriter/ui/querycontinueenddialog.ui new file mode 100644 index 000000000000..b7ab82516d6c --- /dev/null +++ b/sw/uiconfig/swriter/ui/querycontinueenddialog.ui @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkMessageDialog" id="QueryContinueEndDialog"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">Continue at the end?</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="message_type">question</property> + <property name="buttons">yes-no</property> + <property name="text" translatable="yes">Do you want to continue at the end?</property> + <property name="secondary_text" translatable="yes">%PRODUCTNAME Writer has searched to the beginning of the document.</property> + <child internal-child="vbox"> + <object class="GtkBox" id="messagedialog-vbox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">24</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="messagedialog-action_area"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + </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> + </object> + </child> + </object> +</interface> |