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

weld OTableSubscriptionDialog

Change-Id: Idf66a9e49471d6651c03deecc4fb2f9a722f512c
Reviewed-on: https://gerrit.libreoffice.org/70325
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e3d73711
......@@ -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());
......
......@@ -100,7 +100,6 @@ namespace dbaui
::comphelper::disposeComponent(m_xCurrentConnection);
}
catch (RuntimeException&) { }
m_pTablesDlg.clear();
OGenericAdministrationPage::dispose();
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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
......
......@@ -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>
......
......@@ -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);
};
......
......@@ -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
......
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