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

weld SwGlossaryDlg

Change-Id: I6b7a2cc9b9bea2da47cfe731a36fcd5d8bb4ddb6
Reviewed-on: https://gerrit.libreoffice.org/73252
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 63409862
......@@ -244,9 +244,6 @@
<glade-widget-class title="Checked Tree List" name="svxlo-SvxCheckListBox"
generic-name="Checked Tree List" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Glossary Tree List" name="swuilo-SwGlTreeListBox"
generic-name="Glossary Tree List" parent="GtkTreeView"
icon-name="widget-gtk-treeview"/>
<glade-widget-class title="Sidebar Dial Control" name="svxlo-SidebarDialControl"
generic-name="Sidebar Dial Control" parent="GtkSpinner"
icon-name="widget-gtk-spinner"/>
......
......@@ -508,7 +508,6 @@ custom_widgets = [
'SvxTextEncodingBox',
'SvxTextEncodingBox',
'SwAddressPreview',
'SwGlTreeListBox',
'SwMarkPreview',
'SwNavHelpToolBox',
'TableValueSet',
......
......@@ -211,7 +211,10 @@ short AbstractSwModalRedlineAcceptDlg_Impl::Execute()
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractGlossaryDlg_Impl);
short AbstractGlossaryDlg_Impl::Execute()
{
return m_xDlg->run();
}
short AbstractFieldInputDlg_Impl::Execute()
{
......@@ -533,12 +536,12 @@ void AbstractSwModalRedlineAcceptDlg_Impl::AcceptAll( bool bAccept )
OUString AbstractGlossaryDlg_Impl::GetCurrGrpName() const
{
return pDlg->GetCurrGrpName();
return m_xDlg->GetCurrGrpName();
}
OUString AbstractGlossaryDlg_Impl::GetCurrShortName() const
{
return pDlg->GetCurrShortName();
return m_xDlg->GetCurrShortName();
}
void AbstractFieldInputDlg_Impl::EndDialog(sal_Int32 n)
......@@ -995,15 +998,14 @@ VclPtr<SfxAbstractApplyTabDialog> SwAbstractDialogFactory_Impl::CreateTemplateDi
SwWrtShell* pActShell,
bool bNew )
{
return VclPtr<AbstractApplyTabController_Impl>::Create(std::make_unique<SwTemplateDlgController>(pParent, rBase, nRegion, sPage, pActShell, bNew));
return VclPtr<AbstractApplyTabController_Impl>::Create(std::make_unique<SwTemplateDlgController>(pParent, rBase, nRegion,
sPage, pActShell, bNew));
}
VclPtr<AbstractGlossaryDlg> SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxViewFrame* pViewFrame,
SwGlossaryHdl* pGlosHdl,
SwWrtShell *pWrtShell)
VclPtr<AbstractGlossaryDlg> SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxViewFrame* pViewFrame, SwGlossaryHdl* pGlosHdl,
SwWrtShell *pWrtShell)
{
VclPtr<SwGlossaryDlg> pDlg = VclPtr<SwGlossaryDlg>::Create(pViewFrame, pGlosHdl, pWrtShell);
return VclPtr<AbstractGlossaryDlg_Impl>::Create( pDlg );
return VclPtr<AbstractGlossaryDlg_Impl>::Create(std::make_unique<SwGlossaryDlg>(pViewFrame, pGlosHdl, pWrtShell));
}
VclPtr<AbstractFieldInputDlg> SwAbstractDialogFactory_Impl::CreateFieldInputDlg(weld::Widget *pParent,
......
......@@ -400,7 +400,13 @@ public:
class SwGlossaryDlg;
class AbstractGlossaryDlg_Impl : public AbstractGlossaryDlg
{
DECL_ABSTDLG_BASE(AbstractGlossaryDlg_Impl,SwGlossaryDlg)
std::unique_ptr<SwGlossaryDlg> m_xDlg;
public:
explicit AbstractGlossaryDlg_Impl(std::unique_ptr<SwGlossaryDlg> p)
: m_xDlg(std::move(p))
{
}
virtual short Execute() override;
virtual OUString GetCurrGrpName() const override;
virtual OUString GetCurrShortName() const override;
};
......
This diff is collapsed.
......@@ -21,7 +21,8 @@
#include <vcl/edit.hxx>
#include <vcl/treelistbox.hxx>
#include <svx/stddlg.hxx>
#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
......@@ -33,78 +34,24 @@
#include "actctrl.hxx"
struct GroupUserData;
class SwGlossaryHdl;
class SwNewGlosNameDlg;
class SwWrtShell;
class SfxViewFrame;
class PopupMenu;
class Menu;
class OneExampleFrame;
const short RET_EDIT = 100;
class SwGlTreeListBox : public SvTreeListBox
{
const OUString sReadonly;
SvTreeListEntry* pDragEntry;
Link<SwGlTreeListBox*,void> m_aDeleteHdl;
virtual DragDropMode NotifyStartDrag( TransferDataContainer& rContainer,
SvTreeListEntry* ) override;
virtual bool NotifyAcceptDrop( SvTreeListEntry* ) override;
virtual TriState NotifyMoving( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
SvTreeListEntry*& rpNewParent,
sal_uLong& rNewChildPos
) override;
virtual TriState NotifyCopying( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
SvTreeListEntry*& rpNewParent,
sal_uLong& rNewChildPos) override;
TriState NotifyCopyingOrMoving( SvTreeListEntry* pTarget,
SvTreeListEntry* pEntry,
bool bIsMove);
public:
SwGlTreeListBox(vcl::Window* pParent, WinBits nBits);
virtual void RequestHelp( const HelpEvent& rHEvt ) override;
virtual Size GetOptimalSize() const override;
void Clear();
virtual void ExpandedHdl() override;
virtual void KeyInput( const KeyEvent& rKEvt ) override;
void SetDeleteHdl( const Link<SwGlTreeListBox*,void>& rLink ) { m_aDeleteHdl = rLink; }
};
class SwOneExampleFrame;
class SwGlossaryDlg : public SvxStandardDialog
class SwGlossaryDlg : public SfxDialogController
{
friend class SwNewGlosNameDlg;
friend class SwGlTreeListBox;
VclPtr<CheckBox> m_pInsertTipCB;
VclPtr<Edit> m_pNameED;
VclPtr<FixedText> m_pShortNameLbl;
TextFilter m_aNoSpaceFilter;
VclPtr<Edit> m_pShortNameEdit;
VclPtr<SwGlTreeListBox> m_pCategoryBox;
VclPtr<CheckBox> m_pFileRelCB;
VclPtr<CheckBox> m_pNetRelCB;
VclPtr<vcl::Window> m_pExampleWIN;
VclPtr<PushButton> m_pInsertBtn;
VclPtr<MenuButton> m_pEditBtn;
VclPtr<PushButton> m_pBibBtn;
VclPtr<PushButton> m_pPathBtn;
OUString const m_sReadonlyPath;
css::uno::Reference< css::text::XAutoTextContainer2 > m_xAutoText;
std::unique_ptr<SwOneExampleFrame> m_pExampleFrame;
SwGlossaryHdl* m_pGlossaryHdl;
......@@ -119,25 +66,42 @@ class SwGlossaryDlg : public SvxStandardDialog
SwWrtShell* m_pShell;
std::vector<std::unique_ptr<GroupUserData>> m_xGroupData;
std::unique_ptr<weld::CheckButton> m_xInsertTipCB;
std::unique_ptr<weld::Entry> m_xNameED;
std::unique_ptr<weld::Label> m_xShortNameLbl;
TextFilter m_aNoSpaceFilter;
std::unique_ptr<weld::Entry> m_xShortNameEdit;
std::unique_ptr<weld::TreeView> m_xCategoryBox;
std::unique_ptr<weld::CheckButton> m_xFileRelCB;
std::unique_ptr<weld::CheckButton> m_xNetRelCB;
std::unique_ptr<weld::Button> m_xInsertBtn;
std::unique_ptr<weld::MenuButton> m_xEditBtn;
std::unique_ptr<weld::Button> m_xBibBtn;
std::unique_ptr<weld::Button> m_xPathBtn;
std::unique_ptr<OneExampleFrame> m_xExampleFrame;
std::unique_ptr<weld::CustomWeld> m_xExampleFrameWin;
void EnableShortName(bool bOn = true);
void ShowPreview();
DECL_LINK( NameModify, Edit&, void );
DECL_LINK( NameDoubleClick, SvTreeListBox*, bool );
DECL_LINK( GrpSelect, SvTreeListBox *, void );
DECL_LINK( MenuHdl, Menu *, bool );
DECL_LINK( EnableHdl, Menu *, bool );
DECL_LINK( BibHdl, Button *, void );
DECL_LINK( EditHdl, MenuButton *, void );
DECL_LINK( InsertHdl, Button *, void );
DECL_LINK( PathHdl, Button *, void );
DECL_LINK( CheckBoxHdl, Button*, void );
DECL_LINK( PreviewLoadedHdl, SwOneExampleFrame&, void );
DECL_LINK( DeleteHdl, SwGlTreeListBox*, void );
virtual void Apply() override;
DECL_LINK( NameModify, weld::Entry&, void );
DECL_LINK( NameDoubleClick, weld::TreeView&, void );
DECL_LINK( GrpSelect, weld::TreeView&, void );
DECL_LINK( MenuHdl, const OString&, void );
DECL_LINK( EnableHdl, weld::ToggleButton&, void );
DECL_LINK( BibHdl, weld::Button&, void );
DECL_LINK( InsertHdl, weld::Button&, void );
DECL_LINK( PathHdl, weld::Button&, void );
DECL_LINK( CheckBoxHdl, weld::ToggleButton&, void );
DECL_LINK( PreviewLoadedHdl, OneExampleFrame&, void );
DECL_LINK( KeyInputHdl, const KeyEvent&, bool );
DECL_LINK( TextFilterHdl, OUString&, bool );
void Apply();
void Init();
SvTreeListEntry* DoesBlockExist(const OUString& sBlock, const OUString& rShort);
std::unique_ptr<weld::TreeIter> DoesBlockExist(const OUString& sBlock, const OUString& rShort);
void ShowAutoText(const OUString& rGroup, const OUString& rShortName);
void ResumeShowAutoText();
......@@ -149,12 +113,12 @@ class SwGlossaryDlg : public SvxStandardDialog
void DeleteEntry();
public:
SwGlossaryDlg(SfxViewFrame const * pViewFrame, SwGlossaryHdl* pGlosHdl, SwWrtShell *pWrtShell);
virtual short run() override;
virtual ~SwGlossaryDlg() override;
virtual void dispose() override;
OUString GetCurrGrpName() const;
OUString GetCurrShortName() const
{
return m_pShortNameEdit->GetText();
return m_xShortNameEdit->get_text();
}
static OUString GetCurrGroup();
static void SetActGroup(const OUString& rNewGroup);
......
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