Changeset 90626 in vbox
- Timestamp:
- Aug 11, 2021 12:48:59 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146238
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloader.cpp
r90551 r90626 84 84 /* Notify listeners: */ 85 85 emit sigProgressFailed(strError); 86 /* Delete downloader: */87 deleteLater();88 86 } 89 87 … … 92 90 /* Notify listeners: */ 93 91 emit sigProgressCanceled(); 94 /* Delete downloader: */95 deleteLater();96 92 } 97 93 … … 136 132 /* Notify listeners: */ 137 133 emit sigProgressFinished(); 138 /* Delete downloader: */139 deleteLater();140 134 } 141 135 } … … 156 150 /* Notify listeners: */ 157 151 emit sigProgressFinished(); 158 /* Delete downloader: */159 deleteLater();160 152 } 161 153 } … … 168 160 /* Notify listeners: */ 169 161 emit sigProgressFinished(); 170 /* Delete downloader: */171 deleteLater();172 162 } -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateManager.cpp
r90620 r90626 208 208 connect(pNotification, &UINotificationDownloaderExtensionPack::sigExtensionPackDownloaded, 209 209 this, &UIUpdateStepVirtualBoxExtensionPack::sltHandleDownloadedExtensionPack); 210 /* Also, destroyed downloader is a signal to finish the step: */ 211 connect(pNotification, &UINotificationDownloaderExtensionPack::sigDownloaderDestroyed, 210 /* Handle any signal as step-finished: */ 211 connect(pNotification, &UINotificationDownloaderExtensionPack::sigProgressFailed, 212 this, &UIUpdateStepVirtualBoxExtensionPack::sigStepFinished); 213 connect(pNotification, &UINotificationDownloaderExtensionPack::sigProgressCanceled, 214 this, &UIUpdateStepVirtualBoxExtensionPack::sigStepFinished); 215 connect(pNotification, &UINotificationDownloaderExtensionPack::sigProgressFinished, 212 216 this, &UIUpdateStepVirtualBoxExtensionPack::sigStepFinished); 213 217 /* Append and start notification: */ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.cpp
r90625 r90626 123 123 124 124 UINotificationDownloader::UINotificationDownloader() 125 : m_pDownloader(0) 125 126 { 126 127 } … … 129 130 { 130 131 delete m_pDownloader; 132 m_pDownloader = 0; 131 133 } 132 134 … … 163 165 this, &UINotificationDownloader::sltHandleProgressFailed); 164 166 connect(m_pDownloader, &UIDownloader::sigProgressCanceled, 165 this, &UINotificationDownloader::s igProgressCanceled);167 this, &UINotificationDownloader::sltHandleProgressCanceled); 166 168 connect(m_pDownloader, &UIDownloader::sigProgressFinished, 167 this, &UINotificationDownloader::sigProgressFinished); 168 connect(m_pDownloader, &UIDownloader::destroyed, 169 this, &UINotificationDownloader::sigDownloaderDestroyed); 169 this, &UINotificationDownloader::sltHandleProgressFinished); 170 170 171 171 /* And start it finally: */ … … 191 191 void UINotificationDownloader::sltHandleProgressFailed(const QString &strError) 192 192 { 193 delete m_pDownloader; 194 m_pDownloader = 0; 193 195 m_strError = strError; 194 196 emit sigProgressFailed(); 197 } 198 199 void UINotificationDownloader::sltHandleProgressCanceled() 200 { 201 delete m_pDownloader; 202 m_pDownloader = 0; 203 emit sigProgressCanceled(); 204 } 205 206 void UINotificationDownloader::sltHandleProgressFinished() 207 { 208 delete m_pDownloader; 209 m_pDownloader = 0; 210 emit sigProgressFinished(); 195 211 } 196 212 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.h
r90625 r90626 24 24 /* Qt includes: */ 25 25 #include <QObject> 26 #include <QPointer>27 26 28 27 /* GUI includes: */ … … 148 147 void sigProgressFinished(); 149 148 150 /** Notifies listeners about downloader destroyed. */151 void sigDownloaderDestroyed();152 153 149 public: 154 150 … … 181 177 * @param uPercent Brings new progress percentage value. */ 182 178 void sltHandleProgressChange(ulong uPercent); 183 /** Handles signal about progress failed.184 * @param strError Brings error message if any. */185 void sltHandleProgressFailed(const QString &strError);186 187 private:188 189 /** Holds the instance of downloader being wrapped by this notification-downloader. */190 QPointer<UIDownloader> m_pDownloader;191 192 /** Holds the last cached progress percentage value. */193 ulong m_uPercent;194 /** Holds the error message is any. */195 QString m_strError;196 };197 198 /** UINotificationObject extension for notification-new-version-checker. */199 class SHARED_LIBRARY_STUFF UINotificationNewVersionChecker : public UINotificationObject200 {201 Q_OBJECT;202 203 signals:204 205 /** Notifies listeners about progress failed. */206 void sigProgressFailed();207 /** Notifies listeners about progress canceled. */208 void sigProgressCanceled();209 /** Notifies listeners about progress finished. */210 void sigProgressFinished();211 212 public:213 214 /** Constructs notification-new-version-checker. */215 UINotificationNewVersionChecker();216 /** Destructs notification-new-version-checker. */217 virtual ~UINotificationNewVersionChecker() /* override final */;218 219 /** Creates and returns started checker-wrapper. */220 virtual UINewVersionChecker *createChecker() = 0;221 222 /** Returns whether current progress is done. */223 bool isDone() const;224 /** Returns error-message if any. */225 QString error() const;226 227 /** Returns whether object is critical. */228 virtual bool isCritical() const;229 /** Handles notification-object being added. */230 virtual void handle() /* override final */;231 232 public slots:233 234 /** Stops the checker and notifies model about closing. */235 virtual void close() /* override final */;236 237 private slots:238 239 179 /** Handles signal about progress failed. 240 180 * @param strError Brings error message if any. */ … … 247 187 private: 248 188 189 /** Holds the instance of downloader being wrapped by this notification-downloader. */ 190 UIDownloader *m_pDownloader; 191 192 /** Holds the last cached progress percentage value. */ 193 ulong m_uPercent; 194 /** Holds the error message is any. */ 195 QString m_strError; 196 }; 197 198 /** UINotificationObject extension for notification-new-version-checker. */ 199 class SHARED_LIBRARY_STUFF UINotificationNewVersionChecker : public UINotificationObject 200 { 201 Q_OBJECT; 202 203 signals: 204 205 /** Notifies listeners about progress failed. */ 206 void sigProgressFailed(); 207 /** Notifies listeners about progress canceled. */ 208 void sigProgressCanceled(); 209 /** Notifies listeners about progress finished. */ 210 void sigProgressFinished(); 211 212 public: 213 214 /** Constructs notification-new-version-checker. */ 215 UINotificationNewVersionChecker(); 216 /** Destructs notification-new-version-checker. */ 217 virtual ~UINotificationNewVersionChecker() /* override final */; 218 219 /** Creates and returns started checker-wrapper. */ 220 virtual UINewVersionChecker *createChecker() = 0; 221 222 /** Returns whether current progress is done. */ 223 bool isDone() const; 224 /** Returns error-message if any. */ 225 QString error() const; 226 227 /** Returns whether object is critical. */ 228 virtual bool isCritical() const; 229 /** Handles notification-object being added. */ 230 virtual void handle() /* override final */; 231 232 public slots: 233 234 /** Stops the checker and notifies model about closing. */ 235 virtual void close() /* override final */; 236 237 private slots: 238 239 /** Handles signal about progress failed. 240 * @param strError Brings error message if any. */ 241 void sltHandleProgressFailed(const QString &strError); 242 /** Handles signal about progress canceled. */ 243 void sltHandleProgressCanceled(); 244 /** Handles signal about progress finished. */ 245 void sltHandleProgressFinished(); 246 247 private: 248 249 249 /** Holds the instance of checker being wrapped by this notification-new-version-checker. */ 250 250 UINewVersionChecker *m_pChecker;
Note:
See TracChangeset
for help on using the changeset viewer.