summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-07 20:25:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-08 12:07:48 +0100
commita9ad0c3d4a4cfa70ba89d8fb366a782f58f44f07 (patch)
tree69074041c6bb7a64a4e1a36917aa0686c0b5be2d /sw/source/ui
parentc755f71b8b5b009573a673f3f757609ca0ef5ffd (diff)
convert already exists dialog to .ui
Change-Id: I6cb2a11b6ee2f94f611aa852c79dd1a6534381da
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx60
-rw-r--r--sw/source/ui/dbui/mmoutputpage.hrc2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.src51
3 files changed, 28 insertions, 85 deletions
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 <svl/stritem.hxx>
#include <svtools/ehdl.hxx>
#include <svtools/sfxecode.hxx>
+#include <vcl/layout.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/dinfdlg.hxx>
#include <sfx2/printer.hxx>
@@ -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 ;