Kaydet (Commit) cc6f4327 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert merge source error dialog to .ui

Change-Id: I1f09a4b4377a9a6c21e0e260c856dd9fbff4f1bd
üst 331216e2
...@@ -204,6 +204,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -204,6 +204,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/titlepage \ sw/uiconfig/swriter/ui/titlepage \
sw/uiconfig/swriter/ui/tokenwidget \ sw/uiconfig/swriter/ui/tokenwidget \
sw/uiconfig/swriter/ui/viewoptionspage \ sw/uiconfig/swriter/ui/viewoptionspage \
sw/uiconfig/swriter/ui/warndatasourcedialog \
sw/uiconfig/swriter/ui/wordcount \ sw/uiconfig/swriter/ui/wordcount \
sw/uiconfig/swriter/ui/wrapdialog \ sw/uiconfig/swriter/ui/wrapdialog \
sw/uiconfig/swriter/ui/wrappage \ sw/uiconfig/swriter/ui/wrappage \
......
...@@ -365,7 +365,6 @@ ...@@ -365,7 +365,6 @@
#define HID_PVIEW_ZOOM_LB "SW_HID_PVIEW_ZOOM_LB" #define HID_PVIEW_ZOOM_LB "SW_HID_PVIEW_ZOOM_LB"
#define HID_MAIL_MERGE_SELECT "SW_HID_MAIL_MERGE_SELECT" #define HID_MAIL_MERGE_SELECT "SW_HID_MAIL_MERGE_SELECT"
#define HID_PRINT_AS_MERGE "SW_HID_PRINT_AS_MERGE" #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_MODULE_TOOLBOX "SW_HID_MODULE_TOOLBOX"
#define HID_MM_ADDRESSBLOCKPAGE "SW_HID_MM_ADDRESSBLOCKPAGE" #define HID_MM_ADDRESSBLOCKPAGE "SW_HID_MM_ADDRESSBLOCKPAGE"
......
...@@ -489,39 +489,6 @@ QueryBox MSG_PRINT_AS_MERGE ...@@ -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?"; 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 String RID_MODULE_TOOLBOX
{ {
Text [ en-US ] = "Function Bar (viewing mode)" ; Text [ en-US ] = "Function Bar (viewing mode)" ;
......
...@@ -45,14 +45,6 @@ ...@@ -45,14 +45,6 @@
#define STR_CJK_FONT (RC_APP_BEGIN + 78) #define STR_CJK_FONT (RC_APP_BEGIN + 78)
#define MSG_PRINT_AS_MERGE (RC_APP_BEGIN + 80) #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_ENV_TITLE (RC_APP_BEGIN + 91)
#define STR_LAB_TITLE (RC_APP_BEGIN + 92) #define STR_LAB_TITLE (RC_APP_BEGIN + 92)
......
...@@ -2218,52 +2218,6 @@ namespace ...@@ -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) void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
{ {
if(bUseCurrentDocument) if(bUseCurrentDocument)
...@@ -2326,10 +2280,12 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) ...@@ -2326,10 +2280,12 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
OUString sSource; OUString sSource;
if(!GetWrtShell().IsFieldDataSourceAvailable(sSource)) if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
{ {
SwMergeSourceWarningBox_Impl aWarning( &GetViewFrame()->GetWindow()); MessageDialog aWarning(&GetViewFrame()->GetWindow(),
OUString sTmp(aWarning.GetMessText()); "WarnDataSourceDialog",
aWarning.SetMessText(sTmp.replaceFirst("%1", sSource)); "modules/swriter/ui/warndatasourcedialog.ui");
if(RET_OK == aWarning.Execute()) OUString sTmp(aWarning.get_primary_text());
aWarning.set_primary_text(sTmp.replaceFirst("%1", "SOURCE"));
if (RET_OK == aWarning.Execute())
{ {
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact ) if ( pFact )
......
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment