From 6049d3a0bb10b1439f6d02198aebaa5215403a65 Mon Sep 17 00:00:00 2001 From: Adrian Robert Date: Wed, 21 Jan 2009 18:13:26 +0000 Subject: [PATCH] * nsterm.h (EmacsPrefsController): Add -setPanelFromDefaultValues. * nsterm.m (EmacsPrefsController-setPanelFromDefaultValues) New function. (EmacsPrefsController-resetToDefaults:): Use it. --- src/ChangeLog | 6 +++++- src/nsterm.h | 1 + src/nsterm.m | 21 +++++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 78be848beb6..b4378a7cbc2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,12 +2,16 @@ * nsmenu.m (NSMENUPROFILE): Change #if style. - * nsterm.m: (x_set_frame_alpha): Add prototype. + * nsterm.h (EmacsPrefsController): Add -setPanelFromDefaultValues. + + * nsterm.m (x_set_frame_alpha): Add prototype. (ns_fake_keydown, EmacsView-keyUp:): New variable and function to handle Ctrl-tab. (Bug#1841) (ns_get_color): Use unsigned long long for scanned hex string value. (ns_term_shutdown): Abort on non SIGTERM signals. (EmacsPrefsController-setDefaultFont:,-setColors:): Raise the frame. + (EmacsPrefsController-setPanelFromDefaultValues) New function. + (EmacsPrefsController-resetToDefaults:): Use it. (Bug#1801) * nsimage.m (EmacsImage+allocInitFromFile:): Set to ignore DPI. (Bug#1316) diff --git a/src/nsterm.h b/src/nsterm.h index e5ff6c04817..7c295edeb2d 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -355,6 +355,7 @@ along with GNU Emacs. If not, see . */ - (void) showForFrame: (struct frame *)f; - (void) setPanelFromValues; +- (void) setPanelFromDefaultValues; - (void) setValuesFromPanel; @end diff --git a/src/nsterm.m b/src/nsterm.m index e34570062c8..a8b185b538b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6090,6 +6090,7 @@ static void selectItemWithTag (NSPopUpButton *popup, int tag) } +/* If you change this, change setPanelFromDefaultValues too. */ - (void) setPanelFromValues { int cursorType @@ -6120,6 +6121,23 @@ static void selectItemWithTag (NSPopUpButton *popup, int tag) } +/* This and ns_set_default_prefs should be changed together. */ +- (void) setPanelFromDefaultValues +{ + [expandSpaceSlider setFloatValue: 0.0]; + [cursorTypeMatrix selectCellWithTag: 1]; /* filled box */ + selectItemWithTag (alternateModMenu, meta_modifier); + selectItemWithTag (commandModMenu, super_modifier); +#ifdef NS_IMPL_COCOA + selectItemWithTag (controlModMenu, ctrl_modifier); + selectItemWithTag (functionModMenu, 0); /* none */ + [smoothFontsCheck setState: YES]; + [useQuickdrawCheck setState: NO]; + [useSysHiliteCheck setState: YES]; +#endif +} + + - (void) setValuesFromPanel { int altTag = [[alternateModMenu selectedItem] tag]; @@ -6190,8 +6208,7 @@ static void selectItemWithTag (NSPopUpButton *popup, int tag) - (IBAction)resetToDefaults: (id)sender { - ns_set_default_prefs (); - [self setPanelFromValues]; + [self setPanelFromDefaultValues]; } -- 2.39.2