picker: Save the output name to a proper variable instead of parsing it from the button text (#183)

This commit is contained in:
rurigk 2024-02-18 17:24:29 -06:00 committed by GitHub
parent c06fd88b3d
commit f62fcea0cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -111,20 +111,17 @@ int main(int argc, char* argv[]) {
QString text = QString::fromStdString(std::string("Screen " + std::to_string(i) + " at " + std::to_string(GEOMETRY.x()) + ", " + std::to_string(GEOMETRY.y()) + " (" +
std::to_string(GEOMETRY.width()) + "x" + std::to_string(GEOMETRY.height()) + ") (") +
SCREENS[i]->name().toStdString() + ")");
QString outputName = SCREENS[i]->name();
ElidedButton* button = new ElidedButton(text);
button->setMinimumSize(0, BUTTON_HEIGHT);
SCREENS_SCROLL_AREA_CONTENTS_LAYOUT->addWidget(button);
QObject::connect(button, &QPushButton::clicked, [=]() {
std::string ID = button->text().toStdString();
ID = ID.substr(ID.find_last_of('(') + 1);
ID = ID.substr(0, ID.find_last_of(')'));
std::cout << "[SELECTION]";
std::cout << (ALLOWTOKENBUTTON->isChecked() ? "r" : "");
std::cout << "/";
std::cout << "screen:" << ID << "\n";
std::cout << "screen:" << outputName.toStdString() << "\n";
settings->setValue("width", mainPickerPtr->width());
settings->setValue("height", mainPickerPtr->height());