Show a patch.

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

{
    "id": 17059,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17059/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17059/",
    "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": "<20220809205042.344923-8-utkarsh02t@gmail.com>",
    "date": "2022-08-09T20:50:41",
    "name": "[libcamera-devel,v7,7/8] qcam: CamSelectDialog: Display Capture script path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3e19463dab142355cce8e65c6ae0e2144c97bc1a",
    "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/17059/mbox/",
    "series": [
        {
            "id": 3400,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3400/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3400",
            "date": "2022-08-09T20:50:34",
            "name": "Introduce capture scripts to qcam",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/3400/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17059/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17059/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 62AFABE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Aug 2022 20:53:22 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1D94363334;\n\tTue,  9 Aug 2022 22:53:22 +0200 (CEST)",
            "from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com\n\t[IPv6:2607:f8b0:4864:20::62d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F61063328\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Aug 2022 22:53:20 +0200 (CEST)",
            "by mail-pl1-x62d.google.com with SMTP id o3so12435519ple.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Aug 2022 13:53:19 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:2358:3bcd:fb4f:cbb7])\n\tby smtp.gmail.com with ESMTPSA id\n\td3-20020a623603000000b0052d981e7842sm301936pfa.208.2022.08.09.13.53.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Aug 2022 13:53:18 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660078402;\n\tbh=XyTA9Gh1d2o5gLaO6sM827NF2rOSS/csQrznwpcDSK4=;\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=kkvMXchCie3N2uYd763caObDofERbs/664iqnoEwbNjgPDxXpDr982aXDzU1bAWEP\n\tb0h475JmfvyRo03uSnKjf+NlwK6CTtRp6w9uRQkPDdlKJ5ut8WoRzf0UWMuFhmfK+a\n\tkX8l5cFqAD3MY6w+++3oRI/o4EwB/D0SaHiNRCS6Y4aUbhei+nEwYE50VH989OTzLM\n\tYA/BGJlxknTJapsMe1PUnZ2fd91WCRO7516+MLH4rwv3xWf3X8MJhze7WTHcLaunOZ\n\tvnrnunZDvH6d5zpb09r/tbFjqqFDTk1+aIl9Pm0Sf/3/ZY5p/Opj+/b/mg7qzvDdvX\n\tdGXDAeYyUBdrQ==",
            "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=OmavJLYphfFZBhTcOP/Gxk0CM7TEQuFfx5FQ9o/vXsI=;\n\tb=Goy0GOSYNIE/yY+g+K4FQP3JIh4FpR0N2zylI9G9roo23EBSIM+tYNMtIq+M4Fl/Wg\n\tNFmjXPXqESYG9AtSwf14J7ihPZTXMZFHEpXlvsSfidrV9wAtoAC6fBzpHH9GNxg/wHpq\n\t1i2pIn6dpFCiCMnKZ87kx15BOZYsw6/x1UDgAwjTflcSCT2ocvZaBuoVhPdxhhk3ZYDl\n\tXVpobKSB2YTEnZi8VKxdZ4DJrhpXW6kgOGoMp95ngNJkaoU4n0P9Ti4otFDeB9PfBv13\n\tmzc9HYoYl7mRL9Nc8IWTDiY62oTNhtfxer0bHrOmJzQ8Pq0U9FJHm/+QmWBtQT0yt4gc\n\tf9tA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Goy0GOSY\"; 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=OmavJLYphfFZBhTcOP/Gxk0CM7TEQuFfx5FQ9o/vXsI=;\n\tb=Rc7YPG4oGI73SpS/95bXxQHRqbxiapgv5eIblMAiHyoX1Ys0oCNftQLUkkZLG2cdIz\n\tpuwZwkU8bT/95qe3XJsYM+Ki8S2kTp+J5zxVSfq0WV/30+RPOHIgUsjfH5f6y59witOP\n\tvM2MqlyD2sdA7lWy2HxtAA+OCxS4MtvUQmEvbbEGB/pc6+1u077qvS973hcH8Pxc6/7D\n\tLRu7dobKWCR5NNKtiPlgqwcoVZsmlKTTSvwnnF4ow9YFftSzviR1PeBjmSW9/4hz14kf\n\taRk9C5zNK0Bs85Pbh4qyJvyFsWg2RwWae5FMBs2qgU6U2RVM/wLcZ1TlHUR0NwjtWWrC\n\tUOnA==",
        "X-Gm-Message-State": "ACgBeo2WV6G0kJ4ijOpW5RNx+uSkUYQSnT1Hm20pOuBaALJT1NtQ+/xx\n\t1x4Ok/BQhZzkO24xQusT6jSJEBe9zjg=",
        "X-Google-Smtp-Source": "AA6agR7fkgHTKzxfEznfu19AWEqR9AvZROS19j3KJsCh1+m6Sty5OsF1dZgcF8DyxlvTkVG9MfU8wA==",
        "X-Received": "by 2002:a17:903:1104:b0:16c:2f71:7803 with SMTP id\n\tn4-20020a170903110400b0016c2f717803mr25590962plh.101.1660078398468; \n\tTue, 09 Aug 2022 13:53:18 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 10 Aug 2022 02:20:41 +0530",
        "Message-Id": "<20220809205042.344923-8-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220809205042.344923-1-utkarsh02t@gmail.com>",
        "References": "<20220809205042.344923-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v7 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---\n src/qcam/cam_select_dialog.cpp | 38 +++++++++++++++++++++++++++-------\n src/qcam/cam_select_dialog.h   |  8 ++++++-\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 f3df9970..5a9de08c 100644\n--- a/src/qcam/cam_select_dialog.cpp\n+++ b/src/qcam/cam_select_dialog.cpp\n@@ -20,8 +20,9 @@\n #include <QString>\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@@ -39,14 +40,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;\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@@ -63,7 +81,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@@ -138,16 +156,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 56d90596..84904640 100644\n--- a/src/qcam/cam_select_dialog.h\n+++ b/src/qcam/cam_select_dialog.h\n@@ -18,17 +18,20 @@\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 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@@ -66,5 +69,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 d73fb42a..f2e3c576 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -337,7 +337,8 @@ std::string MainWindow::chooseCamera()\n \tbool scriptRunning = script_ != nullptr;\n \n \t/* Construct the selection dialog, unconditionally. */\n-\tcameraSelectorDialog_ = new CameraSelectorDialog(cm_, scriptRunning, this);\n+\tcameraSelectorDialog_ = new CameraSelectorDialog(cm_, scriptRunning,\n+\t\t\t\t\t\t\t scriptPath_, this);\n \n \tconnect(cameraSelectorDialog_, &CameraSelectorDialog::stopCaptureScript,\n \t\tthis, &MainWindow::stopCaptureScript);\n",
    "prefixes": [
        "libcamera-devel",
        "v7",
        "7/8"
    ]
}