~morphis/ubuntu-system-settings/enable-hotspot-for-mako

« back to all changes in this revision

Viewing changes to plugins/system-update/update_manager.cpp

  • Committer: CI Train Bot
  • Author(s): Ken VanDine
  • Date: 2016-03-12 03:41:03 UTC
  • mfrom: (1595.2.10 force_download)
  • Revision ID: ci-train-bot@canonical.com-20160312034103-x6xpglemjk3nsfjx
Added status tracking for updates to be used for system updates. Added handling of started signal from system-image-dbus as well as ForceAllowGSMDownload Fixes: #1508081
Approved by: Jonas G. Drange

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
                  SLOT(updateFailed(int, QString)));
108
108
    QObject::connect(&m_systemUpdate, SIGNAL(updatePaused(int)),
109
109
                  SLOT(systemUpdatePaused(int)));
 
110
    QObject::connect(&m_systemUpdate, SIGNAL(downloadStarted()),
 
111
                  SLOT(systemUpdateDownloadStarted()));
110
112
    QObject::connect(&m_systemUpdate, SIGNAL(updateProgress(int, double)),
111
113
                  SLOT(systemUpdateProgress(int, double)));
112
114
    QObject::connect(&m_systemUpdate, SIGNAL(rebooting(bool)),
303
305
        update->setSelected(true);
304
306
        update->setUpdateState(false);
305
307
        update->setDownloadProgress(value);
 
308
        update->setStatus(Update::Paused);
306
309
    }
307
310
}
308
311
 
 
312
void UpdateManager::systemUpdateDownloadStarted()
 
313
{                 
 
314
    QString packagename(UBUNTU_PACKAGE_NAME);
 
315
    if (m_apps.contains(packagename)) {
 
316
        Update *update = m_apps[packagename];
 
317
        update->setSelected(true);
 
318
        update->setUpdateState(true);
 
319
        update->setStatus(Update::Downloading);
 
320
    }
 
321
 
322
 
309
323
void UpdateManager::systemUpdateProgress(int value, double eta)
310
324
{
311
325
    Q_UNUSED(eta);
326
340
    }
327
341
}
328
342
 
 
343
void UpdateManager::forceAllowGSMDownload(const QString &packagename)
 
344
{
 
345
    if (!m_apps[packagename]->systemUpdate()) 
 
346
        return;
 
347
 
 
348
    m_apps[packagename]->setUpdateState(true);
 
349
        m_systemUpdate.forceAllowGSMDownload();
 
350
}
 
351
 
329
352
void UpdateManager::retryDownload(const QString &packagename)
330
353
{
331
354
    if (m_apps[packagename]->systemUpdate()) {