mirror of
https://github.com/g4klx/ircDDBGateway.git
synced 2026-04-21 06:03:58 +00:00
commit
cb5a7b601c
4 changed files with 27 additions and 14 deletions
|
|
@ -760,7 +760,7 @@ m_y(DEFAULT_WINDOW_Y)
|
||||||
m_config->Read(m_name + KEY_XLX_ENABLED, &m_xlxEnabled, DEFAULT_XLX_ENABLED);
|
m_config->Read(m_name + KEY_XLX_ENABLED, &m_xlxEnabled, DEFAULT_XLX_ENABLED);
|
||||||
|
|
||||||
m_config->Read(m_name + KEY_XLX_HOSTS_FILE_URL, &m_xlxHostsFileUrl, DEFAULT_XLX_HOSTS_FILE_URL);
|
m_config->Read(m_name + KEY_XLX_HOSTS_FILE_URL, &m_xlxHostsFileUrl, DEFAULT_XLX_HOSTS_FILE_URL);
|
||||||
if(m_xlxEnabled && m_xlxHostsFileUrl.IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty
|
if(m_xlxEnabled && m_xlxHostsFileUrl.Trim().IsEmpty())//To avoid support nightmare, fill the url with the default one when xlx is enabled and the url is left empty
|
||||||
m_xlxHostsFileUrl = DEFAULT_XLX_HOSTS_FILE_URL;
|
m_xlxHostsFileUrl = DEFAULT_XLX_HOSTS_FILE_URL;
|
||||||
|
|
||||||
m_config->Read(m_name + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND);
|
m_config->Read(m_name + KEY_STARNET_BAND1, &m_starNet1Band, DEFAULT_STARNET_BAND);
|
||||||
|
|
@ -1434,7 +1434,7 @@ m_y(DEFAULT_WINDOW_Y)
|
||||||
} else if (key.IsSameAs(KEY_XLX_ENABLED)) {
|
} else if (key.IsSameAs(KEY_XLX_ENABLED)) {
|
||||||
val.ToLong(&temp1);
|
val.ToLong(&temp1);
|
||||||
m_xlxEnabled = temp1 == 1L;
|
m_xlxEnabled = temp1 == 1L;
|
||||||
} else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.IsEmpty()) { //always load default url if the value in the config file is empty
|
} else if (key.IsSameAs(KEY_XLX_HOSTS_FILE_URL) && !val.Trim().IsEmpty()) { //always load default url if the value in the config file is empty
|
||||||
m_xlxHostsFileUrl = val;
|
m_xlxHostsFileUrl = val;
|
||||||
} else if (key.IsSameAs(KEY_STARNET_BAND1)) {
|
} else if (key.IsSameAs(KEY_STARNET_BAND1)) {
|
||||||
m_starNet1Band = val;
|
m_starNet1Band = val;
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,8 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL)
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxInputStream* in = NULL;
|
wxInputStream* in = http.GetInputStream(path);
|
||||||
if((in = http.GetInputStream(path)) && in->IsOk()) {
|
if(in != NULL && in->IsOk()) {
|
||||||
wxFile file;
|
wxFile file;
|
||||||
wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"), &file);
|
wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"), &file);
|
||||||
wxLogMessage(_T("Created temporary file %s"), xlxHostsFileName);
|
wxLogMessage(_T("Created temporary file %s"), xlxHostsFileName);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
#include "XLXSet.h"
|
#include "XLXSet.h"
|
||||||
#include "Defs.h"
|
#include "Defs.h"
|
||||||
|
|
||||||
|
#include <wx/url.h>
|
||||||
|
|
||||||
// TODO F4FXL try to figure out why below symbols are not found under ubuntu
|
// TODO F4FXL try to figure out why below symbols are not found under ubuntu
|
||||||
//#include <wx/url.h>
|
//#include <wx/url.h>
|
||||||
|
|
||||||
|
|
@ -79,13 +81,19 @@ bool CXLXSet::Validate()
|
||||||
if (n == wxNOT_FOUND)
|
if (n == wxNOT_FOUND)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#if defined(__WINDOWS__)
|
||||||
// TODO F4FXL try to figure out why below symbols are not found under ubuntu
|
// TODO F4FXL try to figure out why below symbols are not found under ubuntu
|
||||||
/*wxString value = m_xlxHostsFileUrl->GetValue();
|
wxString value = m_xlxHostsFileUrl->GetValue();
|
||||||
wxURL url(value);
|
wxURL url(value);
|
||||||
if (url.GetError() != wxURL_NOERR)
|
if (url.GetError() == wxURL_NOERR)
|
||||||
return false;*/
|
return true;
|
||||||
|
|
||||||
|
wxMessageDialog dialog(this, _("The XLX host file URL is not valid"), m_title + _(" Error"), wxICON_ERROR);
|
||||||
|
dialog.ShowModal();
|
||||||
|
return false;
|
||||||
|
#else
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -102,13 +110,16 @@ wxString CXLXSet::getXLXHostsFileUrl() const
|
||||||
{
|
{
|
||||||
wxString value = m_xlxHostsFileUrl->GetValue();
|
wxString value = m_xlxHostsFileUrl->GetValue();
|
||||||
|
|
||||||
|
#if defined(__WINDOWS__)
|
||||||
// TODO F4FXL try to figure out why below symbols are not found under ubuntu
|
// TODO F4FXL try to figure out why below symbols are not found under ubuntu
|
||||||
//wxURL url(value);
|
wxURL url(value);
|
||||||
//if (url.GetError() == wxURL_NOERR)
|
if (url.GetError() == wxURL_NOERR)
|
||||||
// return value;
|
return value;
|
||||||
|
|
||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
|
#else
|
||||||
|
return value;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CXLXSet::onEnabled(wxCommandEvent &event)
|
void CXLXSet::onEnabled(wxCommandEvent &event)
|
||||||
|
|
|
||||||
|
|
@ -171,8 +171,10 @@ int CIRCDDBGatewayApp::OnExit()
|
||||||
|
|
||||||
wxLogInfo(APPLICATION_NAME + wxT(" is exiting"));
|
wxLogInfo(APPLICATION_NAME + wxT(" is exiting"));
|
||||||
|
|
||||||
//m_thread->kill();
|
m_thread->kill();
|
||||||
wxGetApp().GetTopWindow()->Close();
|
wxWindow * topWin = wxGetApp().GetTopWindow();
|
||||||
|
if (topWin != NULL)
|
||||||
|
topWin->Close();
|
||||||
|
|
||||||
delete m_config;
|
delete m_config;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue