void ExploreFrame::UpdateTitle()
{
	bool modified = m_archive.get() && m_archive->IsModified();

	wxString modStr;

#if defined(__WXOSX__)
	OSXSetModified(modified);
#else
	if (modified)
		modStr = "*";
#endif

	bool saveAvailable = m_archive.get() && !m_archive->GetReadOnly() && modified;
	m_menubar->Enable(wxID_SAVE, saveAvailable);
	m_toolBar->EnableTool(wxID_SAVE, saveAvailable);
	m_menubar->Enable(wxID_SAVEAS, saveAvailable);

	wxString newTitle = modStr;

	if (!m_patchFileName.empty())
	{
		wxFileName archiveFN(m_patchFileName);
		newTitle += wxString::Format("%s - %s", archiveFN.GetName(), wxTheApp->GetAppDisplayName());
	} 
	else
		newTitle += wxTheApp->GetAppDisplayName();

	SetTitle(newTitle);
}
Example #2
0
void FrameMain::UpdateTitle() {
	wxString newTitle;
	if (context->subsController->IsModified()) newTitle << "* ";
	newTitle << context->subsController->Filename().filename().wstring();

#ifndef __WXMAC__
	newTitle << " - Aegisub " << GetAegisubLongVersionString();
#endif

#if defined(__WXMAC__) && !defined(__LP64__)
	// On Mac, set the mark in the close button
	OSXSetModified(context->subsController->IsModified());
#endif

	if (GetTitle() != newTitle) SetTitle(newTitle);
}