From 46c4c36e0aa6244b292e647061d90c3ab6312f90 Mon Sep 17 00:00:00 2001 From: Marcel Dijkstra Date: Thu, 17 Jan 2013 20:51:56 +0100 Subject: Migrate to GSettings --- src/Makefile.am | 23 +- src/mate-terminal.schemas.in | 1302 ---------------------------------- src/org.mate.terminal.gschema.xml.in | 444 ++++++++++++ src/terminal-accels.c | 262 +++---- src/terminal-app.c | 368 ++++------ src/terminal-app.h | 10 +- src/terminal-dconf.c | 113 +++ src/terminal-dconf.h | 44 ++ src/terminal-encoding.c | 31 +- src/terminal-gsettings.c | 177 +++++ src/terminal-gsettings.h | 52 ++ src/terminal-profile.c | 370 ++++------ src/terminal-profile.h | 2 +- src/terminal-util.c | 64 +- src/terminal-util.h | 5 +- src/terminal-window.c | 8 +- src/terminal.c | 7 +- 17 files changed, 1323 insertions(+), 1959 deletions(-) delete mode 100644 src/mate-terminal.schemas.in create mode 100644 src/org.mate.terminal.gschema.xml.in create mode 100644 src/terminal-dconf.c create mode 100644 src/terminal-dconf.h create mode 100644 src/terminal-gsettings.c create mode 100644 src/terminal-gsettings.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index cdada83..65c26a3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,10 +23,14 @@ mate_terminal_SOURCES= \ terminal-accels.h \ terminal-app.c \ terminal-app.h \ + terminal-dconf.c \ + terminal-dconf.h \ terminal-debug.c \ terminal-debug.h \ terminal-encoding.c \ terminal-encoding.h \ + terminal-gsettings.c \ + terminal-gsettings.h \ terminal-info-bar.c \ terminal-info-bar.h \ terminal-intl.h \ @@ -76,17 +80,20 @@ mate_terminal_CPPFLAGS = \ -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES \ -DGTK_DISABLE_SINGLE_INCLUDES \ $(DISABLE_DEPRECATED) \ + $(DCONF_CFLAGS) \ $(AM_CPPFLAGS) mate_terminal_CFLAGS = \ $(TERM_CFLAGS) \ $(WARN_CFLAGS) \ + $(DCONF_CFLAGS) \ $(AM_CFLAGS) mate_terminal_LDFLAGS = -lICE mate_terminal_LDADD = \ skey/libskey.la \ + $(DCONF_LIBS) \ $(TERM_LIBS) if WITH_SMCLIENT @@ -147,9 +154,10 @@ terminal-marshal.c: $(srcdir)/terminal-marshal.list && mv terminal-marshal.c.tmp terminal-marshal.c ) \ || ( rm -f terminal-marshal.c.tmp && exit 1 ) -schemadir = $(MATECONF_SCHEMA_FILE_DIR) -schema_in_files = mate-terminal.schemas.in -schema_DATA = mate-terminal.schemas +gsettingsschema_in_files = org.mate.terminal.gschema.xml.in +gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml) +.PRECIOUS: $(gsettings_SCHEMAS) +@INTLTOOL_XML_NOMERGE_RULE@ aboutdir = $(pkgdatadir) about_DATA = \ @@ -177,6 +185,7 @@ builder_DATA = $(builder_in_files:.glade=.ui) CLEANFILES = \ stamp-terminal-type-builtins.h \ mate-terminal.schemas \ + $(gsettings_SCHEMAS) \ stamp-terminal-type-builtins.h \ $(builder_DATA) \ $(BUILT_SOURCES) @@ -188,16 +197,14 @@ EXTRA_DIST = \ extra-strings.c \ $(about_DATA) \ $(schema_in_files) \ + $(gsettingsschema_in_files) \ $(uimanager_DATA) \ $(builder_in_files) \ $(NULL) -@INTLTOOL_SCHEMAS_RULE@ +@GSETTINGS_RULES@ -if MATECONF_SCHEMAS_INSTALL -install-data-local: - MATECONF_CONFIG_SOURCE=$(MATECONF_SCHEMA_CONFIG_SOURCE) $(MATECONFTOOL) --makefile-install-rule $(top_builddir)/src/$(schema_DATA) -endif +@INTLTOOL_SCHEMAS_RULE@ %.ui: %.glade $(AM_V_GEN) $(GTK_BUILDER_CONVERT) $< $@ diff --git a/src/mate-terminal.schemas.in b/src/mate-terminal.schemas.in deleted file mode 100644 index 5eb5573..0000000 --- a/src/mate-terminal.schemas.in +++ /dev/null @@ -1,1302 +0,0 @@ - - - - - - - - - - - /schemas/apps/mate-terminal/global/profile_list - /apps/mate-terminal/global/profile_list - mate-terminal - list - string - [Default] - - List of profiles - - List of profiles known to mate-terminal. The list contains - strings naming subdirectories relative to - /apps/mate-terminal/profiles. - - - - - - /schemas/apps/mate-terminal/global/default_profile - /apps/mate-terminal/global/default_profile - mate-terminal - string - Default - - Profile to use for new terminals - - Profile to be used when opening a new window or tab. - Must be in profile_list. - - - - - - /schemas/apps/mate-terminal/global/use_mnemonics - /apps/mate-terminal/global/use_mnemonics - mate-terminal - bool - true - - Whether the menubar has access keys - - Whether to have Alt+letter access keys for the menubar. - They may interfere with some applications run inside the terminal - so it's possible to turn them off. - - - - - - /schemas/apps/mate-terminal/global/use_menu_accelerators - /apps/mate-terminal/global/use_menu_accelerators - mate-terminal - bool - true - - Whether the standard GTK shortcut for menubar access is enabled - - Normally you can access the menubar with F10. This can also - be customized via gtkrc (gtk-menu-bar-accel = - "whatever"). This option allows the standard menubar - accelerator to be disabled. - - - - - - - /schemas/apps/mate-terminal/global/active_encodings - /apps/mate-terminal/global/active_encodings - mate-terminal - list - string - - [UTF-8,current] - List of available encodings - - A subset of possible encodings are presented in - the Encoding submenu. This is a list of encodings - to appear there. The special encoding name "current" - means to display the encoding of the current locale. - - - - - - /schemas/apps/mate-terminal/global/confirm_window_close - /apps/mate-terminal/global/confirm_window_close - mate-terminal - bool - true - - Whether to ask for confirmation when closing terminal windows - - Whether to ask for confirmation when closing a terminal window which has - more than one open tab. - - - - - - - - - - - - - - /schemas/apps/mate-terminal/profiles/Default/visible_name - /apps/mate-terminal/profiles/Default/visible_name - mate-terminal - string - - Default - Human-readable name of the profile - - Human-readable name of the profile. - - - - - - /schemas/apps/mate-terminal/profiles/Default/default_show_menubar - /apps/mate-terminal/profiles/Default/default_show_menubar - mate-terminal - bool - true - - Whether to show menubar in new windows/tabs - - True if the menubar should be shown in new windows, - for windows/tabs with this profile. - - - - - - /schemas/apps/mate-terminal/profiles/Default/foreground_color - /apps/mate-terminal/profiles/Default/foreground_color - mate-terminal - string - #000000 - - Default color of text in the terminal - - Default color of text in the terminal, as a color - specification (can be HTML-style hex digits, or - a color name such as "red"). - - - - - - /schemas/apps/mate-terminal/profiles/Default/background_color - /apps/mate-terminal/profiles/Default/background_color - mate-terminal - string - #FFFFDD - - Default color of terminal background - - Default color of terminal background, as a color - specification (can be HTML-style hex digits, or - a color name such as "red"). - - - - - - /schemas/apps/mate-terminal/profiles/Default/bold_color - /apps/mate-terminal/profiles/Default/bold_color - mate-terminal - string - #000000 - - Default color of bold text in the terminal - - Default color of bold text in the terminal, as a color - specification (can be HTML-style hex digits, or - a color name such as "red"). - This is ignored if bold_color_same_as_fg is true. - - - - - - /schemas/apps/mate-terminal/profiles/Default/bold_color_same_as_fg - /apps/mate-terminal/profiles/Default/bold_color_same_as_fg - mate-terminal - bool - true - - Whether bold text should use the same color as normal text - - If true, boldface text will be rendered using the same color as - normal text. - - - - - - /schemas/apps/mate-terminal/profiles/Default/title_mode - /apps/mate-terminal/profiles/Default/title_mode - mate-terminal - string - replace - - What to do with dynamic title - - If the application in the terminal sets the title - (most typically people have their shell set up to - do this), the dynamically-set title can - erase the configured title, go before it, go after it, - or replace it. The possible values are "replace", - "before", "after", and "ignore". - - - - - - /schemas/apps/mate-terminal/profiles/Default/title - /apps/mate-terminal/profiles/Default/title - mate-terminal - string - - Terminal - Title for terminal - - Title to display for the terminal window or tab. - This title may be replaced by or combined with - the title set by the application inside the terminal, - depending on the title_mode setting. - - - - - - /schemas/apps/mate-terminal/profiles/Default/allow_bold - /apps/mate-terminal/profiles/Default/allow_bold - mate-terminal - bool - true - - Whether to allow bold text - - If true, allow applications in the terminal to make - text boldface. - - - - - - /schemas/apps/mate-terminal/profiles/Default/silent_bell - /apps/mate-terminal/profiles/Default/silent_bell - mate-terminal - bool - false - - Whether to silence terminal bell - - If true, don't make a noise when applications send the - escape sequence for the terminal bell. - - - - - - /schemas/apps/mate-terminal/profiles/Default/word_chars - /apps/mate-terminal/profiles/Default/word_chars - mate-terminal - string - -A-Za-z0-9,./?%&#:_=+@~ - - Characters that are considered "part of a word" - - When selecting text by word, sequences of these characters - are considered single words. Ranges can be given as - "A-Z". Literal hyphen (not expressing a range) should be - the first character given. - - - - - - /schemas/apps/mate-terminal/profiles/Default/use_custom_default_size - /apps/mate-terminal/profiles/Default/use_custom_default_size - mate-terminal - bool - false - - Whether to use custom terminal size for new windows - - If true, newly created terminal windows will have custom - size specified by default_size_columns and default_size_rows. - - - - - /schemas/apps/mate-terminal/profiles/Default/default_size_columns - /apps/mate-terminal/profiles/Default/default_size_columns - mate-terminal - int - 80 - - Default number of columns - - Number of columns in newly created terminal windows. - Has no effect if use_custom_default_size is not enabled. - - - - - - /schemas/apps/mate-terminal/profiles/Default/default_size_rows - /apps/mate-terminal/profiles/Default/default_size_rows - mate-terminal - int - 24 - - Default number of rows - - Number of rows in newly created terminal windows. - Has no effect if use_custom_default_size is not enabled. - - - - - - /schemas/apps/mate-terminal/profiles/Default/scrollbar_position - /apps/mate-terminal/profiles/Default/scrollbar_position - mate-terminal - string - right - - Position of the scrollbar - - Where to put the terminal scrollbar. Possibilities are - "left", "right", and "hidden". - - - - - - /schemas/apps/mate-terminal/profiles/Default/scrollback_lines - /apps/mate-terminal/profiles/Default/scrollback_lines - mate-terminal - int - 512 - - Number of lines to keep in scrollback - - Number of scrollback lines to keep around. You can - scroll back in the terminal by this number of lines; - lines that don't fit in the scrollback are discarded. - If scrollback_unlimited is true, this value is ignored. - - - - - - /schemas/apps/mate-terminal/profiles/Default/scrollback_unlimited - /apps/mate-terminal/profiles/Default/scrollback_unlimited - mate-terminal - bool - false - - Whether an unlimited number of lines should be kept in scrollback - - If true, scrollback lines will never be discarded. The scrollback - history is stored on disk temporarily, so this may cause the system - to run out of disk space if there is a lot of output to the - terminal. - - - - - - /schemas/apps/mate-terminal/profiles/Default/scroll_on_keystroke - /apps/mate-terminal/profiles/Default/scroll_on_keystroke - mate-terminal - bool - true - - Whether to scroll to the bottom when a key is pressed - - If true, pressing a key jumps the scrollbar to the bottom. - - - - - - /schemas/apps/mate-terminal/profiles/Default/scroll_on_output - /apps/mate-terminal/profiles/Default/scroll_on_output - mate-terminal - bool - false - - Whether to scroll to the bottom when there's new output - - If true, whenever there's new output the terminal will scroll - to the bottom. - - - - - - /schemas/apps/mate-terminal/profiles/Default/exit_action - /apps/mate-terminal/profiles/Default/exit_action - mate-terminal - string - close - - What to do with the terminal when the child command exits - - Possible values are "close" to close the terminal, and - "restart" to restart the command. - - - - - - /schemas/apps/mate-terminal/profiles/Default/login_shell - /apps/mate-terminal/profiles/Default/login_shell - mate-terminal - bool - false - - Whether to launch the command in the terminal as a login shell - - If true, the command inside the terminal will be launched as - a login shell. (argv[0] will have a hyphen in front of it.) - - - - - - /schemas/apps/mate-terminal/profiles/Default/update_records - /apps/mate-terminal/profiles/Default/update_records - mate-terminal - bool - true - - Whether to update login records when launching terminal command - - If true, the system login records utmp and wtmp will be updated when the command inside the terminal - is launched. - - - - - - /schemas/apps/mate-terminal/profiles/Default/use_custom_command - /apps/mate-terminal/profiles/Default/use_custom_command - mate-terminal - bool - false - - Whether to run a custom command instead of the shell - - If true, the value of the custom_command setting will - be used in place of running a shell. - - - - - - /schemas/apps/mate-terminal/profiles/Default/cursor_blink_mode - /apps/mate-terminal/profiles/Default/cursor_blink_mode - mate-terminal - string - system - - Whether to blink the cursor - - The possible values are "system" to use the global cursor blinking - settings, or "on" or "off" to set the mode explicitly. - - - - - - /schemas/apps/mate-terminal/profiles/Default/cursor_shape - /apps/mate-terminal/profiles/Default/cursor_shape - mate-terminal - string - block - - The cursor appearance - - The possible values are "block" to use a block cursor, "ibeam" to - use a vertical line cursor, or "underline" to use an underline cursor. - - - - - - /schemas/apps/mate-terminal/profiles/Default/custom_command - /apps/mate-terminal/profiles/Default/custom_command - mate-terminal - string - - - Custom command to use instead of the shell - - Run this command in place of the shell, if - use_custom_command is true. - - - - - - /schemas/apps/mate-terminal/profiles/Default/icon - /apps/mate-terminal/profiles/Default/icon - mate-terminal - string - - - Icon for terminal window - - Icon to use for tabs/windows containing this profile. - - - - - - /schemas/apps/mate-terminal/profiles/Default/palette - /apps/mate-terminal/profiles/Default/palette - mate-terminal - string - #2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC - - Palette for terminal applications - - Terminals have a 16-color palette that applications inside - the terminal can use. This is that palette, in the form - of a colon-separated list of color names. Color names - should be in hex format e.g. "#FF00FF" - - - - - - /schemas/apps/mate-terminal/profiles/Default/font - /apps/mate-terminal/profiles/Default/font - mate-terminal - string - Monospace 12 - - Font - - An Pango font name. Examples are "Sans 12" or "Monospace Bold 14". - - - - - - /schemas/apps/mate-terminal/profiles/Default/background_type - /apps/mate-terminal/profiles/Default/background_type - mate-terminal - string - solid - - Background type - - Type of terminal background. May be "solid" for a solid color, - "image" for an image, or "transparent" for either real transparency if - a compositing window manager is running, or pseudo-transparency - otherwise. - - - - - - /schemas/apps/mate-terminal/profiles/Default/background_image - /apps/mate-terminal/profiles/Default/background_image - mate-terminal - string - - - Background image - - Filename of a background image. - - - - - - /schemas/apps/mate-terminal/profiles/Default/scroll_background - /apps/mate-terminal/profiles/Default/scroll_background - mate-terminal - bool - true - - Whether to scroll background image - - If true, scroll the background image with the foreground - text; if false, keep the image in a fixed position and - scroll the text above it. - - - - - - /schemas/apps/mate-terminal/profiles/Default/background_darkness - /apps/mate-terminal/profiles/Default/background_darkness - mate-terminal - float - 0.5 - - How much to darken the background image - - A value between 0.0 and 1.0 indicating how much to darken - the background image. 0.0 means no darkness, 1.0 means fully - dark. In the current implementation, there are only two levels of - darkness possible, so the setting behaves as a boolean, - where 0.0 disables the darkening effect. - - - - - - /schemas/apps/mate-terminal/profiles/Default/backspace_binding - /apps/mate-terminal/profiles/Default/backspace_binding - mate-terminal - string - ascii-del - - Effect of the Backspace key - - Sets what code the backspace key generates. Possible values - are "ascii-del" for the ASCII DEL character, - "control-h" for Control-H (AKA the ASCII BS character), - "escape-sequence" for the escape sequence typically - bound to backspace or delete. "ascii-del" is normally - considered the correct setting for the Backspace key. - - - - - - - /schemas/apps/mate-terminal/profiles/Default/delete_binding - /apps/mate-terminal/profiles/Default/delete_binding - mate-terminal - string - escape-sequence - - Effect of the Delete key - - Sets what code the delete key generates. Possible values - are "ascii-del" for the ASCII DEL character, - "control-h" for Control-H (AKA the ASCII BS character), - "escape-sequence" for the escape sequence typically - bound to backspace or delete. "escape-sequence" is normally - considered the correct setting for the Delete key. - - - - - - - /schemas/apps/mate-terminal/profiles/Default/use_theme_colors - /apps/mate-terminal/profiles/Default/use_theme_colors - mate-terminal - bool - true - - Whether to use the colors from the theme for the terminal widget - - If true, the theme color scheme used for text entry boxes will - be used for the terminal, instead of colors provided by the user. - - - - - - /schemas/apps/mate-terminal/profiles/Default/use_system_font - /apps/mate-terminal/profiles/Default/use_system_font - mate-terminal - bool - true - - Whether to use the system font - - If true, the terminal will use the desktop-global standard - font if it's monospace (and the most similar font it can - come up with otherwise). - - - - - - /schemas/apps/mate-terminal/profiles/Default/use_skey - /apps/mate-terminal/profiles/Default/use_skey - mate-terminal - bool - true - - Highlight S/Key challenges - Popup a dialog when an S/Key challenge response query is - detected and clicked on. Typing a password into the dialog - will send it to the terminal. - - - - - - - - /schemas/apps/mate-terminal/keybindings/new_tab - /apps/mate-terminal/keybindings/new_tab - mate-terminal - string - <Ctrl><Shift>t - - Keyboard shortcut to open a new tab - - Keyboard shortcut key for opening a new tab. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/new_window - /apps/mate-terminal/keybindings/new_window - mate-terminal - string - <Ctrl><Shift>n - - Keyboard shortcut to open a new window - - Keyboard shortcut key for opening a new window. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/new_profile - /apps/mate-terminal/keybindings/new_profile - mate-terminal - string - - Keyboard shortcut to create a new profile - - Keyboard shortcut key for bringing up the dialog for profile - creation. Expressed as a string in the same format used for - GTK+ resource files. If you set the option to the special - string "disabled", then there will be no keyboard shortcut for this - action. - - - - - - /schemas/apps/mate-terminal/keybindings/save_contents - /apps/mate-terminal/keybindings/save_contents - mate-terminal - string - disabled - - Keyboard shortcut to save the current tab contents to file - - Keyboard shortcut key to save the current tab contents to a file. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/close_tab - /apps/mate-terminal/keybindings/close_tab - mate-terminal - string - <Ctrl><Shift>w - - Keyboard shortcut to close a tab - - Keyboard shortcut key for closing a tab. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/close_window - /apps/mate-terminal/keybindings/close_window - mate-terminal - string - <Ctrl><Shift>q - - Keyboard shortcut to close a window - - Keyboard shortcut key for closing a window. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - - /schemas/apps/mate-terminal/keybindings/copy - /apps/mate-terminal/keybindings/copy - mate-terminal - string - <Ctrl><Shift>c - - Keyboard shortcut to copy text - - Keyboard shortcut key for copying selected text to the - clipboard. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - - /schemas/apps/mate-terminal/keybindings/paste - /apps/mate-terminal/keybindings/paste - mate-terminal - string - <Ctrl><Shift>v - - Keyboard shortcut to paste text - - Keyboard shortcut key for pasting the contents of the - clipboard into the terminal. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/full_screen - /apps/mate-terminal/keybindings/full_screen - mate-terminal - string - F11 - - Keyboard shortcut to toggle full screen mode - - Keyboard shortcut key for toggling full screen mode. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - /schemas/apps/mate-terminal/keybindings/toggle_menubar - /apps/mate-terminal/keybindings/toggle_menubar - mate-terminal - string - - Keyboard shortcut to toggle the visibility of the menubar - - Keyboard shortcut key to toggle the visibility of the menubar. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/set_terminal_title - /apps/mate-terminal/keybindings/set_terminal_title - mate-terminal - string - - Keyboard shortcut to set the terminal title - - Keyboard shortcut key to set the terminal title. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/reset - /apps/mate-terminal/keybindings/reset - mate-terminal - string - - Keyboard shortcut to reset the terminal - - Keyboard shortcut key to reset the terminal. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/reset_and_clear - /apps/mate-terminal/keybindings/reset_and_clear - mate-terminal - string - - Keyboard shortcut to reset and clear the terminal - - Keyboard shortcut key to reset and clear the terminal. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/prev_tab - /apps/mate-terminal/keybindings/prev_tab - mate-terminal - string - <Control>Page_Up - - Keyboard shortcut to switch to the previous tab - - Keyboard shortcut key to switch to the previous tab. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/next_tab - /apps/mate-terminal/keybindings/next_tab - mate-terminal - string - <Control>Page_Down - - Keyboard shortcut to switch to the next tab - - Keyboard shortcut key to switch to the next tab. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/move_tab_left - /apps/mate-terminal/keybindings/move_tab_left - mate-terminal - string - <Ctrl><Shift>Page_Up - - Accelerator to move the current tab to the left. - - Accelerator key to move the current tab to the left. Expressed as a - string in the same format used for GTK+ resource files. If you set - the option to the special string "disabled", then there will be no - keybinding for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/move_tab_right - /apps/mate-terminal/keybindings/move_tab_right - mate-terminal - string - <Ctrl><Shift>Page_Down - - Accelerator to move the current tab to the right. - - Accelerator key to move the current tab to the right. Expressed as a - string in the same format used for GTK+ resource files. If you set - the option to the special string "disabled", then there will be no - keybinding for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/detach_tab - /apps/mate-terminal/keybindings/detach_tab - mate-terminal - string - - Accelerator to detach current tab. - - Accelerator key to detach current tab. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keybinding for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_1 - /apps/mate-terminal/keybindings/switch_to_tab_1 - mate-terminal - string - <Alt>1 - - Keyboard shortcut to switch to tab 1 - - Keyboard shortcut key for switch to tab 1. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_2 - /apps/mate-terminal/keybindings/switch_to_tab_2 - mate-terminal - string - <Alt>2 - - Keyboard shortcut to switch to tab 2 - - Keyboard shortcut key for switch to tab 2. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_3 - /apps/mate-terminal/keybindings/switch_to_tab_3 - mate-terminal - string - <Alt>3 - - Keyboard shortcut to switch to tab 3 - - Keyboard shortcut key for switch to tab 3. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_4 - /apps/mate-terminal/keybindings/switch_to_tab_4 - mate-terminal - string - <Alt>4 - - Keyboard shortcut to switch to tab 4 - - Keyboard shortcut key for switch to tab 4. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_5 - /apps/mate-terminal/keybindings/switch_to_tab_5 - mate-terminal - string - <Alt>5 - - Keyboard shortcut to switch to tab 5 - - Keyboard shortcut key for switch to tab 5. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_6 - /apps/mate-terminal/keybindings/switch_to_tab_6 - mate-terminal - string - <Alt>6 - - Keyboard shortcut to switch to tab 6 - - Keyboard shortcut key for switch to tab 6. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_7 - /apps/mate-terminal/keybindings/switch_to_tab_7 - mate-terminal - string - <Alt>7 - - Keyboard shortcut to switch to tab 7 - - Keyboard shortcut key for switch to tab 7. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_8 - /apps/mate-terminal/keybindings/switch_to_tab_8 - mate-terminal - string - <Alt>8 - - Keyboard shortcut to switch to tab 8 - - Keyboard shortcut key for switch to tab 8. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_9 - /apps/mate-terminal/keybindings/switch_to_tab_9 - mate-terminal - string - <Alt>9 - - Keyboard shortcut to switch to tab 9 - - Keyboard shortcut key for switch to tab 9. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_10 - /apps/mate-terminal/keybindings/switch_to_tab_10 - mate-terminal - string - <Alt>0 - - Keyboard shortcut to switch to tab 10 - - Keyboard shortcut key for switch to tab 10. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_11 - /apps/mate-terminal/keybindings/switch_to_tab_11 - mate-terminal - string - - - Keyboard shortcut to switch to tab 11 - - Keyboard shortcut key for switch to tab 11. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/switch_to_tab_12 - /apps/mate-terminal/keybindings/switch_to_tab_12 - mate-terminal - string - - - Keyboard shortcut to switch to tab 12 - - Keyboard shortcut key for switch to tab 12. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/help - /apps/mate-terminal/keybindings/help - mate-terminal - string - F1 - - Keyboard shortcut to launch help - - Keyboard shortcut key for launching help. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/zoom_in - /apps/mate-terminal/keybindings/zoom_in - mate-terminal - string - <Ctrl>plus - - Keyboard shortcut to make font larger - - Keyboard shortcut key for making font larger. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/zoom_out - /apps/mate-terminal/keybindings/zoom_out - mate-terminal - string - <Ctrl>minus - - Keyboard shortcut to make font smaller - - Keyboard shortcut key for making font smaller. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - /schemas/apps/mate-terminal/keybindings/zoom_normal - /apps/mate-terminal/keybindings/zoom_normal - mate-terminal - string - <Ctrl>0 - - Keyboard shortcut to make font normal-size - - Keyboard shortcut key for making font the normal size. Expressed as a string - in the same format used for GTK+ resource files. - If you set the option to the special string "disabled", then there - will be no keyboard shortcut for this action. - - - - - - diff --git a/src/org.mate.terminal.gschema.xml.in b/src/org.mate.terminal.gschema.xml.in new file mode 100644 index 0000000..4d7beae --- /dev/null +++ b/src/org.mate.terminal.gschema.xml.in @@ -0,0 +1,444 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ 'default' ] + List of profiles + List of profiles known to mate-terminal. The list contains strings naming subdirectories relative to /org/mate/terminal/profiles. + + + 'default' + Profile to use for new terminals + Profile to be used when opening a new window or tab. Must be in profile_list. + + + true + Whether the menubar has access keys + Whether to have Alt+letter access keys for the menubar. They may interfere with some applications run inside the terminal so it's possible to turn them off. + + + true + Whether the standard GTK shortcut for menubar access is enabled + Normally you can access the menubar with F10. This can also be customized via gtkrc (gtk-menu-bar-accel = "whatever"). This option allows the standard menubar accelerator to be disabled. + + + [ 'UTF-8', 'current' ] + List of available encodings + A subset of possible encodings are presented in the Encoding submenu. This is a list of encodings to appear there. The special encoding name "current" means to display the encoding of the current locale. + + + true + Whether to ask for confirmation when closing terminal windows + Whether to ask for confirmation when closing a terminal window which has more than one open tab. + + + + + + + 'Default' + Human-readable name of the profile + Human-readable name of the profile. + + + true + Whether to show menubar in new windows/tabs + True if the menubar should be shown in new windows, for windows/tabs with this profile. + + + '#000000' + Default color of text in the terminal + Default color of text in the terminal, as a color specification (can be HTML-style hex digits, or a color name such as "red"). + + + '#FFFFDD' + Default color of terminal background + Default color of terminal background, as a color specification (can be HTML-style hex digits, or a color name such as "red"). + + + '#000000' + Default color of bold text in the terminal + Default color of bold text in the terminal, as a color specification (can be HTML-style hex digits, or a color name such as "red"). This is ignored if bold_color_same_as_fg is true. + + + true + Whether bold text should use the same color as normal text + If true, boldface text will be rendered using the same color as normal text. + + + 'replace' + What to do with dynamic title + If the application in the terminal sets the title (most typically people have their shell set up to do this), the dynamically-set title can erase the configured title, go before it, go after it, or replace it. The possible values are "replace", "before", "after", and "ignore". + + + 'Terminal' + Title for terminal + Title to display for the terminal window or tab. This title may be replaced by or combined with the title set by the application inside the terminal, depending on the title_mode setting. + + + true + Whether to allow bold text + If true, allow applications in the terminal to make text boldface. + + + false + Whether to silence terminal bell + If true, don't make a noise when applications send the escape sequence for the terminal bell. + + + '-A-Za-z0-9,./?%&#:_=+@~' + Characters that are considered "part of a word" + When selecting text by word, sequences of these characters are considered single words. Ranges can be given as "A-Z". Literal hyphen (not expressing a range) should be the first character given. + + + false + Whether to use custom terminal size for new windows + If true, newly created terminal windows will have custom size specified by default_size_columns and default_size_rows. + + + 80 + Default number of columns + Number of columns in newly created terminal windows. Has no effect if use_custom_default_size is not enabled. + + + 24 + Default number of rows + Number of rows in newly created terminal windows. Has no effect if use_custom_default_size is not enabled. + + + 'right' + Position of the scrollbar + Where to put the terminal scrollbar. Possibilities are "left", "right", and "hidden". + + + 512 + Number of lines to keep in scrollback + Number of scrollback lines to keep around. You can scroll back in the terminal by this number of lines; lines that don't fit in the scrollback are discarded. If scrollback_unlimited is true, this value is ignored. + + + false + Whether an unlimited number of lines should be kept in scrollback + If true, scrollback lines will never be discarded. The scrollback history is stored on disk temporarily, so this may cause the system to run out of disk space if there is a lot of output to the terminal. + + + true + Whether to scroll to the bottom when a key is pressed + If true, pressing a key jumps the scrollbar to the bottom. + + + false + Whether to scroll to the bottom when there's new output + If true, whenever there's new output the terminal will scroll to the bottom. + + + 'close' + What to do with the terminal when the child command exits + Possible values are "close" to close the terminal, and "restart" to restart the command. + + + false + Whether to launch the command in the terminal as a login shell + If true, the command inside the terminal will be launched as a login shell. (argv[0] will have a hyphen in front of it.) + + + true + Whether to update login records when launching terminal command + If true, the system login records utmp and wtmp will be updated when the command inside the terminal is launched. + + + false + Whether to run a custom command instead of the shell + If true, the value of the custom_command setting will be used in place of running a shell. + + + 'system' + Whether to blink the cursor + The possible values are "system" to use the global cursor blinking settings, or "on" or "off" to set the mode explicitly. + + + 'block' + The cursor appearance + The possible values are "block" to use a block cursor, "ibeam" to use a vertical line cursor, or "underline" to use an underline cursor. + + + '' + Custom command to use instead of the shell + Run this command in place of the shell, if use_custom_command is true. + + + '' + Icon for terminal window + Icon to use for tabs/windows containing this profile. + + + '#2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC' + Palette for terminal applications + Terminals have a 16-color palette that applications inside the terminal can use. This is that palette, in the form of a colon-separated list of color names. Color names should be in hex format e.g. "#FF00FF" + + + 'Monospace 12' + Font + An Pango font name. Examples are "Sans 12" or "Monospace Bold 14". + + + 'solid' + Background type + Type of terminal background. May be "solid" for a solid color, "image" for an image, or "transparent" for either real transparency if a compositing window manager is running, or pseudo-transparency otherwise. + + + '' + Background image + Filename of a background image. + + + true + Whether to scroll background image + If true, scroll the background image with the foreground text; if false, keep the image in a fixed position and scroll the text above it. + + + 0.5 + How much to darken the background image + A value between 0.0 and 1.0 indicating how much to darken the background image. 0.0 means no darkness, 1.0 means fully dark. In the current implementation, there are only two levels of darkness possible, so the setting behaves as a boolean, where 0.0 disables the darkening effect. + + + 'ascii-del' + Effect of the Backspace key + Sets what code the backspace key generates. Possible values are "ascii-del" for the ASCII DEL character, "control-h" for Control-H (AKA the ASCII BS character), "escape-sequence" for the escape sequence typically bound to backspace or delete. "ascii-del" is normally considered the correct setting for the Backspace key. + + + 'escape-sequence' + Effect of the Delete key + Sets what code the delete key generates. Possible values are "ascii-del" for the ASCII DEL character, "control-h" for Control-H (AKA the ASCII BS character), "escape-sequence" for the escape sequence typically bound to backspace or delete. "escape-sequence" is normally considered the correct setting for the Delete key. + + + true + Whether to use the colors from the theme for the terminal widget + If true, the theme color scheme used for text entry boxes will be used for the terminal, instead of colors provided by the user. + + + true + Whether to use the system font + If true, the terminal will use the desktop-global standard font if it's monospace (and the most similar font it can come up with otherwise). + + + true + Highlight S/Key challenges + Popup a dialog when an S/Key challenge response query is detected and clicked on. Typing a password into the dialog will send it to the terminal. + + + + + '<Ctrl><Shift>t' + Keyboard shortcut to open a new tab + Keyboard shortcut key for opening a new tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl><Shift>n' + Keyboard shortcut to open a new window + Keyboard shortcut key for opening a new window. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to create a new profile + Keyboard shortcut key for bringing up the dialog for profile creation. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to save the current tab contents to file + Keyboard shortcut key to save the current tab contents to a file. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl><Shift>w' + Keyboard shortcut to close a tab + Keyboard shortcut key for closing a tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl><Shift>q' + Keyboard shortcut to close a window + Keyboard shortcut key for closing a window. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl><Shift>c' + Keyboard shortcut to copy text + Keyboard shortcut key for copying selected text to the clipboard. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl><Shift>v' + Keyboard shortcut to paste text + Keyboard shortcut key for pasting the contents of the clipboard into the terminal. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'F11' + Keyboard shortcut to toggle full screen mode + Keyboard shortcut key for toggling full screen mode. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to toggle the visibility of the menubar + Keyboard shortcut key to toggle the visibility of the menubar. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to set the terminal title + Keyboard shortcut key to set the terminal title. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to reset the terminal + Keyboard shortcut key to reset the terminal. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to reset and clear the terminal + Keyboard shortcut key to reset and clear the terminal. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Control>Page_Up' + Keyboard shortcut to switch to the previous tab + Keyboard shortcut key to switch to the previous tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Control>Page_Down' + Keyboard shortcut to switch to the next tab + Keyboard shortcut key to switch to the next tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl><Shift>Page_Up' + Accelerator to move the current tab to the left. + Accelerator key to move the current tab to the left. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keybinding for this action. + + + '<Ctrl><Shift>Page_Down' + Accelerator to move the current tab to the right. + Accelerator key to move the current tab to the right. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keybinding for this action. + + + 'disabled' + Accelerator to detach current tab. + Accelerator key to detach current tab. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keybinding for this action. + + + '<Alt>1' + Keyboard shortcut to switch to tab 1 + Keyboard shortcut key for switch to tab 1. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>2' + Keyboard shortcut to switch to tab 2 + Keyboard shortcut key for switch to tab 2. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>3' + Keyboard shortcut to switch to tab 3 + Keyboard shortcut key for switch to tab 3. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>4' + Keyboard shortcut to switch to tab 4 + Keyboard shortcut key for switch to tab 4. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>5' + Keyboard shortcut to switch to tab 5 + Keyboard shortcut key for switch to tab 5. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>6' + Keyboard shortcut to switch to tab 6 + Keyboard shortcut key for switch to tab 6. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>7' + Keyboard shortcut to switch to tab 7 + Keyboard shortcut key for switch to tab 7. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>8' + Keyboard shortcut to switch to tab 8 + Keyboard shortcut key for switch to tab 8. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>9' + Keyboard shortcut to switch to tab 9 + Keyboard shortcut key for switch to tab 9. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Alt>0' + Keyboard shortcut to switch to tab 10 + Keyboard shortcut key for switch to tab 10. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to switch to tab 11 + Keyboard shortcut key for switch to tab 11. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'disabled' + Keyboard shortcut to switch to tab 12 + Keyboard shortcut key for switch to tab 12. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + 'F1' + Keyboard shortcut to launch help + Keyboard shortcut key for launching help. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl>plus' + Keyboard shortcut to make font larger + Keyboard shortcut key for making font larger. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl>minus' + Keyboard shortcut to make font smaller + Keyboard shortcut key for making font smaller. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + '<Ctrl>0' + Keyboard shortcut to make font normal-size + Keyboard shortcut key for making font the normal size. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action. + + + diff --git a/src/terminal-accels.c b/src/terminal-accels.c index 7f93ac4..44b003b 100644 --- a/src/terminal-accels.c +++ b/src/terminal-accels.c @@ -31,18 +31,18 @@ /* NOTES * - * There are two sources of keybindings changes, from MateConf and from + * There are two sources of keybindings changes, from GSettings and from * the accel map (happens with in-place menu editing). * - * When a keybinding mateconf key changes, we propagate that into the + * When a keybinding GSettins key changes, we propagate that into the * accel map. - * When the accel map changes, we queue a sync to mateconf. + * When the accel map changes, we queue a sync to GSettings. * * To avoid infinite loops, we short-circuit in both directions * if the value is unchanged from last known. * * In the keybinding editor, when editing or clearing an accel, we write - * the change directly to mateconf and rely on the mateconf callback to + * the change directly to GSettings and rely on the GSettings callback to * actually apply the change to the accel map. */ @@ -71,29 +71,29 @@ #define ACCEL_PATH_DETACH_TAB ACCEL_PATH_ROOT "TabsDetach" #define ACCEL_PATH_SWITCH_TAB_PREFIX ACCEL_PATH_ROOT "TabsSwitch" -#define KEY_CLOSE_TAB CONF_KEYS_PREFIX "/close_tab" -#define KEY_CLOSE_WINDOW CONF_KEYS_PREFIX "/close_window" -#define KEY_COPY CONF_KEYS_PREFIX "/copy" -#define KEY_DETACH_TAB CONF_KEYS_PREFIX "/detach_tab" -#define KEY_FULL_SCREEN CONF_KEYS_PREFIX "/full_screen" -#define KEY_HELP CONF_KEYS_PREFIX "/help" -#define KEY_MOVE_TAB_LEFT CONF_KEYS_PREFIX "/move_tab_left" -#define KEY_MOVE_TAB_RIGHT CONF_KEYS_PREFIX "/move_tab_right" -#define KEY_NEW_PROFILE CONF_KEYS_PREFIX "/new_profile" -#define KEY_NEW_TAB CONF_KEYS_PREFIX "/new_tab" -#define KEY_NEW_WINDOW CONF_KEYS_PREFIX "/new_window" -#define KEY_NEXT_TAB CONF_KEYS_PREFIX "/next_tab" -#define KEY_PASTE CONF_KEYS_PREFIX "/paste" -#define KEY_PREV_TAB CONF_KEYS_PREFIX "/prev_tab" -#define KEY_RESET_AND_CLEAR CONF_KEYS_PREFIX "/reset_and_clear" -#define KEY_RESET CONF_KEYS_PREFIX "/reset" -#define KEY_SAVE_CONTENTS CONF_KEYS_PREFIX "/save_contents" -#define KEY_SET_TERMINAL_TITLE CONF_KEYS_PREFIX "/set_window_title" -#define KEY_TOGGLE_MENUBAR CONF_KEYS_PREFIX "/toggle_menubar" -#define KEY_ZOOM_IN CONF_KEYS_PREFIX "/zoom_in" -#define KEY_ZOOM_NORMAL CONF_KEYS_PREFIX "/zoom_normal" -#define KEY_ZOOM_OUT CONF_KEYS_PREFIX "/zoom_out" -#define KEY_SWITCH_TAB_PREFIX CONF_KEYS_PREFIX "/switch_to_tab_" +#define KEY_CLOSE_TAB "close-tab" +#define KEY_CLOSE_WINDOW "close-window" +#define KEY_COPY "copy" +#define KEY_DETACH_TAB "detach-tab" +#define KEY_FULL_SCREEN "full-screen" +#define KEY_HELP "help" +#define KEY_MOVE_TAB_LEFT "move-tab-left" +#define KEY_MOVE_TAB_RIGHT "move-tab-right" +#define KEY_NEW_PROFILE "new-profile" +#define KEY_NEW_TAB "new-tab" +#define KEY_NEW_WINDOW "new-window" +#define KEY_NEXT_TAB "next-tab" +#define KEY_PASTE "paste" +#define KEY_PREV_TAB "prev-tab" +#define KEY_RESET_AND_CLEAR "reset-and-clear" +#define KEY_RESET "reset" +#define KEY_SAVE_CONTENTS "save-contents" +#define KEY_SET_TERMINAL_TITLE "set-terminal-title" +#define KEY_TOGGLE_MENUBAR "toggle-menubar" +#define KEY_ZOOM_IN "zoom-in" +#define KEY_ZOOM_NORMAL "zoom-normal" +#define KEY_ZOOM_OUT "zoom-out" +#define KEY_SWITCH_TAB_PREFIX "switch-to-tab-" #if 1 /* @@ -112,14 +112,14 @@ typedef struct { const char *user_visible_name; - const char *mateconf_key; + const char *gsettings_key; const char *accel_path; - /* last values received from mateconf */ - GdkModifierType mateconf_mask; - guint mateconf_keyval; + /* last values received from GSettings */ + GdkModifierType gsettings_mask; + guint gsettings_keyval; GClosure *closure; /* have gotten a notification from gtk */ - gboolean needs_mateconf_sync; + gboolean needs_gsettings_sync; gboolean accel_path_unlocked; } KeyEntry; @@ -318,10 +318,9 @@ enum N_COLUMNS }; -static void keys_change_notify (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, - gpointer user_data); +static void keys_change_notify (GSettings *settings, + gchar *key, + gpointer user_data); static void accel_changed_callback (GtkAccelGroup *accel_group, guint keyval, @@ -333,7 +332,7 @@ static gboolean binding_from_string (const char *str, guint *accelerator_key, GdkModifierType *accelerator_mods); -static gboolean binding_from_value (MateConfValue *value, +static gboolean binding_from_value (GVariant *value, guint *accelerator_key, GdkModifierType *accelerator_mods); @@ -341,12 +340,12 @@ static gboolean sync_idle_cb (gpointer data); static guint sync_idle_id = 0; static GtkAccelGroup *notification_group = NULL; -/* never set mateconf keys in response to receiving a mateconf notify. */ -static int inside_mateconf_notify = 0; +/* never set GSettings keys in response to receiving a GSettings notify. */ +static int inside_gsettings_notify = 0; static GtkWidget *edit_keys_dialog = NULL; static GtkTreeStore *edit_keys_store = NULL; -static guint mateconf_notify_id; -static GHashTable *mateconf_key_to_entry; +static GHashTable *gsettings_key_to_entry; +static GSettings *settings_keybindings; static char* binding_name (guint keyval, @@ -368,33 +367,19 @@ binding_display_name (guint keyval, return g_strdup (_("Disabled")); } -static const char * -key_from_mateconf_key (const char *mateconf_key) -{ - const char *last_slash = strrchr (mateconf_key, '/'); - if (last_slash) - return ++last_slash; - return NULL; -} - void terminal_accels_init (void) { - MateConfClient *conf; guint i, j; - conf = mateconf_client_get_default (); + settings_keybindings = g_settings_new (CONF_KEYS_SCHEMA); - mateconf_client_add_dir (conf, CONF_KEYS_PREFIX, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - mateconf_notify_id = - mateconf_client_notify_add (conf, - CONF_KEYS_PREFIX, - keys_change_notify, - NULL, NULL, NULL); + g_signal_connect (settings_keybindings, + "changed", + G_CALLBACK(keys_change_notify), + NULL); - mateconf_key_to_entry = g_hash_table_new (g_str_hash, g_str_equal); + gsettings_key_to_entry = g_hash_table_new (g_str_hash, g_str_equal); notification_group = gtk_accel_group_new (); @@ -406,8 +391,8 @@ terminal_accels_init (void) key_entry = &(all_entries[i].key_entry[j]); - g_hash_table_insert (mateconf_key_to_entry, - (gpointer) key_from_mateconf_key (key_entry->mateconf_key), + g_hash_table_insert (gsettings_key_to_entry, + (gpointer) key_entry->gsettings_key, key_entry); key_entry->closure = g_closure_new_simple (sizeof (GClosure), key_entry); @@ -418,13 +403,10 @@ terminal_accels_init (void) gtk_accel_group_connect_by_path (notification_group, I_(key_entry->accel_path), key_entry->closure); - - mateconf_client_notify (conf, key_entry->mateconf_key); + keys_change_notify (settings_keybindings, key_entry->gsettings_key, NULL); } } - g_object_unref (conf); - g_signal_connect (notification_group, "accel-changed", G_CALLBACK (accel_changed_callback), NULL); } @@ -432,12 +414,11 @@ terminal_accels_init (void) void terminal_accels_shutdown (void) { - MateConfClient *conf; - conf = mateconf_client_get_default (); - mateconf_client_notify_remove (conf, mateconf_notify_id); - mateconf_client_remove_dir (conf, CONF_KEYS_PREFIX, NULL); - g_object_unref (conf); + g_signal_handlers_disconnect_by_func (settings_keybindings, + G_CALLBACK(keys_change_notify), + NULL); + g_object_unref (settings_keybindings); if (sync_idle_id != 0) { @@ -447,8 +428,8 @@ terminal_accels_shutdown (void) sync_idle_cb (NULL); } - g_hash_table_destroy (mateconf_key_to_entry); - mateconf_key_to_entry = NULL; + g_hash_table_destroy (gsettings_key_to_entry); + gsettings_key_to_entry = NULL; g_object_unref (notification_group); notification_group = NULL; @@ -475,37 +456,36 @@ update_model_foreach (GtkTreeModel *model, } static void -keys_change_notify (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, - gpointer user_data) +keys_change_notify (GSettings *settings, + gchar *key, + gpointer user_data) { - MateConfValue *val; + GVariant *val; KeyEntry *key_entry; GdkModifierType mask; guint keyval; _terminal_debug_print (TERMINAL_DEBUG_ACCELS, "key %s changed\n", - mateconf_entry_get_key (entry)); + key); - val = mateconf_entry_get_value (entry); + val = g_settings_get_value (settings, key); #ifdef MATE_ENABLE_DEBUG _TERMINAL_DEBUG_IF (TERMINAL_DEBUG_ACCELS) { if (val == NULL) _terminal_debug_print (TERMINAL_DEBUG_ACCELS, " changed to be unset\n"); - else if (val->type != MATECONF_VALUE_STRING) + else if (!g_variant_is_of_type (val, G_VARIANT_TYPE_STRING)) _terminal_debug_print (TERMINAL_DEBUG_ACCELS, " changed to non-string value\n"); else _terminal_debug_print (TERMINAL_DEBUG_ACCELS, " changed to \"%s\"\n", - mateconf_value_get_string (val)); + g_variant_get_string (val, NULL)); } #endif - key_entry = g_hash_table_lookup (mateconf_key_to_entry, key_from_mateconf_key (mateconf_entry_get_key (entry))); + key_entry = g_hash_table_lookup (gsettings_key_to_entry, key); if (!key_entry) { /* shouldn't really happen, but let's be safe */ @@ -516,15 +496,14 @@ keys_change_notify (MateConfClient *client, if (!binding_from_value (val, &keyval, &mask)) { - const char *str = val->type == MATECONF_VALUE_STRING ? mateconf_value_get_string (val) : NULL; + const char *str = g_variant_is_of_type (val, G_VARIANT_TYPE_STRING) ? g_variant_get_string (val, NULL) : NULL; g_printerr ("The value \"%s\" of configuration key %s is not a valid accelerator\n", str ? str : "(null)", - key_entry->mateconf_key); + key_entry->gsettings_key); return; } - - key_entry->mateconf_keyval = keyval; - key_entry->mateconf_mask = mask; + key_entry->gsettings_keyval = keyval; + key_entry->gsettings_mask = mask; /* Unlock the path, so we can change its accel */ if (!key_entry->accel_path_unlocked) @@ -535,15 +514,15 @@ keys_change_notify (MateConfClient *client, "changing path %s to %s\n", key_entry->accel_path, binding_name (keyval, mask)); /* memleak */ - inside_mateconf_notify += 1; + inside_gsettings_notify += 1; /* Note that this may return FALSE, e.g. when the entry was already set correctly. */ gtk_accel_map_change_entry (key_entry->accel_path, keyval, mask, TRUE); - inside_mateconf_notify -= 1; + inside_gsettings_notify -= 1; - /* Lock the path if the mateconf key isn't writable */ - key_entry->accel_path_unlocked = mateconf_entry_get_is_writable (entry); + /* Lock the path if the GSettings key isn't writable */ + key_entry->accel_path_unlocked = g_settings_is_writable (settings, key); if (!key_entry->accel_path_unlocked) gtk_accel_map_lock_path (key_entry->accel_path); @@ -556,6 +535,8 @@ keys_change_notify (MateConfClient *client, */ if (edit_keys_store) gtk_tree_model_foreach (GTK_TREE_MODEL (edit_keys_store), update_model_foreach, key_entry); + + g_variant_unref(val); } static void @@ -570,7 +551,7 @@ accel_changed_callback (GtkAccelGroup *accel_group, * accelerator. We just use the accel closure to find our * accel entry, then update the value of that entry. * We use an idle function to avoid setting the entry - * in mateconf when the accelerator gets removed and then + * in GSettings when the accelerator gets removed and then * setting it again when it gets added. */ KeyEntry *key_entry; @@ -580,17 +561,17 @@ accel_changed_callback (GtkAccelGroup *accel_group, binding_name (keyval, modifier), /* memleak */ accel_closure); - if (inside_mateconf_notify) + if (inside_gsettings_notify) { _terminal_debug_print (TERMINAL_DEBUG_ACCELS, - "Ignoring change from gtk because we're inside a mateconf notify\n"); + "Ignoring change from gtk because we're inside a GSettings notify\n"); return; } key_entry = accel_closure->data; g_assert (key_entry); - key_entry->needs_mateconf_sync = TRUE; + key_entry->needs_gsettings_sync = TRUE; if (sync_idle_id == 0) sync_idle_id = g_idle_add (sync_idle_cb, NULL); @@ -618,7 +599,7 @@ binding_from_string (const char *str, } static gboolean -binding_from_value (MateConfValue *value, +binding_from_value (GVariant *value, guint *accelerator_key, GdkModifierType *accelerator_mods) { @@ -630,10 +611,10 @@ binding_from_value (MateConfValue *value, return TRUE; } - if (value->type != MATECONF_VALUE_STRING) + if (!g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) return FALSE; - return binding_from_string (mateconf_value_get_string (value), + return binding_from_string (g_variant_get_string (value,NULL), accelerator_key, accelerator_mods); } @@ -641,23 +622,23 @@ binding_from_value (MateConfValue *value, static void add_key_entry_to_changeset (gpointer key, KeyEntry *key_entry, - MateConfChangeSet *changeset) + GSettings *changeset) { GtkAccelKey gtk_key; - if (!key_entry->needs_mateconf_sync) + if (!key_entry->needs_gsettings_sync) return; - key_entry->needs_mateconf_sync = FALSE; + key_entry->needs_gsettings_sync = FALSE; if (gtk_accel_map_lookup_entry (key_entry->accel_path, >k_key) && - (gtk_key.accel_key != key_entry->mateconf_keyval || - gtk_key.accel_mods != key_entry->mateconf_mask)) + (gtk_key.accel_key != key_entry->gsettings_keyval || + gtk_key.accel_mods != key_entry->gsettings_mask)) { char *accel_name; accel_name = binding_name (gtk_key.accel_key, gtk_key.accel_mods); - mateconf_change_set_set_string (changeset, key_entry->mateconf_key, accel_name); + g_settings_set_string (changeset, key_entry->gsettings_key, accel_name); g_free (accel_name); } } @@ -665,27 +646,21 @@ add_key_entry_to_changeset (gpointer key, static gboolean sync_idle_cb (gpointer data) { - MateConfClient *conf; - MateConfChangeSet *changeset; + GSettings *changeset; GError *error = NULL; _terminal_debug_print (TERMINAL_DEBUG_ACCELS, - "mateconf sync handler\n"); + "GSettings sync handler\n"); sync_idle_id = 0; - conf = mateconf_client_get_default (); + changeset = g_settings_new (CONF_KEYS_SCHEMA); + g_settings_delay (changeset); - changeset = mateconf_change_set_new (); - g_hash_table_foreach (mateconf_key_to_entry, (GHFunc) add_key_entry_to_changeset, changeset); - if (!mateconf_client_commit_change_set (conf, changeset, TRUE, &error)) - { - g_printerr ("Error committing the accelerator changeset: %s\n", error->message); - g_error_free (error); - } + g_hash_table_foreach (gsettings_key_to_entry, (GHFunc) add_key_entry_to_changeset, changeset); + g_settings_apply(changeset); - mateconf_change_set_unref (changeset); - g_object_unref (conf); + g_object_unref (changeset); return FALSE; } @@ -718,8 +693,8 @@ accel_set_func (GtkTreeViewColumn *tree_column, "visible", TRUE, "sensitive", ke->accel_path_unlocked, "editable", ke->accel_path_unlocked, - "accel-key", ke->mateconf_keyval, - "accel-mods", ke->mateconf_mask, + "accel-key", ke->gsettings_keyval, + "accel-mods", ke->gsettings_mask, NULL); } @@ -746,8 +721,8 @@ accel_compare_func (GtkTreeModel *model, } else { - name_a = binding_display_name (ke_a->mateconf_keyval, - ke_a->mateconf_mask); + name_a = binding_display_name (ke_a->gsettings_keyval, + ke_a->gsettings_mask); } gtk_tree_model_get (model, b, @@ -761,8 +736,8 @@ accel_compare_func (GtkTreeModel *model, } else { - name_b = binding_display_name (ke_b->mateconf_keyval, - ke_b->mateconf_mask); + name_b = binding_display_name (ke_b->gsettings_keyval, + ke_b->gsettings_mask); } result = g_utf8_collate (name_a, name_b); @@ -798,7 +773,6 @@ accel_edited_callback (GtkCellRendererAccel *cell, GtkAccelGroupEntry *entries; guint n_entries; char *str; - MateConfClient *conf; model = gtk_tree_view_get_model (view); @@ -840,7 +814,8 @@ accel_edited_callback (GtkCellRendererAccel *cell, GTK_BUTTONS_OK, _("The shortcut key “%s” is already bound to the “%s” action"), name, - other_key->user_visible_name ? _(other_key->user_visible_name) : other_key->mateconf_key); + +other_key->user_visible_name ? _(other_key->user_visible_name) : other_key->gsettings_key); g_free (name); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); @@ -853,7 +828,7 @@ accel_edited_callback (GtkCellRendererAccel *cell, str = binding_name (keyval, mask); _terminal_debug_print (TERMINAL_DEBUG_ACCELS, - "Edited path %s keyval %s, setting mateconf to %s\n", + "Edited path %s keyval %s, setting GSettings to %s\n", ke->accel_path, gdk_keyval_name (keyval) ? gdk_keyval_name (keyval) : "null", str); @@ -877,12 +852,9 @@ accel_edited_callback (GtkCellRendererAccel *cell, } #endif - conf = mateconf_client_get_default (); - mateconf_client_set_string (conf, - ke->mateconf_key, - str, - NULL); - g_object_unref (conf); + g_settings_set_string (settings_keybindings, + ke->gsettings_key, + str); g_free (str); } @@ -896,7 +868,6 @@ accel_cleared_callback (GtkCellRendererAccel *cell, GtkTreeIter iter; KeyEntry *ke; char *str; - MateConfClient *conf; model = gtk_tree_view_get_model (view); @@ -917,22 +888,19 @@ accel_cleared_callback (GtkCellRendererAccel *cell, if (ke == NULL) return; - ke->mateconf_keyval = 0; - ke->mateconf_mask = 0; - ke->needs_mateconf_sync = TRUE; + ke->gsettings_keyval = 0; + ke->gsettings_mask = 0; + ke->needs_gsettings_sync = TRUE; str = binding_name (0, 0); _terminal_debug_print (TERMINAL_DEBUG_ACCELS, - "Cleared keybinding for mateconf %s", - ke->mateconf_key); - - conf = mateconf_client_get_default (); - mateconf_client_set_string (conf, - ke->mateconf_key, - str, - NULL); - g_object_unref (conf); + "Cleared keybinding for GSettings %s", + ke->gsettings_key); + + g_settings_set_string (settings_keybindings, + ke->gsettings_key, + str); g_free (str); } diff --git a/src/terminal-app.c b/src/terminal-app.c index 12835f1..baac703 100644 --- a/src/terminal-app.c +++ b/src/terminal-app.c @@ -36,7 +36,8 @@ #include "terminal-util.h" #include "profile-editor.h" #include "terminal-encoding.h" -#include +#include "terminal-gsettings.h" +#include "terminal-dconf.h" #include #include #include @@ -48,14 +49,14 @@ #endif #endif -#define FALLBACK_PROFILE_ID "Default" +#define FALLBACK_PROFILE_ID "default" /* Settings storage works as follows: * /apps/mate-terminal/global/ * /apps/mate-terminal/profiles/Foo/ * * It's somewhat tricky to manage the profiles/ dir since we need to track - * the list of profiles, but mateconf doesn't have a concept of notifying that + * the list of profiles, but GSettings doesn't have a concept of notifying that * a directory has appeared or disappeared. * * Session state is stored entirely in the RestartCommand command line. @@ -65,7 +66,7 @@ * OVERLAP. The UI and implementation totally break if you overlap * these categories. See mate-terminal 1.x for why. * - * Don't use this code as an example of how to use MateConf - it's hugely + * Don't use this code as an example of how to use GSettings - it's hugely * overcomplicated due to the profiles stuff. Most apps should not * have to do scary things of this nature, and should not have * a profiles feature. @@ -94,13 +95,8 @@ struct _TerminalApp GtkWidget *manage_profiles_delete_button; GtkWidget *manage_profiles_default_menu; - MateConfClient *conf; - guint profile_list_notify_id; - guint default_profile_notify_id; - guint encoding_list_notify_id; - guint system_font_notify_id; - guint enable_mnemonics_notify_id; - guint enable_menu_accels_notify_id; + GSettings *settings_global; + GSettings *settings_font; GHashTable *profiles; char* default_profile_id; @@ -148,23 +144,20 @@ enum static TerminalApp *global_app = NULL; -/* Evil hack alert: this is exported from libmateconf-2 but not in a public header */ -extern gboolean mateconf_spawn_daemon(GError** err); - -#define MONOSPACE_FONT_DIR "/desktop/mate/interface" -#define MONOSPACE_FONT_KEY MONOSPACE_FONT_DIR "/monospace_font_name" +#define MONOSPACE_FONT_SCHEMA "org.mate.interface" +#define MONOSPACE_FONT_KEY "monospace-font-name" #define DEFAULT_MONOSPACE_FONT ("Monospace 10") -#define ENABLE_MNEMONICS_KEY CONF_GLOBAL_PREFIX "/use_mnemonics" +#define ENABLE_MNEMONICS_KEY "use-mnemonics" #define DEFAULT_ENABLE_MNEMONICS (TRUE) -#define ENABLE_MENU_BAR_ACCEL_KEY CONF_GLOBAL_PREFIX"/use_menu_accelerators" +#define ENABLE_MENU_BAR_ACCEL_KEY "use-menu-accelerators" #define DEFAULT_ENABLE_MENU_BAR_ACCEL (TRUE) -#define PROFILE_LIST_KEY CONF_GLOBAL_PREFIX "/profile_list" -#define DEFAULT_PROFILE_KEY CONF_GLOBAL_PREFIX "/default_profile" +#define PROFILE_LIST_KEY "profile-list" +#define DEFAULT_PROFILE_KEY "default-profile" -#define ENCODING_LIST_KEY CONF_GLOBAL_PREFIX "/active_encodings" +#define ENCODING_LIST_KEY "active-encodings" /* Helper functions */ @@ -305,43 +298,23 @@ static void terminal_app_delete_profile (TerminalApp *app, TerminalProfile *profile) { - GHashTableIter iter; - GSList *name_list; - const char *name, *profile_name; - char *mateconf_dir; + const char *profile_name; + char *profile_dir; GError *error = NULL; - const char **nameptr = &name; profile_name = terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME); - mateconf_dir = mateconf_concat_dir_and_key (CONF_PREFIX "/profiles", profile_name); - - name_list = NULL; - g_hash_table_iter_init (&iter, app->profiles); - while (g_hash_table_iter_next (&iter, (gpointer *) nameptr, NULL)) - { - if (strcmp (name, profile_name) == 0) - continue; - - name_list = g_slist_prepend (name_list, g_strdup (name)); - } + profile_dir = g_strconcat (CONF_PROFILE_PREFIX, profile_name, "/", NULL); - mateconf_client_set_list (app->conf, - CONF_GLOBAL_PREFIX"/profile_list", - MATECONF_VALUE_STRING, - name_list, - NULL); - - g_slist_foreach (name_list, (GFunc) g_free, NULL); - g_slist_free (name_list); + terminal_gsettings_remove_all_from_strv (app->settings_global, PROFILE_LIST_KEY, profile_name); /* And remove the profile directory */ - if (!mateconf_client_recursive_unset (app->conf, mateconf_dir, MATECONF_UNSET_INCLUDING_SCHEMA_NAMES, &error)) + if (!terminal_dconf_recursive_reset (profile_dir, &error)) { - g_warning ("Failed to recursively unset %s: %s\n", mateconf_dir, error->message); + g_warning ("Failed to recursively unset %s: %s\n", profile_dir, error->message); g_error_free (error); } - g_free (mateconf_dir); + g_free (profile_dir); } static void @@ -510,12 +483,10 @@ profile_combo_box_changed_cb (GtkWidget *widget, if (!profile) return; - mateconf_client_set_string (app->conf, - CONF_GLOBAL_PREFIX "/default_profile", - terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME), - NULL); + g_settings_set_string (app->settings_global, DEFAULT_PROFILE_KEY, + terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME)); - /* Even though the mateconf change notification does this, it happens too late. + /* Even though the GSettings change notification does this, it happens too late. * In some cases, the default profile changes twice in quick succession, * and update_default_profile must be called in sync with those changes. */ @@ -741,14 +712,13 @@ find_profile_link (GList *profiles, } static void -terminal_app_profile_list_notify_cb (MateConfClient *conf, - guint cnxn_id, - MateConfEntry *entry, +terminal_app_profile_list_notify_cb (GSettings *settings, + gchar *key, gpointer user_data) { TerminalApp *app = TERMINAL_APP (user_data); GObject *object = G_OBJECT (app); - MateConfValue *val; + GVariant *val; GSList *value_list, *sl; GList *profiles_to_delete, *l; gboolean need_new_default; @@ -759,22 +729,20 @@ terminal_app_profile_list_notify_cb (MateConfClient *conf, profiles_to_delete = terminal_app_get_profile_list (app); - val = mateconf_entry_get_value (entry); + val = g_settings_get_value (settings, key); if (val == NULL || - val->type != MATECONF_VALUE_LIST || - mateconf_value_get_list_type (val) != MATECONF_VALUE_STRING) + (!g_variant_is_of_type (val, G_VARIANT_TYPE_STRING_ARRAY) && + !g_variant_is_of_type (val, G_VARIANT_TYPE_STRING))) goto ensure_one_profile; - value_list = mateconf_value_get_list (val); + value_list = terminal_gsettings_strv_to_gslist( g_variant_get_strv (val, NULL)); /* Add any new ones */ for (sl = value_list; sl != NULL; sl = sl->next) { - MateConfValue *listvalue = (MateConfValue *) (sl->data); - const char *profile_name; + const char *profile_name = sl->data; GList *link; - profile_name = mateconf_value_get_string (listvalue); if (!profile_name) continue; @@ -863,21 +831,20 @@ ensure_one_profile: } static void -terminal_app_default_profile_notify_cb (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, +terminal_app_default_profile_notify_cb (GSettings *settings, + gchar *key, gpointer user_data) { TerminalApp *app = TERMINAL_APP (user_data); - MateConfValue *val; + GVariant *val; const char *name = NULL; - app->default_profile_locked = !mateconf_entry_get_is_writable (entry); + app->default_profile_locked = !g_settings_is_writable (settings, key); - val = mateconf_entry_get_value (entry); + val = g_settings_get_value (settings, key); if (val != NULL && - val->type == MATECONF_VALUE_STRING) - name = mateconf_value_get_string (val); + g_variant_is_of_type (val, G_VARIANT_TYPE_STRING)) + name = g_variant_get_string (val, NULL); if (!name || !name[0]) name = FALLBACK_PROFILE_ID; g_assert (name != NULL); @@ -888,6 +855,7 @@ terminal_app_default_profile_notify_cb (MateConfClient *client, app->default_profile = terminal_app_get_profile_by_name (app, name); g_object_notify (G_OBJECT (app), TERMINAL_APP_DEFAULT_PROFILE); + g_variant_unref (val); } static int @@ -909,18 +877,17 @@ encoding_mark_active (gpointer key, } static void -terminal_app_encoding_list_notify_cb (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, +terminal_app_encoding_list_notify_cb (GSettings *settings, + gchar *key, gpointer user_data) { TerminalApp *app = TERMINAL_APP (user_data); - MateConfValue *val; + GVariant *val; GSList *strings, *tmp; TerminalEncoding *encoding; const char *charset; - app->encodings_locked = !mateconf_entry_get_is_writable (entry); + app->encodings_locked = !g_settings_is_writable (settings, key); /* Mark all as non-active, then re-enable the active ones */ g_hash_table_foreach (app->encodings, (GHFunc) encoding_mark_active, GUINT_TO_POINTER (FALSE)); @@ -937,19 +904,16 @@ terminal_app_encoding_list_notify_cb (MateConfClient *client, if (terminal_encoding_is_valid (encoding)) encoding->is_active = TRUE; - val = mateconf_entry_get_value (entry); + val = g_settings_get_value (settings, key); if (val != NULL && - val->type == MATECONF_VALUE_LIST && - mateconf_value_get_list_type (val) == MATECONF_VALUE_STRING) - strings = mateconf_value_get_list (val); + g_variant_is_of_type (val, G_VARIANT_TYPE_STRING_ARRAY)) + strings = terminal_gsettings_strv_to_gslist (g_variant_get_strv (val, NULL)); else strings = NULL; for (tmp = strings; tmp != NULL; tmp = tmp->next) { - MateConfValue *v = (MateConfValue *) tmp->data; - - charset = mateconf_value_get_string (v); + charset = tmp->data; if (!charset) continue; @@ -961,26 +925,27 @@ terminal_app_encoding_list_notify_cb (MateConfClient *client, } g_signal_emit (app, signals[ENCODING_LIST_CHANGED], 0); + g_variant_unref (val); + g_slist_free_full (strings, g_free); } static void -terminal_app_system_font_notify_cb (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, +terminal_app_system_font_notify_cb (GSettings *settings, + gchar *key, gpointer user_data) { TerminalApp *app = TERMINAL_APP (user_data); - MateConfValue *mateconf_value; + GVariant *val; const char *font = NULL; PangoFontDescription *font_desc; - if (strcmp (mateconf_entry_get_key (entry), MONOSPACE_FONT_KEY) != 0) + if (strcmp (key, MONOSPACE_FONT_KEY) != 0) return; - mateconf_value = mateconf_entry_get_value (entry); - if (mateconf_value && - mateconf_value->type == MATECONF_VALUE_STRING) - font = mateconf_value_get_string (mateconf_value); + val = g_settings_get_value (settings, key); + if (val && + g_variant_is_of_type (val, G_VARIANT_TYPE_STRING)) + font = g_variant_get_string (val, NULL); if (!font) font = DEFAULT_MONOSPACE_FONT; g_assert (font != NULL); @@ -999,28 +964,19 @@ terminal_app_system_font_notify_cb (MateConfClient *client, app->system_font_desc = font_desc; g_object_notify (G_OBJECT (app), TERMINAL_APP_SYSTEM_FONT); + g_variant_unref (val); } static void -terminal_app_enable_mnemonics_notify_cb (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, - gpointer user_data) +terminal_app_enable_mnemonics_notify_cb (GSettings *settings, + gchar *key, + gpointer user_data) { TerminalApp *app = TERMINAL_APP (user_data); - MateConfValue *mateconf_value; + GVariant *settings_value; gboolean enable; - if (strcmp (mateconf_entry_get_key (entry), ENABLE_MNEMONICS_KEY) != 0) - return; - - mateconf_value = mateconf_entry_get_value (entry); - if (mateconf_value && - mateconf_value->type == MATECONF_VALUE_BOOL) - enable = mateconf_value_get_bool (mateconf_value); - else - enable = TRUE; - + enable = g_settings_get_boolean (settings, key); if (enable == app->enable_mnemonics) return; @@ -1029,25 +985,14 @@ terminal_app_enable_mnemonics_notify_cb (MateConfClient *client, } static void -terminal_app_enable_menu_accels_notify_cb (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, +terminal_app_enable_menu_accels_notify_cb (GSettings *settings, + gchar *key, gpointer user_data) { TerminalApp *app = TERMINAL_APP (user_data); - MateConfValue *mateconf_value; gboolean enable; - if (strcmp (mateconf_entry_get_key (entry), ENABLE_MENU_BAR_ACCEL_KEY) != 0) - return; - - mateconf_value = mateconf_entry_get_value (entry); - if (mateconf_value && - mateconf_value->type == MATECONF_VALUE_BOOL) - enable = mateconf_value_get_bool (mateconf_value); - else - enable = TRUE; - + enable = g_settings_get_boolean (settings, key); if (enable == app->enable_menu_accels) return; @@ -1073,7 +1018,6 @@ new_profile_response_cb (GtkWidget *new_profile_dialog, GtkWindow *transient_parent; GtkWidget *confirm_dialog; gint retval; - GSList *list; base_option_menu = g_object_get_data (G_OBJECT (new_profile_dialog), "base_option_menu"); base_profile = profile_combo_box_get_selected (base_option_menu); @@ -1120,17 +1064,10 @@ new_profile_response_cb (GtkWidget *new_profile_dialog, g_strdup (new_profile_name), new_profile /* adopts the refcount */); - /* And now save the list to mateconf */ - list = mateconf_client_get_list (app->conf, - CONF_GLOBAL_PREFIX"/profile_list", - MATECONF_VALUE_STRING, - NULL); - list = g_slist_append (list, g_strdup (new_profile_name)); - mateconf_client_set_list (app->conf, - CONF_GLOBAL_PREFIX"/profile_list", - MATECONF_VALUE_STRING, - list, - NULL); + /* And now save the new profile name to GSettings */ + terminal_gsettings_append_strv (app->settings_global, + PROFILE_LIST_KEY, + new_profile_name); terminal_profile_edit (new_profile, transient_parent, NULL); @@ -1375,20 +1312,6 @@ terminal_app_init (TerminalApp *app) global_app = app; - /* If the mateconf daemon isn't available (e.g. because there's no dbus - * session bus running), we'd crash later on. Tell the user about it - * now, and exit. See bug #561663. - * Don't use mateconf_ping_daemon() here since the server may just not - * be running yet, but able to be started. See comments on bug #564649. - */ - if (!mateconf_spawn_daemon (&error)) - { - g_printerr ("Failed to summon the MateConf demon; exiting. %s\n", error->message); - g_error_free (error); - - exit (EXIT_FAILURE); - } - gtk_window_set_default_icon_name (MATE_TERMINAL_ICON_NAME); /* Initialise defaults */ @@ -1399,63 +1322,59 @@ terminal_app_init (TerminalApp *app) app->encodings = terminal_encodings_get_builtins (); - app->conf = mateconf_client_get_default (); - - mateconf_client_add_dir (app->conf, CONF_GLOBAL_PREFIX, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - mateconf_client_add_dir (app->conf, MONOSPACE_FONT_DIR, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - mateconf_client_add_dir (app->conf, CONF_PROXY_PREFIX, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - mateconf_client_add_dir (app->conf, CONF_HTTP_PROXY_PREFIX, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - - app->profile_list_notify_id = - mateconf_client_notify_add (app->conf, PROFILE_LIST_KEY, - terminal_app_profile_list_notify_cb, - app, NULL, NULL); - - app->default_profile_notify_id = - mateconf_client_notify_add (app->conf, - DEFAULT_PROFILE_KEY, - terminal_app_default_profile_notify_cb, - app, NULL, NULL); - - app->encoding_list_notify_id = - mateconf_client_notify_add (app->conf, - ENCODING_LIST_KEY, - terminal_app_encoding_list_notify_cb, - app, NULL, NULL); - - app->system_font_notify_id = - mateconf_client_notify_add (app->conf, - MONOSPACE_FONT_KEY, - terminal_app_system_font_notify_cb, - app, NULL, NULL); - - app->enable_mnemonics_notify_id = - mateconf_client_notify_add (app->conf, - ENABLE_MNEMONICS_KEY, - terminal_app_enable_mnemonics_notify_cb, - app, NULL, NULL); - - app->enable_menu_accels_notify_id = - mateconf_client_notify_add (app->conf, - ENABLE_MENU_BAR_ACCEL_KEY, - terminal_app_enable_menu_accels_notify_cb, - app, NULL, NULL); + app->settings_global = g_settings_new (CONF_GLOBAL_SCHEMA); + app->settings_font = g_settings_new (MONOSPACE_FONT_SCHEMA); + + g_signal_connect (app->settings_global, + "changed::" PROFILE_LIST_KEY, + G_CALLBACK(terminal_app_profile_list_notify_cb), + app); + + g_signal_connect (app->settings_global, + "changed::" DEFAULT_PROFILE_KEY, + G_CALLBACK(terminal_app_default_profile_notify_cb), + app); + + g_signal_connect (app->settings_global, + "changed::" ENCODING_LIST_KEY, + G_CALLBACK(terminal_app_encoding_list_notify_cb), + app); + + g_signal_connect (app->settings_font, + "changed::" MONOSPACE_FONT_KEY, + G_CALLBACK(terminal_app_system_font_notify_cb), + app); + + + g_signal_connect (app->settings_global, + "changed::" ENABLE_MNEMONICS_KEY, + G_CALLBACK(terminal_app_enable_mnemonics_notify_cb), + app); + + g_signal_connect (app->settings_global, + "changed::" ENABLE_MENU_BAR_ACCEL_KEY, + G_CALLBACK(terminal_app_enable_menu_accels_notify_cb), + app); /* Load the settings */ - mateconf_client_notify (app->conf, PROFILE_LIST_KEY); - mateconf_client_notify (app->conf, DEFAULT_PROFILE_KEY); - mateconf_client_notify (app->conf, ENCODING_LIST_KEY); - mateconf_client_notify (app->conf, MONOSPACE_FONT_KEY); - mateconf_client_notify (app->conf, ENABLE_MENU_BAR_ACCEL_KEY); - mateconf_client_notify (app->conf, ENABLE_MNEMONICS_KEY); + terminal_app_profile_list_notify_cb (app->settings_global, + PROFILE_LIST_KEY, + app); + terminal_app_default_profile_notify_cb (app->settings_global, + DEFAULT_PROFILE_KEY, + app); + terminal_app_encoding_list_notify_cb (app->settings_global, + ENCODING_LIST_KEY, + app); + terminal_app_system_font_notify_cb (app->settings_font, + MONOSPACE_FONT_KEY, + app); + terminal_app_enable_menu_accels_notify_cb (app->settings_global, + ENABLE_MENU_BAR_ACCEL_KEY, + app); + terminal_app_enable_mnemonics_notify_cb (app->settings_global, + ENABLE_MNEMONICS_KEY, + app); /* Ensure we have valid settings */ g_assert (app->default_profile_id != NULL); @@ -1498,24 +1417,27 @@ terminal_app_finalize (GObject *object) g_signal_handlers_disconnect_matched (sm_client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, app); #endif - - if (app->profile_list_notify_id != 0) - mateconf_client_notify_remove (app->conf, app->profile_list_notify_id); - if (app->default_profile_notify_id != 0) - mateconf_client_notify_remove (app->conf, app->default_profile_notify_id); - if (app->encoding_list_notify_id != 0) - mateconf_client_notify_remove (app->conf, app->encoding_list_notify_id); - if (app->system_font_notify_id != 0) - mateconf_client_notify_remove (app->conf, app->system_font_notify_id); - if (app->enable_menu_accels_notify_id != 0) - mateconf_client_notify_remove (app->conf, app->enable_menu_accels_notify_id); - if (app->enable_mnemonics_notify_id != 0) - mateconf_client_notify_remove (app->conf, app->enable_mnemonics_notify_id); - - mateconf_client_remove_dir (app->conf, CONF_GLOBAL_PREFIX, NULL); - mateconf_client_remove_dir (app->conf, MONOSPACE_FONT_DIR, NULL); - - g_object_unref (app->conf); + g_signal_handlers_disconnect_by_func (app->settings_global, + G_CALLBACK(terminal_app_profile_list_notify_cb), + app); + g_signal_handlers_disconnect_by_func (app->settings_global, + G_CALLBACK(terminal_app_default_profile_notify_cb), + app); + g_signal_handlers_disconnect_by_func (app->settings_global, + G_CALLBACK(terminal_app_encoding_list_notify_cb), + app); + g_signal_handlers_disconnect_by_func (app->settings_font, + G_CALLBACK(terminal_app_system_font_notify_cb), + app); + g_signal_handlers_disconnect_by_func (app->settings_global, + G_CALLBACK(terminal_app_enable_menu_accels_notify_cb), + app); + g_signal_handlers_disconnect_by_func (app->settings_global, + G_CALLBACK(terminal_app_enable_mnemonics_notify_cb), + app); + + g_object_unref (app->settings_global); + g_object_unref (app->settings_font); g_free (app->default_profile_id); @@ -1575,11 +1497,11 @@ terminal_app_set_property (GObject *object, { case PROP_ENABLE_MENU_BAR_ACCEL: app->enable_menu_accels = g_value_get_boolean (value); - mateconf_client_set_bool (app->conf, ENABLE_MENU_BAR_ACCEL_KEY, app->enable_menu_accels, NULL); + g_settings_set_boolean (app->settings_global, ENABLE_MENU_BAR_ACCEL_KEY, app->enable_menu_accels); break; case PROP_ENABLE_MNEMONICS: app->enable_mnemonics = g_value_get_boolean (value); - mateconf_client_set_bool (app->conf, ENABLE_MNEMONICS_KEY, app->enable_mnemonics, NULL); + g_settings_set_boolean (app->settings_global, ENABLE_MNEMONICS_KEY, app->enable_mnemonics); break; case PROP_DEFAULT_PROFILE: case PROP_SYSTEM_FONT: diff --git a/src/terminal-app.h b/src/terminal-app.h index 586902d..39c2ad1 100644 --- a/src/terminal-app.h +++ b/src/terminal-app.h @@ -57,10 +57,12 @@ G_BEGIN_DECLS /* Configuration */ -#define CONF_PREFIX "/apps/mate-terminal" -#define CONF_GLOBAL_PREFIX CONF_PREFIX "/global" -#define CONF_PROFILES_PREFIX CONF_PREFIX "/profiles" -#define CONF_KEYS_PREFIX CONF_PREFIX "/keybindings" +#define CONF_PREFIX "org.mate.terminal" +#define CONF_GLOBAL_SCHEMA CONF_PREFIX ".global" +#define CONF_PROFILES_SCHEMA CONF_PREFIX ".profiles" +#define CONF_PROFILE_SCHEMA CONF_PREFIX ".profile" +#define CONF_KEYS_SCHEMA CONF_PREFIX ".keybindings" +#define CONF_PROFILE_PREFIX "/org/mate/terminal/profiles/" #define MATE_TERMINAL_ICON_NAME "utilities-terminal" diff --git a/src/terminal-dconf.c b/src/terminal-dconf.c new file mode 100644 index 0000000..31467dc --- /dev/null +++ b/src/terminal-dconf.c @@ -0,0 +1,113 @@ +/* +* terminal-dconf.c: helper API for dconf +* +* Copyright (C) 2011 Novell, Inc. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +* 02111-1307, USA. +* +* Authors: +* Vincent Untz +* Stefano Karapetsas +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include + +#include "terminal-dconf.h" + +static DConfClient * +terminal_dconf_client_get (void) +{ +#ifdef HAVE_DCONF_NEW + return dconf_client_new (); +#else + return dconf_client_new (NULL, NULL, NULL, NULL); +#endif +} + +gboolean +terminal_dconf_write_sync (const gchar *key, + GVariant *value, + GError **error) +{ + gboolean ret; + DConfClient *client = terminal_dconf_client_get (); + +#ifdef HAVE_DCONF_NEW + ret = dconf_client_write_sync (client, key, value, NULL, NULL, error); +#else + ret = dconf_client_write (client, key, value, NULL, NULL, error); +#endif + + g_object_unref (client); + + return ret; +} + +gboolean +terminal_dconf_recursive_reset (const gchar *dir, + GError **error) +{ + gboolean ret; + DConfClient *client = terminal_dconf_client_get (); + +#ifdef HAVE_DCONF_NEW + ret = dconf_client_write_sync (client, dir, NULL, NULL, NULL, error); +#else + ret = dconf_client_write (client, dir, NULL, NULL, NULL, error); +#endif + + g_object_unref (client); + + return ret; +} + +gchar ** +terminal_dconf_list_subdirs (const gchar *dir, + gboolean remove_trailing_slash) +{ + GArray *array; + gchar **children; + int len; + int i; + DConfClient *client = terminal_dconf_client_get (); + + array = g_array_new (TRUE, TRUE, sizeof (gchar *)); + + children = dconf_client_list (client, dir, &len); + + g_object_unref (client); + + for (i = 0; children[i] != NULL; i++) { + if (dconf_is_rel_dir (children[i], NULL)) { + char *val = g_strdup (children[i]); + + if (remove_trailing_slash) + val[strlen (val) - 1] = '\0'; + + array = g_array_append_val (array, val); + } + } + + g_strfreev (children); + + return (gchar **) g_array_free (array, FALSE); +} diff --git a/src/terminal-dconf.h b/src/terminal-dconf.h new file mode 100644 index 0000000..1d3780d --- /dev/null +++ b/src/terminal-dconf.h @@ -0,0 +1,44 @@ +/* +* terminal-dconf.h: helper API for dconf +* +* Copyright (C) 2011 Novell, Inc. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +* 02111-1307, USA. +* +* Authors: +* Vincent Untz +*/ + +#ifndef __TERMINAL_DCONF_H__ +#define __TERMINAL_DCONF_H__ + +#include + +G_BEGIN_DECLS + +gboolean terminal_dconf_write_sync (const gchar *key, + GVariant *value, + GError **error); + +gboolean terminal_dconf_recursive_reset (const gchar *dir, + GError **error); + +gchar **terminal_dconf_list_subdirs (const gchar *dir, + gboolean remove_trailing_slash); + +G_END_DECLS + +#endif /* __TERMINAL_DCONF_H__ */ diff --git a/src/terminal-encoding.c b/src/terminal-encoding.c index ba689ce..549af80 100644 --- a/src/terminal-encoding.c +++ b/src/terminal-encoding.c @@ -31,7 +31,7 @@ /* Overview * - * There's a list of character sets stored in mateconf, indicating + * There's a list of character sets stored in GSettings, indicating * which encodings to display in the encoding menu. * * We have a pre-canned list of available encodings @@ -39,7 +39,7 @@ * the encoding menu, and to give a human-readable name * to certain encodings. * - * If the mateconf list contains an encoding not in the + * If the GSettings list contains an encoding not in the * predetermined table, then that encoding is * labeled "user defined" but still appears in the menu. */ @@ -285,29 +285,28 @@ terminal_encoding_get_type (void) } static void -update_active_encodings_mateconf (void) +update_active_encodings_gsettings (void) { GSList *list, *l; - GSList *strings = NULL; - MateConfClient *conf; + GArray *strings; + gchar *id_string; + GSettings *settings; list = terminal_app_get_active_encodings (terminal_app_get ()); + strings = g_array_new (TRUE, TRUE, sizeof (gchar *)); for (l = list; l != NULL; l = l->next) { TerminalEncoding *encoding = (TerminalEncoding *) l->data; + id_string = terminal_encoding_get_id (encoding); - strings = g_slist_prepend (strings, (gpointer) terminal_encoding_get_id (encoding)); + strings = g_array_append_val (strings, id_string); } - conf = mateconf_client_get_default (); - mateconf_client_set_list (conf, - CONF_GLOBAL_PREFIX"/active_encodings", - MATECONF_VALUE_STRING, - strings, - NULL); - g_object_unref (conf); + settings = g_settings_new (CONF_GLOBAL_SCHEMA); + g_settings_set_strv (settings, "active-encodings", (const gchar **) strings->data); + g_object_unref (settings); - g_slist_free (strings); + g_array_free (strings, TRUE); g_slist_foreach (list, (GFunc) terminal_encoding_unref, NULL); g_slist_free (list); } @@ -385,10 +384,10 @@ button_clicked_cb (GtkWidget *button, terminal_encoding_unref (encoding); - /* We don't need to emit row-changed here, since updating the mateconf pref + /* We don't need to emit row-changed here, since updating the GSettings pref * will update the models. */ - update_active_encodings_mateconf (); + update_active_encodings_gsettings (); } static void diff --git a/src/terminal-gsettings.c b/src/terminal-gsettings.c new file mode 100644 index 0000000..e13b3c7 --- /dev/null +++ b/src/terminal-gsettings.c @@ -0,0 +1,177 @@ +/* + * terminal-gsettings.c: terminal gsettings utility methods + * + * Copyright (C) 2001 - 2003 Sun Microsystems, Inc. + * 2012 Stefano Karapetsas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Authors: + * Mark McLoughlin + * Glynn Foster + * Stefano Karapetsas + */ + +#include + +#include "terminal-gsettings.h" + +#include +#include +#include + +/* (copied from gnome-panel) + * Adapted from is_valid_keyname() in glib (gio/glib-compile-schemas.c) + * Differences: + * - gettext support removed (we don't need translations here) + * - remove support for allow_any_name + */ +gboolean +terminal_gsettings_is_valid_keyname (const gchar *key, + GError **error) +{ + gint i; + + if (key[0] == '\0') + { + g_set_error_literal (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "empty names are not permitted"); + return FALSE; + } + + if (!g_ascii_islower (key[0])) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "invalid name '%s': names must begin " + "with a lowercase letter", key); + return FALSE; + } + + for (i = 1; key[i]; i++) + { + if (key[i] != '-' && + !g_ascii_islower (key[i]) && + !g_ascii_isdigit (key[i])) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "invalid name '%s': invalid character '%c'; " + "only lowercase letters, numbers and dash ('-') " + "are permitted.", key, key[i]); + return FALSE; + } + + if (key[i] == '-' && key[i + 1] == '-') + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "invalid name '%s': two successive dashes ('--') " + "are not permitted.", key); + return FALSE; + } + } + + if (key[i - 1] == '-') + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "invalid name '%s': the last character may not be a " + "dash ('-').", key); + return FALSE; + } + + if (i > 32) + { + g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, + "invalid name '%s': maximum length is 32", key); + return FALSE; + } + + return TRUE; +} + +/* copied from gnome-panel */ +gboolean +terminal_gsettings_append_strv (GSettings *settings, + const gchar *key, + const gchar *value) +{ + gchar **old; + gchar **new; + gint size; + gboolean retval; + + old = g_settings_get_strv (settings, key); + + for (size = 0; old[size] != NULL; size++); + + size += 1; /* appended value */ + size += 1; /* NULL */ + + new = g_realloc_n (old, size, sizeof (gchar *)); + + new[size - 2] = g_strdup (value); + new[size - 1] = NULL; + + retval = g_settings_set_strv (settings, key, + (const gchar **) new); + + g_strfreev (new); + + return retval; +} + +/* copied from gnome-panel */ +gboolean +terminal_gsettings_remove_all_from_strv (GSettings *settings, + const gchar *key, + const gchar *value) +{ + GArray *array; + gchar **old; + gint i; + gboolean retval; + + old = g_settings_get_strv (settings, key); + array = g_array_new (TRUE, TRUE, sizeof (gchar *)); + + for (i = 0; old[i] != NULL; i++) { + if (g_strcmp0 (old[i], value) != 0) + array = g_array_append_val (array, old[i]); + } + + retval = g_settings_set_strv (settings, key, + (const gchar **) array->data); + + g_strfreev (old); + g_array_free (array, TRUE); + + return retval; +} + + + +/* convert a gchar ** to GList (taken from libmatekbd code) */ +GSList* +terminal_gsettings_strv_to_gslist (gchar **array) +{ + GSList *list = NULL; + gint i; + if (array != NULL) { + for (i = 0; array[i]; i++) { + list = g_slist_append (list, g_strdup (array[i])); + } + } + return list; +} + diff --git a/src/terminal-gsettings.h b/src/terminal-gsettings.h new file mode 100644 index 0000000..f8afb3d --- /dev/null +++ b/src/terminal-gsettings.h @@ -0,0 +1,52 @@ +/* + * terminal-gsettings.h: terminal gsettings utility methods + * + * Copyright (C) 2001 - 2003 Sun Microsystems, Inc. + * 2012 Stefano Karapetsas + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Authors: + * Mark McLoughlin + * Glynn Foster + * Stefano Karapetsas + */ + +#ifndef __TERMINAL_GSETTINGS_H__ +#define __TERMINAL_GSETTINGS_H__ + +#include +#include + +G_BEGIN_DECLS + +gboolean terminal_gsettings_is_valid_keyname (const gchar *key, + GError **error); + +gboolean terminal_gsettings_append_strv (GSettings *settings, + const gchar *key, + const gchar *value); + +gboolean terminal_gsettings_remove_all_from_strv (GSettings *settings, + const gchar *key, + const gchar *value); + +GSList* terminal_gsettings_strv_to_gslist (gchar **array); + +G_END_DECLS + +#endif /* __TEMRINAL_GSETTINGS_H__ */ + diff --git a/src/terminal-profile.c b/src/terminal-profile.c index 0021d7a..bc836f1 100644 --- a/src/terminal-profile.c +++ b/src/terminal-profile.c @@ -24,8 +24,6 @@ #include -#include - #include "terminal-app.h" #include "terminal-debug.h" #include "terminal-intl.h" @@ -39,8 +37,8 @@ * - add a #define with its name in terminal-profile.h * - add a gobject property for it in terminal_profile_class_init * - if the property's type needs special casing, add that to - * terminal_profile_mateconf_notify_cb and - * terminal_profile_mateconf_changeset_add + * terminal_profile_gsettings_notify_cb and + * terminal_profile_gsettings_changeset_add * - if necessary the default value cannot be handled via the paramspec, * handle that in terminal_profile_reset_property_internal */ @@ -89,45 +87,45 @@ enum LAST_PROP }; -#define KEY_ALLOW_BOLD "allow_bold" -#define KEY_BACKGROUND_COLOR "background_color" -#define KEY_BACKGROUND_DARKNESS "background_darkness" -#define KEY_BACKGROUND_IMAGE_FILE "background_image" -#define KEY_BACKGROUND_TYPE "background_type" -#define KEY_BACKSPACE_BINDING "backspace_binding" -#define KEY_BOLD_COLOR "bold_color" -#define KEY_BOLD_COLOR_SAME_AS_FG "bold_color_same_as_fg" -#define KEY_CURSOR_BLINK_MODE "cursor_blink_mode" -#define KEY_CURSOR_SHAPE "cursor_shape" -#define KEY_CUSTOM_COMMAND "custom_command" -#define KEY_DEFAULT_SHOW_MENUBAR "default_show_menubar" -#define KEY_DEFAULT_SIZE_COLUMNS "default_size_columns" -#define KEY_DEFAULT_SIZE_ROWS "default_size_rows" -#define KEY_DELETE_BINDING "delete_binding" -#define KEY_EXIT_ACTION "exit_action" +#define KEY_ALLOW_BOLD "allow-bold" +#define KEY_BACKGROUND_COLOR "background-color" +#define KEY_BACKGROUND_DARKNESS "background-darkness" +#define KEY_BACKGROUND_IMAGE_FILE "background-image" +#define KEY_BACKGROUND_TYPE "background-type" +#define KEY_BACKSPACE_BINDING "backspace-binding" +#define KEY_BOLD_COLOR "bold-color" +#define KEY_BOLD_COLOR_SAME_AS_FG "bold-color-same-as-fg" +#define KEY_CURSOR_BLINK_MODE "cursor-blink-mode" +#define KEY_CURSOR_SHAPE "cursor-shape" +#define KEY_CUSTOM_COMMAND "custom-command" +#define KEY_DEFAULT_SHOW_MENUBAR "default-show-menubar" +#define KEY_DEFAULT_SIZE_COLUMNS "default-size-columns" +#define KEY_DEFAULT_SIZE_ROWS "default-size-rows" +#define KEY_DELETE_BINDING "delete-binding" +#define KEY_EXIT_ACTION "exit-action" #define KEY_FONT "font" -#define KEY_FOREGROUND_COLOR "foreground_color" -#define KEY_LOGIN_SHELL "login_shell" +#define KEY_FOREGROUND_COLOR "foreground-color" +#define KEY_LOGIN_SHELL "login-shell" #define KEY_PALETTE "palette" -#define KEY_SCROLL_BACKGROUND "scroll_background" -#define KEY_SCROLLBACK_LINES "scrollback_lines" -#define KEY_SCROLLBACK_UNLIMITED "scrollback_unlimited" -#define KEY_SCROLLBAR_POSITION "scrollbar_position" -#define KEY_SCROLL_ON_KEYSTROKE "scroll_on_keystroke" -#define KEY_SCROLL_ON_OUTPUT "scroll_on_output" -#define KEY_SILENT_BELL "silent_bell" -#define KEY_TITLE_MODE "title_mode" +#define KEY_SCROLL_BACKGROUND "scroll-background" +#define KEY_SCROLLBACK_LINES "scrollback-lines" +#define KEY_SCROLLBACK_UNLIMITED "scrollback-unlimited" +#define KEY_SCROLLBAR_POSITION "scrollbar-position" +#define KEY_SCROLL_ON_KEYSTROKE "scroll-on-keystroke" +#define KEY_SCROLL_ON_OUTPUT "scroll-on-output" +#define KEY_SILENT_BELL "silent-bell" +#define KEY_TITLE_MODE "title-mode" #define KEY_TITLE "title" -#define KEY_UPDATE_RECORDS "update_records" -#define KEY_USE_CUSTOM_COMMAND "use_custom_command" -#define KEY_USE_CUSTOM_DEFAULT_SIZE "use_custom_default_size" -#define KEY_USE_SKEY "use_skey" -#define KEY_USE_SYSTEM_FONT "use_system_font" -#define KEY_USE_THEME_COLORS "use_theme_colors" -#define KEY_VISIBLE_NAME "visible_name" -#define KEY_WORD_CHARS "word_chars" - -/* Keep these in sync with the MateConf schema! */ +#define KEY_UPDATE_RECORDS "update-records" +#define KEY_USE_CUSTOM_COMMAND "use-custom-command" +#define KEY_USE_CUSTOM_DEFAULT_SIZE "use-custom-default-size" +#define KEY_USE_SKEY "use-skey" +#define KEY_USE_SYSTEM_FONT "use-system-font" +#define KEY_USE_THEME_COLORS "use-theme-colors" +#define KEY_VISIBLE_NAME "visible-name" +#define KEY_WORD_CHARS "word-chars" + +/* Keep these in sync with the GSettings schema! */ #define DEFAULT_ALLOW_BOLD (TRUE) #define DEFAULT_BACKGROUND_COLOR ("#FFFFDD") #define DEFAULT_BOLD_COLOR_SAME_AS_FG (TRUE) @@ -172,33 +170,19 @@ struct _TerminalProfilePrivate GValueArray *properties; gboolean *locked; - MateConfClient *conf; + GSettings *settings; char *profile_dir; - guint notify_id; GSList *dirty_pspecs; guint save_idle_id; - GParamSpec *mateconf_notification_pspec; + GParamSpec *gsettings_notification_pspec; gboolean background_load_failed; guint forgotten : 1; }; -/* We have to continue to use these since they're unfortunately different - * from the value nicks of the vte_terminal_erase_binding_get_type() enum type. - */ -static const MateConfEnumStringPair erase_bindings[] = -{ - { VTE_ERASE_AUTO, "auto" }, - { VTE_ERASE_ASCII_BACKSPACE, "control-h" }, - { VTE_ERASE_ASCII_DELETE, "ascii-del" }, - { VTE_ERASE_DELETE_SEQUENCE, "escape-sequence" }, - { VTE_ERASE_TTY, "tty" }, - { -1, NULL } -}; - static const GdkColor terminal_palettes[TERMINAL_PALETTE_N_BUILTINS][TERMINAL_PALETTE_SIZE] = { /* Tango palette */ @@ -302,7 +286,7 @@ static void ensure_pixbuf_property (TerminalProfile *profile, gboolean *load_failed); static guint signals[LAST_SIGNAL]; -static GQuark mateconf_key_quark; +static GQuark gsettings_key_quark; G_DEFINE_TYPE (TerminalProfile, terminal_profile, G_TYPE_OBJECT); @@ -531,119 +515,95 @@ terminal_profile_reset_property_internal (TerminalProfile *profile, } static void -terminal_profile_mateconf_notify_cb (MateConfClient *client, - guint cnxn_id, - MateConfEntry *entry, - gpointer user_data) +terminal_profile_gsettings_notify_cb (GSettings *settings, + gchar *key, + gpointer user_data) { TerminalProfile *profile = TERMINAL_PROFILE (user_data); TerminalProfilePrivate *priv = profile->priv; TerminalProfileClass *klass; - const char *key; - MateConfValue *mateconf_value; + GVariant *settings_value; GParamSpec *pspec; GValue value = { 0, }; gboolean equal; gboolean force_set = FALSE; - key = mateconf_entry_get_key (entry); - if (!key || !g_str_has_prefix (key, priv->profile_dir)) - return; + if (!key) return; _terminal_debug_print (TERMINAL_DEBUG_PROFILE, - "MateConf notification for key %s [%s]\n", + "GSettings notification for key %s [%s]\n", key, - mateconf_entry_get_is_writable (entry) ? "writable" : "LOCKED"); - - key += strlen (priv->profile_dir); - if (!key[0]) - return; + g_settings_is_writable (settings, key) ? "writable" : "LOCKED"); - key++; klass = TERMINAL_PROFILE_GET_CLASS (profile); - pspec = g_hash_table_lookup (klass->mateconf_keys, key); + pspec = g_hash_table_lookup (klass->gsettings_keys, key); if (!pspec) return; /* ignore unknown keys, for future extensibility */ - priv->locked[pspec->param_id] = !mateconf_entry_get_is_writable (entry); + priv->locked[pspec->param_id] = !g_settings_is_writable (settings, key); - mateconf_value = mateconf_entry_get_value (entry); - if (!mateconf_value) + settings_value = g_settings_get_value (settings, key); + if (!settings_value) return; g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); if (G_IS_PARAM_SPEC_BOOLEAN (pspec)) { - if (mateconf_value->type != MATECONF_VALUE_BOOL) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_BOOLEAN)) goto out; - g_value_set_boolean (&value, mateconf_value_get_bool (mateconf_value)); + g_value_set_boolean (&value, g_variant_get_boolean (settings_value)); } else if (G_IS_PARAM_SPEC_STRING (pspec)) { - if (mateconf_value->type != MATECONF_VALUE_STRING) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING)) goto out; - g_value_set_string (&value, mateconf_value_get_string (mateconf_value)); + g_value_set_string (&value, g_variant_get_string (settings_value, NULL)); } else if (G_IS_PARAM_SPEC_ENUM (pspec)) { - const GEnumValue *eval; - int enum_value; - - if (mateconf_value->type != MATECONF_VALUE_STRING) - goto out; - eval = g_enum_get_value_by_nick (G_PARAM_SPEC_ENUM (pspec)->enum_class, - mateconf_value_get_string (mateconf_value)); - if (eval) - enum_value = eval->value; - else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == vte_terminal_erase_binding_get_type ()) - { - /* Backward compatibility */ - if (!mateconf_string_to_enum ((MateConfEnumStringPair*) erase_bindings, - mateconf_value_get_string (mateconf_value), - &enum_value)) - goto out; - } - else + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING)) goto out; - g_value_set_enum (&value, enum_value); + g_value_set_enum (&value, g_settings_get_enum (settings, key)); } else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_COLOR) { GdkColor color; - if (mateconf_value->type != MATECONF_VALUE_STRING) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING)) goto out; - if (!gdk_color_parse (mateconf_value_get_string (mateconf_value), &color)) + if (!gdk_color_parse (g_variant_get_string (settings_value, NULL), &color)) goto out; g_value_set_boxed (&value, &color); } else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == PANGO_TYPE_FONT_DESCRIPTION) { - if (mateconf_value->type != MATECONF_VALUE_STRING) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING)) goto out; - g_value_take_boxed (&value, pango_font_description_from_string (mateconf_value_get_string (mateconf_value))); + g_value_take_boxed (&value, pango_font_description_from_string (g_variant_get_string (settings_value, NULL))); } else if (G_IS_PARAM_SPEC_DOUBLE (pspec)) { - if (mateconf_value->type != MATECONF_VALUE_FLOAT) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_DOUBLE)) goto out; - g_value_set_double (&value, mateconf_value_get_float (mateconf_value)); + g_value_set_double (&value, g_variant_get_double (settings_value)); } else if (G_IS_PARAM_SPEC_INT (pspec)) { - if (mateconf_value->type != MATECONF_VALUE_INT) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_INT16) && + !g_variant_is_of_type (settings_value, G_VARIANT_TYPE_INT32) && + !g_variant_is_of_type (settings_value, G_VARIANT_TYPE_INT64)) goto out; - g_value_set_int (&value, mateconf_value_get_int (mateconf_value)); + g_value_set_int (&value, g_settings_get_int(settings, key)); } else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) && G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_COLOR) @@ -652,10 +612,10 @@ terminal_profile_mateconf_notify_cb (MateConfClient *client, GdkColor *colors; int n_colors, i; - if (mateconf_value->type != MATECONF_VALUE_STRING) + if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING)) goto out; - color_strings = g_strsplit (mateconf_value_get_string (mateconf_value), ":", -1); + color_strings = g_strsplit (g_variant_get_string (settings_value, NULL), ":", -1); if (!color_strings) goto out; @@ -684,8 +644,8 @@ terminal_profile_mateconf_notify_cb (MateConfClient *client, if (g_param_value_validate (pspec, &value)) { _terminal_debug_print (TERMINAL_DEBUG_PROFILE, - "Invalid value in mateconf for key %s was changed to comply with pspec %s\n", - mateconf_entry_get_key (entry), pspec->name); + "Invalid value in GSettings for key %s was changed to comply with pspec %s\n", + key, pspec->name); force_set = TRUE; } @@ -710,9 +670,9 @@ terminal_profile_mateconf_notify_cb (MateConfClient *client, if (!equal || force_set) { - priv->mateconf_notification_pspec = pspec; + priv->gsettings_notification_pspec = pspec; g_object_set_property (G_OBJECT (profile), pspec->name, &value); - priv->mateconf_notification_pspec = NULL; + priv->gsettings_notification_pspec = NULL; } out: @@ -721,15 +681,15 @@ out: */ g_value_unset (&value); + g_variant_unref (settings_value); } static void -terminal_profile_mateconf_changeset_add (TerminalProfile *profile, - MateConfChangeSet *changeset, +terminal_profile_gsettings_changeset_add (TerminalProfile *profile, + GSettings *changeset, GParamSpec *pspec) { TerminalProfilePrivate *priv = profile->priv; - const char *mateconf_key; char *key; const GValue *value; @@ -738,50 +698,36 @@ terminal_profile_mateconf_changeset_add (TerminalProfile *profile, if (priv->locked[pspec->param_id]) return; - if (!mateconf_client_key_is_writable (priv->conf, mateconf_key, NULL)) + if (!g_settings_is_writable (priv->settings, gsettings_key, NULL)) return; #endif - mateconf_key = g_param_spec_get_qdata (pspec, mateconf_key_quark); - if (!mateconf_key) + key = g_param_spec_get_qdata (pspec, gsettings_key_quark); + if (!key) return; - key = mateconf_concat_dir_and_key (priv->profile_dir, mateconf_key); value = g_value_array_get_nth (priv->properties, pspec->param_id); _terminal_debug_print (TERMINAL_DEBUG_PROFILE, - "Adding pspec %s with value %s to the mateconf changeset\n", + "Adding pspec %s with value %s to the GSettings changeset\n", pspec->name, g_strdup_value_contents (value)); if (G_IS_PARAM_SPEC_BOOLEAN (pspec)) - mateconf_change_set_set_bool (changeset, key, g_value_get_boolean (value)); + g_settings_set_boolean (changeset, key, g_value_get_boolean (value)); else if (G_IS_PARAM_SPEC_STRING (pspec)) { const char *str; str = g_value_get_string (value); - mateconf_change_set_set_string (changeset, key, str ? str : ""); + g_settings_set_string (changeset, key, str ? str : ""); } else if (G_IS_PARAM_SPEC_ENUM (pspec)) { const GEnumValue *eval; - const char *string; eval = g_enum_get_value (G_PARAM_SPEC_ENUM (pspec)->enum_class, g_value_get_enum (value)); - if (G_PARAM_SPEC_VALUE_TYPE (pspec) == vte_terminal_erase_binding_get_type ()) - { - /* Backward compatibility */ - string = mateconf_enum_to_string ((MateConfEnumStringPair*) erase_bindings, g_value_get_enum (value)); - if (!string) - goto cleanup; - } - else if (eval) - string = eval->value_nick; - else - goto cleanup; - - mateconf_change_set_set_string (changeset, key, string); + g_settings_set_enum (changeset, key, eval->value); } else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_COLOR) { @@ -798,7 +744,7 @@ terminal_profile_mateconf_changeset_add (TerminalProfile *profile, color->green, color->blue); - mateconf_change_set_set_string (changeset, key, str); + g_settings_set_string (changeset, key, str); } else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == PANGO_TYPE_FONT_DESCRIPTION) { @@ -810,13 +756,13 @@ terminal_profile_mateconf_changeset_add (TerminalProfile *profile, goto cleanup; font = pango_font_description_to_string (font_desc); - mateconf_change_set_set_string (changeset, key, font); + g_settings_set_string (changeset, key, font); g_free (font); } else if (G_IS_PARAM_SPEC_DOUBLE (pspec)) - mateconf_change_set_set_float (changeset, key, (float) g_value_get_double (value)); + g_settings_set_double (changeset, key, g_value_get_double (value)); else if (G_IS_PARAM_SPEC_INT (pspec)) - mateconf_change_set_set_int (changeset, key, g_value_get_int (value)); + g_settings_set_int (changeset, key, g_value_get_int (value)); else if (G_IS_PARAM_SPEC_VALUE_ARRAY (pspec) && G_PARAM_SPEC_VALUE_TYPE (G_PARAM_SPEC_VALUE_ARRAY (pspec)->element_spec) == GDK_TYPE_COLOR) { @@ -852,27 +798,28 @@ terminal_profile_mateconf_changeset_add (TerminalProfile *profile, color->blue); } - mateconf_change_set_set_string (changeset, key, string->str); + g_settings_set_string (changeset, key, string->str); g_string_free (string, TRUE); } else g_printerr ("Unhandled value type %s of pspec %s\n", g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), pspec->name); cleanup: - g_free (key); + return; } static void terminal_profile_save (TerminalProfile *profile) { TerminalProfilePrivate *priv = profile->priv; - MateConfChangeSet *changeset; + GSettings *changeset; GSList *l; GError *error = NULL; priv->save_idle_id = 0; - - changeset = mateconf_change_set_new (); + changeset = g_settings_new_with_path (CONF_PROFILE_SCHEMA, + g_strconcat (CONF_PROFILE_PREFIX, priv->profile_dir,"/", NULL)); + g_settings_delay (changeset); for (l = priv->dirty_pspecs; l != NULL; l = l->next) { @@ -884,19 +831,14 @@ terminal_profile_save (TerminalProfile *profile) if ((pspec->flags & G_PARAM_WRITABLE) == 0) continue; - terminal_profile_mateconf_changeset_add (profile, changeset, pspec); + terminal_profile_gsettings_changeset_add (profile, changeset, pspec); } g_slist_free (priv->dirty_pspecs); priv->dirty_pspecs = NULL; - if (!mateconf_client_commit_change_set (priv->conf, changeset, TRUE, &error)) - { - g_message ("Failed to commit the changeset to mateconf: %s", error->message); - g_error_free (error); - } - - mateconf_change_set_unref (changeset); + g_settings_apply (changeset); + g_object_unref (changeset); } static gboolean @@ -935,10 +877,7 @@ terminal_profile_init (TerminalProfile *profile) priv = profile->priv = G_TYPE_INSTANCE_GET_PRIVATE (profile, TERMINAL_TYPE_PROFILE, TerminalProfilePrivate); - priv->mateconf_notification_pspec = NULL; - - priv->conf = mateconf_client_get_default (); - + priv->gsettings_notification_pspec = NULL; priv->locked = g_new0 (gboolean, LAST_PROP); priv->properties = g_value_array_new (LAST_PROP); @@ -992,14 +931,21 @@ terminal_profile_constructor (GType type, name = g_value_get_string (g_value_array_get_nth (priv->properties, PROP_NAME)); g_assert (name != NULL); - /* Now load those properties from mateconf that were not set as construction params */ + priv->settings = g_settings_new_with_path (CONF_PROFILE_SCHEMA, + g_strconcat (CONF_PROFILE_PREFIX, name, "/", NULL)); + g_assert (priv->settings != NULL); + g_signal_connect (priv->settings, + g_strconcat("changed::", priv->profile_dir, "/", NULL), + G_CALLBACK(terminal_profile_gsettings_notify_cb), + profile); + + /* Now load those properties from GSettings that were not set as construction params */ pspecs = g_object_class_list_properties (G_OBJECT_CLASS (TERMINAL_PROFILE_GET_CLASS (profile)), &n_pspecs); for (i = 0; i < n_pspecs; ++i) { GParamSpec *pspec = pspecs[i]; guint j; gboolean is_construct = FALSE; - const char *mateconf_key; char *key; if (pspec->owner_type != TERMINAL_TYPE_PROFILE) @@ -1019,13 +965,11 @@ terminal_profile_constructor (GType type, if (is_construct) continue; - mateconf_key = g_param_spec_get_qdata (pspec, mateconf_key_quark); - if (!mateconf_key) + key = g_param_spec_get_qdata (pspec, gsettings_key_quark); + if (!key) continue; - key = mateconf_concat_dir_and_key (priv->profile_dir, mateconf_key); - mateconf_client_notify (priv->conf, key); - g_free (key); + terminal_profile_gsettings_notify_cb (priv->settings, key, profile); } g_free (pspecs); @@ -1039,8 +983,9 @@ terminal_profile_finalize (GObject *object) TerminalProfile *profile = TERMINAL_PROFILE (object); TerminalProfilePrivate *priv = profile->priv; - mateconf_client_notify_remove (priv->conf, priv->notify_id); - priv->notify_id = 0; + g_signal_handlers_disconnect_by_func (priv->settings, + G_CALLBACK(terminal_profile_gsettings_notify_cb), + profile); if (priv->save_idle_id) { @@ -1052,7 +997,7 @@ terminal_profile_finalize (GObject *object) _terminal_profile_forget (profile); - g_object_unref (priv->conf); + g_object_unref (priv->settings); g_free (priv->profile_dir); g_free (priv->locked); @@ -1142,18 +1087,19 @@ terminal_profile_set_property (GObject *object, const char *name = g_value_get_string (value); g_assert (name != NULL); - priv->profile_dir = mateconf_concat_dir_and_key (CONF_PROFILES_PREFIX, name); - - mateconf_client_add_dir (priv->conf, priv->profile_dir, - MATECONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - priv->notify_id = - mateconf_client_notify_add (priv->conf, - priv->profile_dir, - terminal_profile_mateconf_notify_cb, - profile, NULL, - NULL); - + priv->profile_dir = g_strdup (name); + if (priv->settings != NULL) { + g_signal_handlers_disconnect_by_func (priv->settings, + G_CALLBACK(terminal_profile_gsettings_notify_cb), + profile); + g_object_unref (priv->settings); + priv->settings = g_settings_new_with_path (CONF_PROFILE_SCHEMA, + g_strconcat (CONF_PROFILE_PREFIX, priv->profile_dir, "/", NULL)); + g_signal_connect (priv->settings, + g_strconcat("changed::", priv->profile_dir, "/", NULL), + G_CALLBACK(terminal_profile_gsettings_notify_cb), + profile); + } break; } @@ -1185,8 +1131,8 @@ terminal_profile_notify (GObject *object, if (pspec->owner_type == TERMINAL_TYPE_PROFILE && (pspec->flags & G_PARAM_WRITABLE) && - g_param_spec_get_qdata (pspec, mateconf_key_quark) != NULL && - pspec != priv->mateconf_notification_pspec) + g_param_spec_get_qdata (pspec, gsettings_key_quark) != NULL && + pspec != priv->gsettings_notification_pspec) terminal_profile_schedule_save (TERMINAL_PROFILE (object), pspec); } @@ -1195,7 +1141,7 @@ terminal_profile_class_init (TerminalProfileClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - mateconf_key_quark = g_quark_from_static_string ("GT::MateConfKey"); + gsettings_key_quark = g_quark_from_static_string ("GT::GSettingsKey"); g_type_class_add_private (object_class, sizeof (TerminalProfilePrivate)); @@ -1214,88 +1160,88 @@ terminal_profile_class_init (TerminalProfileClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - /* mateconf_key -> pspec hash */ - klass->mateconf_keys = g_hash_table_new (g_str_hash, g_str_equal); + /* gsettings_key -> pspec hash */ + klass->gsettings_keys = g_hash_table_new (g_str_hash, g_str_equal); #define TERMINAL_PROFILE_PSPEC_STATIC (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB) -#define TERMINAL_PROFILE_PROPERTY(propId, propSpec, propMateConf) \ +#define TERMINAL_PROFILE_PROPERTY(propId, propSpec, propGSettings) \ {\ GParamSpec *pspec = propSpec;\ g_object_class_install_property (object_class, propId, pspec);\ \ - if (propMateConf)\ + if (propGSettings)\ {\ - g_param_spec_set_qdata (pspec, mateconf_key_quark, (gpointer) propMateConf);\ - g_hash_table_insert (klass->mateconf_keys, (gpointer) propMateConf, pspec);\ + g_param_spec_set_qdata (pspec, gsettings_key_quark, (gpointer) propGSettings);\ + g_hash_table_insert (klass->gsettings_keys, (gpointer) propGSettings, pspec);\ }\ } -#define TERMINAL_PROFILE_PROPERTY_BOOLEAN(prop, propDefault, propMateConf) \ +#define TERMINAL_PROFILE_PROPERTY_BOOLEAN(prop, propDefault, propGSettings) \ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_boolean (TERMINAL_PROFILE_##prop, NULL, NULL,\ propDefault,\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_BOXED(prop, propType, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_BOXED(prop, propType, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_boxed (TERMINAL_PROFILE_##prop, NULL, NULL,\ propType,\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_DOUBLE(prop, propMin, propMax, propDefault, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_DOUBLE(prop, propMin, propMax, propDefault, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_double (TERMINAL_PROFILE_##prop, NULL, NULL,\ propMin, propMax, propDefault,\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_ENUM(prop, propType, propDefault, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_ENUM(prop, propType, propDefault, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_enum (TERMINAL_PROFILE_##prop, NULL, NULL,\ propType, propDefault,\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_INT(prop, propMin, propMax, propDefault, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_INT(prop, propMin, propMax, propDefault, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_int (TERMINAL_PROFILE_##prop, NULL, NULL,\ propMin, propMax, propDefault,\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) /* these are all read-only */ -#define TERMINAL_PROFILE_PROPERTY_OBJECT(prop, propType, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_OBJECT(prop, propType, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_object (TERMINAL_PROFILE_##prop, NULL, NULL,\ propType,\ G_PARAM_READABLE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_STRING(prop, propDefault, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_STRING(prop, propDefault, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_string (TERMINAL_PROFILE_##prop, NULL, NULL,\ propDefault,\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_STRING_CO(prop, propDefault, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_STRING_CO(prop, propDefault, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_string (TERMINAL_PROFILE_##prop, NULL, NULL,\ propDefault,\ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) -#define TERMINAL_PROFILE_PROPERTY_VALUE_ARRAY_BOXED(prop, propElementName, propElementType, propMateConf)\ +#define TERMINAL_PROFILE_PROPERTY_VALUE_ARRAY_BOXED(prop, propElementName, propElementType, propGSettings)\ TERMINAL_PROFILE_PROPERTY (PROP_##prop,\ g_param_spec_value_array (TERMINAL_PROFILE_##prop, NULL, NULL,\ g_param_spec_boxed (propElementName, NULL, NULL,\ propElementType, \ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ G_PARAM_READWRITE | TERMINAL_PROFILE_PSPEC_STATIC),\ - propMateConf) + propGSettings) TERMINAL_PROFILE_PROPERTY_BOOLEAN (ALLOW_BOLD, DEFAULT_ALLOW_BOLD, KEY_ALLOW_BOLD); TERMINAL_PROFILE_PROPERTY_BOOLEAN (BOLD_COLOR_SAME_AS_FG, DEFAULT_BOLD_COLOR_SAME_AS_FG, KEY_BOLD_COLOR_SAME_AS_FG); @@ -1363,10 +1309,6 @@ _terminal_profile_forget (TerminalProfile *profile) if (!priv->forgotten) { - mateconf_client_remove_dir (priv->conf, - priv->profile_dir, - NULL); - priv->forgotten = TRUE; g_signal_emit (G_OBJECT (profile), signals[FORGOTTEN], 0); @@ -1397,7 +1339,7 @@ _terminal_profile_clone (TerminalProfile *base_profile, profile_num = 0; do { - g_snprintf (profile_name, sizeof (profile_name), "Profile%u", profile_num++); + g_snprintf (profile_name, sizeof (profile_name), "profile%u", profile_num++); } while (terminal_app_get_profile_by_name (app, profile_name) != NULL); @@ -1439,7 +1381,7 @@ _terminal_profile_clone (TerminalProfile *base_profile, for (i = 0; i < n_params; ++i) g_value_unset (¶ms[i].value); - /* Flush the new profile to mateconf */ + /* Flush the new profile to GSettings */ new_priv = new_profile->priv; g_slist_free (new_priv->dirty_pspecs); diff --git a/src/terminal-profile.h b/src/terminal-profile.h index e7ac3bf..0aa2e5e 100644 --- a/src/terminal-profile.h +++ b/src/terminal-profile.h @@ -131,7 +131,7 @@ struct _TerminalProfileClass void (* forgotten) (TerminalProfile *profile); - GHashTable *mateconf_keys; + GHashTable *gsettings_keys; }; GType terminal_profile_get_type (void); diff --git a/src/terminal-util.c b/src/terminal-util.c index ea93a98..27f9b79 100644 --- a/src/terminal-util.c +++ b/src/terminal-util.c @@ -32,8 +32,6 @@ #include #include -#include - #ifdef GDK_WINDOWING_X11 #include #include @@ -527,11 +525,11 @@ terminal_util_key_file_get_argv (GKeyFile *key_file, /* Proxy stuff */ static char * -conf_get_string (MateConfClient *conf, +gsettings_get_string (GSettings *settings, const char *key) { char *value; - value = mateconf_client_get_string (conf, key, NULL); + value = g_settings_get_string (settings, key); if (G_UNLIKELY (value && *value == '\0')) { g_free (value); @@ -590,30 +588,30 @@ set_proxy_env (GHashTable *env_table, static void setup_http_proxy_env (GHashTable *env_table, - MateConfClient *conf) + GSettings *settings_http) { gchar *host; gint port; GSList *ignore; - if (!mateconf_client_get_bool (conf, CONF_HTTP_PROXY_PREFIX "/use_http_proxy", NULL)) + if (!g_settings_get_boolean (settings_http, "use-http-proxy")) return; - host = conf_get_string (conf, CONF_HTTP_PROXY_PREFIX "/host"); - port = mateconf_client_get_int (conf, CONF_HTTP_PROXY_PREFIX "/port", NULL); + host = gsettings_get_string (settings_http, "host"); + port = g_settings_get_int (settings_http, "port"); if (host && port) { GString *buf = g_string_sized_new (64); g_string_append (buf, "http://"); - if (mateconf_client_get_bool (conf, CONF_HTTP_PROXY_PREFIX "/use_authentication", NULL)) + if (g_settings_get_boolean (settings_http, "use-authentication")) { char *user, *password; - user = conf_get_string (conf, CONF_HTTP_PROXY_PREFIX "/authentication_user"); + user = gsettings_get_string (settings_http, "authentication-user"); if (user) { g_string_append_uri_escaped (buf, user, NULL, TRUE); - password = conf_get_string (conf, CONF_HTTP_PROXY_PREFIX "/authentication_password"); + password = gsettings_get_string (settings_http, "authentication-password"); if (password) { g_string_append_c (buf, ':'); @@ -629,7 +627,7 @@ setup_http_proxy_env (GHashTable *env_table, } g_free (host); - ignore = mateconf_client_get_list (conf, CONF_HTTP_PROXY_PREFIX "/ignore_hosts", MATECONF_VALUE_STRING, NULL); + ignore = terminal_gsettings_strv_to_gslist (g_settings_get_strv (settings_http, "ignore-hosts")); if (ignore) { GString *buf = g_string_sized_new (64); @@ -652,13 +650,13 @@ setup_http_proxy_env (GHashTable *env_table, static void setup_https_proxy_env (GHashTable *env_table, - MateConfClient *conf) + GSettings *settings) { gchar *host; gint port; - host = conf_get_string (conf, CONF_PROXY_PREFIX "/secure_host"); - port = mateconf_client_get_int (conf, CONF_PROXY_PREFIX "/secure_port", NULL); + host = gsettings_get_string (settings, "secure-host"); + port = g_settings_get_int (settings, "secure-port"); if (host && port) { char *proxy; @@ -671,13 +669,13 @@ setup_https_proxy_env (GHashTable *env_table, static void setup_ftp_proxy_env (GHashTable *env_table, - MateConfClient *conf) + GSettings *settings) { gchar *host; gint port; - host = conf_get_string (conf, CONF_PROXY_PREFIX "/ftp_host"); - port = mateconf_client_get_int (conf, CONF_PROXY_PREFIX "/ftp_port", NULL); + host = gsettings_get_string (settings, "ftp-host"); + port = g_settings_get_int (settings, "ftp-port"); if (host && port) { char *proxy; @@ -690,13 +688,13 @@ setup_ftp_proxy_env (GHashTable *env_table, static void setup_socks_proxy_env (GHashTable *env_table, - MateConfClient *conf) + GSettings *settings) { gchar *host; gint port; - host = conf_get_string (conf, CONF_PROXY_PREFIX "/socks_host"); - port = mateconf_client_get_int (conf, CONF_PROXY_PREFIX "/socks_port", NULL); + host = gsettings_get_string (settings, "socks-host"); + port = g_settings_get_int (settings, "socks-port"); if (host && port) { char *proxy; @@ -708,12 +706,12 @@ setup_socks_proxy_env (GHashTable *env_table, static void setup_autoconfig_proxy_env (GHashTable *env_table, - MateConfClient *conf) + GSettings *settings) { /* XXX Not sure what to do with this. See bug #596688. gchar *url; - url = conf_get_string (conf, CONF_PROXY_PREFIX "/autoconfig_url"); + url = gsettings_get_string (settings, "autoconfig-url"); if (url) { char *proxy; @@ -735,25 +733,27 @@ terminal_util_add_proxy_env (GHashTable *env_table) { char *proxymode; - MateConfClient *conf; - conf = mateconf_client_get_default (); + GSettings *settings, *settings_http; + settings = g_settings_new (CONF_PROXY_SCHEMA); + settings_http = g_settings_new (CONF_HTTP_PROXY_SCHEMA); /* If mode is not manual, nothing to set */ - proxymode = conf_get_string (conf, CONF_PROXY_PREFIX "/mode"); + proxymode = gsettings_get_string (settings, "mode"); if (proxymode && 0 == strcmp (proxymode, "manual")) { - setup_http_proxy_env (env_table, conf); - setup_https_proxy_env (env_table, conf); - setup_ftp_proxy_env (env_table, conf); - setup_socks_proxy_env (env_table, conf); + setup_http_proxy_env (env_table, settings_http); + setup_https_proxy_env (env_table, settings); + setup_ftp_proxy_env (env_table, settings); + setup_socks_proxy_env (env_table, settings); } else if (proxymode && 0 == strcmp (proxymode, "auto")) { - setup_autoconfig_proxy_env (env_table, conf); + setup_autoconfig_proxy_env (env_table, settings); } g_free (proxymode); - g_object_unref (conf); + g_object_unref (settings); + g_object_unref (settings_http); } /* Bidirectional object/widget binding */ diff --git a/src/terminal-util.h b/src/terminal-util.h index 24a5a81..1e54388 100644 --- a/src/terminal-util.h +++ b/src/terminal-util.h @@ -22,14 +22,13 @@ #define TERMINAL_UTIL_H #include -#include #include "terminal-screen.h" G_BEGIN_DECLS -#define CONF_PROXY_PREFIX "/system/proxy" -#define CONF_HTTP_PROXY_PREFIX "/system/http_proxy" +#define CONF_PROXY_SCHEMA "org.gnome.system.proxy" +#define CONF_HTTP_PROXY_SCHEMA "org.gnome.system.proxy.http" void terminal_util_set_unique_role (GtkWindow *window, const char *prefix); diff --git a/src/terminal-window.c b/src/terminal-window.c index cd10b59..b33e33c 100644 --- a/src/terminal-window.c +++ b/src/terminal-window.c @@ -3204,7 +3204,7 @@ confirm_close_window_or_tab (TerminalWindow *window, { TerminalWindowPrivate *priv = window->priv; GtkWidget *dialog; - MateConfClient *client; + GSettings *settings; gboolean do_confirm; int n_tabs; @@ -3215,9 +3215,9 @@ confirm_close_window_or_tab (TerminalWindow *window, GTK_RESPONSE_DELETE_EVENT); } - client = mateconf_client_get_default (); - do_confirm = mateconf_client_get_bool (client, CONF_GLOBAL_PREFIX "/confirm_window_close", NULL); - g_object_unref (client); + settings = g_settings_new (CONF_GLOBAL_SCHEMA); + do_confirm = g_settings_get_boolean (settings, "confirm-window-close"); + g_object_unref (settings); if (!do_confirm) return FALSE; diff --git a/src/terminal.c b/src/terminal.c index 8504422..7434229 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -409,7 +409,7 @@ name_lost_cb (GDBusConnection *connection, * /apps/mate-terminal/profiles/Foo/ * * It's somewhat tricky to manage the profiles/ dir since we need to track - * the list of profiles, but mateconf doesn't have a concept of notifying that + * the list of profiles, but GSettings doesn't have a concept of notifying that * a directory has appeared or disappeared. * * Session state is stored entirely in the RestartCommand command line. @@ -419,7 +419,7 @@ name_lost_cb (GDBusConnection *connection, * OVERLAP. The UI and implementation totally break if you overlap * these categories. See mate-terminal 1.x for why. * - * Don't use this code as an example of how to use MateConf - it's hugely + * Don't use this code as an example of how to use GSettings - it's hugely * overcomplicated due to the profiles stuff. Most apps should not * have to do scary things of this nature, and should not have * a profiles feature. @@ -519,9 +519,6 @@ main (int argc, char **argv) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - /* MateConf uses MateCORBA2 which need GThread. See bug #565516 */ - g_thread_init (NULL); - _terminal_debug_init (); /* Make a NULL-terminated copy since we may need it later */ -- cgit v1.2.1