23 #include <osl/diagnose.h>
33 #include <com/sun/star/task/XJobExecutor.hpp>
34 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
55 MyApp(
const MyApp&) =
delete;
56 const MyApp& operator=(
const MyApp&) =
delete;
59 virtual int Main()
override;
60 virtual void DeInit()
override;
77 css::uno::Reference< css::uno::XComponentContext > context(
80 css::uno::Reference< css::lang::XComponent >(
81 context, css::uno::UNO_QUERY_THROW)->
dispose();
87 if (rStr.indexOf(
"%PRODUCT" ) == -1)
97 OUString sRet = rStr.replaceAll(
"%PRODUCTNAME", sProductName );
98 sRet = sRet.replaceAll(
"%PRODUCTVERSION", sVersion );
99 sRet = sRet.replaceAll(
"%ABOUTBOXPRODUCTVERSIONSUFFIX", sAboutBoxVersionSuffix );
100 sRet = sRet.replaceAll(
"%ABOUTBOXPRODUCTVERSION", sAboutBoxVersion );
101 sRet = sRet.replaceAll(
"%OOOVENDOR", sOOOVendor );
102 sRet = sRet.replaceAll(
"%PRODUCTEXTENSION", sExtension );
109 :
public ::cppu::WeakImplHelper<ui::dialogs::XAsynchronousExecutableDialog,
110 task::XJobExecutor, css::lang::XServiceInfo>
119 ServiceImpl( Sequence<Any>
const & args,
128 virtual void SAL_CALL setDialogTitle( OUString
const & aTitle )
override;
129 virtual void SAL_CALL startExecuteModal(
130 Reference< ui::dialogs::XDialogClosedListener >
const & xListener )
override;
133 virtual void SAL_CALL trigger( OUString
const & event )
override;
138 ServiceImpl::ServiceImpl( Sequence<Any>
const& args,
144 std::optional<OUString>
view;
146 std::optional<sal_Bool>
unopkg;
149 }
catch (
const css::lang::IllegalArgumentException & ) {
153 }
catch (
const css::lang::IllegalArgumentException & ) {
162 OUString ServiceImpl::getImplementationName()
164 return "com.sun.star.comp.deployment.ui.PackageManagerDialog";
167 sal_Bool ServiceImpl::supportsService(
const OUString& ServiceName )
172 css::uno::Sequence< OUString > ServiceImpl::getSupportedServiceNames()
174 return {
"com.sun.star.deployment.ui.PackageManagerDialog" };
179 void ServiceImpl::setDialogTitle( OUString
const & title )
188 dialog->SetText( title );
195 void ServiceImpl::startExecuteModal(
196 Reference< ui::dialogs::XDialogClosedListener >
const & xListener )
198 bool bCloseDialog =
true;
199 std::unique_ptr<Application> app;
203 const bool bAppUp = (
GetpApp() !=
nullptr);
204 bool bOfficePipePresent;
208 catch (
const Exception & exc) {
213 VclMessageType::Warning, VclButtonsType::Ok, exc.Message));
219 if (! bOfficePipePresent) {
220 OSL_ASSERT( ! bAppUp );
221 app.reset(
new MyApp );
224 static_cast<OWeakObject *>(
this) );
248 myExtMgr->createDialog(
false );
255 myExtMgr->checkUpdates();
275 xListener->dialogClosed(
276 ui::dialogs::DialogClosedEvent(
277 static_cast< ::cppu::OWeakObject * >(
this),
283 void ServiceImpl::trigger( OUString
const &rEvent )
285 if ( rEvent ==
"SHOW_UPDATE_DIALOG" )
290 startExecuteModal( Reference< ui::dialogs::XDialogClosedListener >() );
295 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
297 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
302 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
304 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
306 return cppu::acquire(
new dp_gui::ServiceImpl(args, context));
309 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
311 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
static OUString getAboutBoxProductVersionSuffix()
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
void syncRepositories(bool force, Reference< ucb::XCommandEnvironment > const &xCmdEnv)
ResHookProc GetReadStringHook()
static::rtl::Reference< TheExtensionManager > get(css::uno::Reference< css::uno::XComponentContext > const &xContext, css::uno::Reference< css::awt::XWindow > const &xParent=nullptr, OUString const &view=OUString())
weld::Window * GetFrameWeld() const
void SetReadStringHook(ResHookProc pProc)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
std::optional< Reference< awt::XWindow > > m_parent
static OUString getProductVersion()
Reference< XComponentContext > const m_xComponentContext
VCL_DLLPUBLIC bool InitVCL()
static OUString getProductName()
static::rtl::Reference< TheExtensionManager > s_ExtMgr
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_UpdateRequiredDialogService_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
exports com.sun.star. view
static OUString getAboutBoxProductVersion()
static vcl::Window * GetActiveTopWindow()
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_LicenseDialog_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
void setProcessServiceFactory(const Reference< XMultiServiceFactory > &xSMgr)
std::optional< OUString > m_extensionURL
static OUString getVendor()
void disposeBridges(Reference< css::uno::XComponentContext > const &ctx)
static OUString ReplaceProductNameHookProc(const OUString &rStr)
Reference< XComponentContext > getProcessComponentContext()
void unwrapArgs(const css::uno::Sequence< css::uno::Any > &seq, Args &...args)
VCL_DLLPUBLIC void DeInitVCL()
static OUString getProductExtension()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_ServiceImpl_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
OUString(* ResHookProc)(const OUString &rStr)
bool m_bDetectedRangeSegmentation false
static void SetDisplayName(const OUString &rDisplayName)