~ubuntu-branches/ubuntu/trusty/ibus-libpinyin/trusty

« back to all changes in this revision

Viewing changes to src/PYPinyinProperties.cc

  • Committer: Package Import Robot
  • Author(s): YunQiang Su, Osamu Aoki, YunQiang Su
  • Date: 2013-09-30 20:59:24 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130930205924-uhp7p0c5uo0nlzrr
Tags: 1.6.91-1
* Team upload

[ Osamu Aoki ]
* Imported Upstream version 1.6.91

[ YunQiang Su ]
* Import new commit from upstream
    0001-Update-the-symbol-of-the-ibus-indicator.patch
    0002-fixes-lua-5.2-compile.patch
* Build depends on liblua5.1-dev
* Bump build-dep on libpinyin4-dev
* Use gnome-common and autogen.sh work with dh-autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
namespace PY {
27
27
 
28
28
#define _(text) (dgettext (GETTEXT_PACKAGE, text))
 
29
#define N_(text) text
29
30
 
30
31
PinyinProperties::PinyinProperties (Config & config)
31
32
    : m_config (config),
33
34
      m_mode_full (m_config.initFull ()),
34
35
      m_mode_full_punct (m_config.initFullPunct ()),
35
36
      m_mode_simp (m_config.initSimpChinese ()),
36
 
      m_prop_chinese ("mode.chinese",
 
37
      m_prop_chinese ("InputMode",
37
38
                PROP_TYPE_NORMAL,
38
 
                StaticText ("CN"),
 
39
                StaticText (m_mode_chinese ?
 
40
                            _("Chinese") :
 
41
                            _("English")),
39
42
                m_mode_chinese ?
40
43
                    PKGDATADIR"/icons/chinese.svg" :
41
44
                    PKGDATADIR"/icons/english.svg",
42
 
                StaticText (_("Chinese"))),
 
45
                StaticText (m_mode_chinese ?
 
46
                            _("Switch to English Mode") :
 
47
                            _("Switch to Chinese Mode"))),
43
48
      m_prop_full ("mode.full",
44
49
                PROP_TYPE_NORMAL,
45
 
                StaticText (m_mode_full ? "Aa" : "Aa"),
 
50
                StaticText (m_mode_full ?
 
51
                            _("Full Width Letter") :
 
52
                            _("Half Width Letter")),
46
53
                m_mode_full ?
47
54
                    PKGDATADIR"/icons/full.svg" :
48
55
                    PKGDATADIR"/icons/half.svg",
49
 
                StaticText (_("Full/Half width"))),
 
56
                StaticText (m_mode_full ?
 
57
                            _("Switch to Half Width Letter Mode"):
 
58
                            _("Switch to Full Width Letter Mode"))),
50
59
      m_prop_full_punct ("mode.full_punct",
51
60
                PROP_TYPE_NORMAL,
52
 
                StaticText (m_mode_full_punct ? ",。" : ",."),
 
61
                StaticText (m_mode_full_punct ?
 
62
                            _("Full Width Punct") :
 
63
                            _("Half Width Punct")),
53
64
                m_mode_full_punct ?
54
65
                    PKGDATADIR"/icons/full-punct.svg" :
55
66
                    PKGDATADIR"/icons/half-punct.svg",
56
 
                StaticText (_("Full/Half width punctuation"))),
 
67
                StaticText (m_mode_full_punct ?
 
68
                            _("Switch to Half Width Punctuation Mode"):
 
69
                            _("Switch to Full Width Punctuation Mode"))),
57
70
      m_prop_simp ( "mode.simp",
58
71
                PROP_TYPE_NORMAL,
59
 
                StaticText (m_mode_simp ? "简" : "繁"),
 
72
                StaticText (m_mode_simp ?
 
73
                            _("Simplified Chinese") :
 
74
                            _("Traditional Chinese")),
60
75
                m_mode_simp ?
61
76
                    PKGDATADIR"/icons/simp-chinese.svg" :
62
77
                    PKGDATADIR"/icons/trad-chinese.svg",
63
 
                StaticText (_("Simplfied/Traditional Chinese"))),
 
78
                StaticText (m_mode_simp ?
 
79
                            _("Switch to Traditional Chinese Mode"):
 
80
                            _("Switch to Simplfied Chinese Mode"))),
64
81
      m_prop_setup ("setup",
65
82
                PROP_TYPE_NORMAL,
66
83
                StaticText (_("Preferences")),
67
84
                "ibus-setup",
68
85
                StaticText (_("Preferences")))
