summaryrefslogtreecommitdiff
path: root/sw
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
parentc755f71b8b5b009573a673f3f757609ca0ef5ffd (diff)
convert already exists dialog to .ui
Change-Id: I6cb2a11b6ee2f94f611aa852c79dd1a6534381da
Diffstat (limited to 'sw')
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/dbui.hrc1
-rw-r--r--sw/inc/helpid.h1
-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
-rw-r--r--sw/uiconfig/swriter/ui/alreadyexistsdialog.ui194
7 files changed, 223 insertions, 87 deletions
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 <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 ;
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="AlreadyExistsDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="title" translatable="yes">File already exists</property>
+ <property name="resizable">False</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <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="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</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_stock">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>
+ </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>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkTextView" id="primarymessage">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="cursor_visible">False</property>
+ <property name="buffer">textbuffer1</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTextView" id="secondarymessage">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="cursor_visible">False</property>
+ <property name="buffer">textbuffer2</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">7</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">New document name:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">filename</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="filename">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
+ <property name="icon-size">6</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkTextBuffer" id="textbuffer1">
+ <property name="text" translatable="yes">A document with the name '%1' already exists.</property>
+ </object>
+ <object class="GtkTextBuffer" id="textbuffer2">
+ <property name="text" translatable="yes">Please save this document under a different name.</property>
+ </object>
+</interface>