Kaydet (Commit) 3a56257e authored tarafından Gergő Mocsi's avatar Gergő Mocsi Kaydeden (comit) Andras Timar

Create Photo Album implementation

Added a checkbox to enable/diable Keep Aspect ratio.
Options 2 images/slide, 4 images/slide implemented.
UI tweaks: dialog window remembers last used directory (via config),
buttons get enabled/disabled according to the content of the ListBox.
ListBox show filename only, full path is shown lower in a label.
Dialog window reopens again, if slide preview is not in focus.
Added a title slide: author, title.

Conflicts:
	officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
	sd/uiconfig/simpress/ui/photoalbum.ui

Change-Id: I68d2a3e00f8c55b909fe4d98aa3958188653390e
Reviewed-on: https://gerrit.libreoffice.org/3169Reviewed-by: 's avatarAndras Timar <atimar@suse.com>
Tested-by: 's avatarAndras Timar <atimar@suse.com>
üst 857adead
......@@ -195,4 +195,9 @@
<value oor:separator=";">vnd.sun.star.expand:$BRAND_BASE_DIR/share/config/soffice.cfg/simpress/transitions.xml;vnd.sun.star.expand:$BRAND_BASE_DIR/share/config/soffice.cfg/simpress/transitions-ogl.xml</value>
</prop>
</node>
<node oor:name="Pictures" oor:op="fuse" oor:mandatory="true">
<prop oor:name="Path">
<value>$(work)</value>
</prop>
</node>
</oor:component-data>
......@@ -55,7 +55,7 @@
</node>
<node oor:name=".uno:PhotoAlbumDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Create Photo Album</value>
<value xml:lang="en-US">Photo Album</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
......
......@@ -1594,5 +1594,22 @@
</group>
</group>
</group>
<group oor:name="Pictures">
<info>
<desc>
Contains configuration items form Impress Photo Album function.
</desc>
</info>
<prop oor:name="Path" oor:type="xs:string" oor:nillable="false">
<info>
<author>GM</author>
<desc>
Access path, where images were loaded last time.
The default is work directory.
</desc>
</info>
<value>$(work)</value>
</prop>
</group>
</component>
</oor:component-schema>
......@@ -297,6 +297,7 @@ interface SlideSorterView
SID_PHOTOALBUM
[
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
}
......
......@@ -216,6 +216,7 @@ interface ImpressEditView : DrawView
SID_PHOTOALBUM
[
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
}
......
......@@ -529,7 +529,8 @@ interface OutlineView
]
SID_PHOTOALBUM
[
ExecMethod = FuTemporary;
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
}
......
......@@ -22,11 +22,22 @@
#include <vcl/field.hxx>
#include <vcl/graphicfilter.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdobj.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPages.hpp>
#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
class SdrTextObj;
class SdDrawDocument;
class SdPage;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
namespace sd
{
......@@ -36,7 +47,10 @@ public:
SdPhotoAlbumDialog(Window* pWindow, SdDrawDocument* pActDoc);
~SdPhotoAlbumDialog();
virtual short Execute();
private:
static OUString sDirUrl;
CancelButton* pCancelBtn;
PushButton* pCreateBtn;
......@@ -49,7 +63,11 @@ private:
ListBox* pImagesLst;
FixedImage* pImg;
ListBox* pInsTypeCombo;
ListBox* pInsTypeCombo;
CheckBox* pASRCheck;
FixedText* pFilenameLab;
SdDrawDocument* pDoc;
GraphicFilter* mpGraphicFilter;
......@@ -65,10 +83,21 @@ private:
DECL_LINK(SelectHdl, void*);
void setFirstSlide(SdPage* pFirstSlide);
Reference< drawing::XDrawPage > appendNewSlide(AutoLayout aLayout,
Reference< drawing::XDrawPages > xDrawPages);
awt::Size createASRSize(const awt::Size& aPicSize, const awt::Size& aMaxSize);
Reference< drawing::XShape > createXShapeFromUrl(const OUString& sUrl,
Reference< lang::XMultiServiceFactory > xShapeFactory,
Reference< graphic::XGraphicProvider> xProvider);
Reference< graphic::XGraphic> createXGraphicFromUrl(const OUString& sUrl,
Reference< graphic::XGraphicProvider> xProvider);
};
}
} // end of namespace sd
#endif // _SD_PHOTOALBUMDIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -687,14 +687,18 @@ void DrawViewShell::FuTemp04(SfxRequest& rReq)
case SID_PHOTOALBUM:
{
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
VclAbstractDialog* pDlg = pFact ? pFact->CreateSdPhotoAlbumDialog(GetActiveWindow(),
GetDoc()
) : 0;
if (pDlg)
{
pDlg->Execute();
}
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
VclAbstractDialog* pDlg = pFact ? pFact->CreateSdPhotoAlbumDialog(
GetActiveWindow(),
GetDoc()) : 0;
if (pDlg)
{
pDlg->Execute();
delete pDlg;
}
Cancel();
rReq.Ignore ();
}
break;
......
......@@ -194,6 +194,7 @@
<menu:menu menu:id=".uno:GraphicMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:InsertGraphic"/>
<menu:menuitem menu:id=".uno:PhotoAlbumDialog"/>
<menu:menu menu:id=".uno:Scan">
<menu:menupopup>
<menu:menuitem menu:id=".uno:TwainSelect"/>
......@@ -215,8 +216,6 @@
<menu:menuitem menu:id=".uno:InsertObjectFloatingFrame"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ImportFromFile"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:PhotoAlbumDialog"/>
</menu:menupopup>
</menu:menu>
<menu:menu menu:id=".uno:FormatMenu">
......
......@@ -86,7 +86,7 @@
<property name="row_spacing">6</property>
<child>
<object class="GtkImage" id="preview_img">
<property name="width_request">150</property>
<property name="width_request">200</property>
<property name="height_request">150</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -295,6 +295,25 @@
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="asr_check">
<property name="label" translatable="yes">Keep Aspect Ratio</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -324,6 +343,18 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="filename_lab">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="justify">right</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
......@@ -395,7 +426,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment