Kaydet (Commit) ca040d16 authored tarafından Akshay Deep's avatar Akshay Deep Kaydeden (comit) Samuel Mehrbrodt

New Template Manager

1. Save Mode removed from Template Manager
2. Context Menu for TemplateViewItems (Handled from LocalView for Local Repos)
3. 'showAllTemplates()' replacing 'showRootRegion()'
4. Filter Combobox for templates (Remembers filters also)
5. Search Filter (Synchronized with Filter ComboBoxes)
6. Removed Tabs from Template Manager
7. Removed Buttons from TemplateAbstractView
8. Unused GtkToolButtons removed
9. PushButtons in UI
10. Modal dialog for Import and Move (Works from "All Categories" now too)
11. ContextMenu for TemplateSearchView
12. Delete Categories(Folder) in Settings Menu
13. Save As Template Dialog

Change-Id: I88f6568c35271c17dbd7e6877d50119a8cfe4d60
Reviewed-on: https://gerrit.libreoffice.org/24545Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 365c4d8c
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SFX2_INC_SAVEASTEMPLATEDLG_HXX
#define INCLUDED_SFX2_INC_SAVEASTEMPLATEDLG_HXX
#include <sal/config.h>
#include <sfx2/dllapi.h>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
class Edit;
class ListBox;
class SfxDocumentTemplates;
// class SfxSaveAsTemplateDialog -------------------------------------------------------------------
class SFX2_DLLPUBLIC SfxSaveAsTemplateDialog : public ModalDialog
{
private:
VclPtr<ListBox> mpLBCategory;
VclPtr<Edit> mpTemplateNameEdit;
VclPtr<PushButton> mpOKButton;
OUString msSelectedCategory;
OUString msTemplateName;
sal_uInt16 mnRegionPos;
std::vector<OUString> msCategories;
SfxDocumentTemplates *mpDocTemplates;
css::uno::Reference< css::frame::XModel > m_xModel;
public:
DECL_LINK_TYPED(OkClickHdl, Button*, void);
DECL_LINK_TYPED(TemplateNameEditHdl, Edit&, void);
DECL_LINK_TYPED(SelectCategoryHdl, ListBox&, void);
void setDocumentModel (const css::uno::Reference<css::frame::XModel> &rModel);
void initialize();
void SetCategoryLBEntries(std::vector<OUString> names);
/*Check whether template name is unique or not in a region*/
bool IsTemplateNameUnique();
bool SaveTemplate();
public:
explicit SfxSaveAsTemplateDialog(vcl::Window *parent = nullptr);
virtual ~SfxSaveAsTemplateDialog();
virtual void dispose() override;
};
#endif // INCLUDED_SFX2_INC_SAVEASTEMPLATEDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -30,6 +30,7 @@
#define TEMPLATE_THUMBNAIL_MAX_WIDTH TEMPLATE_ITEM_MAX_WIDTH - 2*TEMPLATE_ITEM_PADDING
class SfxDocumentTemplates;
class TemplateViewItem;
enum class FILTER_APPLICATION
{
......@@ -81,18 +82,14 @@ public:
virtual void reload () { }
virtual void showRootRegion () = 0;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
virtual void showAllTemplates () = 0;
virtual void showRegion (ThumbnailViewItem *pItem) = 0;
virtual sal_uInt16 createRegion (const OUString &rName) = 0;
// Return if we can have regions inside the current region
virtual bool isNestedRegionAllowed () const = 0;
// Return if we can import templates to the current region
virtual bool isImportAllowed () const = 0;
sal_uInt16 getCurRegionId () const { return mnCurRegionId;}
const OUString& getCurRegionName () const { return maCurRegionName;}
......@@ -102,8 +99,16 @@ public:
void setOpenRegionHdl(const Link<void*,void> &rLink);
void setRightClickHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setOpenTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setEditTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setDeleteTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setDefaultTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void updateThumbnailDimensions(long itemMaxSize);
long getThumbnailWidth() const { return mnThumbnailWidth;}
......@@ -117,25 +122,26 @@ public:
protected:
DECL_LINK_TYPED(ShowRootRegionHdl, Button*, void);
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) override;
protected:
sal_uInt16 mnCurRegionId;
OUString maCurRegionName;
TemplateViewItem *maSelectedItem;
long mnThumbnailWidth;
long mnThumbnailHeight;
VclPtr<PushButton> maAllButton;
VclPtr<FixedText> maFTName;
Point maPosition;
Link<void*,void> maOpenRegionHdl;
Link<ThumbnailViewItem*,void> maRightClickHdl;
Link<ThumbnailViewItem*,void> maOpenTemplateHdl;
Link<ThumbnailViewItem*,void> maEditTemplateHdl;
Link<ThumbnailViewItem*,void> maDeleteTemplateHdl;
Link<ThumbnailViewItem*,void> maDefaultTemplateHdl;
};
#endif // INCLUDED_SFX2_TEMPLATEABSTRACTVIEW_HXX
......
......@@ -17,8 +17,6 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabpage.hxx>
#include <com/sun/star/frame/XDesktop2.hpp>
#include <sfx2/templateabstractview.hxx>
......@@ -52,55 +50,55 @@ public:
virtual ~SfxTemplateManagerDlg();
virtual void dispose() override;
void setSaveMode();
void setDocumentModel (const css::uno::Reference<css::frame::XModel> &rModel);
DECL_LINK_TYPED(ActivatePageHdl, TabControl*, void);
private:
void readSettings ();
void writeSettings ();
DECL_LINK_TYPED(TBXViewHdl, ToolBox*, void);
DECL_LINK_TYPED(TBXActionHdl, ToolBox*, void);
DECL_LINK_TYPED(TBXTemplateHdl, ToolBox*, void);
void fillFolderComboBox();
DECL_LINK_TYPED(TBXDropdownHdl, ToolBox*, void);
DECL_LINK_TYPED(SelectApplicationHdl, ListBox&, void);
DECL_LINK_TYPED(SelectRegionHdl, ListBox&, void);
DECL_LINK_TYPED(OkClickHdl, Button*, void);
DECL_LINK_TYPED(MoveClickHdl, Button*, void);
DECL_LINK_TYPED(ExportClickHdl, Button*, void);
DECL_LINK_TYPED(ImportClickHdl, Button*, void);
DECL_LINK_TYPED(LinkClickHdl, Button*, void);
DECL_LINK_TYPED(TVItemStateHdl, const ThumbnailViewItem*, void);
DECL_LINK_TYPED(MenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(MoveMenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(RepositoryMenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(DefaultTemplateMenuSelectHdl, Menu*, bool);
DECL_LINK_TYPED(OpenRegionHdl, void*, void);
DECL_LINK_TYPED(RightClickHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(OpenTemplateHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(EditTemplateHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(DeleteTemplateHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(DefaultTemplateHdl, ThumbnailViewItem*, void);
DECL_LINK_TYPED(SearchUpdateHdl, Edit&, void);
void OnTemplateImport ();
void OnTemplateSearch ();
void OnTemplateImportCategory(OUString sCategory);
static void OnTemplateLink ();
void OnTemplateOpen ();
void OnTemplateEdit ();
void OnTemplateDelete ();
void OnTemplateAsDefault ();
void OnTemplateExport ();
void OnTemplateState (const ThumbnailViewItem *pItem);
void OnFolderNew ();
void OnFolderDelete ();
void OnCategoryNew ();
void OnCategoryDelete();
void OnRegionState (const ThumbnailViewItem *pItem);
void OnRepositoryDelete ();
void OnTemplateSaveAs ();
void createRepositoryMenu ();
......@@ -138,18 +136,22 @@ private:
void syncRepositories () const;
/// Return filter according to the currently selected tab page.
FILTER_APPLICATION getCurrentFilter();
/// Return filter according to the currently selected application filter.
FILTER_APPLICATION getCurrentApplicationFilter();
private:
VclPtr<TabControl> mpTabControl;
VclPtr<Edit> mpSearchFilter;
VclPtr<ListBox> mpCBApp;
VclPtr<ListBox> mpCBFolder;
VclPtr<Edit> mpSearchEdit;
VclPtr<PushButton> mpOKButton;
VclPtr<PushButton> mpMoveButton;
VclPtr<PushButton> mpExportButton;
VclPtr<PushButton> mpImportButton;
VclPtr<PushButton> mpLinkButton;
VclPtr<ToolBox> mpViewBar;
VclPtr<ToolBox> mpActionBar;
VclPtr<ToolBox> mpTemplateBar;
VclPtr<TemplateSearchView> mpSearchView;
VclPtr<TemplateAbstractView> mpCurView;
VclPtr<TemplateLocalView> mpLocalView;
......@@ -159,9 +161,7 @@ private:
PopupMenu *mpTemplateDefaultMenu;
std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates;
std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelFolders;
bool mbIsSaveMode; ///< Flag that indicates if we are in save mode or not.
css::uno::Reference< css::frame::XModel > m_xModel;
css::uno::Reference< css::frame::XDesktop2 > mxDesktop;
......@@ -169,6 +169,48 @@ private:
std::vector<TemplateRepository*> maRepositories; ///< Stores the remote repositories for templates
};
// class SfxTemplateCategoryDialog -------------------------------------------------------------------
class SFX2_DLLPUBLIC SfxTemplateCategoryDialog : public ModalDialog
{
private:
VclPtr<ListBox> mpLBCategory;
VclPtr<FixedText> mpSelectLabel;
VclPtr<Edit> mpNewCategoryEdit;
VclPtr<FixedText> mpCreateLabel;
VclPtr<PushButton> mpOKButton;
OUString msSelectedCategory;
bool mbIsNewCategory;
public:
DECL_LINK_TYPED(NewCategoryEditHdl, Edit&, void);
DECL_LINK_TYPED(SelectCategoryHdl, ListBox&, void);
void SetCategoryLBEntries(std::vector<OUString> names);
void HideNewCategoryOption();
inline OUString GetSelectedCategory() const {
return msSelectedCategory;
};
inline void SetSelectLabelText(OUString sText) const {
mpSelectLabel->SetText(sText);
};
inline bool IsNewCategoryCreated() const {
return mbIsNewCategory;
}
public:
explicit SfxTemplateCategoryDialog(vcl::Window *parent = nullptr);
virtual ~SfxTemplateCategoryDialog();
virtual void dispose() override;
};
#endif // INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -17,6 +17,7 @@
class SfxDocumentTemplates;
class TemplateContainerItem;
class PopupMenu;
namespace com {
namespace sun { namespace star { namespace frame {
......@@ -40,16 +41,24 @@ public:
virtual void reload () override;
virtual void showRootRegion () override;
virtual void showAllTemplates () override;
virtual void showRegion (ThumbnailViewItem *pItem) override;
void showRegion (const OUString &rName);
void createContextMenu();
DECL_LINK_TYPED(ContextMenuSelectHdl, Menu*, bool);
sal_uInt16 getCurRegionItemId () const;
ThumbnailViewItem* getRegion(OUString sStr);
sal_uInt16 getRegionId (size_t pos) const;
sal_uInt16 getRegionId (OUString sRegionName) const;
OUString getRegionName(const sal_uInt16 nRegionId) const;
OUString getRegionItemName(const sal_uInt16 nItemId) const;
......@@ -61,10 +70,6 @@ public:
virtual sal_uInt16 createRegion (const OUString &rName) override;
virtual bool isNestedRegionAllowed () const override;
virtual bool isImportAllowed () const override;
bool removeRegion (const sal_uInt16 nItemId);
bool removeTemplate (const sal_uInt16 nItemId, const sal_uInt16 nSrcItemId);
......@@ -83,22 +88,13 @@ public:
bool exportTo (const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, const OUString &rName);
bool saveTemplateAs (sal_uInt16 nItemId,
css::uno::Reference<css::frame::XModel> &rModel,
const OUString &rName);
bool saveTemplateAs (TemplateContainerItem *pDstItem,
css::uno::Reference<css::frame::XModel> &rModel,
const OUString &rName);
bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString &rName) const;
virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& sNewTitle) override;
private:
SfxDocumentTemplates *mpDocTemplates;
std::vector<TemplateContainerItem* > maRegions;
std::vector<TemplateItemProperties > maAllTemplates;
};
#endif // INCLUDED_SFX2_TEMPLATELOCALVIEW_HXX
......
......@@ -23,7 +23,7 @@ public:
TemplateRemoteView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
virtual void showRootRegion () override;
virtual void showAllTemplates () override;
virtual void showRegion (ThumbnailViewItem *pItem) override;
......@@ -31,10 +31,6 @@ public:
virtual sal_uInt16 createRegion (const OUString &rName) override;
virtual bool isNestedRegionAllowed () const override;
virtual bool isImportAllowed () const override;
private:
css::uno::Reference< css::ucb::XCommandEnvironment > m_xCmdEnv;
......
......@@ -233,6 +233,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/doc/syspath \
sfx2/source/doc/zoomitem \
sfx2/source/doc/templatedlg \
sfx2/source/doc/saveastemplatedlg \
sfx2/source/explorer/nochaos \
sfx2/source/inet/inettbc \
sfx2/source/notebookbar/SfxNotebookBar \
......
......@@ -44,6 +44,8 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/singletabdialog \
sfx2/uiconfig/ui/startcenter \
sfx2/uiconfig/ui/templatedlg \
sfx2/uiconfig/ui/saveastemplatedlg \
sfx2/uiconfig/ui/templatecategorydlg \
sfx2/uiconfig/ui/versionsofdialog \
sfx2/uiconfig/ui/versioncommentdialog \
sfx2/uiconfig/ui/versionscmis \
......
......@@ -10,9 +10,9 @@
#include <sfx2/templateabstractview.hxx>
#include <comphelper/processfactory.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatecontaineritem.hxx>
#include <sfx2/templateviewitem.hxx>
#include <sfx2/sfxresid.hxx>
#include <tools/urlobj.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <vcl/pngread.hxx>
......@@ -71,80 +71,27 @@ bool ViewFilter_Application::operator () (const ThumbnailViewItem *pItem)
if (pTempItem)
return isValid(pTempItem->getPath());
TemplateContainerItem *pContainerItem = const_cast<TemplateContainerItem*>(dynamic_cast<const TemplateContainerItem*>(pItem));
if (pContainerItem)
{
std::vector<TemplateItemProperties> &rTemplates = pContainerItem->maTemplates;
size_t nVisCount = 0;
// Clear thumbnails
pContainerItem->maPreview1.Clear();
pContainerItem->maPreview2.Clear();
pContainerItem->maPreview3.Clear();
pContainerItem->maPreview4.Clear();
for (size_t i = 0, n = rTemplates.size(); i < n && pContainerItem->HasMissingPreview(); ++i)
{
if (isValid(rTemplates[i].aPath))
{
++nVisCount;
if ( pContainerItem->maPreview1.IsEmpty( ) )
{
pContainerItem->maPreview1 = TemplateAbstractView::scaleImg(rTemplates[i].aThumbnail,
TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
TEMPLATE_THUMBNAIL_MAX_HEIGHT*0.75);
}
else if ( pContainerItem->maPreview2.IsEmpty() )
{
pContainerItem->maPreview2 = TemplateAbstractView::scaleImg(rTemplates[i].aThumbnail,
TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
TEMPLATE_THUMBNAIL_MAX_HEIGHT*0.75);
}
else if ( pContainerItem->maPreview3.IsEmpty() )
{
pContainerItem->maPreview3 = TemplateAbstractView::scaleImg(rTemplates[i].aThumbnail,
TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
TEMPLATE_THUMBNAIL_MAX_HEIGHT*0.75);
}
else if ( pContainerItem->maPreview4.IsEmpty() )
{
pContainerItem->maPreview4 = TemplateAbstractView::scaleImg(rTemplates[i].aThumbnail,
TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
TEMPLATE_THUMBNAIL_MAX_HEIGHT*0.75);
}
}
}
}
return true;
}
TemplateAbstractView::TemplateAbstractView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
mnCurRegionId(0),
maSelectedItem(nullptr),
mnThumbnailWidth(TEMPLATE_THUMBNAIL_MAX_WIDTH),
mnThumbnailHeight(TEMPLATE_THUMBNAIL_MAX_HEIGHT),
maAllButton(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))),
maFTName(VclPtr<FixedText>::Create(this, SfxResId(FT_NAME)))
maPosition(0,0)
{
maAllButton->Hide();
maAllButton->SetStyle(maAllButton->GetStyle() | WB_FLATBUTTON);
maAllButton->SetClickHdl(LINK(this,TemplateAbstractView,ShowRootRegionHdl));
maFTName->Hide();
}
TemplateAbstractView::TemplateAbstractView(vcl::Window *pParent)
: ThumbnailView(pParent),
mnCurRegionId(0),
maSelectedItem(nullptr),
mnThumbnailWidth(TEMPLATE_THUMBNAIL_MAX_WIDTH),
mnThumbnailHeight(TEMPLATE_THUMBNAIL_MAX_HEIGHT),
maAllButton(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))),
maFTName(VclPtr<FixedText>::Create(this, SfxResId(FT_NAME)))
maPosition(0,0)
{
maAllButton->Hide();
maAllButton->SetStyle(maAllButton->GetStyle() | WB_FLATBUTTON);
maAllButton->SetClickHdl(LINK(this,TemplateAbstractView,ShowRootRegionHdl));
maFTName->Hide();
}
TemplateAbstractView::~TemplateAbstractView()
......@@ -154,8 +101,6 @@ TemplateAbstractView::~TemplateAbstractView()
void TemplateAbstractView::dispose()
{
maAllButton.disposeAndClear();
maFTName.disposeAndClear();
ThumbnailView::dispose();
}
......@@ -187,7 +132,6 @@ void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties>
std::vector<ThumbnailViewItem*> aItems(rTemplates.size());
for (size_t i = 0, n = rTemplates.size(); i < n; ++i )
{
//TODO: CHECK IF THE ITEM IS A FOLDER OR NOT
const TemplateItemProperties *pCur = &rTemplates[i];
TemplateViewItem *pChild = new TemplateViewItem(*this, pCur->nId);
......@@ -215,16 +159,58 @@ void TemplateAbstractView::updateThumbnailDimensions(long itemMaxSize)
mnThumbnailHeight = itemMaxSize;
}
void TemplateAbstractView::MouseButtonDown( const MouseEvent& rMEvt )
{
if (rMEvt.IsRight())
{
size_t nPos = ImplGetItem(rMEvt.GetPosPixel());
Point aPosition (rMEvt.GetPosPixel());
maPosition = aPosition;
ThumbnailViewItem* pItem = ImplGetItem(nPos);
const TemplateViewItem *pViewItem = dynamic_cast<const TemplateViewItem*>(pItem);
if(pViewItem)
{
maSelectedItem = dynamic_cast<TemplateViewItem*>(pItem);
maRightClickHdl.Call(pItem);
}
}
ThumbnailView::MouseButtonDown(rMEvt);
}
void TemplateAbstractView::setOpenRegionHdl(const Link<void*,void> &rLink)
{
maOpenRegionHdl = rLink;
}
void TemplateAbstractView::setRightClickHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maRightClickHdl = rLink;
}
void TemplateAbstractView::setOpenTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maOpenTemplateHdl = rLink;
}
void TemplateAbstractView::setEditTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maEditTemplateHdl = rLink;
}
void TemplateAbstractView::setDeleteTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maDeleteTemplateHdl = rLink;
}
void TemplateAbstractView::setDefaultTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maDefaultTemplateHdl = rLink;
}
BitmapEx TemplateAbstractView::scaleImg (const BitmapEx &rImg, long width, long height)
{
BitmapEx aImg = rImg;
......@@ -271,11 +257,6 @@ BitmapEx TemplateAbstractView::fetchThumbnail (const OUString &msURL, long width
return TemplateAbstractView::scaleImg(ThumbnailView::readThumbnail(msURL), width, height);
}
IMPL_LINK_NOARG_TYPED(TemplateAbstractView, ShowRootRegionHdl, Button*, void)
{
showRootRegion();
}
void TemplateAbstractView::OnItemDblClicked (ThumbnailViewItem *pItem)
{
//Check if the item is a TemplateContainerItem (Folder) or a TemplateViewItem (File)
......@@ -284,10 +265,8 @@ void TemplateAbstractView::OnItemDblClicked (ThumbnailViewItem *pItem)
if ( pContainerItem )
{
// Fill templates
mnCurRegionId = pContainerItem->mnRegionId+1;
maCurRegionName = pContainerItem->maTitle;
maFTName->SetText(maCurRegionName);
showRegion(pItem);
}
else
......@@ -296,24 +275,4 @@ void TemplateAbstractView::OnItemDblClicked (ThumbnailViewItem *pItem)
}
}
void TemplateAbstractView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
ThumbnailView::Paint(rRenderContext, rRect);
Rectangle aRect(rRect.TopLeft(),
Point(rRect.BottomRight().X(),
mnHeaderHeight));
drawinglayer::primitive2d::Primitive2DContainer aSeq(1);
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
new PolyPolygonColorPrimitive2D(B2DPolyPolygon(::tools::Polygon(aRect).getB2DPolygon()),
maFillColor.getBColor()));
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos));
pProcessor->process(aSeq);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,7 +19,7 @@ VCL_BUILDER_FACTORY(TemplateDefaultView)
TemplateDefaultView::TemplateDefaultView( Window* pParent)
: TemplateLocalView(pParent)
, mnTextHeight(30)
, mnItemPadding(5)
, mnItemPadding(5)//TODO:: Change padding to 10. It looks really crowded and occupied.
{
Rectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
......@@ -32,18 +32,6 @@ TemplateDefaultView::TemplateDefaultView( Window* pParent)
maHighlightColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightColor::get());
maHighlightTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightTextColor::get());
mfHighlightTransparence = 0.25;
maAllButton->SetControlForeground(maTextColor);
maFTName->SetControlForeground(maTextColor);
// TODO - convert the TemplateAbstractView to .ui (instead of fixed layout
// of the button and the fixed text), and do the following:
// const float fMultiplier = 1.4;
// vcl::Font aFont(maAllButton->GetSettings().GetStyleSettings().GetPushButtonFont());
// aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
// maAllButton->SetControlFont(aFont);
// maFTName->SetControlFont(aFont);
}
void TemplateDefaultView::reload()
......
......@@ -60,12 +60,12 @@ VCL_BUILDER_DECL_FACTORY(TemplateRemoteView)
rRet = VclPtr<TemplateRemoteView>::Create(pParent, WB_VSCROLL, false);
}
void TemplateRemoteView::showRootRegion()
void TemplateRemoteView::showRegion(ThumbnailViewItem * /*pItem*/)
{
//TODO:
}
void TemplateRemoteView::showRegion(ThumbnailViewItem * /*pItem*/)
void TemplateRemoteView::showAllTemplates()
{
//TODO:
}
......@@ -83,7 +83,6 @@ bool TemplateRemoteView::loadRepository (TemplateRepository* pItem)
mnCurRegionId = pItem->mnId;
maCurRegionName = pItem->maTitle;
maFTName->SetText(maCurRegionName);
OUString aURL = pItem->getURL();
......@@ -172,14 +171,4 @@ sal_uInt16 TemplateRemoteView::createRegion(const OUString &/*rName*/)
return 0;
}
bool TemplateRemoteView::isNestedRegionAllowed() const
{
return true;
}
bool TemplateRemoteView::isImportAllowed() const
{
return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -9,21 +9,110 @@
#include "templatesearchview.hxx"
#include "templatesearchviewitem.hxx"
#include <sfx2/sfxresid.hxx>
#include "../doc/doc.hrc"
#include <vcl/builderfactory.hxx>
#define MNI_OPEN 1
#define MNI_EDIT 2
#define MNI_DEFAULT_TEMPLATE 3
#define MNI_DELETE 4
TemplateSearchView::TemplateSearchView (vcl::Window *pParent, WinBits nWinStyle)
: ThumbnailView(pParent,nWinStyle)
: ThumbnailView(pParent,nWinStyle),
maSelectedItem(nullptr),
maPosition(0,0)
{
}
VCL_BUILDER_FACTORY(TemplateSearchView)
void TemplateSearchView::MouseButtonDown( const MouseEvent& rMEvt )
{
if (rMEvt.IsRight())
{
size_t nPos = ImplGetItem(rMEvt.GetPosPixel());
Point aPosition (rMEvt.GetPosPixel());
maPosition = aPosition;
ThumbnailViewItem* pItem = ImplGetItem(nPos);
const TemplateViewItem *pViewItem = dynamic_cast<const TemplateViewItem*>(pItem);
if(pViewItem)
{
maSelectedItem = dynamic_cast<TemplateViewItem*>(pItem);
maRightClickHdl.Call(pItem);
}
}
ThumbnailView::MouseButtonDown(rMEvt);
}
void TemplateSearchView::createContextMenu()
{
std::unique_ptr<PopupMenu> pItemMenu(new PopupMenu);
pItemMenu->InsertItem(MNI_OPEN,SfxResId(STR_OPEN).toString());
pItemMenu->InsertItem(MNI_EDIT,SfxResId(STR_EDIT_TEMPLATE).toString());
pItemMenu->InsertItem(MNI_DEFAULT_TEMPLATE,SfxResId(STR_DEFAULT_TEMPLATE).toString());
pItemMenu->InsertSeparator();
pItemMenu->InsertItem(MNI_DELETE,SfxResId(STR_DELETE).toString());
maSelectedItem->setSelection(true);
pItemMenu->SetSelectHdl(LINK(this, TemplateSearchView, ContextMenuSelectHdl));
pItemMenu->Execute(this, Rectangle(maPosition,Size(1,1)), PopupMenuFlags::ExecuteDown);
Invalidate();
}
IMPL_LINK_TYPED(TemplateSearchView, ContextMenuSelectHdl, Menu*, pMenu, bool)
{
sal_uInt16 nMenuId = pMenu->GetCurItemId();
switch(nMenuId)
{
case MNI_OPEN:
maOpenTemplateHdl.Call(maSelectedItem);
break;
case MNI_EDIT:
maEditTemplateHdl.Call(maSelectedItem);
break;
case MNI_DELETE:
maDeleteTemplateHdl.Call(maSelectedItem);
break;
case MNI_DEFAULT_TEMPLATE:
maDefaultTemplateHdl.Call(maSelectedItem);
break;
default:
break;
}
return false;
}
void TemplateSearchView::setRightClickHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maRightClickHdl = rLink;
}
void TemplateSearchView::setOpenTemplateHdl(const Link<ThumbnailViewItem*, void> &rLink)
{
maOpenTemplateHdl = rLink;
}
void TemplateSearchView::setEditTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maEditTemplateHdl = rLink;
}
void TemplateSearchView::setDeleteTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maDeleteTemplateHdl = rLink;
}
void TemplateSearchView::setDefaultTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink)
{
maDefaultTemplateHdl = rLink;
}
void TemplateSearchView::OnItemDblClicked (ThumbnailViewItem *pItem)
{
maOpenTemplateHdl.Call(pItem);
......
......@@ -338,8 +338,8 @@ void BackingWindow::initializeLocalView()
{
mbLocalViewInitialized = true;
mpLocalView->Populate();
mpLocalView->showRootRegion();
mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::NONE));
mpLocalView->showAllTemplates();
}
}
......
......@@ -111,6 +111,20 @@
#define IMG_ACTION_SORT (RID_SFX_DOC_START+149)
#define IMG_ACTION_REFRESH (RID_SFX_DOC_START+150)
#define STR_OPEN (RID_SFX_DOC_START+151)
#define STR_EDIT_TEMPLATE (RID_SFX_DOC_START+152)
#define STR_DEFAULT_TEMPLATE (RID_SFX_DOC_START+153)
#define STR_RENAME (RID_SFX_DOC_START+154)
#define STR_DELETE (RID_SFX_DOC_START+155)
#define STR_PROPERTIES (RID_SFX_DOC_START+156)
#define STR_RENAME_TEMPLATE (RID_SFX_DOC_START+157)
#define STR_CATEGORY_NEW (RID_SFX_DOC_START+158)
#define STR_CATEGORY_SELECT (RID_SFX_DOC_START+100)
#define STR_CATEGORY_DELETE (RID_SFX_DOC_START+101)
#define STR_CREATE_ERROR (RID_SFX_DOC_START+103)
#define STR_ERROR_SAVEAS (RID_SFX_DOC_START+105)
// please update to the last id
#define ACT_SFX_DOC_END IMG_ACTION_REFRESH
#if ACT_SFX_DOC_END > RID_SFX_DOC_END
......
......@@ -48,10 +48,34 @@ String STR_CLOSEDOC_ANDRETURN
{
Text [ en-US ] = "~Close & Return to " ;
};
String STR_EDIT
String STR_OPEN
{
Text [ en-US ] = "Open" ;
};
String STR_EDIT_TEMPLATE
{
Text [ en-US ] = "Edit" ;
};
String STR_DEFAULT_TEMPLATE
{
Text [ en-US ] = "Set As Default" ;
};
String STR_DELETE
{
Text [ en-US ] = "Delete" ;
};
String STR_RENAME
{
Text [ en-US ] = "Rename" ;
};
String STR_PROPERTIES
{
Text [ en-US ] = "Properties" ;
};
String STR_RENAME_TEMPLATE
{
Text [ en-US ] = "Enter New Name: " ;
};
String STR_AUTOMATICVERSION
{
Text [ en-US ] = "Automatically saved version" ;
......@@ -211,9 +235,34 @@ String STR_MOVE_NEW
Text [ en-US ] = "New folder";
};
String STR_CATEGORY_NEW
{
Text [ en-US ] = "New Category";
};
String STR_CATEGORY_DELETE
{
Text [ en-US ] = "Delete Category";
};
String STR_CATEGORY_SELECT
{
Text [ en-US ] = "Select Category";
};
String STR_CREATE_ERROR
{
Text [ en-US ] = "Cannot create category: $1";
};
String STR_ERROR_SAVEAS
{
Text [ en-US ] = "Cannot save template: $1";
};
String STR_INPUT_NEW
{
Text [ en-US ] = "Enter folder name:";
Text [ en-US ] = "Enter category name:";
};
String STR_REPOSITORY_LOCAL
......
......@@ -99,7 +99,7 @@
#include "helpid.hrc"
#include "guisaveas.hxx"
#include <sfx2/templatedlg.hxx>
#include <sfx2/saveastemplatedlg.hxx>
#include <memory>
#include <cppuhelper/implbase.hxx>
......@@ -848,11 +848,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_DOCTEMPLATE:
{
// save as document templates
ScopedVclPtrInstance< SfxTemplateManagerDlg > aDlg;
ScopedVclPtrInstance<SfxSaveAsTemplateDialog> aDlg;
aDlg->setDocumentModel(GetModel());
aDlg->setSaveMode();
aDlg->Execute();
break;
}
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sfx2/saveastemplatedlg.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/doctempl.hxx>
#include <vcl/edit.hxx>
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <com/sun/star/frame/DocumentTemplates.hpp>
#include "doc.hrc"
using namespace ::com::sun::star;
using namespace ::com::sun::star::frame;
// Class SfxSaveAsTemplateDialog --------------------------------------------------
SfxSaveAsTemplateDialog::SfxSaveAsTemplateDialog( vcl::Window* pParent):
ModalDialog(pParent, "SaveAsTemplateDialog", "sfx/ui/saveastemplatedlg.ui"),
msSelectedCategory(OUString()),
msTemplateName(OUString()),
mnRegionPos(0),
mpDocTemplates(new SfxDocumentTemplates)
{
get(mpLBCategory, "categorylb");
get(mpTemplateNameEdit, "name_entry");
get(mpOKButton, "ok");
initialize();
SetCategoryLBEntries(msCategories);
mpTemplateNameEdit->SetModifyHdl(LINK(this, SfxSaveAsTemplateDialog, TemplateNameEditHdl));
mpLBCategory->SetSelectHdl(LINK(this, SfxSaveAsTemplateDialog, SelectCategoryHdl));
mpOKButton->SetClickHdl(LINK(this, SfxSaveAsTemplateDialog, OkClickHdl));
mpOKButton->Disable();
mpOKButton->SetText(SfxResId(STR_SAVEDOC).toString());
}
SfxSaveAsTemplateDialog::~SfxSaveAsTemplateDialog()
{
disposeOnce();
}
void SfxSaveAsTemplateDialog::dispose()
{
mpLBCategory.clear();
mpTemplateNameEdit.clear();
mpOKButton.clear();
ModalDialog::dispose();
}
void SfxSaveAsTemplateDialog::setDocumentModel(const uno::Reference<frame::XModel> &rModel)
{
m_xModel = rModel;
}
IMPL_LINK_NOARG_TYPED(SfxSaveAsTemplateDialog, OkClickHdl, Button*, void)
{
ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if(!IsTemplateNameUnique())
{
OUString sQueryMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString());
sQueryMsg = sQueryMsg.replaceFirst("$1",msTemplateName);
aQueryDlg->set_primary_text(sQueryMsg.replaceFirst("$2", msSelectedCategory));
if( aQueryDlg->Execute() == RET_NO )
return;
}
if(SaveTemplate())
Close();
else
{
OUString sText( SfxResId(STR_ERROR_SAVEAS).toString() );
ScopedVclPtrInstance<MessageDialog>::Create(this, sText.replaceFirst("$1", msTemplateName))->Execute();
}
}
IMPL_LINK_NOARG_TYPED(SfxSaveAsTemplateDialog, TemplateNameEditHdl, Edit&, void)
{
msTemplateName = comphelper::string::strip(mpTemplateNameEdit->GetText(), ' ');
SelectCategoryHdl(*mpLBCategory);
}
IMPL_LINK_NOARG_TYPED(SfxSaveAsTemplateDialog, SelectCategoryHdl, ListBox&, void)
{
if(mpLBCategory->GetSelectEntryPos() == 0)
{
msSelectedCategory = OUString();
mpOKButton->Disable();
}
else
{
msSelectedCategory = mpLBCategory->GetSelectEntry();
mpOKButton->Enable(!msTemplateName.isEmpty());
}
}
void SfxSaveAsTemplateDialog::initialize()
{
sal_uInt16 nCount = mpDocTemplates->GetRegionCount();
for (sal_uInt16 i = 0; i < nCount; ++i)
{
OUString sCategoryName(mpDocTemplates->GetFullRegionName(i));
msCategories.push_back(sCategoryName);
}
}
void SfxSaveAsTemplateDialog::SetCategoryLBEntries(std::vector<OUString> aFolderNames)
{
mpLBCategory->InsertEntry(OUString("None"), 0);
if (!aFolderNames.empty())
{
for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
mpLBCategory->InsertEntry(aFolderNames[i], i+1);
}
mpLBCategory->SelectEntryPos(0);
}
bool SfxSaveAsTemplateDialog::IsTemplateNameUnique()
{
std::vector<OUString>::iterator it;
it=find(msCategories.begin(), msCategories.end(), msSelectedCategory);
mnRegionPos = std::distance(msCategories.begin(), it);
sal_uInt16 nEntries = mpDocTemplates->GetCount(mnRegionPos);
for(sal_uInt16 i = 0; i < nEntries; i++)
{
OUString aName = mpDocTemplates->GetName(mnRegionPos, i);
if(aName == msTemplateName)
return false;
}
return true;
}
bool SfxSaveAsTemplateDialog::SaveTemplate()
{
uno::Reference< frame::XStorable > xStorable(m_xModel, uno::UNO_QUERY_THROW );
uno::Reference< frame::XDocumentTemplates > xTemplates(frame::DocumentTemplates::create(comphelper::getProcessComponentContext()) );
if (!xTemplates->storeTemplate( msSelectedCategory, msTemplateName, xStorable ))
return false;
sal_uInt16 nDocId = mpDocTemplates->GetCount(mnRegionPos);
OUString sURL = mpDocTemplates->GetTemplateTargetURLFromComponent(msSelectedCategory, msTemplateName);
if(!mpDocTemplates->InsertTemplate( mnRegionPos, nDocId, msTemplateName, sURL))
return false;
return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
......@@ -12,6 +12,9 @@
#include <sfx2/thumbnailview.hxx>
class TemplateViewItem;
class PopupMenu;
class TemplateSearchView : public ThumbnailView
{
public:
......@@ -20,6 +23,18 @@ public:
void setOpenTemplateHdl (const Link<ThumbnailViewItem*, void> &rLink);
DECL_LINK_TYPED(ContextMenuSelectHdl, Menu*, bool);
void setRightClickHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setEditTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setDeleteTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void setDefaultTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
void createContextMenu();
void AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionId, sal_uInt16 nIdx,
const OUString &rTitle, const OUString &rSubtitle,
const OUString &rPath, const BitmapEx &rImage );
......@@ -27,8 +42,18 @@ public:
protected:
virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
protected:
TemplateViewItem *maSelectedItem;
Point maPosition;
Link<ThumbnailViewItem*, void> maOpenTemplateHdl;
Link<ThumbnailViewItem*, void> maRightClickHdl;
Link<ThumbnailViewItem*,void> maEditTemplateHdl;
Link<ThumbnailViewItem*,void> maDeleteTemplateHdl;
Link<ThumbnailViewItem*,void> maDefaultTemplateHdl;
};
#endif // INCLUDED_SFX2_SOURCE_INC_TEMPLATESEARCHVIEW_HXX
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.6"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="SaveAsTemplateDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Save As Template</property>
<property name="modal">True</property>
<property name="type_hint">normal</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">6</property>
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="create_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Enter Template Name</property>
<attributes>
<attribute name="weight" value="normal"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="name_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="select_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select Template Category</property>
<attributes>
<attribute name="weight" value="normal"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="categorylb">
<property name="width_request">250</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">help</action-widget>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
</action-widgets>
</object>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.6"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="TemplatesCategoryDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes">Select Category</property>
<property name="modal">True</property>
<property name="type_hint">normal</property>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">6</property>
<property name="row_spacing">12</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="select_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select from Existing Category</property>
<attributes>
<attribute name="weight" value="normal"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="categorylb">
<property name="width_request">250</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="create_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">or Create a New Category</property>
<attributes>
<attribute name="weight" value="normal"/>
</attributes>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="category_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="0">help</action-widget>
<action-widget response="0">ok</action-widget>
<action-widget response="0">cancel</action-widget>
</action-widgets>
</object>
</interface>
This diff is collapsed.
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