From a9ad0c3d4a4cfa70ba89d8fb366a782f58f44f07 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 7 Sep 2013 20:25:59 +0100 Subject: convert already exists dialog to .ui Change-Id: I6cb2a11b6ee2f94f611aa852c79dd1a6534381da --- sw/UIConfig_swriter.mk | 1 + sw/inc/dbui.hrc | 1 - sw/inc/helpid.h | 1 - sw/source/ui/dbui/mmoutputpage.cxx | 60 ++++---- sw/source/ui/dbui/mmoutputpage.hrc | 2 - sw/source/ui/dbui/mmoutputpage.src | 51 ------- sw/uiconfig/swriter/ui/alreadyexistsdialog.ui | 194 ++++++++++++++++++++++++++ 7 files changed, 223 insertions(+), 87 deletions(-) create mode 100644 sw/uiconfig/swriter/ui/alreadyexistsdialog.ui (limited to 'sw') diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index d50ba65346b5..83cf4087589c 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/alreadyexistsdialog \ sw/uiconfig/swriter/ui/asciifilterdialog \ sw/uiconfig/swriter/ui/assignstylesdialog \ sw/uiconfig/swriter/ui/authenticationsettingsdialog \ diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc index 710348902b92..681a6e3be259 100644 --- a/sw/inc/dbui.hrc +++ b/sw/inc/dbui.hrc @@ -48,7 +48,6 @@ #define DLG_MM_MAILBODY (RC_DBUI_BEGIN + 24) #define DLG_MM_SENDMAILS (RC_DBUI_BEGIN + 25) #define DLG_MAILMERGECHILD (RC_DBUI_BEGIN + 26) -#define DLG_MM_SAVEWARNING (RC_DBUI_BEGIN + 27) #define DLG_MM_QUERY (RC_DBUI_BEGIN + 28) #define DLG_MM_SENDWARNING (RC_DBUI_BEGIN + 29) #define DLG_MM_CREATIONMONITOR (RC_DBUI_BEGIN + 30) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index 83b8cd4fb3f5..56f931cb74c1 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -400,7 +400,6 @@ #define HID_MM_CUSTOMFIELDS "SW_HID_MM_CUSTOMFIELDS" #define HID_MM_MAILSTATUS_TLB "SW_HID_MM_MAILSTATUS_TLB" #define HID_RETURN_TO_MAILMERGE "SW_HID_RETURN_TO_MAILMERGE" -#define HID_MM_SAVEWARNING "SW_HID_MM_SAVEWARNING" #define HID_MM_QUERY "SW_HID_MM_QUERY" #define HID_MM_SENDWARNING "SW_HID_MM_SENDWARNING" diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 35d98817a4c8..2a5de59450fc 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -107,22 +108,20 @@ static OUString lcl_GetColumnValueOf(const OUString& rColumn, Reference < contai class SwSaveWarningBox_Impl : public ModalDialog { - FixedImage aWarningImageIM; - FixedInfo aWarningFI; - - FixedText aFileNameFT; - Edit aFileNameED; - - FixedLine aSeparatorFL; - OKButton aOKPB; - CancelButton aCancelPB; + OKButton* m_pOKPB; + FixedImage* m_pWarningImageIM; + VclMultiLineEdit* m_pPrimaryMessage; + VclMultiLineEdit* m_pSecondaryMessage; + Edit* m_pFileNameED; DECL_LINK( ModifyHdl, Edit*); public: - SwSaveWarningBox_Impl(Window* pParent, const String& rFileName); - ~SwSaveWarningBox_Impl(); + SwSaveWarningBox_Impl(Window* pParent, const OUString& rFileName); - String GetFileName() const {return aFileNameED.GetText();} + OUString GetFileName() const + { + return m_pFileNameED->GetText(); + } }; class SwSendQueryBox_Impl : public ModalDialog @@ -156,35 +155,32 @@ public: } }; -SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* pParent, const String& rFileName) : - ModalDialog(pParent, SW_RES( DLG_MM_SAVEWARNING )), - aWarningImageIM(this, SW_RES( IM_WARNING )), - aWarningFI(this, SW_RES( FI_WARNING )), - aFileNameFT(this, SW_RES( FT_FILENAME )), - aFileNameED(this, SW_RES( ED_FILENAME )), - aSeparatorFL(this, SW_RES( FL_SEPARATOR )), - aOKPB(this, SW_RES( PB_OK )), - aCancelPB(this, SW_RES( PB_CANCEL )) +SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(Window* pParent, const OUString& rFileName) + : ModalDialog(pParent, "AlreadyExistsDialog", + "modules/swriter/ui/alreadyexistsdialog.ui") { - FreeResource(); - aWarningImageIM.SetImage(WarningBox::GetStandardImage()); - aFileNameED.SetText(rFileName); - aFileNameED.SetModifyHdl(LINK(this, SwSaveWarningBox_Impl, ModifyHdl)); + get(m_pOKPB, "ok"); + get(m_pPrimaryMessage, "primarymessage"); + m_pPrimaryMessage->SetPaintTransparent(true); + get(m_pSecondaryMessage, "secondarymessage"); + m_pSecondaryMessage->SetPaintTransparent(true); + MessageDialog::SetMessagesWidths(this, m_pPrimaryMessage, m_pSecondaryMessage); + get(m_pWarningImageIM, "image"); + get(m_pFileNameED, "filename"); + m_pWarningImageIM->SetImage(WarningBox::GetStandardImage()); + m_pFileNameED->SetText(rFileName); + m_pFileNameED->SetModifyHdl(LINK(this, SwSaveWarningBox_Impl, ModifyHdl)); INetURLObject aTmp(rFileName); - aWarningFI.SetText(aWarningFI.GetText().replaceAll("%1", aTmp.getName( + m_pPrimaryMessage->SetText(m_pPrimaryMessage->GetText().replaceAll("%1", aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET))); - ModifyHdl( &aFileNameED ); -} - -SwSaveWarningBox_Impl::~SwSaveWarningBox_Impl() -{ + ModifyHdl(m_pFileNameED); } IMPL_LINK( SwSaveWarningBox_Impl, ModifyHdl, Edit*, pEdit) { - aOKPB.Enable(!pEdit->GetText().isEmpty()); + m_pOKPB->Enable(!pEdit->GetText().isEmpty()); return 0; } diff --git a/sw/source/ui/dbui/mmoutputpage.hrc b/sw/source/ui/dbui/mmoutputpage.hrc index f9b3b07545c0..94825ee82457 100644 --- a/sw/source/ui/dbui/mmoutputpage.hrc +++ b/sw/source/ui/dbui/mmoutputpage.hrc @@ -87,8 +87,6 @@ #define IM_WARNING 1 #define FI_WARNING 2 -#define FT_FILENAME 3 -#define ED_FILENAME 4 #endif diff --git a/sw/source/ui/dbui/mmoutputpage.src b/sw/source/ui/dbui/mmoutputpage.src index 1bf8035a2958..d9fa4e3ada0b 100644 --- a/sw/source/ui/dbui/mmoutputpage.src +++ b/sw/source/ui/dbui/mmoutputpage.src @@ -384,57 +384,6 @@ ModalDialog DLG_MM_COPYTO }; }; -ModalDialog DLG_MM_SAVEWARNING -{ - OutputSize = TRUE ; - SVLook = TRUE ; - HelpID = HID_MM_SAVEWARNING; - Size = MAP_APPFONT ( 200 , 99 ) ; - Moveable = TRUE ; - - Text = "%PRODUCTNAME"; - FixedImage IM_WARNING - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 30 , 30 ) ; - }; - FixedText FI_WARNING - { - Pos = MAP_APPFONT ( 40 , 3 ) ; - Size = MAP_APPFONT ( 150 , 30 ) ; - WordBreak = TRUE; - Text[ en-US ] = "A document with the name '%1' already exists. Please save this document under a different name."; - }; - FixedText FT_FILENAME - { - Pos = MAP_APPFONT ( 40, 39 ) ; - Size = MAP_APPFONT ( 154, 8 ) ; - Text[ en-US ] = "New document name"; - }; - Edit ED_FILENAME - { - HelpID = "sw:Edit:DLG_MM_SAVEWARNING:ED_FILENAME"; - Pos = MAP_APPFONT ( 40 , 50 ) ; - Size = MAP_APPFONT ( 154 , 12 ) ; - Border = TRUE; - }; - FixedLine FL_SEPARATOR - { - Pos = MAP_APPFONT ( 0 , 68 ) ; - Size = MAP_APPFONT ( 200 , 8 ) ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 40 , 79) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 93 , 79 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; -}; ModalDialog DLG_MM_QUERY { OutputSize = TRUE ; diff --git a/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui b/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui new file mode 100644 index 000000000000..e62e04c729c8 --- /dev/null +++ b/sw/uiconfig/swriter/ui/alreadyexistsdialog.ui @@ -0,0 +1,194 @@ + + + + + False + 12 + File already exists + False + dialog + + + False + vertical + 24 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + False + True + end + 0 + + + + + True + False + True + True + 12 + 12 + + + True + False + True + 6 + + + True + True + True + False + word + False + textbuffer1 + False + + + 0 + 0 + 1 + 1 + + + + + True + True + True + False + word + False + textbuffer2 + False + + + 0 + 1 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + + + + True + False + True + 7 + + + True + False + 0 + New document name: + True + filename + + + 0 + 0 + 1 + 1 + + + + + True + True + True + + + + 0 + 1 + 1 + 1 + + + + + 1 + 1 + 1 + 1 + + + + + True + False + center + start + 6 + + + 0 + 0 + 1 + 2 + + + + + True + True + 1 + + + + + + ok + cancel + + + + A document with the name '%1' already exists. + + + Please save this document under a different name. + + -- cgit