Show a patch.

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

{
    "id": 17095,
    "url": "https://patchwork.libcamera.org/api/patches/17095/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17095/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20220812121835.21974-1-utkarsh02t@gmail.com>",
    "date": "2022-08-12T12:18:35",
    "name": "[libcamera-devel,v8.1,7/8] qcam: CamSelectDialog: Display Capture script path",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7bedffb9c448b74dee5898d016e44b5430f7ecbd",
    "submitter": {
        "id": 114,
        "url": "https://patchwork.libcamera.org/api/people/114/?format=api",
        "name": "Utkarsh Tiwari",
        "email": "utkarsh02t@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17095/mbox/",
    "series": [
        {
            "id": 3409,
            "url": "https://patchwork.libcamera.org/api/series/3409/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3409",
            "date": "2022-08-12T12:15:39",
            "name": null,
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3409/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17095/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17095/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 615A8C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Aug 2022 12:18:44 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B91D06332B;\n\tFri, 12 Aug 2022 14:18:43 +0200 (CEST)",
            "from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com\n\t[IPv6:2607:f8b0:4864:20::102b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0305E603EA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Aug 2022 14:18:42 +0200 (CEST)",
            "by mail-pj1-x102b.google.com with SMTP id\n\ts5-20020a17090a13c500b001f4da9ffe5fso8161285pjf.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Aug 2022 05:18:42 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:dc0d:d8e:96a2:2dbe:5a83])\n\tby smtp.gmail.com with ESMTPSA id\n\th26-20020aa79f5a000000b0052d33bf14d6sm1472727pfr.63.2022.08.12.05.18.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 12 Aug 2022 05:18:40 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660306723;\n\tbh=9hfG2KEdD9kiPpB7ndMV2msmDt68GxcRdiQOPih0CgU=;\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=wY3ldbbTnC5Our9VJLoY60vCkYqUnFHSXDJek9ezEwQdkyzbVWvSlmGL9ncO9qpLN\n\tB830T27Dfj9zal4vk1MKwvKwkwSh+2SPANizu32OUjUNHtEL3ikZQK4u2IoSGnP+kA\n\t2fAkzpywBIVmu4HbXJeMLqFc3RDsyWVXPOeAhLN4fg4Gbt43oqNs2ny0B2+fAKj3eA\n\tIBg7CUfonrkkCxGyi0S2ACXX+cZ9QZpb+Q+t7zLokujbRIzN6o9wxMF7R14F99dB2E\n\tF3BKmPDI4h3PxYDMxpZHf71ZLvdEZ8wGih26XmtqiWU/JiyU1itTACEdWuauqKpmXg\n\t2M+761KkA9S0Q==",
            "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=K5JhIiFsYkZAHageL2WWC65VHNYg80GNXXE6Me+3AFo=;\n\tb=DPpG6TQpsfhkMmiFOg4nuqQI5HjrJeS85Uh/BDakO27tBTdFQ2rn+hGowdRAQtbrWe\n\tTl2Jm0Jt97q6VYyphQoKdiY9JAWS+qoK7Hie3EGrLcgnRb3HFxnBhEhRpgGf5HaYLW8C\n\tFB03XORd9+87SLIIfX1P5Duh9Ul9R6cCumevpyeKVXfNlniwfCBRkr0nRBll3pXVyiyR\n\tLnwjs536TpFGh7uoOoHsn2Wt0XREFFT0V9y0Jr6Cl4RMi9BpW0uj6M8Orx52mviyZZ5Z\n\tVO3FH9OIojmSVXRksLrd7AzhJsq7BKUPGm6j5i6pBtQJoPDV+NH7jqJFj/Qyion8/wb+\n\tuM1Q=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"DPpG6TQp\"; 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=K5JhIiFsYkZAHageL2WWC65VHNYg80GNXXE6Me+3AFo=;\n\tb=BaO9gCJl7VsyQcFzGs4zDllS2fqAglqQLpz5sEScH7Ny7Q72W0W+4kbJoh2iVPHR29\n\tj8C7g3M77cwi+OKKi+imcWhTvWGBfNV/SOWYOSWEqoeZZxklhiQaWu1TDhGVQXqYo+iP\n\t4EjgUnLOLgov6maddcYrUroDnqJaZmPXrNAVYstptkqbXLybsWQ0JqtHZMnohAv881d1\n\tG0P3CHQKoF8kMYyQPja+Lz586x02I32j7TpXIv+NNLdj+9RWxpkcxSZrZiCBf2Y8s3V1\n\t1b4p55Ka5Cl6pOYtWpte0U1KF35fnWztoHL5XqSYofSd+Zl1nQEzVtSy9gMWA20qhkGL\n\tWRkQ==",
        "X-Gm-Message-State": "ACgBeo1vKAjsX8Gj3gpPd3elpbdSw7qCYQ6EnljdNmADo0MCqYOJDRqE\n\tvQ1ZQEVf37mima++0S7WVSP+eL0XdqE=",
        "X-Google-Smtp-Source": "AA6agR5yt82Xa2EmP4wcEiCiyQW3s3+jjO5r7ZirTa/ikL19qyumKJeCYUcq36O6qzme1b+rVAUwzA==",
        "X-Received": "by 2002:a17:902:e5cd:b0:16d:b92c:6848 with SMTP id\n\tu13-20020a170902e5cd00b0016db92c6848mr3710197plf.56.1660306721321; \n\tFri, 12 Aug 2022 05:18:41 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 12 Aug 2022 17:48:35 +0530",
        "Message-Id": "<20220812121835.21974-1-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220810150349.414043-8-utkarsh02t@gmail.com>",
        "References": "<20220810150349.414043-8-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v8.1 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 from v8:\n\t1. scriptPathLabel_ now removed when informScriptReset() is invoked.\nDifference from v7:\n\t1. The scriptPathLabel_ has a fixed parent now captureWidget\n src/qcam/cam_select_dialog.cpp | 40 ++++++++++++++++++++++++++++------\n src/qcam/cam_select_dialog.h   |  7 +++++-\n src/qcam/main_window.cpp       |  3 ++-\n 3 files changed, 41 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/qcam/cam_select_dialog.cpp b/src/qcam/cam_select_dialog.cpp\nindex 58cbfc28..44fa3ce6 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 \n@@ -170,6 +195,7 @@ void CameraSelectorDialog::informScriptReset()\n \tisScriptRunning_ = false;\n \tscriptPath_.clear();\n \tselectedScriptPath_.clear();\n+\tcaptureWidgetLayout_->removeWidget(scriptPathLabel_);\n \tcaptureScriptButton_->setText(\"Open\");\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.1",
        "7/8"
    ]
}