Added TAS window caption logic for Qt GUI.
This commit is contained in:
parent
eb335f227d
commit
d124808c1b
|
@ -1412,14 +1412,13 @@ bool TasEditorWindow::loadProject(const char* fullname)
|
||||||
applyMovieInputConfig();
|
applyMovieInputConfig();
|
||||||
// add new file to Recent menu
|
// add new file to Recent menu
|
||||||
addRecentProject( fullname );
|
addRecentProject( fullname );
|
||||||
//taseditorWindow.updateRecentProjectsArray(fullname);
|
updateCaption();
|
||||||
//taseditorWindow.updateCaption();
|
|
||||||
update();
|
update();
|
||||||
success = true;
|
success = true;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// failed to load
|
// failed to load
|
||||||
//taseditorWindow.updateCaption();
|
updateCaption();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
@ -1435,7 +1434,8 @@ bool TasEditorWindow::saveProject(bool save_compact)
|
||||||
if (project.getProjectFile().empty())
|
if (project.getProjectFile().empty())
|
||||||
{
|
{
|
||||||
ret = saveProjectAs(save_compact);
|
ret = saveProjectAs(save_compact);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (save_compact)
|
if (save_compact)
|
||||||
{
|
{
|
||||||
|
@ -1445,7 +1445,7 @@ bool TasEditorWindow::saveProject(bool save_compact)
|
||||||
{
|
{
|
||||||
project.save(0, taseditorConfig.projectSavingOptions_SaveInBinary, taseditorConfig.projectSavingOptions_SaveMarkers, taseditorConfig.projectSavingOptions_SaveBookmarks, taseditorConfig.projectSavingOptions_GreenzoneSavingMode, taseditorConfig.projectSavingOptions_SaveHistory, taseditorConfig.projectSavingOptions_SavePianoRoll, taseditorConfig.projectSavingOptions_SaveSelection);
|
project.save(0, taseditorConfig.projectSavingOptions_SaveInBinary, taseditorConfig.projectSavingOptions_SaveMarkers, taseditorConfig.projectSavingOptions_SaveBookmarks, taseditorConfig.projectSavingOptions_GreenzoneSavingMode, taseditorConfig.projectSavingOptions_SaveHistory, taseditorConfig.projectSavingOptions_SavePianoRoll, taseditorConfig.projectSavingOptions_SaveSelection);
|
||||||
}
|
}
|
||||||
//taseditorWindow.updateCaption();
|
updateCaption();
|
||||||
}
|
}
|
||||||
|
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
@ -1548,9 +1548,8 @@ bool TasEditorWindow::saveProjectAs(bool save_compact)
|
||||||
project.save( filename.toStdString().c_str(), taseditorConfig.projectSavingOptions_SaveInBinary, taseditorConfig.projectSavingOptions_SaveMarkers, taseditorConfig.projectSavingOptions_SaveBookmarks, taseditorConfig.projectSavingOptions_GreenzoneSavingMode, taseditorConfig.projectSavingOptions_SaveHistory, taseditorConfig.projectSavingOptions_SavePianoRoll, taseditorConfig.projectSavingOptions_SaveSelection);
|
project.save( filename.toStdString().c_str(), taseditorConfig.projectSavingOptions_SaveInBinary, taseditorConfig.projectSavingOptions_SaveMarkers, taseditorConfig.projectSavingOptions_SaveBookmarks, taseditorConfig.projectSavingOptions_GreenzoneSavingMode, taseditorConfig.projectSavingOptions_SaveHistory, taseditorConfig.projectSavingOptions_SavePianoRoll, taseditorConfig.projectSavingOptions_SaveSelection);
|
||||||
}
|
}
|
||||||
addRecentProject( filename.toStdString().c_str() );
|
addRecentProject( filename.toStdString().c_str() );
|
||||||
//taseditorWindow.updateRecentProjectsArray(nameo);
|
|
||||||
// saved successfully - remove * mark from caption
|
// saved successfully - remove * mark from caption
|
||||||
//taseditorWindow.updateCaption();
|
updateCaption();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1823,7 +1822,7 @@ void TasEditorWindow::createNewProject(void)
|
||||||
recorder.reset();
|
recorder.reset();
|
||||||
//popupDisplay.reset();
|
//popupDisplay.reset();
|
||||||
//taseditorWindow.redraw();
|
//taseditorWindow.redraw();
|
||||||
//taseditorWindow.updateCaption();
|
updateCaption();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
fceuWrapperUnLock();
|
||||||
|
@ -2064,6 +2063,30 @@ void TasEditorWindow::exportMovieFile(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
void TasEditorWindow::updateCaption(void)
|
||||||
|
{
|
||||||
|
char newCaption[300];
|
||||||
|
strcpy(newCaption, "TAS Editor");
|
||||||
|
if (!movie_readonly)
|
||||||
|
{
|
||||||
|
strcat(newCaption, recorder.getRecordingCaption());
|
||||||
|
}
|
||||||
|
// add project name
|
||||||
|
std::string projectname = project.getProjectName();
|
||||||
|
if (!projectname.empty())
|
||||||
|
{
|
||||||
|
strcat(newCaption, " - ");
|
||||||
|
strcat(newCaption, projectname.c_str());
|
||||||
|
}
|
||||||
|
// and * if project has unsaved changes
|
||||||
|
if (project.getProjectChanged())
|
||||||
|
{
|
||||||
|
strcat(newCaption, "*");
|
||||||
|
}
|
||||||
|
setWindowTitle( tr(newCaption) );
|
||||||
|
//SetWindowText(hwndTASEditor, newCaption);
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
void TasEditorWindow::clearProjectList(void)
|
void TasEditorWindow::clearProjectList(void)
|
||||||
{
|
{
|
||||||
std::list <std::string*>::iterator it;
|
std::list <std::string*>::iterator it;
|
||||||
|
|
|
@ -310,6 +310,7 @@ class TasEditorWindow : public QDialog
|
||||||
HISTORY history;
|
HISTORY history;
|
||||||
BRANCHES branches;
|
BRANCHES branches;
|
||||||
|
|
||||||
|
void updateCaption(void);
|
||||||
bool loadProject(const char* fullname);
|
bool loadProject(const char* fullname);
|
||||||
void loadClipboard(const char *txt);
|
void loadClipboard(const char *txt);
|
||||||
void toggleInput(int start, int end, int joy, int button, int consecutivenessTag);
|
void toggleInput(int start, int end, int joy, int button, int consecutivenessTag);
|
||||||
|
|
|
@ -116,7 +116,7 @@ void RECORDER::update()
|
||||||
// update window caption if needed
|
// update window caption if needed
|
||||||
if (oldStateOfMovieReadonly != movie_readonly || oldMultitrackRecordingJoypadNumber != multitrackRecordingJoypadNumber)
|
if (oldStateOfMovieReadonly != movie_readonly || oldMultitrackRecordingJoypadNumber != multitrackRecordingJoypadNumber)
|
||||||
{
|
{
|
||||||
//taseditorWindow.updateCaption();
|
tasWin->updateCaption();
|
||||||
}
|
}
|
||||||
// update Bookmarks/Branches groupbox caption if needed
|
// update Bookmarks/Branches groupbox caption if needed
|
||||||
if (taseditorConfig->oldControlSchemeForBranching && oldStateOfMovieReadonly != movie_readonly)
|
if (taseditorConfig->oldControlSchemeForBranching && oldStateOfMovieReadonly != movie_readonly)
|
||||||
|
|
|
@ -382,7 +382,7 @@ void TASEDITOR_PROJECT::setProjectChanged()
|
||||||
if (!changed)
|
if (!changed)
|
||||||
{
|
{
|
||||||
changed = true;
|
changed = true;
|
||||||
//taseditorWindow.updateCaption();
|
tasWin->updateCaption();
|
||||||
sheduleNextAutosave();
|
sheduleNextAutosave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue