| 142 | } |
| 143 | |
| 144 | void PythonDebug::notifyToInstall() |
| 145 | { |
| 146 | auto winSrv = dpfGetService(WindowService); |
| 147 | if (!winSrv) |
| 148 | return; |
| 149 | |
| 150 | auto handleInstall = [this](const QString &id) { |
| 151 | if (id == kInstallActId) { |
| 152 | PIPInstaller installer; |
| 153 | InstallInfo info { "", "python", { "debugpy" } }; |
| 154 | installer.install(d->interpreterPath, info); |
| 155 | } |
| 156 | }; |
| 157 | |
| 158 | QStringList acts { kCancelActId, tr("Cancel"), |
| 159 | kInstallActId, tr("Install") }; |
| 160 | winSrv->notifyWithCallback(2, "Python", |
| 161 | tr("You need the corresponding version of the debugger. Please install it and try again."), |
| 162 | acts, handleInstall); |
| 163 | } |