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 @@ ...@@ -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> <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> </prop>
</node> </node>
<node oor:name="Pictures" oor:op="fuse" oor:mandatory="true">
<prop oor:name="Path">
<value>$(work)</value>
</prop>
</node>
</oor:component-data> </oor:component-data>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</node> </node>
<node oor:name=".uno:PhotoAlbumDialog" oor:op="replace"> <node oor:name=".uno:PhotoAlbumDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <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>
<prop oor:name="Properties" oor:type="xs:int"> <prop oor:name="Properties" oor:type="xs:int">
<value>1</value> <value>1</value>
......
...@@ -1594,5 +1594,22 @@ ...@@ -1594,5 +1594,22 @@
</group> </group>
</group> </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> </component>
</oor:component-schema> </oor:component-schema>
...@@ -297,6 +297,7 @@ interface SlideSorterView ...@@ -297,6 +297,7 @@ interface SlideSorterView
SID_PHOTOALBUM SID_PHOTOALBUM
[ [
ExecMethod = FuTemporary ; ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
] ]
} }
......
...@@ -216,6 +216,7 @@ interface ImpressEditView : DrawView ...@@ -216,6 +216,7 @@ interface ImpressEditView : DrawView
SID_PHOTOALBUM SID_PHOTOALBUM
[ [
ExecMethod = FuTemporary ; ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
] ]
} }
......
...@@ -529,7 +529,8 @@ interface OutlineView ...@@ -529,7 +529,8 @@ interface OutlineView
] ]
SID_PHOTOALBUM SID_PHOTOALBUM
[ [
ExecMethod = FuTemporary; ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
] ]
} }
......
...@@ -22,11 +22,22 @@ ...@@ -22,11 +22,22 @@
#include <vcl/field.hxx> #include <vcl/field.hxx>
#include <vcl/graphicfilter.hxx> #include <vcl/graphicfilter.hxx>
#include <svx/svdotext.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 SdrTextObj;
class SdDrawDocument; class SdDrawDocument;
class SdPage; class SdPage;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::presentation;
namespace sd namespace sd
{ {
...@@ -36,7 +47,10 @@ public: ...@@ -36,7 +47,10 @@ public:
SdPhotoAlbumDialog(Window* pWindow, SdDrawDocument* pActDoc); SdPhotoAlbumDialog(Window* pWindow, SdDrawDocument* pActDoc);
~SdPhotoAlbumDialog(); ~SdPhotoAlbumDialog();
virtual short Execute();
private: private:
static OUString sDirUrl;
CancelButton* pCancelBtn; CancelButton* pCancelBtn;
PushButton* pCreateBtn; PushButton* pCreateBtn;
...@@ -49,7 +63,11 @@ private: ...@@ -49,7 +63,11 @@ private:
ListBox* pImagesLst; ListBox* pImagesLst;
FixedImage* pImg; FixedImage* pImg;
ListBox* pInsTypeCombo; ListBox* pInsTypeCombo;
CheckBox* pASRCheck;
FixedText* pFilenameLab;
SdDrawDocument* pDoc; SdDrawDocument* pDoc;
GraphicFilter* mpGraphicFilter; GraphicFilter* mpGraphicFilter;
...@@ -65,10 +83,21 @@ private: ...@@ -65,10 +83,21 @@ private:
DECL_LINK(SelectHdl, void*); 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 #endif // _SD_PHOTOALBUMDIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -687,14 +687,18 @@ void DrawViewShell::FuTemp04(SfxRequest& rReq) ...@@ -687,14 +687,18 @@ void DrawViewShell::FuTemp04(SfxRequest& rReq)
case SID_PHOTOALBUM: case SID_PHOTOALBUM:
{ {
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
VclAbstractDialog* pDlg = pFact ? pFact->CreateSdPhotoAlbumDialog(GetActiveWindow(), VclAbstractDialog* pDlg = pFact ? pFact->CreateSdPhotoAlbumDialog(
GetDoc() GetActiveWindow(),
) : 0; GetDoc()) : 0;
if (pDlg)
{ if (pDlg)
pDlg->Execute(); {
} pDlg->Execute();
delete pDlg;
}
Cancel();
rReq.Ignore ();
} }
break; break;
......
...@@ -194,6 +194,7 @@ ...@@ -194,6 +194,7 @@
<menu:menu menu:id=".uno:GraphicMenu"> <menu:menu menu:id=".uno:GraphicMenu">
<menu:menupopup> <menu:menupopup>
<menu:menuitem menu:id=".uno:InsertGraphic"/> <menu:menuitem menu:id=".uno:InsertGraphic"/>
<menu:menuitem menu:id=".uno:PhotoAlbumDialog"/>
<menu:menu menu:id=".uno:Scan"> <menu:menu menu:id=".uno:Scan">
<menu:menupopup> <menu:menupopup>
<menu:menuitem menu:id=".uno:TwainSelect"/> <menu:menuitem menu:id=".uno:TwainSelect"/>
...@@ -215,8 +216,6 @@ ...@@ -215,8 +216,6 @@
<menu:menuitem menu:id=".uno:InsertObjectFloatingFrame"/> <menu:menuitem menu:id=".uno:InsertObjectFloatingFrame"/>
<menu:menuseparator/> <menu:menuseparator/>
<menu:menuitem menu:id=".uno:ImportFromFile"/> <menu:menuitem menu:id=".uno:ImportFromFile"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:PhotoAlbumDialog"/>
</menu:menupopup> </menu:menupopup>
</menu:menu> </menu:menu>
<menu:menu menu:id=".uno:FormatMenu"> <menu:menu menu:id=".uno:FormatMenu">
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<child> <child>
<object class="GtkImage" id="preview_img"> <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="height_request">150</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -295,6 +295,25 @@ ...@@ -295,6 +295,25 @@
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
</child> </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> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
...@@ -324,6 +343,18 @@ ...@@ -324,6 +343,18 @@
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </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> <child>
<object class="GtkFrame" id="frame2"> <object class="GtkFrame" id="frame2">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -395,7 +426,7 @@ ...@@ -395,7 +426,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </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