Skip to content

Commit bf38450

Browse files
committed
[WARP] Add option to reset allowed tags in fetch dialog
1 parent 22c39b0 commit bf38450

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

plugins/warp/ui/shared/fetchdialog.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,20 @@ WarpFetchDialog::WarpFetchDialog(BinaryViewRef bv,
3939

4040
// Tags editor
4141
m_tagsList = new QListWidget(this);
42-
m_addTagBtn = new QPushButton("Add", this);
43-
m_removeTagBtn = new QPushButton("Remove", this);
42+
m_addTagBtn = new QPushButton(this);
43+
m_addTagBtn->setText("+");
44+
m_addTagBtn->setToolTip("Add tag");
45+
m_removeTagBtn = new QPushButton(this);
46+
m_removeTagBtn->setText("-");
47+
m_removeTagBtn->setToolTip("Remove selected tag(s)");
48+
m_resetTagBtn = new QPushButton(this);
49+
m_resetTagBtn->setText("Reset");
50+
m_resetTagBtn->setToolTip("Reset tags to: official, trusted");
4451
auto tagBtnRow = new QHBoxLayout();
4552
tagBtnRow->addWidget(m_addTagBtn);
4653
tagBtnRow->addWidget(m_removeTagBtn);
54+
tagBtnRow->addWidget(m_resetTagBtn);
55+
tagBtnRow->addStretch();
4756
auto tagCol = new QVBoxLayout();
4857
tagCol->addWidget(m_tagsList);
4958
tagCol->addLayout(tagBtnRow);
@@ -95,6 +104,7 @@ WarpFetchDialog::WarpFetchDialog(BinaryViewRef bv,
95104
// Wire buttons
96105
connect(m_addTagBtn, &QPushButton::clicked, this, &WarpFetchDialog::onAddTag);
97106
connect(m_removeTagBtn, &QPushButton::clicked, this, &WarpFetchDialog::onRemoveTag);
107+
connect(m_resetTagBtn, &QPushButton::clicked, this, &WarpFetchDialog::onResetTags);
98108
}
99109

100110
void WarpFetchDialog::populateContainers()
@@ -116,6 +126,13 @@ void WarpFetchDialog::onRemoveTag()
116126
delete item;
117127
}
118128

129+
void WarpFetchDialog::onResetTags()
130+
{
131+
m_tagsList->clear();
132+
AddListItem(m_tagsList, "official");
133+
AddListItem(m_tagsList, "trusted");
134+
}
135+
119136
std::vector<Warp::SourceTag> WarpFetchDialog::collectTags() const
120137
{
121138
std::vector<Warp::SourceTag> out;

plugins/warp/ui/shared/fetchdialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class WarpFetchDialog : public QDialog
2020
QListWidget *m_tagsList;
2121
QPushButton *m_addTagBtn;
2222
QPushButton *m_removeTagBtn;
23+
QPushButton *m_resetTagBtn;
2324

2425
QSpinBox *m_batchSize;
2526
QCheckBox *m_rerunMatcher;
@@ -40,6 +41,8 @@ private slots:
4041

4142
void onRemoveTag();
4243

44+
void onResetTags();
45+
4346
void onAccept();
4447

4548
private:

0 commit comments

Comments
 (0)