StickyNoteActor::~StickyNoteActor() { bool prevHasExceededMaxNumStickyNotes = StickyNoteMenuActionCustomizer::hasExceededMaxNumStickyNotes(); if ((GLOBAL(settings).curNumStickyNotes > 0)) --GLOBAL(settings).curNumStickyNotes; // change the sticky note pad texture to reflect the sticky note pad state if (prevHasExceededMaxNumStickyNotes && !StickyNoteMenuActionCustomizer::hasExceededMaxNumStickyNotes()) { CustomActor * actor = scnManager->getCustomActor<StickyNotePadActorImpl>(); if (actor) actor->setTextureID("icon.custom.stickyNotePad"); } // disable theme event notifications if (shared_ptr<ThemeManager> tm = themeManagerRef.lock()) tm->unregisterThemeEventHandler(this); // destroy the temporary actor SAFE_DELETE(_tmpAnimationActor); // dismiss the edit dialog dismissEditDialog(); // destroy the dialog SAFE_DELETE(_editDialog); // free the sticky note texture #ifdef DXRENDER onRelease(); #endif }
StickyNoteActor::StickyNoteActor() : FileSystemActor() , themeManagerRef(themeManager) , _stickyNoteTextureId(0) , _tmpAnimationActor(NULL) , _selectExistingText(false) { // populate the predefined strings if necessary if (_predefinedPhrases.isEmpty()) { //const QString doubleClickMsg("\n(Double click it later to edit)"); _predefinedPhrases.append(QT_TR_NOOP("- Open another sticky note to read these")); if (winOS->GetLocaleLanguage().startsWith("en")) { _predefinedPhrases.append(QT_TR_NOOP("- Do something nice")); _predefinedPhrases.append(QT_TR_NOOP("- Bump around")); _predefinedPhrases.append(QT_TR_NOOP("- Do one thing everyday that scares you")); _predefinedPhrases.append(QT_TR_NOOP("- Buy a pen")); _predefinedPhrases.append(QT_TR_NOOP("- Take a nap")); _predefinedPhrases.append(QT_TR_NOOP("- Take a deep breath")); _predefinedPhrases.append(QT_TR_NOOP("- Buy a goldfish")); _predefinedPhrases.append(QT_TR_NOOP("- Pick up groceries")); _predefinedPhrases.append(QT_TR_NOOP("- Call Mom")); #ifndef DISABLE_PHONING _predefinedPhrases.append(QT_TR_NOOP("- Visit BumpTop.com")); #endif _predefinedPhrases.append(QT_TR_NOOP("- Think about life")); _predefinedPhrases.append(QT_TR_NOOP("- Reflect")); _predefinedPhrases.append(QT_TR_NOOP("- Read a book")); _predefinedPhrases.append(QT_TR_NOOP("- Take up Yoga")); _predefinedPhrases.append(QT_TR_NOOP("- Walk the dog")); _predefinedPhrases.append(QT_TR_NOOP("- Bake some bread")); _predefinedPhrases.append(QT_TR_NOOP("- Say something nice about someone")); _predefinedPhrases.append(QT_TR_NOOP("- Mow the lawn")); _predefinedPhrases.append(QT_TR_NOOP("- Plant a tree")); _predefinedPhrases.append(QT_TR_NOOP("- Save the planet")); _predefinedPhrases.append(QT_TR_NOOP("- Change the world")); _predefinedPhrases.append(QT_TR_NOOP("- Make a difference")); _predefinedPhrases.append(QT_TR_NOOP("- Fix global warming")); _predefinedPhrases.append(QT_TR_NOOP("- Do the dishes")); _predefinedPhrases.append(QT_TR_NOOP("- Write a blog entry")); _predefinedPhrases.append(QT_TR_NOOP("- Donate to a good cause")); _predefinedPhrases.append(QT_TR_NOOP("- Clean up my desktop")); _predefinedPhrases.append(QT_TR_NOOP("- Tell a friend about BumpTop")); _predefinedPhrases.append(QT_TR_NOOP("- Get some exercise")); _predefinedPhrases.append(QT_TR_NOOP("- Go for a bike ride")); } } pushFileSystemType(StickyNote); setText(QT_NT("")); hideText(true); ++GLOBAL(settings).curNumStickyNotes; // change the sticky note pad texture to reflect the sticky note pad state if (StickyNoteMenuActionCustomizer::hasExceededMaxNumStickyNotes()) { CustomActor * actor = scnManager->getCustomActor<StickyNotePadActorImpl>(); if (actor) actor->setTextureID("icon.custom.stickyNotePadDisabled"); } // enable theme event notifications themeManager->registerThemeEventHandler(this); }