Show a patch.

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

{
    "id": 17021,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17021/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17021/",
    "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": "<20220807203204.152358-4-utkarsh02t@gmail.com>",
    "date": "2022-08-07T20:32:03",
    "name": "[libcamera-devel,v6,3/4] qcam: CamSelectDialog: Display Capture script path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c107c11b53085514a4d695d5ff8b52476e9c9010",
    "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/17021/mbox/",
    "series": [
        {
            "id": 3385,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3385/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3385",
            "date": "2022-08-07T20:32:00",
            "name": "Introduce capture scripts to qcam",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/3385/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17021/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17021/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 1812BBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  7 Aug 2022 20:32:28 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CBE076332D;\n\tSun,  7 Aug 2022 22:32:27 +0200 (CEST)",
            "from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com\n\t[IPv6:2607:f8b0:4864:20::52e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B424C63327\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  7 Aug 2022 22:32:26 +0200 (CEST)",
            "by mail-pg1-x52e.google.com with SMTP id q16so6933479pgq.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 07 Aug 2022 13:32:26 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:8eec:115d:8ea8:b700])\n\tby smtp.gmail.com with ESMTPSA id\n\tx29-20020aa7941d000000b0052d194a6602sm7006334pfo.102.2022.08.07.13.32.23\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 07 Aug 2022 13:32:24 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659904347;\n\tbh=mDM/AqDCeM00UHYfpX5f1RIyHRRuplHtHJbTxOHBOE0=;\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=zx46pBe9D3wWUmitRSbd0Lcy+lvliMiZhKK2g5Wz2706ba7zdhLWpq87f/TEgI1mt\n\tc6htj8b3A+tPvyA0SvKtw1Ta/ZJHJnCzNl5WnVHNj2Wx9f+xnCR5Y33pgKYfh8p3DD\n\tNdlHwQ7MfWjQK8wpimqRIKj2r/rZutUxOkTwT/UGbNAHMhAKEV7i32YLc0v2K7F19t\n\tNutOU0AIqhwZZstIgy5RKiWqpoyzVnfQai3JVwLP72XAzH17dh3RN1RHPmhVlUluXg\n\tn/PX0NmsJzFRe8e9tdxaSNj9eCSGJnlvtaqsLO72LYYQIGaPA8+1WauoQWzjrx0OMu\n\t6vYgJfxKDtXGw==",
            "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=kanfHGJITr6TvtYEOvkfhBTL2ZgRI2xaXV9xshtHLHQ=;\n\tb=aFVbkFsR/DYbdVHhyDWiW5hHP+g7mUlZxQekw7t41QsUjQkxsfHOPQQg+t6hxW58Lk\n\tgByMVMwE47rVWK1f/whu4cJzcVLGIzPdpCLcLvzGlkEPRLfMIkLylo7jZ7wTNFF0GYjK\n\tULqvDxvckHtbraOQ6daEN+f1JXF/RHTblTdl/3iFnxzpuY/kRNm6e0NAuz31HNW/VNOM\n\t1jb9aMGf8NrJ0/C1yguyPccY9yTpSsQGfRa9OPZK1WQJHReZrww/HKNjE+WhCnd9rumY\n\tHQHKvX5hGcWTdVWofWD2LSZAoEZu6H+5ooZJ/zZ1zhXsvGDxEwtwy1I6rh7plVEEC000\n\teVcA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"aFVbkFsR\"; 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=kanfHGJITr6TvtYEOvkfhBTL2ZgRI2xaXV9xshtHLHQ=;\n\tb=wZCaODH2PXU0qWMqMc5t7w785N4oaKIsFxM7yQiTq4g/RmeDh02LjD/XgO7rJVFkPR\n\ts/vUcyBp6qQE2J5x0Ws5m98hFWKCCLsb/bK8ElPq89NoQ4XUFs8T3kLXhYp/OJAW42C8\n\tEdj29LN+8Hvg5JTn6AnhNvGLF1ghX4R4IQiOzJy5PxEZoscHy22O03b02G+Aq7llAAtA\n\t8fvfv82qPEPHLjWX8HW8AMlRu3nC7pEF8h94RnkTTdllv0C0uBwWZMSbQjOzVtL2nrUL\n\t1zKra/xxW5lsLMuSgDAIswBGH5OpGoKKQWMI6b4vzLzgfVZ0Ymkwy1n9vFctsQagjCYj\n\tlVSg==",
        "X-Gm-Message-State": "ACgBeo0aVa6d7PIv9hFbj8TYr5ilO9RH51Nq88C6u0lzkWMcVhHWwhTl\n\ttnK81ERdHw3+AbgtsJjPFx1hjd3xKII=",
        "X-Google-Smtp-Source": "AA6agR6QOQwiYt+oqsL4/JMcMLTIDiDkeT23pakktQs0fs2aSXzZ4JhTHMNuaRVqwi7pyBKEObzuOg==",
        "X-Received": "by 2002:aa7:9157:0:b0:52f:20d6:e4f6 with SMTP id\n\t23-20020aa79157000000b0052f20d6e4f6mr4616705pfi.40.1659904344877; \n\tSun, 07 Aug 2022 13:32:24 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  8 Aug 2022 02:02:03 +0530",
        "Message-Id": "<20220807203204.152358-4-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220807203204.152358-1-utkarsh02t@gmail.com>",
        "References": "<20220807203204.152358-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v6 3/4] 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 V5:\n\tcame to existance.\n src/qcam/cam_select_dialog.h | 41 +++++++++++++++++++++++++++++++-----\n src/qcam/main_window.cpp     |  3 ++-\n 2 files changed, 38 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/qcam/cam_select_dialog.h b/src/qcam/cam_select_dialog.h\nindex fc29b46a..7dc44794 100644\n--- a/src/qcam/cam_select_dialog.h\n+++ b/src/qcam/cam_select_dialog.h\n@@ -19,18 +19,22 @@\n #include <QDialog>\n #include <QDialogButtonBox>\n #include <QFileDialog>\n+#include <QFont>\n #include <QFormLayout>\n #include <QLabel>\n #include <QPushButton>\n #include <QString>\n+#include <QVBoxLayout>\n+#include <QWidget>\n \n class CamSelectDialog : public QDialog\n {\n \tQ_OBJECT\n public:\n \tCamSelectDialog(libcamera::CameraManager *cameraManager,\n-\t\t\tbool isScriptRunning, QWidget *parent)\n-\t\t: QDialog(parent), cm_(cameraManager), isScriptRunning_(isScriptRunning)\n+\t\t\tbool isScriptRunning, std::string scriptPath, QWidget *parent)\n+\t\t: QDialog(parent), cm_(cameraManager),\n+\t\t  isScriptRunning_(isScriptRunning), scriptPath_(scriptPath)\n \t{\n \t\t/* Use a QFormLayout for the dialog. */\n \t\tQFormLayout *camSelectDialogLayout = new QFormLayout(this);\n@@ -51,14 +55,31 @@ public:\n \t\t\t\t\tcameraIdComboBox_->currentText().toStdString()));\n \t\t\t});\n \n+\t\t/* Setup widget for capture script button. */\n+\t\tQWidget *captureWidget = new QWidget;\n+\t\tcaptureWidgetLayout_ = new QVBoxLayout(captureWidget);\n+\t\tcaptureWidgetLayout_->setMargin(0);\n+\n \t\tcaptureScriptButton_ = new QPushButton;\n \t\tconnect(captureScriptButton_, &QPushButton::clicked,\n \t\t\tthis, &CamSelectDialog::handleCaptureScriptButton);\n+\t\tcaptureWidgetLayout_->addWidget(captureScriptButton_);\n+\n+\t\t/* Use a thinner font to indicate script info. */\n+\t\tQFont smallFont;\n+\t\tsmallFont.setWeight(QFont::Thin);\n+\n+\t\tscriptPathLabel_ = new QLabel;\n+\t\tscriptPathLabel_->setFont(smallFont);\n+\t\tscriptPathLabel_->setWordWrap(true);\n \n \t\t/* Display the action that would be performed when button is clicked. */\n-\t\tif (isScriptRunning_)\n+\t\tif (isScriptRunning_) {\n \t\t\tcaptureScriptButton_->setText(\"Stop\");\n-\t\telse\n+\n+\t\t\tscriptPathLabel_->setText(QString::fromStdString(scriptPath_));\n+\t\t\tcaptureWidgetLayout_->addWidget(scriptPathLabel_);\n+\t\t} else\n \t\t\tcaptureScriptButton_->setText(\"Open\");\n \n \t\t/* Setup the QDialogButton Box */\n@@ -75,7 +96,7 @@ public:\n \t\tcamSelectDialogLayout->addRow(\"Camera: \", cameraIdComboBox_);\n \t\tcamSelectDialogLayout->addRow(\"Location: \", cameraLocation_);\n \t\tcamSelectDialogLayout->addRow(\"Model: \", cameraModel_);\n-\t\tcamSelectDialogLayout->addRow(\"Capture Script: \", captureScriptButton_);\n+\t\tcamSelectDialogLayout->addRow(\"Capture Script: \", captureWidget);\n \t\tcamSelectDialogLayout->addWidget(dialogButtonBox);\n \t}\n \n@@ -148,6 +169,8 @@ public:\n \t\t\tQ_EMIT stopCaptureScript();\n \t\t\tisScriptRunning_ = false;\n \t\t\tcaptureScriptButton_->setText(\"Open\");\n+\n+\t\t\tcaptureWidgetLayout_->removeWidget(scriptPathLabel_);\n \t\t} else {\n \t\t\tscriptPath_ = QFileDialog::getOpenFileName(this, \"Run Capture Script\",\n \t\t\t\t\t\t\t\t   QDir::currentPath(), \"Capture Script (*.yaml)\")\n@@ -155,6 +178,11 @@ public:\n \n \t\t\tif (!scriptPath_.empty())\n \t\t\t\tcaptureScriptButton_->setText(\"Loaded\");\n+\t\t\telse\n+\t\t\t\treturn;\n+\n+\t\t\tscriptPathLabel_->setText(QString::fromStdString(scriptPath_));\n+\t\t\tcaptureWidgetLayout_->addWidget(scriptPathLabel_);\n \t\t}\n \t}\n \n@@ -171,5 +199,8 @@ private:\n \tQComboBox *cameraIdComboBox_;\n \tQLabel *cameraLocation_;\n \tQLabel *cameraModel_;\n+\n+\tQVBoxLayout *captureWidgetLayout_;\n \tQPushButton *captureScriptButton_;\n+\tQLabel *scriptPathLabel_ = new QLabel;\n };\ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex e0219e5e..e354ba10 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -332,7 +332,8 @@ void MainWindow::loadCaptureScript()\n std::string MainWindow::chooseCamera()\n {\n \tbool scriptRunning = script_ != nullptr;\n-\tcamSelectDialog_ = new CamSelectDialog(cm_, scriptRunning, this);\n+\tcamSelectDialog_ = new CamSelectDialog(cm_, scriptRunning,\n+\t\t\t\t\t       scriptPath_, this);\n \n \tconnect(camSelectDialog_, &CamSelectDialog::stopCaptureScript,\n \t\tthis, &MainWindow::stopCaptureScript);\n",
    "prefixes": [
        "libcamera-devel",
        "v6",
        "3/4"
    ]
}