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: Important Features:
* Show download progress/failures in FeedView's feedlist * Show download progress/failures in FeedView's feedlist
* Update FeedView's feedlist when feeds added/removed
* Show in desktray * Show in desktray
* Make archivable * Make archivable
* Get menu working * Get menu working
@ -19,9 +18,14 @@ Important improvements:
* Make UI friendly to whatever font-size you throw at it * Make UI friendly to whatever font-size you throw at it
* Give a max size to the progress label in FeedsView * Give a max size to the progress label in FeedsView
* Make fancy Markdown README * Make fancy Markdown README
* Make an icon, somehow (idk I'm not an artist)
Nice Improvements: Nice Improvements:
* 'About' window
* Save window positions
* Main window
* Subscription-edit window
* Proper scripting support * Proper scripting support
* Store feeds in kEnqueueFeeds/etc messages as paths? hmm * Store feeds in kEnqueueFeeds/etc messages as paths? hmm
* This way, if the user edits the feed after it is enqueued but before * 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)); enqueueUpdated->AddData("feeds", B_RAW_TYPE, (void*)fFeed, sizeof(Feed));
((App*)be_app)->MessageReceived(enqueueUpdated); ((App*)be_app)->MessageReceived(enqueueUpdated);
((App*)be_app)->MessageReceived(new BMessage(kFeedsEdited)); ((App*)be_app)->PostMessage(new BMessage(kFeedsEdited));
Quit(); Quit();
} }
@ -150,7 +150,7 @@ void
FeedEditWindow::_DeleteFeed() FeedEditWindow::_DeleteFeed()
{ {
fFeed->Unfiletize(); fFeed->Unfiletize();
((App*)be_app)->MessageReceived(new BMessage(kFeedsEdited)); ((App*)be_app)->PostMessage(new BMessage(kFeedsEdited));
Quit(); Quit();
} }

View File

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

View File

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