diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-24 14:33:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-24 15:11:44 +0100 |
commit | db4154cc19c803707f34bdd5ce4e8a43eac528a6 (patch) | |
tree | 6a55c6c5251c175d42772f54295aa97d76c4b70f /vcl | |
parent | 1c068a7a772ab903af627236ee93b0a1804be844 (diff) |
add gtk_message_dialog_new-alike ctor for MessageDialog
Change-Id: Ie422cd2c903cbd18353b1929c074574d452559ce
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/UIConfig_vcl.mk | 2 | ||||
-rw-r--r-- | vcl/inc/svids.hrc | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 8 | ||||
-rw-r--r-- | vcl/source/src/print.src | 12 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 17 | ||||
-rw-r--r-- | vcl/uiconfig/ui/errornocontentdialog.ui | 35 | ||||
-rw-r--r-- | vcl/uiconfig/ui/errornoprinterdialog.ui | 35 |
7 files changed, 94 insertions, 17 deletions
diff --git a/vcl/UIConfig_vcl.mk b/vcl/UIConfig_vcl.mk index ff6db5bcf76f..d3e901ea3ff5 100644 --- a/vcl/UIConfig_vcl.mk +++ b/vcl/UIConfig_vcl.mk @@ -11,6 +11,8 @@ $(eval $(call gb_UIConfig_UIConfig,vcl)) $(eval $(call gb_UIConfig_add_uifiles,vcl,\ vcl/uiconfig/ui/printdialog \ + vcl/uiconfig/ui/errornocontentdialog \ + vcl/uiconfig/ui/errornoprinterdialog \ )) # vim: set noet sw=4 ts=4: diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index 3e831e508920..0a59f802ee3e 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -122,8 +122,6 @@ #define SV_PRINT_PROGRESS_TEXT 2 #define SV_PRINT_NATIVE_STRINGS 2050 -#define SV_PRINT_NOPRINTERWARNING 2051 -#define SV_PRINT_NOCONTENT 2052 #define SV_HELPTEXT_CLOSE 10000 #define SV_HELPTEXT_MINIMIZE 10001 diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 366caa808143..f08bb250d8b2 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include "vcl/layout.hxx" #include "vcl/print.hxx" #include "vcl/svapp.hxx" #include "vcl/metaact.hxx" -#include "vcl/msgbox.hxx" #include "vcl/configsettings.hxx" #include "vcl/unohelp.hxx" @@ -312,7 +312,8 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr // && ! pController->isDirectPrint() ) { - ErrorBox aBox( NULL, VclResId( SV_PRINT_NOPRINTERWARNING ) ); + MessageDialog aBox(NULL, "ErrorNoPrinterDialog", + "vcl/ui/errornoprinterdialog.ui"); aBox.Execute(); } pController->setValue( OUString( "IsDirect" ), @@ -460,7 +461,8 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr { if( pController->getFilteredPageCount() == 0 ) { - ErrorBox aBox( NULL, VclResId( SV_PRINT_NOCONTENT ) ); + MessageDialog aBox(NULL, "ErrorNoContentDialog", + "vcl/ui/errornocontentdialog.ui"); aBox.Execute(); return; } diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index 89b571554655..0d2f9c130a31 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -44,18 +44,6 @@ ModelessDialog SV_DLG_PRINT_PROGRESS }; }; -ErrorBox SV_PRINT_NOPRINTERWARNING -{ - Title = "%PRODUCTNAME"; - Message [en-US] = "No default printer found.\nPlease choose a printer and try again."; -}; - -ErrorBox SV_PRINT_NOCONTENT -{ - Title = "%PRODUCTNAME"; - Message [en-US] = "There are no pages to be printed. Please check your document for ranges relevant to printing."; -}; - StringArray SV_PRINT_NATIVE_STRINGS { ItemList [en-US] = diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 622862e3cbb1..898cd11c63d2 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1768,6 +1768,23 @@ MessageDialog::MessageDialog(Window* pParent, WinBits nStyle) SetType(WINDOW_MESSBOX); } +MessageDialog::MessageDialog(Window* pParent, + const OUString &rMessage, + VclMessageType eMessageType, + VclButtonsType eButtonsType, + WinBits nStyle) + : Dialog(pParent, nStyle) + , m_eButtonsType(eButtonsType) + , m_eMessageType(eMessageType) + , m_pGrid(NULL) + , m_pImage(NULL) + , m_pPrimaryMessage(NULL) + , m_pSecondaryMessage(NULL) + , m_sPrimaryString(rMessage) +{ + SetType(WINDOW_MESSBOX); +} + MessageDialog::MessageDialog(Window* pParent, const OString& rID, const OUString& rUIXMLDescription) : Dialog(pParent, rID, rUIXMLDescription, WINDOW_MESSBOX) , m_eButtonsType(VCL_BUTTONS_NONE) diff --git a/vcl/uiconfig/ui/errornocontentdialog.ui b/vcl/uiconfig/ui/errornocontentdialog.ui new file mode 100644 index 000000000000..25f5d8e78119 --- /dev/null +++ b/vcl/uiconfig/ui/errornocontentdialog.ui @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkMessageDialog" id="ErrorNoContentDialog"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">%PRODUCTNAME</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="message_type">error</property> + <property name="buttons">ok</property> + <property name="text" translatable="yes">There are no pages to be printed.</property> + <property name="secondary_text" translatable="yes">Please check your document for ranges relevant to printing.</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> + </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> + </object> +</interface> diff --git a/vcl/uiconfig/ui/errornoprinterdialog.ui b/vcl/uiconfig/ui/errornoprinterdialog.ui new file mode 100644 index 000000000000..afba5c02572d --- /dev/null +++ b/vcl/uiconfig/ui/errornoprinterdialog.ui @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkMessageDialog" id="ErrorNoPrinterDialog"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">%PRODUCTNAME</property> + <property name="resizable">False</property> + <property name="type_hint">dialog</property> + <property name="skip_taskbar_hint">True</property> + <property name="message_type">error</property> + <property name="buttons">ok</property> + <property name="text" translatable="yes">No default printer found.</property> + <property name="secondary_text" translatable="yes">Please choose a printer and try again.</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> + </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> + </object> +</interface> |