Kaydet (Commit) 5163c485 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SvxIconChangeDialog warning dialog

Change-Id: If90c8dc0e66678cec6b197e3f0c659e85484f5af
Reviewed-on: https://gerrit.libreoffice.org/51650Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 579411cc
...@@ -159,7 +159,6 @@ ...@@ -159,7 +159,6 @@
#include <vcl/metaact.hxx> #include <vcl/metaact.hxx>
#include <vcl/metaactiontypes.hxx> #include <vcl/metaactiontypes.hxx>
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/notebookbar.hxx> #include <vcl/notebookbar.hxx>
#include <vcl/outdev.hxx> #include <vcl/outdev.hxx>
#include <vcl/outdevmap.hxx> #include <vcl/outdevmap.hxx>
......
...@@ -3315,8 +3315,8 @@ void SvxIconSelectorDialog::ImportGraphics( ...@@ -3315,8 +3315,8 @@ void SvxIconSelectorDialog::ImportGraphics(
message += fPath + rejected[i] + "\n"; message += fPath + rejected[i] + "\n";
} }
ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message); SvxIconChangeDialog aDialog(GetFrameWeld(), message);
aDialog->Execute(); aDialog.run();
} }
} }
...@@ -3402,32 +3402,13 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL ) ...@@ -3402,32 +3402,13 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL )
* The SvxIconChangeDialog class added for issue83555 * The SvxIconChangeDialog class added for issue83555
* *
*******************************************************************************/ *******************************************************************************/
SvxIconChangeDialog::SvxIconChangeDialog( SvxIconChangeDialog::SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage)
vcl::Window *pWindow, const OUString& aMessage) : MessageDialogController(pWindow, "cui/ui/iconchangedialog.ui", "IconChange", "grid")
:ModalDialog(pWindow, "IconChange", "cui/ui/iconchangedialog.ui") , m_xLineEditDescription(m_xBuilder->weld_text_view("addrTextview"))
{ {
get(pFImageInfo, "infoImage"); m_xLineEditDescription->set_size_request(m_xLineEditDescription->get_approximate_digit_width() * 48,
get(pLineEditDescription, "addrTextview"); m_xLineEditDescription->get_text_height() * 8);
m_xLineEditDescription->set_text(rMessage);
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();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <vcl/lstbox.hxx> #include <vcl/lstbox.hxx>
#include <vcl/menubtn.hxx> #include <vcl/menubtn.hxx>
#include <vcl/toolbox.hxx> #include <vcl/toolbox.hxx>
#include <vcl/weld.hxx>
#include <svtools/imgdef.hxx> #include <svtools/imgdef.hxx>
#include <svtools/miscopt.hxx> #include <svtools/miscopt.hxx>
#include <svtools/treelistbox.hxx> #include <svtools/treelistbox.hxx>
...@@ -51,7 +52,6 @@ ...@@ -51,7 +52,6 @@
#include <sfx2/tabdlg.hxx> #include <sfx2/tabdlg.hxx>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <vcl/msgbox.hxx>
#include "cfgutil.hxx" #include "cfgutil.hxx"
#include "CommandCategoryListBox.hxx" #include "CommandCategoryListBox.hxx"
...@@ -637,15 +637,12 @@ public: ...@@ -637,15 +637,12 @@ public:
}; };
//added for issue83555 //added for issue83555
class SvxIconChangeDialog : public ModalDialog class SvxIconChangeDialog : public weld::MessageDialogController
{ {
private: private:
VclPtr<FixedImage> pFImageInfo; std::unique_ptr<weld::TextView> m_xLineEditDescription;
VclPtr<VclMultiLineEdit> pLineEditDescription;
public: public:
SvxIconChangeDialog(vcl::Window *pWindow, const OUString& aMessage); SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage);
virtual ~SvxIconChangeDialog() override;
virtual void dispose() override;
}; };
#endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX #endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.20.2 -->
<interface domain="cui"> <interface domain="cui">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="IconChange"> <object class="GtkMessageDialog" id="IconChange">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="modal">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="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="buttons">ok</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">12</property> <property name="spacing">2</property>
<child internal-child="action_area"> <child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1"> <object class="GtkButtonBox">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="homogeneous">True</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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</property>
<property name="position">0</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> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkGrid" id="grid1"> <object class="GtkGrid" id="grid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child> <child>
<object class="GtkImage" id="infoImage"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="stock">gtk-missing-image</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> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label1"> <object class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</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. <property name="label" translatable="yes" context="iconchangedialog|label1">The files listed below could not be imported.
The file format could not be interpreted.</property> The file format could not be interpreted.</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">0</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>
</child> </child>
<action-widgets> <child>
<action-widget response="-5">ok</action-widget> <placeholder/>
</action-widgets> </child>
</object> </object>
</interface> </interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment