Mercurial > hg > dmlib
diff edmain.cpp @ 403:d34922e6a244
Even more work towards the editor.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 19 Oct 2012 21:52:16 +0300 |
parents | 0f290af63fc1 |
children | 935b91d0f508 |
line wrap: on
line diff
--- a/edmain.cpp Fri Oct 19 17:49:22 2012 +0300 +++ b/edmain.cpp Fri Oct 19 21:52:16 2012 +0300 @@ -247,6 +247,11 @@ } +void DemoEditor::updateResourceView() +{ +} + + void DemoEditor::updateTimelineView() { demoView->setEngineData(&engine); @@ -341,10 +346,7 @@ } // Etc. - - updateTimelineView(); - updateMenuStates(); - update(); + rehash(); return DMERR_OK; } @@ -361,10 +363,20 @@ } +void DemoEditor::rehash() +{ + timelineView->setTimeline(currTimeline); + updateResourceView(); + updateTimelineView(); + updateMenuStates(); + update(); +} + + void DemoEditor::createNewFile() { delete currTimeline; - currTimeline = new TimelineObject(); + currTimeline = new EDTimelineObject(); DMTimelineTrack *tr; dmTimelineAddTrack(currTimeline->tl, &tr, "Penis"); @@ -374,15 +386,15 @@ dmTimelineEventSetEffectByIndex(ev, 0); - update(); historyReset(); updateMenuStates(); + update(); } void DemoEditor::readFromFile(QString filename) { - TimelineObject *tmp = new TimelineObject(); + EDTimelineObject *tmp = new EDTimelineObject(); int ret = tmp->load(filename); if (ret != DMERR_OK) { @@ -393,14 +405,7 @@ { delete currTimeline; currTimeline = tmp; - - timelineView->setTimeline(currTimeline); - updateTimelineView(); - updateMenuStates(); - - update(); - historyReset(); - updateMenuStates(); + rehash(); } } @@ -423,7 +428,6 @@ restoreGeometry(s.value("windowGeometry").toByteArray()); restoreState(s.value("windowState").toByteArray()); - } @@ -433,7 +437,6 @@ s.setValue("windowGeometry", saveGeometry()); s.setValue("windowState", saveState()); - } @@ -466,7 +469,7 @@ delete undoHistory.takeFirst(); } - TimelineObject *copy = new TimelineObject(currTimeline); + EDTimelineObject *copy = new EDTimelineObject(currTimeline); copy->setState(description); undoHistory.append(copy); } @@ -477,12 +480,13 @@ if (currTimeline == NULL) return; - TimelineObject *copy = new TimelineObject(currTimeline); + EDTimelineObject *copy = new EDTimelineObject(currTimeline); copy->setState("-"); undoHistory.append(copy); undoHistoryPos = undoHistory.size() - 1; currTimeline->touch(); + updateTimelineView(); updateMenuStates(); update(); } @@ -503,9 +507,9 @@ { undoHistoryPos++; delete currTimeline; - currTimeline = new TimelineObject(undoHistory.at(undoHistoryPos)); + currTimeline = new EDTimelineObject(undoHistory.at(undoHistoryPos)); currTimeline->touch(); - + updateTimelineView(); updateMenuStates(); update(); } @@ -518,9 +522,9 @@ { undoHistoryPos--; delete currTimeline; - currTimeline = new TimelineObject(undoHistory.at(undoHistoryPos)); + currTimeline = new EDTimelineObject(undoHistory.at(undoHistoryPos)); currTimeline->touch(); - + updateTimelineView(); updateMenuStates(); update(); }