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

weld FormLinkDialog

Change-Id: I440089f650aea87eab21c148e713a8716e55f2bb
Reviewed-on: https://gerrit.libreoffice.org/73002
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 28fc6e2d
......@@ -12,7 +12,6 @@ $(eval $(call gb_UIConfig_UIConfig,modules/spropctrlr))
$(eval $(call gb_UIConfig_add_uifiles,modules/spropctrlr,\
extensions/uiconfig/spropctrlr/ui/controlfontdialog \
extensions/uiconfig/spropctrlr/ui/datatypedialog \
extensions/uiconfig/spropctrlr/ui/fieldlinkrow \
extensions/uiconfig/spropctrlr/ui/formlinksdialog \
extensions/uiconfig/spropctrlr/ui/labelselectiondialog \
extensions/uiconfig/spropctrlr/ui/listselectdialog \
......
......@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <toolkit/helper/vclunohelper.hxx>
#include <sal/log.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <vcl/svapp.hxx>
#include "MasterDetailLinkDialog.hxx"
#include "formlinkdialog.hxx"
#include "pcrservices.hxx"
......@@ -102,8 +102,9 @@ namespace pcr
svt::OGenericUnoDialog::Dialog MasterDetailLinkDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
return svt::OGenericUnoDialog::Dialog(VclPtr<FormLinkDialog>::Create(VCLUnoHelper::GetWindow(rParent),m_xDetail,m_xMaster, m_aContext
,m_sExplanation,m_sDetailLabel,m_sMasterLabel));
return svt::OGenericUnoDialog::Dialog(std::make_unique<FormLinkDialog>(Application::GetFrameWeld(rParent), m_xDetail,
m_xMaster, m_aContext, m_sExplanation,
m_sDetailLabel, m_sMasterLabel));
}
void MasterDetailLinkDialog::implInitialize(const Any& _rValue)
......
......@@ -2673,13 +2673,11 @@ namespace pcr
if ( !xDetailForm.is() || !xMasterForm.is() )
return false;
ScopedVclPtrInstance< FormLinkDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
FormLinkDialog aDialog(impl_getDefaultDialogFrame_nothrow(), m_xComponent, xMasterProp, m_xContext);
_rClearBeforeDialog.clear();
return ( RET_OK == aDialog->Execute() );
return ( RET_OK == aDialog.run() );
}
bool FormComponentPropertyHandler::impl_dialogFormatting_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{
bool bChanged = false;
......
......@@ -20,9 +20,7 @@
#ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_FORMLINKDIALOG_HXX
#define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_FORMLINKDIALOG_HXX
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/weld.hxx>
#include <com/sun/star/form/XForm.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
......@@ -35,25 +33,13 @@
namespace pcr
{
class FieldLinkRow;
//= FormLinkDialog
class FormLinkDialog : public ModalDialog
class FormLinkDialog : public weld::GenericDialogController
{
private:
VclPtr<FixedText> m_pExplanation;
VclPtr<FixedText> m_pDetailLabel;
VclPtr<FixedText> m_pMasterLabel;
VclPtr<FieldLinkRow> m_aRow1;
VclPtr<FieldLinkRow> m_aRow2;
VclPtr<FieldLinkRow> m_aRow3;
VclPtr<FieldLinkRow> m_aRow4;
VclPtr<OKButton> m_pOK;
VclPtr<PushButton> m_pSuggest;
css::uno::Reference< css::uno::XComponentContext >
m_xContext;
css::uno::Reference< css::beans::XPropertySet >
......@@ -67,9 +53,19 @@ namespace pcr
OUString m_sDetailLabel;
OUString m_sMasterLabel;
std::unique_ptr<weld::Label> m_xExplanation;
std::unique_ptr<weld::Label> m_xDetailLabel;
std::unique_ptr<weld::Label> m_xMasterLabel;
std::unique_ptr<FieldLinkRow> m_xRow1;
std::unique_ptr<FieldLinkRow> m_xRow2;
std::unique_ptr<FieldLinkRow> m_xRow3;
std::unique_ptr<FieldLinkRow> m_xRow4;
std::unique_ptr<weld::Button> m_xOK;
std::unique_ptr<weld::Button> m_xSuggest;
public:
FormLinkDialog(
vcl::Window* _pParent,
weld::Window* _pParent,
const css::uno::Reference< css::beans::XPropertySet >& _rxDetailForm,
const css::uno::Reference< css::beans::XPropertySet >& _rxMasterForm,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
......@@ -77,14 +73,14 @@ namespace pcr
const OUString& _sDetailLabel = OUString(),
const OUString& _sMasterLabel = OUString()
);
virtual ~FormLinkDialog( ) override;
virtual void dispose() override;
virtual ~FormLinkDialog() override;
// Dialog overridables
virtual short Execute() override;
virtual short run() override;
private:
DECL_LINK( OnSuggest, Button*, void );
DECL_LINK( OnSuggest, weld::Button&, void );
DECL_LINK( OnFieldChanged, FieldLinkRow&, void );
DECL_LINK( OnInitialize, void*, void);
......@@ -129,10 +125,8 @@ namespace pcr
);
};
} // namespace pcr
#endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_FORMLINKDIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="pcr">
<requires lib="gtk+" version="3.18"/>
<object class="GtkBox" id="FieldLinkRow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkComboBoxText" id="detailCombobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
<child internal-child="entry">
<object class="GtkEntry" id="comboboxtext-entry1">
<property name="can_focus">False</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="masterCombobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
<child internal-child="entry">
<object class="GtkEntry" id="comboboxtext-entry2">
<property name="can_focus">False</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</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