summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-10-03 20:23:31 -0400
committerMason Reed <mason@vector35.com>2025-10-03 20:23:36 -0400
commitbf38450d476e1629b1165e8f8e23ebf0abc0db63 (patch)
tree582e5695567d5ab5f25e88ba8cb6c3bcd9a9a76a
parent22c39b0af205075a3dcc49fe095d2460a1f838f9 (diff)
[WARP] Add option to reset allowed tags in fetch dialog
-rw-r--r--plugins/warp/ui/shared/fetchdialog.cpp21
-rw-r--r--plugins/warp/ui/shared/fetchdialog.h3
2 files changed, 22 insertions, 2 deletions
diff --git a/plugins/warp/ui/shared/fetchdialog.cpp b/plugins/warp/ui/shared/fetchdialog.cpp
index 0230ad51..4b72e840 100644
--- a/plugins/warp/ui/shared/fetchdialog.cpp
+++ b/plugins/warp/ui/shared/fetchdialog.cpp
@@ -39,11 +39,20 @@ WarpFetchDialog::WarpFetchDialog(BinaryViewRef bv,
// Tags editor
m_tagsList = new QListWidget(this);
- m_addTagBtn = new QPushButton("Add", this);
- m_removeTagBtn = new QPushButton("Remove", this);
+ m_addTagBtn = new QPushButton(this);
+ m_addTagBtn->setText("+");
+ m_addTagBtn->setToolTip("Add tag");
+ m_removeTagBtn = new QPushButton(this);
+ m_removeTagBtn->setText("-");
+ m_removeTagBtn->setToolTip("Remove selected tag(s)");
+ m_resetTagBtn = new QPushButton(this);
+ m_resetTagBtn->setText("Reset");
+ m_resetTagBtn->setToolTip("Reset tags to: official, trusted");
auto tagBtnRow = new QHBoxLayout();
tagBtnRow->addWidget(m_addTagBtn);
tagBtnRow->addWidget(m_removeTagBtn);
+ tagBtnRow->addWidget(m_resetTagBtn);
+ tagBtnRow->addStretch();
auto tagCol = new QVBoxLayout();
tagCol->addWidget(m_tagsList);
tagCol->addLayout(tagBtnRow);
@@ -95,6 +104,7 @@ WarpFetchDialog::WarpFetchDialog(BinaryViewRef bv,
// Wire buttons
connect(m_addTagBtn, &QPushButton::clicked, this, &WarpFetchDialog::onAddTag);
connect(m_removeTagBtn, &QPushButton::clicked, this, &WarpFetchDialog::onRemoveTag);
+ connect(m_resetTagBtn, &QPushButton::clicked, this, &WarpFetchDialog::onResetTags);
}
void WarpFetchDialog::populateContainers()
@@ -116,6 +126,13 @@ void WarpFetchDialog::onRemoveTag()
delete item;
}
+void WarpFetchDialog::onResetTags()
+{
+ m_tagsList->clear();
+ AddListItem(m_tagsList, "official");
+ AddListItem(m_tagsList, "trusted");
+}
+
std::vector<Warp::SourceTag> WarpFetchDialog::collectTags() const
{
std::vector<Warp::SourceTag> out;
diff --git a/plugins/warp/ui/shared/fetchdialog.h b/plugins/warp/ui/shared/fetchdialog.h
index 72591a4c..37bfa0bb 100644
--- a/plugins/warp/ui/shared/fetchdialog.h
+++ b/plugins/warp/ui/shared/fetchdialog.h
@@ -20,6 +20,7 @@ class WarpFetchDialog : public QDialog
QListWidget *m_tagsList;
QPushButton *m_addTagBtn;
QPushButton *m_removeTagBtn;
+ QPushButton *m_resetTagBtn;
QSpinBox *m_batchSize;
QCheckBox *m_rerunMatcher;
@@ -40,6 +41,8 @@ private slots:
void onRemoveTag();
+ void onResetTags();
+
void onAccept();
private: