提交 375bc183 编写于 作者: J jp9000

make SettingsData a subclass of wxEvtHandler and add a callback for the language combo box

上级 c5f497ec
......@@ -15,6 +15,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include <wx/event.h>
#include "obs-app.hpp"
#include "settings-basic.hpp"
#include "window-settings-basic.hpp"
......@@ -23,11 +25,14 @@
class GeneralSettings : public BasicSettingsData {
ConfigFile localeIni;
void LanguageChanged(wxCommandEvent &event);
int AddLanguage(const char *tag);
void FillLanguageList(const char *currentLang);
public:
GeneralSettings(OBSBasicSettings *window);
virtual ~GeneralSettings();
virtual void Apply();
};
......@@ -80,6 +85,25 @@ GeneralSettings::GeneralSettings(OBSBasicSettings *window)
const char *currentLang = config_get_string(GetGlobalConfig(),
"General", "Language");
FillLanguageList(currentLang);
window->languageList->Connect(
wxEVT_COMBOBOX,
wxCommandEventHandler(GeneralSettings::LanguageChanged),
NULL,
this);
}
GeneralSettings::~GeneralSettings()
{
window->languageList->Disconnect(
wxEVT_COMBOBOX,
wxCommandEventHandler(GeneralSettings::LanguageChanged),
NULL,
this);
}
void GeneralSettings::LanguageChanged(wxCommandEvent &event)
{
}
void GeneralSettings::Apply()
......
......@@ -17,12 +17,13 @@
#pragma once
class SettingsData {
#include <wx/event.h>
class SettingsData : public wxEvtHandler {
protected:
bool dataChanged;
public:
virtual ~SettingsData() {}
virtual void Apply()=0;
inline bool DataChanged() const {return dataChanged;}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册