Skip to content

Commit ef363c4

Browse files
committed
Change text if default is empty.
1 parent a480b9c commit ef363c4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Common/Cpp/Options/EditableTableOption.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ class EditableTableOption : public ConfigOption{
8787

8888
public:
8989
const std::string& label() const{ return m_label; }
90+
const std::vector<std::unique_ptr<EditableTableRow>>& defaults() const{
91+
return m_default;
92+
}
9093

9194
// Returns the # of rows at this moment of time.
9295
// Since this value can be out-of-date before you return, do not use

Common/Qt/Options/EditableTableWidget.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ EditableTableWidget::EditableTableWidget(QWidget& parent, EditableTableOption& v
141141
);
142142
}
143143
{
144-
QPushButton* button = new QPushButton("Restore Defaults", this);
144+
QPushButton* button = new QPushButton(
145+
value.defaults().empty()
146+
? "Clear Table"
147+
: "Restore Defaults",
148+
this
149+
);
145150
buttons->addWidget(button, 1);
146151
connect(
147152
button, &QPushButton::clicked,

0 commit comments

Comments
 (0)