summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfe Gürkan YALAMAN <efeyalaman@gmail.com>2014-06-14 04:02:19 +0300
committerJan Holesovsky <kendy@collabora.com>2014-08-14 22:20:25 +0200
commitc1f1593014304939f6d0952e2199b568884dc562 (patch)
tree282b3cee4a79ce9f4897dcbbb7645fcf41b946c4
parent9a4d86a0fd65876d5d456088bb6abbe047d9893a (diff)
Initial TemplateBar moved from TemplateManager
Change-Id: I335e69de31bd64e7c4504a58d7652f755491af33
-rw-r--r--sfx2/source/dialog/backingwindow.cxx37
-rw-r--r--sfx2/source/dialog/backingwindow.hxx5
-rw-r--r--sfx2/uiconfig/ui/startcenter.ui242
3 files changed, 228 insertions, 56 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 5026b936a166..1aaefe49c511 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -71,6 +71,15 @@ const char TEMPLATE_URL[] = "slot:5500";
const char OPEN_URL[] = ".uno:Open";
const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess";
+const char TEMPLATEBAR_SAVE[] = "template_save";
+const char TEMPLATEBAR_OPEN[] = "open";
+const char TEMPLATEBAR_EDIT[] = "edit";
+const char TEMPLATEBAR_PROPERTIES[] = "properties";
+const char TEMPLATEBAR_DEFAULT[] = "default";
+const char TEMPLATEBAR_MOVE[] = "move";
+const char TEMPLATEBAR_EXPORT[] = "export";
+const char TEMPLATEBAR_DELETE[] = "template_delete";
+
float fMultiplier = 1.4f;
const Color aButtonsBackground(114, 168, 84); // TDF green
const Color aButtonsText(COL_WHITE);
@@ -116,6 +125,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
get(mpExtensionsButton, "extensions");
get(mpViewBar, "action_view");
+ get(mpTemplateBar, "action_templates");
//Containers are invisible to cursor traversal
//So on pressing "right" when in Help the
@@ -276,6 +286,11 @@ void BackingWindow::initControls()
//mpViewBar->SetDropdownClickHdl(LINK(this,BackingWindow,TBXDropdownHdl));
mpViewBar->Hide();
+ mpTemplateBar->SetButtonType(BUTTON_SYMBOLTEXT);
+ mpTemplateBar->SetItemBits(mpTemplateBar->GetItemId(TEMPLATEBAR_MOVE), TIB_DROPDOWNONLY);
+ mpTemplateBar->SetClickHdl( LINK( this, BackingWindow,TBXTemplateHdl ) );
+ //mpTemplateBar->SetDropdownClickHdl(LINK(this, BackingWindow,TBXDropdownHdl));
+
//set handlers
mpLocalView->setItemStateHdl(LINK(this, BackingWindow, TVItemStateHdl));
mpLocalView->setOpenRegionHdl(LINK(this, BackingWindow, OpenRegionHdl));
@@ -795,6 +810,28 @@ IMPL_LINK_NOARG(BackingWindow,TBXViewHdl)
return 0;
}
+//FIXME: Implement OnSomething() methods
+IMPL_LINK_NOARG(BackingWindow,TBXTemplateHdl)
+{
+ //const size_t nCurItemId = mpTemplateBar->GetCurItemId();
+
+ //if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_OPEN))
+ //OnTemplateOpen();
+ //else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_EDIT))
+ //OnTemplateEdit();
+ //else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_PROPERTIES))
+ //OnTemplateProperties();
+ //else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_DELETE))
+ //OnTemplateDelete();
+ //else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_DEFAULT))
+ //OnTemplateAsDefault();
+ //else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_EXPORT))
+ //OnTemplateExport();
+
+ return 0;
+}
+
+
IMPL_LINK(BackingWindow, TVItemStateHdl, const ThumbnailViewItem*, pItem)
{
const TemplateContainerItem *pCntItem = dynamic_cast<const TemplateContainerItem*>(pItem);
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index 743954cac2ec..f46596f00002 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -86,6 +86,7 @@ class BackingWindow
TemplateAbstractView* mpCurrentView;
ToolBox* mpViewBar;
+ ToolBox* mpTemplateBar;
std::vector<Window*> maDndWindows;
@@ -97,11 +98,10 @@ class BackingWindow
svt::AcceleratorExecute* mpAccExec;
void setupButton( PushButton* pButton );
+ //Template Manager
void OnTemplateImport ();
-
void OnFolderNew ();
void OnFolderDelete ();
-
void OnRegionState (const ThumbnailViewItem *pItem);
void dispatchURL( const OUString& i_rURL,
@@ -117,6 +117,7 @@ class BackingWindow
DECL_LINK(ExtLinkClickHdl, Button*);
DECL_LINK(OpenRegionHdl, void*);
DECL_LINK(TBXViewHdl, void*);
+ DECL_LINK(TBXTemplateHdl, void*);
DECL_LINK(TVItemStateHdl, const ThumbnailViewItem*);
void initControls();
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 20136945b661..63d6cfb95d33 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Sun Jun 1 16:42:18 2014 -->
+<!-- Generated with glade 3.16.0 on Sat Jun 14 02:47:36 2014 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires LibreOffice 1.0 -->
@@ -388,75 +388,209 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkToolbar" id="action_view">
+ <object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
- <object class="GtkToolButton" id="repository">
+ <object class="GtkToolbar" id="action_view">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="action_name">repository</property>
- <property name="label" translatable="yes">Repository</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sfx2/imglst/actionview026.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="import">
- <property name="can_focus">False</property>
- <property name="action_name">import</property>
- <property name="label" translatable="yes">Import</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sfx2/imglst/actionview010.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="delete">
- <property name="can_focus">False</property>
- <property name="action_name">delete</property>
- <property name="label" translatable="yes">Delete</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sfx2/imglst/actionview025.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkToolButton" id="save">
- <property name="can_focus">False</property>
- <property name="action_name">save</property>
- <property name="label" translatable="yes">Save</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sfx2/imglst/actionview028.png</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkToolButton" id="repository">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">repository</property>
+ <property name="label" translatable="yes">Repository</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview026.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="import">
+ <property name="can_focus">False</property>
+ <property name="action_name">import</property>
+ <property name="label" translatable="yes">Import</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview010.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="delete">
+ <property name="can_focus">False</property>
+ <property name="action_name">delete</property>
+ <property name="label" translatable="yes">Delete</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview025.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="save">
+ <property name="can_focus">False</property>
+ <property name="action_name">save</property>
+ <property name="label" translatable="yes">Save</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview028.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="new_folder">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">new_folder</property>
+ <property name="label" translatable="yes">New Folder</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview029.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="new_folder">
- <property name="visible">True</property>
+ <object class="GtkToolbar" id="action_templates">
<property name="can_focus">False</property>
- <property name="action_name">new_folder</property>
- <property name="label" translatable="yes">New Folder</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sfx2/imglst/actionview029.png</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkToolButton" id="template_save">
+ <property name="can_focus">False</property>
+ <property name="action_name">template_save</property>
+ <property name="label" translatable="yes">Save</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview028.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="open">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">open</property>
+ <property name="label" translatable="yes">Open</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actionview030.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="edit">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">edit</property>
+ <property name="label" translatable="yes">Edit</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actiontemplates019.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="properties">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">properties</property>
+ <property name="label" translatable="yes">Properties</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actiontemplates016.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="default">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">default</property>
+ <property name="label" translatable="yes">Set as Default</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actiontemplates015.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="move">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">move</property>
+ <property name="label" translatable="yes">Move to Folder</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actiontemplates017.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="export">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">export</property>
+ <property name="label" translatable="yes">Export</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actiontemplates020.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolButton" id="template_delete">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="action_name">template_delete</property>
+ <property name="label" translatable="yes">Delete</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">sfx2/imglst/actiontemplates018.png</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>