Add --pin, --upload, --accept-on-select to CLI (#1970)
* Add --pin option Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Add --upload option Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Add --accept-on-select option Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix failing build on MacOS Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Clean up option variable names in main Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Remove missing --path error Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Add tests for action options Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix file extension config option Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix --print-geometry bug Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Replace Qt::endl with "\n" Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix copy/upload task clipboard conflict Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix endless loop when using --raw and --delay Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix bug in upload handling Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Show dialog after upload if --clipboard is set Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com> * Fix failing build on Mac and Win Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
This commit is contained in:
@@ -1021,6 +1021,17 @@ void CaptureWidget::initSelection()
|
||||
});
|
||||
connect(m_selection, &SelectionWidget::geometrySettled, this, [this]() {
|
||||
if (m_selection->isVisible()) {
|
||||
auto req = m_context.request();
|
||||
if (req->tasks() & CaptureRequest::ACCEPT_ON_SELECT) {
|
||||
m_captureDone = true;
|
||||
if (req->tasks() & CaptureRequest::PIN) {
|
||||
QRect geometry = m_context.selection;
|
||||
geometry.setTopLeft(geometry.topLeft() +
|
||||
m_context.widgetOffset);
|
||||
req->addPinTask(geometry);
|
||||
}
|
||||
close();
|
||||
}
|
||||
m_buttonHandler->show();
|
||||
} else {
|
||||
m_buttonHandler->hide();
|
||||
@@ -1221,6 +1232,7 @@ void CaptureWidget::selectAll()
|
||||
{
|
||||
m_selection->show();
|
||||
m_selection->setGeometry(rect());
|
||||
emit m_selection->geometrySettled();
|
||||
m_buttonHandler->show();
|
||||
updateSelectionState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user