diff --git a/src/apps/terminal/TermConst.h b/src/apps/terminal/TermConst.h index ef7d704fb6..f1d965f431 100644 --- a/src/apps/terminal/TermConst.h +++ b/src/apps/terminal/TermConst.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013, Haiku. + * Copyright 2001-2015, Haiku. * Copyright (c) 2003-4 Kian Duffy * Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * @@ -71,6 +71,7 @@ static const uint32 ONETHREETWOTWENTYFIVE = 'hunv'; static const uint32 FULLSCREEN = 'fscr'; static const uint32 MSG_FONT_CHANGED = 'fntc'; +static const uint32 MSG_SAVE_AS_DEFAULT = 'sadf'; static const uint32 MSG_CHECK_CHILDREN = 'ckch'; static const uint32 MSG_REMOVE_RESIZE_VIEW_IF_NEEDED = 'rmrv'; static const uint32 MSG_TERMINAL_BUFFER_CHANGED = 'bufc'; diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index 88762c70bb..8519082097 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007-2013, Haiku, Inc. All rights reserved. + * Copyright 2007-2015, Haiku, Inc. All rights reserved. * Copyright (c) 2004 Daniel Furrer * Copyright (c) 2003-2004 Kian Duffy * Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. @@ -523,10 +523,10 @@ TermWindow::_SetupMenu() .AddItem(windowSize) .AddItem(fEncodingMenu) .AddItem(fFontSizeMenu) + .AddItem(B_TRANSLATE("Save as default"), MSG_SAVE_AS_DEFAULT) .AddSeparator() .AddItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS), MENU_PREF_OPEN) - .End() - ; + .End(); AddChild(fMenuBar); @@ -935,6 +935,15 @@ TermWindow::MessageReceived(BMessage *message) _ActiveTermView()->Invalidate(); break; } + case MSG_SAVE_AS_DEFAULT: + { + BPath path; + if (PrefHandler::GetDefaultPath(path) == B_OK) { + PrefHandler::Default()->SaveAsText(path.Path(), + PREFFILE_MIMETYPE); + } + break; + } case MENU_PAGE_SETUP: _DoPageSetup();