| 55 | } |
| 56 | |
| 57 | void DependenceManagerPrivate::notify() |
| 58 | { |
| 59 | using namespace std::placeholders; |
| 60 | if (!notifiable) |
| 61 | notifyTimer.start(); |
| 62 | |
| 63 | QStringList actionList { CancelActionID, DependenceManager::tr("Cancel"), |
| 64 | ViewDetails, DependenceManager::tr("View Details"), |
| 65 | InstallActionID, DependenceManager::tr("Install") }; |
| 66 | |
| 67 | QMutexLocker lk(&mutex); |
| 68 | while (!infoList.isEmpty()) { |
| 69 | const auto &info = infoList.takeFirst(); |
| 70 | auto cb = std::bind(&DependenceManagerPrivate::handleActionInvoke, this, _1, info); |
| 71 | QString msg = DependenceManager::tr("Request to install some dependency packages. " |
| 72 | "Do you want to install them?"); |
| 73 | NotificationManager::instance()->notify(0, info.plugin, msg, actionList, cb); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | void DependenceManagerPrivate::handleActionInvoke(const QString &actId, const InstallInfo &info) |
| 78 | { |
no test coverage detected