Update subscription list on adds/edits/deletes

This commit is contained in:
Jaidyn Ann 2021-02-20 20:58:51 -06:00
parent b8c27d9db5
commit bd358362f4
4 changed files with 13 additions and 5 deletions

View File

@ -1,6 +1,5 @@
Important Features:
* Show download progress/failures in FeedView's feedlist
* Update FeedView's feedlist when feeds added/removed
* Show in desktray
* Make archivable
* Get menu working
@ -19,9 +18,14 @@ Important improvements:
* Make UI friendly to whatever font-size you throw at it
* Give a max size to the progress label in FeedsView
* Make fancy Markdown README
* Make an icon, somehow (idk I'm not an artist)
Nice Improvements:
* 'About' window
* Save window positions
* Main window
* Subscription-edit window
* Proper scripting support
* Store feeds in kEnqueueFeeds/etc messages as paths? hmm
* This way, if the user edits the feed after it is enqueued but before

View File

@ -141,7 +141,7 @@ FeedEditWindow::_SaveFeed()
enqueueUpdated->AddData("feeds", B_RAW_TYPE, (void*)fFeed, sizeof(Feed));
((App*)be_app)->MessageReceived(enqueueUpdated);
((App*)be_app)->MessageReceived(new BMessage(kFeedsEdited));
((App*)be_app)->PostMessage(new BMessage(kFeedsEdited));
Quit();
}
@ -150,7 +150,7 @@ void
FeedEditWindow::_DeleteFeed()
{
fFeed->Unfiletize();
((App*)be_app)->MessageReceived(new BMessage(kFeedsEdited));
((App*)be_app)->PostMessage(new BMessage(kFeedsEdited));
Quit();
}

View File

@ -45,7 +45,6 @@ private:
BButton* fSaveButton;
BButton* fDeleteButton;
};

View File

@ -64,7 +64,7 @@ FeedsView::MessageReceived(BMessage* msg)
}
case kFeedsEdited:
{
// _PopulateFeedList();
_PopulateFeedList();
}
case kDownloadStart:
{
@ -178,12 +178,17 @@ void
FeedsView::_PopulateFeedList()
{
BList feeds = FeedController::SubscribedFeeds();
int32 selected = fFeedsListView->CurrentSelection();
fFeedsListView->MakeEmpty();
for (int i = 0; i < feeds.CountItems(); i++) {
FeedListItem* item = new FeedListItem((Feed*)feeds.ItemAt(i));
fFeedsListView->AddItem(item);
}
if (fFeedsListView->CountItems() < selected)
selected = fFeedsListView->CountItems();
fFeedsListView->Select(selected);
}