Kaydet (Commit) 74144e53 authored tarafından Krisztian Pinter's avatar Krisztian Pinter Kaydeden (comit) Caolán McNamara

startcenter: Tweak Start Center layout

Change-Id: Ia63acef184455f3d515f0da0a90a46d8318fbbe0
Reviewed-on: https://gerrit.libreoffice.org/5901Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 125769a4
...@@ -80,6 +80,7 @@ private: ...@@ -80,6 +80,7 @@ private:
void OnTemplateImport (); void OnTemplateImport ();
void OnTemplateSearch (); void OnTemplateSearch ();
void OnTemplateLink ();
void OnTemplateOpen (); void OnTemplateOpen ();
void OnTemplateEdit (); void OnTemplateEdit ();
void OnTemplateProperties (); void OnTemplateProperties ();
......
...@@ -55,7 +55,20 @@ class BackingWindow ...@@ -55,7 +55,20 @@ class BackingWindow
com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener; com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
PushButton* mpOpenButton; PushButton* mpOpenButton;
PushButton* mpOpenWriterButton;
PushButton* mpOpenCalcButton;
PushButton* mpOpenImpressButton;
PushButton* mpOpenDrawButton;
PushButton* mpOpenDatabaseButton;
PushButton* mpOpenMathButton;
PushButton* mpTemplateButton; PushButton* mpTemplateButton;
PushButton* mpTemplateWriterButton;
PushButton* mpTemplateCalcButton;
PushButton* mpTemplateImpressButton;
PushButton* mpTemplateDrawButton;
PushButton* mpTemplateDatabaseButton;
PushButton* mpTemplateMathButton;
TabControl* mpModuleNotebook; TabControl* mpModuleNotebook;
...@@ -73,10 +86,6 @@ class BackingWindow ...@@ -73,10 +86,6 @@ class BackingWindow
PushButton* mpDBAllButton; PushButton* mpDBAllButton;
PushButton* mpMathAllButton; PushButton* mpMathAllButton;
PushButton* mpExtensionsButton;
PushButton* mpInfoButton;
PushButton* mpTplRepButton;
PushButton* mpWriterShowTemplateButton; PushButton* mpWriterShowTemplateButton;
PushButton* mpCalcShowTemplateButton; PushButton* mpCalcShowTemplateButton;
PushButton* mpImpressShowTemplateButton; PushButton* mpImpressShowTemplateButton;
...@@ -114,7 +123,6 @@ class BackingWindow ...@@ -114,7 +123,6 @@ class BackingWindow
void setupButton( PushButton* pButton ); void setupButton( PushButton* pButton );
void setupTemplateView( TemplateLocalView* pView, FILTER_APPLICATION eFilter, void setupTemplateView( TemplateLocalView* pView, FILTER_APPLICATION eFilter,
PushButton* pRecentButton, PushButton* pTemplateButton ); PushButton* pRecentButton, PushButton* pTemplateButton );
void setupExternalLink( PushButton* pButton );
void dispatchURL( const OUString& i_rURL, void dispatchURL( const OUString& i_rURL,
const OUString& i_rTarget = OUString( "_default" ), const OUString& i_rTarget = OUString( "_default" ),
...@@ -125,7 +133,6 @@ class BackingWindow ...@@ -125,7 +133,6 @@ class BackingWindow
DECL_LINK( ClickHdl, Button* ); DECL_LINK( ClickHdl, Button* );
DECL_LINK( RecentTemplateToggleHdl, Button* ); DECL_LINK( RecentTemplateToggleHdl, Button* );
DECL_LINK( OpenTemplateHdl, ThumbnailViewItem* ); DECL_LINK( OpenTemplateHdl, ThumbnailViewItem* );
DECL_LINK( ExtLinkClickHdl, Button* );
void initControls(); void initControls();
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <sfx2/thumbnailviewitem.hxx> #include <sfx2/thumbnailviewitem.hxx>
#include <sot/storage.hxx> #include <sot/storage.hxx>
#include <svtools/imagemgr.hxx> #include <svtools/imagemgr.hxx>
#include <svtools/langhelp.hxx>
#include <svtools/miscopt.hxx> #include <svtools/miscopt.hxx>
#include <svtools/PlaceEditDialog.hxx> #include <svtools/PlaceEditDialog.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
#include <vcl/toolbox.hxx> #include <vcl/toolbox.hxx>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/document/MacroExecMode.hpp> #include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp> #include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/embed/XStorage.hpp>
...@@ -53,6 +55,8 @@ ...@@ -53,6 +55,8 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/InteractionHandler.hpp>
#include "doc.hrc" #include "doc.hrc"
...@@ -64,6 +68,8 @@ ...@@ -64,6 +68,8 @@
#define TM_SETTING_LASTFOLDER "LastFolder" #define TM_SETTING_LASTFOLDER "LastFolder"
#define TM_SETTING_FILTER "SelectedFilter" #define TM_SETTING_FILTER "SelectedFilter"
const char SERVICENAME_CFGREADACCESS[] = "com.sun.star.configuration.ConfigurationAccess";
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::embed; using namespace ::com::sun::star::embed;
...@@ -448,7 +454,7 @@ void SfxTemplateManagerDlg::Resize() ...@@ -448,7 +454,7 @@ void SfxTemplateManagerDlg::Resize()
long nToolbarsHeight = std::max(std::max(aViewSize.getHeight(), aActionSize.getHeight()), aTemplateSize.getHeight()); long nToolbarsHeight = std::max(std::max(aViewSize.getHeight(), aActionSize.getHeight()), aTemplateSize.getHeight());
aActionSize.setWidth(2.5*aActionSize.getWidth()); aActionSize.setWidth(3.35*aActionSize.getWidth());
aViewSize.setWidth(aWinSize.getWidth()-aActionSize.getWidth()-mpViewBar->GetPosPixel().X()); aViewSize.setWidth(aWinSize.getWidth()-aActionSize.getWidth()-mpViewBar->GetPosPixel().X());
aTemplateSize.setWidth(aWinSize.getWidth()); aTemplateSize.setWidth(aWinSize.getWidth());
...@@ -516,6 +522,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXActionHdl) ...@@ -516,6 +522,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXActionHdl)
case TBI_TEMPLATE_SEARCH: case TBI_TEMPLATE_SEARCH:
OnTemplateSearch(); OnTemplateSearch();
break; break;
case TBI_TEMPLATE_LINK:
OnTemplateLink();
break;
default: default:
break; break;
} }
...@@ -1175,6 +1184,40 @@ void SfxTemplateManagerDlg::OnTemplateSearch () ...@@ -1175,6 +1184,40 @@ void SfxTemplateManagerDlg::OnTemplateSearch ()
mpSearchEdit->GrabFocus(); mpSearchEdit->GrabFocus();
} }
void SfxTemplateManagerDlg::OnTemplateLink ()
{
OUString sNode("TemplateRepositoryURL");
OUString sNodePath("/org.openoffice.Office.Common/Help/StartCenter");
try
{
Reference<lang::XMultiServiceFactory> xConfig = configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
Sequence<Any> args(1);
PropertyValue val(
"nodepath",
0,
Any(sNodePath),
PropertyState_DIRECT_VALUE);
args.getArray()[0] <<= val;
Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,args), UNO_QUERY);
if( xNameAccess.is() )
{
OUString sURL;
//throws css::container::NoSuchElementException, css::lang::WrappedTargetException
Any value( xNameAccess->getByName(sNode) );
sURL = value.get<OUString> ();
localizeWebserviceURI(sURL);
Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(
com::sun::star::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
//throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
xSystemShellExecute->execute( sURL, OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY);
}
}
catch (const Exception&)
{
}
}
void SfxTemplateManagerDlg::OnTemplateOpen () void SfxTemplateManagerDlg::OnTemplateOpen ()
{ {
ThumbnailViewItem *pItem = const_cast<ThumbnailViewItem*>(*maSelTemplates.begin()); ThumbnailViewItem *pItem = const_cast<ThumbnailViewItem*>(*maSelTemplates.begin());
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#define TBI_TEMPLATE_FOLDER_NEW 29 #define TBI_TEMPLATE_FOLDER_NEW 29
#define TBI_TEMPLATE_OPEN 30 #define TBI_TEMPLATE_OPEN 30
#define TBI_TEMPLATE_LINK 31
#define STR_ACTION_REFRESH 263 #define STR_ACTION_REFRESH 263
#define STR_ACTION_SORT_NAME 264 #define STR_ACTION_SORT_NAME 264
......
...@@ -215,6 +215,17 @@ TabPage TAB_TEMPLATE_MANAGER ...@@ -215,6 +215,17 @@ TabPage TAB_TEMPLATE_MANAGER
ImageBitmap = Bitmap { File = "actionaction013.png" ; }; ImageBitmap = Bitmap { File = "actionaction013.png" ; };
}; };
}; };
ToolBoxItem
{
Identifier = TBI_TEMPLATE_LINK;
Text [en-US] = "Get more templates for %PRODUCTNAME";
ItemImage = Image
{
ImageBitmap = Bitmap { File = "actionview010.png" ; };
};
};
}; };
}; };
......
This diff is collapsed.
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