}
typedef ImportExport<GtkRadioButton, int, IntRadioImport, IntRadioExport> IntRadioImportExport;
-template<typename Type, typename Formatter>
-class StringFromType
-{
- StringOutputStream value;
-public:
- StringFromType(const Type& type)
- {
- value << Formatter(type);
- }
- operator const char*() const
- {
- return value.c_str();
- }
-};
-
-typedef StringFromType<const char*, ConvertLocaleToUTF8> LocaleToUTF8;
-typedef StringFromType<const char*, ConvertUTF8ToLocale> UTF8ToLocale;
-
void TextEntryImport(GtkEntry& widget, const char* text)
{
- gtk_entry_set_text(&widget, LocaleToUTF8(text));
+ gtk_entry_set_text(&widget, text);
}
void TextEntryExport(GtkEntry& widget, const StringImportCallback& importCallback)
{
- importCallback(UTF8ToLocale(gtk_entry_get_text(&widget)));
+ importCallback(gtk_entry_get_text(&widget));
}
typedef ImportExport<GtkEntry, const char*, TextEntryImport, TextEntryExport> TextEntryImportExport;
void apply()
{
StringOutputStream value(64);
- value << ConvertUTF8ToLocale(gtk_entry_get_text(m_entry));
+ value << gtk_entry_get_text(m_entry);
Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), value.c_str());
}
typedef MemberCaller<StringAttribute, &StringAttribute::apply> ApplyCaller;
void update()
{
StringOutputStream value(64);
- value << ConvertLocaleToUTF8(SelectedEntity_getValueForKey(m_key.c_str()));
+ value << SelectedEntity_getValueForKey(m_key.c_str());
gtk_entry_set_text(m_entry, value.c_str());
}
typedef MemberCaller<StringAttribute, &StringAttribute::update> UpdateCaller;
void apply()
{
StringOutputStream value(64);
- value << ConvertUTF8ToLocale(gtk_entry_get_text(GTK_ENTRY(m_entry.m_entry.m_entry)));
+ value << gtk_entry_get_text(GTK_ENTRY(m_entry.m_entry.m_entry));
Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), value.c_str());
}
typedef MemberCaller<ModelAttribute, &ModelAttribute::apply> ApplyCaller;
void update()
{
StringOutputStream value(64);
- value << ConvertLocaleToUTF8(SelectedEntity_getValueForKey(m_key.c_str()));
+ value << SelectedEntity_getValueForKey(m_key.c_str());
gtk_entry_set_text(GTK_ENTRY(m_entry.m_entry.m_entry), value.c_str());
}
typedef MemberCaller<ModelAttribute, &ModelAttribute::update> UpdateCaller;
void apply()
{
StringOutputStream value(64);
- value << ConvertUTF8ToLocale(gtk_entry_get_text(GTK_ENTRY(m_entry.m_entry.m_entry)));
+ value << gtk_entry_get_text(GTK_ENTRY(m_entry.m_entry.m_entry));
Scene_EntitySetKeyValue_Selected_Undoable(m_key.c_str(), value.c_str());
}
typedef MemberCaller<SoundAttribute, &SoundAttribute::apply> ApplyCaller;
void update()
{
StringOutputStream value(64);
- value << ConvertLocaleToUTF8(SelectedEntity_getValueForKey(m_key.c_str()));
+ value << SelectedEntity_getValueForKey(m_key.c_str());
gtk_entry_set_text(GTK_ENTRY(m_entry.m_entry.m_entry), value.c_str());
}
typedef MemberCaller<SoundAttribute, &SoundAttribute::update> UpdateCaller;
GtkTreeIter iter;
gtk_list_store_append(store, &iter);
StringOutputStream key(64);
- key << ConvertLocaleToUTF8((*i).first.c_str());
+ key << (*i).first.c_str();
StringOutputStream value(64);
- value << ConvertLocaleToUTF8((*i).second.c_str());
+ value << (*i).second.c_str();
gtk_list_store_set(store, &iter, 0, key.c_str(), 1, value.c_str(), -1);
}
{
// Get current selection text
StringOutputStream key(64);
- key << ConvertUTF8ToLocale(gtk_entry_get_text(g_entityKeyEntry));
+ key << gtk_entry_get_text(g_entityKeyEntry);
StringOutputStream value(64);
- value << ConvertUTF8ToLocale(gtk_entry_get_text(g_entityValueEntry));
+ value << gtk_entry_get_text(g_entityValueEntry);
// TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity
{
// Get current selection text
StringOutputStream key(64);
- key << ConvertUTF8ToLocale(gtk_entry_get_text(g_entityKeyEntry));
+ key << gtk_entry_get_text(g_entityKeyEntry);
if(strcmp(key.c_str(), "classname") != 0)
{