summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-11-04 21:04:18 +0000
committerMichael Meeks <michael.meeks@suse.com>2011-11-07 14:19:34 +0000
commitf1abe3035cc237609dc4d20f3dd9c6e2484ef7a8 (patch)
treed30103ffb6561bc5071ca625634de718a400d000 /vcl
parent17084c750df84e0da377d716a4088f72bd25f972 (diff)
gtk: cleanup to make the vcl file-picker interface work.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/salinst.hxx2
-rw-r--r--vcl/inc/unx/gtk/gtkinst.hxx2
-rw-r--r--vcl/inc/vcl/svapp.hxx4
-rw-r--r--vcl/source/app/svapp.cxx6
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx2
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx1
6 files changed, 16 insertions, 1 deletions
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index e503fb4ea871..67affdbec700 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -170,6 +170,8 @@ public:
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType) = 0;
+ virtual bool hasNativeFileSelection() const { return false; }
+
virtual com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
createFilePicker( const com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext >& )
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 55a187908566..8b937a33e577 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -109,6 +109,8 @@ public:
virtual GenPspGraphics *CreatePrintGraphics();
+ virtual bool hasNativeFileSelection() const { return true; }
+
virtual com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
createFilePicker( const com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext >& );
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 951f817b7aa3..07782dfb07aa 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -373,6 +373,10 @@ public:
*/
static void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
+ /** Do we have a native / system file selector available ?
+ */
+ static bool hasNativeFileSelection();
+
/** Create a platform specific file picker, if one is available,
otherwise return an empty reference
*/
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index e1448510278a..e23192c33cc8 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1895,6 +1895,12 @@ void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ )
{
}
+bool Application::hasNativeFileSelection()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ return pSVData->mpDefInst->hasNativeFileSelection();
+}
+
Reference< ui::dialogs::XFilePicker2 >
Application::createFilePicker( const Reference< uno::XComponentContext >& xSM )
{
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index b7caa0ac51c9..7ffcb69b22c3 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -972,7 +972,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException )
UNO_QUERY_THROW );
uno::Reference< frame::XDesktop > xDesktop(
- createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ),
+ createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ),
UNO_QUERY_THROW );
RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop);
diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
index 923a7fe4a329..07b6bb2abd29 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -206,6 +206,7 @@ GtkInstance::createFolderPicker( const uno::Reference< uno::XComponentContext >
{
fprintf( stderr, "Create gtk folder picker\n" );
#if GTK_CHECK_VERSION(3,0,0)
+ (void)xMSF;
return uno::Reference< ui::dialogs::XFolderPicker >();
#else
return uno::Reference< ui::dialogs::XFolderPicker >(