summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-11 15:55:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-11 15:55:24 +0100
commitcc6f43275a00b0aff2e60e70ee8032222a2c9610 (patch)
tree8248a25ecc718242b142edaf0e7439df8b0364ab /sw
parent331216e2361eb682c7bc21c92345110d380503ed (diff)
convert merge source error dialog to .ui
Change-Id: I1f09a4b4377a9a6c21e0e260c856dd9fbff4f1bd
Diffstat (limited to 'sw')
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/helpid.h1
-rw-r--r--sw/source/ui/app/app.src33
-rw-r--r--sw/source/ui/inc/app.hrc8
-rw-r--r--sw/source/ui/uiview/view2.cxx56
-rw-r--r--sw/uiconfig/swriter/ui/warndatasourcedialog.ui69
6 files changed, 76 insertions, 92 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 1a03283b6890..64900b1eb7b8 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -204,6 +204,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/titlepage \
sw/uiconfig/swriter/ui/tokenwidget \
sw/uiconfig/swriter/ui/viewoptionspage \
+ sw/uiconfig/swriter/ui/warndatasourcedialog \
sw/uiconfig/swriter/ui/wordcount \
sw/uiconfig/swriter/ui/wrapdialog \
sw/uiconfig/swriter/ui/wrappage \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index cc4a15ee8e62..da7cb7eb6697 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -365,7 +365,6 @@
#define HID_PVIEW_ZOOM_LB "SW_HID_PVIEW_ZOOM_LB"
#define HID_MAIL_MERGE_SELECT "SW_HID_MAIL_MERGE_SELECT"
#define HID_PRINT_AS_MERGE "SW_HID_PRINT_AS_MERGE"
-#define HID_MERGE_SOURCE_UNAVAILABLE "SW_HID_MERGE_SOURCE_UNAVAILABLE"
#define HID_MODULE_TOOLBOX "SW_HID_MODULE_TOOLBOX"
#define HID_MM_ADDRESSBLOCKPAGE "SW_HID_MM_ADDRESSBLOCKPAGE"
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 5b4000c8ad9d..a42d2defb1a8 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -489,39 +489,6 @@ QueryBox MSG_PRINT_AS_MERGE
Message [ en-US ] = "Your document contains address database fields. Do you want to print a form letter?";
};
-ModalDialog DLG_MERGE_SOURCE_UNAVAILABLE
-{
- HelpId = HID_MERGE_SOURCE_UNAVAILABLE;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 202 , 72 ) ;
- Moveable = TRUE ;
-
- FixedImage IMG_MERGE
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 103 , 32 ) ;
- };
- FixedText ST_MERGE_SOURCE_UNAVAILABLE
- {
- Pos = MAP_APPFONT ( 12 , 6 ) ;
- Size = MAP_APPFONT ( 178 , 40 ) ;
- WordBreak = TRUE;
- Text [ en-US ] = "The data source '%1' was not found. Thus the connection to the data source could not be established.\n\nPlease check the connection settings.";
- };
- OKButton PB_MERGE_OK
- {
- Pos = MAP_APPFONT ( 12 , 52 ) ;
- Size = MAP_APPFONT ( 125 , 14 ) ;
- Text [ en-US ] = "Check Connection Settings...";
- };
- CancelButton PB_MERGE_CANCEL
- {
- Pos = MAP_APPFONT ( 140 , 52 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-};
-
String RID_MODULE_TOOLBOX
{
Text [ en-US ] = "Function Bar (viewing mode)" ;
diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc
index 7752ca09f43e..d28ae331c9da 100644
--- a/sw/source/ui/inc/app.hrc
+++ b/sw/source/ui/inc/app.hrc
@@ -45,14 +45,6 @@
#define STR_CJK_FONT (RC_APP_BEGIN + 78)
#define MSG_PRINT_AS_MERGE (RC_APP_BEGIN + 80)
-#define DLG_MERGE_SOURCE_UNAVAILABLE (RC_APP_BEGIN + 83)
-
-#define ST_MERGE_SOURCE_UNAVAILABLE 1
-#define PB_MERGE_OK 2
-#define PB_MERGE_CANCEL 3
-#define IMG_MERGE 4
-
-
#define STR_ENV_TITLE (RC_APP_BEGIN + 91)
#define STR_LAB_TITLE (RC_APP_BEGIN + 92)
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 77f863711e1e..eedf54e3fda8 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -2218,52 +2218,6 @@ namespace
}
}
-class SwMergeSourceWarningBox_Impl : public ModalDialog
-{
- FixedInfo aMessageFI;
- OKButton aOK;
- CancelButton aCancel;
-
- FixedImage aWarnImage;
- public:
- SwMergeSourceWarningBox_Impl( Window* pParent ) :
- ModalDialog( pParent, SW_RES( DLG_MERGE_SOURCE_UNAVAILABLE ) ),
- aMessageFI( this, SW_RES( ST_MERGE_SOURCE_UNAVAILABLE ) ),
- aOK( this, SW_RES( PB_MERGE_OK ) ),
- aCancel( this, SW_RES( PB_MERGE_CANCEL ) ),
- aWarnImage( this, SW_RES( IMG_MERGE ) )
- {
- FreeResource();
- SetText( Application::GetDisplayName() );
- const Image& rImg = WarningBox::GetStandardImage();
- aWarnImage.SetImage( rImg );
- Size aImageSize( rImg.GetSizePixel() );
- aImageSize.Width() += 4;
- aImageSize.Height() += 4;
- aWarnImage.SetSizePixel( aImageSize );
-
- aImageSize.Width() += aWarnImage.GetPosPixel().X();
- Size aSz(GetSizePixel());
- aSz.Width() += aImageSize.Width();
- SetSizePixel(aSz);
-
- Point aPos(aMessageFI.GetPosPixel());
- aPos.X() += aImageSize.Width();
- aMessageFI.SetPosPixel( aPos );
-
- aPos = aOK.GetPosPixel();
- aPos.X() += aImageSize.Width();
- aOK.SetPosPixel( aPos );
- aPos = aCancel.GetPosPixel();
- aPos.X() += aImageSize.Width();
- aCancel.SetPosPixel( aPos );
-
- }
-
- String GetMessText() const { return aMessageFI.GetText(); }
- void SetMessText( const String& rText ) { aMessageFI.SetText( rText ); }
-};
-
void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
{
if(bUseCurrentDocument)
@@ -2326,10 +2280,12 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
OUString sSource;
if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
{
- SwMergeSourceWarningBox_Impl aWarning( &GetViewFrame()->GetWindow());
- OUString sTmp(aWarning.GetMessText());
- aWarning.SetMessText(sTmp.replaceFirst("%1", sSource));
- if(RET_OK == aWarning.Execute())
+ MessageDialog aWarning(&GetViewFrame()->GetWindow(),
+ "WarnDataSourceDialog",
+ "modules/swriter/ui/warndatasourcedialog.ui");
+ OUString sTmp(aWarning.get_primary_text());
+ aWarning.set_primary_text(sTmp.replaceFirst("%1", "SOURCE"));
+ if (RET_OK == aWarning.Execute())
{
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact )
diff --git a/sw/uiconfig/swriter/ui/warndatasourcedialog.ui b/sw/uiconfig/swriter/ui/warndatasourcedialog.ui
new file mode 100644
index 000000000000..5e670943f8aa
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/warndatasourcedialog.ui
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.6 -->
+ <object class="GtkMessageDialog" id="WarnDataSourceDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="title" translatable="yes">Data source not found</property>
+ <property name="resizable">False</property>
+ <property name="type_hint">dialog</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="message_type">warning</property>
+ <property name="text" translatable="yes">The data source '%1' was not found.</property>
+ <property name="secondary_text" translatable="yes">The connection to the data source could not be established. Please check the connection settings.</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>
+ <child>
+ <object class="GtkButton" id="check">
+ <property name="label" translatable="yes">Check Connection Settings...</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_underline">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>
+ <property name="image_position">right</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</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>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="1">check</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>