summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-20 15:01:21 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-20 17:47:42 +0100
commit5163c4850dd7768826eaa22947c403d187c3edd3 (patch)
tree8456b94a3709c4e3a7023dea633b20b9953c6bd8 /cui
parent579411ccc38642b395fbfb25c9b4e9e9d280b5d1 (diff)
weld SvxIconChangeDialog warning dialog
Change-Id: If90c8dc0e66678cec6b197e3f0c659e85484f5af Reviewed-on: https://gerrit.libreoffice.org/51650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/inc/pch/precompiled_cui.hxx1
-rw-r--r--cui/source/customize/cfg.cxx35
-rw-r--r--cui/source/inc/cfg.hxx11
-rw-r--r--cui/uiconfig/ui/iconchangedialog.ui97
4 files changed, 45 insertions, 99 deletions
diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx
index 6df4a6862268..ac869daac6b8 100644
--- a/cui/inc/pch/precompiled_cui.hxx
+++ b/cui/inc/pch/precompiled_cui.hxx
@@ -159,7 +159,6 @@
#include <vcl/metaact.hxx>
#include <vcl/metaactiontypes.hxx>
#include <vcl/metric.hxx>
-#include <vcl/msgbox.hxx>
#include <vcl/notebookbar.hxx>
#include <vcl/outdev.hxx>
#include <vcl/outdevmap.hxx>
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 0d3c9fbe69bc..429e8302eb31 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -3315,8 +3315,8 @@ void SvxIconSelectorDialog::ImportGraphics(
message += fPath + rejected[i] + "\n";
}
- ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message);
- aDialog->Execute();
+ SvxIconChangeDialog aDialog(GetFrameWeld(), message);
+ aDialog.run();
}
}
@@ -3402,32 +3402,13 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL )
* The SvxIconChangeDialog class added for issue83555
*
*******************************************************************************/
-SvxIconChangeDialog::SvxIconChangeDialog(
- vcl::Window *pWindow, const OUString& aMessage)
- :ModalDialog(pWindow, "IconChange", "cui/ui/iconchangedialog.ui")
+SvxIconChangeDialog::SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage)
+ : MessageDialogController(pWindow, "cui/ui/iconchangedialog.ui", "IconChange", "grid")
+ , m_xLineEditDescription(m_xBuilder->weld_text_view("addrTextview"))
{
- get(pFImageInfo, "infoImage");
- get(pLineEditDescription, "addrTextview");
-
- Size aSize(LogicToPixel(Size(140, 83), MapMode(MapUnit::MapAppFont)));
- pLineEditDescription->set_width_request(aSize.Width());
- pLineEditDescription->set_height_request(aSize.Height());
-
- pFImageInfo->SetImage(GetStandardInfoBoxImage());
- pLineEditDescription->SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() );
- pLineEditDescription->SetText(aMessage);
-}
-
-SvxIconChangeDialog::~SvxIconChangeDialog()
-{
- disposeOnce();
-}
-
-void SvxIconChangeDialog::dispose()
-{
- pFImageInfo.clear();
- pLineEditDescription.clear();
- ModalDialog::dispose();
+ m_xLineEditDescription->set_size_request(m_xLineEditDescription->get_approximate_digit_width() * 48,
+ m_xLineEditDescription->get_text_height() * 8);
+ m_xLineEditDescription->set_text(rMessage);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 00e2dcc4b27c..51165c9e1d45 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -25,6 +25,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/menubtn.hxx>
#include <vcl/toolbox.hxx>
+#include <vcl/weld.hxx>
#include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/treelistbox.hxx>
@@ -51,7 +52,6 @@
#include <sfx2/tabdlg.hxx>
#include <memory>
#include <vector>
-#include <vcl/msgbox.hxx>
#include "cfgutil.hxx"
#include "CommandCategoryListBox.hxx"
@@ -637,15 +637,12 @@ public:
};
//added for issue83555
-class SvxIconChangeDialog : public ModalDialog
+class SvxIconChangeDialog : public weld::MessageDialogController
{
private:
- VclPtr<FixedImage> pFImageInfo;
- VclPtr<VclMultiLineEdit> pLineEditDescription;
+ std::unique_ptr<weld::TextView> m_xLineEditDescription;
public:
- SvxIconChangeDialog(vcl::Window *pWindow, const OUString& aMessage);
- virtual ~SvxIconChangeDialog() override;
- virtual void dispose() override;
+ SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage);
};
#endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX
diff --git a/cui/uiconfig/ui/iconchangedialog.ui b/cui/uiconfig/ui/iconchangedialog.ui
index 44c423949e54..fa1665d2c942 100644
--- a/cui/uiconfig/ui/iconchangedialog.ui
+++ b/cui/uiconfig/ui/iconchangedialog.ui
@@ -1,114 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.2 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
- <object class="GtkDialog" id="IconChange">
+ <object class="GtkMessageDialog" id="IconChange">
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="border_width">6</property>
- <property name="title" translatable="yes" context="iconchangedialog|IconChange">%PRODUCTNAME %PRODUCTVERSION</property>
- <property name="resizable">False</property>
+ <property name="modal">True</property>
<property name="type_hint">dialog</property>
+ <property name="buttons">ok</property>
<child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
+ <object class="GtkBox">
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">12</property>
+ <property name="spacing">2</property>
<child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <object class="GtkButtonBox">
<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="use_action_appearance">False</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>
+ <property name="homogeneous">True</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkGrid" id="grid">
<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">6</property>
- <property name="column_spacing">6</property>
<child>
- <object class="GtkImage" id="infoImage">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-missing-image</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="addrTextview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="cursor_visible">False</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
<property name="label" translatable="yes" context="iconchangedialog|label1">The files listed below could not be imported.
The file format could not be interpreted.</property>
+ <property name="xalign">0</property>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
- <child>
- <object class="GtkTextView" id="addrTextview:border">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- <property name="cursor_visible">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-5">ok</action-widget>
- </action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>