summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-07-13 21:31:48 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-07-15 08:15:15 -0430
commite64f770707b3e677d0ba337b1b0d35937a691882 (patch)
tree030a67f31ffacddd91c19f9b9eb4bc3c6b7d2ab8 /sfx2
parent63cddab83b1217845c57e37a6e8d3a9a28adc6e3 (diff)
Switch main view between local/online repository.
Change-Id: If2f5f53991271fc05453c44fa422aba7c14d0e16
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/templatedlg.hxx5
-rw-r--r--sfx2/source/doc/templatedlg.cxx31
2 files changed, 36 insertions, 0 deletions
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 435b43665335..307922d68092 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -18,6 +18,7 @@
class Edit;
class PopupMenu;
class TemplateFolderView;
+class TemplateOnlineView;
class TemplateSearchView;
class ThumbnailView;
class ThumbnailViewItem;
@@ -76,6 +77,9 @@ private:
void centerTopButtons ();
+ // Exchange view between local/online view.
+ void switchMainView (bool bDisplayLocal);
+
private:
PushButton aButtonAll;
@@ -92,6 +96,7 @@ private:
ToolBox *mpTemplateBar;
TemplateSearchView *mpSearchView;
TemplateFolderView *maView;
+ TemplateOnlineView *mpOnlineView;
PopupMenu *mpCreateMenu;
PopupMenu *mpActionMenu;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index de48d5745163..a2359cc79aed 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -17,6 +17,7 @@
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatefolderview.hxx>
#include <sfx2/templatefolderviewitem.hxx>
+#include <sfx2/templateonlineview.hxx>
#include <sfx2/templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
#include <tools/urlobj.hxx>
@@ -97,6 +98,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpTemplateBar( new ToolBox(this, SfxResId(TBX_ACTION_TEMPLATES))),
mpSearchView(new TemplateSearchView(this)),
maView(new TemplateFolderView(this,SfxResId(TEMPLATE_VIEW))),
+ mpOnlineView(new TemplateOnlineView(this, WB_VSCROLL,false)),
mnSelectionCount(0),
mxDesktop(comphelper::getProcessServiceFactory()->createInstance( "com.sun.star.frame.Desktop" ),uno::UNO_QUERY )
{
@@ -221,6 +223,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
mpViewBar->Show();
mpActionBar->Show();
+ switchMainView(true);
+
maView->Populate();
maView->Show();
@@ -235,6 +239,7 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg ()
delete mpTemplateBar;
delete mpSearchView;
delete maView;
+ delete mpOnlineView;
delete mpCreateMenu;
delete mpActionMenu;
}
@@ -313,6 +318,12 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXViewHdl)
case TBI_TEMPLATE_FOLDER_DEL:
OnFolderDelete();
break;
+ case TBI_TEMPLATE_LOCAL:
+ switchMainView(true);
+ break;
+ case TBI_TEMPLATE_ONLINE:
+ switchMainView(false);
+ break;
default:
break;
}
@@ -814,6 +825,26 @@ void SfxTemplateManagerDlg::centerTopButtons()
maButtonSelMode.SetPosPixel(aBtnPos);
}
+void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
+{
+ if (bDisplayLocal)
+ {
+ mpViewBar->ShowItem(TBI_TEMPLATE_ONLINE);
+ mpViewBar->HideItem(TBI_TEMPLATE_LOCAL);
+
+ mpOnlineView->Hide();
+ maView->Show();
+ }
+ else
+ {
+ mpViewBar->ShowItem(TBI_TEMPLATE_LOCAL);
+ mpViewBar->HideItem(TBI_TEMPLATE_ONLINE);
+
+ maView->Hide();
+ mpOnlineView->Show();
+ }
+}
+
void lcl_createTemplate(uno::Reference< com::sun::star::frame::XComponentLoader > xDesktop,
const FILTER_APPLICATION eApp)
{