http://trac.filezilla-project.org/ticket/8272

--- configure.orig
+++ configure
@@ -691,6 +691,9 @@ PACKAGE_VERSION_MAJOR
 WINDRESFLAGS
 WINDRES
 WX_CONFIG_WITH_ARGS
+WX_VERSION_MICRO
+WX_VERSION_MINOR
+WX_VERSION_MAJOR
 WX_RESCOMP
 WX_VERSION
 WX_LIBS_STATIC
@@ -16042,7 +16045,7 @@ $as_echo_n "checking for wxWidgets version >= $min_wx_version... " >&6; }
 $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --universal=no)... " >&6; }
     fi
 
-    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no aui,xrc,adv,core,xml,net,base"
+    WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args --unicode=yes --universal=no"
 
     WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
     wx_config_major_version=`echo $WX_VERSION | \
@@ -16081,14 +16084,13 @@ $as_echo_n "checking for wxWidgets version >= $min_wx_version (--unicode=yes --u
 
 
     if test -n "$wx_ver_ok"; then
-
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5
 $as_echo "yes (version $WX_VERSION)" >&6; }
-      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
+      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs aui,html,xrc,adv,core,xml,net,base`
 
                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5
 $as_echo_n "checking for wxWidgets static library... " >&6; }
-      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
+      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs aui,html,xrc,adv,core,xml,net,base 2>/dev/null`
       if test "x$WX_LIBS_STATIC" = "x"; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -16131,16 +16133,16 @@ $as_echo "yes" >&6; }
       fi
 
       if test "x$wx_has_cppflags" = x ; then
-                  WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
+                  WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base`
          WX_CPPFLAGS=$WX_CFLAGS
          WX_CXXFLAGS=$WX_CFLAGS
 
          WX_CFLAGS_ONLY=$WX_CFLAGS
          WX_CXXFLAGS_ONLY=$WX_CFLAGS
       else
