diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-06-05 05:38:13 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-06-06 09:52:33 +0000 |
commit | ecece54942a8e5f20ae6dc69f25a2499d38c78bd (patch) | |
tree | fd7854f40c81cf0d0a2f51c2e3a64ae54ef22bb0 | |
parent | 1efbab1eb4e01ae3116301df861067a2e488c717 (diff) |
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>
-rw-r--r-- | include/sfx2/templatedlg.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/doc.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/doc/doc.src | 4 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 21 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/templatedlg.ui | 18 |
6 files changed, 47 insertions, 3 deletions
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx index 9dadcf837fa4..3affc1b79b93 100644 --- a/include/sfx2/templatedlg.hxx +++ b/include/sfx2/templatedlg.hxx @@ -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; }; diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index 2bb372a8756a..1e5dab96762a 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -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); diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index 10877ab1cc8d..c802ccc7fce6 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -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 diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index ed7f8db4a52e..84c94560e48d 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -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" ; diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index db75aa7e8343..9ba3b7cd75d7 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -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: */ diff --git a/sfx2/uiconfig/ui/templatedlg.ui b/sfx2/uiconfig/ui/templatedlg.ui index ca7134ec91d4..4c7bdf0741e4 100644 --- a/sfx2/uiconfig/ui/templatedlg.ui +++ b/sfx2/uiconfig/ui/templatedlg.ui @@ -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> |