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

weld DependencyDialog

Change-Id: I2ec86617f17cbee25e6de04c5db944b03204996a
Reviewed-on: https://gerrit.libreoffice.org/68235
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 25a6599a
...@@ -33,27 +33,19 @@ namespace vcl { class Window; } ...@@ -33,27 +33,19 @@ namespace vcl { class Window; }
using dp_gui::DependencyDialog; using dp_gui::DependencyDialog;
DependencyDialog::DependencyDialog( DependencyDialog::DependencyDialog(
vcl::Window * parent, std::vector< OUString > const & dependencies): weld::Window * parent, std::vector< OUString > const & dependencies)
ModalDialog(parent, "Dependencies", "desktop/ui/dependenciesdialog.ui") : GenericDialogController(parent, "desktop/ui/dependenciesdialog.ui", "Dependencies")
, m_xList(m_xBuilder->weld_tree_view("depListTreeview"))
{ {
get(m_list, "depListTreeview"); m_xList->set_size_request(-1, m_xList->get_height_rows(10));
set_height_request(200);
SetMinOutputSizePixel(GetOutputSizePixel());
m_list->SetReadOnly();
for (auto const& dependency : dependencies) for (auto const& dependency : dependencies)
{ {
m_list->InsertEntry(dependency); m_xList->append_text(dependency);
} }
} }
DependencyDialog::~DependencyDialog() DependencyDialog::~DependencyDialog()
{ {
disposeOnce();
} }
void DependencyDialog::dispose()
{
m_list.clear();
ModalDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -22,29 +22,27 @@ ...@@ -22,29 +22,27 @@
#include <sal/config.h> #include <sal/config.h>
#include <vector>
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <vcl/button.hxx> #include <vcl/weld.hxx>
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx> #include <vector>
#include <vcl/lstbox.hxx>
namespace vcl { class Window; } namespace vcl { class Window; }
namespace dp_gui { namespace dp_gui {
class DependencyDialog: public ModalDialog { class DependencyDialog : public weld::GenericDialogController
{
public: public:
DependencyDialog( DependencyDialog(
vcl::Window * parent, std::vector< OUString > const & dependencies); weld::Window* parent, std::vector< OUString > const & dependencies);
virtual ~DependencyDialog() override; virtual ~DependencyDialog() override;
virtual void dispose() override;
private: private:
DependencyDialog(DependencyDialog const &) = delete; DependencyDialog(DependencyDialog const &) = delete;
DependencyDialog& operator =(DependencyDialog const &) = delete; DependencyDialog& operator =(DependencyDialog const &) = delete;
VclPtr<ListBox> m_list; std::unique_ptr<weld::TreeView> m_xList;
}; };
} }
......
...@@ -375,7 +375,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & ...@@ -375,7 +375,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
} }
{ {
SolarMutexGuard guard; SolarMutexGuard guard;
short n = ScopedVclPtrInstance<DependencyDialog>( m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, deps )->Execute(); DependencyDialog aDlg(m_pDialogHelper ? m_pDialogHelper->getFrameWeld() : nullptr, deps);
short n = aDlg.run();
// Distinguish between closing the dialog and programmatically // Distinguish between closing the dialog and programmatically
// canceling the dialog (headless VCL): // canceling the dialog (headless VCL):
approve = n == RET_OK approve = n == RET_OK
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="dkt"> <interface domain="dkt">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkTreeStore" id="liststore1">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
<!-- column-name id -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkDialog" id="Dependencies"> <object class="GtkDialog" id="Dependencies">
<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="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes" context="dependenciesdialog|Dependencies">System dependencies check</property> <property name="title" translatable="yes" context="dependenciesdialog|Dependencies">System dependencies check</property>
<property name="modal">True</property>
<property name="default_width">0</property>
<property name="default_height">0</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -55,10 +70,10 @@ ...@@ -55,10 +70,10 @@
<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="xalign">0</property>
<property name="label" translatable="yes" context="dependenciesdialog|label1">The extension cannot be installed as the following system dependencies are not fulfilled:</property> <property name="label" translatable="yes" context="dependenciesdialog|label1">The extension cannot be installed as the following system dependencies are not fulfilled:</property>
<property name="wrap">True</property> <property name="wrap">True</property>
<property name="max_width_chars">60</property> <property name="max_width_chars">60</property>
<property name="xalign">0</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
...@@ -67,14 +82,38 @@ ...@@ -67,14 +82,38 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkTreeView" id="depListTreeview"> <object class="GtkScrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="show_expanders">False</property> <property name="shadow_type">in</property>
<child internal-child="selection"> <child>
<object class="GtkTreeSelection" id="treeview-selection1"/> <object class="GtkTreeView" id="depListTreeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="model">liststore1</property>
<property name="headers_visible">False</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="Macro Library List-selection2"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn5">
<property name="resizable">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkCellRendererText" id="cellrenderer4"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child> </child>
</object> </object>
<packing> <packing>
......
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