Skip to content

Commit

Permalink
Use show_message function
Browse files Browse the repository at this point in the history
  • Loading branch information
epico committed Dec 13, 2024
1 parent db736f5 commit a857787
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/PYPConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@
#include "PYPConfig.h"

#include <string.h>
#include <libintl.h>
#include <pinyin.h>
#include "PYBus.h"
#include "PYXMLUtil.h"
#include "PYLibPinyin.h"
#include "PYTableDatabase.h"

#define USE_G_SETTINGS_LIST_KEYS 0

namespace PY {

#define _(text) (dgettext (GETTEXT_PACKAGE, text))
#define N_(text) text

const gchar * const CONFIG_CORRECT_PINYIN = "correct-pinyin";
const gchar * const CONFIG_FUZZY_PINYIN = "fuzzy-pinyin";
const gchar * const CONFIG_ORIENTATION = "lookup-table-orientation";
Expand Down Expand Up @@ -675,11 +680,13 @@ PinyinConfig::valueChanged (const std::string &schema_id,
std::string filename = normalizeGVariant (value, std::string(""));
if (!filename.empty ())
TableDatabase::userInstance ().importTable (filename.c_str ());
show_message (_("The table file is imported."), NULL);
}
else if (CONFIG_EXPORT_CUSTOM_TABLE == name) {
std::string filename = normalizeGVariant (value, std::string(""));
if (!filename.empty ())
TableDatabase::userInstance ().exportTable (filename.c_str ());
show_message (_("The table file is exported."), NULL);
}
else if (CONFIG_CLEAR_CUSTOM_TABLE == name) {
std::string target = normalizeGVariant (value, std::string(""));
Expand All @@ -690,11 +697,13 @@ PinyinConfig::valueChanged (const std::string &schema_id,
std::string filename = normalizeGVariant (value, std::string(""));
if (!filename.empty ())
LibPinyinBackEnd::instance ().importPinyinDictionary (filename.c_str ());
show_message (_("The pinyin dictionary file is imported."), NULL);
}
else if (CONFIG_EXPORT_DICTIONARY == name) {
std::string filename = normalizeGVariant (value, std::string(""));
if (!filename.empty ())
LibPinyinBackEnd::instance ().exportPinyinDictionary (filename.c_str ());
show_message (_("The pinyin dictionary file is exported."), NULL);
}
else if (CONFIG_CLEAR_USER_DATA == name) {
std::string target = normalizeGVariant (value, std::string(""));
Expand Down

0 comments on commit a857787

Please sign in to comment.