[haiku-commits] r39496 - haiku/trunk/src/apps/terminal

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 19 Nov 2010 12:42:47 +0100 (CET)

Author: bonefish
Date: 2010-11-19 12:42:47 +0100 (Fri, 19 Nov 2010)
New Revision: 39496
Changeset: http://dev.haiku-os.org/changeset/39496

Added:
   haiku/trunk/src/apps/terminal/TermConst.cpp
Modified:
   haiku/trunk/src/apps/terminal/AppearPrefView.cpp
   haiku/trunk/src/apps/terminal/Jamfile
   haiku/trunk/src/apps/terminal/TermConst.h
Log:
Moved the reusable  part of the tab/window title prefs tool tips to
TermConst.h/cpp.


Modified: haiku/trunk/src/apps/terminal/AppearPrefView.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/AppearPrefView.cpp    2010-11-19 11:38:45 UTC 
(rev 39495)
+++ haiku/trunk/src/apps/terminal/AppearPrefView.cpp    2010-11-19 11:42:47 UTC 
(rev 39496)
@@ -110,30 +110,17 @@
                NULL);
        fTabTitle->SetModificationMessage(
                new BMessage(MSG_TAB_TITLE_SETTING_CHANGED));
-       fTabTitle->SetToolTip(B_TRANSLATE(
+       fTabTitle->SetToolTip(BString(B_TRANSLATE(
                "The pattern specifying the tab titles. The following 
placeholders\n"
-               "can be used:\n"
-               "\t%d\t-\tThe current working directory of the active 
process.\n"
-               "\t\t\tOptionally the maximum number of path components can 
be\n"
-               "\t\t\tspecified. E.g. '%2d' for at most two components.\n"
-               "\t%i\t-\tThe index of the tab.\n"
-               "\t%p\t-\tThe name of the active process.\n"
-               "\t%%\t-\tThe character '%'."));
+               "can be used:\n")) << kTooTipSetTabTitlePlaceholders);
 
        fWindowTitle = new BTextControl("windowTitle", B_TRANSLATE("Window 
title:"),
                "", NULL);
        fWindowTitle->SetModificationMessage(
                new BMessage(MSG_WINDOW_TITLE_SETTING_CHANGED));
-       fWindowTitle->SetToolTip(B_TRANSLATE(
+       fWindowTitle->SetToolTip(BString(B_TRANSLATE(
                "The pattern specifying the window titles. The following 
placeholders\n"
-               "can be used:\n"
-               "\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%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"
-               "\t%%\t-\tThe character '%'."));
+               "can be used:\n")) << kTooTipSetWindowTitlePlaceholders);
 
        BLayoutBuilder::Group<>(this)
                .SetInsets(5, 5, 5, 5)

Modified: haiku/trunk/src/apps/terminal/Jamfile
===================================================================
--- haiku/trunk/src/apps/terminal/Jamfile       2010-11-19 11:38:45 UTC (rev 
39495)
+++ haiku/trunk/src/apps/terminal/Jamfile       2010-11-19 11:42:47 UTC (rev 
39496)
@@ -26,6 +26,7 @@
        TermApp.cpp
        TerminalBuffer.cpp
        TerminalCharClassifier.cpp
+       TermConst.cpp
        TermParse.cpp
        TermScrollView.cpp
        TermView.cpp

Added: haiku/trunk/src/apps/terminal/TermConst.cpp
===================================================================
--- haiku/trunk/src/apps/terminal/TermConst.cpp                         (rev 0)
+++ haiku/trunk/src/apps/terminal/TermConst.cpp 2010-11-19 11:42:47 UTC (rev 
39496)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2010, Ingo Weinhold, ingo_weinhold@xxxxxxx
+ * Distributed under the terms of the MIT License.
+ */
+
+
+#include "TermConst.h"
+
+#include <Catalog.h>
+
+
+#undef B_TRANSLATE_CONTEXT
+#define B_TRANSLATE_CONTEXT "Terminal ToolTips"
+
+
+const char* const kTooTipSetTabTitlePlaceholders = B_TRANSLATE(
+       "\t%d\t-\tThe current working directory of the active process.\n"
+       "\t\t\tOptionally the maximum number of path components can be\n"
+       "\t\t\tspecified. E.g. '%2d' for at most two components.\n"
+       "\t%i\t-\tThe index of the tab.\n"
+       "\t%p\t-\tThe name of the active process.\n"
+       "\t%%\t-\tThe character '%'.");
+
+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%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"
+       "\t%%\t-\tThe character '%'.");

Modified: haiku/trunk/src/apps/terminal/TermConst.h
===================================================================
--- haiku/trunk/src/apps/terminal/TermConst.h   2010-11-19 11:38:45 UTC (rev 
39495)
+++ haiku/trunk/src/apps/terminal/TermConst.h   2010-11-19 11:42:47 UTC (rev 
39496)
@@ -134,6 +134,10 @@
 static const char* const PREF_TAB_TITLE = "Tab title";
 static const char* const PREF_WINDOW_TITLE = "Window title";
 
+// shared strings
+extern const char* const kTooTipSetTabTitlePlaceholders;
+extern const char* const kTooTipSetWindowTitlePlaceholders;
+
 // Color type
 enum {
   TEXT_FOREGROUND_COLOR,


Other related posts:

  • » [haiku-commits] r39496 - haiku/trunk/src/apps/terminal - ingo_weinhold