| 198 | } |
| 199 | |
| 200 | QMenu *TrayIcon::contextMenu() |
| 201 | { |
| 202 | QMenu *menu = new QMenu(); |
| 203 | { |
| 204 | captureAction_ = menu->addAction(tr("Capture")); |
| 205 | connect(captureAction_, &QAction::triggered, // |
| 206 | this, [this] { manager_.capture(); }); |
| 207 | } |
| 208 | { |
| 209 | repeatCaptureAction_ = menu->addAction(tr("Repeat capture")); |
| 210 | connect(repeatCaptureAction_, &QAction::triggered, // |
| 211 | this, [this] { manager_.repeatCapture(); }); |
| 212 | } |
| 213 | { |
| 214 | captureLockedAction_ = menu->addAction(tr("Capture saved areas")); |
| 215 | connect(captureLockedAction_, &QAction::triggered, // |
| 216 | this, [this] { manager_.captureLocked(); }); |
| 217 | } |
| 218 | |
| 219 | { |
| 220 | QMenu *translateMenu = menu->addMenu(tr("Result")); |
| 221 | { |
| 222 | showLastAction_ = translateMenu->addAction(tr("Show")); |
| 223 | connect(showLastAction_, &QAction::triggered, // |
| 224 | this, [this] { manager_.showLast(); }); |
| 225 | } |
| 226 | { |
| 227 | clipboardAction_ = translateMenu->addAction(tr("To clipboard")); |
| 228 | connect(clipboardAction_, &QAction::triggered, // |
| 229 | this, [this] { manager_.copyLastToClipboard(); }); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | { |
| 234 | auto action = menu->addAction(tr("Show translator")); |
| 235 | connect(action, &QAction::triggered, // |
| 236 | this, [this] { manager_.showTranslator(); }); |
| 237 | } |
| 238 | |
| 239 | { |
| 240 | settingsAction_ = menu->addAction(tr("Settings")); |
| 241 | connect(settingsAction_, &QAction::triggered, // |
| 242 | this, [this] { manager_.settings(); }); |
| 243 | } |
| 244 | |
| 245 | { |
| 246 | auto action = menu->addAction(tr("Quit")); |
| 247 | connect(action, &QAction::triggered, // |
| 248 | this, [this] { manager_.quit(); }); |
| 249 | } |
| 250 | |
| 251 | return menu; |
| 252 | } |
nothing calls this directly
no test coverage detected