[Libreoffice-commits] core.git: 7 commits - extras/source icon-themes/galaxy include/sfx2 sfx2/source sfx2/uiconfig
Jan Holesovsky
kendy at suse.cz
Tue Aug 13 09:35:45 PDT 2013
extras/source/glade/libreoffice-catalog.xml.in | 5
icon-themes/galaxy/sfx2/res/startcenter-logo.png |binary
include/sfx2/recentdocsview.hxx | 31 -
include/sfx2/sfx.hrc | 8
sfx2/source/appl/sfx.src | 35 +
sfx2/source/control/recentdocsview.cxx | 101 +++
sfx2/source/control/recentdocsviewitem.cxx | 16
sfx2/source/dialog/backingwindow.cxx | 264 +--------
sfx2/source/dialog/backingwindow.hxx | 41 -
sfx2/uiconfig/ui/startcenter.ui | 617 ++++++++++++++++++-----
10 files changed, 700 insertions(+), 418 deletions(-)
New commits:
commit 2a7fe0667062506a21f1fc274da9dad62e28cc43
Author: Jan Holesovsky <kendy at suse.cz>
Date: Tue Aug 13 18:33:22 2013 +0200
startcenter: Logo, more space, and a little cleanup.
Change-Id: Ie732628fefb721cd4fa69a8d1b38c15ec40c6761
diff --git a/icon-themes/galaxy/sfx2/res/startcenter-logo.png b/icon-themes/galaxy/sfx2/res/startcenter-logo.png
new file mode 100644
index 0000000..f94ad94
Binary files /dev/null and b/icon-themes/galaxy/sfx2/res/startcenter-logo.png differ
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 996824d..a60cd52 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -1,17 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
<object class="GtkImage" id="add_temp_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">framework/res/addtemplate_32.png</property>
</object>
+ <object class="GtkImage" id="calc_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/ods_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="database_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odb_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="draw_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odg_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="extension_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/extension.png</property>
+ </object>
+ <object class="GtkImage" id="impress_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odp_32_8.png</property>
+ </object>
<object class="GtkBox" id="StartCenter">
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border_width">36</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
@@ -22,31 +53,33 @@
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
<child>
- <object class="GtkLabel" id="label8">
+ <object class="sfxlo-RecentDocsView" id="all_recent">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="sfxlo-RecentDocsView" id="all_recent">
+ <object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
- <property name="hexpand">True</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -67,6 +100,9 @@
<object class="GtkGrid" id="grid4">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid5">
<property name="visible">True</property>
@@ -95,30 +131,15 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="sfxlo-RecentDocsView" id="writer_recent">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="vexpand">True</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -143,6 +164,9 @@
<object class="GtkGrid" id="grid6">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid7">
<property name="visible">True</property>
@@ -171,30 +195,15 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="sfxlo-RecentDocsView" id="calc_recent">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -219,6 +228,9 @@
<object class="GtkGrid" id="grid8">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid9">
<property name="visible">True</property>
@@ -247,30 +259,15 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="sfxlo-RecentDocsView" id="impress_recent">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -295,6 +292,9 @@
<object class="GtkGrid" id="grid10">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid11">
<property name="visible">True</property>
@@ -323,30 +323,15 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="sfxlo-RecentDocsView" id="draw_recent">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -371,6 +356,9 @@
<object class="GtkGrid" id="grid12">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid13">
<property name="visible">True</property>
@@ -399,30 +387,15 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="sfxlo-RecentDocsView" id="database_recent">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -447,6 +420,9 @@
<object class="GtkGrid" id="grid14">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="border_width">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkGrid" id="grid15">
<property name="visible">True</property>
@@ -475,30 +451,15 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recent</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="sfxlo-RecentDocsView" id="math_recent">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -532,6 +493,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkButton" id="open">
@@ -572,72 +535,65 @@
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid16">
+ <object class="GtkGrid" id="grid17">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="label15">
+ <object class="GtkButton" id="info">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">LibreOffice</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Get more information about %PRODUCTNAME</property>
+ <property name="image">info_image</property>
+ <property name="relief">none</property>
</object>
<packing>
- <property name="left_attach">0</property>
+ <property name="left_attach">4</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="extension">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Add new features to %PRODUCTNAME</property>
+ <property name="image">extension_image</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid17">
+ <object class="GtkButton" id="add_temp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Get more templates for %PRODUCTNAME</property>
+ <property name="image">add_temp_image</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">end</property>
- <child>
- <object class="GtkButton" id="extension">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">extension_image</property>
- <property name="relief">none</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="info">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">info_image</property>
- <property name="relief">none</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="add_temp">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">add_temp_image</property>
- <property name="relief">none</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -646,6 +602,19 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">sfx2/res/startcenter-logo.png</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -662,31 +631,6 @@
</packing>
</child>
</object>
- <object class="GtkImage" id="calc_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/ods_32_8.png</property>
- </object>
- <object class="GtkImage" id="database_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odb_32_8.png</property>
- </object>
- <object class="GtkImage" id="draw_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odg_32_8.png</property>
- </object>
- <object class="GtkImage" id="extension_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">framework/res/extension.png</property>
- </object>
- <object class="GtkImage" id="impress_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odp_32_8.png</property>
- </object>
<object class="GtkImage" id="info_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
commit 844b95607552e948ef64d1c68d9f49684c9ea105
Author: Jan Holesovsky <kendy at suse.cz>
Date: Tue Aug 13 18:32:05 2013 +0200
Add RecentDocsView to the glade catalog.
Change-Id: Ife46af4db6b20f166419c5bfc1ff44077926c60d
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index d6c209b..6ff3b4c 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -448,5 +448,10 @@
<glade-widget-class title="Tab Stop Images" name="cuilo-TabWin_Impl"
generic-name="TabWin_Impl" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/>
+
+ <glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView"
+ generic-name="Icon View" parent="GtkIconView"
+ icon-name="widget-gtk-iconview"/>
+
</glade-widget-classes>
</glade-catalog>
commit fdaaf74a8be430805d0e596296634f6fc5cae33d
Author: Krisztian Pinter <pin.terminator at gmail.com>
Date: Sun Aug 11 19:50:12 2013 +0200
startcenter: Add new Start Center
Change-Id: I8d4308296fd170f7df60db8eddc51909af482d02
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 8d6781a..61573a8 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -38,7 +38,6 @@
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
-#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
@@ -61,18 +60,6 @@ const int nItemId_Extensions = 1;
const int nItemId_Info = 3;
const int nItemId_TplRep = 4;
-const int nShadowTop = 30;
-const int nShadowLeft = 30;
-const int nShadowRight = 30;
-const int nShadowBottom = 30;
-
-const int nPaddingTop = 30;
-const int nPaddingLeft = 50;
-const int nPaddingRight = 50;
-const int nPaddingBottom = 30;
-
-const int nLogoHeight = 150;
-
BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent ),
mbInitControls( false ),
@@ -82,20 +69,44 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
"sfx/ui/startcenter.ui",
"StartCenter" );
+
+ get(mpOpenButton, "open");
+ get(mpTemplateButton, "templates");
+
get(mpWriterButton, "writer");
get(mpCalcButton, "calc");
get(mpImpressButton, "impress");
- get(mpOpenButton, "open");
get(mpDrawButton, "draw");
get(mpDBButton, "database");
get(mpMathButton, "math");
- get(mpTemplateButton, "templates");
get(mpExtensionsButton, "extension");
get(mpInfoButton, "info");
get(mpTplRepButton, "add_temp");
- get(mpStartCenterContainer, "sccontainer");
+
+ get( mpAllRecentThumbnails, "all_recent");
+ get( mpWriterRecentThumbnails, "writer_recent");
+ get( mpCalcRecentThumbnails, "calc_recent");
+ get( mpImpressRecentThumbnails, "impress_recent");
+ get( mpDrawRecentThumbnails, "draw_recent");
+ get( mpDatabaseRecentThumbnails, "database_recent");
+ get( mpMathRecentThumbnails, "math_recent");
+
+ mpWriterRecentThumbnails ->SetFilter(FILTER_WRITER);
+ mpCalcRecentThumbnails ->SetFilter(FILTER_CALC);
+ mpImpressRecentThumbnails ->SetFilter(FILTER_IMPRESS);
+ mpDrawRecentThumbnails ->SetFilter(FILTER_DRAW);
+ mpDatabaseRecentThumbnails ->SetFilter(FILTER_DATABASE);
+ mpMathRecentThumbnails ->SetFilter(FILTER_MATH);
+
+ mpAllRecentThumbnails ->loadRecentDocs();
+ mpWriterRecentThumbnails ->loadRecentDocs();
+ mpCalcRecentThumbnails ->loadRecentDocs();
+ mpImpressRecentThumbnails ->loadRecentDocs();
+ mpDrawRecentThumbnails ->loadRecentDocs();
+ mpDatabaseRecentThumbnails ->loadRecentDocs();
+ mpMathRecentThumbnails ->loadRecentDocs();
try
{
@@ -115,25 +126,12 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
Any value( xNameAccess->getByName("StartCenterHideExternalLinks") );
mnHideExternalLinks = value.get<sal_Int32>();
}
-
- mxPopupMenuFactory.set(
- frame::PopupMenuControllerFactory::create( mxContext ) );
- // TODO If there is no PopupMenuController, the button should be a nomral one not a MenuButton
- if ( mxPopupMenuFactory->hasController(
- OUString( RECENT_FILE_LIST ) , OUString("com.sun.star.frame.StartModule") ) )
- {
- mxPopupMenu.set( mxContext->getServiceManager()->createInstanceWithContext(
- OUString( "com.sun.star.awt.PopupMenu" ), mxContext ), uno::UNO_QUERY_THROW );
- }
}
catch (const Exception& e)
{
SAL_WARN( "fwk", "BackingWindow - caught an exception! " << e.Message );
}
- // clean up resource stack
- //FreeResource();
-
// fdo#34392: we do the layout dynamically, the layout depends on the font,
// so we should handle data changed events (font changing) of the last child
// control, at this point all the controls have updated settings (i.e. font).
@@ -146,41 +144,27 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
Reference<XDesktop2> xDesktop = Desktop::create( comphelper::getProcessComponentContext() );
mxDesktopDispatchProvider = xDesktop;
+ mpTemplateButton->SetHelpId( ".HelpId:StartCenter:TemplateButton" );
+ mpOpenButton->SetHelpId( ".HelpId:StartCenter:OpenButton" );
+
mpWriterButton->SetHelpId( ".HelpId:StartCenter:WriterButton" );
mpCalcButton->SetHelpId( ".HelpId:StartCenter:CalcButton" );
mpImpressButton->SetHelpId( ".HelpId:StartCenter:ImpressButton" );
mpDrawButton->SetHelpId( ".HelpId:StartCenter:DrawButton" );
mpDBButton->SetHelpId( ".HelpId:StartCenter:DBButton" );
mpMathButton->SetHelpId( ".HelpId:StartCenter:MathButton" );
- mpTemplateButton->SetHelpId( ".HelpId:StartCenter:TemplateButton" );
- mpOpenButton->SetHelpId( ".HelpId:StartCenter:OpenButton" );
+
mpExtensionsButton->SetHelpId( ".HelpId:StartCenter:Extensions" );
mpInfoButton->SetHelpId( ".HelpId:StartCenter:Info" );
mpTplRepButton->SetHelpId( ".HelpId:StartCenter:TemplateRepository" );
// init background
- initBackground();
+ SetBackground();
}
BackingWindow::~BackingWindow()
{
- if( mxPopupMenuController.is() )
- {
- Reference< lang::XComponent > xComponent( mxPopupMenuController, UNO_QUERY );
- if( xComponent.is() )
- {
- try
- {
- xComponent->dispose();
- }
- catch (...)
- {}
- }
- mxPopupMenuController.clear();
- }
- mxPopupMenuFactory.clear();
- mxPopupMenu.clear();
}
IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
@@ -192,7 +176,7 @@ IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
static_cast<DataChangedEvent*>( pWinEvent->GetData() );
if ( pDCEvt->GetFlags() & SETTINGS_STYLE )
{
- initBackground();
+ SetBackground();
Invalidate();
// fdo#34392: Resize buttons to match the new text size.
Resize();
@@ -201,80 +185,6 @@ IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
return 0;
}
-void BackingWindow::prepareRecentFileMenu()
-{
- if( ! mxPopupMenu.is() )
- return;
-
- if ( !mxPopupMenuController.is() )
- {
- uno::Sequence< uno::Any > aArgs( 2 );
- beans::PropertyValue aProp;
-
- aProp.Name = OUString( "Frame" );
- aProp.Value <<= mxFrame;
- aArgs[0] <<= aProp;
-
- aProp.Name = OUString( "ModuleIdentifier" );
- aProp.Value <<= OUString("com.sun.star.frame.StartModule");
- aArgs[1] <<= aProp;
- try
- {
- mxPopupMenuController.set(
- mxPopupMenuFactory->createInstanceWithArgumentsAndContext(
- OUString( RECENT_FILE_LIST ), aArgs, mxContext),
- uno::UNO_QUERY_THROW );
- mxPopupMenuController->setPopupMenu( mxPopupMenu );
- }
- catch ( const Exception &e )
- {
- SAL_WARN( "fwk", "BackingWindow - caught an exception! " << e.Message );
- }
-
- PopupMenu *pRecentMenu = NULL;
- VCLXMenu* pTKMenu = VCLXMenu::GetImplementation( mxPopupMenu );
- if ( pTKMenu )
- pRecentMenu = dynamic_cast< PopupMenu * >( pTKMenu->GetMenu() );
- mpOpenButton->SetPopupMenu( pRecentMenu );
- }
-}
-
-void BackingWindow::initBackground()
-{
- SetBackground();
-
- // scale middle segment
- Size aMiddleSize;
- if( !! maBackgroundMiddle )
- aMiddleSize = maBackgroundMiddle.GetSizePixel();
-
- // load middle segment
- Application::LoadBrandBitmap ("shell/backing_space", maBackgroundMiddle);
-
- // and scale it to previous size
- if( aMiddleSize.Width() && aMiddleSize.Height() )
- maBackgroundMiddle.Scale( aMiddleSize );
-
- if( GetSettings().GetLayoutRTL() )
- {
- // replace images by RTL versions
- Application::LoadBrandBitmap ("shell/backing_rtl_right", maBackgroundLeft);
- Application::LoadBrandBitmap ("shell/backing_rtl_left", maBackgroundRight);
- }
- else
- {
- Application::LoadBrandBitmap ("shell/backing_left", maBackgroundLeft);
- Application::LoadBrandBitmap ("shell/backing_right", maBackgroundRight);
- }
-
- mpOpenButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
- mpOpenButton->SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
-
- // this will be moved to somewhere saner later
- mnSCWidth = 780;
- mnSCHeight = maBackgroundLeft.GetSizePixel().Height();
-}
-
void BackingWindow::initControls()
{
if( mbInitControls )
@@ -364,10 +274,7 @@ void BackingWindow::Paint( const Rectangle& )
Wallpaper aBack( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor );
Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
- Rectangle aBmpRect(Point((GetOutputSizePixel().Width()-mnSCWidth)/2,
- (GetOutputSizePixel().Height()-mnSCHeight)/2),
- Size(mnSCWidth,mnSCHeight));
- aClip.Exclude( aBmpRect );
+ aClip.Exclude( maStartCentButtons );
Push( PUSH_CLIPREGION );
IntersectClipRegion( aClip );
@@ -376,28 +283,12 @@ void BackingWindow::Paint( const Rectangle& )
VirtualDevice aDev( *this );
aDev.EnableRTL( IsRTLEnabled() );
- aDev.SetOutputSizePixel( aBmpRect.GetSize() );
- Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft());
+ aDev.SetOutputSizePixel( maStartCentButtons.GetSize() );
+ Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft());
aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
- maBackgroundMiddle.Scale(
- Size(mnSCWidth - maBackgroundLeft.GetSizePixel().Width() - maBackgroundRight.GetSizePixel().Width(),
- maBackgroundMiddle.GetSizePixel().Height()),
- BMP_SCALE_FAST);
-
- // draw bitmap
- Point aTL( 0, 0 );
- aDev.DrawBitmapEx( aTL, maBackgroundLeft );
- aTL.X() += maBackgroundLeft.GetSizePixel().Width();
- if( !!maBackgroundMiddle )
- {
- aDev.DrawBitmapEx( aTL, maBackgroundMiddle );
- aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
- }
- aDev.DrawBitmapEx( aTL, maBackgroundRight );
-
- DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
- Point( 0, 0 ), aBmpRect.GetSize(),
+ DrawOutDev( maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(),
+ Point( 0, 0 ), maStartCentButtons.GetSize(),
aDev );
}
@@ -416,71 +307,6 @@ long BackingWindow::Notify( NotifyEvent& rNEvt )
const KeyCode& rKeyCode(pEvt->GetKeyCode());
if( pEvt && mpAccExec->execute(rKeyCode) )
return 1;
-
- // #i110344# extrawurst: specialized arrow key control
- if( rKeyCode.GetModifier() == 0 )
- {
- if( rKeyCode.GetCode() == KEY_RIGHT )
- {
- if( mpWriterButton->HasFocus() )
- mpDrawButton->GrabFocus();
- else if( mpCalcButton->HasFocus() )
- mpDBButton->GrabFocus();
- else if( mpImpressButton->HasFocus() )
- mpMathButton->GrabFocus();
- else if( mpOpenButton->HasFocus() )
- mpTemplateButton->GrabFocus();
- return 1;
- }
- else if( rKeyCode.GetCode() == KEY_LEFT )
- {
- if( mpDrawButton->HasFocus() )
- mpWriterButton->GrabFocus();
- else if( mpDBButton->HasFocus() )
- mpCalcButton->GrabFocus();
- else if( mpMathButton->HasFocus() )
- mpImpressButton->GrabFocus();
- else if( mpTemplateButton->HasFocus() )
- mpOpenButton->GrabFocus();
- return 1;
- }
- else if( rKeyCode.GetCode() == KEY_UP )
- {
- // first column
- if( mpOpenButton->HasFocus() )
- mpImpressButton->GrabFocus();
- else if( mpImpressButton->HasFocus() )
- mpCalcButton->GrabFocus();
- else if( mpCalcButton->HasFocus() )
- mpWriterButton->GrabFocus();
- // second column
- else if( mpTemplateButton->HasFocus() )
- mpMathButton->GrabFocus();
- else if( mpMathButton->HasFocus() )
- mpDBButton->GrabFocus();
- else if( mpDBButton->HasFocus() )
- mpDrawButton->GrabFocus();
- return 1;
- }
- else if( rKeyCode.GetCode() == KEY_DOWN )
- {
- // first column
- if( mpWriterButton->HasFocus() )
- mpCalcButton->GrabFocus();
- else if( mpCalcButton->HasFocus() )
- mpImpressButton->GrabFocus();
- else if( mpImpressButton->HasFocus() )
- mpOpenButton->GrabFocus();
- // second column
- else if( mpDrawButton->HasFocus() )
- mpDBButton->GrabFocus();
- else if( mpDBButton->HasFocus() )
- mpMathButton->GrabFocus();
- else if( mpMathButton->HasFocus() )
- mpTemplateButton->GrabFocus();
- return 1;
- }
- }
}
return Window::Notify( rNEvt );
@@ -495,11 +321,8 @@ void BackingWindow::setOwningFrame( const com::sun::star::uno::Reference< com::s
void BackingWindow::Resize()
{
- maStartCentButtons = Rectangle(
- Point((GetOutputSizePixel().Width()-mnSCWidth)/2 + nShadowTop + nPaddingTop,
- (GetOutputSizePixel().Height()-mnSCHeight)/2 + nShadowLeft + nPaddingLeft + nLogoHeight),
- Size(mnSCWidth - nShadowLeft - nShadowRight - nPaddingLeft - nPaddingRight,
- mnSCHeight - nShadowTop - nShadowBottom - nPaddingTop - nPaddingBottom - nLogoHeight));
+ maStartCentButtons = Rectangle( Point(0, 0), GetOutputSizePixel() );
+
if (isLayoutEnabled(this))
VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD),
maStartCentButtons.TopLeft(), maStartCentButtons.GetSize());
@@ -594,13 +417,6 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
return 0;
}
-IMPL_LINK( BackingWindow, ActivateHdl, Button*, pButton )
-{
- if( pButton == mpOpenButton )
- prepareRecentFileMenu();
- return 0;
-}
-
struct ImplDelayedDispatch
{
Reference< XDispatch > xDispatch;
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index 287a777..99ba9e1 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -24,35 +24,20 @@
#include <vcl/builder.hxx>
#include <vcl/button.hxx>
-#include <vcl/menubtn.hxx>
-#include <vcl/bitmapex.hxx>
-#include <vcl/toolbox.hxx>
#include <vcl/layout.hxx>
+#include <sfx2/recentdocsview.hxx>
+
#include <svtools/acceleratorexecute.hxx>
#include <unotools/moduleoptions.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/frame/XUIControllerFactory.hpp>
-#include <com/sun/star/frame/XPopupMenuController.hpp>
-#include <com/sun/star/awt/XPopupMenu.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XTerminateListener.hpp>
-#include <com/sun/star/document/XEventListener.hpp>
-#include <com/sun/star/document/XEventBroadcaster.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
-#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <set>
-class MnemonicGenerator;
-
class BackingWindow
: public Window
, public VclBuilderContainer
@@ -60,24 +45,28 @@ class BackingWindow
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider > mxDesktopDispatchProvider;
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> mxFrame;
- com::sun::star::uno::Reference< com::sun::star::frame::XUIControllerFactory > mxPopupMenuFactory;
- com::sun::star::uno::Reference< com::sun::star::frame::XPopupMenuController > mxPopupMenuController;
- com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu > mxPopupMenu;
+
+ PushButton* mpOpenButton;
+ PushButton* mpTemplateButton;
PushButton* mpWriterButton;
PushButton* mpCalcButton;
PushButton* mpImpressButton;
- MenuButton* mpOpenButton;
PushButton* mpDrawButton;
PushButton* mpDBButton;
PushButton* mpMathButton;
- PushButton* mpTemplateButton;
PushButton* mpExtensionsButton;
PushButton* mpInfoButton;
PushButton* mpTplRepButton;
- VclGrid* mpStartCenterContainer;
+ RecentDocsView* mpAllRecentThumbnails;
+ RecentDocsView* mpWriterRecentThumbnails;
+ RecentDocsView* mpCalcRecentThumbnails;
+ RecentDocsView* mpImpressRecentThumbnails;
+ RecentDocsView* mpDrawRecentThumbnails;
+ RecentDocsView* mpDatabaseRecentThumbnails;
+ RecentDocsView* mpMathRecentThumbnails;
BitmapEx maBackgroundLeft;
BitmapEx maBackgroundMiddle;
@@ -89,9 +78,6 @@ class BackingWindow
sal_Int32 mnHideExternalLinks;
svt::AcceleratorExecute* mpAccExec;
- int mnSCWidth;
- int mnSCHeight;
-
void setupButton( PushButton* pButton, const OUString& rURL, const std::set<OUString>& rURLS,
SvtModuleOptions& rOpt, SvtModuleOptions::EModule eMod );
@@ -105,12 +91,9 @@ class BackingWindow
DECL_LINK( ClickHdl, Button* );
DECL_LINK( ExtLinkClickHdl, Button* );
- DECL_LINK( ActivateHdl, Button* );
DECL_LINK( WindowEventListener, VclSimpleEvent* );
void initControls();
- void initBackground();
- void prepareRecentFileMenu();
public:
BackingWindow( Window* pParent );
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 33c6e17..996824d 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -6,279 +6,580 @@
<property name="can_focus">False</property>
<property name="pixbuf">framework/res/addtemplate_32.png</property>
</object>
- <object class="GtkImage" id="calc_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/ods_32_8.png</property>
- </object>
- <object class="GtkImage" id="database_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odb_32_8.png</property>
- </object>
- <object class="GtkImage" id="draw_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odg_32_8.png</property>
- </object>
- <object class="GtkImage" id="extension_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">framework/res/extension.png</property>
- </object>
- <object class="GtkImage" id="info_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">framework/res/info_26.png</property>
- </object>
- <object class="GtkImage" id="impress_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odp_32_8.png</property>
- </object>
- <object class="GtkImage" id="math_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odf_32_8.png</property>
- </object>
- <object class="GtkImage" id="open_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">framework/res/folder_32.png</property>
- </object>
- <object class="GtkImage" id="templates_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">framework/res/templates_32.png</property>
- </object>
- <object class="GtkImage" id="writer_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odt_32_8.png</property>
- </object>
<object class="GtkBox" id="StartCenter">
<property name="can_focus">False</property>
<child>
- <object class="GtkGrid" id="sccontainer">
+ <object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="border_width">12</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
- <property name="column_homogeneous">True</property>
<child>
- <object class="GtkGrid" id="grid2">
+ <object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
- <property name="column_homogeneous">True</property>
+ <property name="vexpand">True</property>
<child>
- <object class="GtkButton" id="writer">
- <property name="label" translatable="yes">Text _Document</property>
+ <object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">writer_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="all_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">All</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="draw">
- <property name="label" translatable="yes">D_rawing</property>
+ <object class="GtkGrid" id="grid4">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">draw_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="writer">
+ <property name="label" translatable="yes">New Document</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">writer_image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="writer_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="calc">
- <property name="label" translatable="yes">_Spreadsheet</property>
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">calc_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Documents</property>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="database">
- <property name="label" translatable="yes">D_atabase</property>
+ <object class="GtkGrid" id="grid6">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">database_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="calc">
+ <property name="label" translatable="yes">New Spreadsheet</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">calc_image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="calc_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Spreadsheets</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="impress">
- <property name="label" translatable="yes">_Presentation</property>
+ <object class="GtkGrid" id="grid8">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">impress_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="impress">
+ <property name="label" translatable="yes">New Presentation</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">impress_image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="impress_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Presentations</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="math">
- <property name="label" translatable="yes">F_ormula</property>
+ <object class="GtkGrid" id="grid10">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">math_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="draw">
+ <property name="label" translatable="yes">New Drawing</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">draw_image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="draw_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Drawings</property>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="open:addmenu">
- <property name="label" translatable="yes">Ope_n...</property>
+ <object class="GtkGrid" id="grid12">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">open_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="database">
+ <property name="label" translatable="yes">New Database</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">database_image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="database_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Databases</property>
+ </object>
+ <packing>
+ <property name="position">5</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="templates">
- <property name="label" translatable="yes">Te_mplates...</property>
+ <object class="GtkGrid" id="grid14">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="image">templates_image</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="grid15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkButton" id="math">
+ <property name="label" translatable="yes">New Formula</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">math_image</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recent</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="sfxlo-RecentDocsView" id="math_recent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="vexpand">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="left_attach">1</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Formulas</property>
+ </object>
+ <packing>
+ <property name="position">6</property>
+ <property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
+ <object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="valign">end</property>
- <property name="vexpand">True</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
+ <property name="hexpand">True</property>
+ <property name="column_homogeneous">True</property>
<child>
- <object class="GtkButton" id="extension">
+ <object class="GtkButton" id="open">
+ <property name="label" translatable="yes">Open</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Add new features to %PRODUCTNAME</property>
- <property name="image">extension_image</property>
- <property name="relief">none</property>
- <property name="always_show_image">True</property>
+ <property name="image">open_image</property>
</object>
<packing>
- <property name="left_attach">1</property>
+ <property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="info">
+ <object class="GtkButton" id="templates">
+ <property name="label" translatable="yes">Templates</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Get more information about %PRODUCTNAME</property>
- <property name="image">info_image</property>
- <property name="relief">none</property>
- <property name="always_show_image">True</property>
+ <property name="image">templates_image</property>
</object>
<packing>
- <property name="left_attach">2</property>
+ <property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
<child>
- <object class="GtkButton" id="add_temp">
+ <object class="GtkLabel" id="label15">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Get more templates for %PRODUCTNAME</property>
- <property name="image">add_temp_image</property>
- <property name="relief">none</property>
- <property name="always_show_image">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">LibreOffice</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -287,10 +588,68 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkGrid" id="grid17">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <child>
+ <object class="GtkButton" id="extension">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">extension_image</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="info">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">info_image</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="add_temp">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">add_temp_image</property>
+ <property name="relief">none</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -303,4 +662,54 @@
</packing>
</child>
</object>
+ <object class="GtkImage" id="calc_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/ods_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="database_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odb_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="draw_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odg_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="extension_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/extension.png</property>
+ </object>
+ <object class="GtkImage" id="impress_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odp_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="info_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/info_26.png</property>
+ </object>
+ <object class="GtkImage" id="math_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odf_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="open_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/folder_32.png</property>
+ </object>
+ <object class="GtkImage" id="templates_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/templates_32.png</property>
+ </object>
+ <object class="GtkImage" id="writer_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odt_32_8.png</property>
+ </object>
</interface>
commit d1cbaee70d3f922937a1993914436c8fc899ebfc
Author: Krisztian Pinter <pin.terminator at gmail.com>
Date: Sun Aug 11 18:35:52 2013 +0200
startcenter: Add file type filter to RecentDocsView
Change-Id: Ib42721e00f60590fc947ba8ec5f615227641e754
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index dd5ce9e..38f1a53 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -49,6 +49,7 @@ public:
void SetThumbnailSize(long thumbnailSize);
long GetThumbnailSize() const;
+ void SetFilter(APPLICATION_FILTER filter);
static bool isFilteredExtension(APPLICATION_FILTER filter, const OUString &rExt);
static BitmapEx getDefaultThumbnail(const OUString &rURL);
@@ -58,6 +59,10 @@ public:
protected:
virtual void OnItemDblClicked(ThumbnailViewItem *pItem);
+ bool isUnfilteredFile(const OUString &rURL) const;
+
+ APPLICATION_FILTER mFilter;
+
long mnItemMaxSize;
long mnTextHeight;
long mnItemPadding;
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 73c585f..ae235f7 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -95,6 +95,12 @@ bool RecentDocsView::isFilteredExtension(APPLICATION_FILTER filter, const OUStri
return bRet;
}
+bool RecentDocsView::isUnfilteredFile(const OUString &rURL) const
+{
+ INetURLObject aUrl(rURL);
+ return isFilteredExtension(mFilter, aUrl.getExtension());
+}
+
BitmapEx RecentDocsView::getDefaultThumbnail(const OUString &rURL)
{
BitmapEx aImg;
@@ -149,7 +155,10 @@ void RecentDocsView::loadRecentDocs()
a >>= aTitle;
}
- insertItem(aURL, aTitle);
+ if( isUnfilteredFile(aURL) )
+ {
+ insertItem(aURL, aTitle);
+ }
}
CalculateItemPositions();
@@ -214,6 +223,11 @@ long RecentDocsView::GetThumbnailSize() const
return mnItemMaxSize;
}
+void RecentDocsView::SetFilter(APPLICATION_FILTER filter)
+{
+ mFilter = filter;
+}
+
Size RecentDocsView::GetOptimalSize() const
{
return Window::GetOptimalSize();
commit 85e4d35f1926b8568dfcbe9571ebdc9879fa52b4
Author: Krisztian Pinter <pin.terminator at gmail.com>
Date: Sun Aug 11 18:29:58 2013 +0200
startcenter: Improve thumbnails in RecentDocsView
Change-Id: Ib33e20996267f3e178079174fde014aa28638fcf
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index f2184e4..dd5ce9e 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -24,6 +24,17 @@ struct LoadRecentFile
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
};
+enum APPLICATION_FILTER
+{
+ FILTER_NONE,
+ FILTER_WRITER,
+ FILTER_CALC,
+ FILTER_IMPRESS,
+ FILTER_DRAW,
+ FILTER_DATABASE,
+ FILTER_MATH,
+};
+
class SFX2_DLLPUBLIC RecentDocsView : protected ::comphelper::OBaseMutex,
public ThumbnailView
{
@@ -39,6 +50,9 @@ public:
void SetThumbnailSize(long thumbnailSize);
long GetThumbnailSize() const;
+ static bool isFilteredExtension(APPLICATION_FILTER filter, const OUString &rExt);
+ static BitmapEx getDefaultThumbnail(const OUString &rURL);
+
DECL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile* );
protected:
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 2aea3f7..73c585f 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -21,6 +21,8 @@
#include <sfx2/templateabstractview.hxx>
#include <sfx2/app.hxx>
+#include <sfx2/sfx.hrc>
+#include <sfx2/sfxresid.hxx>
#include <unotools/historyoptions.hxx>
#include <vcl/builder.hxx>
#include <vcl/svapp.hxx>
@@ -59,6 +61,64 @@ RecentDocsView::~RecentDocsView()
{
}
+bool RecentDocsView::isFilteredExtension(APPLICATION_FILTER filter, const OUString &rExt)
+{
+ bool bRet = true;
+
+ if (filter == FILTER_WRITER)
+ {
+ bRet = rExt == "odt" || rExt == "doc" || rExt == "docx" ||
+ rExt == "rtf" || rExt == "txt";
+ }
+ else if (filter == FILTER_CALC)
+ {
+ bRet = rExt == "ods" || rExt == "xls" || rExt == "xlsx";
+ }
+ else if (filter == FILTER_IMPRESS)
+ {
+ bRet = rExt == "odp" || rExt == "pps" || rExt == "ppt" ||
+ rExt == "pptx";
+ }
+ else if (filter == FILTER_DRAW)
+ {
+ bRet = rExt == "odg";
+ }
+ else if (filter == FILTER_DATABASE)
+ {
+ bRet = rExt == "odb";
+ }
+ else if (filter == FILTER_MATH)
+ {
+ bRet = rExt == "odf";
+ }
+
+ return bRet;
+}
+
+BitmapEx RecentDocsView::getDefaultThumbnail(const OUString &rURL)
+{
+ BitmapEx aImg;
+ INetURLObject aUrl(rURL);
+ OUString aExt = aUrl.getExtension();
+
+ if ( isFilteredExtension( FILTER_WRITER, aExt) )
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_TEXT ) );
+ else if ( isFilteredExtension( FILTER_CALC, aExt) )
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_SHEET ) );
+ else if ( isFilteredExtension( FILTER_IMPRESS, aExt) )
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_PRESENTATION ) );
+ else if ( isFilteredExtension( FILTER_DRAW, aExt) )
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_DRAWING ) );
+ else if ( isFilteredExtension( FILTER_DATABASE, aExt) )
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_DATABASE ) );
+ else if ( isFilteredExtension( FILTER_MATH, aExt) )
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_MATH ) );
+ else
+ aImg = BitmapEx ( SfxResId( SFX_FILE_THUMBNAIL_DEFAULT ) );
+
+ return aImg;
+}
+
void RecentDocsView::insertItem(const OUString &rURL, const OUString &rTitle)
{
RecentDocsViewItem *pChild = new RecentDocsViewItem(*this, rURL, rTitle);
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index 996d064..a4024ae 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -9,16 +9,17 @@
#include <sfx2/recentdocsviewitem.hxx>
-#include <sfx2/sfxresid.hxx>
-#include "../doc/doc.hrc"
-
#include <sfx2/templateabstractview.hxx>
+#include <sfx2/recentdocsview.hxx>
#include <tools/urlobj.hxx>
RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rURL, const OUString &rTitle)
: ThumbnailViewItem(rView)
{
+ RecentDocsView& rRecentView = dynamic_cast<RecentDocsView&>(rView);
+ long nThumbnailSize = rRecentView.GetThumbnailSize();
OUString aTitle = rTitle;
+
if( !aTitle.getLength() )
{
// If we have no title, get filename from the URL
@@ -30,17 +31,12 @@ RecentDocsViewItem::RecentDocsViewItem(ThumbnailView &rView, const OUString &rUR
if( aThumbnail.IsEmpty() )
{
// Use the default thumbnail if we have nothing else
- aThumbnail = TemplateAbstractView::getDefaultThumbnail(rURL);
- }
- if( aThumbnail.IsEmpty() )
- {
- // Last fallback
- aThumbnail = BitmapEx ( SfxResId( SFX_THUMBNAIL_TEXT ) );
+ aThumbnail = RecentDocsView::getDefaultThumbnail(rURL);
}
maURL = rURL;
maTitle = aTitle;
- maPreview1 = TemplateAbstractView::scaleImg(aThumbnail, 150, 150);
+ maPreview1 = TemplateAbstractView::scaleImg(aThumbnail, nThumbnailSize, nThumbnailSize);
}
void RecentDocsViewItem::setEditTitle (bool edit, bool bChangeFocus)
commit 2ace414bd8350a682ad6d482413e50bfa05893f5
Author: Krisztian Pinter <pin.terminator at gmail.com>
Date: Sun Aug 11 17:08:53 2013 +0200
startcenter: Clean up RecentDocsView
Change-Id: I8c303c9c5e112d57f87f44a00ded78247b0d330a
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index 6ae9391..f2184e4 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -36,22 +36,18 @@ public:
virtual Size GetOptimalSize() const;
- void SetThumbnailSize(long ThumbnailWidth, long ThumbnailHeight);
- void SetHeight(long Height);
+ void SetThumbnailSize(long thumbnailSize);
+ long GetThumbnailSize() const;
DECL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile* );
protected:
virtual void OnItemDblClicked(ThumbnailViewItem *pItem);
- long mnItemMaxWidth;
- long mnItemMaxHeight;
+ long mnItemMaxSize;
+ long mnTextHeight;
long mnItemPadding;
long mnItemMaxTextLength;
- long mnItemThumbnailMaxHeight;
- long mnItemMaxHeightSub;
-
- long mnHeight;
int mnMaxThumbnailItems;
};
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list