mirror of https://github.com/zlatinb/muwire
ability to re-fetch profiles
parent
ed9b4f2014
commit
d730127486
|
@ -24,6 +24,7 @@ class ViewProfileController {
|
||||||
@ControllerAction
|
@ControllerAction
|
||||||
void fetch() {
|
void fetch() {
|
||||||
model.register()
|
model.register()
|
||||||
|
model.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ControllerAction
|
@ControllerAction
|
||||||
|
|
|
@ -726,6 +726,7 @@ PROFILE_VIEWER_FETCH=Fetch Profile
|
||||||
PROFILE_VIEWER_AVATAR=User Avatar
|
PROFILE_VIEWER_AVATAR=User Avatar
|
||||||
PROFILE_VIEWER_PROFILE=Profile
|
PROFILE_VIEWER_PROFILE=Profile
|
||||||
PROFILE_VIEWER_BLOCK=Block
|
PROFILE_VIEWER_BLOCK=Block
|
||||||
|
PROFILE_VIEWER_UPDATE=Update Profile
|
||||||
|
|
||||||
## Tooltips
|
## Tooltips
|
||||||
|
|
||||||
|
@ -906,6 +907,7 @@ TOOLTIP_PROFILE_EDITOR_GENERATE=Generate an avatar from your MuWire ID
|
||||||
TOOLTIP_PROFILE_VIEWER_FETCH=Fetch the full profile of this user
|
TOOLTIP_PROFILE_VIEWER_FETCH=Fetch the full profile of this user
|
||||||
TOOLTIP_PROFILE_VIEWER_ADD_CONTACT=Add this user as a trusted contact
|
TOOLTIP_PROFILE_VIEWER_ADD_CONTACT=Add this user as a trusted contact
|
||||||
TOOLTIP_PROFILE_VIEWER_BLOCK=Block this user
|
TOOLTIP_PROFILE_VIEWER_BLOCK=Block this user
|
||||||
|
TOOLTIP_PROFILE_VIEWER_UPDATE=Check for updated profile
|
||||||
|
|
||||||
## Test string
|
## Test string
|
||||||
TEST_PLURALIZABLE_STRING={count, plural, one {You have {count} item.} other {You have {count} items.}}
|
TEST_PLURALIZABLE_STRING={count, plural, one {You have {count} item.} other {You have {count} items.}}
|
||||||
|
|
|
@ -38,11 +38,18 @@ class ViewProfileModel {
|
||||||
profileTitle = HTMLSanitizer.sanitize(profileHeader.getTitle())
|
profileTitle = HTMLSanitizer.sanitize(profileHeader.getTitle())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean fetchEnabled() {
|
||||||
|
status != MWProfileFetchStatus.CONNECTING && status != MWProfileFetchStatus.FETCHING
|
||||||
|
}
|
||||||
|
|
||||||
void register() {
|
void register() {
|
||||||
if (registered)
|
if (registered)
|
||||||
return
|
return
|
||||||
registered = true
|
registered = true
|
||||||
core.getEventBus().register(MWProfileFetchEvent.class, this)
|
core.getEventBus().register(MWProfileFetchEvent.class, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
void fetch() {
|
||||||
core.getEventBus().publish(new UIProfileFetchEvent(uuid: uuid, host: persona))
|
core.getEventBus().publish(new UIProfileFetchEvent(uuid: uuid, host: persona))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muwire.gui.profile
|
package com.muwire.gui.profile
|
||||||
|
|
||||||
import com.muwire.core.profile.MWProfile
|
import com.muwire.core.profile.MWProfile
|
||||||
|
import com.muwire.core.profile.MWProfileFetchStatus
|
||||||
import com.muwire.gui.HTMLSanitizer
|
import com.muwire.gui.HTMLSanitizer
|
||||||
|
|
||||||
import javax.imageio.ImageIO
|
import javax.imageio.ImageIO
|
||||||
|
@ -74,21 +75,29 @@ class ViewProfileView {
|
||||||
cardLayout()
|
cardLayout()
|
||||||
panel(constraints: "fetch-profile") {
|
panel(constraints: "fetch-profile") {
|
||||||
button(text: trans("PROFILE_VIEWER_FETCH"), toolTipText: trans("TOOLTIP_PROFILE_VIEWER_FETCH"),
|
button(text: trans("PROFILE_VIEWER_FETCH"), toolTipText: trans("TOOLTIP_PROFILE_VIEWER_FETCH"),
|
||||||
|
enabled: bind {model.fetchEnabled()},
|
||||||
fetchAction)
|
fetchAction)
|
||||||
}
|
}
|
||||||
panel(constraints: "full-profile") {
|
panel(constraints: "full-profile") {
|
||||||
gridLayout(rows: 1, cols: 2)
|
borderLayout()
|
||||||
panel(border: titledBorder(title: trans("PROFILE_VIEWER_AVATAR"), border: etchedBorder(),
|
panel(constraints: BorderLayout.CENTER) {
|
||||||
titlePosition: TitledBorder.TOP)) {
|
gridLayout(rows: 1, cols: 2)
|
||||||
gridLayout(rows: 1, cols: 1)
|
panel(border: titledBorder(title: trans("PROFILE_VIEWER_AVATAR"), border: etchedBorder(),
|
||||||
widget(imagePanel)
|
titlePosition: TitledBorder.TOP)) {
|
||||||
}
|
gridLayout(rows: 1, cols: 1)
|
||||||
panel(border: titledBorder(title: trans("PROFILE_VIEWER_PROFILE"), border: etchedBorder(),
|
widget(imagePanel)
|
||||||
titlePosition: TitledBorder.TOP)) {
|
|
||||||
gridLayout(rows: 1, cols: 1)
|
|
||||||
scrollPane {
|
|
||||||
bodyArea = textArea(editable: false, lineWrap: true, wrapStyleWord: true)
|
|
||||||
}
|
}
|
||||||
|
panel(border: titledBorder(title: trans("PROFILE_VIEWER_PROFILE"), border: etchedBorder(),
|
||||||
|
titlePosition: TitledBorder.TOP)) {
|
||||||
|
gridLayout(rows: 1, cols: 1)
|
||||||
|
scrollPane {
|
||||||
|
bodyArea = textArea(editable: false, lineWrap: true, wrapStyleWord: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
panel(constraints: BorderLayout.SOUTH) {
|
||||||
|
button(text: trans("PROFILE_VIEWER_UPDATE"), toolTipText: trans("TOOLTIP_PROFILE_VIEWER_UPDATE"),
|
||||||
|
enabled: bind { model.fetchEnabled()}, fetchAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue