MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / copyButtonPressed

Method copyButtonPressed

gui/nbrowserwindow.cpp:893–912  ·  view source on GitHub ↗

The copy button was pressed

Source from the content-addressed store, hash-verified

891
892// The copy button was pressed
893void NBrowserWindow::copyButtonPressed() {
894// editor->downloadImageAction()->setEnabled(true);
895// selectedFileName = f;
896// selectedFileLid = l.toInt();
897
898 // If we have text selected
899 if (this->editor->selectedText().trimmed() != "") {
900 this->editor->triggerPageAction(QWebPage::Copy);
901 this->editor->setFocus();
902 } else {
903 // If we have an image selected, we copy it to the clipboard.
904 if (editor->downloadImageAction()->isEnabled()) {
905 QString fileName = global.fileManager.getDbaDirPath()+selectedFileName;
906 QApplication::clipboard()->setPixmap(QPixmap(fileName));
907 }
908 }
909
910 microFocusChanged();
911
912}
913
914
915// Build URL from pasted text

Callers

nothing calls this directly

Calls 2

downloadImageActionMethod · 0.80
getDbaDirPathMethod · 0.80

Tested by

no test coverage detected