mirror of https://github.com/zlatinb/muwire
Do not popup the update prompt, add a button on the bottom bar instead. GitHub issue #157
parent
7f26a02339
commit
f6d824339e
|
@ -1062,6 +1062,17 @@ class MainFrameController {
|
||||||
mvcGroup.createMVCGroup("chat-favorites", params)
|
mvcGroup.createMVCGroup("chat-favorites", params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ControllerAction
|
||||||
|
void showUpdate() {
|
||||||
|
if (application.mvcGroupManager.findGroup("update") == null) {
|
||||||
|
Map<String, Object> args = new HashMap<>()
|
||||||
|
args['core'] = core
|
||||||
|
args['available'] = model.updateAvailableEvent
|
||||||
|
args['downloaded'] = model.updateDownloadedEvent
|
||||||
|
mvcGroup.createMVCGroup("update", "update", args).destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void saveMuWireSettings() {
|
void saveMuWireSettings() {
|
||||||
core.saveMuSettings()
|
core.saveMuSettings()
|
||||||
}
|
}
|
||||||
|
|
|
@ -772,6 +772,7 @@ TOOLTIP_TOTAL_UP_SPEED=Total upload speed
|
||||||
TOOLTIP_UNREAD_MESSAEGS=Unread messages
|
TOOLTIP_UNREAD_MESSAEGS=Unread messages
|
||||||
TOOLTIP_CONNECTIONS=Connections to other MuWire nodes
|
TOOLTIP_CONNECTIONS=Connections to other MuWire nodes
|
||||||
TOOLTIP_SEARCH_BOX=Search for keywords, search phrase or regular expression
|
TOOLTIP_SEARCH_BOX=Search for keywords, search phrase or regular expression
|
||||||
|
TOOLTIP_UPDATE=Update MuWire
|
||||||
|
|
||||||
### Tooltips for browse files tab
|
### Tooltips for browse files tab
|
||||||
TOOLTIP_COPY_SENDER_FULL_ID=Copy the full ID of the sender to clipboard
|
TOOLTIP_COPY_SENDER_FULL_ID=Copy the full ID of the sender to clipboard
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.muwire.core.trust.TrustServiceLoadedEvent
|
||||||
import com.muwire.gui.profile.PersonaOrProfile
|
import com.muwire.gui.profile.PersonaOrProfile
|
||||||
import com.muwire.gui.profile.ThumbnailIcon
|
import com.muwire.gui.profile.ThumbnailIcon
|
||||||
import com.muwire.gui.profile.TrustPOP
|
import com.muwire.gui.profile.TrustPOP
|
||||||
|
import griffon.core.controller.ControllerAction
|
||||||
|
|
||||||
import javax.swing.DefaultListModel
|
import javax.swing.DefaultListModel
|
||||||
import javax.swing.Icon
|
import javax.swing.Icon
|
||||||
|
@ -207,6 +208,9 @@ class MainFrameModel {
|
||||||
@Observable int downSpeed
|
@Observable int downSpeed
|
||||||
@Observable int upSpeed
|
@Observable int upSpeed
|
||||||
|
|
||||||
|
@Observable UpdateDownloadedEvent updateDownloadedEvent
|
||||||
|
@Observable UpdateAvailableEvent updateAvailableEvent
|
||||||
|
|
||||||
private final Set<InfoHash> downloadInfoHashes = new ConcurrentHashSet<>()
|
private final Set<InfoHash> downloadInfoHashes = new ConcurrentHashSet<>()
|
||||||
|
|
||||||
@Observable volatile Core core
|
@Observable volatile Core core
|
||||||
|
@ -411,13 +415,15 @@ class MainFrameModel {
|
||||||
|
|
||||||
void onUpdateDownloadedEvent(UpdateDownloadedEvent e) {
|
void onUpdateDownloadedEvent(UpdateDownloadedEvent e) {
|
||||||
runInsideUIAsync {
|
runInsideUIAsync {
|
||||||
if (application.mvcGroupManager.findGroup("update") == null) {
|
updateDownloadedEvent = e
|
||||||
Map<String, Object> args = new HashMap<>()
|
updateAvailableEvent = null
|
||||||
args['core'] = core
|
}
|
||||||
args['available'] = null
|
}
|
||||||
args['downloaded'] = e
|
|
||||||
mvcGroup.createMVCGroup("update", "update", args).destroy()
|
void onUpdateAvailableEvent(UpdateAvailableEvent e) {
|
||||||
}
|
runInsideUIAsync {
|
||||||
|
updateDownloadedEvent = null
|
||||||
|
updateAvailableEvent = e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,18 +804,6 @@ class MainFrameModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onUpdateAvailableEvent(UpdateAvailableEvent e) {
|
|
||||||
runInsideUIAsync {
|
|
||||||
if (application.mvcGroupManager.findGroup("update") == null) {
|
|
||||||
Map<String, Object> args = new HashMap<>()
|
|
||||||
args['core'] = core
|
|
||||||
args['available'] = e
|
|
||||||
args['downloaded'] = null
|
|
||||||
mvcGroup.createMVCGroup("update", "update", args).destroy()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void onRouterDisconnectedEvent(RouterDisconnectedEvent e) {
|
void onRouterDisconnectedEvent(RouterDisconnectedEvent e) {
|
||||||
if (core.getShutdown().get())
|
if (core.getShutdown().get())
|
||||||
return
|
return
|
||||||
|
|
|
@ -735,6 +735,9 @@ class MainFrameView {
|
||||||
panel (border: etchedBorder(), constraints : BorderLayout.SOUTH) {
|
panel (border: etchedBorder(), constraints : BorderLayout.SOUTH) {
|
||||||
borderLayout()
|
borderLayout()
|
||||||
panel (constraints : BorderLayout.WEST) {
|
panel (constraints : BorderLayout.WEST) {
|
||||||
|
button(text: trans("UPDATE"), toolTipText: trans("TOOLTIP_UPDATE"),
|
||||||
|
enabled: bind {model.updateAvailableEvent != null || model.updateDownloadedEvent != null},
|
||||||
|
showUpdateAction)
|
||||||
button(text: "", icon: imageIcon('/edit_profile.png'), toolTipText: trans("TOOLTIP_PROFILE_EDITOR"),
|
button(text: "", icon: imageIcon('/edit_profile.png'), toolTipText: trans("TOOLTIP_PROFILE_EDITOR"),
|
||||||
editProfileAction)
|
editProfileAction)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue