Qt: Fixed behaviour of buttons by connecting functors to correct signals

Following screens got fixes:
- Cheats
- Configure/Debug
- Configure/Input
- Chat Room
- Direct Connect
- Host
- Lobby List
This commit is contained in:
Silent
2019-07-22 23:28:10 +02:00
parent a9df1c29f9
commit 4fd22c6a14
8 changed files with 22 additions and 21 deletions

View File

@@ -189,9 +189,9 @@ ChatRoom::ChatRoom(QWidget* parent) : QWidget(parent), ui(std::make_unique<Ui::C
// Connect all the widgets to the appropriate events
connect(ui->player_view, &QTreeView::customContextMenuRequested, this,
&ChatRoom::PopupContextMenu);
connect(ui->chat_message, &QLineEdit::returnPressed, ui->send_message, &QPushButton::pressed);
connect(ui->chat_message, &QLineEdit::textChanged, this, &::ChatRoom::OnChatTextChanged);
connect(ui->send_message, &QPushButton::pressed, this, &ChatRoom::OnSendChat);
connect(ui->chat_message, &QLineEdit::returnPressed, this, &ChatRoom::OnSendChat);
connect(ui->chat_message, &QLineEdit::textChanged, this, &ChatRoom::OnChatTextChanged);
connect(ui->send_message, &QPushButton::clicked, this, &ChatRoom::OnSendChat);
}
ChatRoom::~ChatRoom() = default;

View File

@@ -40,7 +40,7 @@ ClientRoomWindow::ClientRoomWindow(QWidget* parent)
// TODO (jroweboy) network was not initialized?
}
connect(ui->disconnect, &QPushButton::pressed, [this] { Disconnect(); });
connect(ui->disconnect, &QPushButton::clicked, this, &ClientRoomWindow::Disconnect);
ui->disconnect->setDefault(false);
ui->disconnect->setAutoDefault(false);
connect(ui->moderation, &QPushButton::clicked, [this] {

View File

@@ -45,7 +45,7 @@ DirectConnectWindow::DirectConnectWindow(QWidget* parent)
// TODO(jroweboy): Show or hide the connection options based on the current value of the combo
// box. Add this back in when the traversal server support is added.
connect(ui->connect, &QPushButton::pressed, this, &DirectConnectWindow::Connect);
connect(ui->connect, &QPushButton::clicked, this, &DirectConnectWindow::Connect);
}
DirectConnectWindow::~DirectConnectWindow() = default;

View File

@@ -49,7 +49,7 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
ui->game_list->setModel(proxy);
// Connect all the widgets to the appropriate events
connect(ui->host, &QPushButton::pressed, this, &HostRoomWindow::Host);
connect(ui->host, &QPushButton::clicked, this, &HostRoomWindow::Host);
// Restore the settings:
ui->username->setText(UISettings::values.room_nickname);

View File

@@ -63,7 +63,7 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
}
// UI Buttons
connect(ui->refresh_list, &QPushButton::pressed, this, &Lobby::RefreshLobby);
connect(ui->refresh_list, &QPushButton::clicked, this, &Lobby::RefreshLobby);
connect(ui->games_owned, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterOwned);
connect(ui->hide_full, &QCheckBox::toggled, proxy, &LobbyFilterProxyModel::SetFilterFull);
connect(ui->search, &QLineEdit::textChanged, proxy, &LobbyFilterProxyModel::SetFilterSearch);