summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/layout.hxx5
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx6
-rw-r--r--sw/source/ui/lingu/olmenu.cxx4
-rw-r--r--sw/source/ui/table/tautofmt.cxx12
-rw-r--r--vcl/UIConfig_vcl.mk2
-rw-r--r--vcl/inc/svids.hrc2
-rw-r--r--vcl/source/gdi/print3.cxx8
-rw-r--r--vcl/source/src/print.src12
-rw-r--r--vcl/source/window/layout.cxx17
-rw-r--r--vcl/uiconfig/ui/errornocontentdialog.ui35
-rw-r--r--vcl/uiconfig/ui/errornoprinterdialog.ui35
11 files changed, 108 insertions, 30 deletions
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index e5fd00436e13..adecb945b1e5 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -705,6 +705,11 @@ private:
short get_response(const Window *pWindow) const;
public:
+ MessageDialog(Window* pParent,
+ const OUString &rMessage,
+ VclMessageType eMessageType = VCL_MESSAGE_ERROR,
+ VclButtonsType eButtonsType = VCL_BUTTONS_OK,
+ WinBits nStyle = WB_MOVEABLE|WB_3DLOOK|WB_CLOSEABLE);
MessageDialog(Window* pParent, WinBits nStyle);
MessageDialog(Window* pParent, const OString& rID, const OUString& rUIXMLDescription);
virtual bool set_property(const OString &rKey, const OString &rValue);
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 600e069dc928..804d76965fdf 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -21,9 +21,9 @@
#include <mailmergewizard.hxx>
#include <swtypes.hxx>
#include <addresslistdialog.hxx>
-#include <vcl/xtextedt.hxx>
+#include <vcl/layout.hxx>
#include <vcl/txtattr.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/xtextedt.hxx>
#include <mmconfigitem.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
@@ -185,7 +185,7 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl)
catch (const uno::Exception& e)
{
OSL_FAIL(OUStringToOString(e.Message, osl_getThreadTextEncoding()).getStr());
- ErrorBox(this, WB_OK, e.Message).Execute();
+ MessageDialog(this, e.Message).Execute();
}
return 0;
}
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index 1909479b1b62..ee4bece90798 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -70,7 +70,7 @@
#include <svx/dlgutil.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/linguprops.hxx>
-#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <sal/macros.h>
@@ -794,7 +794,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- ErrorBox aErrorBox( NULL, WB_OK, msg );
+ MessageDialog aErrorBox(NULL, msg);
aErrorBox.SetText( "Explanations" );
aErrorBox.Execute();
}
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 20b4589712a0..de31736cc40b 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -333,10 +333,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl)
if( !bFmtInserted )
{
- bOk = RET_CANCEL == ErrorBox( this,
- WinBits( WB_OK_CANCEL | WB_DEF_OK),
- aStrInvalidFmt
- ).Execute();
+ bOk = RET_CANCEL == MessageDialog(this, aStrInvalidFmt, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL)
+ .Execute();
}
}
else
@@ -437,10 +435,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl)
if( !bFmtRenamed )
{
- bOk = RET_CANCEL == ErrorBox( this,
- WinBits( WB_OK_CANCEL | WB_DEF_OK),
- aStrInvalidFmt
- ).Execute();
+ bOk = RET_CANCEL == MessageDialog(this, aStrInvalidFmt, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL)
+ .Execute();
}
}
else
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>