69
86
{
 
87
    if (m_mode_chinese)
 
88
        m_prop_chinese.setSymbol(N_("中"));
 
89
    else
 
90
        m_prop_chinese.setSymbol(N_("英"));
 
91
 
70
92
    m_props.append (m_prop_chinese);
71
93
    m_props.append (m_prop_full);
72
94
    m_props.append (m_prop_full_punct);
79
101
PinyinProperties::toggleModeChinese (void)
80
102
{
81
103
    m_mode_chinese = ! m_mode_chinese;
82
 
    m_prop_chinese.setLabel (m_mode_chinese ? "CN" : "EN");
 
104
    m_prop_chinese.setLabel (m_mode_chinese ?
 
105
                             _("Chinese") :
 
106
                             _("English"));
 
107
 
 
108
    if (m_mode_chinese)
 
109
        m_prop_chinese.setSymbol(N_("中"));
 
110
    else
 
111
        m_prop_chinese.setSymbol(N_("英"));
 
112
 
83
113
    m_prop_chinese.setIcon (m_mode_chinese ?
84
 
                                PKGDATADIR"/icons/chinese.svg" :
85
 
                                PKGDATADIR"/icons/english.svg");
 
114
                            PKGDATADIR"/icons/chinese.svg" :
 
115
                            PKGDATADIR"/icons/english.svg");
 
116
    m_prop_chinese.setTooltip (m_mode_chinese ?
 
117
                               _("Switch to English Mode") :
 
118
                               _("Switch to Chinese Mode"));
86
119
    updateProperty (m_prop_chinese);
87
120
    
88
121
    m_prop_full_punct.setSensitive (m_mode_chinese);
93
126
PinyinProperties::toggleModeFull (void)
94
127
{
95
128
    m_mode_full = !m_mode_full;
96
 
    m_prop_full.setLabel (m_mode_full ? "Aa" : "Aa");
 
129
    m_prop_full.setLabel (m_mode_full ?
 
130
                          _("Full Width Letter") :
 
131
                          _("Half Width Letter"));
97
132
    m_prop_full.setIcon (m_mode_full ?
98
 
                            PKGDATADIR"/icons/full.svg" :
99
 
                            PKGDATADIR"/icons/half.svg");
 
133
                         PKGDATADIR"/icons/full.svg" :
 
134
                         PKGDATADIR"/icons/half.svg");
 
135
    m_prop_full.setTooltip (m_mode_full ?
 
136
                            _("Switch to Half Width Letter Mode"):
 
137
                            _("Switch to Full Width Letter Mode"));
100
138
    updateProperty (m_prop_full);
101
139
}
102
140
 
104
142
PinyinProperties::toggleModeFullPunct (void)
105
143
{
106
144
    m_mode_full_punct = !m_mode_full_punct;
107
 
    m_prop_full_punct.setLabel (m_mode_full_punct ? ",。" : ",.");
 
145
    m_prop_full_punct.setLabel (m_mode_full_punct ?
 
146
                                _("Full Width Punct") :
 
147
                                _("Half Width Punct"));
108
148
    m_prop_full_punct.setIcon (m_mode_full_punct ?
109
149
                                PKGDATADIR"/icons/full-punct.svg" :
110
150
                                PKGDATADIR"/icons/half-punct.svg");
 
151
    m_prop_full_punct.setTooltip(m_mode_full_punct ?
 
152
                                 _("Switch to Half Width Punctuation Mode"):
 
153
                                 _("Switch to Full Width Punctuation Mode"));
111
154
    updateProperty (m_prop_full_punct);
112
155
}
113
156
 
115
158
PinyinProperties::toggleModeSimp (void)
116
159
{
117
160
    m_mode_simp = ! m_mode_simp;
118
 
    m_prop_simp.setLabel (m_mode_simp ? "简" : "繁");
 
161
    m_prop_simp.setLabel (m_mode_simp ?
 
162
                          _("Simplified Chinese") :
 
163
                          _("Traditional Chinese"));
119
164
    m_prop_simp.setIcon (m_mode_simp ?
120
165
                            PKGDATADIR"/icons/simp-chinese.svg" :
121
166
                            PKGDATADIR"/icons/trad-chinese.svg");
 
167
    m_prop_simp.setTooltip(m_mode_simp ?
 
168
                           _("Switch to Traditional Chinese Mode"):
 
169
                           _("Switch to Simplfied Chinese Mode"));
122
170
    updateProperty (m_prop_simp);
123
171
}
124
172