mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:56:22 +00:00
Fix previous commit.
This commit is contained in:
parent
ed942cc4d4
commit
f556d7e103
@ -29,6 +29,8 @@ ConnectionsWindow::ConnectionsWindow(FortManager *fortManager, QWidget *parent)
|
|||||||
{
|
{
|
||||||
setupUi();
|
setupUi();
|
||||||
setupController();
|
setupController();
|
||||||
|
|
||||||
|
syncAutoScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionsWindow::setupController()
|
void ConnectionsWindow::setupController()
|
||||||
@ -193,27 +195,14 @@ void ConnectionsWindow::setupLogBlockedIp()
|
|||||||
|
|
||||||
void ConnectionsWindow::setupAutoScroll()
|
void ConnectionsWindow::setupAutoScroll()
|
||||||
{
|
{
|
||||||
const auto syncAutoScroll = [&] {
|
m_cbAutoScroll = ControlUtil::createCheckBox(settings()->connAutoScroll(), [&](bool checked) {
|
||||||
if (settings()->connAutoScroll()) {
|
if (settings()->connAutoScroll() == checked)
|
||||||
connect(connListModel(), &QAbstractItemModel::rowsInserted, m_connListView,
|
return;
|
||||||
&QAbstractItemView::scrollToBottom);
|
|
||||||
} else {
|
|
||||||
disconnect(connListModel(), &QAbstractItemModel::rowsInserted, m_connListView,
|
|
||||||
&QAbstractItemView::scrollToBottom);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
syncAutoScroll();
|
settings()->setConnAutoScroll(checked);
|
||||||
|
|
||||||
m_cbAutoScroll = ControlUtil::createCheckBox(
|
syncAutoScroll();
|
||||||
settings()->connAutoScroll(), [&, syncAutoScroll](bool checked) {
|
});
|
||||||
if (settings()->connAutoScroll() == checked)
|
|
||||||
return;
|
|
||||||
|
|
||||||
settings()->setConnAutoScroll(checked);
|
|
||||||
|
|
||||||
syncAutoScroll();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionsWindow::setupTableConnList()
|
void ConnectionsWindow::setupTableConnList()
|
||||||
@ -281,6 +270,19 @@ void ConnectionsWindow::setupTableConnsChanged()
|
|||||||
connect(m_connListView, &TableView::currentIndexChanged, this, refreshTableConnsChanged);
|
connect(m_connListView, &TableView::currentIndexChanged, this, refreshTableConnsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConnectionsWindow::syncAutoScroll()
|
||||||
|
{
|
||||||
|
if (settings()->connAutoScroll()) {
|
||||||
|
connect(connListModel(), &QAbstractItemModel::rowsInserted, m_connListView,
|
||||||
|
&QAbstractItemView::scrollToBottom);
|
||||||
|
|
||||||
|
m_connListView->scrollToBottom();
|
||||||
|
} else {
|
||||||
|
disconnect(connListModel(), &QAbstractItemModel::rowsInserted, m_connListView,
|
||||||
|
&QAbstractItemView::scrollToBottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ConnectionsWindow::deleteConn(int row)
|
void ConnectionsWindow::deleteConn(int row)
|
||||||
{
|
{
|
||||||
const auto connRow = connListModel()->connRowAt(row);
|
const auto connRow = connListModel()->connRowAt(row);
|
||||||
|
@ -42,6 +42,8 @@ private:
|
|||||||
void setupAppInfoRow();
|
void setupAppInfoRow();
|
||||||
void setupTableConnsChanged();
|
void setupTableConnsChanged();
|
||||||
|
|
||||||
|
void syncAutoScroll();
|
||||||
|
|
||||||
void deleteConn(int row);
|
void deleteConn(int row);
|
||||||
|
|
||||||
void deleteSelectedConns();
|
void deleteSelectedConns();
|
||||||
|
Loading…
Reference in New Issue
Block a user