Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PlayWallDesktop
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PlayWall
PlayWallDesktop
Commits
12c230af
Commit
12c230af
authored
3 years ago
by
Tobias Ullerich
Browse files
Options
Downloads
Patches
Plain Diff
#174 - Reconnect to disconnected servers on icon click
parent
7d0971a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
PlayWallPlugins/PlayWallPluginWebAPI/src/main/java/de/tobias/playpad/plugin/api/client/WebApiRemoteConnectionStateListener.java
+15
-0
15 additions, 0 deletions
...lugin/api/client/WebApiRemoteConnectionStateListener.java
with
15 additions
and
0 deletions
PlayWallPlugins/PlayWallPluginWebAPI/src/main/java/de/tobias/playpad/plugin/api/client/WebApiRemoteConnectionStateListener.java
+
15
−
0
View file @
12c230af
...
...
@@ -34,6 +34,8 @@ public class WebApiRemoteConnectionStateListener implements MainWindowListener {
connectionStateIcon
=
new
FontIcon
(
FontAwesomeType
.
CLOUD
);
connectionStateIcon
.
setSize
(
20
);
connectionStateIcon
.
setOnMouseClicked
(
this
::
onIconClicked
);
connectedProperty
=
new
SimpleIntegerProperty
(
0
);
connectedProperty
.
addListener
((
observable
,
oldValue
,
newValue
)
->
{
Platform
.
runLater
(()
->
{
...
...
@@ -70,6 +72,19 @@ public class WebApiRemoteConnectionStateListener implements MainWindowListener {
);
}
private
void
onIconClicked
(
MouseEvent
event
)
{
WebApiPlugin
$
.
MODULE
$
.
connections
().
values
().
stream
()
.
filter
(
client
->
client
.
getPlayPadConnectionState
()
!=
WebSocketState
.
OPEN
)
.
forEach
(
client
->
Worker
.
runLater
(()
->
{
try
{
client
.
disconnect
();
client
.
connect
(
1
);
}
catch
(
IOException
|
WebSocketException
e
)
{
Logger
.
error
(
e
);
}
}));
}
@Override
public
void
onInit
(
IMainViewController
mainViewController
)
{
mainViewController
.
performLayoutDependedAction
((
oldToolbar
,
newToolbar
)
->
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment