diff --git a/TODO.txt b/TODO.txt index 78f3e08..033901f 100644 --- a/TODO.txt +++ b/TODO.txt @@ -25,9 +25,6 @@ Important improvements: Nice Improvements: -* Save window positions - * Main window - * Subscription-edit window * Proper scripting support * Show in desktray * Store feeds in kEnqueueFeeds/etc messages as paths? hmm @@ -35,12 +32,5 @@ Nice Improvements: processing, the changes will be applied. * Move the provisional BList download queue to a BJob + JobQueue system * This might add some more flexibility -* Multiple downloads at once? +* Multiple downloads at once * Array of thread_ids for multiple DL threads? - * In which case, it'd probably make sense to only spin them - up as necessary, and kill when everything's done. - * That'd require a proper queue system, instead of just - spamming data to the download thread lol - * Using a proper queue list would give faster - results to Notifer about how many feeds are - enqueued (so things *feel* faster) diff --git a/src/FeedEditWindow.cpp b/src/FeedEditWindow.cpp index 465272b..dcd6505 100644 --- a/src/FeedEditWindow.cpp +++ b/src/FeedEditWindow.cpp @@ -21,7 +21,7 @@ FeedEditWindow::FeedEditWindow() : - BWindow(BRect(BPoint(-1000.0, -1000.0), BSize(500, 150)), "New Feed", + BWindow(((App*)be_app)->fPreferences->fFeedEditRect, "New Feed", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) { _InitInterface(); @@ -53,6 +53,12 @@ FeedEditWindow::FeedEditWindow(FeedListItem* feedItem) } +FeedEditWindow::~FeedEditWindow() +{ + ((App*)be_app)->fPreferences->fFeedEditRect = ConvertToScreen(Bounds()); +} + + void FeedEditWindow::MessageReceived(BMessage* msg) { diff --git a/src/FeedEditWindow.h b/src/FeedEditWindow.h index 9f1e1a7..41f3684 100644 --- a/src/FeedEditWindow.h +++ b/src/FeedEditWindow.h @@ -26,6 +26,7 @@ public: FeedEditWindow(); FeedEditWindow(BEntry feedEntry); FeedEditWindow(FeedListItem* feedItem); + ~FeedEditWindow(); void MessageReceived(BMessage* msg); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a3a0b3d..d720138 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -25,7 +25,7 @@ MainWindow::MainWindow() : - BWindow(BRect(BPoint(-1000.0, -1000.0), BSize(520, 380)), "Pogger", + BWindow(((App*)be_app)->fPreferences->fMainWindowRect, "Pogger", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) { _InitInterface(); @@ -33,6 +33,13 @@ MainWindow::MainWindow() } +MainWindow::~MainWindow() +{ + ((App*)be_app)->fPreferences->fMainWindowRect = ConvertToScreen(Bounds()); + ((App*)be_app)->fPreferences->fTabSelection = fTabView->Selection(); +} + + void MainWindow::MessageReceived(BMessage *msg) { @@ -92,6 +99,7 @@ MainWindow::_InitInterface() fTabView->AddTab(fEntriesView); fTabView->AddTab(fUpdatesView); fTabView->SetBorder(B_NO_BORDER); + fTabView->Select(((App*)be_app)->fPreferences->fTabSelection); fBaseView->AddChild(fTabView); // Bottom bar diff --git a/src/MainWindow.h b/src/MainWindow.h index bb6e6fd..20a6a1a 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -16,6 +16,7 @@ class UpdatesView; class MainWindow : public BWindow { public: MainWindow(); + ~MainWindow(); void MessageReceived(BMessage*); diff --git a/src/Preferences.cpp b/src/Preferences.cpp index 4fa6b78..e349f27 100644 --- a/src/Preferences.cpp +++ b/src/Preferences.cpp @@ -40,6 +40,12 @@ Preferences::Load() fNewNotify = storage.GetBool("notifyNew", true); fFailureNotify = storage.GetBool("notifyFailure", true); fUpdateInterval = storage.GetInt8("updateInterval", 1); + + fMainWindowRect = storage.GetRect("mainWindow", + BRect(BPoint(-1000.0, -1000.0), BSize(520, 380))); + fFeedEditRect = storage.GetRect("feedEditWindow", + BRect(BPoint(-1000.0, -1000.0), BSize(500, 150))); + fTabSelection = storage.GetInt32("tabSelection", 0); } @@ -73,6 +79,10 @@ Preferences::Save() storage.AddBool("notifyFailure", fFailureNotify); storage.AddInt8("updateInterval", fUpdateInterval); + storage.AddRect("mainWindow", fMainWindowRect); + storage.AddRect("feedEditWindow", fFeedEditRect); + storage.AddInt32("tabSelection", fTabSelection); + storage.Flatten(file); } diff --git a/src/Preferences.h b/src/Preferences.h index dbd160a..081079c 100644 --- a/src/Preferences.h +++ b/src/Preferences.h @@ -44,6 +44,10 @@ public: bool fFailureNotify; int8 fOpenAs; + BRect fMainWindowRect; + BRect fFeedEditRect; + int32 fTabSelection; + private: int8 fUpdateInterval;