Show a patch.

GET /api/1.1/patches/17073/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 17073,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17073/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17073/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220810150349.414043-8-utkarsh02t@gmail.com>",
    "date": "2022-08-10T15:03:48",
    "name": "[libcamera-devel,v8,7/8] qcam: CamSelectDialog: Display Capture script path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "df759965434abef067fd9199429cc28e530711a2",
    "submitter": {
        "id": 114,
        "url": "https://patchwork.libcamera.org/api/1.1/people/114/?format=api",
        "name": "Utkarsh Tiwari",
        "email": "utkarsh02t@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17073/mbox/",
    "series": [
        {
            "id": 3402,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3402/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3402",
            "date": "2022-08-10T15:03:41",
            "name": "Introduce capture scripts to qcam",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/3402/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17073/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17073/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 77C32C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 15:04:14 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EE7963340;\n\tWed, 10 Aug 2022 17:04:14 +0200 (CEST)",
            "from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com\n\t[IPv6:2607:f8b0:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 843F56333D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 17:04:12 +0200 (CEST)",
            "by mail-pf1-x42b.google.com with SMTP id f192so13938807pfa.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 08:04:12 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:2a55:4cae:bf8f:f4ed])\n\tby smtp.gmail.com with ESMTPSA id\n\tb3-20020a1709027e0300b0016f1319d2a7sm12882624plm.297.2022.08.10.08.04.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Aug 2022 08:04:10 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660143854;\n\tbh=qytBWn/jAHqKVs+wfUAlvvbyclouipgE2JQ+P8k0rmU=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=yBfcpDrJrhxSp+l4LSbF2CXXM3O6Qh9XfODyeuAglTdiyK9jfFEmDFgqnXe/iweO0\n\tjjTednZoKvhvCjcKFICGxy0DjBcG99ASbjMYq2pJsd3m0otDvlj1645woHo/iCbCIb\n\tLrAEOylo+I6KV8D9vBgxtdeSdW7l74y4oUjjl+G83XkL7uF6IAmcUzHhCu0fPUamyG\n\tpxNTifNtP2Xk+kcEjNTCLkQWMtc92Ef1IGDetO8WUuMd/6IZ1vBT6BdC2gHQJnAuVE\n\t2gKB+0k2NvYvLPS11VY/ChjdOnlVXxhibBtKZpNyjPYASxLWiWC0XI8SbsKzmnhmTy\n\tFt+4+CDweXeNw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=kx1n1X+NqDdSrABkSCaBRoZD7PnoXHnF4Drty4LDWhI=;\n\tb=Jx2azNbMCGbCbJkCYx8sKRtcRUA+/8ityRp39f6VUkzevP3vzHCKIUJWB4bmGglx95\n\tqO8pjYR5voIN3+z7oWtcJAUJzM/85drIGFEyUrD5QocOeHrFN8COC4LtTT7wN4Y0twm7\n\tmfSFdldpceBt/PJe+dnQFPbnyx2rP2D4HxnKkfMnsJs7DbIsrYde7OlHrQGEASibHPyv\n\t4c+w8OZRKCeXXikGrn8fyhj6aUrdMJYIHHOv38qGprsD9VXIGxwfNwvi0tVoIfT4h6do\n\tCX4HjTSm6JJObTC1olgOPwUe98+WzW9r2mNOHInc7W0Kqcr2FcaCv2Nv9PHLoFYc042/\n\tnV9Q=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Jx2azNbM\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=kx1n1X+NqDdSrABkSCaBRoZD7PnoXHnF4Drty4LDWhI=;\n\tb=nLWRvuiwp7SiOLARy3onc3D3LflfV30xJMrvs8KkHfG/Y99dcIxmfD/tTl+qbVYTcK\n\tPEDR/FOlJBDxZgq8mnudEi269szWoZmqcIUosCjQunsMXqKB0uao8x3w3QREURnIFKMz\n\tJF+q6gH81OidJRzVdTpY+aq6HvrGJ37pvsKWNgFQuZ+wVsisvdsZmuHOGr/JUsRTFc2Q\n\ti1+tu9TvQX6WAKjSIyQCzq7qlieu/WYWZ3mMba+2DizHhO9W5FobEUxFA/bcuhIqbGDC\n\tpH07PDr0aVFhn3Xbn6Gq/G72IrnNBvKK+zoKl4HVTZuaxRb8a6bFxPSZNv9RKTj9EeDL\n\t7G/w==",
        "X-Gm-Message-State": "ACgBeo1P2XfXvZT+5KHuo2JnsgPFy967dL6tevue8HLxT7wVdVHNGvz5\n\troJh1nY5YiAYD6y8lLZmOLgrVoPPC2k=",
        "X-Google-Smtp-Source": "AA6agR5sOXzNCgUK9dVPk12jzVv2TqoUMWjkDjfvNtUZF3VPrukX+VTUj/NVFoQpjXfI37bgO1nWHA==",
        "X-Received": "by 2002:aa7:8096:0:b0:52d:d5f6:2ea6 with SMTP id\n\tv22-20020aa78096000000b0052dd5f62ea6mr28456817pff.0.1660143850861; \n\tWed, 10 Aug 2022 08:04:10 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 10 Aug 2022 20:33:48 +0530",
        "Message-Id": "<20220810150349.414043-8-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220810150349.414043-1-utkarsh02t@gmail.com>",
        "References": "<20220810150349.414043-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v8 7/8] qcam: CamSelectDialog: Display\n\tCapture script path",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "From": "Utkarsh Tiwari via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Utkarsh Tiwari <utkarsh02t@gmail.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Display the path of the selected capture script in a thinner font.\n\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\n---\nDifference:\n\t1. The scriptPathLabel_ has a fixed parent now captureWidget\n src/qcam/cam_select_dialog.cpp | 39 ++++++++++++++++++++++++++++------\n src/qcam/cam_select_dialog.h   |  7 +++++-\n src/qcam/main_window.cpp       |  3 ++-\n 3 files changed, 40 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/qcam/cam_select_dialog.cpp b/src/qcam/cam_select_dialog.cpp\nindex 0db0a5bd..3286c433 100644\n--- a/src/qcam/cam_select_dialog.cpp\n+++ b/src/qcam/cam_select_dialog.cpp\n@@ -19,10 +19,12 @@\n #include <QFileDialog>\n #include <QFormLayout>\n #include <QString>\n+#include <QVBoxLayout>\n \n CameraSelectorDialog::CameraSelectorDialog(libcamera::CameraManager *cameraManager,\n-\t\t\t\t\t   bool isScriptRunning, QWidget *parent)\n-\t: QDialog(parent), cm_(cameraManager), isScriptRunning_(isScriptRunning)\n+\t\t\t\t\t   bool isScriptRunning, std::string scriptPath, QWidget *parent)\n+\t: QDialog(parent), cm_(cameraManager),\n+\t  isScriptRunning_(isScriptRunning), scriptPath_(scriptPath)\n {\n \t/* Use a QFormLayout for the dialog. */\n \tQFormLayout *layout = new QFormLayout(this);\n@@ -40,14 +42,31 @@ CameraSelectorDialog::CameraSelectorDialog(libcamera::CameraManager *cameraManag\n \tconnect(cameraIdComboBox_, &QComboBox::currentTextChanged,\n \t\tthis, &CameraSelectorDialog::handleCameraChange);\n \n+\t/* Setup widget for capture script button. */\n+\tQWidget *captureWidget = new QWidget;\n+\tcaptureWidgetLayout_ = new QVBoxLayout(captureWidget);\n+\tcaptureWidgetLayout_->setMargin(0);\n+\n \tcaptureScriptButton_ = new QPushButton;\n \tconnect(captureScriptButton_, &QPushButton::clicked,\n \t\tthis, &CameraSelectorDialog::handleCaptureScriptButton);\n+\tcaptureWidgetLayout_->addWidget(captureScriptButton_);\n+\n+\t/* Use a thinner font to indicate script info. */\n+\tQFont smallFont;\n+\tsmallFont.setWeight(QFont::Thin);\n+\n+\tscriptPathLabel_ = new QLabel(captureWidget);\n+\tscriptPathLabel_->setFont(smallFont);\n+\tscriptPathLabel_->setWordWrap(true);\n \n \t/* Display the action that would be performed when button is clicked. */\n-\tif (isScriptRunning_)\n+\tif (isScriptRunning_) {\n \t\tcaptureScriptButton_->setText(\"Stop\");\n-\telse\n+\n+\t\tscriptPathLabel_->setText(QString::fromStdString(scriptPath_));\n+\t\tcaptureWidgetLayout_->addWidget(scriptPathLabel_);\n+\t} else\n \t\tcaptureScriptButton_->setText(\"Open\");\n \n \t/* Setup the QDialogButton Box */\n@@ -64,7 +83,7 @@ CameraSelectorDialog::CameraSelectorDialog(libcamera::CameraManager *cameraManag\n \tlayout->addRow(\"Camera:\", cameraIdComboBox_);\n \tlayout->addRow(\"Location:\", cameraLocation_);\n \tlayout->addRow(\"Model:\", cameraModel_);\n-\tlayout->addRow(\"Capture Script:\", captureScriptButton_);\n+\tlayout->addRow(\"Capture Script:\", captureWidget);\n \tlayout->addWidget(buttonBox);\n }\n \n@@ -139,16 +158,22 @@ void CameraSelectorDialog::handleCaptureScriptButton()\n \t\tQ_EMIT stopCaptureScript();\n \t\tisScriptRunning_ = false;\n \t\tcaptureScriptButton_->setText(\"Open\");\n+\n+\t\tcaptureWidgetLayout_->removeWidget(scriptPathLabel_);\n \t} else {\n \t\tselectedScriptPath_ = QFileDialog::getOpenFileName(this,\n \t\t\t\t\t\t\t\t   \"Run Capture Script\", QDir::currentPath(),\n \t\t\t\t\t\t\t\t   \"Capture Script (*.yaml)\")\n \t\t\t\t\t      .toStdString();\n \n-\t\tif (!selectedScriptPath_.empty())\n+\t\tif (!selectedScriptPath_.empty()) {\n \t\t\tcaptureScriptButton_->setText(\"Loaded\");\n-\t\telse\n+\t\t\tscriptPathLabel_->setText(QString::fromStdString(selectedScriptPath_));\n+\t\t\tcaptureWidgetLayout_->addWidget(scriptPathLabel_);\n+\t\t} else {\n \t\t\tcaptureScriptButton_->setText(\"Open\");\n+\t\t\tcaptureWidgetLayout_->removeWidget(scriptPathLabel_);\n+\t\t}\n \t}\n }\n \ndiff --git a/src/qcam/cam_select_dialog.h b/src/qcam/cam_select_dialog.h\nindex bbdf897e..72dfbb14 100644\n--- a/src/qcam/cam_select_dialog.h\n+++ b/src/qcam/cam_select_dialog.h\n@@ -18,13 +18,15 @@\n #include <QDialog>\n #include <QLabel>\n #include <QPushButton>\n+#include <QVBoxLayout>\n+#include <QWidget>\n \n class CameraSelectorDialog : public QDialog\n {\n \tQ_OBJECT\n public:\n \tCameraSelectorDialog(libcamera::CameraManager *cameraManager,\n-\t\t\t     bool isScriptRunning, QWidget *parent);\n+\t\t\t     bool isScriptRunning, std::string scriptPath, QWidget *parent);\n \n \t~CameraSelectorDialog() = default;\n \n@@ -62,5 +64,8 @@ private:\n \tQComboBox *cameraIdComboBox_;\n \tQLabel *cameraLocation_;\n \tQLabel *cameraModel_;\n+\n+\tQVBoxLayout *captureWidgetLayout_;\n \tQPushButton *captureScriptButton_;\n+\tQLabel *scriptPathLabel_;\n };\ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 3c7c3173..753e1af9 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -339,7 +339,8 @@ std::string MainWindow::chooseCamera()\n \n \t/* Construct the selection dialog, only the first time. */\n \tif (!cameraSelectorDialog_)\n-\t\tcameraSelectorDialog_ = new CameraSelectorDialog(cm_, scriptRunning, this);\n+\t\tcameraSelectorDialog_ = new CameraSelectorDialog(cm_, scriptRunning,\n+\t\t\t\t\t\t\t\t scriptPath_, this);\n \n \tconnect(cameraSelectorDialog_, &CameraSelectorDialog::stopCaptureScript,\n \t\tthis, &MainWindow::stopCaptureScript);\n",
    "prefixes": [
        "libcamera-devel",
        "v8",
        "7/8"
    ]
}