diff --git a/core/src/main/java/com/muwire/core/filefeeds/Feed.java b/core/src/main/java/com/muwire/core/filefeeds/Feed.java index 8758265c..8dd61674 100644 --- a/core/src/main/java/com/muwire/core/filefeeds/Feed.java +++ b/core/src/main/java/com/muwire/core/filefeeds/Feed.java @@ -14,6 +14,7 @@ public class Feed { public Feed(Persona publisher) { this.publisher = publisher; + this.status = FeedFetchStatus.IDLE; } public int getUpdateInterval() { diff --git a/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy b/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy index 83c4490d..4616c175 100644 --- a/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy +++ b/gui/griffon-app/controllers/com/muwire/gui/MainFrameController.groovy @@ -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 diff --git a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy index c98982c1..558384f4 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -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() {