Compare commits
8 Commits
ab56ecda0f
...
85424d6b5d
Author | SHA1 | Date |
---|---|---|
Félix Arreola Rodríguez | 85424d6b5d | |
Félix Arreola Rodríguez | bf285963f3 | |
Félix Arreola Rodríguez | 0c216e68f6 | |
Félix Arreola Rodríguez | 18ec266a0f | |
Félix Arreola Rodríguez | 85d3ffbf56 | |
Félix Arreola Rodríguez | 5dccb37026 | |
Félix Arreola Rodríguez | 60d514fb47 | |
Félix Arreola Rodríguez | ca9ac7fd9e |
|
@ -1,19 +0,0 @@
|
|||
#### Expected behaviour
|
||||
|
||||
|
||||
#### Actual behaviour
|
||||
|
||||
|
||||
#### Steps to reproduce the behaviour
|
||||
|
||||
|
||||
#### MATE general version
|
||||
|
||||
|
||||
#### Package version
|
||||
|
||||
|
||||
#### Linux Distribution
|
||||
|
||||
|
||||
#### Link to downstream report of your Distribution
|
116
.travis.yml
116
.travis.yml
|
@ -1,116 +0,0 @@
|
|||
# vim: set ts=2 sts=2 sw=2 expandtab :
|
||||
dist: xenial
|
||||
sudo: required
|
||||
language: bash
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- curl -Ls -o docker-build https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/docker-build
|
||||
- chmod +x docker-build
|
||||
|
||||
install:
|
||||
- sudo apt-get install -y python3-pip python3-setuptools
|
||||
- sudo pip3 install --upgrade pip
|
||||
- sudo pip install PyGithub
|
||||
- ./docker-build --name ${DISTRO} --config .travis.yml --install
|
||||
|
||||
script:
|
||||
- ./docker-build --name ${DISTRO} --verbose --config .travis.yml --build autotools
|
||||
|
||||
deploy:
|
||||
- provider: script
|
||||
script: ./docker-build --verbose --config .travis.yml --release github
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
condition: "${TRAVIS_TAG} =~ ^v.*$ && ${DISTRO} =~ ^fedora.*$"
|
||||
|
||||
env:
|
||||
- DISTRO="archlinux/base"
|
||||
- DISTRO="debian:sid"
|
||||
- DISTRO="fedora:29"
|
||||
- DISTRO="ubuntu:18.10"
|
||||
|
||||
##########################################################
|
||||
# THE FOLLOWING LINES IS USED BY docker-build
|
||||
##########################################################
|
||||
requires:
|
||||
archlinux:
|
||||
# Useful URL: https://git.archlinux.org/svntogit/community.git/tree/mate-terminal
|
||||
- gcc
|
||||
- git
|
||||
- intltool
|
||||
- libsm
|
||||
- make
|
||||
- mate-common
|
||||
- mate-desktop
|
||||
- vte3
|
||||
- which
|
||||
- yelp-tools
|
||||
|
||||
debian:
|
||||
# Useful URL: https://github.com/mate-desktop/debian-packages
|
||||
# Useful URL: https://salsa.debian.org/debian-mate-team/mate-terminal
|
||||
- git
|
||||
- intltool
|
||||
- intltool
|
||||
- libdconf-dev
|
||||
- libglib2.0-dev
|
||||
- libgtk-3-dev
|
||||
- libsm-dev
|
||||
- libvte-2.91-dev
|
||||
- libx11-dev
|
||||
- make
|
||||
- mate-common
|
||||
- yelp-tools
|
||||
|
||||
fedora:
|
||||
# Useful URL: https://src.fedoraproject.org/cgit/rpms/mate-terminal.git
|
||||
- gcc
|
||||
- dconf-devel
|
||||
- desktop-file-utils
|
||||
- git
|
||||
- gtk3-devel
|
||||
- libSM-devel
|
||||
- make
|
||||
- mate-common
|
||||
- redhat-rpm-config
|
||||
- vte291-devel
|
||||
|
||||
ubuntu:
|
||||
- git
|
||||
- intltool
|
||||
- intltool
|
||||
- libdconf-dev
|
||||
- libglib2.0-dev
|
||||
- libgtk-3-dev
|
||||
- libsm-dev
|
||||
- libvte-2.91-dev
|
||||
- libx11-dev
|
||||
- make
|
||||
- mate-common
|
||||
- yelp-tools
|
||||
|
||||
variables:
|
||||
- CFLAGS="-Wall -Werror=format-security"
|
||||
|
||||
before_scripts:
|
||||
- if [ ${DISTRO_NAME} == "debian" ];then
|
||||
- curl -Ls -o debian.sh https://github.com/mate-desktop/mate-dev-scripts/raw/master/travis/debian.sh
|
||||
- bash ./debian.sh
|
||||
- fi
|
||||
|
||||
after_scripts:
|
||||
- make distcheck
|
||||
|
||||
releases:
|
||||
draft: false
|
||||
prerelease: false
|
||||
checksum: true
|
||||
file_glob: true
|
||||
files: mate-terminal-*.tar.xz
|
||||
github_release:
|
||||
tags: true
|
||||
overwrite: true
|
||||
base_version: 1.20.0
|
16
Makefile.am
16
Makefile.am
|
@ -1,4 +1,4 @@
|
|||
SUBDIRS = src po help
|
||||
SUBDIRS = src po
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
|
||||
|
@ -11,29 +11,31 @@ DISTCHECK_CONFIGURE_FLAGS = \
|
|||
|
||||
@INTLTOOL_XML_RULE@
|
||||
appdatadir = $(datadir)/metainfo
|
||||
appdata_in_files = mate-terminal.appdata.xml.in
|
||||
appdata_in_files = gatuno-terminal.appdata.xml.in
|
||||
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@
|
||||
|
||||
man_MANS = mate-terminal.1
|
||||
man_MANS = gatuno-terminal.1
|
||||
|
||||
bin_SCRIPTS = mate-terminal.wrapper
|
||||
bin_SCRIPTS = gatuno-terminal.wrapper
|
||||
|
||||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
config.rpath \
|
||||
xmldocs.make \
|
||||
omf.make \
|
||||
mate-terminal.wrapper \
|
||||
gatuno-terminal.wrapper \
|
||||
$(appdata_in_files) \
|
||||
$(man_MANS) \
|
||||
$(NULL)
|
||||
# autogen.sh
|
||||
|
||||
CLEANFILES = \
|
||||
mate-terminal.appdata.xml \
|
||||
gatuno-terminal.appdata.xml \
|
||||
$(desktop_DATA) \
|
||||
$(NULL)
|
||||
|
||||
|
|
3
README
3
README
|
@ -1,9 +1,10 @@
|
|||
|
||||
This is the MATE terminal emulator application. mate-terminal is
|
||||
This is the Gatuno terminal emulator application. gatuno-terminal is
|
||||
only the shell (menubar, prefs dialog); the terminal emulation ("stuff
|
||||
in the middle") comes from the VTE widget. Remember this when you
|
||||
report a bug. ;-)
|
||||
|
||||
Gatuno Terminal is a fork of Mate terminal.
|
||||
MATE terminal is a fork of GNOME terminal.
|
||||
|
||||
How it works
|
||||
|
|
30
autogen.sh
30
autogen.sh
|
@ -1,30 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
PKG_NAME="mate-terminal"
|
||||
|
||||
(test -f $srcdir/configure.ac) || {
|
||||
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
|
||||
echo " top-level $PKG_NAME directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
which mate-autogen || {
|
||||
echo "You need to install mate-common"
|
||||
exit 1
|
||||
}
|
||||
|
||||
which yelp-build || {
|
||||
echo "You need to install yelp-tools"
|
||||
exit 1
|
||||
}
|
||||
|
||||
REQUIRED_AUTOMAKE_VERSION=1.9
|
||||
MATE_DATADIR="$mate_datadir"
|
||||
USE_COMMON_DOC_BUILD=yes
|
||||
|
||||
. mate-autogen
|
||||
|
36
configure.ac
36
configure.ac
|
@ -6,7 +6,7 @@ m4_define([gt_version],[gt_version_major().gt_version_minor().gt_version_micro()
|
|||
|
||||
m4_define([gt_api_version],[0])
|
||||
|
||||
AC_INIT([MATE Terminal],[gt_version],[http://www.mate-desktop.org],[mate-terminal])
|
||||
AC_INIT([Gatuno Terminal],[gt_version],[http://git.gatuno.mx/gatuno/gatuno-terminal],[gatuno-terminal])
|
||||
AC_CONFIG_SRCDIR([src/terminal.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
@ -14,7 +14,7 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||
AM_INIT_AUTOMAKE([1.9 foreign no-dist-gzip dist-xz check-news])
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
|
||||
|
||||
GETTEXT_PACKAGE=mate-terminal
|
||||
GETTEXT_PACKAGE=gatuno-terminal
|
||||
AC_SUBST([GETTEXT_PACKAGE])
|
||||
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
|
||||
|
||||
|
@ -31,18 +31,12 @@ AC_HEADER_STDC
|
|||
AM_PROG_LIBTOOL
|
||||
IT_PROG_INTLTOOL([0.50.1])
|
||||
|
||||
MATE_COMMON_INIT
|
||||
MATE_DEBUG_CHECK
|
||||
MATE_COMPILE_WARNINGS([maximum])
|
||||
#MATE_MAINTAINER_MODE_DEFINES
|
||||
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
GLIB_REQUIRED=2.50.0
|
||||
GIO_REQUIRED=2.50.0
|
||||
GTK_REQUIRED=3.22.0
|
||||
VTE_REQUIRED=0.48
|
||||
DCONF_REQUIRED=0.13.4
|
||||
|
||||
PKG_CHECK_MODULES([TERM],
|
||||
[vte-2.91 >= $VTE_REQUIRED
|
||||
|
@ -50,22 +44,8 @@ PKG_CHECK_MODULES([TERM],
|
|||
gthread-2.0
|
||||
gio-2.0 >= $GIO_REQUIRED
|
||||
gtk+-3.0 >= $GTK_REQUIRED
|
||||
dconf >= $DCONF_REQUIRED
|
||||
x11])
|
||||
|
||||
# ********
|
||||
# smclient
|
||||
# ********
|
||||
|
||||
PKG_CHECK_MODULES(SMCLIENT, sm >= 1.0.0)
|
||||
AC_SUBST([SMCLIENT_CFLAGS])
|
||||
AC_SUBST([SMCLIENT_LIBS])
|
||||
|
||||
# *****
|
||||
# GSettings
|
||||
# *****
|
||||
|
||||
GLIB_GSETTINGS
|
||||
|
||||
GLIB_GENMARSHAL="$($PKG_CONFIG --variable=glib_genmarshal glib-2.0)"
|
||||
AC_SUBST([GLIB_GENMARSHAL])
|
||||
|
@ -106,12 +86,6 @@ fi
|
|||
|
||||
AM_CONDITIONAL([ENABLE_SKEY],[test "$enable_skey" = "yes"])
|
||||
|
||||
# *************
|
||||
# Documentation
|
||||
# *************
|
||||
|
||||
YELP_HELP_INIT
|
||||
|
||||
# ****************************
|
||||
|
||||
AC_SUBST([TERMINAL_MAJOR_VERSION],[gt_version_major])
|
||||
|
@ -123,12 +97,10 @@ AC_SUBST([TERMINAL_API_VERSION],[gt_api_version])
|
|||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
mate-terminal.desktop.in
|
||||
gatuno-terminal.desktop.in
|
||||
src/Makefile
|
||||
src/org.mate.terminal.gschema.xml
|
||||
src/terminal-version.h
|
||||
src/skey/Makefile
|
||||
help/Makefile
|
||||
po/Makefile.in
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
@ -136,7 +108,7 @@ AC_OUTPUT
|
|||
# ****************************
|
||||
|
||||
echo "
|
||||
mate-terminal-$VERSION:
|
||||
gatuno-terminal-$VERSION:
|
||||
|
||||
prefix: ${prefix}
|
||||
source code location: ${srcdir}
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright 2014 MATE team <mate-dev@ml.mate-desktop.org> -->
|
||||
<component type="desktop">
|
||||
<id>mate-terminal.desktop</id>
|
||||
<id>gatuno-terminal.desktop</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-3.0+</project_license>
|
||||
<name>MATE Terminal</name>
|
||||
<_summary>A terminal emulator for the MATE desktop environment</_summary>
|
||||
<name>Gatuno Terminal</name>
|
||||
<_summary>A terminal emulator for you</_summary>
|
||||
<_description>
|
||||
<p>
|
||||
MATE Terminal is a terminal emulation application that you can use
|
||||
to access a UNIX shell in the MATE environment. MATE Terminal emulates
|
||||
Gatuno Terminal is a terminal emulation application that you can use
|
||||
to access a UNIX shell in the destop environment. Gatuno Terminal emulates
|
||||
the xterm program developed by the X Consortium. It supports translucent
|
||||
backgrounds, opening multiple terminals in a single window (tabs) and
|
||||
clickable URLs.
|
||||
</p>
|
||||
<p>
|
||||
MATE Terminal is a fork of GNOME Terminal and part of the MATE Desktop Environment.
|
||||
If you would like to know more about MATE and MATE Terminal, please visit the
|
||||
Gatuno Terminal is a fork of Mate Terminal, which in turn is a fork
|
||||
of GNOME Terminal and part of the MATE Desktop Environment.
|
||||
If you would like to know more about Gatuno Terminal, please visit the
|
||||
project's home page.
|
||||
</p>
|
||||
</_description>
|
||||
|
@ -39,5 +40,4 @@
|
|||
</screenshots>
|
||||
<url type="homepage">http://www.mate-desktop.org</url>
|
||||
<updatecontact>mate-dev@ml.mate-desktop.org</updatecontact>
|
||||
<project_group>MATE</project_group>
|
||||
</component>
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
_Name=Gatuno Terminal
|
||||
_GenericName=Terminal
|
||||
_Comment=Use the command line
|
||||
TryExec=gatuno-terminal
|
||||
Exec=gatuno-terminal
|
||||
Icon=utilities-terminal
|
||||
Type=Application
|
||||
Categories=System;GTK;Utility;TerminalEmulator;
|
||||
StartupNotify=true
|
||||
|
|
@ -78,4 +78,4 @@ if ($login == 1)
|
|||
{
|
||||
@args = ('--login', @args);
|
||||
}
|
||||
exec('mate-terminal',@args);
|
||||
exec('gatuno-terminal',@args);
|
2
makepot
2
makepot
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
|
||||
PACKAGE=mate-terminal;
|
||||
PACKAGE=gatuno-terminal;
|
||||
|
||||
# normal translations for the package
|
||||
make -C po $PACKAGE.pot && mv po/$PACKAGE.pot .
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
[Desktop Entry]
|
||||
_Name=MATE Terminal
|
||||
_GenericName=Terminal
|
||||
_Comment=Use the command line
|
||||
TryExec=mate-terminal
|
||||
Exec=mate-terminal
|
||||
Icon=utilities-terminal
|
||||
Type=Application
|
||||
X-MATE-DocPath=mate-terminal/index.html
|
||||
X-MATE-Bugzilla-Bugzilla=MATE
|
||||
X-MATE-Bugzilla-Product=mate-terminal
|
||||
X-MATE-Bugzilla-Component=BugBuddyBugs
|
||||
X-MATE-Bugzilla-Version=@VERSION@
|
||||
Categories=System;GTK;Utility;TerminalEmulator;
|
||||
StartupNotify=true
|
||||
|
|
@ -0,0 +1,269 @@
|
|||
# INTLTOOL_MAKEFILE
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
#
|
||||
# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
|
||||
# instead of PACKAGE and to look for po2tbl in ./ not in intl/
|
||||
#
|
||||
# - Modified by jacob berkman <jacob@ximian.com> to install
|
||||
# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
|
||||
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = @SHELL@
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
libdir = @libdir@
|
||||
localedir = $(libdir)/locale
|
||||
gnulocaledir = $(datadir)/locale
|
||||
gettextsrcdir = $(datadir)/glib-2.0/gettext/po
|
||||
subdir = po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = mkdir -p
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_OPTS = @MSGFMT_OPTS@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
MSGMERGE = msgmerge
|
||||
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
|
||||
INCLUDES = -I.. -I$(top_srcdir)/intl
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES =
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
DISTFILES = LINGUAS ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \
|
||||
$(POFILES) $(GMOFILES) $(SOURCES)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
|
||||
.po.pox:
|
||||
$(MAKE) $(GETTEXT_PACKAGE).pot
|
||||
$(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox
|
||||
|
||||
.po.mo:
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
.po.gmo:
|
||||
$(AM_V_GEN) file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
||||
&& rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $<
|
||||
|
||||
.po.cat:
|
||||
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
||||
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
|
||||
$(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --from-code=UTF-8 \
|
||||
--msgid-bugs-address='http://bugzilla.gnome.org/enter_bug.cgi?product=glib&keywords=I18N+L10N&component=general' \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--keyword=C_:1c,2 \
|
||||
--keyword=NC_:1c,2 \
|
||||
--keyword=g_dcgettext:2 \
|
||||
--keyword=g_dngettext:2,3 \
|
||||
--keyword=g_dpgettext2:2c,3 \
|
||||
--flag=N_:1:pass-c-format \
|
||||
--flag=C_:2:pass-c-format \
|
||||
--flag=NC_:2:pass-c-format \
|
||||
--flag=g_dngettext:2:pass-c-format \
|
||||
--flag=g_strdup_printf:1:c-format \
|
||||
--flag=g_string_printf:2:c-format \
|
||||
--flag=g_string_append_printf:2:c-format \
|
||||
--flag=g_error_new:3:c-format \
|
||||
--flag=g_set_error:4:c-format \
|
||||
--flag=g_markup_printf_escaped:1:c-format \
|
||||
--flag=g_log:3:c-format \
|
||||
--flag=g_print:1:c-format \
|
||||
--flag=g_printerr:1:c-format \
|
||||
--flag=g_printf:1:c-format \
|
||||
--flag=g_fprintf:2:c-format \
|
||||
--flag=g_sprintf:2:c-format \
|
||||
--flag=g_snprintf:3:c-format \
|
||||
--flag=g_scanner_error:2:c-format \
|
||||
--flag=g_scanner_warn:2:c-format \
|
||||
$(POTFILES) \
|
||||
&& test ! -f $(GETTEXT_PACKAGE).po \
|
||||
|| ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
|
||||
&& mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot )
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
||||
*.gmo) destdir=$(gnulocaledir);; \
|
||||
*) destdir=$(localedir);; \
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
|
||||
fi; \
|
||||
if test -r $$cat.m; then \
|
||||
$(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
if test -r $(srcdir)/$$cat.m ; then \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
||||
$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "glib"; then \
|
||||
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
|
||||
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "glib"; then \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
||||
fi
|
||||
|
||||
check: all
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES)
|
||||
|
||||
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(GETTEXT_PACKAGE).pot
|
||||
tmpdir=`pwd`; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
echo "$$lang:"; \
|
||||
if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
|
||||
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
else \
|
||||
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
|
||||
:; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
else \
|
||||
echo "msgmerge for $$cat failed!"; \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# POTFILES is created from POTFILES.in by stripping comments, empty lines
|
||||
# and Intltool tags (enclosed in square brackets), and appending a full
|
||||
# relative path to them
|
||||
POTFILES: POTFILES.in
|
||||
( if test 'x$(srcdir)' != 'x.'; then \
|
||||
posrcprefix='$(top_srcdir)/'; \
|
||||
else \
|
||||
posrcprefix="../"; \
|
||||
fi; \
|
||||
rm -f $@-t $@ \
|
||||
&& (sed -e '/^#/d' \
|
||||
-e "s/^\[.*\] +//" \
|
||||
-e '/^[ ]*$$/d' \
|
||||
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
||||
| sed -e '$$s/\\$$//') > $@-t \
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
|
||||
Makefile: Makefile.in.in ../config.status POTFILES
|
||||
cd .. \
|
||||
&& $(SHELL) ./config.status $(subdir)/$@.in
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,18 +1,15 @@
|
|||
[encoding: UTF-8]
|
||||
# List of source files containing translatable strings.
|
||||
# Please keep this file sorted alphabetically.
|
||||
mate-terminal.appdata.xml.in
|
||||
mate-terminal.desktop.in.in
|
||||
src/eggsmclient.c
|
||||
[type: gettext/gsettings]src/org.mate.terminal.gschema.xml.in
|
||||
gatuno-terminal.appdata.xml.in
|
||||
gatuno-terminal.desktop.in.in
|
||||
src/profile-editor.c
|
||||
[type: gettext/glade]src/encodings-dialog.ui
|
||||
[type: gettext/glade]src/find-dialog.ui
|
||||
[type: gettext/glade]src/keybinding-editor.ui
|
||||
[type: gettext/glade]src/profile-manager.ui
|
||||
[type: gettext/glade]src/profile-new-dialog.ui
|
||||
[type: gettext/glade]src/profile-preferences.ui
|
||||
[type: gettext/glade]src/skey-challenge.ui
|
||||
src/encodings-dialog.ui
|
||||
src/find-dialog.ui
|
||||
src/keybinding-editor.ui
|
||||
src/profile-manager.ui
|
||||
src/profile-new-dialog.ui
|
||||
src/profile-preferences.ui
|
||||
src/skey-challenge.ui
|
||||
src/skey-popup.c
|
||||
src/terminal-accels.c
|
||||
src/terminal-app.c
|
||||
|
|
|
@ -4,7 +4,7 @@ if ENABLE_SKEY
|
|||
SUBDIRS = skey
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = mate-terminal
|
||||
bin_PROGRAMS = gatuno-terminal
|
||||
|
||||
BUILT_SOURCES = \
|
||||
terminal-marshal.c \
|
||||
|
@ -15,7 +15,7 @@ BUILT_SOURCES = \
|
|||
terminal-type-builtins.h \
|
||||
$(NULL)
|
||||
|
||||
mate_terminal_SOURCES= \
|
||||
gatuno_terminal_SOURCES= \
|
||||
eggshell.c \
|
||||
eggshell.h \
|
||||
profile-editor.c \
|
||||
|
@ -56,17 +56,17 @@ mate_terminal_SOURCES= \
|
|||
$(NULL)
|
||||
|
||||
if ENABLE_SKEY
|
||||
mate_terminal_SOURCES += \
|
||||
gatuno_terminal_SOURCES += \
|
||||
skey-popup.c \
|
||||
skey-popup.h \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
nodist_mate_terminal_SOURCES= $(BUILT_SOURCES)
|
||||
nodist_gatuno_terminal_SOURCES= $(BUILT_SOURCES)
|
||||
|
||||
mate_terminal_CPPFLAGS = \
|
||||
gatuno_terminal_CPPFLAGS = \
|
||||
-DTERMINAL_COMPILATION \
|
||||
-DTERMINAL_RESOURCES_PATH_PREFIX="\"/org/mate/terminal\"" \
|
||||
-DTERMINAL_RESOURCES_PATH_PREFIX="\"/org/gatuno/terminal\"" \
|
||||
-DTERM_DATADIR="\"$(datadir)\"" \
|
||||
-DTERM_LOCALEDIR="\"$(datadir)/locale\"" \
|
||||
-DTERM_PKGDATADIR="\"$(pkgdatadir)\"" \
|
||||
|
@ -82,30 +82,17 @@ mate_terminal_CPPFLAGS = \
|
|||
$(DISABLE_DEPRECATED) \
|
||||
$(AM_CPPFLAGS)
|
||||
|
||||
mate_terminal_CFLAGS = \
|
||||
gatuno_terminal_CFLAGS = \
|
||||
$(TERM_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
mate_terminal_LDFLAGS = -lICE
|
||||
gatuno_terminal_LDFLAGS = -lICE
|
||||
|
||||
mate_terminal_LDADD = \
|
||||
gatuno_terminal_LDADD = \
|
||||
skey/libskey.la \
|
||||
$(TERM_LIBS)
|
||||
|
||||
mate_terminal_SOURCES += \
|
||||
eggdesktopfile.c \
|
||||
eggdesktopfile.h \
|
||||
eggsmclient.c \
|
||||
eggsmclient.h \
|
||||
eggsmclient-private.h \
|
||||
eggsmclient-xsmp.c \
|
||||
$(NULL)
|
||||
|
||||
mate_terminal_CFLAGS += $(SMCLIENT_CFLAGS)
|
||||
mate_terminal_CPPFLAGS += -DEGG_SM_CLIENT_BACKEND_XSMP
|
||||
mate_terminal_LDADD += $(SMCLIENT_LIBS)
|
||||
|
||||
TYPES_H_FILES = \
|
||||
terminal-profile.h \
|
||||
$(NULL)
|
||||
|
@ -142,15 +129,10 @@ 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 +153,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,38 +0,0 @@
|
|||
/* eggsmclient-private.h
|
||||
* Copyright (C) 2007 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EGG_SM_CLIENT_PRIVATE_H__
|
||||
#define __EGG_SM_CLIENT_PRIVATE_H__
|
||||
|
||||
#include "eggsmclient.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GKeyFile *egg_sm_client_save_state (EggSMClient *client);
|
||||
void egg_sm_client_quit_requested (EggSMClient *client);
|
||||
void egg_sm_client_quit_cancelled (EggSMClient *client);
|
||||
void egg_sm_client_quit (EggSMClient *client);
|
||||
|
||||
GType egg_sm_client_xsmp_get_type (void);
|
||||
EggSMClient *egg_sm_client_xsmp_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __EGG_SM_CLIENT_PRIVATE_H__ */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,603 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2007 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "eggsmclient.h"
|
||||
#include "eggsmclient-private.h"
|
||||
|
||||
static void egg_sm_client_debug_handler (const char *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const char *message,
|
||||
gpointer user_data);
|
||||
|
||||
enum
|
||||
{
|
||||
SAVE_STATE,
|
||||
QUIT_REQUESTED,
|
||||
QUIT_CANCELLED,
|
||||
QUIT,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
struct _EggSMClientPrivate
|
||||
{
|
||||
GKeyFile *state_file;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (EggSMClient, egg_sm_client, G_TYPE_OBJECT)
|
||||
|
||||
static EggSMClient *global_client;
|
||||
static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL;
|
||||
|
||||
static void
|
||||
egg_sm_client_init (EggSMClient *client)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
static void
|
||||
egg_sm_client_class_init (EggSMClientClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
/**
|
||||
* EggSMClient::save_state:
|
||||
* @client: the client
|
||||
* @state_file: a #GKeyFile to save state information into
|
||||
*
|
||||
* Emitted when the session manager has requested that the
|
||||
* application save information about its current state. The
|
||||
* application should save its state into @state_file, and then the
|
||||
* session manager may then restart the application in a future
|
||||
* session and tell it to initialize itself from that state.
|
||||
*
|
||||
* You should not save any data into @state_file's "start group"
|
||||
* (ie, the %NULL group). Instead, applications should save their
|
||||
* data into groups with names that start with the application name,
|
||||
* and libraries that connect to this signal should save their data
|
||||
* into groups with names that start with the library name.
|
||||
*
|
||||
* Alternatively, rather than (or in addition to) using @state_file,
|
||||
* the application can save its state by calling
|
||||
* egg_sm_client_set_restart_command() during the processing of this
|
||||
* signal (eg, to include a list of files to open).
|
||||
**/
|
||||
signals[SAVE_STATE] =
|
||||
g_signal_new ("save_state",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (EggSMClientClass, save_state),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE,
|
||||
1, G_TYPE_POINTER);
|
||||
|
||||
/**
|
||||
* EggSMClient::quit_requested:
|
||||
* @client: the client
|
||||
*
|
||||
* Emitted when the session manager requests that the application
|
||||
* exit (generally because the user is logging out). The application
|
||||
* should decide whether or not it is willing to quit (perhaps after
|
||||
* asking the user what to do with documents that have unsaved
|
||||
* changes) and then call egg_sm_client_will_quit(), passing %TRUE
|
||||
* or %FALSE to give its answer to the session manager. (It does not
|
||||
* need to give an answer before returning from the signal handler;
|
||||
* it can interact with the user asynchronously and then give its
|
||||
* answer later on.) If the application does not connect to this
|
||||
* signal, then #EggSMClient will automatically return %TRUE on its
|
||||
* behalf.
|
||||
*
|
||||
* The application should not save its session state as part of
|
||||
* handling this signal; if the user has requested that the session
|
||||
* be saved when logging out, then ::save_state will be emitted
|
||||
* separately.
|
||||
*
|
||||
* If the application agrees to quit, it should then wait for either
|
||||
* the ::quit_cancelled or ::quit signals to be emitted.
|
||||
**/
|
||||
signals[QUIT_REQUESTED] =
|
||||
g_signal_new ("quit_requested",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (EggSMClientClass, quit_requested),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
|
||||
/**
|
||||
* EggSMClient::quit_cancelled:
|
||||
* @client: the client
|
||||
*
|
||||
* Emitted when the session manager decides to cancel a logout after
|
||||
* the application has already agreed to quit. After receiving this
|
||||
* signal, the application can go back to what it was doing before
|
||||
* receiving the ::quit_requested signal.
|
||||
**/
|
||||
signals[QUIT_CANCELLED] =
|
||||
g_signal_new ("quit_cancelled",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (EggSMClientClass, quit_cancelled),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
|
||||
/**
|
||||
* EggSMClient::quit:
|
||||
* @client: the client
|
||||
*
|
||||
* Emitted when the session manager wants the application to quit
|
||||
* (generally because the user is logging out). The application
|
||||
* should exit as soon as possible after receiving this signal; if
|
||||
* it does not, the session manager may choose to forcibly kill it.
|
||||
*
|
||||
* Normally a GUI application would only be sent a ::quit if it
|
||||
* agreed to quit in response to a ::quit_requested signal. However,
|
||||
* this is not guaranteed; in some situations the session manager
|
||||
* may decide to end the session without giving applications a
|
||||
* chance to object.
|
||||
**/
|
||||
signals[QUIT] =
|
||||
g_signal_new ("quit",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (EggSMClientClass, quit),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
}
|
||||
|
||||
static gboolean sm_client_disable = FALSE;
|
||||
static char *sm_client_state_file = NULL;
|
||||
static char *sm_client_id = NULL;
|
||||
static char *sm_config_prefix = NULL;
|
||||
|
||||
static gboolean
|
||||
sm_client_post_parse_func (GOptionContext *context,
|
||||
GOptionGroup *group,
|
||||
gpointer data,
|
||||
GError **error)
|
||||
{
|
||||
EggSMClient *client = egg_sm_client_get ();
|
||||
|
||||
if (sm_client_id == NULL)
|
||||
{
|
||||
const gchar *desktop_autostart_id;
|
||||
|
||||
desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
|
||||
|
||||
if (desktop_autostart_id != NULL)
|
||||
sm_client_id = g_strdup (desktop_autostart_id);
|
||||
}
|
||||
|
||||
/* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to
|
||||
* use the same client id. */
|
||||
g_unsetenv ("DESKTOP_AUTOSTART_ID");
|
||||
|
||||
if (EGG_SM_CLIENT_GET_CLASS (client)->startup)
|
||||
EGG_SM_CLIENT_GET_CLASS (client)->startup (client, sm_client_id);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_get_option_group:
|
||||
*
|
||||
* Creates a %GOptionGroup containing the session-management-related
|
||||
* options. You should add this group to the application's
|
||||
* %GOptionContext if you want to use #EggSMClient.
|
||||
*
|
||||
* Return value: the %GOptionGroup
|
||||
**/
|
||||
GOptionGroup *
|
||||
egg_sm_client_get_option_group (void)
|
||||
{
|
||||
const GOptionEntry entries[] =
|
||||
{
|
||||
{
|
||||
"sm-client-disable", 0, 0,
|
||||
G_OPTION_ARG_NONE, &sm_client_disable,
|
||||
N_("Disable connection to session manager"), NULL
|
||||
},
|
||||
{
|
||||
"sm-client-state-file", 0, 0,
|
||||
G_OPTION_ARG_FILENAME, &sm_client_state_file,
|
||||
N_("Specify file containing saved configuration"), N_("FILE")
|
||||
},
|
||||
{
|
||||
"sm-client-id", 0, 0,
|
||||
G_OPTION_ARG_STRING, &sm_client_id,
|
||||
N_("Specify session management ID"), N_("ID")
|
||||
},
|
||||
/* MateClient compatibility option */
|
||||
{
|
||||
"sm-disable", 0, G_OPTION_FLAG_HIDDEN,
|
||||
G_OPTION_ARG_NONE, &sm_client_disable,
|
||||
NULL, NULL
|
||||
},
|
||||
/* MateClient compatibility option. This is a dummy option that only
|
||||
* exists so that sessions saved by apps with MateClient can be restored
|
||||
* later when they've switched to EggSMClient. See bug #575308.
|
||||
*/
|
||||
{
|
||||
"sm-config-prefix", 0, G_OPTION_FLAG_HIDDEN,
|
||||
G_OPTION_ARG_STRING, &sm_config_prefix,
|
||||
NULL, NULL
|
||||
},
|
||||
{ NULL }
|
||||
};
|
||||
GOptionGroup *group;
|
||||
|
||||
/* Use our own debug handler for the "EggSMClient" domain. */
|
||||
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
|
||||
egg_sm_client_debug_handler, NULL);
|
||||
|
||||
group = g_option_group_new ("sm-client",
|
||||
_("Session management options:"),
|
||||
_("Show session management options"),
|
||||
NULL, NULL);
|
||||
g_option_group_add_entries (group, entries);
|
||||
g_option_group_set_parse_hooks (group, NULL, sm_client_post_parse_func);
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_set_mode:
|
||||
* @mode: an #EggSMClient mode
|
||||
*
|
||||
* Sets the "mode" of #EggSMClient as follows:
|
||||
*
|
||||
* %EGG_SM_CLIENT_MODE_DISABLED: Session management is completely
|
||||
* disabled. The application will not even connect to the session
|
||||
* manager. (egg_sm_client_get() will still return an #EggSMClient,
|
||||
* but it will just be a dummy object.)
|
||||
*
|
||||
* %EGG_SM_CLIENT_MODE_NO_RESTART: The application will connect to
|
||||
* the session manager (and thus will receive notification when the
|
||||
* user is logging out, etc), but will request to not be
|
||||
* automatically restarted with saved state in future sessions.
|
||||
*
|
||||
* %EGG_SM_CLIENT_MODE_NORMAL: The default. #EggSMCLient will
|
||||
* function normally.
|
||||
*
|
||||
* This must be called before the application's main loop begins.
|
||||
**/
|
||||
void
|
||||
egg_sm_client_set_mode (EggSMClientMode mode)
|
||||
{
|
||||
global_client_mode = mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_get_mode:
|
||||
*
|
||||
* Gets the global #EggSMClientMode. See egg_sm_client_set_mode()
|
||||
* for details.
|
||||
*
|
||||
* Return value: the global #EggSMClientMode
|
||||
**/
|
||||
EggSMClientMode
|
||||
egg_sm_client_get_mode (void)
|
||||
{
|
||||
return global_client_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_get:
|
||||
*
|
||||
* Returns the master #EggSMClient for the application.
|
||||
*
|
||||
* On platforms that support saved sessions (ie, POSIX/X11), the
|
||||
* application will only request to be restarted by the session
|
||||
* manager if you call egg_set_desktop_file() to set an application
|
||||
* desktop file. In particular, if the desktop file contains the key
|
||||
* "X
|
||||
*
|
||||
* Return value: the master #EggSMClient.
|
||||
**/
|
||||
EggSMClient *
|
||||
egg_sm_client_get (void)
|
||||
{
|
||||
if (!global_client)
|
||||
{
|
||||
if (global_client_mode != EGG_SM_CLIENT_MODE_DISABLED &&
|
||||
!sm_client_disable)
|
||||
{
|
||||
global_client = egg_sm_client_xsmp_new ();
|
||||
}
|
||||
|
||||
/* Fallback: create a dummy client, so that callers don't have
|
||||
* to worry about a %NULL return value.
|
||||
*/
|
||||
if (!global_client)
|
||||
global_client = g_object_new (EGG_TYPE_SM_CLIENT, NULL);
|
||||
}
|
||||
|
||||
return global_client;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_is_resumed:
|
||||
* @client: the client
|
||||
*
|
||||
* Checks whether or not the current session has been resumed from
|
||||
* a previous saved session. If so, the application should call
|
||||
* egg_sm_client_get_state_file() and restore its state from the
|
||||
* returned #GKeyFile.
|
||||
*
|
||||
* Return value: %TRUE if the session has been resumed
|
||||
**/
|
||||
gboolean
|
||||
egg_sm_client_is_resumed (EggSMClient *client)
|
||||
{
|
||||
g_return_val_if_fail (client == global_client, FALSE);
|
||||
|
||||
return sm_client_state_file != NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_get_state_file:
|
||||
* @client: the client
|
||||
*
|
||||
* If the application was resumed by the session manager, this will
|
||||
* return the #GKeyFile containing its state from the previous
|
||||
* session.
|
||||
*
|
||||
* Note that other libraries and #EggSMClient itself may also store
|
||||
* state in the key file, so if you call egg_sm_client_get_groups(),
|
||||
* on it, the return value will likely include groups that you did not
|
||||
* put there yourself. (It is also not guaranteed that the first
|
||||
* group created by the application will still be the "start group"
|
||||
* when it is resumed.)
|
||||
*
|
||||
* Return value: the #GKeyFile containing the application's earlier
|
||||
* state, or %NULL on error. You should not free this key file; it
|
||||
* is owned by @client.
|
||||
**/
|
||||
GKeyFile *
|
||||
egg_sm_client_get_state_file (EggSMClient *client)
|
||||
{
|
||||
EggSMClientPrivate *priv = egg_sm_client_get_instance_private (client);
|
||||
char *state_file_path;
|
||||
GError *err = NULL;
|
||||
|
||||
g_return_val_if_fail (client == global_client, NULL);
|
||||
|
||||
if (!sm_client_state_file)
|
||||
return NULL;
|
||||
if (priv->state_file)
|
||||
return priv->state_file;
|
||||
|
||||
if (!strncmp (sm_client_state_file, "file://", 7))
|
||||
state_file_path = g_filename_from_uri (sm_client_state_file, NULL, NULL);
|
||||
else
|
||||
state_file_path = g_strdup (sm_client_state_file);
|
||||
|
||||
priv->state_file = g_key_file_new ();
|
||||
if (!g_key_file_load_from_file (priv->state_file, state_file_path, 0, &err))
|
||||
{
|
||||
g_warning ("Could not load SM state file '%s': %s",
|
||||
sm_client_state_file, err->message);
|
||||
g_clear_error (&err);
|
||||
g_key_file_free (priv->state_file);
|
||||
priv->state_file = NULL;
|
||||
}
|
||||
|
||||
g_free (state_file_path);
|
||||
return priv->state_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_set_restart_command:
|
||||
* @client: the client
|
||||
* @argc: the length of @argv
|
||||
* @argv: argument vector
|
||||
*
|
||||
* Sets the command used to restart @client if it does not have a
|
||||
* .desktop file that can be used to find its restart command.
|
||||
*
|
||||
* This can also be used when handling the ::save_state signal, to
|
||||
* save the current state via an updated command line. (Eg, providing
|
||||
* a list of filenames to open when the application is resumed.)
|
||||
**/
|
||||
void
|
||||
egg_sm_client_set_restart_command (EggSMClient *client,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
g_return_if_fail (EGG_IS_SM_CLIENT (client));
|
||||
|
||||
if (EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command)
|
||||
EGG_SM_CLIENT_GET_CLASS (client)->set_restart_command (client, argc, argv);
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_set_discard_command:
|
||||
* @client: the client
|
||||
* @argc: the length of @argv
|
||||
* @argv: argument vector
|
||||
*
|
||||
* Sets the command used to discard a custom state file if using
|
||||
* egg_sm_client_set_restart_command(), which must be called before
|
||||
* using this function.
|
||||
**/
|
||||
void
|
||||
egg_sm_client_set_discard_command (EggSMClient *client,
|
||||
int argc,
|
||||
const char **argv)
|
||||
{
|
||||
g_return_if_fail (EGG_IS_SM_CLIENT (client));
|
||||
|
||||
if (EGG_SM_CLIENT_GET_CLASS (client)->set_discard_command)
|
||||
EGG_SM_CLIENT_GET_CLASS (client)->set_discard_command (client, argc, argv);
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_will_quit:
|
||||
* @client: the client
|
||||
* @will_quit: whether or not the application is willing to quit
|
||||
*
|
||||
* This MUST be called in response to the ::quit_requested signal, to
|
||||
* indicate whether or not the application is willing to quit. The
|
||||
* application may call it either directly from the signal handler, or
|
||||
* at some later point (eg, after asynchronously interacting with the
|
||||
* user).
|
||||
*
|
||||
* If the application does not connect to ::quit_requested,
|
||||
* #EggSMClient will call this method on its behalf (passing %TRUE
|
||||
* for @will_quit).
|
||||
*
|
||||
* After calling this method, the application should wait to receive
|
||||
* either ::quit_cancelled or ::quit.
|
||||
**/
|
||||
void
|
||||
egg_sm_client_will_quit (EggSMClient *client,
|
||||
gboolean will_quit)
|
||||
{
|
||||
g_return_if_fail (EGG_IS_SM_CLIENT (client));
|
||||
|
||||
if (EGG_SM_CLIENT_GET_CLASS (client)->will_quit)
|
||||
EGG_SM_CLIENT_GET_CLASS (client)->will_quit (client, will_quit);
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_sm_client_end_session:
|
||||
* @style: a hint at how to end the session
|
||||
* @request_confirmation: whether or not the user should get a chance
|
||||
* to confirm the action
|
||||
*
|
||||
* Requests that the session manager end the current session. @style
|
||||
* indicates how the session should be ended, and
|
||||
* @request_confirmation indicates whether or not the user should be
|
||||
* given a chance to confirm the logout/reboot/shutdown. Both of these
|
||||
* flags are merely hints though; the session manager may choose to
|
||||
* ignore them.
|
||||
*
|
||||
* Return value: %TRUE if the request was sent; %FALSE if it could not
|
||||
* be (eg, because it could not connect to the session manager).
|
||||
**/
|
||||
gboolean
|
||||
egg_sm_client_end_session (EggSMClientEndStyle style,
|
||||
gboolean request_confirmation)
|
||||
{
|
||||
EggSMClient *client = egg_sm_client_get ();
|
||||
|
||||
g_return_val_if_fail (EGG_IS_SM_CLIENT (client), FALSE);
|
||||
|
||||
if (EGG_SM_CLIENT_GET_CLASS (client)->end_session)
|
||||
{
|
||||
return EGG_SM_CLIENT_GET_CLASS (client)->end_session (client, style,
|
||||
request_confirmation);
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Signal-emitting callbacks from platform-specific code */
|
||||
|
||||
GKeyFile *
|
||||
egg_sm_client_save_state (EggSMClient *client)
|
||||
{
|
||||
GKeyFile *state_file;
|
||||
char *group;
|
||||
|
||||
g_return_val_if_fail (client == global_client, NULL);
|
||||
|
||||
state_file = g_key_file_new ();
|
||||
|
||||
g_debug ("Emitting save_state");
|
||||
g_signal_emit (client, signals[SAVE_STATE], 0, state_file);
|
||||
g_debug ("Done emitting save_state");
|
||||
|
||||
group = g_key_file_get_start_group (state_file);
|
||||
if (group)
|
||||
{
|
||||
g_free (group);
|
||||
return state_file;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_key_file_free (state_file);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
egg_sm_client_quit_requested (EggSMClient *client)
|
||||
{
|
||||
g_return_if_fail (client == global_client);
|
||||
|
||||
if (!g_signal_has_handler_pending (client, signals[QUIT_REQUESTED], 0, FALSE))
|
||||
{
|
||||
g_debug ("Not emitting quit_requested because no one is listening");
|
||||
egg_sm_client_will_quit (client, TRUE);
|
||||
return;
|
||||
}
|
||||
|
||||
g_debug ("Emitting quit_requested");
|
||||
g_signal_emit (client, signals[QUIT_REQUESTED], 0);
|
||||
g_debug ("Done emitting quit_requested");
|
||||
}
|
||||
|
||||
void
|
||||
egg_sm_client_quit_cancelled (EggSMClient *client)
|
||||
{
|
||||
g_return_if_fail (client == global_client);
|
||||
|
||||
g_debug ("Emitting quit_cancelled");
|
||||
g_signal_emit (client, signals[QUIT_CANCELLED], 0);
|
||||
g_debug ("Done emitting quit_cancelled");
|
||||
}
|
||||
|
||||
void
|
||||
egg_sm_client_quit (EggSMClient *client)
|
||||
{
|
||||
g_return_if_fail (client == global_client);
|
||||
|
||||
g_debug ("Emitting quit");
|
||||
g_signal_emit (client, signals[QUIT], 0);
|
||||
g_debug ("Done emitting quit");
|
||||
|
||||
/* FIXME: should we just call gtk_main_quit() here? */
|
||||
}
|
||||
|
||||
static void
|
||||
egg_sm_client_debug_handler (const char *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const char *message,
|
||||
gpointer user_data)
|
||||
{
|
||||
static int debug = -1;
|
||||
|
||||
if (debug < 0)
|
||||
debug = (g_getenv ("EGG_SM_CLIENT_DEBUG") != NULL);
|
||||
|
||||
if (debug)
|
||||
g_log_default_handler (log_domain, log_level, message, NULL);
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
/* eggsmclient.h
|
||||
* Copyright (C) 2007 Novell, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EGG_SM_CLIENT_H__
|
||||
#define __EGG_SM_CLIENT_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ())
|
||||
#define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient))
|
||||
#define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass))
|
||||
#define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT))
|
||||
#define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT))
|
||||
#define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass))
|
||||
|
||||
typedef struct _EggSMClient EggSMClient;
|
||||
typedef struct _EggSMClientClass EggSMClientClass;
|
||||
typedef struct _EggSMClientPrivate EggSMClientPrivate;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EGG_SM_CLIENT_END_SESSION_DEFAULT,
|
||||
EGG_SM_CLIENT_LOGOUT,
|
||||
EGG_SM_CLIENT_REBOOT,
|
||||
EGG_SM_CLIENT_SHUTDOWN
|
||||
} EggSMClientEndStyle;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
EGG_SM_CLIENT_MODE_DISABLED,
|
||||
EGG_SM_CLIENT_MODE_NO_RESTART,
|
||||
EGG_SM_CLIENT_MODE_NORMAL
|
||||
} EggSMClientMode;
|
||||
|
||||
struct _EggSMClient
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
};
|
||||
|
||||
struct _EggSMClientClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
/* signals */
|
||||
void (*save_state) (EggSMClient *client,
|
||||
GKeyFile *state_file);
|
||||
|
||||
void (*quit_requested) (EggSMClient *client);
|
||||
void (*quit_cancelled) (EggSMClient *client);
|
||||
void (*quit) (EggSMClient *client);
|
||||
|
||||
/* virtual methods */
|
||||
void (*startup) (EggSMClient *client,
|
||||
const char *client_id);
|
||||
void (*set_restart_command) (EggSMClient *client,
|
||||
int argc,
|
||||
const char **argv);
|
||||
void (*set_discard_command) (EggSMClient *client,
|
||||
int argc,
|
||||
const char **argv);
|
||||
void (*will_quit) (EggSMClient *client,
|
||||
gboolean will_quit);
|
||||
gboolean (*end_session) (EggSMClient *client,
|
||||
EggSMClientEndStyle style,
|
||||
gboolean request_confirmation);
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_egg_reserved1) (void);
|
||||
void (*_egg_reserved2) (void);
|
||||
void (*_egg_reserved3) (void);
|
||||
void (*_egg_reserved4) (void);
|
||||
};
|
||||
|
||||
GType egg_sm_client_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GOptionGroup *egg_sm_client_get_option_group (void);
|
||||
|
||||
/* Initialization */
|
||||
void egg_sm_client_set_mode (EggSMClientMode mode);
|
||||
EggSMClientMode egg_sm_client_get_mode (void);
|
||||
EggSMClient *egg_sm_client_get (void);
|
||||
|
||||
/* Resuming a saved session */
|
||||
gboolean egg_sm_client_is_resumed (EggSMClient *client);
|
||||
GKeyFile *egg_sm_client_get_state_file (EggSMClient *client);
|
||||
|
||||
/* Alternate means of saving state */
|
||||
void egg_sm_client_set_restart_command (EggSMClient *client,
|
||||
int argc,
|
||||
const char **argv);
|
||||
void egg_sm_client_set_discard_command (EggSMClient *client,
|
||||
int argc,
|
||||
const char **argv);
|
||||
|
||||
/* Handling "quit_requested" signal */
|
||||
void egg_sm_client_will_quit (EggSMClient *client,
|
||||
gboolean will_quit);
|
||||
|
||||
/* Initiate a logout/reboot/shutdown */
|
||||
gboolean egg_sm_client_end_session (EggSMClientEndStyle style,
|
||||
gboolean request_confirmation);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __EGG_SM_CLIENT_H__ */
|
|
@ -12,7 +12,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Keyboard Shortcuts</property>
|
||||
<property name="role">mate-terminal-accels</property>
|
||||
<property name="role">gatuno-terminal-accels</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox2">
|
||||
|
|
|
@ -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>
|
|
@ -567,7 +567,7 @@ editor_response_cb (GtkWidget *editor,
|
|||
{
|
||||
if (response == GTK_RESPONSE_HELP)
|
||||
{
|
||||
terminal_util_show_help ("mate-terminal-prefs", GTK_WINDOW (editor));
|
||||
terminal_util_show_help ("gatuno-terminal-prefs", GTK_WINDOW (editor));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Profiles</property>
|
||||
<property name="role">mate-terminal-profile-manager</property>
|
||||
<property name="role">gatuno-terminal-profile-manager</property>
|
||||
<property name="default_width">400</property>
|
||||
<property name="default_height">300</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
|
|
|
@ -231,7 +231,7 @@ Author: Wolfgang Ulbrich
|
|||
<property name="can_focus">False</property>
|
||||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Profile Editor</property>
|
||||
<property name="role">mate-terminal-profile-editor</property>
|
||||
<property name="role">gatuno-terminal-profile-editor</property>
|
||||
<property name="default_width">600</property>
|
||||
<property name="default_height">400</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
|
|
|
@ -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,6 @@ 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 char*
|
||||
binding_name (guint keyval,
|
||||
|
@ -413,13 +408,6 @@ terminal_accels_init (void)
|
|||
{
|
||||
guint i, j;
|
||||
|
||||
settings_keybindings = g_settings_new (CONF_KEYS_SCHEMA);
|
||||
|
||||
g_signal_connect (settings_keybindings,
|
||||
"changed",
|
||||
G_CALLBACK(keys_change_notify),
|
||||
NULL);
|
||||
|
||||
gsettings_key_to_entry = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
notification_group = gtk_accel_group_new ();
|
||||
|
@ -444,7 +432,7 @@ terminal_accels_init (void)
|
|||
gtk_accel_group_connect_by_path (notification_group,
|
||||
I_(key_entry->accel_path),
|
||||
key_entry->closure);
|
||||
keys_change_notify (settings_keybindings, key_entry->gsettings_key, NULL);
|
||||
keys_change_notify (terminal_app_get_global_settings (), key_entry->gsettings_key, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -455,12 +443,6 @@ terminal_accels_init (void)
|
|||
void
|
||||
terminal_accels_shutdown (void)
|
||||
{
|
||||
|
||||
g_signal_handlers_disconnect_by_func (settings_keybindings,
|
||||
G_CALLBACK(keys_change_notify),
|
||||
NULL);
|
||||
g_object_unref (settings_keybindings);
|
||||
|
||||
if (sync_idle_id != 0)
|
||||
{
|
||||
g_source_remove (sync_idle_id);
|
||||
|
@ -497,32 +479,38 @@ 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;
|
||||
gboolean has_ini_value = TRUE;
|
||||
GError *gerror = NULL;
|
||||
|
||||
_terminal_debug_print (TERMINAL_DEBUG_ACCELS,
|
||||
"key %s changed\n",
|
||||
key);
|
||||
|
||||
val = g_settings_get_value (settings, key);
|
||||
val = g_key_file_get_string (settings, CONF_KEYS_SCHEMA, key, &gerror);
|
||||
|
||||
if (gerror != NULL) {
|
||||
g_error_free (gerror);
|
||||
|
||||
has_ini_value = FALSE;
|
||||
}
|
||||
|
||||
#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 +520,18 @@ 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))
|
||||
{
|
||||
const char *str = g_variant_is_of_type (val, G_VARIANT_TYPE_STRING) ? g_variant_get_string (val, NULL) : NULL;
|
||||
if (has_ini_value == FALSE) {
|
||||
keyval = key_entry->gsettings_keyval;
|
||||
mask = key_entry->gsettings_mask;
|
||||
} else if (!binding_from_string (val, &keyval, &mask)) {
|
||||
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 +554,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 +568,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 +630,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 +649,8 @@ 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);
|
||||
keys_change_notify (changeset, key_entry->gsettings_key, NULL);
|
||||
g_free (accel_name);
|
||||
}
|
||||
}
|
||||
|
@ -687,20 +658,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, terminal_app_get_global_settings ());
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -892,9 +855,10 @@ 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 (terminal_app_get_global_settings (), CONF_KEYS_SCHEMA,
|
||||
ke->gsettings_key,
|
||||
str);
|
||||
keys_change_notify (terminal_app_get_global_settings (), ke->gsettings_key, NULL);
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
|
@ -938,9 +902,10 @@ accel_cleared_callback (GtkCellRendererAccel *cell,
|
|||
"Cleared keybinding for GSettings %s",
|
||||
ke->gsettings_key);
|
||||
|
||||
g_settings_set_string (settings_keybindings,
|
||||
g_key_file_set_string (terminal_app_get_global_settings (), CONF_KEYS_SCHEMA,
|
||||
ke->gsettings_key,
|
||||
str);
|
||||
keys_change_notify (terminal_app_get_global_settings (), ke->gsettings_key, NULL);
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
|
@ -960,7 +925,7 @@ edit_keys_dialog_response_cb (GtkWidget *editor,
|
|||
{
|
||||
if (response == GTK_RESPONSE_HELP)
|
||||
{
|
||||
terminal_util_show_help ("mate-terminal-shortcuts", GTK_WINDOW (editor));
|
||||
terminal_util_show_help ("gatuno-terminal-shortcuts", GTK_WINDOW (editor));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
@ -41,14 +45,11 @@
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "eggsmclient.h"
|
||||
#include "eggdesktopfile.h"
|
||||
|
||||
#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,9 +91,6 @@ struct _TerminalApp
|
|||
GtkWidget *manage_profiles_delete_button;
|
||||
GtkWidget *manage_profiles_default_menu;
|
||||
|
||||
GSettings *settings_global;
|
||||
GSettings *settings_font;
|
||||
|
||||
GHashTable *profiles;
|
||||
char* default_profile_id;
|
||||
TerminalProfile *default_profile;
|
||||
|
@ -138,6 +136,7 @@ enum
|
|||
};
|
||||
|
||||
static TerminalApp *global_app = NULL;
|
||||
static GKeyFile *settings_global = NULL;
|
||||
|
||||
#define MONOSPACE_FONT_SCHEMA "org.mate.interface"
|
||||
#define MONOSPACE_FONT_KEY "monospace-font-name"
|
||||
|
@ -161,64 +160,10 @@ 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 */
|
||||
static void terminal_app_profile_list_notify_cb (TerminalApp *app);
|
||||
static void terminal_app_default_profile_notify_cb (GKeyFile *settings, gchar *key, gpointer user_data);
|
||||
|
||||
static GdkScreen*
|
||||
terminal_app_get_screen_by_display_name (const char *display_name,
|
||||
|
@ -383,20 +328,15 @@ 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 (g_get_user_config_dir (), "/gatuno-terminal/profiles/", 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);
|
||||
|
||||
/* Volver a listar los perfiles para provocar que se actualicen */
|
||||
terminal_app_profile_list_notify_cb (app);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -563,8 +503,9 @@ 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 (settings_global, CONF_GLOBAL_SCHEMA, DEFAULT_PROFILE_KEY, terminal_profile_get_property_string (profile, TERMINAL_PROFILE_NAME));
|
||||
terminal_app_default_profile_notify_cb (settings_global, DEFAULT_PROFILE_KEY, app);
|
||||
/* 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 +750,45 @@ 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_user_config_dir (), "/gatuno-terminal/profiles", NULL);
|
||||
|
||||
/* Posiblemente no exista, intentar crear como directorio */
|
||||
ret = g_mkdir_with_parents (profile_dir, 0755);
|
||||
|
||||
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_dir_close (dir);
|
||||
}
|
||||
|
||||
//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 +799,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 +821,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,22 +900,19 @@ 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;
|
||||
name = g_strdup (FALLBACK_PROFILE_ID);
|
||||
g_assert (name != NULL);
|
||||
|
||||
g_free (app->default_profile_id);
|
||||
|
@ -961,7 +921,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
|
||||
|
@ -982,19 +942,18 @@ encoding_mark_active (gpointer key,
|
|||
encoding->is_active = active;
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_app_encoding_list_notify_cb (GSettings *settings,
|
||||
void
|
||||
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 +970,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,40 +987,18 @@ 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,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
terminal_app_system_set_default_font (TerminalApp *app)
|
||||
{
|
||||
TerminalApp *app = TERMINAL_APP (user_data);
|
||||
GVariant *val;
|
||||
const 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);
|
||||
if (!font)
|
||||
font = DEFAULT_MONOSPACE_FONT;
|
||||
g_assert (font != NULL);
|
||||
|
||||
if (font && (strlen (font) == 0)) /* empty string */
|
||||
font = DEFAULT_MONOSPACE_FONT;
|
||||
|
||||
font_desc = pango_font_description_from_string (font);
|
||||
font_desc = pango_font_description_from_string (DEFAULT_MONOSPACE_FONT);
|
||||
if (app->system_font_desc &&
|
||||
pango_font_description_equal (app->system_font_desc, font_desc))
|
||||
{
|
||||
|
@ -1080,18 +1012,23 @@ 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);
|
||||
}
|
||||
|
||||
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 +1037,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;
|
||||
|
||||
|
@ -1166,9 +1109,10 @@ new_profile_response_cb (GtkWidget *new_profile_dialog,
|
|||
/* 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)
|
||||
if (retval == GTK_RESPONSE_NO) {
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
g_list_free (profiles);
|
||||
|
||||
transient_parent = gtk_window_get_transient_for (GTK_WINDOW (new_profile_dialog));
|
||||
|
@ -1179,13 +1123,8 @@ 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);
|
||||
|
||||
terminal_app_profile_list_notify_cb (app);
|
||||
cleanup:
|
||||
g_free (name);
|
||||
}
|
||||
|
@ -1294,7 +1233,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;
|
||||
}
|
||||
|
||||
|
@ -1393,21 +1332,6 @@ terminal_app_manage_profiles (TerminalApp *app,
|
|||
gtk_window_present (GTK_WINDOW (app->manage_profiles_dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_app_save_state_cb (EggSMClient *client,
|
||||
GKeyFile *key_file,
|
||||
TerminalApp *app)
|
||||
{
|
||||
terminal_app_save_config (app, key_file);
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_app_client_quit_cb (EggSMClient *client,
|
||||
TerminalApp *app)
|
||||
{
|
||||
g_signal_emit (app, signals[QUIT], 0);
|
||||
}
|
||||
|
||||
/* Class implementation */
|
||||
|
||||
G_DEFINE_TYPE (TerminalApp, terminal_app, G_TYPE_OBJECT)
|
||||
|
@ -1415,6 +1339,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);
|
||||
|
@ -1422,62 +1347,36 @@ terminal_app_init (TerminalApp *app)
|
|||
/* Initialise defaults */
|
||||
app->enable_mnemonics = DEFAULT_ENABLE_MNEMONICS;
|
||||
app->enable_menu_accels = DEFAULT_ENABLE_MENU_BAR_ACCEL;
|
||||
|
||||
app->system_font_desc = NULL;
|
||||
app->profiles = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
|
||||
|
||||
app->encodings = terminal_encodings_get_builtins ();
|
||||
|
||||
app->settings_global = g_settings_new (CONF_GLOBAL_SCHEMA);
|
||||
app->settings_font = g_settings_new (MONOSPACE_FONT_SCHEMA);
|
||||
/* Verificar que exista como directorio */
|
||||
concat = g_strconcat (g_get_user_config_dir (), "/gatuno-terminal", NULL);
|
||||
/* Posiblemente no exista, intentar crear como directorio */
|
||||
g_mkdir_with_parents (concat, 0755);
|
||||
g_free (concat);
|
||||
|
||||
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);
|
||||
settings_global = g_key_file_new ();
|
||||
concat = g_strconcat (g_get_user_config_dir (), "/gatuno-terminal/config", NULL);
|
||||
g_key_file_load_from_file (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_default_profile_notify_cb (app->settings_global,
|
||||
terminal_app_profile_list_notify_cb (app);
|
||||
|
||||
terminal_app_default_profile_notify_cb (settings_global,
|
||||
DEFAULT_PROFILE_KEY,
|
||||
app);
|
||||
terminal_app_encoding_list_notify_cb (app->settings_global,
|
||||
terminal_app_encoding_list_notify_cb (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,
|
||||
terminal_app_system_set_default_font (app);
|
||||
terminal_app_enable_menu_accels_notify_cb (settings_global,
|
||||
ENABLE_MENU_BAR_ACCEL_KEY,
|
||||
app);
|
||||
terminal_app_enable_mnemonics_notify_cb (app->settings_global,
|
||||
terminal_app_enable_mnemonics_notify_cb (settings_global,
|
||||
ENABLE_MNEMONICS_KEY,
|
||||
app);
|
||||
|
||||
|
@ -1486,56 +1385,19 @@ terminal_app_init (TerminalApp *app)
|
|||
g_assert (app->system_font_desc != NULL);
|
||||
|
||||
terminal_accels_init ();
|
||||
|
||||
EggSMClient *sm_client;
|
||||
char *desktop_file;
|
||||
|
||||
desktop_file = g_build_filename (TERM_DATADIR,
|
||||
"applications",
|
||||
PACKAGE ".desktop",
|
||||
NULL);
|
||||
egg_set_desktop_file_without_defaults (desktop_file);
|
||||
g_free (desktop_file);
|
||||
|
||||
sm_client = egg_sm_client_get ();
|
||||
g_signal_connect (sm_client, "save-state",
|
||||
G_CALLBACK (terminal_app_save_state_cb), app);
|
||||
g_signal_connect (sm_client, "quit",
|
||||
G_CALLBACK (terminal_app_client_quit_cb), app);
|
||||
}
|
||||
|
||||
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_user_config_dir (), "/gatuno-terminal/config", NULL);
|
||||
g_key_file_save_to_file (settings_global, concat, NULL);
|
||||
g_key_file_free (settings_global);
|
||||
g_free (concat);
|
||||
|
||||
g_free (app->default_profile_id);
|
||||
|
||||
|
@ -1595,11 +1457,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 (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 (settings_global, CONF_GLOBAL_SCHEMA, ENABLE_MNEMONICS_KEY, app->enable_mnemonics);
|
||||
break;
|
||||
case PROP_DEFAULT_PROFILE:
|
||||
case PROP_SYSTEM_FONT:
|
||||
|
@ -1697,6 +1559,10 @@ terminal_app_get (void)
|
|||
return global_app;
|
||||
}
|
||||
|
||||
GKeyFile *terminal_app_get_global_settings (void) {
|
||||
return settings_global;
|
||||
}
|
||||
|
||||
void
|
||||
terminal_app_shutdown (void)
|
||||
{
|
||||
|
@ -1759,20 +1625,6 @@ terminal_app_handle_options (TerminalApp *app,
|
|||
/* fall-through on success */
|
||||
}
|
||||
|
||||
EggSMClient *sm_client;
|
||||
|
||||
sm_client = egg_sm_client_get ();
|
||||
|
||||
if (allow_resume && egg_sm_client_is_resumed (sm_client))
|
||||
{
|
||||
GKeyFile *key_file;
|
||||
|
||||
key_file = egg_sm_client_get_state_file (sm_client);
|
||||
if (key_file != NULL &&
|
||||
!terminal_options_merge_config (options, key_file, SOURCE_SESSION, error))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Make sure we open at least one window */
|
||||
terminal_options_ensure_window (options);
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
@ -86,6 +82,7 @@ typedef struct _TerminalApp TerminalApp;
|
|||
GType terminal_app_get_type (void);
|
||||
|
||||
TerminalApp* terminal_app_get (void);
|
||||
GKeyFile *terminal_app_get_global_settings (void);
|
||||
|
||||
void terminal_app_shutdown (void);
|
||||
|
||||
|
@ -158,6 +155,10 @@ gboolean terminal_app_save_config_file (TerminalApp *app,
|
|||
const char *file_name,
|
||||
GError **error);
|
||||
|
||||
void
|
||||
terminal_app_encoding_list_notify_cb (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* !TERMINAL_APP_H */
|
||||
|
|
|
@ -290,7 +290,7 @@ update_active_encodings_gsettings (void)
|
|||
GSList *list, *l;
|
||||
GArray *strings;
|
||||
const gchar *id_string;
|
||||
GSettings *settings;
|
||||
GKeyFile *settings;
|
||||
|
||||
list = terminal_app_get_active_encodings (terminal_app_get ());
|
||||
strings = g_array_new (TRUE, TRUE, sizeof (gchar *));
|
||||
|
@ -302,13 +302,14 @@ update_active_encodings_gsettings (void)
|
|||
strings = g_array_append_val (strings, id_string);
|
||||
}
|
||||
|
||||
settings = g_settings_new (CONF_GLOBAL_SCHEMA);
|
||||
g_settings_set_strv (settings, "active-encodings", (const gchar **) strings->data);
|
||||
g_object_unref (settings);
|
||||
settings = terminal_app_get_global_settings ();
|
||||
g_key_file_set_string_list (settings, CONF_GLOBAL_SCHEMA, "active-encodings", (const gchar **) strings->data, g_strv_length ((const gchar **) strings->data));
|
||||
|
||||
g_array_free (strings, TRUE);
|
||||
g_slist_foreach (list, (GFunc) terminal_encoding_unref, NULL);
|
||||
g_slist_free (list);
|
||||
|
||||
terminal_app_encoding_list_notify_cb (settings, "active-encodings", terminal_app_get ());
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -317,7 +318,7 @@ response_callback (GtkWidget *window,
|
|||
EncodingDialogData *data)
|
||||
{
|
||||
if (id == GTK_RESPONSE_HELP)
|
||||
terminal_util_show_help ("mate-terminal-encoding-add", GTK_WINDOW (window));
|
||||
terminal_util_show_help ("gatuno-terminal-encoding-add", GTK_WINDOW (window));
|
||||
else
|
||||
gtk_widget_destroy (GTK_WIDGET (window));
|
||||
}
|
||||
|
@ -489,7 +490,7 @@ terminal_encoding_dialog_show (GtkWindow *transient_parent)
|
|||
g_object_set_data_full (G_OBJECT (data->dialog), "GT::Data", data, (GDestroyNotify) encoding_dialog_data_free);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (data->dialog), transient_parent);
|
||||
gtk_window_set_role (GTK_WINDOW (data->dialog), "mate-terminal-encodings");
|
||||
gtk_window_set_role (GTK_WINDOW (data->dialog), "gatuno-terminal-encodings");
|
||||
g_signal_connect (data->dialog, "response",
|
||||
G_CALLBACK (response_callback), data);
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ unsupported_option_callback (const gchar *option_name,
|
|||
gpointer data,
|
||||
GError **error)
|
||||
{
|
||||
g_printerr (_("Option \"%s\" is no longer supported in this version of mate-terminal;"
|
||||
g_printerr (_("Option \"%s\" is no longer supported in this version of gatuno-terminal;"
|
||||
" you might want to create a profile with the desired setting, and use"
|
||||
" the new '--profile' option\n"), option_name);
|
||||
return TRUE; /* we do not want to bail out here but continue */
|
||||
|
@ -186,7 +186,7 @@ option_version_cb (const gchar *option_name,
|
|||
gpointer data,
|
||||
GError **error)
|
||||
{
|
||||
g_print ("%s %s\n", _("MATE Terminal"), VERSION);
|
||||
g_print ("%s %s\n", _("Gatuno Terminal"), VERSION);
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
@ -1363,11 +1363,11 @@ get_goption_context (TerminalOptions *options)
|
|||
|
||||
context = g_option_context_new (NULL);
|
||||
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
|
||||
g_option_context_set_description (context, N_("MATE Terminal Emulator"));
|
||||
g_option_context_set_description (context, N_("Gatuno Terminal Emulator"));
|
||||
|
||||
group = g_option_group_new ("mate-terminal",
|
||||
N_("MATE Terminal Emulator"),
|
||||
N_("Show MATE Terminal options"),
|
||||
group = g_option_group_new ("gatuno-terminal",
|
||||
N_("Gatuno Terminal Emulator"),
|
||||
N_("Show Gatuno Terminal options"),
|
||||
options,
|
||||
NULL);
|
||||
g_option_group_set_translation_domain (group, GETTEXT_PACKAGE);
|
||||
|
|
|
@ -165,15 +165,15 @@ enum
|
|||
#define DEFAULT_VISIBLE_NAME (N_("Unnamed"))
|
||||
#define DEFAULT_WORD_CHARS ("-A-Za-z0-9,./?%&#:_=+@~")
|
||||
|
||||
#define PROFILE_GROUP_NAME "profile"
|
||||
|
||||
struct _TerminalProfilePrivate
|
||||
{
|
||||
GValueArray *properties;
|
||||
gboolean *locked;
|
||||
|
||||
GSettings *settings;
|
||||
GKeyFile *settings;
|
||||
char *profile_dir;
|
||||
|
||||
GSList *dirty_pspecs;
|
||||
guint save_idle_id;
|
||||
|
||||
GParamSpec *gsettings_notification_pspec;
|
||||
|
@ -547,95 +547,139 @@ terminal_profile_reset_property_internal (TerminalProfile *profile,
|
|||
}
|
||||
|
||||
static void
|
||||
terminal_profile_gsettings_notify_cb (GSettings *settings,
|
||||
terminal_profile_ini_read (GKeyFile *settings,
|
||||
gchar *key,
|
||||
gpointer user_data)
|
||||
{
|
||||
TerminalProfile *profile = TERMINAL_PROFILE (user_data);
|
||||
TerminalProfilePrivate *priv = profile->priv;
|
||||
TerminalProfileClass *klass;
|
||||
GVariant *settings_value;
|
||||
GError *gerror = NULL;
|
||||
GParamSpec *pspec;
|
||||
GValue value = { 0, };
|
||||
GValue value = { 0, }, *default_value;
|
||||
gboolean equal;
|
||||
gboolean force_set = FALSE;
|
||||
|
||||
if (!key) return;
|
||||
|
||||
_terminal_debug_print (TERMINAL_DEBUG_PROFILE,
|
||||
"GSettings notification for key %s [%s]\n",
|
||||
key,
|
||||
g_settings_is_writable (settings, key) ? "writable" : "LOCKED");
|
||||
|
||||
klass = TERMINAL_PROFILE_GET_CLASS (profile);
|
||||
pspec = g_hash_table_lookup (klass->gsettings_keys, key);
|
||||
if (!pspec)
|
||||
return; /* ignore unknown keys, for future extensibility */
|
||||
|
||||
priv->locked[pspec->param_id] = !g_settings_is_writable (settings, key);
|
||||
|
||||
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 (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_BOOLEAN))
|
||||
goto out;
|
||||
gboolean res;
|
||||
res = g_key_file_get_boolean (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), &gerror);
|
||||
if (gerror != NULL) {
|
||||
/* No es un boolean, triste caso */
|
||||
g_error_free (gerror);
|
||||
|
||||
g_value_set_boolean (&value, g_variant_get_boolean (settings_value));
|
||||
default_value = g_param_spec_get_default_value (pspec);
|
||||
res = g_value_get_boolean (default_value);
|
||||
}
|
||||
|
||||
g_value_set_boolean (&value, res);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_STRING (pspec))
|
||||
{
|
||||
if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING))
|
||||
goto out;
|
||||
gchar *cadena;
|
||||
cadena = g_key_file_get_string (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), NULL);
|
||||
|
||||
g_value_set_string (&value, g_variant_get_string (settings_value, NULL));
|
||||
if (cadena == NULL) {
|
||||
default_value = g_param_spec_get_default_value (pspec);
|
||||
g_value_set_string (&value, g_value_get_string (default_value));
|
||||
goto out;
|
||||
}
|
||||
|
||||
g_value_set_string (&value, cadena);
|
||||
g_free (cadena);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_ENUM (pspec))
|
||||
{
|
||||
gint entero;
|
||||
entero = g_key_file_get_integer (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), &gerror);
|
||||
if (gerror != NULL) {
|
||||
/* No es un entero, mal */
|
||||
g_error_free (gerror);
|
||||
default_value = g_param_spec_get_default_value (pspec);
|
||||
entero = g_value_get_enum (default_value);
|
||||
}
|
||||
|
||||
if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING))
|
||||
goto out;
|
||||
|
||||
g_value_set_enum (&value, g_settings_get_enum (settings, key));
|
||||
g_value_set_enum (&value, entero);
|
||||
}
|
||||
else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_RGBA)
|
||||
{
|
||||
GdkRGBA color;
|
||||
|
||||
if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING))
|
||||
goto out;
|
||||
gchar *cadena;
|
||||
cadena = g_key_file_get_string (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), NULL);
|
||||
|
||||
if (!gdk_rgba_parse (&color, g_variant_get_string (settings_value, NULL)))
|
||||
if (cadena == NULL) {
|
||||
if (strcmp (g_param_spec_get_name (pspec), KEY_FOREGROUND_COLOR) == 0) {
|
||||
cadena = g_strdup ("#000000");
|
||||
} else if (strcmp (g_param_spec_get_name (pspec), KEY_BACKGROUND_COLOR) == 0) {
|
||||
cadena = g_strdup ("#FFFFDD");
|
||||
} else if (strcmp (g_param_spec_get_name (pspec), KEY_BOLD_COLOR) == 0) {
|
||||
cadena = g_strdup ("#000000");
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gdk_rgba_parse (&color, cadena)) {
|
||||
g_free (cadena);
|
||||
goto out;
|
||||
}
|
||||
g_free (cadena);
|
||||
|
||||
g_value_set_boxed (&value, &color);
|
||||
}
|
||||
else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == PANGO_TYPE_FONT_DESCRIPTION)
|
||||
{
|
||||
if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING))
|
||||
goto out;
|
||||
gchar *cadena;
|
||||
cadena = g_key_file_get_string (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), NULL);
|
||||
|
||||
g_value_take_boxed (&value, pango_font_description_from_string (g_variant_get_string (settings_value, NULL)));
|
||||
if (cadena == NULL) {
|
||||
if (strcmp (g_param_spec_get_name (pspec), KEY_FONT) == 0) {
|
||||
cadena = g_strdup ("Monospace 12");
|
||||
} else {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
g_value_take_boxed (&value, pango_font_description_from_string (cadena));
|
||||
g_free (cadena);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_DOUBLE (pspec))
|
||||
{
|
||||
if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_DOUBLE))
|
||||
goto out;
|
||||
gdouble doble;
|
||||
doble = g_key_file_get_double (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), &gerror);
|
||||
|
||||
g_value_set_double (&value, g_variant_get_double (settings_value));
|
||||
if (gerror != NULL) {
|
||||
g_error_free (gerror);
|
||||
default_value = g_param_spec_get_default_value (pspec);
|
||||
doble = g_value_get_double (default_value);
|
||||
}
|
||||
g_value_set_double (&value, doble);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_INT (pspec))
|
||||
{
|
||||
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;
|
||||
gint entero;
|
||||
entero = g_key_file_get_integer (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), &gerror);
|
||||
|
||||
g_value_set_int (&value, g_settings_get_int(settings, key));
|
||||
if (gerror != NULL) {
|
||||
/* No es un entero, mal */
|
||||
g_error_free (gerror);
|
||||
|
||||
default_value = g_param_spec_get_default_value (pspec);
|
||||
entero = g_value_get_int (default_value);
|
||||
}
|
||||
|
||||
g_value_set_int (&value, entero);
|
||||
}
|
||||
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)
|
||||
|
@ -644,12 +688,10 @@ terminal_profile_gsettings_notify_cb (GSettings *settings,
|
|||
GdkRGBA *colors;
|
||||
int n_colors, i;
|
||||
|
||||
if (!g_variant_is_of_type (settings_value, G_VARIANT_TYPE_STRING))
|
||||
goto out;
|
||||
|
||||
color_strings = g_strsplit (g_variant_get_string (settings_value, NULL), ":", -1);
|
||||
if (!color_strings)
|
||||
goto out;
|
||||
color_strings = g_key_file_get_string_list (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), NULL, NULL);
|
||||
if (color_strings == NULL) {
|
||||
color_strings = g_strsplit ("#2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC", ":", 0);
|
||||
}
|
||||
|
||||
n_colors = g_strv_length (color_strings);
|
||||
colors = g_new0 (GdkRGBA, n_colors);
|
||||
|
@ -713,53 +755,33 @@ out:
|
|||
*/
|
||||
|
||||
g_value_unset (&value);
|
||||
g_variant_unref (settings_value);
|
||||
}
|
||||
|
||||
static void
|
||||
terminal_profile_gsettings_changeset_add (TerminalProfile *profile,
|
||||
GSettings *changeset,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
terminal_profile_ini_write (TerminalProfile *profile, GKeyFile *settings, GParamSpec *pspec) {
|
||||
TerminalProfilePrivate *priv = profile->priv;
|
||||
char *key;
|
||||
const GValue *value;
|
||||
TerminalProfileClass *klass;
|
||||
GValue *value;
|
||||
|
||||
/* FIXME: do this? */
|
||||
#if 0
|
||||
if (priv->locked[pspec->param_id])
|
||||
return;
|
||||
if (settings == NULL) return;
|
||||
|
||||
if (!g_settings_is_writable (priv->settings, gsettings_key, NULL))
|
||||
return;
|
||||
#endif
|
||||
|
||||
key = g_param_spec_get_qdata (pspec, gsettings_key_quark);
|
||||
if (!key)
|
||||
return;
|
||||
klass = TERMINAL_PROFILE_GET_CLASS (profile);
|
||||
|
||||
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 GSettings changeset\n",
|
||||
pspec->name, g_strdup_value_contents (value));
|
||||
|
||||
if (G_IS_PARAM_SPEC_BOOLEAN (pspec))
|
||||
g_settings_set_boolean (changeset, key, g_value_get_boolean (value));
|
||||
{
|
||||
g_key_file_set_boolean (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), g_value_get_boolean (value));
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_STRING (pspec))
|
||||
{
|
||||
const char *str;
|
||||
|
||||
str = g_value_get_string (value);
|
||||
g_settings_set_string (changeset, key, str ? str : "");
|
||||
g_key_file_set_string (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), str ? str : "");
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_ENUM (pspec))
|
||||
{
|
||||
const GEnumValue *eval;
|
||||
|
||||
eval = g_enum_get_value (G_PARAM_SPEC_ENUM (pspec)->enum_class, g_value_get_enum (value));
|
||||
|
||||
g_settings_set_enum (changeset, key, eval->value);
|
||||
g_key_file_set_integer (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), g_value_get_enum (value));
|
||||
}
|
||||
else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == GDK_TYPE_RGBA)
|
||||
{
|
||||
|
@ -775,8 +797,7 @@ terminal_profile_gsettings_changeset_add (TerminalProfile *profile,
|
|||
(guint) (color->red * 65535),
|
||||
(guint) (color->green * 65535),
|
||||
(guint) (color->blue * 65535));
|
||||
|
||||
g_settings_set_string (changeset, key, str);
|
||||
g_key_file_set_string (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), str);
|
||||
}
|
||||
else if (G_PARAM_SPEC_VALUE_TYPE (pspec) == PANGO_TYPE_FONT_DESCRIPTION)
|
||||
{
|
||||
|
@ -788,54 +809,60 @@ terminal_profile_gsettings_changeset_add (TerminalProfile *profile,
|
|||
goto cleanup;
|
||||
|
||||
font = pango_font_description_to_string (font_desc);
|
||||
g_settings_set_string (changeset, key, font);
|
||||
g_key_file_set_string (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), font);
|
||||
g_free (font);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_DOUBLE (pspec))
|
||||
g_settings_set_double (changeset, key, g_value_get_double (value));
|
||||
{
|
||||
g_key_file_set_double (settings, PROFILE_GROUP_NAME, g_param_spec_get_name (pspec), g_value_get_double (value));
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_INT (pspec))
|
||||
g_settings_set_int (changeset, key, g_value_get_int (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;
|
||||
GString *string;
|
||||
guint n_colors, i;
|
||||
GPtrArray *builder_str;
|
||||
char **color_strings;
|
||||
GdkRGBA color;
|
||||
int n_colors, i;
|
||||
gchar *cadena;
|
||||
|
||||
/* We need to do this ourselves, because the gtk_color_selection_palette_to_string
|
||||
* does not carry all the bytes, and xterm's palette is messed up...
|
||||
*/
|
||||
array = (GValueArray *) g_value_get_boxed (value);
|
||||
|
||||
array = g_value_get_boxed (value);
|
||||
if (!array)
|
||||
goto cleanup;
|
||||
builder_str = g_ptr_array_new_with_free_func (g_free);
|
||||
|
||||
n_colors = array->n_values;
|
||||
string = g_string_sized_new (n_colors * (1 /* # */ + 3 * 4) + n_colors /* : separators and terminating \0 */);
|
||||
for (i = 0; i < n_colors; ++i)
|
||||
{
|
||||
GdkRGBA *color;
|
||||
|
||||
if (i > 0)
|
||||
g_string_append_c (string, ':');
|
||||
|
||||
color = g_value_get_boxed (g_value_array_get_nth (array, i));
|
||||
if (!color)
|
||||
if (!color) {
|
||||
g_ptr_array_add (builder_str, g_strdup (""));
|
||||
continue;
|
||||
}
|
||||
|
||||
g_string_append_printf (string,
|
||||
"#%04X%04X%04X",
|
||||
cadena = g_strdup_printf ("#%04X%04X%04X",
|
||||
(guint) (color->red * 65535),
|
||||
(guint) (color->green * 65535),
|
||||
(guint) (color->blue * 65535));
|
||||
|
||||
g_ptr_array_add (builder_str, cadena);
|
||||
}
|
||||
|
||||
g_settings_set_string (changeset, key, string->str);
|
||||
g_string_free (string, TRUE);
|
||||
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_ptr_array_unref (builder_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printerr ("Unhandled value type %s of pspec %s\n", g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), pspec->name);
|
||||
|
||||
}
|
||||
cleanup:
|
||||
return;
|
||||
}
|
||||
|
@ -844,18 +871,15 @@ static void
|
|||
terminal_profile_save (TerminalProfile *profile)
|
||||
{
|
||||
TerminalProfilePrivate *priv = profile->priv;
|
||||
GSettings *changeset;
|
||||
GSList *l;
|
||||
gchar *concat;
|
||||
GError *gerror = NULL;
|
||||
gboolean was_saved;
|
||||
|
||||
priv->save_idle_id = 0;
|
||||
concat = g_strconcat (CONF_PROFILE_PREFIX, priv->profile_dir,"/", NULL);
|
||||
changeset = g_settings_new_with_path (CONF_PROFILE_SCHEMA, concat);
|
||||
g_free (concat);
|
||||
g_settings_delay (changeset);
|
||||
|
||||
for (l = priv->dirty_pspecs; l != NULL; l = l->next)
|
||||
{
|
||||
#if 0
|
||||
for (l = priv->dirty_pspecs; l != NULL; l = l->next) {
|
||||
GParamSpec *pspec = (GParamSpec *) l->data;
|
||||
|
||||
if (pspec->owner_type != TERMINAL_TYPE_PROFILE)
|
||||
|
@ -864,14 +888,22 @@ terminal_profile_save (TerminalProfile *profile)
|
|||
if ((pspec->flags & G_PARAM_WRITABLE) == 0)
|
||||
continue;
|
||||
|
||||
terminal_profile_gsettings_changeset_add (profile, changeset, pspec);
|
||||
terminal_profile_ini_write (profile, priv->settings, pspec);
|
||||
}
|
||||
|
||||
g_slist_free (priv->dirty_pspecs);
|
||||
priv->dirty_pspecs = NULL;
|
||||
#endif
|
||||
|
||||
g_settings_apply (changeset);
|
||||
g_object_unref (changeset);
|
||||
concat = g_strconcat (g_get_user_config_dir (), "/gatuno-terminal/profiles/", priv->profile_dir, NULL);
|
||||
|
||||
was_saved = g_key_file_save_to_file (priv->settings, concat, &gerror);
|
||||
|
||||
if (gerror != NULL) {
|
||||
g_error_free (gerror);
|
||||
}
|
||||
|
||||
g_free (concat);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -891,8 +923,9 @@ terminal_profile_schedule_save (TerminalProfile *profile,
|
|||
|
||||
g_assert (pspec != NULL);
|
||||
|
||||
if (!g_slist_find (priv->dirty_pspecs, pspec))
|
||||
priv->dirty_pspecs = g_slist_prepend (priv->dirty_pspecs, pspec);
|
||||
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;
|
||||
|
@ -911,7 +944,6 @@ terminal_profile_init (TerminalProfile *profile)
|
|||
priv = profile->priv = G_TYPE_INSTANCE_GET_PRIVATE (profile, TERMINAL_TYPE_PROFILE, TerminalProfilePrivate);
|
||||
|
||||
priv->gsettings_notification_pspec = NULL;
|
||||
priv->locked = g_new0 (gboolean, LAST_PROP);
|
||||
|
||||
priv->properties = g_value_array_new (LAST_PROP);
|
||||
for (i = 0; i < LAST_PROP; ++i)
|
||||
|
@ -965,16 +997,9 @@ terminal_profile_constructor (GType type,
|
|||
name = g_value_get_string (g_value_array_get_nth (priv->properties, PROP_NAME));
|
||||
g_assert (name != NULL);
|
||||
|
||||
concat = g_strconcat (CONF_PROFILE_PREFIX, name, "/", NULL);
|
||||
priv->settings = g_settings_new_with_path (CONF_PROFILE_SCHEMA, concat);
|
||||
g_assert (priv->settings != NULL);
|
||||
g_free (concat);
|
||||
concat = g_strconcat("changed::", priv->profile_dir, "/", NULL);
|
||||
g_signal_connect (priv->settings,
|
||||
concat,
|
||||
G_CALLBACK(terminal_profile_gsettings_notify_cb),
|
||||
profile);
|
||||
|
||||
priv->settings = g_key_file_new ();
|
||||
concat = g_strconcat (g_get_user_config_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);
|
||||
|
||||
/* Now load those properties from GSettings that were not set as construction params */
|
||||
|
@ -1007,7 +1032,8 @@ terminal_profile_constructor (GType type,
|
|||
if (!key)
|
||||
continue;
|
||||
|
||||
terminal_profile_gsettings_notify_cb (priv->settings, key, profile);
|
||||
/* Tomar esta propiedad desde el archivo */
|
||||
terminal_profile_ini_read (priv->settings, key, profile);
|
||||
}
|
||||
|
||||
g_free (pspecs);
|
||||
|
@ -1021,10 +1047,6 @@ terminal_profile_finalize (GObject *object)
|
|||
TerminalProfile *profile = TERMINAL_PROFILE (object);
|
||||
TerminalProfilePrivate *priv = profile->priv;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (priv->settings,
|
||||
G_CALLBACK(terminal_profile_gsettings_notify_cb),
|
||||
profile);
|
||||
|
||||
if (priv->save_idle_id)
|
||||
{
|
||||
g_source_remove (priv->save_idle_id);
|
||||
|
@ -1035,10 +1057,8 @@ terminal_profile_finalize (GObject *object)
|
|||
|
||||
_terminal_profile_forget (profile);
|
||||
|
||||
g_object_unref (priv->settings);
|
||||
|
||||
g_key_file_free (priv->settings);
|
||||
g_free (priv->profile_dir);
|
||||
g_free (priv->locked);
|
||||
g_value_array_free (priv->properties);
|
||||
|
||||
G_OBJECT_CLASS (terminal_profile_parent_class)->finalize (object);
|
||||
|
@ -1123,23 +1143,18 @@ terminal_profile_set_property (GObject *object,
|
|||
case PROP_NAME:
|
||||
{
|
||||
const char *name = g_value_get_string (value);
|
||||
/* TODO: Cuando un profile cambia de nombre, "vigilar" el nuevo archivo */
|
||||
|
||||
g_assert (name != NULL);
|
||||
priv->profile_dir = g_strdup (name);
|
||||
|
||||
if (priv->settings != NULL) {
|
||||
gchar *concat;
|
||||
g_signal_handlers_disconnect_by_func (priv->settings,
|
||||
G_CALLBACK(terminal_profile_gsettings_notify_cb),
|
||||
profile);
|
||||
g_object_unref (priv->settings);
|
||||
concat= g_strconcat (CONF_PROFILE_PREFIX, priv->profile_dir, "/", NULL);
|
||||
priv->settings = g_settings_new_with_path (CONF_PROFILE_SCHEMA, concat);
|
||||
g_free (concat);
|
||||
concat = g_strconcat("changed::", priv->profile_dir, "/", NULL);
|
||||
g_signal_connect (priv->settings,
|
||||
concat,
|
||||
G_CALLBACK(terminal_profile_gsettings_notify_cb),
|
||||
profile);
|
||||
g_key_file_free (priv->settings);
|
||||
|
||||
concat = g_strconcat (g_get_user_config_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);
|
||||
}
|
||||
break;
|
||||
|
@ -1426,8 +1441,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);
|
||||
|
@ -1442,7 +1455,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);
|
||||
|
||||
|
@ -1551,19 +1564,8 @@ terminal_profile_get_property_string (TerminalProfile *profile,
|
|||
return g_value_get_string (value);
|
||||
}
|
||||
|
||||
gboolean
|
||||
terminal_profile_property_locked (TerminalProfile *profile,
|
||||
const char *prop_name)
|
||||
{
|
||||
TerminalProfilePrivate *priv = profile->priv;
|
||||
GParamSpec *pspec;
|
||||
|
||||
pspec = get_pspec_from_name (profile, prop_name);
|
||||
g_return_val_if_fail (pspec != NULL, FALSE);
|
||||
if (!pspec)
|
||||
gboolean terminal_profile_property_locked (TerminalProfile *profile, const char *prop_name) {
|
||||
return FALSE;
|
||||
|
||||
return priv->locked[pspec->param_id];
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -470,11 +470,12 @@ terminal_util_key_file_get_argv (GKeyFile *key_file,
|
|||
/* Proxy stuff */
|
||||
|
||||
static char *
|
||||
gsettings_get_string (GSettings *settings,
|
||||
gsettings_get_string (GKeyFile *settings,
|
||||
const char *group,
|
||||
const char *key)
|
||||
{
|
||||
char *value;
|
||||
value = g_settings_get_string (settings, key);
|
||||
value = g_key_file_get_string (settings, group, key, NULL);
|
||||
if (G_UNLIKELY (value && *value == '\0'))
|
||||
{
|
||||
g_free (value);
|
||||
|
@ -533,27 +534,27 @@ set_proxy_env (GHashTable *env_table,
|
|||
|
||||
static void
|
||||
setup_http_proxy_env (GHashTable *env_table,
|
||||
GSettings *settings_http)
|
||||
GKeyFile *settings_global)
|
||||
{
|
||||
gchar *host;
|
||||
gint port;
|
||||
|
||||
host = gsettings_get_string (settings_http, "host");
|
||||
port = g_settings_get_int (settings_http, "port");
|
||||
host = gsettings_get_string (settings_global, CONF_HTTP_PROXY_SCHEMA, "host");
|
||||
port = g_key_file_get_integer (settings_global, CONF_HTTP_PROXY_SCHEMA, "port", NULL);
|
||||
if (host && port)
|
||||
{
|
||||
|
||||
GString *buf = g_string_sized_new (64);
|
||||
g_string_append (buf, "http://");
|
||||
|
||||
if (g_settings_get_boolean (settings_http, "use-authentication"))
|
||||
if (g_key_file_get_boolean (settings_global, CONF_HTTP_PROXY_SCHEMA, "use-authentication", NULL))
|
||||
{
|
||||
char *user, *password;
|
||||
user = gsettings_get_string (settings_http, "authentication-user");
|
||||
user = gsettings_get_string (settings_global, CONF_HTTP_PROXY_SCHEMA, "authentication-user");
|
||||
if (user)
|
||||
{
|
||||
g_string_append_uri_escaped (buf, user, NULL, TRUE);
|
||||
password = gsettings_get_string (settings_http, "authentication-password");
|
||||
password = gsettings_get_string (settings_global, CONF_HTTP_PROXY_SCHEMA, "authentication-password");
|
||||
if (password)
|
||||
{
|
||||
g_string_append_c (buf, ':');
|
||||
|
@ -573,9 +574,9 @@ setup_http_proxy_env (GHashTable *env_table,
|
|||
|
||||
static void
|
||||
setup_ignore_host_env (GHashTable *env_table,
|
||||
GSettings *settings)
|
||||
GKeyFile *settings_global)
|
||||
{
|
||||
gchar **ignore = g_settings_get_strv (settings, "ignore-hosts");
|
||||
gchar **ignore = g_key_file_get_string_list (settings_global, CONF_PROXY_SCHEMA, "ignore-hosts", NULL, NULL);
|
||||
if (ignore == NULL)
|
||||
return;
|
||||
|
||||
|
@ -596,13 +597,13 @@ setup_ignore_host_env (GHashTable *env_table,
|
|||
|
||||
static void
|
||||
setup_https_proxy_env (GHashTable *env_table,
|
||||
GSettings *settings_https)
|
||||
GKeyFile *settings_global)
|
||||
{
|
||||
gchar *host;
|
||||
gint port;
|
||||
|
||||
host = gsettings_get_string (settings_https, "host");
|
||||
port = g_settings_get_int (settings_https, "port");
|
||||
host = gsettings_get_string (settings_global, CONF_HTTPS_PROXY_SCHEMA, "host");
|
||||
port = g_key_file_get_integer (settings_global, CONF_HTTPS_PROXY_SCHEMA, "port", NULL);
|
||||
if (host && port)
|
||||
{
|
||||
char *proxy;
|
||||
|
@ -615,13 +616,13 @@ setup_https_proxy_env (GHashTable *env_table,
|
|||
|
||||
static void
|
||||
setup_ftp_proxy_env (GHashTable *env_table,
|
||||
GSettings *settings_ftp)
|
||||
GKeyFile *settings_global)
|
||||
{
|
||||
gchar *host;
|
||||
gint port;
|
||||
|
||||
host = gsettings_get_string (settings_ftp, "host");
|
||||
port = g_settings_get_int (settings_ftp, "port");
|
||||
host = gsettings_get_string (settings_global, CONF_FTP_PROXY_SCHEMA, "host");
|
||||
port = g_key_file_get_integer (settings_global, CONF_FTP_PROXY_SCHEMA, "port", NULL);
|
||||
if (host && port)
|
||||
{
|
||||
char *proxy;
|
||||
|
@ -634,13 +635,13 @@ setup_ftp_proxy_env (GHashTable *env_table,
|
|||
|
||||
static void
|
||||
setup_socks_proxy_env (GHashTable *env_table,
|
||||
GSettings *settings_socks)
|
||||
GKeyFile *settings_global)
|
||||
{
|
||||
gchar *host;
|
||||
gint port;
|
||||
|
||||
host = gsettings_get_string (settings_socks, "host");
|
||||
port = g_settings_get_int (settings_socks, "port");
|
||||
host = gsettings_get_string (settings_global, CONF_SOCKS_PROXY_SCHEMA, "host");
|
||||
port = g_key_file_get_integer (settings_global, CONF_SOCKS_PROXY_SCHEMA, "port", NULL);
|
||||
if (host && port)
|
||||
{
|
||||
char *proxy;
|
||||
|
@ -652,7 +653,7 @@ setup_socks_proxy_env (GHashTable *env_table,
|
|||
|
||||
static void
|
||||
setup_autoconfig_proxy_env (GHashTable *env_table,
|
||||
GSettings *settings)
|
||||
GKeyFile *settings_global)
|
||||
{
|
||||
/* XXX Not sure what to do with this. See bug #596688.
|
||||
gchar *url;
|
||||
|
@ -678,33 +679,38 @@ void
|
|||
terminal_util_add_proxy_env (GHashTable *env_table)
|
||||
{
|
||||
char *proxymode;
|
||||
/* Trasladar estos gsettings al único fichero global */
|
||||
GKeyFile *settings_global = terminal_app_get_global_settings ();
|
||||
|
||||
/*
|
||||
TODO: Sería ideal trasladar estas configuraciones a un archivo global
|
||||
GSettings *settings = g_settings_new (CONF_PROXY_SCHEMA);
|
||||
GSettings *settings_http = g_settings_new (CONF_HTTP_PROXY_SCHEMA);
|
||||
GSettings *settings_https = g_settings_new (CONF_HTTPS_PROXY_SCHEMA);
|
||||
GSettings *settings_ftp = g_settings_new (CONF_FTP_PROXY_SCHEMA);
|
||||
GSettings *settings_socks = g_settings_new (CONF_SOCKS_PROXY_SCHEMA);
|
||||
|
||||
*/
|
||||
/* If mode is not manual, nothing to set */
|
||||
proxymode = gsettings_get_string (settings, "mode");
|
||||
proxymode = g_key_file_get_string (settings_global, CONF_PROXY_SCHEMA, "mode", NULL);
|
||||
if (proxymode && 0 == strcmp (proxymode, "manual"))
|
||||
{
|
||||
setup_http_proxy_env (env_table, settings_http);
|
||||
setup_ignore_host_env (env_table, settings);
|
||||
setup_https_proxy_env (env_table, settings_https);
|
||||
setup_ftp_proxy_env (env_table, settings_ftp);
|
||||
setup_socks_proxy_env (env_table, settings_socks);
|
||||
setup_http_proxy_env (env_table, settings_global);
|
||||
setup_ignore_host_env (env_table, settings_global);
|
||||
setup_https_proxy_env (env_table, settings_global);
|
||||
setup_ftp_proxy_env (env_table, settings_global);
|
||||
setup_socks_proxy_env (env_table, settings_global);
|
||||
}
|
||||
else if (proxymode && 0 == strcmp (proxymode, "auto"))
|
||||
{
|
||||
setup_autoconfig_proxy_env (env_table, settings);
|
||||
setup_autoconfig_proxy_env (env_table, settings_global);
|
||||
}
|
||||
|
||||
g_free (proxymode);
|
||||
g_object_unref (settings);
|
||||
/*g_object_unref (settings);
|
||||
g_object_unref (settings_http);
|
||||
g_object_unref (settings_https);
|
||||
g_object_unref (settings_ftp);
|
||||
g_object_unref (settings_socks);
|
||||
g_object_unref (settings_socks);*/
|
||||
}
|
||||
|
||||
/* Bidirectional object/widget binding */
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define CONF_PROXY_SCHEMA "org.gnome.system.proxy"
|
||||
#define CONF_HTTP_PROXY_SCHEMA "org.gnome.system.proxy.http"
|
||||
#define CONF_HTTPS_PROXY_SCHEMA "org.gnome.system.proxy.https"
|
||||
#define CONF_FTP_PROXY_SCHEMA "org.gnome.system.proxy.ftp"
|
||||
#define CONF_SOCKS_PROXY_SCHEMA "org.gnome.system.proxy.socks"
|
||||
#define CONF_PROXY_SCHEMA "proxy"
|
||||
#define CONF_HTTP_PROXY_SCHEMA "proxy.http"
|
||||
#define CONF_HTTPS_PROXY_SCHEMA "proxy.https"
|
||||
#define CONF_FTP_PROXY_SCHEMA "proxy.ftp"
|
||||
#define CONF_SOCKS_PROXY_SCHEMA "proxy.socks"
|
||||
|
||||
void terminal_util_set_unique_role (GtkWindow *window, const char *prefix);
|
||||
|
||||
|
|
|
@ -159,10 +159,10 @@ static gboolean terminal_window_focus_in_event (GtkWidget *widget,
|
|||
|
||||
static gboolean notebook_button_press_cb (GtkWidget *notebook,
|
||||
GdkEventButton *event,
|
||||
GSettings *settings);
|
||||
gpointer data);
|
||||
static gboolean window_key_press_cb (GtkWidget *notebook,
|
||||
GdkEventKey *event,
|
||||
GSettings *settings);
|
||||
gpointer data);
|
||||
static gboolean notebook_popup_menu_cb (GtkWidget *notebook,
|
||||
TerminalWindow *window);
|
||||
static void notebook_page_selected_callback (GtkWidget *notebook,
|
||||
|
@ -2145,10 +2145,8 @@ terminal_window_init (TerminalWindow *window)
|
|||
|
||||
GtkStyleContext *context;
|
||||
|
||||
GSettings *settings = g_settings_new ("org.mate.terminal.global");
|
||||
|
||||
context = gtk_widget_get_style_context (GTK_WIDGET (window));
|
||||
gtk_style_context_add_class (context, "mate-terminal");
|
||||
gtk_style_context_add_class (context, "gatuno-terminal");
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (window), _("Terminal"));
|
||||
|
||||
|
@ -2163,11 +2161,11 @@ terminal_window_init (TerminalWindow *window)
|
|||
gtk_notebook_set_scrollable (GTK_NOTEBOOK (priv->notebook), TRUE);
|
||||
gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), FALSE);
|
||||
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (priv->notebook), FALSE);
|
||||
gtk_notebook_set_group_name (GTK_NOTEBOOK (priv->notebook), I_("mate-terminal-window"));
|
||||
gtk_notebook_set_group_name (GTK_NOTEBOOK (priv->notebook), I_("gatuno-terminal-window"));
|
||||
g_signal_connect (priv->notebook, "button-press-event",
|
||||
G_CALLBACK (notebook_button_press_cb), settings);
|
||||
G_CALLBACK (notebook_button_press_cb), NULL);
|
||||
g_signal_connect (window, "key-press-event",
|
||||
G_CALLBACK (window_key_press_cb), settings);
|
||||
G_CALLBACK (window_key_press_cb), NULL);
|
||||
g_signal_connect (priv->notebook, "popup-menu",
|
||||
G_CALLBACK (notebook_popup_menu_cb), window);
|
||||
g_signal_connect_after (priv->notebook, "switch-page",
|
||||
|
@ -2273,7 +2271,7 @@ terminal_window_init (TerminalWindow *window)
|
|||
gtk_window_group_add_window (window_group, GTK_WINDOW (window));
|
||||
g_object_unref (window_group);
|
||||
|
||||
terminal_util_set_unique_role (GTK_WINDOW (window), "mate-terminal-window");
|
||||
terminal_util_set_unique_role (GTK_WINDOW (window), "gatuno-terminal-window");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2864,7 +2862,7 @@ terminal_window_get_active (TerminalWindow *window)
|
|||
static gboolean
|
||||
notebook_button_press_cb (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
GSettings *settings)
|
||||
gpointer data)
|
||||
{
|
||||
TerminalWindow *window = TERMINAL_WINDOW (gtk_widget_get_toplevel (widget));
|
||||
TerminalWindowPrivate *priv = window->priv;
|
||||
|
@ -2876,9 +2874,17 @@ notebook_button_press_cb (GtkWidget *widget,
|
|||
int page_num;
|
||||
int before_pages;
|
||||
int later_pages;
|
||||
gboolean middle_closes;
|
||||
GError *gerror = NULL;
|
||||
|
||||
if ((event->type == GDK_BUTTON_PRESS && event->button == 2) &&
|
||||
(g_settings_get_boolean (settings, "middle-click-closes-tabs")))
|
||||
middle_closes = g_key_file_get_boolean (terminal_app_get_global_settings (), CONF_GLOBAL_SCHEMA, "middle-click-closes-tabs", &gerror);
|
||||
if (gerror != NULL) {
|
||||
g_error_free (gerror);
|
||||
|
||||
middle_closes = FALSE;
|
||||
}
|
||||
|
||||
if ((event->type == GDK_BUTTON_PRESS && event->button == 2) && middle_closes)
|
||||
{
|
||||
tab_clicked = find_tab_num_at_pos (notebook, event->x_root, event->y_root);
|
||||
if (tab_clicked >= 0)
|
||||
|
@ -2936,9 +2942,19 @@ notebook_button_press_cb (GtkWidget *widget,
|
|||
static gboolean
|
||||
window_key_press_cb (GtkWidget *widget,
|
||||
GdkEventKey *event,
|
||||
GSettings *settings)
|
||||
gpointer data)
|
||||
{
|
||||
if (g_settings_get_boolean (settings, "ctrl-tab-switch-tabs") &&
|
||||
gboolean tab_switches;
|
||||
GError *gerror = NULL;
|
||||
|
||||
tab_switches = g_key_file_get_boolean (terminal_app_get_global_settings (), CONF_GLOBAL_SCHEMA, "ctrl-tab-switch-tabs", &gerror);
|
||||
if (gerror != NULL) {
|
||||
g_error_free (gerror);
|
||||
|
||||
tab_switches = FALSE;
|
||||
}
|
||||
|
||||
if (tab_switches &&
|
||||
event->state & GDK_CONTROL_MASK)
|
||||
{
|
||||
TerminalWindow *window = TERMINAL_WINDOW (widget);
|
||||
|
@ -3499,11 +3515,11 @@ confirm_close_window_or_tab (TerminalWindow *window,
|
|||
{
|
||||
TerminalWindowPrivate *priv = window->priv;
|
||||
GtkWidget *dialog;
|
||||
GSettings *settings;
|
||||
gboolean do_confirm;
|
||||
gboolean has_processes;
|
||||
int n_tabs;
|
||||
char *confirm_msg;
|
||||
GError *gerror = NULL;
|
||||
|
||||
if (priv->confirm_close_dialog)
|
||||
{
|
||||
|
@ -3512,9 +3528,13 @@ confirm_close_window_or_tab (TerminalWindow *window,
|
|||
GTK_RESPONSE_DELETE_EVENT);
|
||||
}
|
||||
|
||||
settings = g_settings_new (CONF_GLOBAL_SCHEMA);
|
||||
do_confirm = g_settings_get_boolean (settings, "confirm-window-close");
|
||||
g_object_unref (settings);
|
||||
do_confirm = g_key_file_get_boolean (terminal_app_get_global_settings (), CONF_GLOBAL_SCHEMA, "confirm-window-close", &gerror);
|
||||
if (gerror != NULL) {
|
||||
g_error_free (gerror);
|
||||
|
||||
do_confirm = TRUE;
|
||||
}
|
||||
|
||||
if (!do_confirm)
|
||||
return FALSE;
|
||||
|
||||
|
@ -4168,7 +4188,7 @@ terminal_set_title_callback (GtkAction *action,
|
|||
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Set Title"));
|
||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
||||
gtk_window_set_role (GTK_WINDOW (dialog), "mate-terminal-change-title");
|
||||
gtk_window_set_role (GTK_WINDOW (dialog), "gatuno-terminal-change-title");
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
|
||||
/* Alternative button order was set automatically by GtkMessageDialog */
|
||||
|
||||
|
@ -4336,7 +4356,8 @@ help_about_callback (GtkAction *action,
|
|||
"Copyright © 2006 Guilherme de S. Pastore\n"
|
||||
"Copyright © 2007–2010 Christian Persch\n"
|
||||
"Copyright © 2011 Perberos\n"
|
||||
"Copyright © 2012-2019 MATE developers";
|
||||
"Copyright © 2012-2019 MATE developers\n"
|
||||
"Copyright © 2021 Gatuno\n";
|
||||
char *licence_text;
|
||||
GBytes *bytes;
|
||||
const guint8 *data;
|
||||
|
@ -4390,9 +4411,9 @@ help_about_callback (GtkAction *action,
|
|||
licence_text = terminal_util_get_licence_text ();
|
||||
|
||||
gtk_show_about_dialog (GTK_WINDOW (window),
|
||||
"program-name", _("MATE Terminal"),
|
||||
"program-name", _("Gatuno Terminal"),
|
||||
"copyright", copyright,
|
||||
"comments", _("A terminal emulator for the MATE desktop"),
|
||||
"comments", _("A terminal emulator for the desktop"),
|
||||
"version", VERSION,
|
||||
"authors", array_strv,
|
||||
"artists", artists,
|
||||
|
@ -4401,7 +4422,7 @@ help_about_callback (GtkAction *action,
|
|||
"wrap-license", TRUE,
|
||||
"translator-credits", _("translator-credits"),
|
||||
"logo-icon-name", MATE_TERMINAL_ICON_NAME,
|
||||
"website", "http://www.mate-desktop.org",
|
||||
"website", "http://git.gatuno.mx/gatuno/gatuno-terminal",
|
||||
NULL);
|
||||
|
||||
g_strfreev (array_strv);
|
||||
|
|
351
src/terminal.c
351
src/terminal.c
|
@ -26,6 +26,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
@ -34,7 +35,10 @@
|
|||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#include "eggsmclient.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
#include "terminal-accels.h"
|
||||
#include "terminal-app.h"
|
||||
|
@ -43,9 +47,12 @@
|
|||
#include "terminal-options.h"
|
||||
#include "terminal-util.h"
|
||||
|
||||
#define TERMINAL_FACTORY_SERVICE_NAME_PREFIX "org.mate.Terminal.Display"
|
||||
#define TERMINAL_FACTORY_SERVICE_PATH "/org/mate/Terminal/Factory"
|
||||
#define TERMINAL_FACTORY_INTERFACE_NAME "org.mate.Terminal.Factory"
|
||||
#define TERMINAL_FACTORY_UNIX_FOLDER "gatuno-terminal"
|
||||
#define TERMINAL_FACTORY_SERVICE_NAME_PREFIX "factory"
|
||||
|
||||
int factory_fd_lock = -1;
|
||||
int factory_unix_fd = -1;
|
||||
guint factory_unix_watch = 0;
|
||||
|
||||
static char *
|
||||
ay_to_string (GVariant *variant,
|
||||
|
@ -132,18 +139,11 @@ typedef struct
|
|||
int argc;
|
||||
} OwnData;
|
||||
|
||||
static void
|
||||
method_call_cb (GDBusConnection *connection,
|
||||
const char *sender,
|
||||
const char *object_path,
|
||||
const char *interface_name,
|
||||
const char *method_name,
|
||||
GVariant *parameters,
|
||||
GDBusMethodInvocation *invocation,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (g_strcmp0 (method_name, "HandleArguments") == 0)
|
||||
{
|
||||
gboolean unix_socket_dgram_recv (GIOChannel *source, GIOCondition condition, gpointer data) {
|
||||
char *message = NULL, byte;
|
||||
int message_len;
|
||||
int s;
|
||||
|
||||
TerminalOptions *options = NULL;
|
||||
GVariant *v_wd, *v_display, *v_sid, *v_envv, *v_argv;
|
||||
char *working_directory = NULL, *display_name = NULL, *startup_id = NULL;
|
||||
|
@ -151,6 +151,26 @@ method_call_cb (GDBusConnection *connection,
|
|||
char **envv = NULL, **argv = NULL;
|
||||
int argc;
|
||||
GError *error = NULL;
|
||||
GVariant *parameters;
|
||||
|
||||
s = g_io_channel_unix_get_fd (source);
|
||||
|
||||
message_len = recvfrom (s, &byte, 1, MSG_TRUNC | MSG_PEEK, NULL, NULL);
|
||||
|
||||
message = g_malloc (message_len);
|
||||
|
||||
if (message == NULL) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
message_len = recvfrom (s, message, message_len, 0, NULL, NULL);
|
||||
if (message_len < 0) {
|
||||
g_free (message);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
parameters = g_variant_new_from_data (G_VARIANT_TYPE ("(ayayayayiay)"), message, message_len, FALSE, NULL, NULL);
|
||||
|
||||
g_variant_get (parameters, "(@ay@ay@ay@ayi@ay)",
|
||||
&v_wd, &v_display, &v_sid, &v_envv, &initial_workspace, &v_argv);
|
||||
|
@ -185,14 +205,12 @@ method_call_cb (GDBusConnection *connection,
|
|||
&error,
|
||||
NULL);
|
||||
|
||||
if (options != NULL)
|
||||
{
|
||||
if (options != NULL) {
|
||||
options->initial_workspace = initial_workspace;
|
||||
|
||||
terminal_app_handle_options (terminal_app_get (), options, FALSE /* no resume */, &error);
|
||||
terminal_options_free (options);
|
||||
}
|
||||
|
||||
out:
|
||||
g_variant_unref (v_wd);
|
||||
g_free (working_directory);
|
||||
|
@ -205,108 +223,17 @@ out:
|
|||
g_variant_unref (v_argv);
|
||||
g_strfreev (argv);
|
||||
|
||||
if (error == NULL)
|
||||
{
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_dbus_method_invocation_return_gerror (invocation, error);
|
||||
if (error != NULL) {
|
||||
g_error_free (error);
|
||||
}
|
||||
}
|
||||
|
||||
g_free (message);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
bus_acquired_cb (GDBusConnection *connection,
|
||||
const char *name,
|
||||
gpointer user_data)
|
||||
|
||||
static void send_ask_open (const char *name, OwnData *data)
|
||||
{
|
||||
static const char dbus_introspection_xml[] =
|
||||
"<node name='/org/mate/Terminal'>"
|
||||
"<interface name='org.mate.Terminal.Factory'>"
|
||||
"<method name='HandleArguments'>"
|
||||
"<arg type='ay' name='working_directory' direction='in' />"
|
||||
"<arg type='ay' name='display_name' direction='in' />"
|
||||
"<arg type='ay' name='startup_id' direction='in' />"
|
||||
"<arg type='ay' name='environment' direction='in' />"
|
||||
"<arg type='i' name='workspace' direction='in' />"
|
||||
"<arg type='ay' name='arguments' direction='in' />"
|
||||
"</method>"
|
||||
"</interface>"
|
||||
"</node>";
|
||||
|
||||
static const GDBusInterfaceVTable interface_vtable =
|
||||
{
|
||||
method_call_cb,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
OwnData *data = (OwnData *) user_data;
|
||||
GDBusNodeInfo *introspection_data;
|
||||
guint registration_id;
|
||||
GError *error = NULL;
|
||||
|
||||
_terminal_debug_print (TERMINAL_DEBUG_FACTORY,
|
||||
"Bus %s acquired\n", name);
|
||||
|
||||
introspection_data = g_dbus_node_info_new_for_xml (dbus_introspection_xml, NULL);
|
||||
g_assert (introspection_data != NULL);
|
||||
|
||||
registration_id = g_dbus_connection_register_object (connection,
|
||||
TERMINAL_FACTORY_SERVICE_PATH,
|
||||
introspection_data->interfaces[0],
|
||||
&interface_vtable,
|
||||
NULL, NULL,
|
||||
&error);
|
||||
g_dbus_node_info_unref (introspection_data);
|
||||
|
||||
if (registration_id == 0)
|
||||
{
|
||||
g_printerr ("Failed to register object: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
gtk_main_quit ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
name_acquired_cb (GDBusConnection *connection,
|
||||
const char *name,
|
||||
gpointer user_data)
|
||||
{
|
||||
OwnData *data = (OwnData *) user_data;
|
||||
GError *error = NULL;
|
||||
|
||||
_terminal_debug_print (TERMINAL_DEBUG_FACTORY,
|
||||
"Acquired the name %s on the session bus\n", name);
|
||||
|
||||
if (data->options == NULL)
|
||||
{
|
||||
/* Name re-acquired!? */
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
|
||||
if (!terminal_app_handle_options (terminal_app_get (), data->options, TRUE /* do resume */, &error))
|
||||
{
|
||||
g_printerr ("Failed to handle options: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
terminal_options_free (data->options);
|
||||
data->options = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
name_lost_cb (GDBusConnection *connection,
|
||||
const char *name,
|
||||
gpointer user_data)
|
||||
{
|
||||
OwnData *data = (OwnData *) user_data;
|
||||
GError *error = NULL;
|
||||
char **envv;
|
||||
int i;
|
||||
|
@ -315,23 +242,22 @@ name_lost_cb (GDBusConnection *connection,
|
|||
GString *string;
|
||||
char *s;
|
||||
gsize len;
|
||||
struct sockaddr_un unix_dest;
|
||||
int fd_u, ret;
|
||||
|
||||
_terminal_debug_print (TERMINAL_DEBUG_FACTORY,
|
||||
"Lost the name %s on the session bus\n", name);
|
||||
|
||||
/* Couldn't get the connection? No way to continue! */
|
||||
if (connection == NULL)
|
||||
{
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
gtk_main_quit ();
|
||||
return;
|
||||
}
|
||||
"Sending message to %s on the unix socket\n", name);
|
||||
|
||||
if (data->options == NULL)
|
||||
{
|
||||
/* Already handled */
|
||||
data->exit_code = EXIT_SUCCESS;
|
||||
gtk_main_quit ();
|
||||
return;
|
||||
}
|
||||
fd_u = socket (AF_UNIX, SOCK_DGRAM, 0);
|
||||
|
||||
if (fd_u < 0) {
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -376,7 +302,21 @@ name_lost_cb (GDBusConnection *connection,
|
|||
g_variant_builder_add (&builder, "@ay",
|
||||
g_variant_new_from_data (G_VARIANT_TYPE ("ay"), s, len, TRUE, g_free, s));
|
||||
|
||||
value = g_dbus_connection_call_sync (connection,
|
||||
GVariant *todo;
|
||||
todo = g_variant_builder_end (&builder);
|
||||
|
||||
unix_dest.sun_family = AF_UNIX;
|
||||
g_snprintf (unix_dest.sun_path, sizeof (unix_dest.sun_path), "%s%s%s%s%s", g_get_user_runtime_dir (), G_DIR_SEPARATOR_S, TERMINAL_FACTORY_UNIX_FOLDER, G_DIR_SEPARATOR_S, name);
|
||||
|
||||
g_free (subcadena);
|
||||
ret = sendto (fd_u, g_variant_get_data (todo), g_variant_get_size (todo), 0, (struct sockaddr *) &unix_dest, sizeof (unix_dest));
|
||||
if (ret < 0) {
|
||||
g_printerr ("Failed to forward arguments: \n");
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
close (fd_u);
|
||||
/*value = g_dbus_connection_call_sync (connection,
|
||||
data->factory_name,
|
||||
TERMINAL_FACTORY_SERVICE_PATH,
|
||||
TERMINAL_FACTORY_INTERFACE_NAME,
|
||||
|
@ -386,29 +326,17 @@ name_lost_cb (GDBusConnection *connection,
|
|||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
NULL,
|
||||
&error);
|
||||
if (value == NULL)
|
||||
{
|
||||
g_printerr ("Failed to forward arguments: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
gtk_main_quit ();
|
||||
}
|
||||
else
|
||||
{
|
||||
g_variant_unref (value);
|
||||
&error);*/
|
||||
g_variant_unref (todo);
|
||||
data->exit_code = EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
terminal_options_free (data->options);
|
||||
data->options = NULL;
|
||||
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
/* Settings storage works as follows:
|
||||
* /apps/mate-terminal/global/
|
||||
* /apps/mate-terminal/profiles/Foo/
|
||||
* ~/.config/gatuno-terminal/config
|
||||
* ~/.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
|
||||
|
@ -484,8 +412,11 @@ get_factory_name_for_display (const char *display_name)
|
|||
{
|
||||
GString *name;
|
||||
const char *p;
|
||||
int len;
|
||||
|
||||
name = g_string_sized_new (strlen (TERMINAL_FACTORY_SERVICE_NAME_PREFIX) + strlen (display_name) + 1 /* NUL */);
|
||||
len = strlen (TERMINAL_FACTORY_SERVICE_NAME_PREFIX) + strlen (display_name) + 10 /* NUL */;
|
||||
|
||||
name = g_string_sized_new (len);
|
||||
g_string_append (name, TERMINAL_FACTORY_SERVICE_NAME_PREFIX);
|
||||
|
||||
for (p = display_name; *p; ++p)
|
||||
|
@ -502,6 +433,83 @@ get_factory_name_for_display (const char *display_name)
|
|||
return g_string_free (name, FALSE);
|
||||
}
|
||||
|
||||
void create_factory_unix_socket_folder (void) {
|
||||
char path[8192];
|
||||
|
||||
g_snprintf (path, sizeof (path), "%s%s%s", g_get_user_runtime_dir (), G_DIR_SEPARATOR_S, TERMINAL_FACTORY_UNIX_FOLDER);
|
||||
|
||||
/* Crear el directorio de los sockets unix */
|
||||
g_mkdir_with_parents (path, 0700);
|
||||
}
|
||||
|
||||
int get_lock_factory (char *factory_name) {
|
||||
char path[8192];
|
||||
struct flock fl;
|
||||
int fd;
|
||||
|
||||
g_snprintf (path, sizeof (path), "%s%s%s%s%s.lock", g_get_user_runtime_dir (), G_DIR_SEPARATOR_S, TERMINAL_FACTORY_UNIX_FOLDER, G_DIR_SEPARATOR_S, factory_name);
|
||||
|
||||
fd = open (path, O_RDWR | O_CREAT, 0600);
|
||||
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 0;
|
||||
fl.l_type = F_WRLCK;
|
||||
fl.l_whence = SEEK_SET;
|
||||
if (fcntl(fd, F_SETLK, &fl) < 0) {
|
||||
//fputs("Another instance of this program is running.\n", stderr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
factory_fd_lock = fd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void release_lock_factory (void) {
|
||||
if (factory_fd_lock != -1) {
|
||||
close (factory_fd_lock);
|
||||
factory_fd_lock = -1;
|
||||
}
|
||||
}
|
||||
|
||||
int do_bind_factory_unix_socket (char *factory_name) {
|
||||
int s, ret;
|
||||
struct sockaddr_un name;
|
||||
|
||||
s = socket (AF_UNIX, SOCK_DGRAM, 0);
|
||||
|
||||
if (s < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
name.sun_family = AF_UNIX;
|
||||
g_snprintf (name.sun_path, sizeof (name.sun_path), "%s%s%s%s%s", g_get_user_runtime_dir (), G_DIR_SEPARATOR_S, TERMINAL_FACTORY_UNIX_FOLDER, G_DIR_SEPARATOR_S, factory_name);
|
||||
|
||||
unlink (name.sun_path);
|
||||
|
||||
ret = bind (s, (struct sockaddr *) &name, sizeof (name));
|
||||
if (ret < 0) {
|
||||
close (s);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void release_factory_unix_socket (char *factory_name) {
|
||||
struct sockaddr_un name;
|
||||
if (factory_unix_fd != -1) {
|
||||
g_source_remove (factory_unix_watch);
|
||||
factory_unix_watch = 0;
|
||||
|
||||
close (factory_unix_fd);
|
||||
factory_unix_fd = -1;
|
||||
|
||||
g_snprintf (name.sun_path, sizeof (name.sun_path), "%s%s%s%s%s", g_get_user_runtime_dir (), G_DIR_SEPARATOR_S, TERMINAL_FACTORY_UNIX_FOLDER, G_DIR_SEPARATOR_S, factory_name);
|
||||
unlink (name.sun_path);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
get_initial_workspace (void)
|
||||
{
|
||||
|
@ -575,7 +583,6 @@ main (int argc, char **argv)
|
|||
&argc, &argv,
|
||||
&error,
|
||||
gtk_get_option_group (TRUE),
|
||||
egg_sm_client_get_option_group (),
|
||||
NULL);
|
||||
|
||||
g_free (working_directory);
|
||||
|
@ -614,29 +621,65 @@ main (int argc, char **argv)
|
|||
{
|
||||
OwnData *data;
|
||||
guint owner_id;
|
||||
|
||||
GError * error = NULL;
|
||||
data = g_new (OwnData, 1);
|
||||
data->factory_name = get_factory_name_for_display (display_name);
|
||||
data->options = options;
|
||||
data->exit_code = -1;
|
||||
data->argv = argv_copy;
|
||||
data->argc = argc_copy;
|
||||
GIOChannel *io_channel;
|
||||
|
||||
gtk_init(&argc, &argv);
|
||||
options->initial_workspace = get_initial_workspace ();
|
||||
|
||||
owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
|
||||
data->factory_name,
|
||||
G_BUS_NAME_OWNER_FLAGS_NONE,
|
||||
bus_acquired_cb,
|
||||
name_acquired_cb,
|
||||
name_lost_cb,
|
||||
data, NULL);
|
||||
/* El proceso del factory funciona así:
|
||||
* Si me pidieron usar el factory, intentar conseguir el candado.
|
||||
* Si obtenemos el candado, poner el socket a la escucha.
|
||||
* Si obtenemos el socket a la escucha, somos el factory. Lanzar terminal
|
||||
* Si no consigo el socket a la escucha, error. Lanzar terminal como si no hubiera factory.
|
||||
* Si no obtengo el candado, enviar mensaje a la otra terminal.
|
||||
*/
|
||||
create_factory_unix_socket_folder ();
|
||||
|
||||
if (get_lock_factory (data->factory_name) == 0) {
|
||||
factory_unix_fd = do_bind_factory_unix_socket (data->factory_name);
|
||||
|
||||
if (factory_unix_fd >= 0) {
|
||||
/* Soy la factory */
|
||||
_terminal_debug_print (TERMINAL_DEBUG_FACTORY, "Acquired the name %s on the unix socket\n", data->factory_name);
|
||||
/* Instalar un vigilador del socket unix */
|
||||
io_channel = g_io_channel_unix_new (factory_unix_fd);
|
||||
|
||||
factory_unix_watch = g_io_add_watch (io_channel, G_IO_IN, unix_socket_dgram_recv, NULL);
|
||||
} else {
|
||||
/* ¿Tengo lock pero no pude conseguir el socket unix? Raro, soltar el lock, puesto que no puedo recibir las peticiones del factory */
|
||||
release_lock_factory ();
|
||||
|
||||
/* Correr la terminal de a solas */
|
||||
}
|
||||
|
||||
/* Correr la terminal */
|
||||
if (!terminal_app_handle_options (terminal_app_get (), data->options, TRUE /* do resume */, &error))
|
||||
{
|
||||
g_printerr ("Failed to handle options: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
data->exit_code = EXIT_FAILURE;
|
||||
} else {
|
||||
terminal_options_free (data->options);
|
||||
data->options = NULL;
|
||||
|
||||
gtk_main ();
|
||||
}
|
||||
|
||||
release_factory_unix_socket (data->factory_name);
|
||||
release_lock_factory ();
|
||||
} else {
|
||||
/* Ya hay otra factory corriendo, enviar el mensaje */
|
||||
send_ask_open (data->factory_name, data);
|
||||
}
|
||||
|
||||
ret = data->exit_code;
|
||||
g_bus_unown_name (owner_id);
|
||||
|
||||
g_free (data->factory_name);
|
||||
g_free (data);
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This file is part of MATE Terminal.
|
||||
This file is part of Gatuno Terminal.
|
||||
|
||||
MATE Terminal is free software: you can redistribute it and/or modify
|
||||
Gatuno Terminal 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.
|
||||
|
||||
MATE Terminal is distributed in the hope that it will be useful,
|
||||
Gatuno Terminal 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 MATE Terminal. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with Gatuno Terminal. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<gresources>
|
||||
<gresource prefix="/org/mate/terminal/ui">
|
||||
<gresource prefix="/org/gatuno/terminal/ui">
|
||||
<file compressed="true" preprocess="xml-stripblanks">encodings-dialog.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">find-dialog.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">keybinding-editor.ui</file>
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#!/usr/bin/perl
|
||||
=pod
|
||||
|
||||
update-authors.pl is part of MATE Terminal.
|
||||
update-authors.pl is part of Gatuno Terminal.
|
||||
|
||||
MATE Terminal is free software: you can redistribute it and/or modify
|
||||
Gatuno Terminal 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.
|
||||
|
||||
MATE Terminal is distributed in the hope that it will be useful,
|
||||
Gatuno Terminal 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 MATE Terminal. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with Gatuno Terminal. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
=cut
|
||||
use strict;
|
||||
|
|
Loading…
Reference in New Issue