LibreOffice Module desktop (master)  1
dp_gui_updateinstalldialog.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 
21 #include "dp_gui_updatedata.hxx"
22 
23 #include <sal/config.h>
24 #include <osl/file.hxx>
25 #include <cppuhelper/exc_hlp.hxx>
26 #include <vcl/svapp.hxx>
27 #include <cppuhelper/implbase.hxx>
28 
29 #include <com/sun/star/beans/NamedValue.hpp>
30 #include <com/sun/star/lang/WrappedTargetException.hpp>
31 #include <com/sun/star/ucb/NameClash.hpp>
32 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
33 #include <com/sun/star/ucb/XProgressHandler.hpp>
34 #include <com/sun/star/deployment/DeploymentException.hpp>
35 #include <com/sun/star/deployment/ExtensionManager.hpp>
36 #include <com/sun/star/deployment/LicenseException.hpp>
37 #include <com/sun/star/deployment/VersionException.hpp>
38 #include <com/sun/star/task/XInteractionHandler.hpp>
39 #include <com/sun/star/task/XInteractionApprove.hpp>
40 
42 #include <strings.hrc>
44 #include <dp_shared.hxx>
45 #include <dp_ucb.h>
46 #include <dp_misc.h>
48 #include <ucbhelper/content.hxx>
49 #include <rtl/ref.hxx>
50 #include <salhelper/thread.hxx>
51 #include <com/sun/star/uno/Sequence.h>
53 
54 #include <vector>
55 
56 namespace cssu = ::com::sun::star::uno;
57 
58 using dp_misc::StrTitle;
59 
60 namespace dp_gui {
61 
63  friend class UpdateCommandEnv;
64 public:
65  Thread(cssu::Reference< cssu::XComponentContext > const & ctx,
66  UpdateInstallDialog & dialog, std::vector< dp_gui::UpdateData > & aVecUpdateData);
67 
68  void stop();
69 
70 private:
71  virtual ~Thread() override;
72 
73  virtual void execute() override;
74  void downloadExtensions();
75  bool download(OUString const & aUrls, UpdateData & aUpdatData);
76  void installExtensions();
77  void removeTempDownloads();
78 
80 
81  // guarded by Application::GetSolarMutex():
82  cssu::Reference< css::task::XAbortChannel > m_abort;
83  cssu::Reference< cssu::XComponentContext > m_xComponentContext;
84  std::vector< dp_gui::UpdateData > & m_aVecUpdateData;
86 
87  //A folder which is created in the temp directory in which then the updates are downloaded
89 
90  bool m_stop;
91 
92 };
93 
95  : public ::cppu::WeakImplHelper< css::ucb::XCommandEnvironment,
96  css::task::XInteractionHandler,
97  css::ucb::XProgressHandler >
98 {
100 
102  cssu::Reference< cssu::XComponentContext > m_xContext;
103 
104 public:
105  UpdateCommandEnv( cssu::Reference< cssu::XComponentContext > const & xCtx,
107 
108  // XCommandEnvironment
109  virtual cssu::Reference<css::task::XInteractionHandler > SAL_CALL
110  getInteractionHandler() override;
111  virtual cssu::Reference<css::ucb::XProgressHandler >
112  SAL_CALL getProgressHandler() override;
113 
114  // XInteractionHandler
115  virtual void SAL_CALL handle(
116  cssu::Reference<css::task::XInteractionRequest > const & xRequest ) override;
117 
118  // XProgressHandler
119  virtual void SAL_CALL push( cssu::Any const & Status ) override;
120  virtual void SAL_CALL update( cssu::Any const & Status ) override;
121  virtual void SAL_CALL pop() override;
122 };
123 
124 
126  cssu::Reference< cssu::XComponentContext> const & xCtx,
127  UpdateInstallDialog & dialog,
128  std::vector< dp_gui::UpdateData > & aVecUpdateData):
129  salhelper::Thread("dp_gui_updateinstalldialog"),
130  m_dialog(dialog),
131  m_xComponentContext(xCtx),
132  m_aVecUpdateData(aVecUpdateData),
133  m_updateCmdEnv(new UpdateCommandEnv(xCtx, this)),
134  m_stop(false)
135 {}
136 
138  cssu::Reference< css::task::XAbortChannel > abort;
139  {
140  SolarMutexGuard g;
141  abort = m_abort;
142  m_stop = true;
143  }
144  if (abort.is()) {
145  abort->sendAbort();
146  }
147 }
148 
150 
152 {
153  try {
154  downloadExtensions();
155  installExtensions();
156  }
157  catch (...)
158  {
159  }
160 
161  //clean up the temp directories
162  try {
163  removeTempDownloads();
164  } catch( ... ) {
165  }
166 
167  {
168  //make sure m_dialog is still alive
169  SolarMutexGuard g;
170  if (! m_stop)
171  m_dialog.updateDone();
172  }
173  //UpdateCommandEnv keeps a reference to Thread and prevents destruction. Therefore remove it.
174  m_updateCmdEnv->m_installThread.clear();
175 }
176 
178  weld::Window* pParent,
179  std::vector<dp_gui::UpdateData> & aVecUpdateData,
180  cssu::Reference< cssu::XComponentContext > const & xCtx)
181  : GenericDialogController(pParent, "desktop/ui/updateinstalldialog.ui",
182  "UpdateInstallDialog")
183  , m_thread(new Thread(xCtx, *this, aVecUpdateData))
184  , m_bError(false)
185  , m_bNoEntry(true)
186  , m_sInstalling(DpResId(RID_DLG_UPDATE_INSTALL_INSTALLING))
187  , m_sFinished(DpResId(RID_DLG_UPDATE_INSTALL_FINISHED))
188  , m_sNoErrors(DpResId(RID_DLG_UPDATE_INSTALL_NO_ERRORS))
189  , m_sErrorDownload(DpResId(RID_DLG_UPDATE_INSTALL_ERROR_DOWNLOAD))
190  , m_sErrorInstallation(DpResId(RID_DLG_UPDATE_INSTALL_ERROR_INSTALLATION))
191  , m_sErrorLicenseDeclined(DpResId(RID_DLG_UPDATE_INSTALL_ERROR_LIC_DECLINED))
192  , m_sNoInstall(DpResId(RID_DLG_UPDATE_INSTALL_EXTENSION_NOINSTALL))
193  , m_sThisErrorOccurred(DpResId(RID_DLG_UPDATE_INSTALL_THIS_ERROR_OCCURRED))
194  , m_xFt_action(m_xBuilder->weld_label("DOWNLOADING"))
195  , m_xStatusbar(m_xBuilder->weld_progress_bar("STATUSBAR"))
196  , m_xFt_extension_name(m_xBuilder->weld_label("EXTENSION_NAME"))
197  , m_xMle_info(m_xBuilder->weld_text_view("INFO"))
198  , m_xHelp(m_xBuilder->weld_button("help"))
199  , m_xOk(m_xBuilder->weld_button("ok"))
200  , m_xCancel(m_xBuilder->weld_button("cancel"))
201 {
202  m_xMle_info->set_size_request(m_xMle_info->get_approximate_digit_width() * 52,
203  m_xMle_info->get_height_rows(5));
204 
205  m_xExtensionManager = css::deployment::ExtensionManager::get( xCtx );
206 
207  m_xCancel->connect_clicked(LINK(this, UpdateInstallDialog, cancelHandler));
209  m_xHelp->set_sensitive(false);
210 }
211 
213 {
214 }
215 
217 {
218  m_thread->launch();
219  short nRet = GenericDialogController::run();
220  m_thread->stop();
221  return nRet;
222 }
223 
224 // make sure the solar mutex is locked before calling
226 {
227  if (!m_bError)
228  m_xMle_info->set_text(m_xMle_info->get_text() + m_sNoErrors);
229  m_xOk->set_sensitive(true);
230  m_xOk->grab_focus();
231  m_xCancel->set_sensitive(false);
232 }
233 
234 // make sure the solar mutex is locked before calling
235 //sets an error message in the text area
236 void UpdateInstallDialog::setError(INSTALL_ERROR err, OUString const & sExtension,
237  OUString const & exceptionMessage)
238 {
239  OUString sError;
240  m_bError = true;
241 
242  switch (err)
243  {
244  case ERROR_DOWNLOAD:
245  sError = m_sErrorDownload;
246  break;
247  case ERROR_INSTALLATION:
248  sError = m_sErrorInstallation;
249  break;
251  sError = m_sErrorLicenseDeclined;
252  break;
253 
254  default:
255  OSL_ASSERT(false);
256  }
257 
258  OUString sMsg(m_xMle_info->get_text());
259  sError = sError.replaceFirst("%NAME", sExtension);
260  //We want to have an empty line between the error messages. However,
261  //there shall be no empty line after the last entry.
262  if (m_bNoEntry)
263  m_bNoEntry = false;
264  else
265  sMsg += "\n";
266  sMsg += sError;
267  //Insert more information about the error
268  if (!exceptionMessage.isEmpty())
269  sMsg += m_sThisErrorOccurred + exceptionMessage + "\n";
270 
271  sMsg += m_sNoInstall + "\n";
272 
273  m_xMle_info->set_text(sMsg);
274 }
275 
276 void UpdateInstallDialog::setError(OUString const & exceptionMessage)
277 {
278  m_bError = true;
279  m_xMle_info->set_text(m_xMle_info->get_text() + exceptionMessage + "\n");
280 }
281 
283 {
284  m_xDialog->response(RET_CANCEL);
285 }
286 
288 {
289  try
290  {
291  //create the download directory in the temp folder
292  OUString sTempDir;
293  if (::osl::FileBase::getTempDirURL(sTempDir) != ::osl::FileBase::E_None)
294  throw cssu::Exception("Could not get URL for the temp directory. No extensions will be installed.", nullptr);
295 
296  //create a unique name for the directory
297  OUString tempEntry, destFolder;
298  if (::osl::File::createTempFile(&sTempDir, nullptr, &tempEntry ) != ::osl::File::E_None)
299  throw cssu::Exception("Could not create a temporary file in " + sTempDir +
300  ". No extensions will be installed", nullptr );
301 
302  tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
303 
304  destFolder = dp_misc::makeURL( sTempDir, tempEntry ) + "_";
305  m_sDownloadFolder = destFolder;
306  try
307  {
308  dp_misc::create_folder(nullptr, destFolder, m_updateCmdEnv.get() );
309  } catch (const cssu::Exception & e)
310  {
311  css::uno::Any anyEx = cppu::getCaughtException();
312  throw css::lang::WrappedTargetException( e.Message + " No extensions will be installed",
313  nullptr, anyEx );
314  }
315 
316 
317  sal_uInt16 count = 0;
318  for (auto & updateData : m_aVecUpdateData)
319  {
320  if (!updateData.aUpdateInfo.is() || updateData.aUpdateSource.is())
321  continue;
322  //We assume that m_aVecUpdateData contains only information about extensions which
323  //can be downloaded directly.
324  OSL_ASSERT(updateData.sWebsiteURL.isEmpty());
325 
326  //update the name of the extension which is to be downloaded
327  {
328  SolarMutexGuard g;
329  if (m_stop) {
330  return;
331  }
332  m_dialog.m_xFt_extension_name->set_label(updateData.aInstalledPackage->getDisplayName());
333  sal_uInt16 prog = (sal::static_int_cast<sal_uInt16>(100) * ++count) /
334  sal::static_int_cast<sal_uInt16>(m_aVecUpdateData.size());
335  m_dialog.m_xStatusbar->set_percentage(prog);
336  }
337  dp_misc::DescriptionInfoset info(m_xComponentContext, updateData.aUpdateInfo);
338  //remember occurring exceptions in case we need to print out error information
339  std::vector< std::pair<OUString, cssu::Exception> > vecExceptions;
340  cssu::Sequence<OUString> seqDownloadURLs = info.getUpdateDownloadUrls();
341  OSL_ENSURE(seqDownloadURLs.hasElements(), "No download URL provided!");
342  for (sal_Int32 j = 0; j < seqDownloadURLs.getLength(); j++)
343  {
344  try
345  {
346  OSL_ENSURE(!seqDownloadURLs[j].isEmpty(), "Download URL is empty!");
347  bool bCancelled = download(seqDownloadURLs[j], updateData);
348  if (bCancelled || !updateData.sLocalURL.isEmpty())
349  break;
350  }
351  catch ( cssu::Exception & e )
352  {
353  vecExceptions.emplace_back(seqDownloadURLs[j], e);
354  //There can be several different errors, for example, the URL is wrong, webserver cannot be reached,
355  //name cannot be resolved. The UCB helper API does not specify different special exceptions for these
356  //cases. Therefore ignore and continue.
357  continue;
358  }
359  }
360  //update the progress and display download error
361  {
362  SolarMutexGuard g;
363  if (m_stop) {
364  return;
365  }
366  if (updateData.sLocalURL.isEmpty())
367  {
368  //Construct a string of all messages contained in the exceptions plus the respective download URLs
369  OUStringBuffer buf(256);
370  size_t nPos = 0;
371  for (auto const& elem : vecExceptions)
372  {
373  if (nPos)
374  buf.append("\n");
375  buf.append("Could not download ");
376  buf.append(elem.first);
377  buf.append(". ");
378  buf.append(elem.second.Message);
379  ++nPos;
380  }
381  m_dialog.setError(UpdateInstallDialog::ERROR_DOWNLOAD, updateData.aInstalledPackage->getDisplayName(),
382  buf.makeStringAndClear());
383  }
384  }
385 
386  }
387  }
388  catch (const cssu::Exception & e)
389  {
390  SolarMutexGuard g;
391  if (m_stop) {
392  return;
393  }
394  m_dialog.setError(e.Message);
395  }
396 }
397 
399 {
400  //Update the fix text in the dialog to "Installing extensions..."
401  {
402  SolarMutexGuard g;
403  if (m_stop) {
404  return;
405  }
406  m_dialog.m_xFt_action->set_label(m_dialog.m_sInstalling);
407  m_dialog.m_xStatusbar->set_percentage(0);
408  }
409 
410  sal_uInt16 count = 0;
411  for (auto const& updateData : m_aVecUpdateData)
412  {
413  //update the name of the extension which is to be installed
414  {
415  SolarMutexGuard g;
416  if (m_stop) {
417  return;
418  }
419  //we only show progress after an extension has been installed.
420  if (count > 0) {
421  m_dialog.m_xStatusbar->set_percentage(
422  (sal::static_int_cast<sal_uInt16>(100) * count) /
423  sal::static_int_cast<sal_uInt16>(m_aVecUpdateData.size()));
424  }
425  m_dialog.m_xFt_extension_name->set_label(updateData.aInstalledPackage->getDisplayName());
426  }
427  bool bError = false;
428  bool bLicenseDeclined = false;
429  cssu::Reference<css::deployment::XPackage> xExtension;
430  cssu::Exception exc;
431  try
432  {
433  cssu::Reference< css::task::XAbortChannel > xAbortChannel(
434  updateData.aInstalledPackage->createAbortChannel() );
435  {
436  SolarMutexGuard g;
437  if (m_stop) {
438  return;
439  }
440  m_abort = xAbortChannel;
441  }
442  if (!updateData.aUpdateSource.is() && !updateData.sLocalURL.isEmpty())
443  {
444  css::beans::NamedValue prop("EXTENSION_UPDATE", css::uno::makeAny(OUString("1")));
445  if (!updateData.bIsShared)
446  xExtension = m_dialog.getExtensionManager()->addExtension(
447  updateData.sLocalURL, css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
448  "user", xAbortChannel, m_updateCmdEnv.get());
449  else
450  xExtension = m_dialog.getExtensionManager()->addExtension(
451  updateData.sLocalURL, css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
452  "shared", xAbortChannel, m_updateCmdEnv.get());
453  }
454  else if (updateData.aUpdateSource.is())
455  {
456  OSL_ASSERT(updateData.aUpdateSource.is());
457  //I am not sure if we should obtain the install properties and pass them into
458  //add extension. Currently it contains only "SUPPRESS_LICENSE". So it could happen
459  //that a license is displayed when updating from the shared repository, although the
460  //shared extension was installed using "SUPPRESS_LICENSE".
461  css::beans::NamedValue prop("EXTENSION_UPDATE", css::uno::makeAny(OUString("1")));
462  if (!updateData.bIsShared)
463  xExtension = m_dialog.getExtensionManager()->addExtension(
464  updateData.aUpdateSource->getURL(), css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
465  "user", xAbortChannel, m_updateCmdEnv.get());
466  else
467  xExtension = m_dialog.getExtensionManager()->addExtension(
468  updateData.aUpdateSource->getURL(), css::uno::Sequence<css::beans::NamedValue>(&prop, 1),
469  "shared", xAbortChannel, m_updateCmdEnv.get());
470  }
471  }
472  catch (css::deployment::DeploymentException & de)
473  {
474  if (de.Cause.has<css::deployment::LicenseException>())
475  {
476  bLicenseDeclined = true;
477  }
478  else
479  {
480  exc = de.Cause.get<cssu::Exception>();
481  bError = true;
482  }
483  }
484  catch (cssu::Exception& e)
485  {
486  exc = e;
487  bError = true;
488  }
489 
490  if (bLicenseDeclined)
491  {
492  SolarMutexGuard g;
493  if (m_stop) {
494  return;
495  }
497  updateData.aInstalledPackage->getDisplayName(), OUString());
498  }
499  else if (!xExtension.is() || bError)
500  {
501  SolarMutexGuard g;
502  if (m_stop) {
503  return;
504  }
505  m_dialog.setError(UpdateInstallDialog::ERROR_INSTALLATION,
506  updateData.aInstalledPackage->getDisplayName(), exc.Message);
507  }
508  ++count;
509  }
510  {
511  SolarMutexGuard g;
512  if (m_stop) {
513  return;
514  }
515  m_dialog.m_xStatusbar->set_percentage(100);
516  m_dialog.m_xFt_extension_name->set_label(OUString());
517  m_dialog.m_xFt_action->set_label(m_dialog.m_sFinished);
518  }
519 }
520 
522 {
523  if (!m_sDownloadFolder.isEmpty())
524  {
525  dp_misc::erase_path(m_sDownloadFolder,
526  cssu::Reference<css::ucb::XCommandEnvironment>(),false /* no throw: ignore errors */ );
527  //remove also the temp file which we have used to create the unique name
528  OUString tempFile = m_sDownloadFolder.copy(0, m_sDownloadFolder.getLength() - 1);
529  dp_misc::erase_path(tempFile, cssu::Reference<css::ucb::XCommandEnvironment>(),false);
530  m_sDownloadFolder.clear();
531  }
532 }
533 
534 bool UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, UpdateData & aUpdateData)
535 {
536  {
537  SolarMutexGuard g;
538  if (m_stop) {
539  return m_stop;
540  }
541  }
542 
543  OSL_ASSERT(m_sDownloadFolder.getLength());
544  OUString destFolder, tempEntry;
545  if (::osl::File::createTempFile(
546  &m_sDownloadFolder,
547  nullptr, &tempEntry ) != ::osl::File::E_None)
548  {
549  //ToDo feedback in window that download of this component failed
550  throw cssu::Exception("Could not create temporary file in folder " + destFolder + ".", nullptr);
551  }
552  tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
553 
554  destFolder = dp_misc::makeURL( m_sDownloadFolder, tempEntry ) + "_";
555 
556  ::ucbhelper::Content destFolderContent;
557  dp_misc::create_folder( &destFolderContent, destFolder, m_updateCmdEnv.get() );
558 
559  ::ucbhelper::Content sourceContent;
560  (void)dp_misc::create_ucb_content(&sourceContent, sDownloadURL, m_updateCmdEnv.get());
561 
562  const OUString sTitle( StrTitle::getTitle( sourceContent ) );
563 
564  destFolderContent.transferContent(
565  sourceContent, ::ucbhelper::InsertOperation::Copy,
566  sTitle, css::ucb::NameClash::OVERWRITE );
567 
568  {
569  //the user may have cancelled the dialog because downloading took too long
570  SolarMutexGuard g;
571  if (m_stop) {
572  return m_stop;
573  }
574  //all errors should be handled by the command environment.
575  aUpdateData.sLocalURL = destFolder + "/" + sTitle;
576  }
577 
578  return m_stop;
579 }
580 
581 UpdateCommandEnv::UpdateCommandEnv( cssu::Reference< cssu::XComponentContext > const & xCtx,
583  : m_installThread(thread),
584  m_xContext(xCtx)
585 {
586 }
587 
588 // XCommandEnvironment
589 cssu::Reference<css::task::XInteractionHandler> UpdateCommandEnv::getInteractionHandler()
590 {
591  return this;
592 }
593 
594 cssu::Reference<css::ucb::XProgressHandler> UpdateCommandEnv::getProgressHandler()
595 {
596  return this;
597 }
598 
599 // XInteractionHandler
601  cssu::Reference< css::task::XInteractionRequest> const & xRequest )
602 {
603  cssu::Any request( xRequest->getRequest() );
604  OSL_ASSERT( request.getValueTypeClass() == cssu::TypeClass_EXCEPTION );
605  dp_misc::TRACE("[dp_gui_cmdenv.cxx] incoming request:\n"
606  + ::comphelper::anyToString(request) + "\n\n");
607 
608  css::deployment::VersionException verExc;
609  bool approve = false;
610 
611  if (request >>= verExc)
612  { //We must catch the version exception during the update,
613  //because otherwise the user would be confronted with the dialogs, asking
614  //them if they want to replace an already installed version of the same extension.
615  //During an update we assume that we always want to replace the old version with the
616  //new version.
617  approve = true;
618  }
619 
620  if (!approve)
621  {
622  //forward to interaction handler for main dialog.
624  }
625  else
626  {
627  // select:
628  cssu::Sequence< cssu::Reference< css::task::XInteractionContinuation > > conts(
629  xRequest->getContinuations() );
630  cssu::Reference< css::task::XInteractionContinuation > const * pConts =
631  conts.getConstArray();
632  sal_Int32 len = conts.getLength();
633  for ( sal_Int32 pos = 0; pos < len; ++pos )
634  {
635  if (approve) {
636  cssu::Reference< css::task::XInteractionApprove > xInteractionApprove(
637  pConts[ pos ], cssu::UNO_QUERY );
638  if (xInteractionApprove.is()) {
639  xInteractionApprove->select();
640  // don't query again for ongoing continuations:
641  approve = false;
642  }
643  }
644  }
645  }
646 }
647 
648 // XProgressHandler
649 void UpdateCommandEnv::push( cssu::Any const & /*Status*/ )
650 {
651 }
652 
653 void UpdateCommandEnv::update( cssu::Any const & /*Status */)
654 {
655 }
656 
658 {
659 }
660 
661 
662 } //end namespace dp_gui
663 
664 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void setError(INSTALL_ERROR err, OUString const &sExtension, OUString const &exceptionMessage)
std::shared_ptr< weld::Dialog > m_xDialog
The modal “Download and Installation” dialog.
const size_t count(pCandidateA->getBorderLines().size())
std::unique_ptr< weld::Button > m_xCancel
std::vector< dp_gui::UpdateData > & m_aVecUpdateData
std::unique_ptr< weld::Builder > m_xBuilder
css::uno::Sequence< OUString > getUpdateDownloadUrls() const
Return the download URLs from the update information.
std::unique_ptr< weld::Button > m_xHelp
Thread(cssu::Reference< cssu::XComponentContext > const &ctx, UpdateInstallDialog &dialog, std::vector< dp_gui::UpdateData > &aVecUpdateData)
bool office_is_running()
Definition: dp_misc.cxx:333
OUString makeURL(OUString const &baseURL, OUString const &relPath_)
appends a relative path to a url.
Definition: dp_misc.cxx:251
type_info_ info
virtual void SAL_CALL push(cssu::Any const &Status) override
cssu::Reference< cssu::XComponentContext > m_xComponentContext
RET_CANCEL
IMPL_LINK_NOARG(ExtMgrDialog, HandleCancelBtn, weld::Button &, void)
cssu::Reference< cssu::XComponentContext > m_xContext
Any SAL_CALL getCaughtException()
size_t pos
virtual cssu::Reference< css::ucb::XProgressHandler > SAL_CALL getProgressHandler() override
std::unique_ptr< weld::Label > m_xFt_extension_name
Reference< XComponentContext > const m_xComponentContext
cssu::Reference< css::task::XAbortChannel > m_abort
::rtl::Reference< UpdateInstallDialog::Thread > m_installThread
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
virtual void SAL_CALL pop() override
GenericDialogController(weld::Widget *pParent, const OUString &rUIFile, const OString &rDialogId)
std::unique_ptr< weld::TextView > m_xMle_info
bool download(OUString const &aUrls, UpdateData &aUpdatData)
css::uno::Reference< css::ucb::XContent > get() const
void handleInteractionRequest(const uno::Reference< uno::XComponentContext > &xContext, const uno::Reference< task::XInteractionRequest > &xRequest)
::rtl::Reference< UpdateCommandEnv > m_updateCmdEnv
void TRACE(OUString const &sText)
print the text to the console in a debug build.
Definition: dp_misc.cxx:488
std::unique_ptr< weld::Label > m_xFt_action
UpdateCommandEnv(cssu::Reference< cssu::XComponentContext > const &xCtx,::rtl::Reference< UpdateInstallDialog::Thread >const &thread)
void transferContent(const Content &rSourceContent, InsertOperation eOperation, const OUString &rTitle, const sal_Int32 nNameClashAction, const OUString &rMimeType=OUString(), bool bMajorVersion=false, const OUString &rCommentVersion=OUString(), OUString *pResultURL=nullptr, const OUString &rDocumentId=OUString()) const
std::unique_ptr< weld::ProgressBar > m_xStatusbar
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool erase_path(OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
std::unique_ptr< weld::Button > m_xOk
OUString DpResId(const char *pId)
Definition: dp_shared.hxx:37
css::uno::Reference< css::deployment::XExtensionManager > m_xExtensionManager
UpdateInstallDialog(weld::Window *parent, std::vector< UpdateData > &aVecUpdateData, css::uno::Reference< css::uno::XComponentContext > const &xCtx)
Create an instance.
Definition: dp_gui.h:23
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_folder(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
virtual void SAL_CALL handle(cssu::Reference< css::task::XInteractionRequest > const &xRequest) override
virtual cssu::Reference< css::task::XInteractionHandler > SAL_CALL getInteractionHandler() override
virtual void SAL_CALL update(cssu::Any const &Status) override
sal_uInt16 nPos
uno::Reference< uno::XComponentContext > m_xContext
OUString anyToString(uno::Any const &value)
Access to the content of an XML description element.
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo