Elimino mas gsettings.
parent
60d514fb47
commit
5dccb37026
|
@ -9,7 +9,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
|
|||
--disable-silent-rules \
|
||||
CFLAGS='-Wno-deprecated-declarations'
|
||||
|
||||
@INTLTOOL_XML_RULE@
|
||||
#INTLTOOL_XML_RULE@
|
||||
appdatadir = $(datadir)/metainfo
|
||||
appdata_in_files = gatuno-terminal.appdata.xml.in
|
||||
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
|
||||
|
@ -17,20 +17,21 @@ appdata_DATA = $(appdata_in_files:.xml.in=.xml)
|
|||
desktopdir = $(datadir)/applications
|
||||
desktop_in_files = @PACKAGE@.desktop.in.in
|
||||
desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
#INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
man_MANS = gatuno-terminal.1
|
||||
|
||||
bin_SCRIPTS = gatuno-terminal.wrapper
|
||||
|
||||
EXTRA_DIST = \
|
||||
config.rpath \
|
||||
xmldocs.make \
|
||||
omf.make \
|
||||
gatuno-terminal.wrapper \
|
||||
$(appdata_in_files) \
|
||||
$(man_MANS) \
|
||||
$(NULL)
|
||||
# autogen.sh \
|
||||
# autogen.sh
|
||||
|
||||
CLEANFILES = \
|
||||
gatuno-terminal.appdata.xml \
|
||||
|
|
|
@ -29,7 +29,7 @@ PKG_PROG_PKG_CONFIG
|
|||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AM_PROG_LIBTOOL
|
||||
IT_PROG_INTLTOOL([0.50.1])
|
||||
#IT_PROG_INTLTOOL([0.50.1])
|
||||
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
|
|
|
@ -142,15 +142,11 @@ terminal-marshal.c: $(srcdir)/terminal-marshal.list
|
|||
terminal-resources.h terminal-resources.c: terminal.gresource.xml Makefile $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir $(srcdir) $(srcdir)/terminal.gresource.xml)
|
||||
$(AM_V_GEN) XMLLINT=$(XMLLINT) $(GLIB_COMPILE_RESOURCES) --target $@ --sourcedir $(srcdir) --generate --c-name terminal $<
|
||||
|
||||
gsettingsschema_in_files = org.mate.terminal.gschema.xml.in
|
||||
gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
|
||||
.PRECIOUS: $(gsettings_SCHEMAS)
|
||||
@INTLTOOL_XML_NOMERGE_RULE@
|
||||
#INTLTOOL_XML_NOMERGE_RULE@
|
||||
|
||||
CLEANFILES = \
|
||||
stamp-terminal-type-builtins.h \
|
||||
mate-terminal.schemas \
|
||||
$(gsettings_SCHEMAS) \
|
||||
stamp-terminal-type-builtins.h \
|
||||
$(BUILT_SOURCES)
|
||||
|
||||
|
@ -171,13 +167,8 @@ EXTRA_DIST = \
|
|||
extra-strings.c \
|
||||
$(about_DATA) \
|
||||
$(schema_in_files) \
|
||||
$(gsettingsschema_in_files) \
|
||||
$(uimanager_DATA) \
|
||||
$(builder_DATA) \
|
||||
$(NULL)
|
||||
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
@INTLTOOL_SCHEMAS_RULE@
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
|
|
@ -1,484 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<schemalist gettext-domain="@GETTEXT_PACKAGE@">
|
||||
<enum id="org.mate.terminal.erasebinding">
|
||||
<value nick="auto" value="0"/>
|
||||
<value nick="control-h" value="1"/>
|
||||
<value nick="ascii-del" value="2"/>
|
||||
<value nick="escape-sequence" value="3"/>
|
||||
<value nick="tty" value="4"/>
|
||||
</enum>
|
||||
<enum id="org.mate.terminal.titlemode">
|
||||
<value nick="replace" value="0"/>
|
||||
<value nick="before" value="1"/>
|
||||
<value nick="after" value="2"/>
|
||||
<value nick="ignore" value="3"/>
|
||||
</enum>
|
||||
<enum id="org.mate.terminal.scrollbar-position">
|
||||
<value nick="left" value="0"/>
|
||||
<value nick="right" value="1"/>
|
||||
<value nick="hidden" value="2"/>
|
||||
</enum>
|
||||
<enum id="org.mate.terminal.exit-action">
|
||||
<value nick="close" value="0"/>
|
||||
<value nick="restart" value="1"/>
|
||||
<value nick="hold" value="2"/>
|
||||
</enum>
|
||||
<enum id="org.mate.terminal.cursor-shape">
|
||||
<value nick="block" value="0"/>
|
||||
<value nick="ibeam" value="1"/>
|
||||
<value nick="underline" value="2"/>
|
||||
</enum>
|
||||
<enum id="org.mate.terminal.cursor-blink-mode">
|
||||
<value nick="system" value="0"/>
|
||||
<value nick="on" value="1"/>
|
||||
<value nick="off" value="2"/>
|
||||
</enum>
|
||||
<enum id="org.mate.terminal.background-type">
|
||||
<value nick="solid" value="0"/>
|
||||
<value nick="image" value="1"/>
|
||||
<value nick="transparent" value="2"/>
|
||||
</enum>
|
||||
<schema id="org.mate.terminal" path="/org/mate/terminal/">
|
||||
<child name="global" schema="org.mate.terminal.global"/>
|
||||
<child name="profiles" schema="org.mate.terminal.profiles"/>
|
||||
<child name="keybindings" schema="org.mate.terminal.keybindings"/>
|
||||
</schema>
|
||||
<schema id="org.mate.terminal.global" path="/org/mate/terminal/global/">
|
||||
<key name="profile-list" type="as">
|
||||
<default>[ 'default' ]</default>
|
||||
<summary>List of profiles</summary>
|
||||
<description>List of profiles known to mate-terminal. The list contains strings naming subdirectories relative to /org/mate/terminal/profiles.</description>
|
||||
</key>
|
||||
<key name="default-profile" type="s">
|
||||
<default>'default'</default>
|
||||
<summary>Profile to use for new terminals</summary>
|
||||
<description>Profile to be used when opening a new window or tab. Must be in profile_list.</description>
|
||||
</key>
|
||||
<key name="use-mnemonics" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether the menubar has access keys</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="use-menu-accelerators" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether the standard GTK+ shortcut for menubar access is enabled</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="active-encodings" type="as">
|
||||
<default context="active-encodings" l10n="messages">[ 'UTF-8', 'current' ]</default>
|
||||
<summary>List of available encodings</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="confirm-window-close" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to ask for confirmation when closing terminal windows</summary>
|
||||
<description>Whether to ask for confirmation when closing a terminal window which has more than one open tab or any foreground subprocesses.</description>
|
||||
</key>
|
||||
<key name="middle-click-closes-tabs" type="b">
|
||||
<default>false</default>
|
||||
<summary>Close tabs with middle click</summary>
|
||||
<description>If true, it enables the ability to close tabs using middle click.</description>
|
||||
</key>
|
||||
<key name="ctrl-tab-switch-tabs" type="b">
|
||||
<default>false</default>
|
||||
<summary>Switch tabs with [Ctrl]+[Tab]</summary>
|
||||
<description>If true, it enables the ability to switch tabs using [Ctrl+Tab] and [Ctrl+Shift+Tab].</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.mate.terminal.profiles" path="/org/mate/terminal/profiles/">
|
||||
</schema>
|
||||
<schema id="org.mate.terminal.profile">
|
||||
<key name="visible-name" type="s">
|
||||
<default context="visible-name" l10n="messages">'Default'</default>
|
||||
<summary>Human-readable name of the profile</summary>
|
||||
<description>Human-readable name of the profile.</description>
|
||||
</key>
|
||||
<key name="default-show-menubar" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to show menubar in new windows/tabs</summary>
|
||||
<description>True if the menubar should be shown in new windows, for windows/tabs with this profile.</description>
|
||||
</key>
|
||||
<key name="foreground-color" type="s">
|
||||
<default>'#000000'</default>
|
||||
<summary>Default color of text in the terminal</summary>
|
||||
<description>Default color of text in the terminal, as a color specification (can be HTML-style hex digits, or a color name such as "red").</description>
|
||||
</key>
|
||||
<key name="background-color" type="s">
|
||||
<default>'#FFFFDD'</default>
|
||||
<summary>Default color of terminal background</summary>
|
||||
<description>Default color of terminal background, as a color specification (can be HTML-style hex digits, or a color name such as "red").</description>
|
||||
</key>
|
||||
<key name="bold-color" type="s">
|
||||
<default>'#000000'</default>
|
||||
<summary>Default color of bold text in the terminal</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="bold-color-same-as-fg" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether bold text should use the same color as normal text</summary>
|
||||
<description>If true, boldface text will be rendered using the same color as normal text.</description>
|
||||
</key>
|
||||
<key name="title-mode" enum="org.mate.terminal.titlemode">
|
||||
<default>'replace'</default>
|
||||
<summary>What to do with dynamic title</summary>
|
||||
<description>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".</description>
|
||||
</key>
|
||||
<key name="title" type="s">
|
||||
<default context="title" l10n="messages">'Terminal'</default>
|
||||
<summary>Title for terminal</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="allow-bold" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to allow bold text</summary>
|
||||
<description>If true, allow applications in the terminal to make text boldface.</description>
|
||||
</key>
|
||||
<key name="silent-bell" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether to silence terminal bell</summary>
|
||||
<description>If true, don't make a noise when applications send the escape sequence for the terminal bell.</description>
|
||||
</key>
|
||||
<key name="copy-selection" type="b">
|
||||
<default>false</default>
|
||||
<summary>Copy selection to clipboard</summary>
|
||||
<description>If true, selection is automatically copied to clipboard buffer.</description>
|
||||
</key>
|
||||
<key name="word-chars" type="s">
|
||||
<default>'-A-Za-z0-9,./?%&#:_=+@~'</default>
|
||||
<summary>Characters that are considered "part of a word"</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="use-custom-default-size" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether to use custom terminal size for new windows</summary>
|
||||
<description>If true, newly created terminal windows will have custom size specified by default_size_columns and default_size_rows.</description>
|
||||
</key>
|
||||
<key name="default-size-columns" type="i">
|
||||
<default>80</default>
|
||||
<summary>Default number of columns</summary>
|
||||
<description>Number of columns in newly created terminal windows. Has no effect if use_custom_default_size is not enabled.</description>
|
||||
</key>
|
||||
<key name="default-size-rows" type="i">
|
||||
<default>24</default>
|
||||
<summary>Default number of rows</summary>
|
||||
<description>Number of rows in newly created terminal windows. Has no effect if use_custom_default_size is not enabled.</description>
|
||||
</key>
|
||||
<key name="scrollbar-position" enum="org.mate.terminal.scrollbar-position">
|
||||
<default>'right'</default>
|
||||
<summary>Position of the scrollbar</summary>
|
||||
<description>Where to put the terminal scrollbar. Possibilities are "left", "right", and "hidden".</description>
|
||||
</key>
|
||||
<key name="scrollback-lines" type="i">
|
||||
<default>512</default>
|
||||
<summary>Number of lines to keep in scrollback</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="scrollback-unlimited" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether an unlimited number of lines should be kept in scrollback</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="scroll-on-keystroke" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to scroll to the bottom when a key is pressed</summary>
|
||||
<description>If true, pressing a key jumps the scrollbar to the bottom.</description>
|
||||
</key>
|
||||
<key name="scroll-on-output" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether to scroll to the bottom when there's new output</summary>
|
||||
<description>If true, whenever there's new output the terminal will scroll to the bottom.</description>
|
||||
</key>
|
||||
<key name="exit-action" enum="org.mate.terminal.exit-action">
|
||||
<default>'close'</default>
|
||||
<summary>What to do with the terminal when the child command exits</summary>
|
||||
<description>Possible values are "close" to close the terminal, and "restart" to restart the command.</description>
|
||||
</key>
|
||||
<key name="login-shell" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether to launch the command in the terminal as a login shell</summary>
|
||||
<description>If true, the command inside the terminal will be launched as a login shell. (argv[0] will have a hyphen in front of it.)</description>
|
||||
</key>
|
||||
<key name="use-custom-command" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether to run a custom command instead of the shell</summary>
|
||||
<description>If true, the value of the custom_command setting will be used in place of running a shell.</description>
|
||||
</key>
|
||||
<key name="cursor-blink-mode" enum="org.mate.terminal.cursor-blink-mode">
|
||||
<default>'system'</default>
|
||||
<summary>Whether to blink the cursor</summary>
|
||||
<description>The possible values are "system" to use the global cursor blinking settings, or "on" or "off" to set the mode explicitly.</description>
|
||||
</key>
|
||||
<key name="cursor-shape" enum="org.mate.terminal.cursor-shape">
|
||||
<default>'block'</default>
|
||||
<summary>The cursor appearance</summary>
|
||||
<description>The possible values are "block" to use a block cursor, "ibeam" to use a vertical line cursor, or "underline" to use an underline cursor.</description>
|
||||
</key>
|
||||
<key name="custom-command" type="s">
|
||||
<default>''</default>
|
||||
<summary>Custom command to use instead of the shell</summary>
|
||||
<description>Run this command in place of the shell, if use_custom_command is true.</description>
|
||||
</key>
|
||||
<key name="icon" type="s">
|
||||
<default>''</default>
|
||||
<summary>Icon for terminal window</summary>
|
||||
<description>Icon to use for tabs/windows containing this profile.</description>
|
||||
</key>
|
||||
<key name="palette" type="s">
|
||||
<default>'#2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC'</default>
|
||||
<summary>Palette for terminal applications</summary>
|
||||
<description>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"</description>
|
||||
</key>
|
||||
<key name="font" type="s">
|
||||
<default>'Monospace 12'</default>
|
||||
<summary>Font</summary>
|
||||
<description>An Pango font name. Examples are "Sans 12" or "Monospace Bold 14".</description>
|
||||
</key>
|
||||
<key name="background-type" enum="org.mate.terminal.background-type">
|
||||
<default>'solid'</default>
|
||||
<summary>Background type</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="background-image" type="s">
|
||||
<default>''</default>
|
||||
<summary>Background image</summary>
|
||||
<description>Filename of a background image.</description>
|
||||
</key>
|
||||
<key name="scroll-background" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to scroll background image</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="background-darkness" type="d">
|
||||
<default>0.5</default>
|
||||
<summary>How much to darken the background image</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="backspace-binding" enum="org.mate.terminal.erasebinding">
|
||||
<default>'ascii-del'</default>
|
||||
<summary>Effect of the Backspace key</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="delete-binding" enum="org.mate.terminal.erasebinding">
|
||||
<default>'escape-sequence'</default>
|
||||
<summary>Effect of the Delete key</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="use-theme-colors" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to use the colors from the theme for the terminal widget</summary>
|
||||
<description>If true, the theme color scheme used for text entry boxes will be used for the terminal, instead of colors provided by the user.</description>
|
||||
</key>
|
||||
<key name="use-system-font" type="b">
|
||||
<default>true</default>
|
||||
<summary>Whether to use the system font</summary>
|
||||
<description>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).</description>
|
||||
</key>
|
||||
<key name="use-skey" type="b">
|
||||
<default>true</default>
|
||||
<summary>Highlight S/Key challenges</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.mate.terminal.keybindings" path="/org/mate/terminal/keybindings/">
|
||||
<key name="new-tab" type="s">
|
||||
<default>'<Ctrl><Shift>t'</default>
|
||||
<summary>Keyboard shortcut to open a new tab</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="new-window" type="s">
|
||||
<default>'<Ctrl><Shift>n'</default>
|
||||
<summary>Keyboard shortcut to open a new window</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="new-profile" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to create a new profile</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="save-contents" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to save the current tab contents to file</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="close-tab" type="s">
|
||||
<default>'<Ctrl><Shift>w'</default>
|
||||
<summary>Keyboard shortcut to close a tab</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="close-window" type="s">
|
||||
<default>'<Ctrl><Shift>q'</default>
|
||||
<summary>Keyboard shortcut to close a window</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="copy" type="s">
|
||||
<default>'<Ctrl><Shift>c'</default>
|
||||
<summary>Keyboard shortcut to copy text</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="paste" type="s">
|
||||
<default>'<Ctrl><Shift>v'</default>
|
||||
<summary>Keyboard shortcut to paste text</summary>
|
||||
<description>Keyboard shortcut key for pasting the contents of the clipboard in 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.</description>
|
||||
</key>
|
||||
<key name="select-all" type="s">
|
||||
<default>'<Ctrl><Shift>a'</default>
|
||||
<summary>Keyboard shortcut to select all text</summary>
|
||||
<description>Keyboard shortcut key for selecting all the text in 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.</description>
|
||||
</key>
|
||||
<key name="search-find" type="s">
|
||||
<default>'<Ctrl><Shift>f'</default>
|
||||
<summary>Keyboard shortcut to show the find dialog</summary>
|
||||
<description>Keyboard shortcut key for showing the find dialog. 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.</description>
|
||||
</key>
|
||||
<key name="search-find-next" type="s">
|
||||
<default>'<Ctrl><Shift>h'</default>
|
||||
<summary>Keyboard shortcut to find the next occurrence of the search term</summary>
|
||||
<description>Keyboard shortcut key for finding the next occurrence of the search term in 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.</description>
|
||||
</key>
|
||||
<key name="search-find-previous" type="s">
|
||||
<default>'<Ctrl><Shift>g'</default>
|
||||
<summary>Keyboard shortcut to find the previous occurrence of the search term</summary>
|
||||
<description>Keyboard shortcut key for finding the previous occurrence of the search term in 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.</description>
|
||||
</key>
|
||||
<key name="full-screen" type="s">
|
||||
<default>'F11'</default>
|
||||
<summary>Keyboard shortcut to toggle full screen mode</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="toggle-menubar" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to toggle the visibility of the menubar</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="set-terminal-title" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to set the terminal title</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="reset" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to reset the terminal</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="reset-and-clear" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to reset and clear the terminal</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="prev-tab" type="s">
|
||||
<default>'<Control>Page_Up'</default>
|
||||
<summary>Keyboard shortcut to switch to the previous tab</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="next-tab" type="s">
|
||||
<default>'<Control>Page_Down'</default>
|
||||
<summary>Keyboard shortcut to switch to the next tab</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="prev-profile" type="s">
|
||||
<default>'<Alt>Page_Up'</default>
|
||||
<summary>Keyboard shortcut to switch to the previous profile</summary>
|
||||
<description>Keyboard shortcut key to switch to the previous profile. 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.</description>
|
||||
</key>
|
||||
<key name="next-profile" type="s">
|
||||
<default>'<Alt>Page_Down'</default>
|
||||
<summary>Keyboard shortcut to switch to the next profile</summary>
|
||||
<description>Keyboard shortcut key to switch to the next profile. 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.</description>
|
||||
</key>
|
||||
<key name="move-tab-left" type="s">
|
||||
<default>'<Ctrl><Shift>Page_Up'</default>
|
||||
<summary>Accelerator to move the current tab to the left.</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="move-tab-right" type="s">
|
||||
<default>'<Ctrl><Shift>Page_Down'</default>
|
||||
<summary>Accelerator to move the current tab to the right.</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="detach-tab" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Accelerator to detach current tab.</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-1" type="s">
|
||||
<default>'<Alt>1'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 1</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-2" type="s">
|
||||
<default>'<Alt>2'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 2</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-3" type="s">
|
||||
<default>'<Alt>3'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 3</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-4" type="s">
|
||||
<default>'<Alt>4'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 4</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-5" type="s">
|
||||
<default>'<Alt>5'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 5</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-6" type="s">
|
||||
<default>'<Alt>6'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 6</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-7" type="s">
|
||||
<default>'<Alt>7'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 7</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-8" type="s">
|
||||
<default>'<Alt>8'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 8</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-9" type="s">
|
||||
<default>'<Alt>9'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 9</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-10" type="s">
|
||||
<default>'<Alt>0'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 10</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-11" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 11</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="switch-to-tab-12" type="s">
|
||||
<default>'disabled'</default>
|
||||
<summary>Keyboard shortcut to switch to tab 12</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="help" type="s">
|
||||
<default>'F1'</default>
|
||||
<summary>Keyboard shortcut to launch help</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="zoom-in" type="s">
|
||||
<default>'<Ctrl>plus'</default>
|
||||
<summary>Keyboard shortcut to make font larger</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="zoom-out" type="s">
|
||||
<default>'<Ctrl>minus'</default>
|
||||
<summary>Keyboard shortcut to make font smaller</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
<key name="zoom-normal" type="s">
|
||||
<default>'<Ctrl>0'</default>
|
||||
<summary>Keyboard shortcut to make font normal-size</summary>
|
||||
<description>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.</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
|
@ -359,7 +359,7 @@ enum
|
|||
N_COLUMNS
|
||||
};
|
||||
|
||||
static void keys_change_notify (GSettings *settings,
|
||||
static void keys_change_notify (GKeyFile *settings,
|
||||
const gchar *key,
|
||||
gpointer user_data);
|
||||
|
||||
|
@ -373,10 +373,6 @@ static gboolean binding_from_string (const char *str,
|
|||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods);
|
||||
|
||||
static gboolean binding_from_value (GVariant *value,
|
||||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods);
|
||||
|
||||
static gboolean sync_idle_cb (gpointer data);
|
||||
|
||||
static guint sync_idle_id = 0;
|
||||
|
@ -386,7 +382,7 @@ static int inside_gsettings_notify = 0;
|
|||
static GtkWidget *edit_keys_dialog = NULL;
|
||||
static GtkTreeStore *edit_keys_store = NULL;
|
||||
static GHashTable *gsettings_key_to_entry;
|
||||
static GSettings *settings_keybindings;
|
||||
static GKeyFile *settings_keybindings;
|
||||
|
||||
static char*
|
||||
binding_name (guint keyval,
|
||||
|
@ -412,13 +408,12 @@ void
|
|||
terminal_accels_init (void)
|
||||
{
|
||||
guint i, j;
|
||||
gchar *concat;
|
||||
|
||||
settings_keybindings = g_settings_new (CONF_KEYS_SCHEMA);
|
||||
|
||||
g_signal_connect (settings_keybindings,
|
||||
"changed",
|
||||
G_CALLBACK(keys_change_notify),
|
||||
NULL);
|
||||
settings_keybindings = g_key_file_new ();
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/keybindings", NULL);
|
||||
g_key_file_load_from_file (settings_keybindings, concat, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
||||
g_free (concat);
|
||||
|
||||
gsettings_key_to_entry = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
|
@ -455,11 +450,13 @@ terminal_accels_init (void)
|
|||
void
|
||||
terminal_accels_shutdown (void)
|
||||
{
|
||||
gchar *concat;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (settings_keybindings,
|
||||
G_CALLBACK(keys_change_notify),
|
||||
NULL);
|
||||
g_object_unref (settings_keybindings);
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/keybindings", NULL);
|
||||
g_key_file_save_to_file (settings_keybindings, concat, NULL);
|
||||
g_free (concat);
|
||||
|
||||
g_key_file_free (settings_keybindings);
|
||||
|
||||
if (sync_idle_id != 0)
|
||||
{
|
||||
|
@ -497,11 +494,11 @@ update_model_foreach (GtkTreeModel *model,
|
|||
}
|
||||
|
||||
static void
|
||||
keys_change_notify (GSettings *settings,
|
||||
keys_change_notify (GKeyFile *settings,
|
||||
const gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
GVariant *val;
|
||||
gchar *val;
|
||||
KeyEntry *key_entry;
|
||||
GdkModifierType mask;
|
||||
guint keyval;
|
||||
|
@ -510,19 +507,17 @@ keys_change_notify (GSettings *settings,
|
|||
"key %s changed\n",
|
||||
key);
|
||||
|
||||
val = g_settings_get_value (settings, key);
|
||||
val = g_key_file_get_string (settings, CONF_KEYS_SCHEMA, key, NULL);
|
||||
|
||||
#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 (!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",
|
||||
g_variant_get_string (val, NULL));
|
||||
val);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -532,15 +527,16 @@ keys_change_notify (GSettings *settings,
|
|||
/* shouldn't really happen, but let's be safe */
|
||||
_terminal_debug_print (TERMINAL_DEBUG_ACCELS,
|
||||
" WARNING: KeyEntry for changed key not found, bailing out\n");
|
||||
g_free (val);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!binding_from_value (val, &keyval, &mask))
|
||||
if (!binding_from_string (val, &keyval, &mask))
|
||||
{
|
||||
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)",
|
||||
val ? val : "(null)",
|
||||
key_entry->gsettings_key);
|
||||
g_free (val);
|
||||
return;
|
||||
}
|
||||
key_entry->gsettings_keyval = keyval;
|
||||
|
@ -563,7 +559,7 @@ keys_change_notify (GSettings *settings,
|
|||
inside_gsettings_notify -= 1;
|
||||
|
||||
/* Lock the path if the GSettings key isn't writable */
|
||||
key_entry->accel_path_unlocked = g_settings_is_writable (settings, key);
|
||||
key_entry->accel_path_unlocked = TRUE;
|
||||
if (!key_entry->accel_path_unlocked)
|
||||
gtk_accel_map_lock_path (key_entry->accel_path);
|
||||
|
||||
|
@ -577,7 +573,7 @@ keys_change_notify (GSettings *settings,
|
|||
if (edit_keys_store)
|
||||
gtk_tree_model_foreach (GTK_TREE_MODEL (edit_keys_store), update_model_foreach, key_entry);
|
||||
|
||||
g_variant_unref(val);
|
||||
g_free (val);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -639,31 +635,10 @@ binding_from_string (const char *str,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
binding_from_value (GVariant *value,
|
||||
guint *accelerator_key,
|
||||
GdkModifierType *accelerator_mods)
|
||||
{
|
||||
if (value == NULL)
|
||||
{
|
||||
/* unset */
|
||||
*accelerator_key = 0;
|
||||
*accelerator_mods = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
|
||||
return FALSE;
|
||||
|
||||
return binding_from_string (g_variant_get_string (value,NULL),
|
||||
accelerator_key,
|
||||
accelerator_mods);
|
||||
}
|
||||
|
||||
static void
|
||||
add_key_entry_to_changeset (gpointer key,
|
||||
KeyEntry *key_entry,
|
||||
GSettings *changeset)
|
||||
GKeyFile *changeset)
|
||||
{
|
||||
GtkAccelKey gtk_key;
|
||||
|
||||
|
@ -679,7 +654,7 @@ add_key_entry_to_changeset (gpointer key,
|
|||
char *accel_name;
|
||||
|
||||
accel_name = binding_name (gtk_key.accel_key, gtk_key.accel_mods);
|
||||
g_settings_set_string (changeset, key_entry->gsettings_key, accel_name);
|
||||
g_key_file_set_string (changeset, CONF_KEYS_SCHEMA, key_entry->gsettings_key, accel_name);
|
||||
g_free (accel_name);
|
||||
}
|
||||
}
|
||||
|
@ -687,20 +662,12 @@ add_key_entry_to_changeset (gpointer key,
|
|||
static gboolean
|
||||
sync_idle_cb (gpointer data)
|
||||
{
|
||||
GSettings *changeset;
|
||||
|
||||
_terminal_debug_print (TERMINAL_DEBUG_ACCELS,
|
||||
"GSettings sync handler\n");
|
||||
|
||||
sync_idle_id = 0;
|
||||
|
||||
changeset = g_settings_new (CONF_KEYS_SCHEMA);
|
||||
g_settings_delay (changeset);
|
||||
|
||||
g_hash_table_foreach (gsettings_key_to_entry, (GHFunc) add_key_entry_to_changeset, changeset);
|
||||
g_settings_apply(changeset);
|
||||
|
||||
g_object_unref (changeset);
|
||||
g_hash_table_foreach (gsettings_key_to_entry, (GHFunc) add_key_entry_to_changeset, settings_keybindings);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -892,7 +859,7 @@ other_key->user_visible_name ? _(other_key->user_visible_name) : other_key->gset
|
|||
}
|
||||
#endif
|
||||
|
||||
g_settings_set_string (settings_keybindings,
|
||||
g_key_file_set_string (settings_keybindings, CONF_KEYS_SCHEMA,
|
||||
ke->gsettings_key,
|
||||
str);
|
||||
g_free (str);
|
||||
|
@ -938,7 +905,7 @@ accel_cleared_callback (GtkCellRendererAccel *cell,
|
|||
"Cleared keybinding for GSettings %s",
|
||||
ke->gsettings_key);
|
||||
|
||||
g_settings_set_string (settings_keybindings,
|
||||
g_key_file_set_string (settings_keybindings, CONF_KEYS_SCHEMA,
|
||||
ke->gsettings_key,
|
||||
str);
|
||||
g_free (str);
|
||||
|
|
|
@ -24,7 +24,11 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <dconf.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
#include "terminal-intl.h"
|
||||
|
||||
|
@ -47,8 +51,8 @@
|
|||
#define FALLBACK_PROFILE_ID "default"
|
||||
|
||||
/* Settings storage works as follows:
|
||||
* /apps/mate-terminal/global/
|
||||
* /apps/mate-terminal/profiles/Foo/
|
||||
* ~/.gatuno-terminal/config
|
||||
* ~/.gatuno-terminal/profiles/Foo
|
||||
*
|
||||
* It's somewhat tricky to manage the profiles/ dir since we need to track
|
||||
* the list of profiles, but GSettings doesn't have a concept of notifying that
|
||||
|
@ -90,8 +94,7 @@ struct _TerminalApp
|
|||
GtkWidget *manage_profiles_delete_button;
|
||||
GtkWidget *manage_profiles_default_menu;
|
||||
|
||||
GSettings *settings_global;
|
||||
GSettings *settings_font;
|
||||
GKeyFile *settings_global;
|
||||
|
||||
GHashTable *profiles;
|
||||
char* default_profile_id;
|
||||
|
@ -161,62 +164,6 @@ static TerminalApp *global_app = NULL;
|
|||
* FIXME: I suspect there's no need for excessive copies, we might use
|
||||
* existing profile list to form GVariant's and write them to GSettings
|
||||
*/
|
||||
static gboolean
|
||||
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;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
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;
|
||||
}
|
||||
|
||||
/* Helper functions */
|
||||
|
||||
|
@ -383,19 +330,12 @@ terminal_app_delete_profile (TerminalApp *app,
|
|||
GError *error = NULL;
|
||||
|
||||
profile_name = terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME);
|
||||
profile_dir = g_strconcat (CONF_PROFILE_PREFIX, profile_name, "/", NULL);
|
||||
profile_dir = g_strconcat ("~/.gatuno-terminal/", profile_name, NULL);
|
||||
|
||||
gsettings_remove_all_from_strv (app->settings_global, PROFILE_LIST_KEY, profile_name);
|
||||
/* Borrar el archivo */
|
||||
g_unlink (profile_dir);
|
||||
|
||||
/* And remove the profile directory */
|
||||
DConfClient *client = dconf_client_new ();
|
||||
if (!dconf_client_write_sync (client, profile_dir, NULL, NULL, NULL, &error))
|
||||
{
|
||||
g_warning ("Failed to recursively unset %s: %s\n", profile_dir, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
g_object_unref (client);
|
||||
g_free (profile_dir);
|
||||
}
|
||||
|
||||
|
@ -563,8 +503,8 @@ profile_combo_box_changed_cb (GtkWidget *widget,
|
|||
if (!profile)
|
||||
return;
|
||||
|
||||
g_settings_set_string (app->settings_global, DEFAULT_PROFILE_KEY,
|
||||
terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME));
|
||||
g_key_file_set_string (app->settings_global, CONF_GLOBAL_SCHEMA, DEFAULT_PROFILE_KEY, terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME));
|
||||
/* FIXME: ¿debería guardar el archivo? */
|
||||
|
||||
/* Even though the GSettings change notification does this, it happens too late.
|
||||
* In some cases, the default profile changes twice in quick succession,
|
||||
|
@ -809,15 +749,51 @@ find_profile_link (GList *profiles,
|
|||
return l;
|
||||
}
|
||||
|
||||
static gchar **terminal_app_profile_list_from_dir (TerminalApp *app) {
|
||||
GDir *dir;
|
||||
gchar *profile_dir;
|
||||
GPtrArray *builder_str;
|
||||
const gchar *file;
|
||||
char *dup;
|
||||
int ret;
|
||||
gchar **profile_list = NULL;
|
||||
|
||||
profile_dir = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/profiles", NULL);
|
||||
|
||||
/* Verificar que exista como directorio */
|
||||
if (g_file_test (profile_dir, G_FILE_TEST_IS_DIR)) {
|
||||
/* Posiblemente no exista, intentar crear como directorio */
|
||||
ret = g_mkdir_with_parents (profile_dir, 0640);
|
||||
} else if (g_file_test (profile_dir, G_FILE_TEST_EXISTS)) {
|
||||
/* Si no es directorio, estamos en problemas */
|
||||
g_free (profile_dir);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
builder_str = g_ptr_array_new_with_free_func (g_free);
|
||||
dir = g_dir_open (profile_dir, 0, NULL);
|
||||
g_free (profile_dir);
|
||||
if (dir != NULL) {
|
||||
while (file = g_dir_read_name (dir), file != NULL) {
|
||||
dup = g_strdup (file);
|
||||
g_ptr_array_add (builder_str, dup);
|
||||
}
|
||||
|
||||
g_ptr_array_add (builder_str, NULL);
|
||||
profile_list = (gchar **) g_ptr_array_free (builder_str, FALSE);
|
||||
}
|
||||
|
||||
//g_ptr_array_unref (builder_str);
|
||||
return profile_list;
|
||||
}
|
||||
|
||||
/* El listador principal de perfiles */
|
||||
static void
|
||||
terminal_app_profile_list_notify_cb (GSettings *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
terminal_app_profile_list_notify_cb (TerminalApp *app)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
GObject *object = G_OBJECT (app);
|
||||
GVariant *val;
|
||||
const gchar **value_list;
|
||||
gchar **value_list;
|
||||
int i;
|
||||
GList *profiles_to_delete, *l;
|
||||
gboolean need_new_default;
|
||||
|
@ -828,13 +804,8 @@ terminal_app_profile_list_notify_cb (GSettings *settings,
|
|||
|
||||
profiles_to_delete = terminal_app_get_profile_list (app);
|
||||
|
||||
val = g_settings_get_value (settings, key);
|
||||
if (val == NULL ||
|
||||
(!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 = terminal_app_profile_list_from_dir (app);
|
||||
|
||||
value_list = g_variant_get_strv (val, NULL);
|
||||
if (value_list == NULL)
|
||||
goto ensure_one_profile;
|
||||
|
||||
|
@ -855,13 +826,10 @@ terminal_app_profile_list_notify_cb (GSettings *settings,
|
|||
terminal_app_create_profile (app, profile_name);
|
||||
}
|
||||
|
||||
g_free (value_list);
|
||||
g_strfreev (value_list);
|
||||
|
||||
ensure_one_profile:
|
||||
|
||||
if (val != NULL)
|
||||
g_variant_unref (val);
|
||||
|
||||
fallback = NULL;
|
||||
count = g_hash_table_size (app->profiles);
|
||||
if (count == 0 || count <= g_list_length (profiles_to_delete))
|
||||
|
@ -937,20 +905,17 @@ ensure_one_profile:
|
|||
}
|
||||
|
||||
static void
|
||||
terminal_app_default_profile_notify_cb (GSettings *settings,
|
||||
terminal_app_default_profile_notify_cb (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
GVariant *val;
|
||||
const char *name = NULL;
|
||||
char *name = NULL;
|
||||
|
||||
app->default_profile_locked = !g_settings_is_writable (settings, key);
|
||||
app->default_profile_locked = FALSE;
|
||||
|
||||
val = g_settings_get_value (settings, key);
|
||||
if (val != NULL &&
|
||||
g_variant_is_of_type (val, G_VARIANT_TYPE_STRING))
|
||||
name = g_variant_get_string (val, NULL);
|
||||
name = g_key_file_get_string (settings, CONF_GLOBAL_SCHEMA, key, NULL);
|
||||
if (!name || !name[0])
|
||||
name = FALLBACK_PROFILE_ID;
|
||||
g_assert (name != NULL);
|
||||
|
@ -961,7 +926,7 @@ terminal_app_default_profile_notify_cb (GSettings *settings,
|
|||
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);
|
||||
g_free (name);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -983,18 +948,17 @@ encoding_mark_active (gpointer key,
|
|||
}
|
||||
|
||||
static void
|
||||
terminal_app_encoding_list_notify_cb (GSettings *settings,
|
||||
terminal_app_encoding_list_notify_cb (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
GVariant *val;
|
||||
const gchar **strings;
|
||||
gchar **strings;
|
||||
int i;
|
||||
TerminalEncoding *encoding;
|
||||
const char *charset;
|
||||
|
||||
app->encodings_locked = !g_settings_is_writable (settings, key);
|
||||
app->encodings_locked = FALSE;
|
||||
|
||||
/* 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));
|
||||
|
@ -1011,12 +975,7 @@ terminal_app_encoding_list_notify_cb (GSettings *settings,
|
|||
if (terminal_encoding_is_valid (encoding))
|
||||
encoding->is_active = TRUE;
|
||||
|
||||
val = g_settings_get_value (settings, key);
|
||||
if (val != NULL &&
|
||||
g_variant_is_of_type (val, G_VARIANT_TYPE_STRING_ARRAY))
|
||||
strings = g_variant_get_strv (val, NULL);
|
||||
else
|
||||
strings = NULL;
|
||||
strings = g_key_file_get_string_list (settings, CONF_GLOBAL_SCHEMA, key, NULL, NULL);
|
||||
|
||||
if (strings != NULL)
|
||||
{
|
||||
|
@ -1033,44 +992,38 @@ terminal_app_encoding_list_notify_cb (GSettings *settings,
|
|||
encoding->is_active = TRUE;
|
||||
}
|
||||
|
||||
g_free (strings);
|
||||
g_strfreev (strings);
|
||||
}
|
||||
|
||||
g_signal_emit (app, signals[ENCODING_LIST_CHANGED], 0);
|
||||
|
||||
if (val != NULL)
|
||||
g_variant_unref (val);
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_app_system_font_notify_cb (GSettings *settings,
|
||||
terminal_app_system_font_notify_cb (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
GVariant *val;
|
||||
const char *font = NULL;
|
||||
char *font = NULL;
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
if (strcmp (key, MONOSPACE_FONT_KEY) != 0)
|
||||
return;
|
||||
|
||||
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);
|
||||
font = g_key_file_get_string (settings, CONF_GLOBAL_SCHEMA, key, NULL);
|
||||
if (!font)
|
||||
font = DEFAULT_MONOSPACE_FONT;
|
||||
font = g_strdup (DEFAULT_MONOSPACE_FONT);
|
||||
g_assert (font != NULL);
|
||||
|
||||
if (font && (strlen (font) == 0)) /* empty string */
|
||||
font = DEFAULT_MONOSPACE_FONT;
|
||||
font = g_strdup (DEFAULT_MONOSPACE_FONT);
|
||||
|
||||
font_desc = pango_font_description_from_string (font);
|
||||
if (app->system_font_desc &&
|
||||
pango_font_description_equal (app->system_font_desc, font_desc))
|
||||
{
|
||||
pango_font_description_free (font_desc);
|
||||
g_free (font);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1080,18 +1033,24 @@ terminal_app_system_font_notify_cb (GSettings *settings,
|
|||
app->system_font_desc = font_desc;
|
||||
|
||||
g_object_notify (G_OBJECT (app), TERMINAL_APP_SYSTEM_FONT);
|
||||
g_variant_unref (val);
|
||||
g_free (font);
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_app_enable_mnemonics_notify_cb (GSettings *settings,
|
||||
terminal_app_enable_mnemonics_notify_cb (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
gboolean enable;
|
||||
GError *gerror = NULL;
|
||||
|
||||
enable = g_settings_get_boolean (settings, key);
|
||||
enable = g_key_file_get_boolean (settings, CONF_GLOBAL_SCHEMA, key, &gerror);
|
||||
if (gerror != NULL) {
|
||||
/* Ocurrió un error, no es booleano */
|
||||
g_error_free (gerror);
|
||||
return;
|
||||
}
|
||||
if (enable == app->enable_mnemonics)
|
||||
return;
|
||||
|
||||
|
@ -1100,14 +1059,20 @@ terminal_app_enable_mnemonics_notify_cb (GSettings *settings,
|
|||
}
|
||||
|
||||
static void
|
||||
terminal_app_enable_menu_accels_notify_cb (GSettings *settings,
|
||||
terminal_app_enable_menu_accels_notify_cb (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
gboolean enable;
|
||||
GError *gerror = NULL;
|
||||
|
||||
enable = g_settings_get_boolean (settings, key);
|
||||
enable = g_key_file_get_boolean (settings, CONF_GLOBAL_SCHEMA, key, &gerror);
|
||||
if (gerror != NULL) {
|
||||
/* Ocurrió un error, no es booleano */
|
||||
g_error_free (gerror);
|
||||
return;
|
||||
}
|
||||
if (enable == app->enable_menu_accels)
|
||||
return;
|
||||
|
||||
|
@ -1160,13 +1125,12 @@ new_profile_response_cb (GtkWidget *new_profile_dialog,
|
|||
{
|
||||
confirm_dialog = gtk_message_dialog_new (GTK_WINDOW (new_profile_dialog),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_QUESTION,
|
||||
GTK_BUTTONS_YES_NO,
|
||||
_("You already have a profile called “%s”. Do you want to create another profile with the same name?"), name);
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
_("You already have a profile called “%s”. Can't have two profiles with the same name"), name);
|
||||
/* Alternative button order was set automatically by GtkMessageDialog */
|
||||
retval = gtk_dialog_run (GTK_DIALOG (confirm_dialog));
|
||||
gtk_widget_destroy (confirm_dialog);
|
||||
if (retval == GTK_RESPONSE_NO)
|
||||
goto cleanup;
|
||||
}
|
||||
g_list_free (profiles);
|
||||
|
@ -1179,11 +1143,6 @@ new_profile_response_cb (GtkWidget *new_profile_dialog,
|
|||
g_strdup (new_profile_name),
|
||||
new_profile /* adopts the refcount */);
|
||||
|
||||
/* And now save the new profile name to GSettings */
|
||||
gsettings_append_strv (app->settings_global,
|
||||
PROFILE_LIST_KEY,
|
||||
new_profile_name);
|
||||
|
||||
terminal_profile_edit (new_profile, transient_parent, NULL);
|
||||
|
||||
cleanup:
|
||||
|
@ -1294,7 +1253,7 @@ profile_list_response_cb (GtkWidget *dialog,
|
|||
|
||||
if (id == GTK_RESPONSE_HELP)
|
||||
{
|
||||
terminal_util_show_help ("mate-terminal-manage-profiles", GTK_WINDOW (dialog));
|
||||
terminal_util_show_help ("gatuno-terminal-manage-profiles", GTK_WINDOW (dialog));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1415,6 +1374,7 @@ G_DEFINE_TYPE (TerminalApp, terminal_app, G_TYPE_OBJECT)
|
|||
static void
|
||||
terminal_app_init (TerminalApp *app)
|
||||
{
|
||||
gchar *concat;
|
||||
global_app = app;
|
||||
|
||||
gtk_window_set_default_icon_name (MATE_TERMINAL_ICON_NAME);
|
||||
|
@ -1427,51 +1387,21 @@ terminal_app_init (TerminalApp *app)
|
|||
|
||||
app->encodings = terminal_encodings_get_builtins ();
|
||||
|
||||
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);
|
||||
app->settings_global = g_key_file_new ();
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/config", NULL);
|
||||
g_key_file_load_from_file (app->settings_global, concat, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
||||
g_free (concat);
|
||||
|
||||
/* Load the settings */
|
||||
terminal_app_profile_list_notify_cb (app->settings_global,
|
||||
PROFILE_LIST_KEY,
|
||||
app);
|
||||
terminal_app_profile_list_notify_cb (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,
|
||||
terminal_app_system_font_notify_cb (app->settings_global,
|
||||
MONOSPACE_FONT_KEY,
|
||||
app);
|
||||
terminal_app_enable_menu_accels_notify_cb (app->settings_global,
|
||||
|
@ -1508,34 +1438,18 @@ static void
|
|||
terminal_app_finalize (GObject *object)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (object);
|
||||
|
||||
gchar *concat;
|
||||
EggSMClient *sm_client;
|
||||
|
||||
sm_client = egg_sm_client_get ();
|
||||
g_signal_handlers_disconnect_matched (sm_client, G_SIGNAL_MATCH_DATA,
|
||||
0, 0, NULL, NULL, app);
|
||||
|
||||
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);
|
||||
/* Guardar las configuraciones antes de salir */
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/config", NULL);
|
||||
g_key_file_save_to_file (app->settings_global, concat, NULL);
|
||||
g_key_file_free (app->settings_global);
|
||||
g_free (concat);
|
||||
|
||||
g_free (app->default_profile_id);
|
||||
|
||||
|
@ -1595,11 +1509,11 @@ terminal_app_set_property (GObject *object,
|
|||
{
|
||||
case PROP_ENABLE_MENU_BAR_ACCEL:
|
||||
app->enable_menu_accels = g_value_get_boolean (value);
|
||||
g_settings_set_boolean (app->settings_global, ENABLE_MENU_BAR_ACCEL_KEY, app->enable_menu_accels);
|
||||
g_key_file_set_boolean (app->settings_global, CONF_GLOBAL_SCHEMA, ENABLE_MENU_BAR_ACCEL_KEY, app->enable_menu_accels);
|
||||
break;
|
||||
case PROP_ENABLE_MNEMONICS:
|
||||
app->enable_mnemonics = g_value_get_boolean (value);
|
||||
g_settings_set_boolean (app->settings_global, ENABLE_MNEMONICS_KEY, app->enable_mnemonics);
|
||||
g_key_file_set_boolean (app->settings_global, CONF_GLOBAL_SCHEMA, ENABLE_MNEMONICS_KEY, app->enable_mnemonics);
|
||||
break;
|
||||
case PROP_DEFAULT_PROFILE:
|
||||
case PROP_SYSTEM_FONT:
|
||||
|
|
|
@ -57,12 +57,8 @@ G_BEGIN_DECLS
|
|||
|
||||
/* Configuration */
|
||||
|
||||
#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 CONF_GLOBAL_SCHEMA "global"
|
||||
#define CONF_KEYS_SCHEMA "keybindings"
|
||||
|
||||
#define MATE_TERMINAL_ICON_NAME "utilities-terminal"
|
||||
|
||||
|
|
|
@ -580,7 +580,7 @@ terminal_profile_ini_read (GKeyFile *settings,
|
|||
goto out;
|
||||
}
|
||||
|
||||
g_value_set_boolean (&value, g_variant_get_boolean (settings_value));
|
||||
g_value_set_boolean (&value, res);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_STRING (pspec))
|
||||
{
|
||||
|
@ -668,7 +668,7 @@ terminal_profile_ini_read (GKeyFile *settings,
|
|||
GdkRGBA *colors;
|
||||
int n_colors, i;
|
||||
|
||||
color_strings = g_key_file_get_string_list (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), NULL);
|
||||
color_strings = g_key_file_get_string_list (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), NULL, NULL);
|
||||
if (color_strings == NULL) {
|
||||
goto out;
|
||||
}
|
||||
|
@ -772,7 +772,7 @@ terminal_profile_ini_write (TerminalProfile *profile, GKeyFile *settings, GParam
|
|||
if (!color)
|
||||
goto cleanup;
|
||||
|
||||
cadena = g_snprintf (str, sizeof (str),
|
||||
g_snprintf (str, sizeof (str),
|
||||
"#%04X%04X%04X",
|
||||
(guint) (color->red * 65535),
|
||||
(guint) (color->green * 65535),
|
||||
|
@ -798,13 +798,13 @@ terminal_profile_ini_write (TerminalProfile *profile, GKeyFile *settings, GParam
|
|||
}
|
||||
else if (G_IS_PARAM_SPEC_INT (pspec))
|
||||
{
|
||||
g_key_file_set_integer (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), g_value_get_integer (value));
|
||||
g_key_file_set_integer (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), 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_RGBA)
|
||||
{
|
||||
GValueArray *array;
|
||||
GStrvBuilder *builder_str;
|
||||
GPtrArray *builder_str;
|
||||
char **color_strings;
|
||||
GdkRGBA color;
|
||||
int n_colors, i;
|
||||
|
@ -812,7 +812,7 @@ terminal_profile_ini_write (TerminalProfile *profile, GKeyFile *settings, GParam
|
|||
|
||||
array = (GValueArray *) g_value_get_boxed (value);
|
||||
|
||||
builder_str = g_strv_builder_new ();
|
||||
builder_str = g_ptr_array_new_with_free_func (g_free);
|
||||
|
||||
n_colors = array->n_values;
|
||||
for (i = 0; i < n_colors; ++i)
|
||||
|
@ -821,7 +821,7 @@ terminal_profile_ini_write (TerminalProfile *profile, GKeyFile *settings, GParam
|
|||
|
||||
color = g_value_get_boxed (g_value_array_get_nth (array, i));
|
||||
if (!color) {
|
||||
g_strv_builder_add (builder_str, g_strdup (""));
|
||||
g_ptr_array_add (builder_str, g_strdup (""));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -830,13 +830,14 @@ terminal_profile_ini_write (TerminalProfile *profile, GKeyFile *settings, GParam
|
|||
(guint) (color->green * 65535),
|
||||
(guint) (color->blue * 65535));
|
||||
|
||||
g_strv_builder_add (builder_str, cadena);
|
||||
g_ptr_array_add (builder_str, cadena);
|
||||
}
|
||||
|
||||
color_strings = g_strv_builder_end (builder_str);
|
||||
g_ptr_array_add (builder_str, NULL);
|
||||
color_strings = (gchar **) g_ptr_array_free (builder_str, FALSE);
|
||||
g_key_file_set_string_list (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), color_strings, n_colors);
|
||||
g_strfreev (color_strings);
|
||||
g_strv_builder_unref (builder_str);
|
||||
g_ptr_array_unref (builder_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -874,7 +875,7 @@ terminal_profile_save (TerminalProfile *profile)
|
|||
priv->dirty_pspecs = NULL;
|
||||
#endif
|
||||
|
||||
concat = g_strconcat ("~/.gatuno-terminal/", priv->profile_dir, NULL);
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/profiles/", priv->profile_dir, NULL);
|
||||
|
||||
was_saved = g_key_file_save_to_file (priv->settings, concat, &gerror);
|
||||
|
||||
|
@ -902,7 +903,9 @@ terminal_profile_schedule_save (TerminalProfile *profile,
|
|||
|
||||
g_assert (pspec != NULL);
|
||||
|
||||
if (pspec->owner_type == TERMINAL_TYPE_PROFILE && (pspec->flags & G_PARAM_WRITABLE) != 0) {
|
||||
terminal_profile_ini_write (profile, priv->settings, pspec);
|
||||
}
|
||||
|
||||
if (priv->save_idle_id != 0)
|
||||
return;
|
||||
|
@ -975,7 +978,7 @@ terminal_profile_constructor (GType type,
|
|||
g_assert (name != NULL);
|
||||
|
||||
priv->settings = g_key_file_new ();
|
||||
concat = g_strconcat ("~/.gatuno-terminal/", priv->profile_dir, NULL);
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/profiles/", priv->profile_dir, NULL);
|
||||
g_key_file_load_from_file (priv->settings, concat, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
||||
g_free (concat);
|
||||
|
||||
|
@ -1129,7 +1132,7 @@ terminal_profile_set_property (GObject *object,
|
|||
gchar *concat;
|
||||
g_key_file_free (priv->settings);
|
||||
|
||||
concat = g_strconcat ("~/.gatuno-terminal/", priv->profile_dir, NULL);
|
||||
concat = g_strconcat (g_get_home_dir (), "/.gatuno-terminal/profiles/", priv->profile_dir, NULL);
|
||||
priv->settings = g_key_file_new ();
|
||||
g_key_file_load_from_file (priv->settings, concat, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
||||
g_free (concat);
|
||||
|
@ -1418,8 +1421,6 @@ _terminal_profile_clone (TerminalProfile *base_profile,
|
|||
/* Flush the new profile to GSettings */
|
||||
new_priv = new_profile->priv;
|
||||
|
||||
g_slist_free (new_priv->dirty_pspecs);
|
||||
new_priv->dirty_pspecs = NULL;
|
||||
if (new_priv->save_idle_id != 0)
|
||||
{
|
||||
g_source_remove (new_priv->save_idle_id);
|
||||
|
@ -1434,7 +1435,7 @@ _terminal_profile_clone (TerminalProfile *base_profile,
|
|||
(pspec->flags & G_PARAM_WRITABLE) == 0)
|
||||
continue;
|
||||
|
||||
new_priv->dirty_pspecs = g_slist_prepend (new_priv->dirty_pspecs, pspec);
|
||||
terminal_profile_ini_write (new_profile, new_priv->settings, pspec);
|
||||
}
|
||||
g_free (pspecs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue