diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index c51fe32f60..bc17d81def 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -110,30 +110,17 @@ AppearancePrefView::AppearancePrefView(const char* name, 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) diff --git a/src/apps/terminal/Jamfile b/src/apps/terminal/Jamfile index b3a2cda52a..8575217372 100644 --- a/src/apps/terminal/Jamfile +++ b/src/apps/terminal/Jamfile @@ -26,6 +26,7 @@ Application Terminal : TermApp.cpp TerminalBuffer.cpp TerminalCharClassifier.cpp + TermConst.cpp TermParse.cpp TermScrollView.cpp TermView.cpp diff --git a/src/apps/terminal/TermConst.cpp b/src/apps/terminal/TermConst.cpp new file mode 100644 index 0000000000..bb47f939d0 --- /dev/null +++ b/src/apps/terminal/TermConst.cpp @@ -0,0 +1,31 @@ +/* + * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de. + * Distributed under the terms of the MIT License. + */ + + +#include "TermConst.h" + +#include + + +#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 '%'."); diff --git a/src/apps/terminal/TermConst.h b/src/apps/terminal/TermConst.h index 69f6039dcb..04fd34a8b4 100644 --- a/src/apps/terminal/TermConst.h +++ b/src/apps/terminal/TermConst.h @@ -134,6 +134,10 @@ static const char* const PREF_WARN_ON_EXIT = "Warn on exit"; 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,