Improve Impress Template Selection Dialog
1. Hide controls: export, move, action menu, repository menu, Online Button 2. Checkbox to easily hide the dialog Change-Id: Id2899edb9ba280c9a714d09fa534f975600b05af Reviewed-on: https://gerrit.libreoffice.org/25913 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
committed by
Samuel Mehrbrodt
parent
1efbab1eb4
commit
ecece54942
@@ -149,6 +149,7 @@ protected:
|
||||
VclPtr<PushButton> mpExportButton;
|
||||
VclPtr<PushButton> mpImportButton;
|
||||
VclPtr<PushButton> mpLinkButton;
|
||||
VclPtr<CheckBox> mpCBXHideDlg;
|
||||
VclPtr<ToolBox> mpActionBar;
|
||||
VclPtr<TemplateSearchView> mpSearchView;
|
||||
VclPtr<TemplateAbstractView> mpCurView;
|
||||
@@ -222,9 +223,11 @@ public:
|
||||
virtual short Execute() override;
|
||||
|
||||
inline OUString const & getTemplatePath() const { return msTemplatePath; };
|
||||
inline bool IsStartWithTemplate() const { return mpCBXHideDlg->IsChecked(); };
|
||||
|
||||
private:
|
||||
DECL_LINK_TYPED(OpenTemplateHdl, ThumbnailViewItem*, void);
|
||||
DECL_LINK_TYPED(OkClickHdl, Button*, void);
|
||||
|
||||
OUString msTemplatePath;
|
||||
};
|
||||
|
@@ -559,6 +559,9 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
|
||||
ScopedVclPtrInstance< SfxTemplateSelectionDlg > aTemplDlg;
|
||||
aTemplDlg->Execute();
|
||||
|
||||
//check to disable the dialog
|
||||
pOpt->SetStartWithTemplate( aTemplDlg->IsStartWithTemplate() );
|
||||
|
||||
//pFrame is loaded with the desired template
|
||||
if(!aTemplDlg->getTemplatePath().isEmpty())
|
||||
pFrame = CreateFromTemplate(aTemplDlg->getTemplatePath(), xTargetFrame);
|
||||
|
@@ -123,6 +123,7 @@
|
||||
#define STR_CREATE_ERROR (RID_SFX_DOC_START+103)
|
||||
#define STR_ERROR_SAVEAS (RID_SFX_DOC_START+105)
|
||||
#define STR_CATEGORY_RENAME (RID_SFX_DOC_START+109)
|
||||
#define STR_TEMPLATE_SELECTION (RID_SFX_DOC_START+120)
|
||||
|
||||
// please update to the last id
|
||||
#define ACT_SFX_DOC_END IMG_ACTION_REFRESH
|
||||
|
@@ -80,6 +80,10 @@ String STR_RENAME_TEMPLATE
|
||||
{
|
||||
Text [ en-US ] = "Enter New Name: " ;
|
||||
};
|
||||
String STR_TEMPLATE_SELECTION
|
||||
{
|
||||
Text [ en-US ] = "Select a Template" ;
|
||||
};
|
||||
String STR_AUTOMATICVERSION
|
||||
{
|
||||
Text [ en-US ] = "Automatically saved version" ;
|
||||
|
@@ -179,6 +179,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent)
|
||||
get(mpExportButton, "export_btn");
|
||||
get(mpImportButton, "import_btn");
|
||||
get(mpLinkButton, "online_link");
|
||||
get(mpCBXHideDlg, "hidedialogcb");
|
||||
|
||||
// Create popup menus
|
||||
mpActionMenu = new PopupMenu;
|
||||
@@ -326,6 +327,7 @@ void SfxTemplateManagerDlg::dispose()
|
||||
mpExportButton.clear();
|
||||
mpImportButton.clear();
|
||||
mpLinkButton.clear();
|
||||
mpCBXHideDlg.clear();
|
||||
mpSearchFilter.clear();
|
||||
mpCBApp.clear();
|
||||
mpCBFolder.clear();
|
||||
@@ -1646,8 +1648,8 @@ SfxTemplateSelectionDlg::SfxTemplateSelectionDlg(vcl::Window* pParent):
|
||||
msTemplatePath(OUString())
|
||||
{
|
||||
mpCBApp->SelectEntryPos(MNI_IMPRESS);
|
||||
mpCBApp->Disable();
|
||||
mpCBFolder->SelectEntryPos(0);
|
||||
SetText(SfxResId(STR_TEMPLATE_SELECTION).toString());
|
||||
|
||||
if(mpLocalView->IsVisible())
|
||||
{
|
||||
@@ -1655,8 +1657,17 @@ SfxTemplateSelectionDlg::SfxTemplateSelectionDlg(vcl::Window* pParent):
|
||||
mpLocalView->showAllTemplates();
|
||||
}
|
||||
|
||||
mpCBApp->Disable();
|
||||
mpActionBar->Hide();
|
||||
mpLinkButton->Hide();
|
||||
mpMoveButton->Hide();
|
||||
mpExportButton->Hide();
|
||||
mpCBXHideDlg->Show();
|
||||
mpCBXHideDlg->Check(true);
|
||||
|
||||
mpLocalView->setOpenTemplateHdl(LINK(this,SfxTemplateSelectionDlg, OpenTemplateHdl));
|
||||
mpSearchView->setOpenTemplateHdl(LINK(this,SfxTemplateSelectionDlg, OpenTemplateHdl));
|
||||
mpOKButton->SetClickHdl(LINK(this, SfxTemplateSelectionDlg, OkClickHdl));
|
||||
}
|
||||
|
||||
SfxTemplateSelectionDlg::~SfxTemplateSelectionDlg()
|
||||
@@ -1682,4 +1693,12 @@ IMPL_LINK_TYPED(SfxTemplateSelectionDlg, OpenTemplateHdl, ThumbnailViewItem*, pI
|
||||
EndDialog(RET_OK);
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG_TYPED(SfxTemplateSelectionDlg, OkClickHdl, Button*, void)
|
||||
{
|
||||
TemplateViewItem *pViewItem = static_cast<TemplateViewItem*>(const_cast<ThumbnailViewItem*>(*maSelTemplates.begin()));
|
||||
msTemplatePath = pViewItem->getPath();
|
||||
|
||||
EndDialog(RET_OK);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -330,7 +330,7 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -347,7 +347,21 @@
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="hidedialogcb">
|
||||
<property name="label" translatable="yes">Show this dialog at startup</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
Reference in New Issue
Block a user