diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-05 21:46:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-06 20:46:36 +0200 |
commit | 8387a0381af4b857035878f8f1bcc880cb823ba7 (patch) | |
tree | f4a66ae00771d1797dc82cf91928bfc72cef9aa3 /dbaccess | |
parent | e3d737119fc7bdce224a173896486f376f95a417 (diff) |
weld OTableSubscriptionDialog
Change-Id: Idf66a9e49471d6651c03deecc4fb2f9a722f512c
Reviewed-on: https://gerrit.libreoffice.org/70325
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/dlg/TablesSingleDlg.cxx | 22 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/tablespage.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/tablespage.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/TablesSingleDlg.hxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/TableFilterDlg.cxx | 3 | ||||
-rw-r--r-- | dbaccess/uiconfig/ui/tablesfilterpage.ui | 25 |
6 files changed, 29 insertions, 31 deletions
diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index 8673bcf25b5b..c6fcbc7c81d4 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -32,13 +32,13 @@ using namespace com::sun::star::beans; using namespace com::sun::star::container; // OTableSubscriptionDialog -OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window* pParent +OTableSubscriptionDialog::OTableSubscriptionDialog(weld::Window* pParent ,const SfxItemSet* _pItems ,const Reference< XComponentContext >& _rxORB ,const css::uno::Any& _aDataSourceName) - : SfxSingleTabDialog(pParent, _pItems, "TablesFilterDialog", - "dbaccess/ui/tablesfilterdialog.ui") - , m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, GetFrameWeld(), pParent ? pParent->GetFrameWeld() : nullptr, this ) ) + : SfxSingleTabDialogController(pParent, _pItems, + "dbaccess/ui/tablesfilterdialog.ui", "TablesFilterDialog") + , m_pImpl(new ODbDataSourceAdministrationHelper(_rxORB, m_xDialog.get(), pParent, this)) , m_bStopExecution(false) { m_pImpl->setDataSourceOrName(_aDataSourceName); @@ -48,28 +48,22 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window* pParent m_pImpl->translateProperties(xDatasource, *m_pOutSet); SetInputSet(m_pOutSet.get()); - VclPtrInstance<OTableSubscriptionPage> pTabPage(get_content_area(), *m_pOutSet, this); + TabPageParent pPageParent(get_content_area(), this); + auto pTabPage = VclPtrInstance<OTableSubscriptionPage>(pPageParent, *m_pOutSet, this); pTabPage->SetServiceFactory(_rxORB); SetTabPage(pTabPage); } OTableSubscriptionDialog::~OTableSubscriptionDialog() { - disposeOnce(); } -void OTableSubscriptionDialog::dispose() -{ - m_pOutSet.reset(); - SfxSingleTabDialog::dispose(); -} - -short OTableSubscriptionDialog::Execute() +short OTableSubscriptionDialog::run() { short nRet = RET_CANCEL; if ( !m_bStopExecution ) { - nRet = SfxSingleTabDialog::Execute(); + nRet = SfxSingleTabDialogController::run(); if ( nRet == RET_OK ) { m_pOutSet->Put(*GetOutputItemSet()); diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index d5b8ec000344..7ceacdc70d14 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -100,7 +100,6 @@ namespace dbaui ::comphelper::disposeComponent(m_xCurrentConnection); } catch (RuntimeException&) { } - m_pTablesDlg.clear(); OGenericAdministrationPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx index d432b1f917b6..9d92a8407b80 100644 --- a/dbaccess/source/ui/dlg/tablespage.hxx +++ b/dbaccess/source/ui/dlg/tablespage.hxx @@ -42,7 +42,7 @@ namespace dbaui m_xCurrentConnection; /// valid as long as the page is active css::uno::Reference< css::i18n::XCollator > m_xCollator; - VclPtr<OTableSubscriptionDialog> m_pTablesDlg; + OTableSubscriptionDialog* m_pTablesDlg; std::unique_ptr<weld::Widget> m_xTables; std::unique_ptr<TableTreeListBox> m_xTablesList; diff --git a/dbaccess/source/ui/inc/TablesSingleDlg.hxx b/dbaccess/source/ui/inc/TablesSingleDlg.hxx index a72f70fe756c..135c1350e92a 100644 --- a/dbaccess/source/ui/inc/TablesSingleDlg.hxx +++ b/dbaccess/source/ui/inc/TablesSingleDlg.hxx @@ -39,7 +39,7 @@ namespace dbaui { class ODbDataSourceAdministrationHelper; // OTableSubscriptionDialog - class OTableSubscriptionDialog : public SfxSingleTabDialog, public IItemSetHelper + class OTableSubscriptionDialog : public SfxSingleTabDialogController, public IItemSetHelper { std::unique_ptr<ODbDataSourceAdministrationHelper> m_pImpl; bool m_bStopExecution; // set when the dialog should not be executed @@ -47,13 +47,12 @@ class ODbDataSourceAdministrationHelper; std::unique_ptr<SfxItemSet> m_pOutSet; public: - OTableSubscriptionDialog(vcl::Window* pParent + OTableSubscriptionDialog(weld::Window* pParent ,const SfxItemSet* _pItems ,const css::uno::Reference< css::uno::XComponentContext >& _rxORB ,const css::uno::Any& _aDataSourceName ); virtual ~OTableSubscriptionDialog() override; - virtual void dispose() override; // forwards from ODbDataSourceAdministrationHelper void successfullyConnected(); @@ -66,7 +65,7 @@ class ODbDataSourceAdministrationHelper; virtual const SfxItemSet* getOutputSet() const override; virtual SfxItemSet* getWriteOutputSet() override; - virtual short Execute() override; + virtual short run() override; }; } // namespace dbaui diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx index ca24f744b0f7..e2d05c812366 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.cxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx @@ -23,6 +23,7 @@ #include <TablesSingleDlg.hxx> #include <comphelper/processfactory.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <vcl/svapp.hxx> using namespace dbaui; @@ -94,7 +95,7 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() svt::OGenericUnoDialog::Dialog OTableFilterDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) { - return svt::OGenericUnoDialog::Dialog(VclPtr<OTableSubscriptionDialog>::Create(VCLUnoHelper::GetWindow(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection)); + return svt::OGenericUnoDialog::Dialog(std::make_unique<OTableSubscriptionDialog>(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext, m_aInitialSelection)); } } // namespace dbaui diff --git a/dbaccess/uiconfig/ui/tablesfilterpage.ui b/dbaccess/uiconfig/ui/tablesfilterpage.ui index 682f215cbaf9..85f1b908434e 100644 --- a/dbaccess/uiconfig/ui/tablesfilterpage.ui +++ b/dbaccess/uiconfig/ui/tablesfilterpage.ui @@ -4,10 +4,10 @@ <requires lib="gtk+" version="3.18"/> <object class="GtkTreeStore" id="liststore2"> <columns> - <!-- column-name check1 --> - <column type="gboolean"/> <!-- column-name expander --> <column type="GdkPixbuf"/> + <!-- column-name check1 --> + <column type="gboolean"/> <!-- column-name text --> <column type="gchararray"/> <!-- column-name id --> @@ -74,7 +74,7 @@ <property name="vexpand">True</property> <property name="model">liststore2</property> <property name="headers_visible">False</property> - <property name="search_column">1</property> + <property name="search_column">2</property> <property name="enable_tree_lines">True</property> <property name="show_expanders">True</property> <child internal-child="selection"> @@ -84,24 +84,29 @@ <object class="GtkTreeViewColumn" id="treeviewcolumn8"> <property name="spacing">6</property> <child> - <object class="GtkCellRendererToggle" id="cellrenderer5"/> + <object class="GtkCellRendererPixbuf" id="cellrenderertext5"/> <attributes> - <attribute name="visible">4</attribute> - <attribute name="active">0</attribute> - <attribute name="inconsistent">5</attribute> + <attribute name="pixbuf">0</attribute> </attributes> </child> <child> - <object class="GtkCellRendererPixbuf" id="cellrenderertext5"/> + <object class="GtkCellRendererToggle" id="cellrenderer5"/> <attributes> - <attribute name="pixbuf">1</attribute> + <attribute name="visible">4</attribute> + <attribute name="active">1</attribute> + <attribute name="inconsistent">5</attribute> </attributes> </child> + </object> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn9"> + <property name="spacing">6</property> <child> <object class="GtkCellRendererText" id="cellrenderertext6"/> <attributes> <attribute name="text">2</attribute> - <attribute name="weight">5</attribute> + <attribute name="weight">6</attribute> </attributes> </child> </object> |