Ticket #4339: ScreenSaverWindew.cpp.diff

File ScreenSaverWindew.cpp.diff, 1.4 KB (added by stimut, 15 years ago)

ScreenSaver preflet patch

  • src/preferences/screensaver/ScreenSaverWindow.cpp

     
    9797        void PopulateScreenSaverList();
    9898        void SaveState();
    9999
     100        inline void SetQuitting(bool quitting) {fIsQuitting = quitting;}
     101
    100102    private:
    101103        static int _CompareScreenSaverItems(const void* left, const void* right);
    102104        BScreenSaver* _ScreenSaver();
    103105        void _CloseSaver();
    104106        void _OpenSaver();
    105107
     108        inline bool IsQuitting() {return fIsQuitting;}
     109
    106110        BFilePanel*     fFilePanel;
    107111        BListView*      fListView;
    108112        BButton*        fTestButton;
     
    118122        PreviewView*    fPreviewView;
    119123
    120124        team_id         fScreenSaverTestTeamId;
     125
     126        bool            fIsQuitting;
    121127};
    122128
    123129static const int32 kTimeInUnits[] = {
     
    252258    : BView(rect, name, B_FOLLOW_ALL, B_WILL_DRAW),
    253259    fSettings(settings),
    254260    fSaverRunner(NULL),
    255     fSettingsView(NULL)
     261    fSettingsView(NULL),
     262    fIsQuitting(false)
    256263{
    257264    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    258265
     
    308315void
    309316ModulesView::DetachedFromWindow()
    310317{
     318    if (!IsQuitting())
     319        SaveState();
    311320    _CloseSaver();
    312321}
    313322
     
    920929    _UpdateStatus();
    921930    fModulesView->SaveState();
    922931    fSettings.Save();
     932    fModulesView->SetQuitting(true);
    923933
    924934    be_app->PostMessage(B_QUIT_REQUESTED);
    925935    return true;