MCPcopy Create free account
hub / github.com/ckaiser/Lightscreen / createUploadMenu

Method createUploadMenu

lightscreenwindow.cpp:278–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void LightscreenWindow::createUploadMenu()
279{
280 auto imgurMenu = new QMenu(tr("Upload"));
281
282 auto uploadAction = new QAction(os::icon("imgur"), tr("&Upload last"), imgurMenu);
283 uploadAction->setToolTip(tr("Upload the last screenshot you took to imgur.com"));
284 connect(uploadAction, &QAction::triggered, this, &LightscreenWindow::uploadLast);
285
286 auto cancelAction = new QAction(os::icon("no"), tr("&Cancel upload"), imgurMenu);
287 cancelAction->setToolTip(tr("Cancel the currently uploading screenshots"));
288 cancelAction->setEnabled(false);
289
290 connect(this, &LightscreenWindow::uploading, cancelAction, &QAction::setEnabled);
291 connect(cancelAction, &QAction::triggered, this, &LightscreenWindow::uploadCancel);
292
293 auto historyAction = new QAction(os::icon("view-history"), tr("View &History"), imgurMenu);
294 connect(historyAction, &QAction::triggered, this, &LightscreenWindow::showHistoryDialog);
295
296 imgurMenu->addAction(uploadAction);
297 imgurMenu->addAction(cancelAction);
298 imgurMenu->addAction(historyAction);
299 imgurMenu->addSeparator();
300
301 connect(imgurMenu, &QMenu::aboutToShow, this, [&, imgurMenu] {
302 imgurMenu->actions().at(0)->setEnabled(!mLastScreenshot.isEmpty());
303 });
304
305 ui.imgurPushButton->setMenu(imgurMenu);
306}
307
308void LightscreenWindow::goToFolder()
309{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected