mirror of https://github.com/odrling/Aegisub
Some fixes for SVN wx compatibility (that doesn't work, anyway)
Originally committed to SVN as r1472.
This commit is contained in:
parent
acc6e13022
commit
2c60df7b53
|
@ -54,7 +54,32 @@
|
||||||
#pragma comment(lib, "wxpng.lib")
|
#pragma comment(lib, "wxpng.lib")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if wxCHECK_VERSION(2, 8, 0)
|
#if wxCHECK_VERSION(2, 9, 0)
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
|
#pragma comment(lib, "wxregexud.lib")
|
||||||
|
#pragma comment(lib, "wxbase29ud.lib")
|
||||||
|
#pragma comment(lib, "wxbase29ud_net.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29ud_media.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29ud_core.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29ud_adv.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29ud_gl.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29ud_stc.lib")
|
||||||
|
#pragma comment(lib, "wxbase29ud_xml.lib")
|
||||||
|
#pragma comment(lib, "wxexpatd.lib")
|
||||||
|
#else
|
||||||
|
#pragma comment(lib, "wxregexu.lib")
|
||||||
|
#pragma comment(lib, "wxbase29u.lib")
|
||||||
|
#pragma comment(lib, "wxbase29u_net.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29u_media.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29u_core.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29u_adv.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29u_gl.lib")
|
||||||
|
#pragma comment(lib, "wxmsw29u_stc.lib")
|
||||||
|
#pragma comment(lib, "wxbase29u_xml.lib")
|
||||||
|
#pragma comment(lib, "wxexpat.lib")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif wxCHECK_VERSION(2, 8, 0)
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
#pragma comment(lib, "wxregexud.lib")
|
#pragma comment(lib, "wxregexud.lib")
|
||||||
#pragma comment(lib, "wxbase28ud.lib")
|
#pragma comment(lib, "wxbase28ud.lib")
|
||||||
|
|
|
@ -127,7 +127,8 @@ void HunspellSpellChecker::Reset() {
|
||||||
// Can add to dictionary?
|
// Can add to dictionary?
|
||||||
bool HunspellSpellChecker::CanAddWord(wxString word) {
|
bool HunspellSpellChecker::CanAddWord(wxString word) {
|
||||||
if (!hunspell) return false;
|
if (!hunspell) return false;
|
||||||
return (word.mb_str(*conv) != NULL);
|
wxCharBuffer buffer = word.mb_str(*conv);
|
||||||
|
return (buffer.data() != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -680,7 +680,7 @@ void SubtitlesGrid::OnAudioClip(wxCommandEvent &event) {
|
||||||
end=(end>num_samples)?num_samples:end;
|
end=(end>num_samples)?num_samples:end;
|
||||||
|
|
||||||
|
|
||||||
wxString filename = wxFileSelector(_("Save audio clip"),0,0,_T("wav"),0,wxFD_SAVE|wxFD_OVERWRITE_PROMPT,this);
|
wxString filename = wxFileSelector(_("Save audio clip"),_T(""),_T(""),_T("wav"),_T(""),wxFD_SAVE|wxFD_OVERWRITE_PROMPT,this);
|
||||||
|
|
||||||
if (!filename.empty()) {
|
if (!filename.empty()) {
|
||||||
std::ofstream outfile(filename.mb_str(wxConvLocal),std::ios::binary);
|
std::ofstream outfile(filename.mb_str(wxConvLocal),std::ios::binary);
|
||||||
|
|
|
@ -111,7 +111,11 @@ wxString TextFileReader::GetEncoding(const wxString _filename) {
|
||||||
CloseHandle(ifile);
|
CloseHandle(ifile);
|
||||||
#else
|
#else
|
||||||
ifstream ifile;
|
ifstream ifile;
|
||||||
|
#ifdef WIN32
|
||||||
|
ifile.open(_filename.wc_str());
|
||||||
|
#else
|
||||||
ifile.open(wxFNCONV(_filename));
|
ifile.open(wxFNCONV(_filename));
|
||||||
|
#endif
|
||||||
if (!ifile.is_open()) {
|
if (!ifile.is_open()) {
|
||||||
return _T("unknown");
|
return _T("unknown");
|
||||||
}
|
}
|
||||||
|
@ -288,8 +292,12 @@ void TextFileReader::Open() {
|
||||||
if (file == 0) {
|
if (file == 0) {
|
||||||
throw _T("Failed opening file for reading.");
|
throw _T("Failed opening file for reading.");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#ifdef WIN32
|
||||||
|
file.open(filename.wc_str(),std::ios::in | std::ios::binary);
|
||||||
#else
|
#else
|
||||||
file.open(wxFNCONV(filename),std::ios::in | std::ios::binary);
|
file.open(wxFNCONV(filename),std::ios::in | std::ios::binary);
|
||||||
|
#endif
|
||||||
if (!file.is_open()) {
|
if (!file.is_open()) {
|
||||||
throw _T("Failed opening file for reading.");
|
throw _T("Failed opening file for reading.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,11 @@ TextFileWriter::~TextFileWriter() {
|
||||||
void TextFileWriter::Open() {
|
void TextFileWriter::Open() {
|
||||||
// Open file
|
// Open file
|
||||||
if (open) return;
|
if (open) return;
|
||||||
|
#ifdef WIN32
|
||||||
|
file.open(filename.wc_str(),std::ios::out | std::ios::binary | std::ios::trunc);
|
||||||
|
#else
|
||||||
file.open(wxFNCONV(filename),std::ios::out | std::ios::binary | std::ios::trunc);
|
file.open(wxFNCONV(filename),std::ios::out | std::ios::binary | std::ios::trunc);
|
||||||
|
#endif
|
||||||
if (!file.is_open()) {
|
if (!file.is_open()) {
|
||||||
throw _T("Failed opening file for writing.");
|
throw _T("Failed opening file for writing.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue