Skip to content

Commit

Permalink
Shell: Closing connection; autoselect address in OpenDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 10, 2019
1 parent 1f5e3a3 commit ab0eee3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doomsday/tools/shell/src/linkwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ DE_PIMPL(LinkWindow)
[]() { GuiShellApp::app().connectToServer(); });
keys->add(KeyEvent::press('d', KeyEvent::Command),
[this]() { self().closeConnection(); });
keys->add(KeyEvent::press('w', KeyEvent::Command),
[this]() { self().windowAboutToClose(); });
keys->add(KeyEvent::press('1', KeyEvent::Command), [this]() { self().switchToStatus(); });
keys->add(KeyEvent::press('2', KeyEvent::Command), [this]() { self().switchToOptions(); });
keys->add(KeyEvent::press('3', KeyEvent::Command), [this]() { self().switchToConsole(); });
Expand Down Expand Up @@ -1036,7 +1038,7 @@ void LinkWindow::windowAboutToClose()
dlg->buttons()
<< new DialogButtonItem(DialogWidget::Accept | DialogWidget::Default,
"Keep Running")
<< new DialogButtonItem(DialogWidget::Accept, "Stop Server",
<< new DialogButtonItem(DialogWidget::Action, "Stop Server",
[dlg]() { dlg->accept(2); })
<< new DialogButtonItem(DialogWidget::Reject, "Cancel");

Expand All @@ -1046,6 +1048,7 @@ void LinkWindow::windowAboutToClose()
{
sendCommandToServer("quit");
}
closeConnection();
close();
}
}
Expand All @@ -1057,7 +1060,6 @@ void LinkWindow::checkFoundServers()
const auto &finder = GuiShellApp::app().serverFinder();
for (const auto &addr : finder.foundServers())
{
// debug("found: %s isLocal: %d port: %d", addr.asText().c_str(), addr.isLocal(), addr.port());
if (addr.isLocal() && addr.port() == d->waitingForLocalPort)
{
// This is the one!
Expand Down
1 change: 1 addition & 0 deletions doomsday/tools/shell/src/opendialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ void OpenDialog::updateLocalList(bool autoselect)
if (autoselect && !selected)
{
d->localServers->setSelected(items.size() - 1);
d->address->setText(sv.first);
selected = true;
}
}
Expand Down

0 comments on commit ab0eee3

Please sign in to comment.