fix nls... notably classify text on conversion whether its for X or
console, plus handle catalogs better.
This commit is contained in:
parent
62a298b0b3
commit
3ada3b1f0d
30 changed files with 352 additions and 288 deletions
16
ChangeLog
16
ChangeLog
|
@ -1,13 +1,15 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 1.0rc2:
|
||||
*06/06/21:
|
||||
* Fix nls file location. nls wouldn't have worked, why did no-one say?
|
||||
(Simon)
|
||||
- Need a couple more fixes too:
|
||||
* Messages output on stdout/err need to be in local encoding
|
||||
* Check for existence of catalog file, if not exist, try opening an
|
||||
iconv for UTF-8, and loading that one instead.
|
||||
FbTk/I18n.cc
|
||||
* Fix nls (Simon
|
||||
- file location waas wrong. nls wouldn't have worked, why did no-one say?
|
||||
- Messages output on stdout/err now properly in local encoding
|
||||
- Check for existence of catalog file, if it doesn't exist, and we can
|
||||
convert from UTF-8, try loading that one instead.
|
||||
- bunch of files changed due to macro name change:
|
||||
+ Use _FB_XTEXT if the text will go out to X (for X fonts)
|
||||
+ Use _FB_CONSOLETEXT if the text will go to console (stdout/err)
|
||||
FbTk/I18n.hh/cc (+anything with _FB_TEXT)
|
||||
*06/06/20:
|
||||
* Fix window placement when apps remembers size but not location (Simon)
|
||||
Window.cc
|
||||
|
|
|
@ -34,11 +34,11 @@ $set 3 #Common
|
|||
4 Compiled options
|
||||
5 Compiler
|
||||
6 Compiler version
|
||||
7 init
|
||||
8 keys
|
||||
9 nls
|
||||
10 menu
|
||||
11 style
|
||||
7 init
|
||||
8 keys
|
||||
9 nls
|
||||
10 menu
|
||||
11 style
|
||||
12 Defaults
|
||||
13 disabled
|
||||
14 Error
|
||||
|
@ -46,6 +46,7 @@ $set 3 #Common
|
|||
16 Maximize Over
|
||||
17 SVN Revision
|
||||
18 Visible
|
||||
19 There is no background option specified in this style.\nPlease consult the manual or read the FAQ.
|
||||
|
||||
$set 4 #Configmenu
|
||||
|
||||
|
|
|
@ -58,9 +58,9 @@ public:
|
|||
if (m_tool.timeFormat().find("%k") != std::string::npos ||
|
||||
m_tool.timeFormat().find("%H") != std::string::npos ||
|
||||
m_tool.timeFormat().find("%T") != std::string::npos)
|
||||
setLabel( _FBTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") );
|
||||
setLabel( _FB_XTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") );
|
||||
else
|
||||
setLabel( _FBTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") );
|
||||
setLabel( _FB_XTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") );
|
||||
}
|
||||
|
||||
void click(int button, int time) {
|
||||
|
@ -107,9 +107,9 @@ public:
|
|||
if (m_tool.timeFormat().find("%k") != std::string::npos ||
|
||||
m_tool.timeFormat().find("%H") != std::string::npos ||
|
||||
m_tool.timeFormat().find("%T") != std::string::npos)
|
||||
setLabel( _FBTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") );
|
||||
setLabel( _FB_XTEXT(Toolbar, Clock24, "Clock: 24h", "set Clockmode to 24h") );
|
||||
else
|
||||
setLabel( _FBTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") );
|
||||
setLabel( _FB_XTEXT(Toolbar, Clock12, "Clock: 12h", "set Clockmode to 12h") );
|
||||
|
||||
} // else some other strange format...so we don't do anything
|
||||
FbTk::MenuItem::click(button, time);
|
||||
|
@ -166,7 +166,7 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent,
|
|||
item->setCommand(saverc);
|
||||
menu.insert(item);
|
||||
FbTk::RefCount<FbTk::Command> editformat_cmd(new EditClockFormatCmd());
|
||||
menu.insert(_FBTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd);
|
||||
menu.insert(_FB_XTEXT(Toolbar, ClockEditFormat, "Edit Clock Format", "edit Clock Format") , editformat_cmd);
|
||||
|
||||
|
||||
update(0);
|
||||
|
|
|
@ -382,7 +382,7 @@ void Ewmh::updateClientList(BScreen &screen) {
|
|||
Window *wl = FB_new_nothrow Window[num];
|
||||
if (wl == 0) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<_FBTEXT(Ewmh, OutOfMemoryClientList,
|
||||
cerr<<_FB_CONSOLETEXT(Ewmh, OutOfMemoryClientList,
|
||||
"Fatal: Out of memory, can't allocate for EWMH client list", "")<<endl;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ void Color::allocate(unsigned short red, unsigned short green, unsigned short bl
|
|||
|
||||
if (!XAllocColor(disp, DefaultColormap(disp, screen), &color)) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::Color: "<<_FBTKTEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<<endl;
|
||||
cerr<<"FbTk::Color: "<<_FBTK_CONSOLETEXT(Error, ColorAllocation, "Allocation error.", "XAllocColor failed...")<<endl;
|
||||
} else {
|
||||
free();
|
||||
setRGB(maxValue(color.red),
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#endif // _GNU_SOURCE
|
||||
|
||||
#include "I18n.hh"
|
||||
#include "FileUtil.hh"
|
||||
|
||||
#include <X11/Xlocale.h>
|
||||
|
||||
|
@ -72,7 +73,7 @@ void NLSInit(const char *catalog) {
|
|||
}
|
||||
|
||||
|
||||
I18n::I18n():m_multibyte(false), m_catalog_fd((nl_catd)(-1)) {
|
||||
I18n::I18n():m_multibyte(false), m_utf8_translate(false), m_catalog_fd((nl_catd)(-1)) {
|
||||
#ifdef HAVE_SETLOCALE
|
||||
//make sure we don't get 0 to m_locale string
|
||||
char *temp = setlocale(LC_MESSAGES, "");
|
||||
|
@ -122,13 +123,33 @@ I18n *I18n::instance() {
|
|||
|
||||
void I18n::openCatalog(const char *catalog) {
|
||||
#if defined(NLS) && defined(HAVE_CATOPEN)
|
||||
|
||||
|
||||
string catalog_filename = LOCALEPATH;
|
||||
catalog_filename += '/';
|
||||
catalog_filename += m_locale;
|
||||
catalog_filename += '/';
|
||||
catalog_filename += catalog;
|
||||
|
||||
if (!FileUtil::isRegularFile(catalog_filename.c_str()) && m_locale != "C" && FbStringUtil::haveUTF8()) {
|
||||
// try the UTF-8 catalog, this also picks up situations where
|
||||
// the codeset somehow isn't specified
|
||||
|
||||
// remove everything after @
|
||||
string::size_type index = m_locale.find('.');
|
||||
// erase all characters starting at index
|
||||
if (index != string::npos)
|
||||
m_locale.erase(index);
|
||||
|
||||
m_locale.append(".UTF-8");
|
||||
m_utf8_translate = true;
|
||||
|
||||
catalog_filename = LOCALEPATH;
|
||||
catalog_filename += '/';
|
||||
catalog_filename += m_locale;
|
||||
catalog_filename += '/';
|
||||
catalog_filename += catalog;
|
||||
}
|
||||
|
||||
#ifdef MCLoadBySet
|
||||
m_catalog_fd = catopen(catalog_filename.c_str(), MCLoadBySet);
|
||||
#else // !MCLoadBySet
|
||||
|
@ -147,16 +168,29 @@ void I18n::openCatalog(const char *catalog) {
|
|||
}
|
||||
|
||||
|
||||
// Translate_FB means it'll become an FbString that goes to X for Fonts,
|
||||
// No translate means it stays in the local encoding, for printing to the
|
||||
// console.
|
||||
FbString I18n::getMessage(int set_number, int message_number,
|
||||
const char *default_message) const {
|
||||
const char *default_message, bool translate_fb) const {
|
||||
|
||||
#if defined(NLS) && defined(HAVE_CATGETS)
|
||||
if (m_catalog_fd != (nl_catd)-1) {
|
||||
const char *ret = catgets(m_catalog_fd, set_number, message_number, default_message);
|
||||
// can't translate, leave it in raw ascii (utf-8 compatible)
|
||||
if (ret == default_message || ret == NULL)
|
||||
return default_message; // don't recode the default
|
||||
return default_message;
|
||||
|
||||
return FbStringUtil::LocaleStrToFb(ret);
|
||||
if (!m_utf8_translate && translate_fb)
|
||||
// Local input, UTF-8 output
|
||||
return FbStringUtil::LocaleStrToFb(ret);
|
||||
else if (m_utf8_translate && !translate_fb)
|
||||
// UTF-8 input, local output
|
||||
return FbStringUtil::FbStrToLocale(ret);
|
||||
else
|
||||
// UTF-8 input, UTF-8 output OR
|
||||
// local input, local output
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
#endif // NLS && HAVE_CATGETS
|
||||
|
|
|
@ -68,20 +68,36 @@ void catclose(nl_catd cat);
|
|||
FbTk::I18n &i18n = *FbTk::I18n::instance()
|
||||
|
||||
// ignore the description, it's for helping translators
|
||||
#define _FBTEXT(msgset, msgid, default_text, description) \
|
||||
i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text)
|
||||
|
||||
|
||||
// Text for X
|
||||
#define _FB_XTEXT(msgset, msgid, default_text, description) \
|
||||
i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text, true)
|
||||
|
||||
// Text for console
|
||||
#define _FB_CONSOLETEXT(msgset, msgid, default_text, description) \
|
||||
i18n.getMessage(FBNLS::msgset ## Set, FBNLS::msgset ## msgid, default_text, false)
|
||||
|
||||
// This ensure that FbTk nls stuff is in a kind of namespace of its own
|
||||
#define _FBTKTEXT( msgset, msgid, default_text, description) \
|
||||
i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text)
|
||||
#define _FBTK_XTEXT( msgset, msgid, default_text, description) \
|
||||
i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text, true)
|
||||
|
||||
#define _FBTK_CONSOLETEXT( msgset, msgid, default_text, description) \
|
||||
i18n.getMessage(FBNLS::FbTk ## msgset ## Set, FBNLS::FbTk ## msgset ## msgid, default_text, false)
|
||||
|
||||
#else // no NLS
|
||||
|
||||
#define _FB_USES_NLS
|
||||
#define _FBTEXT(msgset, msgid, default_text, description) \
|
||||
|
||||
#define _FB_XTEXT(msgset, msgid, default_text, description) \
|
||||
std::string(default_text)
|
||||
|
||||
#define _FBTKTEXT(msgset, msgid, default_text, description) \
|
||||
#define _FB_CONSOLETEXT(msgset, msgid, default_text, description) \
|
||||
std::string(default_text)
|
||||
|
||||
#define _FBTK_XTEXT(msgset, msgid, default_text, description) \
|
||||
std::string(default_text)
|
||||
|
||||
#define _FBTK_CONSOLETEXT(msgset, msgid, default_text, description) \
|
||||
std::string(default_text)
|
||||
|
||||
#endif // defined NLS
|
||||
|
@ -96,15 +112,17 @@ public:
|
|||
inline const nl_catd &getCatalogFd() const { return m_catalog_fd; }
|
||||
|
||||
FbString getMessage(int set_number, int message_number,
|
||||
const char *default_messsage = 0) const;
|
||||
const char *default_messsage = 0, bool translate_fb = false) const;
|
||||
|
||||
void openCatalog(const char *catalog);
|
||||
private:
|
||||
I18n();
|
||||
~I18n();
|
||||
std::string m_locale;
|
||||
bool m_multibyte;
|
||||
bool m_multibyte, m_utf8_translate;
|
||||
nl_catd m_catalog_fd;
|
||||
|
||||
|
||||
};
|
||||
|
||||
void NLSInit(const char *);
|
||||
|
|
|
@ -660,7 +660,7 @@ void ImageControl::createColorTable() {
|
|||
|
||||
default:
|
||||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::ImageControl: "<<_FBTKTEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X")<<endl;
|
||||
cerr<<"FbTk::ImageControl: "<<_FBTK_CONSOLETEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X")<<endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,8 +87,8 @@ bool ResourceManager::load(const char *filename) {
|
|||
resource->setFromString(value.addr);
|
||||
else {
|
||||
_FB_USES_NLS;
|
||||
cerr<<_FBTKTEXT(Error, FailedRead, "Failed to read", "Couldn't load a resource (following)")<<": "<<resource->name()<<endl;
|
||||
cerr<<_FBTKTEXT(Error, UsingDefault, "Setting default value", "Falling back to default value for resource")<<endl;
|
||||
cerr<<_FBTK_CONSOLETEXT(Error, FailedRead, "Failed to read", "Couldn't load a resource (following)")<<": "<<resource->name()<<endl;
|
||||
cerr<<_FBTK_CONSOLETEXT(Error, UsingDefault, "Setting default value", "Falling back to default value for resource")<<endl;
|
||||
resource->setDefaultValue();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,12 +70,12 @@ TextureRender::TextureRender(ImageControl &imgctrl,
|
|||
_FB_USES_NLS;
|
||||
// clamp to "normal" size
|
||||
if (width > texture_max_width) {
|
||||
cerr<<"TextureRender: "<<_FBTKTEXT(Error, BigWidth, "Warning! Width > 3200 setting Width = 3200", "Image width seems too big, clamping")<<endl;
|
||||
cerr<<"TextureRender: "<<_FBTK_CONSOLETEXT(Error, BigWidth, "Warning! Width > 3200 setting Width = 3200", "Image width seems too big, clamping")<<endl;
|
||||
width = texture_max_width;
|
||||
}
|
||||
|
||||
if (height > texture_max_height) {
|
||||
cerr<<"TextureRender: "<<_FBTKTEXT(Error, BigHeight, "Warning! Height > 3200 setting Height = 3200", "Image height seems too big, clamping")<<endl;
|
||||
cerr<<"TextureRender: "<<_FBTK_CONSOLETEXT(Error, BigHeight, "Warning! Height > 3200 setting Height = 3200", "Image height seems too big, clamping")<<endl;
|
||||
height = texture_max_height;
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ void TextureRender::allocateColorTables() {
|
|||
char sbuf[128];
|
||||
sprintf(sbuf, "%ld", (long int) size);
|
||||
throw std::string("TextureRender::TextureRender(): " +
|
||||
std::string(_FBTKTEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
|
||||
std::string(_FBTK_CONSOLETEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
|
||||
}
|
||||
|
||||
|
||||
|
@ -129,7 +129,7 @@ void TextureRender::allocateColorTables() {
|
|||
char sbuf[128];
|
||||
sprintf(sbuf, "%ld", (long int) size);
|
||||
throw std::string("TextureRender::TextureRender(): " +
|
||||
std::string(_FBTKTEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
|
||||
std::string(_FBTK_CONSOLETEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
|
||||
}
|
||||
|
||||
blue = FB_new_nothrow unsigned char[size];
|
||||
|
@ -137,7 +137,7 @@ void TextureRender::allocateColorTables() {
|
|||
char sbuf[128];
|
||||
sprintf(sbuf, "%ld", (long int) size);
|
||||
throw std::string("TextureRender::TextureRender(): " +
|
||||
std::string(_FBTKTEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
|
||||
std::string(_FBTK_CONSOLETEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
|
||||
}
|
||||
|
||||
|
||||
|
@ -152,7 +152,7 @@ Pixmap TextureRender::renderSolid(const FbTk::Texture &texture) {
|
|||
|
||||
if (pixmap.drawable() == None) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::TextureRender::render_solid(): "<<_FBTKTEXT(Error, CreatePixmap, "Error creating pixmap", "Couldn't create a pixmap - image - for some reason")<<endl;
|
||||
cerr<<"FbTk::TextureRender::render_solid(): "<<_FBTK_CONSOLETEXT(Error, CreatePixmap, "Error creating pixmap", "Couldn't create a pixmap - image - for some reason")<<endl;
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ XImage *TextureRender::renderXImage() {
|
|||
|
||||
if (! image) {
|
||||
_FB_USES_NLS;
|
||||
cerr << "FbTk::TextureRender::renderXImage(): " << _FBTKTEXT(Error, CreateXImage, "Can't create XImage", "Couldn't create an XImage") << "." << endl;
|
||||
cerr << "FbTk::TextureRender::renderXImage(): " << _FBTK_CONSOLETEXT(Error, CreateXImage, "Can't create XImage", "Couldn't create an XImage") << "." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -594,7 +594,7 @@ XImage *TextureRender::renderXImage() {
|
|||
default:
|
||||
_FB_USES_NLS;
|
||||
cerr << "TextureRender::renderXImage(): " <<
|
||||
_FBTKTEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X") << endl;
|
||||
_FBTK_CONSOLETEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X") << endl;
|
||||
delete [] d;
|
||||
XDestroyImage(image);
|
||||
return (XImage *) 0;
|
||||
|
@ -697,7 +697,7 @@ XImage *TextureRender::renderXImage() {
|
|||
default:
|
||||
_FB_USES_NLS;
|
||||
cerr << "TextureRender::renderXImage(): " <<
|
||||
_FBTKTEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X") << endl;
|
||||
_FBTK_CONSOLETEXT(Error, UnsupportedVisual, "Unsupported visual", "A visual is a technical term in X") << endl;
|
||||
delete [] d;
|
||||
XDestroyImage(image);
|
||||
return (XImage *) 0;
|
||||
|
@ -716,7 +716,7 @@ Pixmap TextureRender::renderPixmap() {
|
|||
|
||||
if (pixmap.drawable() == None) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::TextureRender::renderPixmap(): "<<_FBTKTEXT(Error, CreatePixmap, "Error creating pixmap", "Couldn't create a pixmap - image - for some reason")<<endl;
|
||||
cerr<<"FbTk::TextureRender::renderPixmap(): "<<_FBTK_CONSOLETEXT(Error, CreatePixmap, "Error creating pixmap", "Couldn't create a pixmap - image - for some reason")<<endl;
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ void ThemeManager::loadTheme(Theme &tm) {
|
|||
if (!tm.fallback(*resource)) {
|
||||
if (verbose()) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<_FBTKTEXT(Error, ThemeItem, "Failed to read theme item", "When reading a style, couldn't read a specific item (following)")<<": "<<resource->name()<<endl;
|
||||
cerr<<_FBTK_CONSOLETEXT(Error, ThemeItem, "Failed to read theme item", "When reading a style, couldn't read a specific item (following)")<<": "<<resource->name()<<endl;
|
||||
}
|
||||
resource->setDefaultValue();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
|
|||
PictFormatDepth | PictFormatAlphaMask,
|
||||
&pic_format, 0);
|
||||
if (format == 0) {
|
||||
cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderFormat, "Warning: Failed to find valid format for alpha.", "transparency requires a pict format, can't get one...")<<endl;
|
||||
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderFormat, "Warning: Failed to find valid format for alpha.", "transparency requires a pict format, can't get one...")<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
|
|||
Pixmap alpha_pm = XCreatePixmap(disp, drawable,
|
||||
1, 1, 8);
|
||||
if (alpha_pm == 0) {
|
||||
cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderPixmap, "Warning: Failed to create alpha pixmap.", "XCreatePixmap failed for our transparency pixmap")<<endl;
|
||||
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPixmap, "Warning: Failed to create alpha pixmap.", "XCreatePixmap failed for our transparency pixmap")<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ Picture createAlphaPic(Window drawable, unsigned char alpha) {
|
|||
format, CPRepeat, &attr);
|
||||
if (alpha_pic == 0) {
|
||||
XFreePixmap(disp, alpha_pm);
|
||||
cerr<<"FbTk::Transparent: "<<_FBTKTEXT(Error, NoRenderPicture, "Warning: Failed to create alpha picture.", "XRenderCreatePicture failed")<<endl;
|
||||
cerr<<"FbTk::Transparent: "<<_FBTK_CONSOLETEXT(Error, NoRenderPicture, "Warning: Failed to create alpha picture.", "XRenderCreatePicture failed")<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ void Transparent::setDest(Drawable dest, int screen_num) {
|
|||
if (format == 0) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::Transparent: ";
|
||||
fprintf(stderr, _FBTKTEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num);
|
||||
fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num);
|
||||
cerr<<endl;
|
||||
}
|
||||
m_dest_pic = XRenderCreatePicture(disp, dest, format, 0, 0);
|
||||
|
@ -273,7 +273,7 @@ void Transparent::setSource(Drawable source, int screen_num) {
|
|||
if (format == 0) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<"FbTk::Transparent: ";
|
||||
fprintf(stderr, _FBTKTEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num);
|
||||
fprintf(stderr, _FBTK_CONSOLETEXT(Error, NoRenderVisualFormat, "Failed to find format for screen(%d)", "XRenderFindVisualFormat failed... include %d for screen number").c_str(), screen_num);
|
||||
cerr<<endl;
|
||||
}
|
||||
m_src_pic = XRenderCreatePicture(disp, m_source, format,
|
||||
|
|
|
@ -149,7 +149,7 @@ void XFontImp::rotate(FbTk::Orientation orient) {
|
|||
XRotFontStruct *rotfont = m_rotfonts[orient];
|
||||
|
||||
if (rotfont == 0) {
|
||||
cerr<<"RotFont: "<<_FBTKTEXT(Error, OutOfMemory, "Out of memory", "Something couldn't allocate memory")<<endl;
|
||||
cerr<<"RotFont: "<<_FBTK_CONSOLETEXT(Error, OutOfMemory, "Out of memory", "Something couldn't allocate memory")<<endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ void XFontImp::rotate(FbTk::Orientation orient) {
|
|||
vert_w, vert_h, 8, 0);
|
||||
|
||||
if (I1 == None) {
|
||||
cerr << "RotFont: " << _FBTKTEXT(Error, CreateXImage,
|
||||
cerr << "RotFont: " << _FBTK_CONSOLETEXT(Error, CreateXImage,
|
||||
"Can't create XImage",
|
||||
"XCreateImage failed for some reason")
|
||||
<< "." << endl;
|
||||
|
@ -257,7 +257,7 @@ void XFontImp::rotate(FbTk::Orientation orient) {
|
|||
(char *)bitdata, bit_w, bit_h, 8, 0);
|
||||
|
||||
if (I2 == None) {
|
||||
cerr << "XFontImp: " <<_FBTKTEXT(Error, CreateXImage,
|
||||
cerr << "XFontImp: " <<_FBTK_CONSOLETEXT(Error, CreateXImage,
|
||||
"Can't create XImage",
|
||||
"XCreateImage failed for some reason")
|
||||
<< "." << endl;
|
||||
|
|
|
@ -167,7 +167,7 @@ void Gnome::updateClientList(BScreen &screen) {
|
|||
Window *wl = new Window[num];
|
||||
if (wl == 0) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<_FBTEXT(Gnome, OutOfMemoryClientList, "Fatal: Out of memory, can't allocate for GNOME client list", "")<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Gnome, OutOfMemoryClientList, "Fatal: Out of memory, can't allocate for GNOME client list", "")<<endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ IconMenu::IconMenu(BScreen &screen):
|
|||
getLayer(Layer::MENU)) {
|
||||
|
||||
_FB_USES_NLS;
|
||||
setLabel(_FBTEXT(Menu, Icons, "Icons", "Iconic windows menu title"));
|
||||
setLabel(_FB_XTEXT(Menu, Icons, "Icons", "Iconic windows menu title"));
|
||||
screen.iconListSig().attach(this);
|
||||
updateItems(*this, screen);
|
||||
}
|
||||
|
|
|
@ -243,65 +243,65 @@ void setupModeMenu(FbTk::Menu &menu, IconbarTool &handler) {
|
|||
using namespace FbTk;
|
||||
_FB_USES_NLS;
|
||||
|
||||
menu.setLabel(_FBTEXT(Toolbar, IconbarMode, "Iconbar Mode", "Menu title - chooses which set of icons are shown in the iconbar"));
|
||||
menu.setLabel(_FB_XTEXT(Toolbar, IconbarMode, "Iconbar Mode", "Menu title - chooses which set of icons are shown in the iconbar"));
|
||||
|
||||
RefCount<Command> saverc_cmd(new FbCommands::SaveResources());
|
||||
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(_FBTEXT(Toolbar, IconbarModeNone,
|
||||
menu.insert(new ToolbarModeMenuItem(_FB_XTEXT(Toolbar, IconbarModeNone,
|
||||
"None", "No icons are shown in the iconbar"),
|
||||
handler,
|
||||
IconbarTool::NONE, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(
|
||||
_FBTEXT(Toolbar, IconbarModeIcons,
|
||||
_FB_XTEXT(Toolbar, IconbarModeIcons,
|
||||
"Icons", "Iconified windows from all workspaces are shown"),
|
||||
handler,
|
||||
IconbarTool::ICONS, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(
|
||||
_FBTEXT(Toolbar, IconbarModeNoIcons,
|
||||
_FB_XTEXT(Toolbar, IconbarModeNoIcons,
|
||||
"NoIcons", "No iconified windows from all workspaces are shown"),
|
||||
handler,
|
||||
IconbarTool::NOICONS, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(
|
||||
_FBTEXT(Toolbar, IconbarModeWorkspaceIcons,
|
||||
_FB_XTEXT(Toolbar, IconbarModeWorkspaceIcons,
|
||||
"WorkspaceIcons", "Iconified windows from this workspace are shown"),
|
||||
handler,
|
||||
IconbarTool::WORKSPACEICONS, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(
|
||||
_FBTEXT(Toolbar, IconbarModeWorkspaceNoIcons,
|
||||
_FB_XTEXT(Toolbar, IconbarModeWorkspaceNoIcons,
|
||||
"WorkspaceNoIcons", "No iconified windows from this workspace are shown"),
|
||||
handler,
|
||||
IconbarTool::WORKSPACENOICONS, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(
|
||||
_FBTEXT(Toolbar, IconbarModeWorkspace,
|
||||
_FB_XTEXT(Toolbar, IconbarModeWorkspace,
|
||||
"Workspace", "Normal and iconified windows from this workspace are shown"),
|
||||
handler,
|
||||
IconbarTool::WORKSPACE, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarModeMenuItem(
|
||||
_FBTEXT(Toolbar, IconbarModeAllWindows, "All Windows", "All windows are shown"),
|
||||
_FB_XTEXT(Toolbar, IconbarModeAllWindows, "All Windows", "All windows are shown"),
|
||||
handler,
|
||||
IconbarTool::ALLWINDOWS, saverc_cmd));
|
||||
|
||||
menu.insert(new FbTk::MenuSeparator());
|
||||
|
||||
menu.insert(new ToolbarAlignMenuItem(
|
||||
_FBTEXT(Align, Left, "Left", "Align to the left"),
|
||||
_FB_XTEXT(Align, Left, "Left", "Align to the left"),
|
||||
handler,
|
||||
Container::LEFT, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarAlignMenuItem(
|
||||
_FBTEXT(Align, Relative, "Relative", "Align relative to the width"),
|
||||
_FB_XTEXT(Align, Relative, "Relative", "Align relative to the width"),
|
||||
handler,
|
||||
Container::RELATIVE, saverc_cmd));
|
||||
|
||||
menu.insert(new ToolbarAlignMenuItem(
|
||||
_FBTEXT(Align, Right, "Right", "Align to the right"),
|
||||
_FB_XTEXT(Align, Right, "Right", "Align to the right"),
|
||||
handler,
|
||||
Container::RIGHT, saverc_cmd));
|
||||
|
||||
|
@ -402,7 +402,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr
|
|||
save_and_reconfig->add(reconfig);
|
||||
save_and_reconfig->add(save);
|
||||
RefCount<Command> s_and_reconfig(save_and_reconfig);
|
||||
m_menu.insert(new BoolMenuItem(_FBTEXT(Toolbar, ShowIcons, "Show Pictures", "chooses if little icons are shown next to title in the iconbar") ,
|
||||
m_menu.insert(new BoolMenuItem(_FB_XTEXT(Toolbar, ShowIcons, "Show Pictures", "chooses if little icons are shown next to title in the iconbar") ,
|
||||
*m_rc_use_pixmap, s_and_reconfig));
|
||||
m_menu.updateMenu();
|
||||
// must be internal menu, otherwise toolbar main menu tries to delete it.
|
||||
|
|
10
src/Keys.cc
10
src/Keys.cc
|
@ -226,7 +226,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
|
|||
key = FbTk::KeyUtil::getKey(val[argc].c_str());
|
||||
|
||||
if (key == 0) {
|
||||
cerr<<_FBTEXT(Keys, InvalidKeyMod,
|
||||
cerr<<_FB_CONSOLETEXT(Keys, InvalidKeyMod,
|
||||
"Keys: Invalid key/modifier on line",
|
||||
"A bad key/modifier string was found on line (number following)")<<" "<<
|
||||
m_current_line<<"): "<<linebuffer<<endl;
|
||||
|
@ -244,7 +244,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
|
|||
|
||||
} else { // parse command line
|
||||
if (last_key == 0) {
|
||||
cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
|
||||
cerr<<"> "<<linebuffer<<endl;
|
||||
return false;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ bool Keys::addBinding(const std::string &linebuffer) {
|
|||
FbTk::StringUtil::strcasestr(linebuffer.c_str(),
|
||||
val[argc].c_str() + 1); // +1 to skip ':'
|
||||
if (str == 0) {
|
||||
cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
|
||||
cerr<<"> "<<linebuffer<<endl;
|
||||
ret_val = false;
|
||||
} else {
|
||||
|
@ -261,14 +261,14 @@ bool Keys::addBinding(const std::string &linebuffer) {
|
|||
last_key->m_command = CommandParser::instance().parseLine(str);
|
||||
|
||||
if (*last_key->m_command == 0) {
|
||||
cerr<<_FBTEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Keys, BadLine, "Keys: Error on line", "Error on line (number following)")<<": "<<m_current_line<<endl;
|
||||
cerr<<"> "<<linebuffer<<endl;
|
||||
} else {
|
||||
// need to change keymode here so it doesn't get changed by CommandParser
|
||||
m_keylist = m_map[keyMode];
|
||||
// Add the keychain to list
|
||||
if (!mergeTree(current_key)) {
|
||||
cerr<<_FBTEXT(Keys, BadMerge, "Keys: Failed to merge keytree!", "relatively technical error message. Key bindings are stored in a tree structure")<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Keys, BadMerge, "Keys: Failed to merge keytree!", "relatively technical error message. Key bindings are stored in a tree structure")<<endl;
|
||||
ret_val = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,12 +43,12 @@ LayerMenu::LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl,
|
|||
int layernum;
|
||||
} layer_menuitems[] = {
|
||||
//TODO: nls
|
||||
{0, 0, _FBTEXT(Layer, AboveDock, "Above Dock", "Layer above dock"), Layer::ABOVE_DOCK},
|
||||
{0, 0, _FBTEXT(Layer, Dock, "Dock", "Layer dock"), Layer::DOCK},
|
||||
{0, 0, _FBTEXT(Layer, Top, "Top", "Layer top"), Layer::TOP},
|
||||
{0, 0, _FBTEXT(Layer, Normal, "Normal", "Layer normal"), Layer::NORMAL},
|
||||
{0, 0, _FBTEXT(Layer, Bottom, "Bottom", "Layer bottom"), Layer::BOTTOM},
|
||||
{0, 0, _FBTEXT(Layer, Desktop, "Desktop", "Layer desktop"), Layer::DESKTOP},
|
||||
{0, 0, _FB_XTEXT(Layer, AboveDock, "Above Dock", "Layer above dock"), Layer::ABOVE_DOCK},
|
||||
{0, 0, _FB_XTEXT(Layer, Dock, "Dock", "Layer dock"), Layer::DOCK},
|
||||
{0, 0, _FB_XTEXT(Layer, Top, "Top", "Layer top"), Layer::TOP},
|
||||
{0, 0, _FB_XTEXT(Layer, Normal, "Normal", "Layer normal"), Layer::NORMAL},
|
||||
{0, 0, _FB_XTEXT(Layer, Bottom, "Bottom", "Layer bottom"), Layer::BOTTOM},
|
||||
{0, 0, _FB_XTEXT(Layer, Desktop, "Desktop", "Layer desktop"), Layer::DESKTOP},
|
||||
};
|
||||
|
||||
FbTk::RefCount<FbTk::Command> saverc_cmd(new FbCommands::SaveResources());
|
||||
|
|
|
@ -193,13 +193,13 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) {
|
|||
if (submenu == 0)
|
||||
return;
|
||||
if (str_label.empty())
|
||||
menu.insert(_FBTEXT(Menu, Icons, "Icons", "Iconic windows menu title"));
|
||||
menu.insert(_FB_XTEXT(Menu, Icons, "Icons", "Iconic windows menu title"));
|
||||
else
|
||||
menu.insert(str_label, submenu);
|
||||
} else if (str_key == "exit") { // exit
|
||||
FbTk::RefCount<FbTk::Command> exit_cmd(CommandParser::instance().parseLine("exit"));
|
||||
if (str_label.empty())
|
||||
menu.insert(_FBTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd);
|
||||
menu.insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd);
|
||||
else
|
||||
menu.insert(str_label, exit_cmd);
|
||||
} else if (str_key == "exec") {
|
||||
|
@ -319,10 +319,10 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) {
|
|||
// special NLS default labels
|
||||
if (str_label.empty()) {
|
||||
if (str_key == "reconfig" || str_key == "reconfigure") {
|
||||
menu.insert(_FBTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), command);
|
||||
menu.insert(_FB_XTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), command);
|
||||
return;
|
||||
} else if (str_key == "restart") {
|
||||
menu.insert(_FBTEXT(Menu, Restart, "Restart", "Restart Command"), command);
|
||||
menu.insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart Command"), command);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
|
|||
|
||||
if (type == "shade") {
|
||||
RefCmd shade_cmd(new WindowCmd<void>(&FluxboxWindow::shade));
|
||||
menu.insert(label.empty()?_FBTEXT(Windowmenu, Shade, "Shade", "Shade the window"):label, shade_cmd);
|
||||
menu.insert(label.empty()?_FB_XTEXT(Windowmenu, Shade, "Shade", "Shade the window"):label, shade_cmd);
|
||||
} else if (type == "maximize") {
|
||||
RefCmd maximize_cmd(new WindowCmd<void>(&FluxboxWindow::maximizeFull));
|
||||
RefCmd maximize_vert_cmd(new WindowCmd<void>(&FluxboxWindow::maximizeVertical));
|
||||
|
@ -498,7 +498,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
|
|||
FbTk::MultiButtonMenuItem *maximize_item =
|
||||
new FbTk::MultiButtonMenuItem(3,
|
||||
label.empty()?
|
||||
_FBTEXT(Windowmenu, Maximize,
|
||||
_FB_XTEXT(Windowmenu, Maximize,
|
||||
"Maximize", "Maximize the window"):
|
||||
label);
|
||||
// create maximize item with:
|
||||
|
@ -512,37 +512,37 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
|
|||
} else if (type == "iconify") {
|
||||
RefCmd iconify_cmd(new WindowCmd<void>(&FluxboxWindow::iconify));
|
||||
menu.insert(label.empty() ?
|
||||
_FBTEXT(Windowmenu, Iconify,
|
||||
_FB_XTEXT(Windowmenu, Iconify,
|
||||
"Iconify", "Iconify the window") :
|
||||
label, iconify_cmd);
|
||||
} else if (type == "close") {
|
||||
RefCmd close_cmd(new WindowCmd<void>(&FluxboxWindow::close));
|
||||
menu.insert(label.empty() ?
|
||||
_FBTEXT(Windowmenu, Close,
|
||||
_FB_XTEXT(Windowmenu, Close,
|
||||
"Close", "Close the window") :
|
||||
label, close_cmd);
|
||||
} else if (type == "kill" || type == "killwindow") {
|
||||
RefCmd kill_cmd(new WindowCmd<void>(&FluxboxWindow::kill));
|
||||
menu.insert(label.empty() ?
|
||||
_FBTEXT(Windowmenu, Kill,
|
||||
_FB_XTEXT(Windowmenu, Kill,
|
||||
"Kill", "Kill the window"):
|
||||
label, kill_cmd);
|
||||
} else if (type == "lower") {
|
||||
RefCmd lower_cmd(new WindowCmd<void>(&FluxboxWindow::lower));
|
||||
menu.insert( label.empty() ?
|
||||
_FBTEXT(Windowmenu, Lower,
|
||||
_FB_XTEXT(Windowmenu, Lower,
|
||||
"Lower", "Lower the window"):
|
||||
label, lower_cmd);
|
||||
} else if (type == "raise") {
|
||||
RefCmd raise_cmd(new WindowCmd<void>(&FluxboxWindow::raise));
|
||||
menu.insert(label.empty() ?
|
||||
_FBTEXT(Windowmenu, Raise,
|
||||
_FB_XTEXT(Windowmenu, Raise,
|
||||
"Raise", "Raise the window"):
|
||||
label, raise_cmd);
|
||||
} else if (type == "stick") {
|
||||
RefCmd stick_cmd(new WindowCmd<void>(&FluxboxWindow::stick));
|
||||
menu.insert(label.empty() ?
|
||||
_FBTEXT(Windowmenu, Stick,
|
||||
_FB_XTEXT(Windowmenu, Stick,
|
||||
"Stick", "Stick the window"):
|
||||
label, stick_cmd);
|
||||
} else if (type == "extramenus") {
|
||||
|
@ -555,7 +555,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
|
|||
}
|
||||
|
||||
} else if (type == "sendto") {
|
||||
menu.insert(label.empty() ? _FBTEXT(Windowmenu, SendTo, "Send To...", "Send to menu item name"):
|
||||
menu.insert(label.empty() ? _FB_XTEXT(Windowmenu, SendTo, "Send To...", "Send to menu item name"):
|
||||
label, new SendToMenu(*Fluxbox::instance()->findScreen(menu.screenNumber())));
|
||||
} else if (type == "layer") {
|
||||
BScreen *screen = Fluxbox::instance()->findScreen(menu.screenNumber());
|
||||
|
@ -570,7 +570,7 @@ bool MenuCreator::createWindowMenuItem(const std::string &type,
|
|||
&context,
|
||||
false);
|
||||
submenu->disableTitle();
|
||||
menu.insert(label.empty()?_FBTEXT(Windowmenu, Layer, "Layer ...", "Layer menu"):label, submenu);
|
||||
menu.insert(label.empty()?_FB_XTEXT(Windowmenu, Layer, "Layer ...", "Layer menu"):label, submenu);
|
||||
|
||||
|
||||
} else if (type == "separator") {
|
||||
|
|
|
@ -64,7 +64,7 @@ m_regex(0) {
|
|||
errstr = new char[size];
|
||||
|
||||
regerror(ret, m_regex, errstr, size);
|
||||
cerr<<_FBTEXT(Fluxbox, ErrorRegexp, "Error parsing regular expression", "Error parsing regular expression (following)")<<": "<<errstr<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, ErrorRegexp, "Error parsing regular expression", "Error parsing regular expression (following)")<<": "<<errstr<<endl;
|
||||
delete [] errstr;
|
||||
delete m_regex; // I don't think I regfree a failed compile?
|
||||
m_regex = 0;
|
||||
|
|
|
@ -129,25 +129,25 @@ FbTk::Menu *createRememberMenu(BScreen &screen) {
|
|||
}
|
||||
*/
|
||||
_FB_USES_NLS;
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Workspace, "Workspace", "Remember Workspace"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Workspace, "Workspace", "Remember Workspace"),
|
||||
Remember::REM_WORKSPACE));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, JumpToWorkspace, "Jump to workspace", "Change active workspace to remembered one on open"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, JumpToWorkspace, "Jump to workspace", "Change active workspace to remembered one on open"),
|
||||
Remember::REM_JUMPWORKSPACE));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Head, "Head", "Remember Head"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Head, "Head", "Remember Head"),
|
||||
Remember::REM_HEAD));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Dimensions, "Dimensions", "Remember Dimensions - with width and height"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Dimensions, "Dimensions", "Remember Dimensions - with width and height"),
|
||||
Remember::REM_DIMENSIONS));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Position, "Position", "Remember position - window co-ordinates"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Position, "Position", "Remember position - window co-ordinates"),
|
||||
Remember::REM_POSITION));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Sticky, "Sticky", "Remember Sticky"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Sticky, "Sticky", "Remember Sticky"),
|
||||
Remember::REM_STUCKSTATE));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Decorations, "Decorations", "Remember window decorations"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Decorations, "Decorations", "Remember window decorations"),
|
||||
Remember::REM_DECOSTATE));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Shaded, "Shaded", "Remember shaded"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Shaded, "Shaded", "Remember shaded"),
|
||||
Remember::REM_SHADEDSTATE));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, Layer, "Layer", "Remember Layer"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, Layer, "Layer", "Remember Layer"),
|
||||
Remember::REM_LAYER));
|
||||
menu->insert(new RememberMenuItem(_FBTEXT(Remember, SaveOnClose, "Save on close", "Save remembered attributes on close"),
|
||||
menu->insert(new RememberMenuItem(_FB_XTEXT(Remember, SaveOnClose, "Save on close", "Save remembered attributes on close"),
|
||||
Remember::REM_SAVEONCLOSE));
|
||||
|
||||
menu->updateMenu();
|
||||
|
@ -463,7 +463,7 @@ int Remember::parseApp(std::ifstream &file, Application &app, std::string *first
|
|||
} else if (strcasecmp(str_key.c_str(), "end") == 0) {
|
||||
return row;
|
||||
} else {
|
||||
cerr << _FBTEXT(Remember, Unknown, "Unknown apps key", "apps entry type not known")<<" = " << str_key << endl;
|
||||
cerr << _FB_CONSOLETEXT(Remember, Unknown, "Unknown apps key", "apps entry type not known")<<" = " << str_key << endl;
|
||||
}
|
||||
if (had_error) {
|
||||
cerr<<"Error parsing apps entry: ("<<line<<")"<<endl;
|
||||
|
@ -1083,7 +1083,7 @@ void Remember::updateClientClose(WinClient &winclient) {
|
|||
void Remember::initForScreen(BScreen &screen) {
|
||||
// All windows get the remember menu.
|
||||
_FB_USES_NLS;
|
||||
screen.addExtraWindowMenu(_FBTEXT(Remember, MenuItemName, "Remember...", "Remember item in menu"),
|
||||
screen.addExtraWindowMenu(_FB_XTEXT(Remember, MenuItemName, "Remember...", "Remember item in menu"),
|
||||
createRememberMenu(screen));
|
||||
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ void RootTheme::reconfigTheme() {
|
|||
|
||||
if (!m_background_loaded) {
|
||||
cerr<<"Fluxbox: "<<
|
||||
_FBTEXT(Common, BackgroundWarning,
|
||||
_FB_CONSOLETEXT(Common, BackgroundWarning,
|
||||
"There is no background option specified in this style."
|
||||
" Please consult the manual or read the FAQ.",
|
||||
"Background missing warning")<<endl;
|
||||
|
|
|
@ -147,7 +147,7 @@ namespace {
|
|||
|
||||
int anotherWMRunning(Display *display, XErrorEvent *) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<_FBTEXT(Screen, AnotherWMRunning,
|
||||
cerr<<_FB_CONSOLETEXT(Screen, AnotherWMRunning,
|
||||
"BScreen::BScreen: an error occured while querying the X server.\n"
|
||||
" another window manager already running on display ",
|
||||
"Message when another WM is found already active on all screens")
|
||||
|
@ -360,7 +360,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
|||
|
||||
_FB_USES_NLS;
|
||||
|
||||
fprintf(stderr, _FBTEXT(Screen, ManagingScreen,
|
||||
fprintf(stderr, _FB_CONSOLETEXT(Screen, ManagingScreen,
|
||||
"BScreen::BScreen: managing screen %d "
|
||||
"using visual 0x%lx, depth %d\n",
|
||||
"informational message saying screen number (%d), visual (%lx), and colour depth (%d)").c_str(),
|
||||
|
@ -428,7 +428,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
|||
// own resources we must do this.
|
||||
fluxbox->load_rc(*this);
|
||||
|
||||
m_configmenu.reset(createMenu(_FBTEXT(Menu, Configuration,
|
||||
m_configmenu.reset(createMenu(_FB_XTEXT(Menu, Configuration,
|
||||
"Configuration", "Title of configuration menu")));
|
||||
setupConfigmenu(*m_configmenu.get());
|
||||
m_configmenu->setInternalMenu();
|
||||
|
@ -1525,15 +1525,15 @@ void BScreen::initMenu() {
|
|||
|
||||
if (m_rootmenu.get() == 0) {
|
||||
_FB_USES_NLS;
|
||||
m_rootmenu.reset(createMenu(_FBTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu")));
|
||||
m_rootmenu.reset(createMenu(_FB_XTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu")));
|
||||
FbTk::RefCount<FbTk::Command> restart_fb(CommandParser::instance().parseLine("restart"));
|
||||
FbTk::RefCount<FbTk::Command> exit_fb(CommandParser::instance().parseLine("exit"));
|
||||
FbTk::RefCount<FbTk::Command> execute_xterm(CommandParser::instance().parseLine("exec xterm"));
|
||||
m_rootmenu->setInternalMenu();
|
||||
m_rootmenu->insert("xterm", execute_xterm);
|
||||
m_rootmenu->insert(_FBTEXT(Menu, Restart, "Restart", "Restart command"),
|
||||
m_rootmenu->insert(_FB_XTEXT(Menu, Restart, "Restart", "Restart command"),
|
||||
restart_fb);
|
||||
m_rootmenu->insert(_FBTEXT(Menu, Exit, "Exit", "Exit command"),
|
||||
m_rootmenu->insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit command"),
|
||||
exit_fb);
|
||||
}
|
||||
|
||||
|
@ -1587,16 +1587,16 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
// create focus menu
|
||||
// we don't set this to internal menu so will
|
||||
// be deleted toghether with the parent
|
||||
FbTk::FbString focusmenu_label = _FBTEXT(Configmenu, FocusModel,
|
||||
FbTk::FbString focusmenu_label = _FB_XTEXT(Configmenu, FocusModel,
|
||||
"Focus Model",
|
||||
"Method used to give focus to windows");
|
||||
FbTk::Menu *focus_menu = createMenu(focusmenu_label);
|
||||
|
||||
#define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new BoolMenuItem(_FBTEXT(a, b, c, d), e, f))
|
||||
#define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new BoolMenuItem(_FB_XTEXT(a, b, c, d), e, f))
|
||||
|
||||
|
||||
#define _FOCUSITEM(a, b, c, d, e) \
|
||||
focus_menu->insert(new FocusModelMenuItem(_FBTEXT(a, b, c, d), focusControl(), \
|
||||
focus_menu->insert(new FocusModelMenuItem(_FB_XTEXT(a, b, c, d), focusControl(), \
|
||||
e, save_and_reconfigure))
|
||||
|
||||
_FOCUSITEM(Configmenu, ClickFocus,
|
||||
|
@ -1615,7 +1615,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
save_and_reconfigure));
|
||||
|
||||
|
||||
focus_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu,
|
||||
focus_menu->insert(new BoolMenuItem(_FB_XTEXT(Configmenu,
|
||||
AutoRaise,
|
||||
"Auto Raise",
|
||||
"Auto Raise windows on sloppy"),
|
||||
|
@ -1630,11 +1630,11 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
|
||||
// BEGIN tab menu
|
||||
|
||||
FbTk::FbString tabmenu_label = _FBTEXT(Configmenu, TabMenu,
|
||||
FbTk::FbString tabmenu_label = _FB_XTEXT(Configmenu, TabMenu,
|
||||
"Tab Options",
|
||||
"heading for tab-related options");
|
||||
FbTk::Menu *tab_menu = createMenu(tabmenu_label);
|
||||
FbTk::FbString tabplacement_label = _FBTEXT(Menu, Placement, "Placement", "Title of Placement menu");
|
||||
FbTk::FbString tabplacement_label = _FB_XTEXT(Menu, Placement, "Placement", "Title of Placement menu");
|
||||
FbTk::Menu *tabplacement_menu = createToggleMenu(tabplacement_label);
|
||||
|
||||
tab_menu->insert(tabplacement_label, tabplacement_menu);
|
||||
|
@ -1644,7 +1644,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
*resource.default_internal_tabs, save_and_reconftabs);
|
||||
|
||||
FbTk::MenuItem *tab_width_item =
|
||||
new IntResMenuItem(_FBTEXT(Configmenu, ExternalTabWidth,
|
||||
new IntResMenuItem(_FB_XTEXT(Configmenu, ExternalTabWidth,
|
||||
"External Tab Width",
|
||||
"Width of external-style tabs"),
|
||||
resource.tab_width, 10, 3000, /* silly number */
|
||||
|
@ -1658,14 +1658,14 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
Placements place_menu;
|
||||
|
||||
// menu is 2 wide, 2 down
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT));
|
||||
|
||||
tabplacement_menu->setMinimumSublevels(2);
|
||||
// create items in sub menu
|
||||
|
@ -1733,20 +1733,20 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
if (FbTk::Transparent::haveRender() ||
|
||||
FbTk::Transparent::haveComposite()) {
|
||||
|
||||
FbTk::FbString alphamenu_label = _FBTEXT(Configmenu, Transparency,
|
||||
FbTk::FbString alphamenu_label = _FB_XTEXT(Configmenu, Transparency,
|
||||
"Transparency",
|
||||
"Menu containing various transparency options");
|
||||
FbTk::Menu *alpha_menu = createMenu(alphamenu_label);
|
||||
|
||||
if (FbTk::Transparent::haveComposite(true)) {
|
||||
alpha_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, ForcePseudoTrans,
|
||||
alpha_menu->insert(new BoolMenuItem(_FB_XTEXT(Configmenu, ForcePseudoTrans,
|
||||
"Force Pseudo-Transparency",
|
||||
"When composite is available, still use old pseudo-transparency"),
|
||||
Fluxbox::instance()->getPseudoTrans(), save_and_reconfigure));
|
||||
}
|
||||
|
||||
FbTk::MenuItem *focused_alpha_item =
|
||||
new IntResMenuItem(_FBTEXT(Configmenu, FocusedAlpha,
|
||||
new IntResMenuItem(_FB_XTEXT(Configmenu, FocusedAlpha,
|
||||
"Focused Window Alpha",
|
||||
"Transparency level of the focused window"),
|
||||
resource.focused_alpha, 0, 255, *alpha_menu);
|
||||
|
@ -1754,7 +1754,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
alpha_menu->insert(focused_alpha_item);
|
||||
|
||||
FbTk::MenuItem *unfocused_alpha_item =
|
||||
new IntResMenuItem(_FBTEXT(Configmenu,
|
||||
new IntResMenuItem(_FB_XTEXT(Configmenu,
|
||||
UnfocusedAlpha,
|
||||
"Unfocused Window Alpha",
|
||||
"Transparency level of unfocused windows"),
|
||||
|
@ -1764,7 +1764,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
alpha_menu->insert(unfocused_alpha_item);
|
||||
|
||||
FbTk::MenuItem *menu_alpha_item =
|
||||
new IntResMenuItem(_FBTEXT(Configmenu, MenuAlpha,
|
||||
new IntResMenuItem(_FB_XTEXT(Configmenu, MenuAlpha,
|
||||
"Menu Alpha", "Transparency level of menu"),
|
||||
resource.menu_alpha, 0, 255, *alpha_menu);
|
||||
menu_alpha_item->setCommand(saverc_cmd);
|
||||
|
@ -1862,7 +1862,7 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) {
|
|||
_FB_USES_NLS;
|
||||
|
||||
sprintf(label,
|
||||
_FBTEXT(Screen, GeometryFormat,
|
||||
_FB_XTEXT(Screen, GeometryFormat,
|
||||
"W: %4d x H: %4d",
|
||||
"Format for width and height window, %4d for width, and %4d for height").c_str(),
|
||||
gx, gy);
|
||||
|
@ -1929,7 +1929,7 @@ void BScreen::renderGeomWindow() {
|
|||
_FB_USES_NLS;
|
||||
|
||||
sprintf(label,
|
||||
_FBTEXT(Screen, GeometryFormat,
|
||||
_FB_XTEXT(Screen, GeometryFormat,
|
||||
"W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(),
|
||||
0, 0);
|
||||
|
||||
|
|
54
src/Slit.cc
54
src/Slit.cc
|
@ -219,8 +219,8 @@ public:
|
|||
std::string reallabel = m_label + " " +
|
||||
( m_slit.direction() == Slit::HORIZONTAL ?
|
||||
|
||||
_FBTEXT(Align, Horizontal, "Horizontal", "Horizontal"):
|
||||
_FBTEXT(Align, Vertical, "Vertical", "Vertical"));
|
||||
_FB_XTEXT(Align, Horizontal, "Horizontal", "Horizontal"):
|
||||
_FB_XTEXT(Align, Vertical, "Vertical", "Vertical"));
|
||||
FbTk::MenuItem::setLabel(reallabel);
|
||||
}
|
||||
private:
|
||||
|
@ -294,7 +294,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
|
|||
scr.resizeSig().attach(this);
|
||||
scr.reconfigureSig().attach(this); // if alpha changed (we disablethis signal when we get theme change sig)
|
||||
|
||||
scr.addConfigMenu(_FBTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu);
|
||||
scr.addConfigMenu(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"), m_slitmenu);
|
||||
|
||||
frame.pixmap = None;
|
||||
// move the frame out of sight for a moment
|
||||
|
@ -322,7 +322,7 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename)
|
|||
getLayer(Layer::MENU),
|
||||
this,
|
||||
true));
|
||||
m_layermenu->setLabel(_FBTEXT(Slit, Layer, "Slit Layer", "Title of Slit Layer Menu"));
|
||||
m_layermenu->setLabel(_FB_XTEXT(Slit, Layer, "Slit Layer", "Title of Slit Layer Menu"));
|
||||
|
||||
moveToLayer((*m_rc_layernum).getNum());
|
||||
|
||||
|
@ -1162,12 +1162,12 @@ void Slit::updateClientmenu() {
|
|||
|
||||
// clear old items
|
||||
m_clientlist_menu.removeAll();
|
||||
m_clientlist_menu.setLabel(_FBTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"));
|
||||
m_clientlist_menu.setLabel(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"));
|
||||
|
||||
FbTk::RefCount<FbTk::Command> cycle_up(new FbTk::SimpleCommand<Slit>(*this, &Slit::cycleClientsUp));
|
||||
FbTk::RefCount<FbTk::Command> cycle_down(new FbTk::SimpleCommand<Slit>(*this, &Slit::cycleClientsDown));
|
||||
m_clientlist_menu.insert(_FBTEXT(Slit, CycleUp, "Cycle Up", "Cycle clients upwards"), cycle_up);
|
||||
m_clientlist_menu.insert(_FBTEXT(Slit, CycleDown, "Cycle Down", "Cycle clients downwards"), cycle_down);
|
||||
m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleUp, "Cycle Up", "Cycle clients upwards"), cycle_up);
|
||||
m_clientlist_menu.insert(_FB_XTEXT(Slit, CycleDown, "Cycle Down", "Cycle clients downwards"), cycle_down);
|
||||
|
||||
m_clientlist_menu.insert(new FbTk::MenuSeparator());
|
||||
|
||||
|
@ -1180,7 +1180,7 @@ void Slit::updateClientmenu() {
|
|||
|
||||
m_clientlist_menu.insert(new FbTk::MenuSeparator());
|
||||
FbTk::RefCount<FbTk::Command> savecmd(new FbTk::SimpleCommand<Slit>(*this, &Slit::saveClientList));
|
||||
m_clientlist_menu.insert(_FBTEXT(Slit,
|
||||
m_clientlist_menu.insert(_FB_XTEXT(Slit,
|
||||
SaveSlitList,
|
||||
"Save SlitList", "Saves the current order in the slit"),
|
||||
savecmd);
|
||||
|
@ -1242,37 +1242,37 @@ void Slit::setupMenu() {
|
|||
|
||||
|
||||
// setup base menu
|
||||
m_slitmenu.setLabel(_FBTEXT(Slit, Slit, "Slit", "The Slit"));
|
||||
m_slitmenu.insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"),
|
||||
m_slitmenu.setLabel(_FB_XTEXT(Slit, Slit, "Slit", "The Slit"));
|
||||
m_slitmenu.insert(_FB_XTEXT(Menu, Placement, "Placement", "Title of Placement menu"),
|
||||
placement_menu);
|
||||
|
||||
m_slitmenu.insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get());
|
||||
m_slitmenu.insert(_FB_XTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), m_layermenu.get());
|
||||
|
||||
#ifdef XINERAMA
|
||||
if (screen().hasXinerama()) {
|
||||
m_slitmenu.insert(_FBTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"),
|
||||
m_slitmenu.insert(_FB_XTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"),
|
||||
new XineramaHeadMenu<Slit>(
|
||||
screen().menuTheme(),
|
||||
screen(),
|
||||
screen().imageControl(),
|
||||
*screen().layerManager().getLayer(::Layer::MENU),
|
||||
*this,
|
||||
_FBTEXT(Slit, OnHead, "Slit on Head", "Title of Slits On Head menu")
|
||||
_FB_XTEXT(Slit, OnHead, "Slit on Head", "Title of Slits On Head menu")
|
||||
));
|
||||
}
|
||||
#endif //XINERAMA
|
||||
|
||||
m_slitmenu.insert(new BoolMenuItem(_FBTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"),
|
||||
m_slitmenu.insert(new BoolMenuItem(_FB_XTEXT(Common, AutoHide, "Auto hide", "This thing automatically hides when not close by"),
|
||||
*m_rc_auto_hide,
|
||||
save_and_reconfigure_slit));
|
||||
|
||||
m_slitmenu.insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"),
|
||||
m_slitmenu.insert(new BoolMenuItem(_FB_XTEXT(Common, MaximizeOver,"Maximize Over", "Maximize over this thing when maximizing"),
|
||||
*m_rc_maximize_over,
|
||||
save_and_reconfigure_slit));
|
||||
|
||||
// this saves resources and clears the slit window to update alpha value
|
||||
FbTk::MenuItem *alpha_menuitem =
|
||||
new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"),
|
||||
new IntResMenuItem(_FB_XTEXT(Common, Alpha, "Alpha", "Transparency level"),
|
||||
m_rc_alpha,
|
||||
0, 255, m_slitmenu);
|
||||
// setup command for alpha value
|
||||
|
@ -1285,14 +1285,14 @@ void Slit::setupMenu() {
|
|||
|
||||
m_slitmenu.insert(alpha_menuitem);
|
||||
|
||||
m_slitmenu.insert(new SlitDirMenuItem(_FBTEXT(Slit, Direction, "Slit Direction", "Orientation of slit"),
|
||||
m_slitmenu.insert(new SlitDirMenuItem(_FB_XTEXT(Slit, Direction, "Slit Direction", "Orientation of slit"),
|
||||
*this,
|
||||
save_and_reconfigure));
|
||||
m_slitmenu.insert(_FBTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu);
|
||||
m_slitmenu.insert(_FB_XTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu);
|
||||
m_slitmenu.updateMenu();
|
||||
|
||||
// setup sub menu
|
||||
placement_menu->setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement"));
|
||||
placement_menu->setLabel(_FB_XTEXT(Slit, Placement, "Slit Placement", "Slit Placement"));
|
||||
placement_menu->setMinimumSublevels(3);
|
||||
m_layermenu->setInternalMenu();
|
||||
m_clientlist_menu.setInternalMenu();
|
||||
|
@ -1303,15 +1303,15 @@ void Slit::setupMenu() {
|
|||
Placements place_menu;
|
||||
|
||||
// menu is 3 wide, 5 down
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopLeft, "Top Left", "Top Left"), Slit::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, LeftCenter, "Left Center", "Left Center"), Slit::LEFTCENTER));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Slit::BOTTOMLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopCenter, "Top Center", "Top Center"), Slit::TOPCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), Slit::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), Slit::LEFTCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Slit::BOTTOMLEFT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), Slit::TOPCENTER));
|
||||
place_menu.push_back(PlacementP("", Slit::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Slit::BOTTOMCENTER));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), Slit::TOPRIGHT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Slit::RIGHTCENTER));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Slit::BOTTOMRIGHT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Slit::BOTTOMCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), Slit::TOPRIGHT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), Slit::RIGHTCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Slit::BOTTOMRIGHT));
|
||||
|
||||
|
||||
// create items in sub menu
|
||||
|
|
|
@ -247,15 +247,15 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
|
|||
|
||||
moveToLayer((*m_rc_layernum).getNum());
|
||||
|
||||
m_layermenu.setLabel(_FBTEXT(Toolbar, Layer, "Toolbar Layer", "Title of toolbar layer menu"));
|
||||
m_placementmenu.setLabel(_FBTEXT(Toolbar, Placement, "Toolbar Placement", "Title of toolbar placement menu"));
|
||||
m_layermenu.setLabel(_FB_XTEXT(Toolbar, Layer, "Toolbar Layer", "Title of toolbar layer menu"));
|
||||
m_placementmenu.setLabel(_FB_XTEXT(Toolbar, Placement, "Toolbar Placement", "Title of toolbar placement menu"));
|
||||
|
||||
m_layermenu.setInternalMenu();
|
||||
m_placementmenu.setInternalMenu();
|
||||
m_toolbarmenu.setInternalMenu();
|
||||
setupMenus();
|
||||
// add menu to screen
|
||||
screen().addConfigMenu(_FBTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu());
|
||||
screen().addConfigMenu(_FB_XTEXT(Toolbar, Toolbar, "Toolbar", "title of toolbar menu item"), menu());
|
||||
|
||||
// geometry settings
|
||||
frame.width = width;
|
||||
|
@ -808,7 +808,7 @@ void Toolbar::setupMenus() {
|
|||
typedef RefCount<Command> RefCommand;
|
||||
typedef SimpleCommand<Toolbar> ToolbarCommand;
|
||||
|
||||
menu().setLabel(_FBTEXT(Toolbar, Toolbar,
|
||||
menu().setLabel(_FB_XTEXT(Toolbar, Toolbar,
|
||||
"Toolbar", "Title of Toolbar menu"));
|
||||
|
||||
RefCommand reconfig_toolbar(new ToolbarCommand(*this, &Toolbar::reconfigure));
|
||||
|
@ -824,17 +824,17 @@ void Toolbar::setupMenus() {
|
|||
visible_macro->add(reconfig_toolbar);
|
||||
visible_macro->add(save_resources);
|
||||
RefCommand toggle_visible_cmd(visible_macro);
|
||||
menu().insert(new BoolMenuItem(_FBTEXT(Common, Visible,
|
||||
menu().insert(new BoolMenuItem(_FB_XTEXT(Common, Visible,
|
||||
"Visible", "Whether this item is visible"),
|
||||
*m_rc_visible, toggle_visible_cmd));
|
||||
|
||||
menu().insert(new BoolMenuItem(_FBTEXT(Common, AutoHide,
|
||||
menu().insert(new BoolMenuItem(_FB_XTEXT(Common, AutoHide,
|
||||
"Auto hide", "Toggle auto hide of toolbar"),
|
||||
*m_rc_auto_hide,
|
||||
reconfig_toolbar_and_save_resource));
|
||||
|
||||
MenuItem *toolbar_menuitem =
|
||||
new IntResMenuItem(_FBTEXT(Toolbar, WidthPercent,
|
||||
new IntResMenuItem(_FB_XTEXT(Toolbar, WidthPercent,
|
||||
"Toolbar width percent",
|
||||
"Percentage of screen width taken by toolbar"),
|
||||
m_rc_width_percent,
|
||||
|
@ -844,21 +844,21 @@ void Toolbar::setupMenus() {
|
|||
toolbar_menuitem->setCommand(reconfig_toolbar_and_save_resource);
|
||||
menu().insert(toolbar_menuitem);
|
||||
|
||||
menu().insert(new BoolMenuItem(_FBTEXT(Common, MaximizeOver,
|
||||
menu().insert(new BoolMenuItem(_FB_XTEXT(Common, MaximizeOver,
|
||||
"Maximize Over",
|
||||
"Maximize over this thing when maximizing"),
|
||||
*m_rc_maximize_over,
|
||||
reconfig_toolbar_and_save_resource));
|
||||
menu().insert(_FBTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), &layerMenu());
|
||||
menu().insert(_FB_XTEXT(Menu, Layer, "Layer...", "Title of Layer menu"), &layerMenu());
|
||||
#ifdef XINERAMA
|
||||
if (screen().hasXinerama()) {
|
||||
menu().insert(_FBTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"),
|
||||
menu().insert(_FB_XTEXT(Menu, OnHead, "On Head...", "Title of On Head menu"),
|
||||
new XineramaHeadMenu<Toolbar>(screen().menuTheme(),
|
||||
screen(),
|
||||
screen().imageControl(),
|
||||
*screen().layerManager().getLayer(::Layer::MENU),
|
||||
*this,
|
||||
_FBTEXT(Toolbar, OnHead, "Toolbar on Head",
|
||||
_FB_XTEXT(Toolbar, OnHead, "Toolbar on Head",
|
||||
"Title of toolbar on head menu")));
|
||||
}
|
||||
#endif // XINERAMA
|
||||
|
@ -868,21 +868,21 @@ void Toolbar::setupMenus() {
|
|||
Placements place_menu;
|
||||
|
||||
// menu is 3 wide, 5 down
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopLeft, "Top Left", "Top Left"), Toolbar::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, LeftTop, "Left Top", "Left Top"), Toolbar::LEFTTOP));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, LeftCenter, "Left Center", "Left Center"), Toolbar::LEFTCENTER));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), Toolbar::LEFTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Toolbar::BOTTOMLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopCenter, "Top Center", "Top Center"), Toolbar::TOPCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), Toolbar::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), Toolbar::LEFTTOP));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), Toolbar::LEFTCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), Toolbar::LEFTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), Toolbar::BOTTOMLEFT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), Toolbar::TOPCENTER));
|
||||
place_menu.push_back(PlacementP("", Toolbar::TOPLEFT));
|
||||
place_menu.push_back(PlacementP("", Toolbar::TOPLEFT));
|
||||
place_menu.push_back(PlacementP("", Toolbar::TOPLEFT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Toolbar::BOTTOMCENTER));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, TopRight, "Top Right", "Top Right"), Toolbar::TOPRIGHT));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, RightTop, "Right Top", "Right Top"), Toolbar::RIGHTTOP));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FBTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), Toolbar::BOTTOMCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), Toolbar::TOPRIGHT));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), Toolbar::RIGHTTOP));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), Toolbar::RIGHTCENTER));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), Toolbar::RIGHTBOTTOM));
|
||||
place_menu.push_back(PlacementP(_FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), Toolbar::BOTTOMRIGHT));
|
||||
|
||||
|
||||
placementMenu().setMinimumSublevels(3);
|
||||
|
@ -901,13 +901,13 @@ void Toolbar::setupMenus() {
|
|||
}
|
||||
place_menu.pop_front();
|
||||
}
|
||||
menu().insert(_FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"), &placementMenu());
|
||||
menu().insert(_FB_XTEXT(Menu, Placement, "Placement", "Title of Placement menu"), &placementMenu());
|
||||
placementMenu().updateMenu();
|
||||
|
||||
|
||||
// this saves resources and clears the slit window to update alpha value
|
||||
FbTk::MenuItem *alpha_menuitem =
|
||||
new IntResMenuItem(_FBTEXT(Common, Alpha, "Alpha", "Transparency level"),
|
||||
new IntResMenuItem(_FB_XTEXT(Common, Alpha, "Alpha", "Transparency level"),
|
||||
m_rc_alpha,
|
||||
0, 255, menu());
|
||||
// setup command for alpha value
|
||||
|
|
|
@ -374,10 +374,9 @@ void Workspace::setName(const std::string &name) {
|
|||
_FB_USES_NLS;
|
||||
char tname[128];
|
||||
sprintf(tname,
|
||||
_FBTEXT(Workspace, DefaultNameFormat,
|
||||
_FB_XTEXT(Workspace, DefaultNameFormat,
|
||||
"Workspace %d", "Default workspace names, with a %d for the workspace number").c_str(),
|
||||
m_id + 1); //m_id starts at 0
|
||||
m_name = FbTk::FbStringUtil::LocaleStrToFb(tname);
|
||||
}
|
||||
|
||||
screen().updateWorkspaceNamesAtom();
|
||||
|
|
|
@ -115,8 +115,8 @@ void WorkspaceMenu::init(BScreen &screen) {
|
|||
|
||||
removeAll();
|
||||
|
||||
setLabel(_FBTEXT(Workspace, MenuTitle, "Workspaces", "Title of main workspace menu"));
|
||||
insert(_FBTEXT(Menu, Icons, "Icons", "Iconic windows menu title"),
|
||||
setLabel(_FB_XTEXT(Workspace, MenuTitle, "Workspaces", "Title of main workspace menu"));
|
||||
insert(_FB_XTEXT(Menu, Icons, "Icons", "Iconic windows menu title"),
|
||||
MenuCreator::createMenuType("iconmenu", screen.screenNumber()));
|
||||
insert(new FbTk::MenuSeparator());
|
||||
// for each workspace add workspace name and it's menu to our workspace menu
|
||||
|
@ -150,11 +150,11 @@ void WorkspaceMenu::init(BScreen &screen) {
|
|||
RefCount<Command> start_edit(CommandParser::instance().parseLine("setworkspacenamedialog"));
|
||||
|
||||
insert(new FbTk::MenuSeparator());
|
||||
insert(_FBTEXT(Workspace, NewWorkspace, "New Workspace", "Add a new workspace"),
|
||||
insert(_FB_XTEXT(Workspace, NewWorkspace, "New Workspace", "Add a new workspace"),
|
||||
new_workspace_cmd);
|
||||
insert(_FBTEXT(Toolbar, EditWkspcName, "Edit current workspace name", "Edit current workspace name"),
|
||||
insert(_FB_XTEXT(Toolbar, EditWkspcName, "Edit current workspace name", "Edit current workspace name"),
|
||||
start_edit);
|
||||
insert(_FBTEXT(Workspace, RemoveLast, "Remove Last", "Remove the last workspace"),
|
||||
insert(_FB_XTEXT(Workspace, RemoveLast, "Remove Last", "Remove the last workspace"),
|
||||
remove_last_cmd);
|
||||
|
||||
updateMenu();
|
||||
|
|
|
@ -70,11 +70,11 @@ FbTk::FbString getWMName(Window window) {
|
|||
XFree(text_prop.value);
|
||||
|
||||
} else { // default name
|
||||
name = FbTk::FbStringUtil::LocaleStrToFb(_FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME"));
|
||||
name = _FB_XTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME");
|
||||
}
|
||||
} else {
|
||||
// default name
|
||||
name = FbTk::FbStringUtil::LocaleStrToFb(_FBTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME"));
|
||||
name = _FB_XTEXT(Window, Unnamed, "Unnamed", "Default name for a window without a WM_NAME");
|
||||
}
|
||||
|
||||
return name;
|
||||
|
|
|
@ -234,10 +234,10 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
|||
|
||||
_FB_USES_NLS;
|
||||
if (s_singleton != 0)
|
||||
throw _FBTEXT(Fluxbox, FatalSingleton, "Fatal! There can only one instance of fluxbox class.", "Error displayed on weird error where an instance of the Fluxbox class already exists!");
|
||||
throw _FB_CONSOLETEXT(Fluxbox, FatalSingleton, "Fatal! There can only one instance of fluxbox class.", "Error displayed on weird error where an instance of the Fluxbox class already exists!");
|
||||
|
||||
if (display() == 0) {
|
||||
throw _FBTEXT(Fluxbox, NoDisplay,
|
||||
throw _FB_CONSOLETEXT(Fluxbox, NoDisplay,
|
||||
"Can not connect to X server.\nMake sure you started X before you start Fluxbox.",
|
||||
"Error message when no X display appears to exist");
|
||||
}
|
||||
|
@ -312,10 +312,10 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
|||
setupConfigFiles();
|
||||
|
||||
if (! XSupportsLocale())
|
||||
cerr<<_FBTEXT(Fluxbox, WarningLocale, "Warning: X server does not support locale", "XSupportsLocale returned false")<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, WarningLocale, "Warning: X server does not support locale", "XSupportsLocale returned false")<<endl;
|
||||
|
||||
if (XSetLocaleModifiers("") == 0)
|
||||
cerr<<_FBTEXT(Fluxbox, WarningLocaleModifiers, "Warning: cannot set locale modifiers", "XSetLocaleModifiers returned false")<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, WarningLocaleModifiers, "Warning: cannot set locale modifiers", "XSetLocaleModifiers returned false")<<endl;
|
||||
|
||||
|
||||
#ifdef HAVE_GETPID
|
||||
|
@ -335,7 +335,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
|||
for (i = 1; i < m_argc; i++) {
|
||||
if (! strcmp(m_argv[i], "-screen")) {
|
||||
if ((++i) >= m_argc) {
|
||||
cerr << _FBTEXT(main, ScreenRequiresArg, "error, -screen requires argument", "the -screen option requires a file argument") << endl;
|
||||
cerr << _FB_CONSOLETEXT(main, ScreenRequiresArg, "error, -screen requires argument", "the -screen option requires a file argument") << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
|||
|
||||
|
||||
if (m_screen_list.empty()) {
|
||||
throw _FBTEXT(Fluxbox, ErrorNoScreens,
|
||||
throw _FB_CONSOLETEXT(Fluxbox, ErrorNoScreens,
|
||||
"Couldn't find screens to manage.\nMake sure you don't have another window manager running.",
|
||||
"Error message when no unmanaged screens found - usually means another window manager is running");
|
||||
}
|
||||
|
@ -594,7 +594,7 @@ void Fluxbox::setupConfigFiles() {
|
|||
_FB_USES_NLS;
|
||||
// create directory with perm 700
|
||||
if (mkdir(dirname.c_str(), 0700)) {
|
||||
fprintf(stderr, _FBTEXT(Fluxbox, ErrorCreatingDirectory,
|
||||
fprintf(stderr, _FB_CONSOLETEXT(Fluxbox, ErrorCreatingDirectory,
|
||||
"Can't create %s directory",
|
||||
"Can't create a directory, one %s for directory name").c_str(),
|
||||
dirname.c_str());
|
||||
|
@ -758,7 +758,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
screen = searchScreen(e->xmaprequest.parent);
|
||||
|
||||
if (screen == 0) {
|
||||
cerr<<"Fluxbox "<<_FBTEXT(Fluxbox, CantMapWindow, "Warning! Could not find screen to map window on!", "")<<endl;
|
||||
cerr<<"Fluxbox "<<_FB_CONSOLETEXT(Fluxbox, CantMapWindow, "Warning! Could not find screen to map window on!", "")<<endl;
|
||||
} else
|
||||
win = screen->createWindow(e->xmaprequest.window);
|
||||
|
||||
|
@ -1156,17 +1156,17 @@ void Fluxbox::handleSignal(int signum) {
|
|||
break;
|
||||
default:
|
||||
fprintf(stderr,
|
||||
_FBTEXT(BaseDisplay, SignalCaught, "%s: signal %d caught\n", "signal catch debug message. Include %s for command and %d for signal number").c_str(),
|
||||
_FB_CONSOLETEXT(BaseDisplay, SignalCaught, "%s: signal %d caught\n", "signal catch debug message. Include %s for command and %d for signal number").c_str(),
|
||||
m_argv[0], signum);
|
||||
|
||||
if (! m_starting && ! re_enter) {
|
||||
re_enter = 1;
|
||||
cerr<<_FBTEXT(BaseDisplay, ShuttingDown, "Shutting Down\n", "Quitting because of signal, end with newline");
|
||||
cerr<<_FB_CONSOLETEXT(BaseDisplay, ShuttingDown, "Shutting Down\n", "Quitting because of signal, end with newline");
|
||||
shutdown();
|
||||
}
|
||||
|
||||
|
||||
cerr<<_FBTEXT(BaseDisplay, Aborting, "Aborting... dumping core\n", "Aboring and dumping core, end with newline");
|
||||
cerr<<_FB_CONSOLETEXT(BaseDisplay, Aborting, "Aborting... dumping core\n", "Aboring and dumping core, end with newline");
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
|
@ -1455,7 +1455,7 @@ void Fluxbox::save_rc() {
|
|||
m_resourcemanager.save(dbfile.c_str(), dbfile.c_str());
|
||||
m_screen_rm.save(dbfile.c_str(), dbfile.c_str());
|
||||
} else
|
||||
cerr<<_FBTEXT(Fluxbox, BadRCFile, "rc filename is invalid!", "Bad settings file")<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, BadRCFile, "rc filename is invalid!", "Bad settings file")<<endl;
|
||||
|
||||
ScreenList::iterator it = m_screen_list.begin();
|
||||
ScreenList::iterator it_end = m_screen_list.end();
|
||||
|
@ -1521,14 +1521,14 @@ void Fluxbox::load_rc() {
|
|||
|
||||
if (!dbfile.empty()) {
|
||||
if (!m_resourcemanager.load(dbfile.c_str())) {
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl;
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
if (!m_resourcemanager.load(DEFAULT_INITFILE))
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
}
|
||||
} else {
|
||||
if (!m_resourcemanager.load(DEFAULT_INITFILE))
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
}
|
||||
|
||||
if (m_rc_menufile->empty())
|
||||
|
@ -1555,7 +1555,7 @@ void Fluxbox::load_rc() {
|
|||
|
||||
if (!Workspace::loadGroups(*m_rc_groupfile)) {
|
||||
#ifdef DEBUG
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadGroupFile, "Failed to load groupfile", "Couldn't load the groupfile")<<": "<<*m_rc_groupfile<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadGroupFile, "Failed to load groupfile", "Couldn't load the groupfile")<<": "<<*m_rc_groupfile<<endl;
|
||||
#endif // DEBUG
|
||||
}
|
||||
}
|
||||
|
@ -1610,14 +1610,14 @@ void Fluxbox::load_rc(BScreen &screen) {
|
|||
|
||||
if (!dbfile.empty()) {
|
||||
if (!m_screen_rm.load(dbfile.c_str())) {
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl;
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
if (!m_screen_rm.load(DEFAULT_INITFILE))
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
}
|
||||
} else {
|
||||
if (!m_screen_rm.load(DEFAULT_INITFILE))
|
||||
cerr<<_FBTEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
150
src/main.cc
150
src/main.cc
|
@ -62,42 +62,85 @@
|
|||
using namespace std;
|
||||
void showInfo(ostream &ostr) {
|
||||
_FB_USES_NLS;
|
||||
ostr<<_FBTEXT(Common, FluxboxVersion, "Fluxbox version", "Fluxbox version heading")<<": "<<__fluxbox_version<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, FluxboxVersion, "Fluxbox version", "Fluxbox version heading")<<": "<<__fluxbox_version<<endl;
|
||||
|
||||
if (strlen(svnversion()) > 0)
|
||||
ostr << _FBTEXT(Common, SvnRevision, "SVN Revision", "Revision number in SVN repositary") << ": " << svnversion() << endl;
|
||||
ostr << _FB_CONSOLETEXT(Common, SvnRevision, "SVN Revision", "Revision number in SVN repositary") << ": " << svnversion() << endl;
|
||||
#if defined(__DATE__) && defined(__TIME__)
|
||||
ostr<<_FBTEXT(Common, Compiled, "Compiled", "Time fluxbox was compiled")<<": "<<__DATE__<<" "<<__TIME__<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, Compiled, "Compiled", "Time fluxbox was compiled")<<": "<<__DATE__<<" "<<__TIME__<<endl;
|
||||
#endif
|
||||
#ifdef __fluxbox_compiler
|
||||
ostr<<_FBTEXT(Common, Compiler, "Compiler", "Compiler used to build fluxbox")<<": "<<__fluxbox_compiler<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, Compiler, "Compiler", "Compiler used to build fluxbox")<<": "<<__fluxbox_compiler<<endl;
|
||||
#endif // __fluxbox_compiler
|
||||
#ifdef __fluxbox_compiler_version
|
||||
ostr<<_FBTEXT(Common, CompilerVersion, "Compiler version", "Compiler version used to build fluxbox")<<": "<<__fluxbox_compiler_version<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, CompilerVersion, "Compiler version", "Compiler version used to build fluxbox")<<": "<<__fluxbox_compiler_version<<endl;
|
||||
#endif // __fluxbox_compiler_version
|
||||
|
||||
ostr<<endl<<_FBTEXT(Common, Defaults, "Defaults", "Default values compiled in")<<":"<<endl;
|
||||
ostr<<endl<<_FB_CONSOLETEXT(Common, Defaults, "Defaults", "Default values compiled in")<<":"<<endl;
|
||||
|
||||
ostr<<_FBTEXT(Common, DefaultMenuFile, " menu", "default menu file (right aligned - make sure same width as other default values)")<<": "<<DEFAULTMENU<<endl;
|
||||
ostr<<_FBTEXT(Common, DefaultStyle, " style", "default style (right aligned - make sure same width as other default values)")<<": "<<DEFAULTSTYLE<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, DefaultMenuFile, " menu", "default menu file (right aligned - make sure same width as other default values)")<<": "<<DEFAULTMENU<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, DefaultStyle, " style", "default style (right aligned - make sure same width as other default values)")<<": "<<DEFAULTSTYLE<<endl;
|
||||
|
||||
ostr<<_FBTEXT(Common, DefaultKeyFile, " keys", "default key file (right aligned - make sure same width as other default values)")<<": "<<DEFAULTKEYSFILE<<endl;
|
||||
ostr<<_FBTEXT(Common, DefaultInitFile, " init", "default init file (right aligned - make sure same width as other default values)")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, DefaultKeyFile, " keys", "default key file (right aligned - make sure same width as other default values)")<<": "<<DEFAULTKEYSFILE<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, DefaultInitFile, " init", "default init file (right aligned - make sure same width as other default values)")<<": "<<DEFAULT_INITFILE<<endl;
|
||||
|
||||
#ifdef NLS
|
||||
ostr<<_FBTEXT(Common, DefaultLocalePath, " nls", "location for localization files (right aligned - make sure same width as other default values)")<<": "<<LOCALEPATH<<endl;
|
||||
ostr<<_FB_CONSOLETEXT(Common, DefaultLocalePath, " nls", "location for localization files (right aligned - make sure same width as other default values)")<<": "<<LOCALEPATH<<endl;
|
||||
#endif
|
||||
|
||||
const char NOT[] = "-";
|
||||
ostr<<endl<<
|
||||
_FBTEXT(Common, CompiledOptions, "Compiled options", "Options used when compiled")
|
||||
_FB_CONSOLETEXT(Common, CompiledOptions, "Compiled options", "Options used when compiled")
|
||||
<<" ("<<NOT<<" => "<<
|
||||
_FBTEXT(Common, Disabled, "disabled", "option is turned off")<<"): "<<endl<<
|
||||
_FB_CONSOLETEXT(Common, Disabled, "disabled", "option is turned off")<<"): "<<endl<<
|
||||
|
||||
/**** NOTE: This list is in alphabetical order! ****/
|
||||
|
||||
#ifndef DEBUG
|
||||
NOT<<
|
||||
#endif // DEBUG
|
||||
"DEBUG"<<endl<<
|
||||
|
||||
#ifndef USE_NEWWMSPEC
|
||||
NOT<<
|
||||
#endif // USE_NEWWMSPEC
|
||||
"EWMH"<<endl<<
|
||||
|
||||
#ifndef USE_GNOME
|
||||
NOT<<
|
||||
#endif // USE_GNOME
|
||||
"GNOME"<<endl<<
|
||||
|
||||
#ifndef HAVE_IMLIB2
|
||||
NOT<<
|
||||
#endif // HAVE_IMLIB2
|
||||
"IMLIB2"<<endl<<
|
||||
|
||||
#ifndef KDE
|
||||
NOT<<
|
||||
#endif // KDE
|
||||
"KDE"<<endl<<
|
||||
|
||||
#ifndef NLS
|
||||
NOT<<
|
||||
#endif // NLS
|
||||
"NLS"<<endl<<
|
||||
|
||||
#ifndef REMEMBER
|
||||
NOT<<
|
||||
#endif // REMEMBER
|
||||
"REMEMBER"<<endl<<
|
||||
|
||||
#ifndef HAVE_XRENDER
|
||||
NOT<<
|
||||
#endif // HAVE_XRENDER
|
||||
"RENDER"<<endl<<
|
||||
|
||||
#ifndef SHAPE
|
||||
NOT<<
|
||||
#endif // SHAPE
|
||||
"SHAPE"<<endl<<
|
||||
|
||||
#ifndef SLIT
|
||||
NOT<<
|
||||
#endif // SLIT
|
||||
|
@ -108,60 +151,27 @@ void showInfo(ostream &ostr) {
|
|||
#endif // USE_TOOLBAR
|
||||
"TOOLBAR"<<endl<<
|
||||
|
||||
#ifndef HAVE_XPM
|
||||
NOT<<
|
||||
#endif // HAVE_XPM
|
||||
"XPM"<<endl<<
|
||||
|
||||
#ifndef HAVE_IMLIB2
|
||||
NOT<<
|
||||
#endif // HAVE_IMLIB2
|
||||
"IMLIB2"<<endl<<
|
||||
|
||||
#ifndef USE_GNOME
|
||||
NOT<<
|
||||
#endif // USE_GNOME
|
||||
"GNOME"<<endl<<
|
||||
|
||||
#ifndef KDE
|
||||
NOT<<
|
||||
#endif // KDE
|
||||
"KDE"<<endl<<
|
||||
|
||||
#ifndef USE_NEWWMSPEC
|
||||
NOT<<
|
||||
#endif // USE_NEWWMSPEC
|
||||
"EWMH"<<endl<<
|
||||
|
||||
#ifndef REMEMBER
|
||||
NOT<<
|
||||
#endif // REMEMBER
|
||||
"REMEMBER"<<endl<<
|
||||
|
||||
#ifndef SHAPE
|
||||
NOT<<
|
||||
#endif // SHAPE
|
||||
"SHAPE"<<endl<<
|
||||
|
||||
#ifndef USE_XFT
|
||||
NOT<<
|
||||
#endif // USE_XFT
|
||||
"XFT"<<endl<<
|
||||
|
||||
#ifndef USE_XMB
|
||||
NOT<<
|
||||
#endif // USE_XMB
|
||||
"XMB"<<endl<<
|
||||
|
||||
#ifndef XINERAMA
|
||||
NOT<<
|
||||
#endif // XINERAMA
|
||||
"XINERAMA"<<endl<<
|
||||
|
||||
#ifndef HAVE_XRENDER
|
||||
#ifndef USE_XMB
|
||||
NOT<<
|
||||
#endif // HAVE_XRENDER
|
||||
"RENDER"<<endl<<
|
||||
#endif // USE_XMB
|
||||
"XMB"<<endl<<
|
||||
|
||||
#ifndef HAVE_XPM
|
||||
NOT<<
|
||||
#endif // HAVE_XPM
|
||||
"XPM"<<endl<<
|
||||
|
||||
|
||||
endl;
|
||||
}
|
||||
|
||||
|
@ -180,7 +190,7 @@ int main(int argc, char **argv) {
|
|||
// look for alternative rc file to use
|
||||
|
||||
if ((++i) >= argc) {
|
||||
cerr<<_FBTEXT(main, RCRequiresArg,
|
||||
cerr<<_FB_CONSOLETEXT(main, RCRequiresArg,
|
||||
"error: '-rc' requires an argument", "the -rc option requires a file argument")<<endl;;
|
||||
exit(1);
|
||||
}
|
||||
|
@ -191,7 +201,7 @@ int main(int argc, char **argv) {
|
|||
// set by the environment variable DISPLAY
|
||||
|
||||
if ((++i) >= argc) {
|
||||
cerr<<_FBTEXT(main, DISPLAYRequiresArg,
|
||||
cerr<<_FB_CONSOLETEXT(main, DISPLAYRequiresArg,
|
||||
"error: '-display' requires an argument",
|
||||
"")<<endl;
|
||||
exit(1);
|
||||
|
@ -200,7 +210,7 @@ int main(int argc, char **argv) {
|
|||
session_display = argv[i];
|
||||
std::string display_env = "DISPLAY=" + session_display;
|
||||
if (putenv(const_cast<char *>(display_env.c_str()))) {
|
||||
cerr<<_FBTEXT(main, WarnDisplayEnv,
|
||||
cerr<<_FB_CONSOLETEXT(main, WarnDisplayEnv,
|
||||
"warning: couldn't set environment variable 'DISPLAY'",
|
||||
"")<<endl;
|
||||
perror("putenv()");
|
||||
|
@ -211,13 +221,13 @@ int main(int argc, char **argv) {
|
|||
exit(0);
|
||||
} else if (strcmp(argv[i], "-log") == 0 ) {
|
||||
if (i + 1 >= argc) {
|
||||
cerr<<_FBTEXT(main, LOGRequiresArg, "error: '-log' needs an argument", "")<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(main, LOGRequiresArg, "error: '-log' needs an argument", "")<<endl;
|
||||
exit(1);
|
||||
}
|
||||
log_filename = argv[++i];
|
||||
} else if (strcmp(argv[i], "-help") == 0 || strcmp(argv[i], "-h") == 0) {
|
||||
// print program usage and command line options
|
||||
printf(_FBTEXT(main, Usage,
|
||||
printf(_FB_CONSOLETEXT(main, Usage,
|
||||
"Fluxbox %s : (c) %s Henrik Kinnunen\n"
|
||||
"Website: http://www.fluxbox.org/\n\n"
|
||||
"-display <string>\t\tuse display connection.\n"
|
||||
|
@ -252,9 +262,9 @@ int main(int argc, char **argv) {
|
|||
|
||||
// setup log file
|
||||
if (log_file) {
|
||||
cerr<<_FBTEXT(main, LoggingTo, "Logging to", "Logging to a file")<<": "<<log_filename<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(main, LoggingTo, "Logging to", "Logging to a file")<<": "<<log_filename<<endl;
|
||||
log_file<<"------------------------------------------"<<endl;
|
||||
log_file<<_FBTEXT(main, LogFile, "Log File", "")<<": "<<log_filename<<endl;
|
||||
log_file<<_FB_CONSOLETEXT(main, LogFile, "Log File", "")<<": "<<log_filename<<endl;
|
||||
showInfo(log_file);
|
||||
log_file<<"------------------------------------------"<<endl;
|
||||
// setup log to use cout and cerr stream
|
||||
|
@ -270,19 +280,19 @@ int main(int argc, char **argv) {
|
|||
exitcode = EXIT_SUCCESS;
|
||||
|
||||
} catch (std::out_of_range &oor) {
|
||||
cerr<<"Fluxbox: "<<_FBTEXT(main, ErrorOutOfRange, "Out of range", "Error message")<<": "<<oor.what()<<endl;
|
||||
cerr<<"Fluxbox: "<<_FB_CONSOLETEXT(main, ErrorOutOfRange, "Out of range", "Error message")<<": "<<oor.what()<<endl;
|
||||
} catch (std::runtime_error &re) {
|
||||
cerr<<"Fluxbox: "<<_FBTEXT(main, ErrorRuntime, "Runtime error", "Error message")<<": "<<re.what()<<endl;
|
||||
cerr<<"Fluxbox: "<<_FB_CONSOLETEXT(main, ErrorRuntime, "Runtime error", "Error message")<<": "<<re.what()<<endl;
|
||||
} catch (std::bad_cast &bc) {
|
||||
cerr<<"Fluxbox: "<<_FBTEXT(main, ErrorBadCast, "Bad cast", "Error message")<<": "<<bc.what()<<endl;
|
||||
cerr<<"Fluxbox: "<<_FB_CONSOLETEXT(main, ErrorBadCast, "Bad cast", "Error message")<<": "<<bc.what()<<endl;
|
||||
} catch (std::bad_alloc &ba) {
|
||||
cerr<<"Fluxbox: "<<_FBTEXT(main, ErrorBadAlloc, "Bad Alloc", "Error message")<<": "<<ba.what()<<endl;
|
||||
cerr<<"Fluxbox: "<<_FB_CONSOLETEXT(main, ErrorBadAlloc, "Bad Alloc", "Error message")<<": "<<ba.what()<<endl;
|
||||
} catch (std::exception &e) {
|
||||
cerr<<"Fluxbox: "<<_FBTEXT(main, ErrorStandardException, "Standard Exception", "Error message")<<": "<<e.what()<<endl;
|
||||
cerr<<"Fluxbox: "<<_FB_CONSOLETEXT(main, ErrorStandardException, "Standard Exception", "Error message")<<": "<<e.what()<<endl;
|
||||
} catch (std::string error_str) {
|
||||
cerr<<_FBTEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl;
|
||||
cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl;
|
||||
} catch (...) {
|
||||
cerr<<"Fluxbox: "<<_FBTEXT(main, ErrorUnknown, "Unknown error", "Error message")<<"."<<endl;
|
||||
cerr<<"Fluxbox: "<<_FB_CONSOLETEXT(main, ErrorUnknown, "Unknown error", "Error message")<<"."<<endl;
|
||||
abort();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue