changeset 101321:0f6bc8e16469

* nsterm.h (EmacsPrefsController): Add -setPanelFromDefaultValues. * nsterm.m (EmacsPrefsController-setPanelFromDefaultValues) New function. (EmacsPrefsController-resetToDefaults:): Use it.
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Wed, 21 Jan 2009 18:13:26 +0000
parents 989377128d72
children 01bc4f46ab56
files src/ChangeLog src/nsterm.h src/nsterm.m
diffstat 3 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jan 21 17:58:16 2009 +0000
+++ b/src/ChangeLog	Wed Jan 21 18:13:26 2009 +0000
@@ -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)
--- a/src/nsterm.h	Wed Jan 21 17:58:16 2009 +0000
+++ b/src/nsterm.h	Wed Jan 21 18:13:26 2009 +0000
@@ -355,6 +355,7 @@
 
 - (void) showForFrame: (struct frame *)f;
 - (void) setPanelFromValues;
+- (void) setPanelFromDefaultValues;
 - (void) setValuesFromPanel;
 @end
 
--- a/src/nsterm.m	Wed Jan 21 17:58:16 2009 +0000
+++ b/src/nsterm.m	Wed Jan 21 18:13:26 2009 +0000
@@ -6090,6 +6090,7 @@
 }
 
 
+/* If you change this, change setPanelFromDefaultValues too. */
 - (void) setPanelFromValues
 {
   int cursorType
@@ -6120,6 +6121,23 @@
 }
 
 
+/* 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 @@
 
 - (IBAction)resetToDefaults: (id)sender
 {
-  ns_set_default_prefs ();
-  [self setPanelFromValues];
+  [self setPanelFromDefaultValues];
 }