[Libreoffice-commits] core.git: dbaccess/source dbaccess/uiconfig include/sfx2 vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Apr 6 18:46:59 UTC 2019
dbaccess/source/ui/dlg/TablesSingleDlg.cxx | 22 ++++++++--------------
dbaccess/source/ui/dlg/tablespage.cxx | 1 -
dbaccess/source/ui/dlg/tablespage.hxx | 2 +-
dbaccess/source/ui/inc/TablesSingleDlg.hxx | 7 +++----
dbaccess/source/ui/uno/TableFilterDlg.cxx | 3 ++-
dbaccess/uiconfig/ui/tablesfilterpage.ui | 25 +++++++++++++++----------
include/sfx2/basedlgs.hxx | 1 +
vcl/unx/gtk3/gtk3gtkinst.cxx | 8 +++++++-
8 files changed, 37 insertions(+), 32 deletions(-)
New commits:
commit 8387a0381af4b857035878f8f1bcc880cb823ba7
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Apr 5 21:46:02 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Apr 6 20:46:36 2019 +0200
weld OTableSubscriptionDialog
Change-Id: Idf66a9e49471d6651c03deecc4fb2f9a722f512c
Reviewed-on: https://gerrit.libreoffice.org/70325
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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>
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 69c527ffce15..ed7df91b3883 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -274,6 +274,7 @@ protected:
std::unique_ptr<weld::Button> m_xHelpBtn;
void CreateOutputItemSet(const SfxItemSet& rInput);
+ void SetInputSet(const SfxItemSet* pInSet) { m_pInputSet = pInSet; }
DECL_DLLPRIVATE_LINK(OKHdl_Impl, weld::Button&, void);
};
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 06a2ba5a705c..d5bf067032d3 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -5863,6 +5863,10 @@ private:
{
GtkTreePath *tree_path = gtk_tree_path_new_from_string(path);
+ // toggled signal handlers can query get_cursor to get which
+ // node was clicked
+ gtk_tree_view_set_cursor(m_pTreeView, tree_path, nullptr, false);
+
GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
GtkTreeIter iter;
gtk_tree_model_get_iter(pModel, &iter, tree_path);
@@ -5876,6 +5880,8 @@ private:
gint* indices = gtk_tree_path_get_indices_with_depth(tree_path, &depth);
int nRow = indices[depth-1];
+ set(iter, m_aToggleTriStateMap[nCol], false);
+
signal_toggled(std::make_pair(nRow, nCol));
gtk_tree_path_free(tree_path);
@@ -6422,7 +6428,7 @@ public:
{
const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter);
col = get_model_col(col);
- set(rGtkIter.iter, m_aWeightMap[col], bOn ? PANGO_WEIGHT_BOLD : -1);
+ set(rGtkIter.iter, m_aWeightMap[col], bOn ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
}
virtual bool get_text_emphasis(const weld::TreeIter& rIter, int col) const override
More information about the Libreoffice-commits
mailing list