aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-06-07 11:46:05 (GMT)
committerrathnor <rathnor>2004-06-07 11:46:05 (GMT)
commitfff4456dee29e675d7f2ed3490db39bcb7e10e53 (patch)
tree2d2dbf386551773cbdc8231b2a93b493187bd733 /src/Keys.cc
parent073065ac56b388db1169108d44f37d32f1d19c67 (diff)
downloadfluxbox-fff4456dee29e675d7f2ed3490db39bcb7e10e53.zip
fluxbox-fff4456dee29e675d7f2ed3490db39bcb7e10e53.tar.bz2
update NLS string handling...
Diffstat (limited to 'src/Keys.cc')
-rw-r--r--src/Keys.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Keys.cc b/src/Keys.cc
index 41af901..aef2b8f 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: Keys.cc,v 1.42 2004/02/20 09:29:07 fluxgen Exp $ 22//$Id: Keys.cc,v 1.43 2004/06/07 11:46:04 rathnor Exp $
23 23
24 24
25#include "Keys.hh" 25#include "Keys.hh"
@@ -30,6 +30,7 @@
30#include "FbTk/KeyUtil.hh" 30#include "FbTk/KeyUtil.hh"
31 31
32#include "CommandParser.hh" 32#include "CommandParser.hh"
33#include "FbTk/I18n.hh"
33 34
34#ifdef HAVE_CONFIG_H 35#ifdef HAVE_CONFIG_H
35#include "config.h" 36#include "config.h"
@@ -165,6 +166,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
165 char keyarg = 0; 166 char keyarg = 0;
166 t_key *current_key=0, *last_key=0; 167 t_key *current_key=0, *last_key=0;
167 168
169 _FB_USES_NLS;
168 // for each argument 170 // for each argument
169 for (unsigned int argc=0; argc<val.size(); argc++) { 171 for (unsigned int argc=0; argc<val.size(); argc++) {
170 172
@@ -180,7 +182,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
180 else { 182 else {
181 key = FbTk::KeyUtil::getKey(val[argc].c_str()); // else get the key 183 key = FbTk::KeyUtil::getKey(val[argc].c_str()); // else get the key
182 if (key == 0) { 184 if (key == 0) {
183 cerr<<"Keys: Invalid key/modifier on line("<< 185 cerr<<_FBTEXT(Keys, InvalidKeyMod, "Keys: Invalid key/modifier on line", "A bad key/modifier string was found on line (number following)")<<" "<<
184 m_current_line<<"): "<<linebuffer<<endl; 186 m_current_line<<"): "<<linebuffer<<endl;
185 return false; 187 return false;
186 } 188 }
@@ -197,7 +199,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
197 199
198 } else { // parse command line 200 } else { // parse command line
199 if (last_key == 0) { 201 if (last_key == 0) {
200 cerr<<"Keys: Error on line: "<<m_current_line<<endl; 202 cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
201 cerr<<"> "<<linebuffer<<endl; 203 cerr<<"> "<<linebuffer<<endl;
202 return false; 204 return false;
203 } 205 }
@@ -206,7 +208,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
206 FbTk::StringUtil::strcasestr(linebuffer.c_str(), 208 FbTk::StringUtil::strcasestr(linebuffer.c_str(),
207 val[argc].c_str() + 1); // +1 to skip ':' 209 val[argc].c_str() + 1); // +1 to skip ':'
208 if (str == 0) { 210 if (str == 0) {
209 cerr<<"Keys: Error on line: "<<m_current_line<<endl; 211 cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
210 cerr<<"> "<<linebuffer<<endl; 212 cerr<<"> "<<linebuffer<<endl;
211 ret_val = false; 213 ret_val = false;
212 } else { 214 } else {
@@ -214,12 +216,12 @@ bool Keys::addBinding(const std::string &linebuffer) {
214 last_key->m_command = CommandParser::instance().parseLine(str); 216 last_key->m_command = CommandParser::instance().parseLine(str);
215 217
216 if (*last_key->m_command == 0) { 218 if (*last_key->m_command == 0) {
217 cerr<<"Keys: Error on line: "<<m_current_line<<endl; 219 cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
218 cerr<<"> "<<linebuffer<<endl; 220 cerr<<"> "<<linebuffer<<endl;
219 } else { 221 } else {
220 // Add the keychain to list 222 // Add the keychain to list
221 if (!mergeTree(current_key)) { 223 if (!mergeTree(current_key)) {
222 cerr<<"Keys: Failed to merge keytree!"<<endl; 224 cerr<<_FBTEXT(Keys, BadMerge, "Keys: Failed to merge keytree!", "relatively technical error message. Key bindings are stored in a tree structure")<<endl;
223 ret_val = false; 225 ret_val = false;
224 } 226 }
225 } 227 }