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 @@
#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>
......
......@@ -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: */
......@@ -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
......
<?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>
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