Skip to content

Commit

Permalink
Terminal: Added "Save as defaults" back.
Browse files Browse the repository at this point in the history
* It's still convenient to have.
* Furthermore, the distinction between when settings are stored is hard
  to grasp otherwise.
* Plus, adopting the current window size is now much more straight forward.
  • Loading branch information
axeld committed Sep 3, 2015
1 parent 9a1b63b commit b7d0120
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/apps/terminal/TermConst.h
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2013, Haiku.
* Copyright 2001-2015, Haiku.
* Copyright (c) 2003-4 Kian Duffy <myob@users.sourceforge.net>
* Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
*
Expand Down Expand Up @@ -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';
Expand Down
15 changes: 12 additions & 3 deletions 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 <assimil8or@users.sourceforge.net>
* Copyright (c) 2003-2004 Kian Duffy <myob@users.sourceforge.net>
* Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit b7d0120

Please sign in to comment.