manual update and unsubscribe actions
This commit is contained in:
@@ -14,6 +14,7 @@ public class Feed {
|
||||
|
||||
public Feed(Persona publisher) {
|
||||
this.publisher = publisher;
|
||||
this.status = FeedFetchStatus.IDLE;
|
||||
}
|
||||
|
||||
public int getUpdateInterval() {
|
||||
|
||||
@@ -30,6 +30,9 @@ import com.muwire.core.download.UIDownloadCancelledEvent
|
||||
import com.muwire.core.download.UIDownloadPausedEvent
|
||||
import com.muwire.core.download.UIDownloadResumedEvent
|
||||
import com.muwire.core.filecert.UICreateCertificateEvent
|
||||
import com.muwire.core.filefeeds.Feed
|
||||
import com.muwire.core.filefeeds.UIFeedDeletedEvent
|
||||
import com.muwire.core.filefeeds.UIFeedUpdateEvent
|
||||
import com.muwire.core.filefeeds.UIFilePublishedEvent
|
||||
import com.muwire.core.filefeeds.UIFileUnpublishedEvent
|
||||
import com.muwire.core.files.FileUnsharedEvent
|
||||
@@ -530,12 +533,23 @@ class MainFrameController {
|
||||
|
||||
@ControllerAction
|
||||
void updateFileFeed() {
|
||||
|
||||
Feed feed = view.selectedFeed()
|
||||
if (feed == null)
|
||||
return
|
||||
model.core.eventBus.publish(new UIFeedUpdateEvent(host: feed.getPublisher()))
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void unsubscribeFileFeed() {
|
||||
|
||||
Feed feed = view.selectedFeed()
|
||||
if (feed == null)
|
||||
return
|
||||
model.core.eventBus.publish(new UIFeedDeletedEvent(host : feed.getPublisher()))
|
||||
runInsideUIAsync {
|
||||
model.feeds.remove(feed)
|
||||
model.feedItems.clear()
|
||||
view.refreshFeeds()
|
||||
}
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
|
||||
@@ -1332,6 +1332,9 @@ class MainFrameView {
|
||||
feedsTable.model.fireTableDataChanged()
|
||||
if (selectedFeed >= 0)
|
||||
feedsTable.selectionModel.setSelectionInterval(selectedFeed, selectedFeed)
|
||||
|
||||
JTable feedItemsTable = builder.getVariable("feed-items-table")
|
||||
feedItemsTable.model.fireTableDataChanged()
|
||||
}
|
||||
|
||||
Feed selectedFeed() {
|
||||
|
||||
Reference in New Issue
Block a user