HTGTimeLineView::HTGTimeLineView(BMessage* archive) : BView(archive) { dragger = NULL; const char *ptr = NULL; isReplicant = true; errorCount = 0; archive->FindBool("HTGTimeLineView::waitingForUpdate", &waitingForUpdate); archive->FindBool("HTGTimeLineView::wantsNotifications", &wantsNotifications); archive->FindBool("HTGTimeLineView::saveTweets", &saveTweets); archive->FindString("HTGTimeLineView::name", &ptr); archive->FindInt32("HTGTimeLineView::TYPE", &TYPE); SetName(ptr); BMessage msg; BArchivable* unarchived; /*Set up listView*/ if(archive->FindMessage("HTGTimeLineView::listView", &msg) == B_OK) { unarchived = instantiate_object(&msg); if(unarchived) { std::cout << "Unable to instantiate archived <HTGTimeLineView::listView>." << std::endl; listView = dynamic_cast<HTGListView *>(unarchived); listView->ResizeTo(Bounds().Width(), Bounds().Height()); //No scrollview, so resize to fit whole view }else { listView = new HTGListView(Bounds(), "ListView", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS); } } /*Set up unhandled list*/ int i = 0; unhandledList = new BList(); while(archive->FindMessage("HTGTimeLineView::unhandled", i++, &msg) == B_OK) { unarchived = instantiate_object(&msg); if(unarchived) unhandledList->AddItem(dynamic_cast<HTGTweetItem *>(unarchived)); else std::cout << "Unable to instantiate archived <HTGTimeLineView::unhandled>." << std::endl; } /*Set up twitcurl*/ twitObj = new twitCurl(); archive->FindString("HTGTimeLineView::oauthKey", &ptr); std::string key(ptr); archive->FindString("HTGTimeLineView::oauthSecret", &ptr); std::string secret(ptr); twitObj->getOAuth().setOAuthTokenKey(key); twitObj->getOAuth().setOAuthTokenSecret(secret); previousThread = B_NAME_NOT_FOUND; //NOTE: Should we also set the font? AddChild(listView); waitingForUpdate = true; updateTimeLine(); }
void Editor::switchVisibilityOfLayer( int layerNumber ) { Layer* layer = mObject->getLayer( layerNumber ); if ( layer != NULL ) layer->switchVisibility(); mScribbleArea->updateAllFrames(); emit updateTimeLine(); }
void Editor::moveLayer( int i, int j ) { mObject->moveLayer( i, j ); if ( j < i ) { layers()->setCurrentLayer( j ); } else { layers()->setCurrentLayer( j - 1 ); } emit updateTimeLine(); mScribbleArea->updateAllFrames(); }
void Editor::scrubTo(int frame) { if (frame < 1) { frame = 1; } int oldFrame = mFrame; mFrame = frame; Q_EMIT currentFrameChanged(oldFrame); Q_EMIT currentFrameChanged(frame); // FIXME: should not emit Timeline update here. // Editor must be an individual class. // Will remove all Timeline related code in Editor class. if (mPlaybackManager && !mPlaybackManager->isPlaying()) { emit updateTimeLine(); // needs to update the timeline to update onion skin positions } mObject->updateActiveFrames(frame); }
void Editor::modification( int layerNumber ) { if ( mObject != NULL ) { mObject->modification(); } lastModifiedFrame = currentFrame(); lastModifiedLayer = layerNumber; mScribbleArea->update(); emit updateTimeLine(); numberOfModifications++; if ( mIsAutosave && numberOfModifications > autosaveNumber ) { numberOfModifications = 0; emit needSave(); } }
void Editor::settingUpdated(SETTING setting) { switch (setting) { case SETTING::AUTO_SAVE: mIsAutosave = mPreferenceManager->isOn(SETTING::AUTO_SAVE); break; case SETTING::AUTO_SAVE_NUMBER: mAutosaveNumber = mPreferenceManager->getInt(SETTING::AUTO_SAVE_NUMBER); break; case SETTING::ONION_TYPE: mScribbleArea->updateAllFrames(); emit updateTimeLine(); break; case SETTING::FRAME_POOL_SIZE: mObject->setActiveFramePoolSize(mPreferenceManager->getInt(SETTING::FRAME_POOL_SIZE)); break; default: break; } }
void Editor::toggleShowAllLayers() { mScribbleArea->toggleShowAllLayers(); emit updateTimeLine(); }