Terminal: Added "Save as defaults" back.

* 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.
This commit is contained in:
Axel Dörfler
2015-09-03 21:30:34 +02:00
parent 9a1b63b19f
commit b7d0120074
2 changed files with 14 additions and 4 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2013, Haiku.
* Copyright 2001-2015, Haiku.
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
* 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';
+12 -3
View File
@@ -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 <[email protected]>
* Copyright (c) 2003-2004 Kian Duffy <[email protected]>
* 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();