[haiku-commits] haiku: hrev45278 - src/apps/terminal

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 13 Feb 2013 12:21:42 +0100 (CET)

hrev45278 adds 1 changeset to branch 'master'
old head: 8940ad259ab803eff8176766a73f8f531142c3b6
new head: a5b3caa295edb4064e3a560bced06ec27770c498
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=a5b3caa+%5E8940ad2

----------------------------------------------------------------------------

a5b3caa: %T placeholder (localized Terminal name) for title mask
  
  * %T placeholder added into the set, available for customizing main
    Terminal window title. It should be typically replaced by the
    application name localized for the currect system locale.
  * Use B_TRANSLATE instead of B_TRANSLATE_SYSTEM_NAME for the first
    menu entry in the main TermWindow menu. The meaning of "Terminal"
    term in this menu is the "Terminal session" but not the "Terminal
    Application" so using separate catkeys entry for this menu item
    avoids this inconsistency in Terminal UI localization;
  * Fixes #7586

                                        [ Siarzhuk Zharski <zharik@xxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45278
Commit:      a5b3caa295edb4064e3a560bced06ec27770c498
URL:         http://cgit.haiku-os.org/haiku/commit/?id=a5b3caa
Author:      Siarzhuk Zharski <zharik@xxxxxx>
Date:        Tue Feb 12 19:14:30 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/7586

----------------------------------------------------------------------------

4 files changed, 10 insertions(+), 2 deletions(-)
src/apps/terminal/PrefHandler.cpp            | 2 +-
src/apps/terminal/TermConst.cpp              | 1 +
src/apps/terminal/TermWindow.cpp             | 2 +-
src/apps/terminal/TitlePlaceholderMapper.cpp | 7 +++++++

----------------------------------------------------------------------------

diff --git a/src/apps/terminal/PrefHandler.cpp 
b/src/apps/terminal/PrefHandler.cpp
index 7c120f7..cf4f469 100644
--- a/src/apps/terminal/PrefHandler.cpp
+++ b/src/apps/terminal/PrefHandler.cpp
@@ -62,7 +62,7 @@ static const pref_defaults kTermDefaults[] = {
        { PREF_IM_AWARE,                        "0"},
 
        { PREF_TAB_TITLE,                       "%1d: %p" },
-       { PREF_WINDOW_TITLE,            "Terminal %i: %t" },
+       { PREF_WINDOW_TITLE,            "%T %i: %t" },
        { PREF_BLINK_CURSOR,            PREF_TRUE },
        { PREF_WARN_ON_EXIT,            PREF_TRUE },
 
diff --git a/src/apps/terminal/TermConst.cpp b/src/apps/terminal/TermConst.cpp
index f04adb6..e3d5efa 100644
--- a/src/apps/terminal/TermConst.cpp
+++ b/src/apps/terminal/TermConst.cpp
@@ -25,6 +25,7 @@ const char* const kTooTipSetWindowTitlePlaceholders = 
B_TRANSLATE(
        "\t%d\t-\tThe current working directory of the active process in the\n"
        "\t\t\tcurrent tab. Optionally the maximum number of path components\n"
        "\t\t\tcan be specified. E.g. '%2d' for at most two components.\n"
+       "\t%T\t-\tThe Terminal application name for the current locale.\n"
        "\t%i\t-\tThe index of the window.\n"
        "\t%p\t-\tThe name of the active process in the current tab.\n"
        "\t%t\t-\tThe title of the current tab.\n"
diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp
index cd2701f..239201d 100644
--- a/src/apps/terminal/TermWindow.cpp
+++ b/src/apps/terminal/TermWindow.cpp
@@ -465,7 +465,7 @@ TermWindow::_SetupMenu()
 
        BLayoutBuilder::Menu<>(fMenuBar = new BMenuBar(Bounds(), "mbar"))
                // Terminal
-               .AddMenu(B_TRANSLATE_SYSTEM_NAME("Terminal"))
+               .AddMenu(B_TRANSLATE("Terminal"))
                        .AddItem(B_TRANSLATE("Switch Terminals"), 
MENU_SWITCH_TERM, B_TAB)
                                .GetItem(fSwitchTerminalsMenuItem)
                        .AddItem(B_TRANSLATE("New Terminal"), MENU_NEW_TERM, 
'N')
diff --git a/src/apps/terminal/TitlePlaceholderMapper.cpp 
b/src/apps/terminal/TitlePlaceholderMapper.cpp
index 304270b..b5ec9b4 100644
--- a/src/apps/terminal/TitlePlaceholderMapper.cpp
+++ b/src/apps/terminal/TitlePlaceholderMapper.cpp
@@ -4,6 +4,8 @@
  */
 
 
+#include <Catalog.h>
+
 #include "TitlePlaceholderMapper.h"
 
 
@@ -80,6 +82,11 @@ WindowTitlePlaceholderMapper::MapPlaceholder(char 
placeholder, int64 number,
        bool numberGiven, BString& _string)
 {
        switch (placeholder) {
+               case 'T':
+                       // The Terminal application name for the current locale
+                       _string = B_TRANSLATE_SYSTEM_NAME("Terminal");
+                       return true;
+
                case 'i':
                        // window index
                        _string.Truncate(0);


Other related posts: