Basic structures of KDE5 native filepicker build now
Change-Id: I174a4a01f2191d935ea069a0e04b5c88f4bf8193
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde5))
|
$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde5))
|
||||||
|
|
||||||
$(call gb_CustomTarget_get_target,vcl/unx/kde5) : \
|
$(call gb_CustomTarget_get_target,vcl/unx/kde5) : \
|
||||||
|
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/KDE5FilePicker.moc \
|
||||||
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_socket_notifiers.moc \
|
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_socket_notifiers.moc \
|
||||||
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_posted_events.moc
|
$(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_posted_events.moc
|
||||||
|
|
||||||
|
@@ -87,6 +87,8 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\
|
|||||||
))
|
))
|
||||||
|
|
||||||
$(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
|
$(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
|
||||||
|
vcl/unx/kde5/KDE5FilePicker \
|
||||||
|
vcl/unx/kde5/KDE5FilePicker2 \
|
||||||
vcl/unx/kde5/KDE5SalData \
|
vcl/unx/kde5/KDE5SalData \
|
||||||
vcl/unx/kde5/KDE5SalDisplay \
|
vcl/unx/kde5/KDE5SalDisplay \
|
||||||
vcl/unx/kde5/KDE5SalFrame \
|
vcl/unx/kde5/KDE5SalFrame \
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kde5_filepicker.hxx"
|
#include "KDE5FilePicker.hxx"
|
||||||
|
|
||||||
#include <KWindowSystem>
|
#include <KWindowSystem>
|
||||||
#include <KFileWidget>
|
#include <KFileWidget>
|
||||||
@@ -241,6 +241,6 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
|
|||||||
return QObject::eventFilter(o, e);
|
return QObject::eventFilter(o, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <kde5_filepicker.moc>
|
#include <KDE5FilePicker.moc>
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gtk3_kde5_filepicker.hxx"
|
#include "KDE5FilePicker2.hxx"
|
||||||
|
|
||||||
#include <com/sun/star/lang/DisposedException.hpp>
|
#include <com/sun/star/lang/DisposedException.hpp>
|
||||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||||
@@ -88,33 +88,19 @@ void SAL_CALL KDE5FilePicker2::removeFilePickerListener(const uno::Reference<XFi
|
|||||||
m_xListener.clear();
|
m_xListener.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::setTitle(const OUString& title)
|
void SAL_CALL KDE5FilePicker2::setTitle(const OUString& title) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetTitle, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
sal_Int16 SAL_CALL KDE5FilePicker2::execute() { return m_ipc.execute(); }
|
sal_Int16 SAL_CALL KDE5FilePicker2::execute() { return 0; }
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::setMultiSelectionMode(sal_Bool multiSelect)
|
void SAL_CALL KDE5FilePicker2::setMultiSelectionMode(sal_Bool multiSelect) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetMultiSelectionMode, bool(multiSelect));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::setDefaultName(const OUString& name)
|
void SAL_CALL KDE5FilePicker2::setDefaultName(const OUString& name) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetDefaultName, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::setDisplayDirectory(const OUString& dir)
|
void SAL_CALL KDE5FilePicker2::setDisplayDirectory(const OUString& dir) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetDisplayDirectory, dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString SAL_CALL KDE5FilePicker2::getDisplayDirectory()
|
OUString SAL_CALL KDE5FilePicker2::getDisplayDirectory()
|
||||||
{
|
{
|
||||||
auto id = m_ipc.sendCommand(Commands::GetDisplayDirectory);
|
|
||||||
OUString dir;
|
OUString dir;
|
||||||
m_ipc.readResponse(id, dir);
|
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,27 +114,17 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getFiles()
|
|||||||
|
|
||||||
uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getSelectedFiles()
|
uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getSelectedFiles()
|
||||||
{
|
{
|
||||||
auto id = m_ipc.sendCommand(Commands::GetSelectedFiles);
|
|
||||||
uno::Sequence<OUString> seq;
|
uno::Sequence<OUString> seq;
|
||||||
m_ipc.readResponse(id, seq);
|
|
||||||
return seq;
|
return seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter)
|
void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::AppendFilter, title, filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title)
|
void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetCurrentFilter, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString SAL_CALL KDE5FilePicker2::getCurrentFilter()
|
OUString SAL_CALL KDE5FilePicker2::getCurrentFilter()
|
||||||
{
|
{
|
||||||
auto id = m_ipc.sendCommand(Commands::GetCurrentFilter);
|
|
||||||
OUString filter;
|
OUString filter;
|
||||||
m_ipc.readResponse(id, filter);
|
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,14 +142,6 @@ void SAL_CALL KDE5FilePicker2::appendFilterGroup(const OUString& /*rGroupTitle*/
|
|||||||
void SAL_CALL KDE5FilePicker2::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
|
void SAL_CALL KDE5FilePicker2::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
|
||||||
const uno::Any& value)
|
const uno::Any& value)
|
||||||
{
|
{
|
||||||
if (value.has<bool>())
|
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetValue, controlId, nControlAction, value.get<bool>());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OSL_TRACE("set value of unhandled type %d", controlId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
|
uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
|
||||||
@@ -186,29 +154,18 @@ uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nCont
|
|||||||
// saves the value of the setting, so LO core is not needed for that either.
|
// saves the value of the setting, so LO core is not needed for that either.
|
||||||
return uno::Any(false);
|
return uno::Any(false);
|
||||||
|
|
||||||
auto id = m_ipc.sendCommand(Commands::GetValue, controlId, nControlAction);
|
|
||||||
|
|
||||||
bool value = false;
|
bool value = false;
|
||||||
m_ipc.readResponse(id, value);
|
|
||||||
|
|
||||||
return uno::Any(value);
|
return uno::Any(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable)
|
void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::EnableControl, controlId, bool(enable));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label)
|
void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label) {}
|
||||||
{
|
|
||||||
m_ipc.sendCommand(Commands::SetLabel, controlId, label);
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString SAL_CALL KDE5FilePicker2::getLabel(sal_Int16 controlId)
|
OUString SAL_CALL KDE5FilePicker2::getLabel(sal_Int16 controlId)
|
||||||
{
|
{
|
||||||
auto id = m_ipc.sendCommand(Commands::GetLabel, controlId);
|
|
||||||
OUString label;
|
OUString label;
|
||||||
m_ipc.readResponse(id, label);
|
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,9 +236,6 @@ void KDE5FilePicker2::addCustomControl(sal_Int16 controlId)
|
|||||||
// the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
|
// the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
|
||||||
// code, but the checkbox is hidden and ignored
|
// code, but the checkbox is hidden and ignored
|
||||||
bool hidden = controlId == CHECKBOX_AUTOEXTENSION;
|
bool hidden = controlId == CHECKBOX_AUTOEXTENSION;
|
||||||
|
|
||||||
m_ipc.sendCommand(Commands::AddCheckBox, controlId, hidden, getResString(resId));
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PUSHBUTTON_PLAY:
|
case PUSHBUTTON_PLAY:
|
||||||
@@ -402,9 +356,7 @@ void SAL_CALL KDE5FilePicker2::initialize(const uno::Sequence<uno::Any>& args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTitle(getResString(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
|
setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
|
||||||
|
|
||||||
m_ipc.sendCommand(Commands::Initialize, saveDialog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SAL_CALL KDE5FilePicker2::cancel()
|
void SAL_CALL KDE5FilePicker2::cancel()
|
||||||
|
@@ -32,8 +32,6 @@
|
|||||||
|
|
||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
|
|
||||||
#include "gtk3_kde5_filepicker_ipc.hxx"
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
typedef ::cppu::WeakComponentImplHelper<css::ui::dialogs::XFilePicker3,
|
typedef ::cppu::WeakComponentImplHelper<css::ui::dialogs::XFilePicker3,
|
||||||
@@ -49,7 +47,6 @@ protected:
|
|||||||
css::uno::Reference<css::ui::dialogs::XFilePickerListener> m_xListener;
|
css::uno::Reference<css::ui::dialogs::XFilePickerListener> m_xListener;
|
||||||
|
|
||||||
osl::Mutex _helperMutex;
|
osl::Mutex _helperMutex;
|
||||||
KDE5FilePicker2Ipc m_ipc;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KDE5FilePicker2(const css::uno::Reference<css::uno::XComponentContext>&);
|
explicit KDE5FilePicker2(const css::uno::Reference<css::uno::XComponentContext>&);
|
||||||
|
Reference in New Issue
Block a user