-                  WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
-         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
-         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
+                  WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags aui,html,xrc,adv,core,xml,net,base`
+         WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags aui,html,xrc,adv,core,xml,net,base`
+         WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags aui,html,xrc,adv,core,xml,net,base`
 
          WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
          WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
@@ -16164,7 +16166,32 @@ $as_echo "no (version $WX_VERSION is not new enough)" >&6; }
        WX_LIBS=""
        WX_LIBS_STATIC=""
        WX_RESCOMP=""
-       :
+
+       if test ! -z "--unicode=yes --universal=no"; then
+
+          wx_error_message="
+    The configuration you asked for $PACKAGE_NAME requires a wxWidgets
+    build with the following settings:
+        --unicode=yes --universal=no
+    but such build is not available.
+
+    To see the wxWidgets builds available on this system, please use
+    'wx-config --list' command. To use the default build, returned by
+    'wx-config --selected-config', use the options with their 'auto'
+    default values."
+
+       fi
+
+       wx_error_message="
+    The requested wxWidgets build couldn't be found.
+    $wx_error_message
+
+    If you still get this error, then check that 'wx-config' is
+    in path, the directory where wxWidgets libraries are installed
+    (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH
+    or equivalent variable and wxWidgets version is $MIN_WX_VERSION or above."
+
+       as_fn_error $? "$wx_error_message" "$LINENO" 5
 
     fi
   else
@@ -16190,6 +16217,13 @@ $as_echo "no (version $WX_VERSION is not new enough)" >&6; }
 
 
 
+      WX_VERSION_MAJOR="$wx_config_major_version"
+  WX_VERSION_MINOR="$wx_config_minor_version"
+  WX_VERSION_MICRO="$wx_config_micro_version"
+
+
+
+
   if test "$wxWin" != 1; then
     as_fn_error $? "
         wxWidgets must be installed on your system
@@ -16205,9 +16239,6 @@ $as_echo "no (version $WX_VERSION is not new enough)" >&6; }
         equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
     " "$LINENO" 5
   fi
-  if test "$wx_config_major_version" -gt "2" || test "$wx_config_minor_version" -gt "8"; then
-    as_fn_error $? "You need to use wxWidgets 2.8.x to compile this program." "$LINENO" 5
-  fi
 
   # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here.
   if echo "$WX_CPPFLAGS" | grep __WXUNIVERSAL__ > /dev/null; then
--- src/engine/local_path.cpp.orig
+++ src/engine/local_path.cpp
@@ -48,6 +48,7 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
 
 	wxChar* out;
 	wxChar* start;
+	wxStringBuffer* buffer = 0;
 	if (*in == '\\')
 	{
 		// possibly UNC
@@ -59,7 +60,8 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
 			return false;
 		}
 
-		start = m_path.GetWriteBuf(path.Len() + 2);
+		buffer = new wxStringBuffer(m_path, path.Len() + 2);
+		start = *buffer;
 		out = start;
 		*out++ = '\\';
 		*out++ = '\\';
@@ -77,7 +79,7 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
 		{
 			// not a valid UNC path
 			*start = 0;
-			m_path.UngetWriteBuf( 0 );
+			delete buffer;
 			return false;
 		}
 
@@ -87,21 +89,22 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
 	{
 		// Regular path
 
-		start = m_path.GetWriteBuf(path.Len() + 2);
+		buffer = new wxStringBuffer(m_path, path.Len() + 2);
+		start = *buffer;
 		out = start;
 		*out++ = *in++;
 
 		if (*in++ != ':')
 		{
 			*start = 0;
-			m_path.UngetWriteBuf( 0 );
+			delete buffer;
 			return false;
 		}
 		*out++ = ':';
 		if (*in != '/' && *in != '\\' && *in)
 		{
 			*start = 0;
-			m_path.UngetWriteBuf( 0 );
+			delete buffer;
 			return false;
 		}
 		*out++ = path_separator;
@@ -120,8 +123,13 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
 		return false;
 	}
 
+#if wxCHECK_VERSION(2, 9, 0)
+	wxStringBuffer* buffer = new wxStringBuffer(m_path, path.Len() + 2);
+	wxChar* out = *buffer;
+#else
 	wxChar* start = m_path.GetWriteBuf(path.Len() + 2);
 	wxChar* out = start;
+#endif
 
 	*out++ = '/';
 	segments.push_back(out);
@@ -210,9 +218,13 @@ bool CLocalPath::SetPath(const wxString& path, wxString* file /*=0*/)
 	}
 
 	*out = 0;
-
+#if !wxCHECK_VERSION(2, 9, 0)
 	m_path.UngetWriteBuf( out - start );
-
+#else
+	if (buffer != 0) {
+		delete buffer;
+	}
+#endif
 	::Coalesce(m_path);
 
 	return true;
--- src/engine/logging.cpp.orig
+++ src/engine/logging.cpp
@@ -51,6 +51,43 @@ CLogging::~CLogging()
 	}
 }
 
+#if wxCHECK_VERSION(2, 9, 0)
+void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const
+{
+        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str());
+}
+
+void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const
+{
+        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar());
+}
+
+void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const
+{
+        LogMessage(nMessageType, msgFormat, (const char*)(wxString() << value1).c_str(), value2.AsWChar(), value3.AsWChar());
+}
+
+void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const
+{
+        LogMessage(nMessageType, msgFormat, value1.AsWChar());
+}
+
+void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const
+{
+        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar());
+}
+
+void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const
+{
+        LogMessage(nMessageType, msgFormat, value1.AsWChar(), value2.AsWChar(), value3.AsWChar(), value4.AsWChar());
+}
+
+void CLogging::LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const
+{
+        LogMessage(sourceFile, nSourceLine, pInstance, nMessageType, msgFormat, value1.AsWChar());
+}
+#endif
+
 void CLogging::LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const
 {
 	InitLogFile();
--- src/engine/logging_private.h.orig
+++ src/engine/logging_private.h
@@ -7,6 +7,16 @@ public:
 	CLogging(CFileZillaEnginePrivate *pEngine);
 	virtual ~CLogging();
 
+#if wxCHECK_VERSION(2, 9, 0)
+	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1) const;
+	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2) const;
+	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, int value1, wxCStrData value2, wxCStrData value3) const;
+	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const;
+	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2) const;
+	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1, wxCStrData value2, wxCStrData value3, wxCStrData value4) const;
+	void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, wxCStrData value1) const;
+#endif
+
 	void LogMessage(MessageType nMessageType, const wxChar *msgFormat, ...) const;
 	void LogMessageRaw(MessageType nMessageType, const wxChar *msg) const;
 	void LogMessage(wxString sourceFile, int nSourceLine, void *pInstance, MessageType nMessageType, const wxChar *msgFormat, ...) const;
--- src/engine/misc.cpp.orig
+++ src/engine/misc.cpp
@@ -349,11 +349,24 @@ void MakeLowerAscii(wxString& str)
 {
 	for (size_t i = 0; i < str.Len(); i++)
 	{
+#if wxCHECK_VERSION(2, 9, 0)
+		char c;
+		str.GetChar(i).GetAsChar(&c);
+		if (c >= 'A' && c <= 'Z')
+		{
+			c += 32;
+			str.SetChar(i, wxUniChar(c));
+		} else if (c == 0x130 || c == 0x131) {
+			c = 'i';
+			str.SetChar(i, wxUniChar(c));
+		}
+#else
 		wxChar& c = str[i];
 		if (c >= 'A' && c <= 'Z')
 			c += 32;
 		else if (c == 0x130 || c == 0x131)
 			c = 'i';
+#endif
 	}
 }
 
--- src/engine/server.cpp.orig
+++ src/engine/server.cpp
@@ -12,13 +12,13 @@ struct t_protocolInfo
 };
 
 static const t_protocolInfo protocolInfos[] = {
-	{ FTP,          _T("ftp"),    false, 21,  true,  wxTRANSLATE("FTP - File Transfer Protocol with optional encryption"),                 true  },
+	{ FTP,          _T("ftp"),    false, 21,  true,  _T("FTP - File Transfer Protocol with optional encryption"),          true  },
 	{ SFTP,         _T("sftp"),   true,  22,  false, _T("SFTP - SSH File Transfer Protocol"),                              false },
 	{ HTTP,         _T("http"),   true,  80,  false, _T("HTTP - Hypertext Transfer Protocol"),                             false  },
-	{ HTTPS,        _T("https"),  true, 443,  true,  wxTRANSLATE("HTTPS - HTTP over TLS"),                                 false  },
-	{ FTPS,         _T("ftps"),   true, 990,  true,  wxTRANSLATE("FTPS - FTP over implicit TLS/SSL"),                      true  },
-	{ FTPES,        _T("ftpes"),  true,  21,  true,  wxTRANSLATE("FTPES - FTP over explicit TLS/SSL"),                     true  },
-	{ INSECURE_FTP, _T("ftp"),    false, 21,  true,  wxTRANSLATE("FTP - Insecure File Transfer Protocol"), true  },
+	{ HTTPS,        _T("https"),  true, 443,  true,  _T("HTTPS - HTTP over TLS"),                                          false  },
+	{ FTPS,         _T("ftps"),   true, 990,  true,  _T("FTPS - FTP over implicit TLS/SSL"),                               true  },
+	{ FTPES,        _T("ftpes"),  true,  21,  true,  _T("FTPES - FTP over explicit TLS/SSL"),                              true  },
+	{ INSECURE_FTP, _T("ftp"),    false, 21,  true,  _T("FTP - Insecure File Transfer Protocol"),                          true  },
 	{ UNKNOWN,      _T(""),       false, 21,  false, _T(""), false }
 };
 
--- src/engine/serverpath.cpp.orig
+++ src/engine/serverpath.cpp
@@ -258,8 +258,13 @@ wxString CServerPath::GetSafePath() const
 		len += iter->Length() + 2 + INTLENGTH;
 
 	wxString safepath;
+#if wxCHECK_VERSION(2, 9, 0)
+	wxStringBuffer* buffer = new wxStringBuffer(safepath, len);
+	wxChar* t = *buffer;
+#else
 	wxChar* start = safepath.GetWriteBuf(len);
 	wxChar* t = start;
+#endif
 
 	t = fast_sprint_number(t, m_type);
 	*(t++) = ' ';
@@ -281,8 +286,11 @@ wxString CServerPath::GetSafePath() const
 		t += iter->size();
 	}
 	*t = 0;
-
+#if !wxCHECK_VERSION(2, 9, 0)
 	safepath.UngetWriteBuf( t - start );
+#else
+	delete buffer;
+#endif
 	safepath.Shrink();
 
 	return safepath;
--- src/engine/socket.cpp.orig
+++ src/engine/socket.cpp
@@ -1187,7 +1187,7 @@ void CSocket::SetEventHandler(CSocketEventHandler* pEvtHandler)
 	}
 }
 
-#define ERRORDECL(c, desc) { c, _T(#c), wxTRANSLATE(desc) },
+#define ERRORDECL(c, desc) { c, _T(#c), _T(desc) },
 
 struct Error_table
 {
--- src/engine/string_coalescer.cpp.orig
+++ src/engine/string_coalescer.cpp
@@ -67,7 +67,11 @@ struct fast_equal
 	{
 		// wxString is CoW, yet it doesn't even do this fast pointer
 		// comparison in its less and/or equal operator(s).
+#if wxCHECK_VERSION(2, 9, 0)
+		return lhs == rhs;
+#else
 		return lhs.c_str() == rhs.c_str() || lhs == rhs;
+#endif
 	}
 };
 
--- src/include/libfilezilla.h.orig
+++ src/include/libfilezilla.h
@@ -21,6 +21,10 @@
 #include <wx/datetime.h>
 #include <wx/event.h>
 #include <wx/string.h>
+#if wxCHECK_VERSION(2, 9, 0)
+#include <wx/translation.h>
+#include <wx/dcclient.h>
+#endif
 
 #include <list>
 #include <vector>
--- src/interface/FileZilla.cpp.orig
+++ src/interface/FileZilla.cpp
@@ -269,7 +269,7 @@ bool CFileZillaApp::OnInit()
 #else
 		if (!pInfo || !SetLocale(pInfo->Language))
 		{
-			if (pInfo && pInfo->Description)
+			if (pInfo && !pInfo->Description.IsEmpty())
 				wxMessageBoxEx(wxString::Format(_("Failed to set language to %s (%s), using default system language"), pInfo->Description.c_str(), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
 			else
 				wxMessageBoxEx(wxString::Format(_("Failed to set language to %s, using default system language"), language.c_str()), _("Failed to change language"), wxICON_EXCLAMATION);
@@ -694,7 +694,7 @@ void CFileZillaApp::CheckExistsFzsftp()
 	if (!wxFileName::FileExists(executable))
 	{
 		wxMessageBoxEx(wxString::Format(_("%s could not be found. Without this component of FileZilla, SFTP will not work.\n\nPlease download FileZilla again. If this problem persists, please submit a bug report."), executable.c_str()),
-			_("File not found"), wxICON_ERROR);
+			_("File not found"), wxICON_ERROR | wxOK);
 		executable.clear();
 	}
 
--- src/interface/Mainfrm.cpp.orig
+++ src/interface/Mainfrm.cpp
@@ -759,14 +759,19 @@ void CMainFrame::OnMenuHandler(wxCommandEvent &event)
 			// Do a crude approach: Drop everything unexpected...
 			for (unsigned int i = 0; i < version.Len(); i++)
 			{
+#if wxCHECK_VERSION(2, 9, 0)
+				char c;
+				version.GetChar(i).GetAsChar(&c);
+#else
 				wxChar& c = version[i];
+#endif
 				if ((version[i] >= '0' && version[i] <= '9') ||
 					(version[i] >= 'a' && version[i] <= 'z') ||
 					(version[i] >= 'A' && version[i] <= 'Z') ||
 					version[i] == '-' || version[i] == '.' ||
 					version[i] == '_')
 				{
-					url += c;
+					url.Append(c);
 				}
 			}
 		}
@@ -784,7 +789,11 @@ void CMainFrame::OnMenuHandler(wxCommandEvent &event)
 			{
 				pStatusBar->Show(show);
 				wxSizeEvent evt;
+#if wxCHECK_VERSION(2, 9, 0)
+				controls->pLocalListViewPanel->ProcessWindowEvent(evt);
+#else
 				controls->pLocalListViewPanel->ProcessEvent(evt);
+#endif
 			}
 		}
 		if (controls && controls->pRemoteListViewPanel)
@@ -794,7 +803,11 @@ void CMainFrame::OnMenuHandler(wxCommandEvent &event)
 			{
 				pStatusBar->Show(show);
 				wxSizeEvent evt;
+#if wxCHECK_VERSION(2, 9, 0)
+				controls->pRemoteListViewPanel->ProcessWindowEvent(evt);
+#else
 				controls->pRemoteListViewPanel->ProcessEvent(evt);
+#endif
 			}
 		}
 	}
--- src/interface/QueueView.cpp.orig
+++ src/interface/QueueView.cpp
@@ -3443,9 +3443,13 @@ wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename)
 	const wxChar replace = COptions::Get()->GetOption(OPTION_INVALID_CHAR_REPLACE)[0];
 
 	wxString result;
-
+#if wxCHECK_VERSION(2, 9, 0)
+	wxStringBuffer* buffer = new wxStringBuffer(result, filename.Len() + 1);
+	wxChar* buf = *buffer;
+#else
 	wxChar* start = result.GetWriteBuf(filename.Len() + 1);
 	wxChar* buf = start;
+#endif
 
 	const wxChar* p = filename.c_str();
 	while (*p)
@@ -3480,9 +3484,11 @@ wxString CQueueView::ReplaceInvalidCharacters(const wxString& filename)
 		p++;
 	}
 	*buf = 0;
-
+#if wxCHECK_VERSION(2, 9, 0)
+	delete buffer;
+#else
 	result.UngetWriteBuf( buf - start );
-
+#endif
 	return result;
 }
 
--- src/interface/RemoteTreeView.cpp.orig
+++ src/interface/RemoteTreeView.cpp
@@ -351,7 +351,7 @@ void CRemoteTreeView::SetDirectoryListing(const CSharedPointer<const CDirectoryL
 	SetItemImages(parent, false);
 
 #ifndef __WXMSW__
-	m_freezeCount--;
+	Thaw();
 #endif
 	if (!modified)
 		SafeSelectItem(parent);
--- src/interface/StatusView.cpp.orig
+++ src/interface/StatusView.cpp
@@ -71,7 +71,7 @@ public:
 	{
 		wxWindow* parent = GetParent();
 		event.SetEventObject(parent);
-		parent->ProcessEvent(event);
+		parent->GetEventHandler()->ProcessEvent(event);
 	}
 #else
 	void OnKeyDown(wxKeyEvent& event)
@@ -89,7 +89,7 @@ public:
 		navEvent.SetDirection(!event.ShiftDown());
 		navEvent.SetFromTab(true);
 		navEvent.ResumePropagation(1);
-		parent->ProcessEvent(navEvent);
+		parent->GetEventHandler()->ProcessEvent(navEvent);
 	}
 #endif
 };
--- src/interface/aui_notebook_ex.cpp.orig
+++ src/interface/aui_notebook_ex.cpp
@@ -3,7 +3,16 @@
 #include "aui_notebook_ex.h"
 #include <wx/dcmirror.h>
 
+#if wxCHECK_VERSION(2, 9, 0)
+wxColor wxAuiStepColour(const wxColor& c, int ialpha)
+{
+	wxColor* result = new wxColor(c);
+	result->ChangeLightness(ialpha);
+	return *result;
+}
+#else
 wxColor wxAuiStepColour(const wxColor& c, int ialpha);
+#endif
 
 #ifdef __WXMSW__
 #define TABCOLOUR wxSYS_COLOUR_3DFACE
@@ -184,9 +193,6 @@ public:
 		}
 	}
 
-#ifdef __WXGTK__
-	virtual GdkWindow* GetGDKWindow() const { return m_original_dc->GetGDKWindow(); }
-#endif
 protected:
 	int m_gradient_called;
 	int m_rectangle_called;
@@ -215,9 +221,15 @@ public:
 	virtual wxAuiTabArt* Clone()
 	{
 		wxAuiTabArtEx *art = new wxAuiTabArtEx(m_pNotebook, m_bottom, m_data);
+#if wxCHECK_VERSION(2, 9, 0)
+		art->SetNormalFont(m_normalFont);
+		art->SetSelectedFont(m_selectedFont);
+		art->SetMeasuringFont(m_measuringFont);
+#else
 		art->SetNormalFont(m_normal_font);
 		art->SetSelectedFont(m_selected_font);
 		art->SetMeasuringFont(m_measuring_font);
+#endif
 		return art;
 	}
 
@@ -257,12 +269,21 @@ public:
 						 int* x_extent)
 	{
 #ifndef __WXMAC__
+#if wxCHECK_VERSION(2, 9, 0)
+		m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
+#else
 		m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
 #endif
+#endif
 		if (!pane.active)
 		{
+#if wxCHECK_VERSION(2, 9, 0)
+			if (m_baseColour.Red() + m_baseColour.Green() + m_baseColour.Blue() >= 384)
+				m_baseColour = wxColour( m_baseColour.Red() * 0.95, m_baseColour.Green() * 0.95, m_baseColour.Blue() * 0.95 );
+#else
 			if (m_base_colour.Red() + m_base_colour.Green() + m_base_colour.Blue() >= 384)
 				m_base_colour = wxColour( m_base_colour.Red() * 0.95, m_base_colour.Green() * 0.95, m_base_colour.Blue() * 0.95 );
+#endif
 
 			dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
 			if (m_pNotebook->Highlighted(m_pNotebook->GetPageIndex(pane.window)))
@@ -270,27 +291,49 @@ public:
 				if (!m_fonts_initialized)
 				{
 					m_fonts_initialized = true;
+#if wxCHECK_VERSION(2, 9, 0)
+					m_original_normal_font = m_normalFont;
+					m_highlighted_font = m_normalFont;
+#else
 					m_original_normal_font = m_normal_font;
 					m_highlighted_font = m_normal_font;
+#endif
 					m_highlighted_font.SetWeight(wxFONTWEIGHT_BOLD);
 					m_highlighted_font.SetStyle(wxFONTSTYLE_ITALIC);
 				}
+#if wxCHECK_VERSION(2, 9, 0)
+				m_normalFont = m_highlighted_font;
+#else
 				m_normal_font = m_highlighted_font;
+#endif
 			}
 			else if (m_fonts_initialized)
+#if wxCHECK_VERSION(2, 9, 0)
+				m_normalFont = m_original_normal_font;
+#else
 				m_normal_font = m_original_normal_font;
+#endif
 		}
-
+#if wxCHECK_VERSION(2, 9, 0)
+		CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tabCtrlHeight % 2) != 0, m_bottom);
+		wxAuiGenericTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
+		m_baseColour = wxSystemSettings::GetColour(TABCOLOUR);
+#else
 		CFilterDC filter_dc(dc, pane.active ? 1 : 0, (m_tab_ctrl_height % 2) != 0, m_bottom);
 		wxAuiDefaultTabArt::DrawTab(*((wxDC*)&filter_dc), wnd, pane, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
-
 		m_base_colour = wxSystemSettings::GetColour(TABCOLOUR);
+#endif
 	}
 
 	virtual void DrawBackground(wxDC& dc, wxWindow* wnd, const wxRect& rect)
 	{
+#if wxCHECK_VERSION(2, 9, 0)
+		CFilterDC filter_dc(dc, 2, (m_tabCtrlHeight % 2) != 0, m_bottom);
+		wxAuiGenericTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
+#else
 		CFilterDC filter_dc(dc, 2, (m_tab_ctrl_height % 2) != 0, m_bottom);
 		wxAuiDefaultTabArt::DrawBackground(*((wxDC*)&filter_dc), wnd, rect);
+#endif
 	}
 protected:
 	wxAuiNotebookEx* m_pNotebook;
--- src/interface/commandqueue.cpp.orig
+++ src/interface/commandqueue.cpp
@@ -289,7 +289,7 @@ void CCommandQueue::GrantExclusiveEngineRequest()
 
 	wxCommandEvent evt(fzEVT_GRANTEXCLUSIVEENGINEACCESS);
 	evt.SetId(m_requestId);
-	m_pMainFrame->GetQueue()->AddPendingEvent(evt);
+	m_pMainFrame->GetQueue()->GetEventHandler()->AddPendingEvent(evt);
 }
 
 CFileZillaEngine* CCommandQueue::GetEngineExclusive(int requestId)
--- src/interface/filezilla.h.orig
+++ src/interface/filezilla.h
@@ -72,5 +72,6 @@
 #include <wx/toolbar.h>
 #include <wx/treectrl.h>
 #include <wx/xrc/xmlres.h>
+#include <wx/xml/xml.h>
 
 #endif
--- src/interface/import.cpp.orig
+++ src/interface/import.cpp
@@ -146,7 +146,7 @@ wxString CImportDialog::DecodeLegacyPassword(wxString pass)
 			return _T("");
 		int number = (pass[i] - '0') * 100 +
 						(pass[i + 1] - '0') * 10 +
-						pass[i + 2] - '0';
+						(pass[i + 2] - '0');
 		wxChar c = number ^ key[(i / 3 + pos) % strlen(key)];
 		output += c;
 	}
--- src/interface/listctrlex.cpp.orig
+++ src/interface/listctrlex.cpp
@@ -73,7 +73,7 @@ wxListCtrlEx::~wxListCtrlEx()
 #ifndef __WXMSW__
 wxScrolledWindow* wxListCtrlEx::GetMainWindow() const
 {
-#ifdef __WXMAC__
+#if defined(__WXMAC__) && !wxCHECK_VERSION(2, 9, 0)
 	return (wxScrolledWindow*)m_genericImpl->m_mainWin;
 #else
 	return (wxScrolledWindow*)m_mainWin;
--- src/interface/netconfwizard.cpp.orig
+++ src/interface/netconfwizard.cpp
@@ -777,7 +777,12 @@ void CNetConfWizard::SendNextCommand()
 			wxString hexIP = ip;
 			for (unsigned int i = 0; i < hexIP.Length(); i++)
 			{
+#if wxCHECK_VERSION(2, 9, 0)
+				char c;
+				hexIP.GetChar(i).GetAsChar(&c);
+#else
 				wxChar& c = hexIP[i];
+#endif
 				if (c == '.')
 					c = '-';
 				else
--- src/interface/queue.cpp.orig
+++ src/interface/queue.cpp
@@ -1310,7 +1310,7 @@ void CQueueViewBase::DisplayNumberQueuedFiles()
 	}
 	else
 	{
-		if (m_folderScanCount)
+		if (m_folderScanCount && m_fileCount > 0)
 			str.Printf(m_title + _T(" (0+)"), m_fileCount);
 		else
 			str = m_title;
@@ -1442,7 +1442,11 @@ void CQueueViewBase::RefreshItem(const CQueueItem* pItem)
 void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event)
 {
 	event.SetEventObject(m_pQueue);
+#if wxCHECK_VERSION(2, 9, 0)
+	m_pQueue->ProcessWindowEvent(event);
+#else
 	m_pQueue->ProcessEvent(event);
+#endif
 }
 
 void CQueueViewBase::OnChar(wxKeyEvent& event)
--- src/interface/queue_storage.cpp.orig
+++ src/interface/queue_storage.cpp
@@ -135,7 +135,11 @@ struct fast_equal
 	{
 		// wxString is CoW, yet it doesn't even do this fast pointer
 		// comparison in it's less and/or equal operator(s).
+#if wxCHECK_VERSION(2, 9, 0)
+		return (const char*)lhs.c_str() == (const char*)rhs.c_str() || lhs == rhs;
+#else
 		return lhs.c_str() == rhs.c_str() || lhs == rhs;
+#endif
 	}
 };
 
@@ -561,9 +565,11 @@ bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, wxLongLong_t
 extern "C" {
 static void custom_free(void* v)
 {
-#ifdef __WXMSW__
+#if defined(__WXMSW__)
+#if !wxCHECK_VERSION(2, 9, 0)
 	wxStringData* data = reinterpret_cast<wxStringData*>(v) - 1;
 	data->Unlock();
+#endif
 #else
 	char* s = reinterpret_cast<char*>(v);
 	delete [] s;
@@ -574,11 +580,16 @@ static void custom_free(void* v)
 bool CQueueStorage::Impl::Bind(sqlite3_stmt* statement, int index, const wxString& value)
 {
 #ifdef __WXMSW__
+#if wxCHECK_VERSION(2, 9, 0)
+	char* data = value.char_str();
+	return sqlite3_bind_text16(statement, index, data, value.length(), custom_free) == SQLITE_OK;
+#else
 	// Increase string reference and pass the data to sqlite with a custom deallocator that
 	// reduces the reference once sqlite is done with it.
 	wxStringData* data = reinterpret_cast<wxStringData*>(const_cast<wxChar*>(value.c_str())) - 1;
 	data->Lock();
 	return sqlite3_bind_text16(statement, index, data + 1, data->nDataLength * 2, custom_free) == SQLITE_OK;
+#endif
 #else
 	char* out = new char[value.size() * 2];
 	size_t outlen = utf16_.FromWChar(out, value.size() * 2, value.c_str(), value.size());
@@ -831,9 +842,18 @@ wxString CQueueStorage::Impl::GetColumnText(sqlite3_stmt* statement, int index,
 	int len = sqlite3_column_bytes16(statement, index);
 	if (text)
 	{
+#if wxCHECK_VERSION(2, 9, 0)
+		wxStringBuffer* buffer = new wxStringBuffer(ret, len);
+		wxChar* out = *buffer;
+#else
 		wxChar* out = ret.GetWriteBuf( len );
+#endif
 		int outlen = utf16_.ToWChar( out, len, text, len );
+#if wxCHECK_VERSION(2, 9, 0)
+		delete buffer;
+#else
 		ret.UngetWriteBuf( outlen );
+#endif
 		if (shrink)
 			ret.Shrink();
 	}
--- src/interface/quickconnectbar.cpp.orig
+++ src/interface/quickconnectbar.cpp
@@ -222,12 +222,12 @@ void CQuickconnectBar::OnKeyboardNavigation(wxNavigationKeyEvent& event)
 	if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton))
 	{
 		event.SetEventObject(this);
-		GetParent()->ProcessEvent(event);
+		GetParent()->GetEventHandler()->ProcessEvent(event);
 	}
 	else if (!event.GetDirection() && event.GetEventObject() == m_pHost)
 	{
 		event.SetEventObject(this);
-		GetParent()->ProcessEvent(event);
+		GetParent()->GetEventHandler()->ProcessEvent(event);
 	}
 	else
 		event.Skip();
--- src/interface/resources/xrc/settings.xrc.orig
+++ src/interface/resources/xrc/settings.xrc
@@ -427,7 +427,7 @@
               </object>
               <cols>1</cols>
               <vgap>3</vgap>
-              <rows>2</rows>
+              <rows>3</rows>
             </object>
             <flag>wxLEFT|wxRIGHT|wxBOTTOM</flag>
             <border>4</border>
@@ -632,9 +632,9 @@
               <object class="sizeritem">
                 <object class="wxListCtrl" name="ID_KEYS">
                   <style>wxLC_REPORT|wxSUNKEN_BORDER</style>
+                  <size>400,-1</size>
                 </object>
-                <option>1</option>
-                <flag>wxGROW</flag>
+                <flag>wxSHAPED</flag>
               </object>
               <vgap>5</vgap>
               <growablecols>0</growablecols>
@@ -1393,7 +1393,7 @@
           <object class="sizeritem">
             <object class="wxFlexGridSizer">
               <cols>2</cols>
-              <rows>2</rows>
+              <rows>3</rows>
               <object class="sizeritem">
                 <object class="wxStaticText">
                   <label>&amp;Theme:</label>
@@ -2105,7 +2105,6 @@
                   </object>
                   <growablecols>1</growablecols>
                 </object>
-                <flag>wxGROW</flag>
                 <minsize>400,0</minsize>
               </object>
               <growablecols>0</growablecols>
--- src/interface/settings/optionspage_dateformatting.cpp.orig
+++ src/interface/settings/optionspage_dateformatting.cpp
@@ -16,7 +16,7 @@ bool COptionsPageDateFormatting::LoadPage()
 	const wxString& dateFormat = m_pOptions->GetOption(OPTION_DATE_FORMAT);
 	if (dateFormat == _T("1"))
 		SetRCheck(XRCID("ID_DATEFORMAT_ISO"), true, failure);
-	else if (dateFormat[0] == '2')
+	else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
 	{
 		SetRCheck(XRCID("ID_DATEFORMAT_CUSTOM"), true, failure);
 		SetText(XRCID("ID_CUSTOM_DATEFORMAT"), dateFormat.Mid(1), failure);
@@ -27,7 +27,7 @@ bool COptionsPageDateFormatting::LoadPage()
 	const wxString& timeFormat = m_pOptions->GetOption(OPTION_TIME_FORMAT);
 	if (timeFormat == _T("1"))
 		SetRCheck(XRCID("ID_TIMEFORMAT_ISO"), true, failure);
-	else if (timeFormat[0] == '2')
+	else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
 	{
 		SetRCheck(XRCID("ID_TIMEFORMAT_CUSTOM"), true, failure);
 		SetText(XRCID("ID_CUSTOM_TIMEFORMAT"), timeFormat.Mid(1), failure);
--- src/interface/sitemanager.cpp.orig
+++ src/interface/sitemanager.cpp
@@ -525,6 +525,8 @@ CSiteManagerItemData_Site* CSiteManager::GetSiteByPath(wxString sitePath)
 
 bool CSiteManager::GetBookmarks(wxString sitePath, std::list<wxString> &bookmarks)
 {
+	if (sitePath.IsEmpty())
+		return false;
 	wxChar c = sitePath[0];
 	if (c != '0' && c != '1')
 		return false;
--- src/interface/statusbar.cpp.orig
+++ src/interface/statusbar.cpp
@@ -153,10 +153,10 @@ void wxStatusBarEx::OnSize(wxSizeEvent& event)
 void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/)
 {
 	// Basically identical to the wx one, but not calling Update
-	wxString oldText = m_statusStrings[number];
+	wxString oldText = GetStatusText(number);
 	if (oldText != text)
 	{
-		m_statusStrings[number] = text;
+		wxStatusBar::SetStatusText(text, number);
 
 		wxRect rect;
 		GetFieldRect(number, rect);
--- src/interface/timeformatting.cpp.orig
+++ src/interface/timeformatting.cpp
@@ -23,7 +23,7 @@ public:
 
 		if (dateFormat == _T("1"))
 			m_dateFormat = _T("%Y-%m-%d");
-		else if (dateFormat[0] == '2')
+		else if (!dateFormat.IsEmpty() && dateFormat[0] == '2')
 			m_dateFormat = dateFormat.Mid(1);
 		else
 			m_dateFormat = _T("%x");
@@ -33,7 +33,7 @@ public:
 
 		if (timeFormat == _T("1"))
 			m_dateTimeFormat += _T("%H:%M");
-		else if (timeFormat[0] == '2')
+		else if (!timeFormat.IsEmpty() && timeFormat[0] == '2')
 			m_dateTimeFormat += timeFormat.Mid(1);
 		else
 			m_dateTimeFormat += _T("%X");
--- src/interface/viewheader.cpp.orig
+++ src/interface/viewheader.cpp
@@ -24,7 +24,11 @@ class CComboBoxEx : public wxComboBox
 {
 public:
 	CComboBoxEx(CViewHeader* parent)
-		: wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER | wxCB_SORT)
+		: wxComboBox(parent, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxArrayString(), wxCB_DROPDOWN | wxTE_PROCESS_ENTER
+#if !defined(__WXMAC__) || !wxCHECK_VERSION(2, 9, 0)
+            | wxCB_SORT
+#endif
+    )
 	{
 		m_parent = parent;
 	}
@@ -67,7 +71,7 @@ protected:
 		navEvent.SetDirection(!event.ShiftDown());
 		navEvent.SetFromTab(true);
 		navEvent.ResumePropagation(1);
-		m_parent->ProcessEvent(navEvent);
+		m_parent->GetEventHandler()->ProcessEvent(navEvent);
 	}
 
 	void OnChar(wxKeyEvent& event)
--- src/interface/wrapengine.cpp.orig
+++ src/interface/wrapengine.cpp
@@ -232,24 +232,24 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
 	bool containsURL = false;
 	for (int i = 0; i <= strLen; i++)
 	{
-		if ((text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
-			(text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
+		if ((i < strLen - 2 && text[i] == ':' && text[i + 1] == '/' && text[i + 2] == '/') || // absolute
+			(i < strLen && text[i] == '/' && (!i || text[i - 1] == ' '))) // relative
 		{
 			url = true;
 			containsURL = true;
 		}
-		if (text[i] != ' ' && text[i] != 0)
+		if (i < strLen && text[i] != ' ')
 		{
 			// If url, wrap on slashes and ampersands, but not first slash of something://
 			if (!url ||
-				 ((text[i] != '/' || text[i + 1] == '/') && (text[i] != '&' || text[i + 1] == '&') && text[i] != '?'))
+				 ((i < strLen - 1 && (text[i] != '/' || text[i + 1] == '/')) && (i < strLen - 1 && (text[i] != '&' || text[i + 1] == '&')) && text[i] != '?'))
 			continue;
 		}
 
 		wxString segment;
 		if (wrapAfter == -1)
 		{
-			if (text[i] == '/' || text[i] == '?' || text[i] == '&')
+			if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
 				segment = text.Mid(start, i - start + 1);
 			else
 				segment = text.Mid(start, i - start);
@@ -257,7 +257,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
 		}
 		else
 		{
-			if (text[i] == '/' || text[i] == '?' || text[i] == '&')
+			if (i < strLen && (text[i] == '/' || text[i] == '?' || text[i] == '&'))
 				segment = text.Mid(wrapAfter + 1, i - wrapAfter);
 			else
 				segment = text.Mid(wrapAfter + 1, i - wrapAfter - 1);
@@ -272,7 +272,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
 			if (wrappedText != _T(""))
 				wrappedText += _T("\n");
 			wrappedText += text.Mid(start, wrapAfter - start);
-			if (text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
+			if (wrapAfter < strLen && text[wrapAfter] != ' ' && text[wrapAfter] != '\0')
 				wrappedText += text[wrapAfter];
 
 			if (width + spaceWidth >= (int)maxLength)
@@ -302,7 +302,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
 			if (wrappedText != _T(""))
 				wrappedText += _T("\n");
 			wrappedText += text.Mid(start, i - start);
-			if (text[i] != ' ' && text[i] != '\0')
+			if (i < strLen && text[i] != ' ' && text[i] != '\0')
 				wrappedText += text[i];
 			start = i + 1;
 			wrapAfter = -1;
@@ -316,7 +316,7 @@ bool CWrapEngine::WrapText(wxWindow* parent, wxString& text, unsigned long maxLe
 			wrapAfter = i;
 		}
 
-		if (text[i] == ' ')
+		if (i < strLen && text[i] == ' ')
 			url = false;
 	}
 	if (start < strLen)
