1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567 |
- Description: Port to GSettings.
- Debian-Bug: https://bugs.debian.org/886055
- Author: Yavor Doganov <[email protected]>
- Forwarded: no
- Last-Update: 2018-10-23
- ---
- --- debian-mssh.orig/Makefile.am
- +++ debian-mssh/Makefile.am
- @@ -2,15 +2,12 @@
-
- EXTRA_DIST = config.rpath mkinstalldirs m4/Makefile.in mssh.schemas mssh_clusters.conf
-
- -SCHEMAS_FILE = mssh.schemas
- +data_convertdir = $(datadir)/GConf/gsettings
- +dist_data_convert_DATA = mssh.convert
-
- -schemadir = $(GCONF_SCHEMA_FILE_DIR)
- -schema_DATA = $(SCHEMAS_FILE)
- -
- -if GCONF_SCHEMAS_INSTALL
- -install-data-local:
- - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/$(schema_DATA)
- -endif
- +gsettings_SCHEMAS = es.hgarcia.mssh.gschema.xml
- +EXTRA_DIST += $(gsettings_SCHEMAS)
- +@GSETTINGS_RULES@
-
- man1_MANS = mssh.1
-
- --- debian-mssh.orig/configure.ac
- +++ debian-mssh/configure.ac
- @@ -6,7 +6,7 @@
- AC_SUBST(GETTEXT_PACKAGE)
- AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
- [The prefix for our gettext translation domains.])
- -IT_PROG_INTLTOOL(0.26)
- +IT_PROG_INTLTOOL([0.50.1])
-
- #AM_GNU_GETTEXT([external])
-
- @@ -16,17 +16,11 @@
-
- AC_PROG_CC
-
- -PKG_CHECK_MODULES(MSSH, [gtk+-3.0 vte-2.91 gconf-2.0])
- +PKG_CHECK_MODULES(MSSH, [gtk+-3.0 vte-2.91])
- AC_SUBST(MSSH_CFLAGS)
- AC_SUBST(MSSH_LIBS)
-
- -AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
- -
- -if test x"$GCONFTOOL" = xno; then
- - AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
- -fi
- -
- -AM_GCONF_SOURCE_2
- +GLIB_GSETTINGS
-
- AC_OUTPUT( po/Makefile.in
- Makefile
- --- /dev/null
- +++ debian-mssh/es.hgarcia.mssh.gschema.xml
- @@ -0,0 +1,74 @@
- +<schemalist gettext-domain="mssh">
- + <schema id="es.hgarcia.mssh" path="/es/hgarcia/mssh/">
- + <key name="font" type="s">
- + <default>'Monospace 10'</default>
- + <summary>Terminal font</summary>
- + <description>Font to use for all MSSH terminals</description>
- + </key>
- + <key name="fg-colour" type="s">
- + <default>'#ffffffffffff'</default>
- + <summary>Terminal foreground colour</summary>
- + <description>Foreground colour to use for all MSSH terminals</description>
- + </key>
- + <key name="bg-colour" type="s">
- + <default>'#000000000000'</default>
- + <summary>Terminal background colour</summary>
- + <description>Background colour to use for all MSSH terminals</description>
- + </key>
- + <key name="recolor-focused" type="b">
- + <default>true</default>
- + <summary>Recolor focused window</summary>
- + <description>Use different Back- and Foreground color for focused window</description>
- + </key>
- + <key name="fg-colour-focus" type="s">
- + <default>'#ffffffffffff'</default>
- + <summary>Terminal foreground colour for the focused window</summary>
- + <description>Foreground colour to use for the currently focused MSSH terminal</description>
- + </key>
- + <key name="bg-colour-focus" type="s">
- + <default>'#000000000000'</default>
- + <summary>Terminal background colour for the focused window</summary>
- + <description>Background colour to use for the currently focused MSSH terminal</description>
- + </key>
- + <key name="columns" type="i">
- + <default>2</default>
- + <summary>Terminal columns</summary>
- + <description>Number of columns of tiled terminals</description>
- + </key>
- + <key name="timeout" type="i">
- + <default>2</default>
- + <summary>Terminal close timeout</summary>
- + <description>Timeout after which to close ended sessions</description>
- + </key>
- + <key name="close-ended" type="b">
- + <default>true</default>
- + <summary>Close ended sessions</summary>
- + <description>Close ended ssh sessions</description>
- + </key>
- + <key name="quit-all-ended" type="b">
- + <default>false</default>
- + <summary>Quit after all sessions ended</summary>
- + <description>Quit MSSH when all ssh sessions have ended</description>
- + </key>
- + <key name="dir-focus" type="b">
- + <default>true</default>
- + <summary>Use directional focus</summary>
- + <description>Uses directional focus rather than linear focus</description>
- + </key>
- + <key name="use-pattern-expansion" type="b">
- + <default>true</default>
- + <summary>Allow expansion of curly braces when adding new sessions</summary>
- + <description>Use curly bracket expansion when adding new sessions</description>
- + </key>
- + <key name="modifier" type="i">
- + <default>8</default>
- + <summary>Shortcut modifier</summary>
- + <description>Modifier used in focus shortcuts</description>
- + </key>
- + <key name="backscroll-buffer-size" type="i">
- + <default>5000</default>
- + <summary>Backscroll buffer size</summary>
- + <description>Number of lines to keep for every window as a backscroll buffer. Set to -1 to make it infinite</description>
- + </key>
- + </schema>
- +</schemalist>
- --- /dev/null
- +++ debian-mssh/mssh.convert
- @@ -0,0 +1,15 @@
- +[es.hgarcia.mssh]
- +font = /apps/mssh/font
- +fg-colour = /apps/mssh/fg_colour
- +bg-colour = /apps/mssh/bg_colour
- +recolor-focused = /apps/mssh/recolor_focused
- +fg-colour-focus = /apps/mssh/fg_colour_focus
- +bg-colour-focus = /apps/mssh/bg_colour_focus
- +columns = /apps/mssh/columns
- +timeout = /apps/mssh/timeout
- +close-ended = /apps/mssh/close_ended
- +quit-all-ended = /apps/mssh/quit_all_ended
- +dir-focus = /apps/mssh/dir_focus
- +use-pattern-expansion = /apps/mssh/use_pattern_expansion
- +modifier = /apps/mssh/modifier
- +backscroll-buffer-size = /apps/mssh/backscroll_buffer_size
- --- debian-mssh.orig/mssh.schemas
- +++ /dev/null
- @@ -1,158 +0,0 @@
- -<gconfschemafile>
- - <schemalist>
- - <schema>
- - <key>/schemas/apps/mssh/font</key>
- - <applyto>/apps/mssh/font</applyto>
- - <owner>mssh</owner>
- - <type>string</type>
- - <default>Monospace 10</default>
- - <locale name="C">
- - <short>Terminal font</short>
- - <long>Font to use for all MSSH terminals</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/fg_colour</key>
- - <applyto>/apps/mssh/fg_colour</applyto>
- - <owner>mssh</owner>
- - <type>string</type>
- - <default>#ffffffffffff</default>
- - <locale name="C">
- - <short>Terminal foreground colour</short>
- - <long>Foreground colour to use for all MSSH terminals</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/bg_colour</key>
- - <applyto>/apps/mssh/bg_colour</applyto>
- - <owner>mssh</owner>
- - <type>string</type>
- - <default>#000000000000</default>
- - <locale name="C">
- - <short>Terminal background colour</short>
- - <long>Background colour to use for all MSSH terminals</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/recolor_focused</key>
- - <applyto>/apps/mssh/recolor_focused</applyto>
- - <owner>mssh</owner>
- - <type>bool</type>
- - <default>true</default>
- - <locale name="C">
- - <short>Recolor focused window</short>
- - <long>Use different Back- and Foreground color for focused window</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/fg_colour_focus</key>
- - <applyto>/apps/mssh/fg_colour_focus</applyto>
- - <owner>mssh</owner>
- - <type>string</type>
- - <default>#ffffffffffff</default>
- - <locale name="C">
- - <short>Terminal foreground colour for the focused window</short>
- - <long>Foreground colour to use for the currently focused MSSH terminal</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/bg_colour_focus</key>
- - <applyto>/apps/mssh/bg_colour_focus</applyto>
- - <owner>mssh</owner>
- - <type>string</type>
- - <default>#000000000000</default>
- - <locale name="C">
- - <short>Terminal background colour for the focused window</short>
- - <long>Background colour to use for the currently focused MSSH terminal</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/coloums</key>
- - <applyto>/apps/mssh/columns</applyto>
- - <owner>mssh</owner>
- - <type>int</type>
- - <default>2</default>
- - <locale name="C">
- - <short>Terminal columns</short>
- - <long>Number of columns of tiled terminals</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/timeout</key>
- - <applyto>/apps/mssh/timeout</applyto>
- - <owner>mssh</owner>
- - <type>int</type>
- - <default>2</default>
- - <locale name="C">
- - <short>Terminal close timeout</short>
- - <long>Timeout after which to close ended sessions</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/close_ended</key>
- - <applyto>/apps/mssh/close_ended</applyto>
- - <owner>mssh</owner>
- - <type>bool</type>
- - <default>true</default>
- - <locale name="C">
- - <short>Close ended sessions</short>
- - <long>Close ended ssh sessions</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/quit_all_ended</key>
- - <applyto>/apps/mssh/quit_all_ended</applyto>
- - <owner>mssh</owner>
- - <type>bool</type>
- - <default>false</default>
- - <locale name="C">
- - <short>Quit after all sessions ended</short>
- - <long>Quit MSSH when all ssh sessions have ended</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/dir_focus</key>
- - <applyto>/apps/mssh/dir_focus</applyto>
- - <owner>mssh</owner>
- - <type>bool</type>
- - <default>true</default>
- - <locale name="C">
- - <short>Use directional focus</short>
- - <long>Uses directional focus rather than linear focus</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/use_pattern_expansion</key>
- - <applyto>/apps/mssh/use_pattern_expansion</applyto>
- - <owner>mssh</owner>
- - <type>bool</type>
- - <default>true</default>
- - <locale name="C">
- - <short>Allow expansion of curly braces when adding new sessions</short>
- - <long>Use curly bracket expansion when adding new sessions</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/modifier</key>
- - <applyto>/apps/mssh/modifier</applyto>
- - <owner>mssh</owner>
- - <type>int</type>
- - <default>8</default>
- - <locale name="C">
- - <short>Shortcut modifier</short>
- - <long>Modifier used in focus shortcuts</long>
- - </locale>
- - </schema>
- - <schema>
- - <key>/schemas/apps/mssh/backscroll_buffer_size</key>
- - <applyto>/apps/mssh/backscroll_buffer_size</applyto>
- - <owner>mssh</owner>
- - <type>int</type>
- - <default>5000</default>
- - <locale name="C">
- - <short>Backscroll buffer size</short>
- - <long>Number of lines to keep for every window as a backscroll buffer. Set to -1 to make it infinite</long>
- - </locale>
- - </schema>
- - </schemalist>
- -</gconfschemafile>
- --- debian-mssh.orig/src/mssh-window.c
- +++ debian-mssh/src/mssh-window.c
- @@ -2,7 +2,6 @@
- #include <stdlib.h>
- #include <stdio.h>
-
- -#include <gconf/gconf-client.h>
- #include <gdk/gdkkeysyms.h>
- #include <gtk/gtk.h>
-
- @@ -94,7 +93,7 @@
- static void mssh_window_pref(GtkWidget *widget, gpointer data)
- {
- MSSHWindow *window = MSSH_WINDOW(data);
- - GtkWidget *pref = mssh_pref_new();
- + GtkWidget *pref = mssh_pref_new(window->settings);
-
- gtk_window_set_transient_for(GTK_WINDOW(pref), GTK_WINDOW(window));
- gtk_window_set_modal(GTK_WINDOW(pref), TRUE);
- @@ -139,22 +138,16 @@
- static gboolean mssh_window_entry_focused(GtkWidget *widget,
- GtkDirectionType dir, gpointer data)
- {
- - GConfClient *client;
- - GConfEntry *entry;
- MSSHWindow *window = MSSH_WINDOW(data);
-
- gtk_window_set_title(GTK_WINDOW(window), PACKAGE_NAME" - All");
- window->last_focus = NULL;
-
- /* clear the coloring for the focused window */
- - client = gconf_client_get_default();
- -
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
- + window);
- + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
- + window);
- return FALSE;
- }
-
- @@ -163,8 +156,6 @@
- {
- MSSHWindow *window = MSSH_WINDOW(data);
- GtkWidget *focus;
- - GConfClient *client;
- - GConfEntry *entry;
-
- int i, idx = -1, len = window->terminals->len;
- int wcols = window->columns_override ? window->columns_override :
- @@ -183,16 +174,12 @@
- }
- }
-
- - client = gconf_client_get_default();
- -
- /* recolor the windows */
- if (window->recolor_focused) {
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour(window->settings,
- + MSSH_GCONF_KEY_FG_COLOUR, window);
- + mssh_gconf_notify_bg_colour(window->settings,
- + MSSH_GCONF_KEY_BG_COLOUR, window);
- }
- if(focus == window->global_entry && keyval == GDK_KEY_Down &&
- window->dir_focus)
- @@ -326,8 +313,6 @@
- char *title;
- size_t len;
-
- - GConfClient *client;
- - GConfEntry *entry;
- MSSHWindow *window = MSSH_WINDOW(data);
-
- len = strlen(PACKAGE_NAME" - ") + strlen(terminal->hostname) + 1;
- @@ -338,31 +323,26 @@
- gtk_window_set_title(GTK_WINDOW(window), title);
-
- free(title);
- - client = gconf_client_get_default();
-
- /* recolor all windows */
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
- + window);
- + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
- + window);
-
- /* recolor the focused window - if needed */
- if (window->recolor_focused && window->is_maximized == 0) {
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour_focus(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour_focus(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour_focus(window->settings,
- + MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
- + window);
- + mssh_gconf_notify_bg_colour_focus(window->settings,
- + MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
- + window);
- }
- }
-
- void mssh_window_relayout(MSSHWindow *window)
- {
- - GConfClient *client;
- - GConfEntry *entry;
- GtkWidget *focus;
- int i, len = window->terminals->len;
- int wcols = window->columns_override ? window->columns_override :
- @@ -428,19 +408,13 @@
- }
- }
-
- - client = gconf_client_get_default();
- -
- gtk_widget_show_all(GTK_WIDGET(window));
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FONT, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_font(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour(client, 0, entry, window);
- + mssh_gconf_notify_font(window->settings, MSSH_GCONF_KEY_FONT, window);
- + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
- + window);
- + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
- + window);
-
- gtk_window_set_focus(GTK_WINDOW(window), GTK_WIDGET(focus));
- }
- @@ -467,8 +441,6 @@
-
- static void mssh_window_init(MSSHWindow* window)
- {
- - GConfClient *client;
- -
- GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- GtkWidget *entry = gtk_entry_new();
-
- @@ -553,46 +525,54 @@
- gtk_window_set_default_size(GTK_WINDOW(window), 1024, 768);
- gtk_window_set_title(GTK_WINDOW(window), PACKAGE_NAME);
-
- - client = gconf_client_get_default();
- + window->settings = g_settings_new("es.hgarcia.mssh");
-
- - gconf_client_add_dir(client, MSSH_GCONF_PATH,
- - GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
- -
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_FONT,
- - mssh_gconf_notify_font, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_FG_COLOUR,
- - mssh_gconf_notify_fg_colour, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_BG_COLOUR,
- - mssh_gconf_notify_bg_colour, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
- - mssh_gconf_notify_fg_colour_focus, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
- - mssh_gconf_notify_bg_colour_focus, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_COLUMNS,
- - mssh_gconf_notify_columns, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_TIMEOUT,
- - mssh_gconf_notify_timeout, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_CLOSE_ENDED,
- - mssh_gconf_notify_close_ended, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED,
- - mssh_gconf_notify_recolor_focused, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED,
- - mssh_gconf_notify_quit_all_ended, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_DIR_FOCUS,
- - mssh_gconf_notify_dir_focus, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_MODIFIER,
- - mssh_gconf_notify_modifier, window, NULL, NULL);
- - gconf_client_notify_add(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE,
- - mssh_gconf_backscroll_buffer_size, window, NULL, NULL);
- -
- - gconf_client_notify(client, MSSH_GCONF_KEY_COLUMNS);
- - gconf_client_notify(client, MSSH_GCONF_KEY_TIMEOUT);
- - gconf_client_notify(client, MSSH_GCONF_KEY_CLOSE_ENDED);
- - gconf_client_notify(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED);
- - gconf_client_notify(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED);
- - gconf_client_notify(client, MSSH_GCONF_KEY_DIR_FOCUS);
- - gconf_client_notify(client, MSSH_GCONF_KEY_MODIFIER);
- - gconf_client_notify(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_FONT,
- + G_CALLBACK(mssh_gconf_notify_font), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_FG_COLOUR,
- + G_CALLBACK(mssh_gconf_notify_fg_colour), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_BG_COLOUR,
- + G_CALLBACK(mssh_gconf_notify_bg_colour), window);
- + g_signal_connect(window->settings,
- + "changed::"MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
- + G_CALLBACK(mssh_gconf_notify_fg_colour_focus), window);
- + g_signal_connect(window->settings,
- + "changed::"MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
- + G_CALLBACK(mssh_gconf_notify_bg_colour_focus), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_COLUMNS,
- + G_CALLBACK(mssh_gconf_notify_columns), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_TIMEOUT,
- + G_CALLBACK(mssh_gconf_notify_timeout), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_CLOSE_ENDED,
- + G_CALLBACK(mssh_gconf_notify_close_ended), window);
- + g_signal_connect(window->settings,
- + "changed::"MSSH_GCONF_KEY_RECOLOR_FOCUSED,
- + G_CALLBACK(mssh_gconf_notify_recolor_focused), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_QUIT_ALL_ENDED,
- + G_CALLBACK(mssh_gconf_notify_quit_all_ended), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_DIR_FOCUS,
- + G_CALLBACK(mssh_gconf_notify_dir_focus), window);
- + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_MODIFIER,
- + G_CALLBACK(mssh_gconf_notify_modifier), window);
- + g_signal_connect(window->settings,
- + "changed::"MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE,
- + G_CALLBACK(mssh_gconf_backscroll_buffer_size), window);
- +
- + mssh_gconf_notify_columns(window->settings, MSSH_GCONF_KEY_COLUMNS, window);
- + mssh_gconf_notify_timeout(window->settings, MSSH_GCONF_KEY_TIMEOUT, window);
- + mssh_gconf_notify_close_ended(window->settings, MSSH_GCONF_KEY_CLOSE_ENDED,
- + window);
- + mssh_gconf_notify_recolor_focused(window->settings,
- + MSSH_GCONF_KEY_RECOLOR_FOCUSED, window);
- + mssh_gconf_notify_quit_all_ended(window->settings,
- + MSSH_GCONF_KEY_QUIT_ALL_ENDED, window);
- + mssh_gconf_notify_dir_focus(window->settings, MSSH_GCONF_KEY_DIR_FOCUS,
- + window);
- + mssh_gconf_notify_modifier(window->settings, MSSH_GCONF_KEY_MODIFIER,
- + window);
- + mssh_gconf_backscroll_buffer_size(window->settings,
- + MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE,
- + window);
-
- gtk_accel_group_connect(accel, GDK_KEY_Up, window->modifier,
- GTK_ACCEL_VISIBLE, g_cclosure_new(
- @@ -667,8 +647,6 @@
- void mssh_window_relayout_for_one(MSSHWindow *window, GtkWidget *t)
- {
-
- - GConfClient *client;
- - GConfEntry *entry;
- int len = window->terminals->len;
- int wcols = window->columns_override ? window->columns_override :
- window->columns;
- @@ -692,14 +670,10 @@
- /* remove the coloring */
- if (window->recolor_focused) {
-
- - client = gconf_client_get_default();
- -
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
- + window);
- + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
- + window);
- }
-
- g_object_unref(terminal);
- @@ -731,8 +705,6 @@
- int i;
- int idx = -1;
- int len = window->terminals->len;
- - GConfClient *client;
- - GConfEntry *entry;
-
- /* get the currently focused window */
- GtkWidget *focus = gtk_window_get_focus(GTK_WINDOW(window));
- @@ -752,14 +724,10 @@
-
- /* recolor the window with the normal color */
- if (window->recolor_focused) {
- - client = gconf_client_get_default();
- -
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
- + window);
- + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
- + window);
- }
- if (idx == -1) {
- /* there's no window focused, do nothing */
- @@ -774,8 +742,6 @@
- static void mssh_window_restore_layout(GtkWidget *widget, gpointer data)
- {
-
- - GConfClient *client;
- - GConfEntry *entry;
- /* get the window */
- MSSHWindow *window = MSSH_WINDOW(data);
-
- @@ -789,14 +755,13 @@
- }
-
- /* recolor the focused window - if needed */
- - client = gconf_client_get_default();
- if (window->recolor_focused && window->is_maximized == 0) {
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_fg_colour_focus(client, 0, entry, window);
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
- - TRUE, NULL);
- - mssh_gconf_notify_bg_colour_focus(client, 0, entry, window);
- + mssh_gconf_notify_fg_colour_focus(window->settings,
- + MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
- + window);
- + mssh_gconf_notify_bg_colour_focus(window->settings,
- + MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
- + window);
- }
- }
-
- --- debian-mssh.orig/src/mssh-window.h
- +++ debian-mssh/src/mssh-window.h
- @@ -41,6 +41,7 @@
- int is_maximized;
- gboolean recolor_focused;
- GData **commands;
- + GSettings *settings;
- } MSSHWindow;
-
- typedef struct
- --- debian-mssh.orig/src/mssh-gconf.h
- +++ debian-mssh/src/mssh-gconf.h
- @@ -1,48 +1,47 @@
- #ifndef __MSSH_GCONF__
- #define __MSSH_GCONF__
-
- -#include <gconf/gconf-client.h>
- +#include <gio/gio.h>
-
- -#define MSSH_GCONF_PATH "/apps/mssh"
- -#define MSSH_GCONF_KEY_FONT MSSH_GCONF_PATH"/font"
- -#define MSSH_GCONF_KEY_FG_COLOUR MSSH_GCONF_PATH"/fg_colour"
- -#define MSSH_GCONF_KEY_BG_COLOUR MSSH_GCONF_PATH"/bg_colour"
- -#define MSSH_GCONF_KEY_FG_COLOUR_FOCUS MSSH_GCONF_PATH"/fg_colour_focus"
- -#define MSSH_GCONF_KEY_BG_COLOUR_FOCUS MSSH_GCONF_PATH"/bg_colour_focus"
- -#define MSSH_GCONF_KEY_COLUMNS MSSH_GCONF_PATH"/columns"
- -#define MSSH_GCONF_KEY_TIMEOUT MSSH_GCONF_PATH"/timeout"
- -#define MSSH_GCONF_KEY_CLOSE_ENDED MSSH_GCONF_PATH"/close_ended"
- -#define MSSH_GCONF_KEY_RECOLOR_FOCUSED MSSH_GCONF_PATH"/recolor_focused"
- -#define MSSH_GCONF_KEY_QUIT_ALL_ENDED MSSH_GCONF_PATH"/quit_all_ended"
- -#define MSSH_GCONF_KEY_MODIFIER MSSH_GCONF_PATH"/modifier"
- -#define MSSH_GCONF_KEY_DIR_FOCUS MSSH_GCONF_PATH"/dir_focus"
- -#define MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE MSSH_GCONF_PATH"/backscroll_buffer_size"
- +#define MSSH_GCONF_KEY_FONT "font"
- +#define MSSH_GCONF_KEY_FG_COLOUR "fg-colour"
- +#define MSSH_GCONF_KEY_BG_COLOUR "bg-colour"
- +#define MSSH_GCONF_KEY_FG_COLOUR_FOCUS "fg-colour-focus"
- +#define MSSH_GCONF_KEY_BG_COLOUR_FOCUS "bg-colour-focus"
- +#define MSSH_GCONF_KEY_COLUMNS "columns"
- +#define MSSH_GCONF_KEY_TIMEOUT "timeout"
- +#define MSSH_GCONF_KEY_CLOSE_ENDED "close-ended"
- +#define MSSH_GCONF_KEY_RECOLOR_FOCUSED "recolor-focused"
- +#define MSSH_GCONF_KEY_QUIT_ALL_ENDED "quit-all-ended"
- +#define MSSH_GCONF_KEY_MODIFIER "modifier"
- +#define MSSH_GCONF_KEY_DIR_FOCUS "dir-focus"
- +#define MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE "backscroll-buffer-size"
-
- -void mssh_gconf_notify_font(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_fg_colour(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_bg_colour(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_fg_colour_focus(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_bg_colour_focus(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_columns(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_timeout(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_close_ended(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_quit_all_ended(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_modifier(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_dir_focus(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_backscroll_buffer_size(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- -void mssh_gconf_notify_recolor_focused(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data);
- +void mssh_gconf_notify_font(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_fg_colour(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_bg_colour(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_fg_colour_focus(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_bg_colour_focus(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_columns(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_timeout(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_close_ended(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_quit_all_ended(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_modifier(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_dir_focus(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_backscroll_buffer_size(GSettings *settings, const gchar *key,
- + gpointer data);
- +void mssh_gconf_notify_recolor_focused(GSettings *settings, const gchar *key,
- + gpointer data);
-
- #endif
- --- debian-mssh.orig/src/mssh-pref.c
- +++ debian-mssh/src/mssh-pref.c
- @@ -1,5 +1,3 @@
- -#include <gconf/gconf-client.h>
- -
- #define GETTEXT_PACKAGE "mssh"
- #include <glib/gi18n-lib.h>
-
- @@ -7,13 +5,17 @@
-
- #include "mssh-pref.h"
-
- +GSettings *settings;
- +
- static void mssh_pref_init(MSSHPref* pref);
- static void mssh_pref_class_init(MSSHPrefClass *klass);
-
- G_DEFINE_TYPE(MSSHPref, mssh_pref, GTK_TYPE_WINDOW)
-
- -GtkWidget* mssh_pref_new(void)
- +GtkWidget* mssh_pref_new(GSettings *window_settings)
- {
- + settings = window_settings;
- +
- return g_object_new(MSSH_TYPE_PREF, NULL);
- }
-
- @@ -26,169 +28,125 @@
-
- static void mssh_pref_font_select(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- const gchar *font;
-
- - client = gconf_client_get_default();
- -
- font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER(widget));
-
- - gconf_client_set_string(client, MSSH_GCONF_KEY_FONT, font, NULL);
- + g_settings_set_string(settings, MSSH_GCONF_KEY_FONT, font);
- }
-
- static void mssh_pref_fg_colour_select(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- GdkRGBA colour;
- const gchar *colour_s;
-
- - client = gconf_client_get_default();
- -
- gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
- colour_s = gdk_rgba_to_string(&colour);
-
- - gconf_client_set_string(client, MSSH_GCONF_KEY_FG_COLOUR, colour_s,
- - NULL);
- + g_settings_set_string(settings, MSSH_GCONF_KEY_FG_COLOUR, colour_s);
- }
-
- static void mssh_pref_bg_colour_select(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- GdkRGBA colour;
- const gchar *colour_s;
-
- - client = gconf_client_get_default();
- -
- gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
- colour_s = gdk_rgba_to_string(&colour);
-
- - gconf_client_set_string(client, MSSH_GCONF_KEY_BG_COLOUR, colour_s,
- - NULL);
- + g_settings_set_string(settings, MSSH_GCONF_KEY_BG_COLOUR, colour_s);
- }
-
- static void mssh_pref_fg_colour_select_focus(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- GdkRGBA colour;
- const gchar *colour_s;
-
- - client = gconf_client_get_default();
- -
- gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
- colour_s = gdk_rgba_to_string(&colour);
-
-
- - gconf_client_set_string(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, colour_s,
- - NULL);
- + g_settings_set_string(settings, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, colour_s);
- }
-
- static void mssh_pref_bg_colour_select_focus(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- GdkRGBA colour;
- const gchar *colour_s;
-
- - client = gconf_client_get_default();
- -
- gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
- colour_s = gdk_rgba_to_string(&colour);
-
- - gconf_client_set_string(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, colour_s,
- - NULL);
- + g_settings_set_string(settings, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, colour_s);
- }
- static void mssh_pref_columns_select(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- int columns;
-
- - client = gconf_client_get_default();
- -
- columns = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
-
- - gconf_client_set_int(client, MSSH_GCONF_KEY_COLUMNS, columns, NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_COLUMNS, columns);
- }
-
- static void mssh_pref_backscroll_buffer_size_select(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- gint backscroll_buffer_size;
-
- - client = gconf_client_get_default();
- -
- backscroll_buffer_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
-
- - gconf_client_set_int(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size, NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size);
- }
- static void mssh_pref_timeout_select(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- int timeout;
-
- - client = gconf_client_get_default();
- -
- timeout = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
-
- - gconf_client_set_int(client, MSSH_GCONF_KEY_TIMEOUT, timeout, NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_TIMEOUT, timeout);
- }
-
- static void mssh_pref_close_check(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- gboolean close;
-
- - client = gconf_client_get_default();
- -
- close = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
- - gconf_client_set_bool(client, MSSH_GCONF_KEY_CLOSE_ENDED, close, NULL);
- + g_settings_set_boolean(settings, MSSH_GCONF_KEY_CLOSE_ENDED, close);
- }
-
- static void mssh_pref_recolor_focused_check(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- gboolean recolor_focused;
-
- - client = gconf_client_get_default();
- -
- recolor_focused = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
- - gconf_client_set_bool(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED, recolor_focused, NULL);
- + g_settings_set_boolean(settings, MSSH_GCONF_KEY_RECOLOR_FOCUSED, recolor_focused);
- }
- static void mssh_pref_exit_check(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- gboolean close;
-
- - client = gconf_client_get_default();
- -
- close = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
- - gconf_client_set_bool(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED, close,
- - NULL);
- + g_settings_set_boolean(settings, MSSH_GCONF_KEY_QUIT_ALL_ENDED, close);
- }
-
- static void mssh_pref_dir_focus_check(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- gboolean focus;
-
- - client = gconf_client_get_default();
- -
- focus = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
-
- - gconf_client_set_bool(client, MSSH_GCONF_KEY_DIR_FOCUS, focus, NULL);
- + g_settings_set_boolean(settings, MSSH_GCONF_KEY_DIR_FOCUS, focus);
- }
-
- static void mssh_pref_modifier_check(GtkWidget *widget, gpointer data)
- {
- - GConfClient *client;
- gboolean ctrl, alt, shift, super;
- gint val;
-
- MSSHPref * pref = MSSH_PREF(data);
-
- - client = gconf_client_get_default();
- -
- ctrl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->ctrl));
- shift = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->shift));
- alt = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->alt));
- @@ -196,14 +154,12 @@
-
- val = (shift << 0) | (ctrl << 2) | (alt << 3) | (super << 26);
-
- - gconf_client_set_int(client, MSSH_GCONF_KEY_MODIFIER, val, NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_MODIFIER, val);
- }
-
- static void mssh_pref_init(MSSHPref* pref)
- {
- - GConfClient *client;
- - GConfEntry *entry;
- - GConfValue *value;
- + GVariant *value;
- GdkRGBA colour;
- const gchar *colour_s;
-
- @@ -378,99 +334,84 @@
- g_signal_connect(G_OBJECT(mod_super_check), "toggled",
- G_CALLBACK(mssh_pref_modifier_check), pref);
-
- - client = gconf_client_get_default();
- -
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FONT, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_FONT);
- gtk_font_chooser_set_font(GTK_FONT_CHOOSER(font_select),
- - gconf_value_get_string(value));
- + g_variant_get_string(value, NULL));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_FG_COLOUR);
- + colour_s = g_variant_get_string(value, NULL);
- gdk_rgba_parse(&colour, colour_s);
- gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fg_colour_select),
- &colour);
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_BG_COLOUR);
- + colour_s = g_variant_get_string(value, NULL);
- gdk_rgba_parse(&colour, colour_s);
- gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(bg_colour_select),
- &colour);
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_FG_COLOUR_FOCUS);
- + colour_s = g_variant_get_string(value, NULL);
- gdk_rgba_parse(&colour, colour_s);
- gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fg_colour_select_focus),
- &colour);
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_BG_COLOUR_FOCUS);
- + colour_s = g_variant_get_string(value, NULL);
- gdk_rgba_parse(&colour, colour_s);
- gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(bg_colour_select_focus),
- &colour);
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_COLUMNS, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_COLUMNS);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(columns_select),
- - gconf_value_get_int(value));
- + g_variant_get_int32(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(backscroll_buffer_size_select),
- - gconf_value_get_int(value));
- + g_variant_get_int32(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_TIMEOUT, NULL,
- - TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_TIMEOUT);
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(timeout_select),
- - gconf_value_get_int(value));
- + g_variant_get_int32(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_CLOSE_ENDED,
- - NULL, TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_CLOSE_ENDED);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(close_check),
- - gconf_value_get_bool(value));
- + g_variant_get_boolean(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED,
- - NULL, TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_RECOLOR_FOCUSED);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(recolor_focused_check),
- - gconf_value_get_bool(value));
- + g_variant_get_boolean(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED,
- - NULL, TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_QUIT_ALL_ENDED);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(exit_check),
- - gconf_value_get_bool(value));
- + g_variant_get_boolean(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_DIR_FOCUS,
- - NULL, TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_DIR_FOCUS);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dir_focus_check),
- - gconf_value_get_bool(value));
- + g_variant_get_boolean(value));
- + g_variant_unref(value);
-
- - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_MODIFIER,
- - NULL, TRUE, NULL);
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_value(settings, MSSH_GCONF_KEY_MODIFIER);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_ctrl_check),
- - (gconf_value_get_int(value) & GDK_CONTROL_MASK) ? 1 : 0);
- + (g_variant_get_int32(value) & GDK_CONTROL_MASK) ? 1 : 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_shift_check),
- - (gconf_value_get_int(value) & GDK_SHIFT_MASK) ? 1 : 0);
- + (g_variant_get_int32(value) & GDK_SHIFT_MASK) ? 1 : 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_alt_check),
- - (gconf_value_get_int(value) & GDK_MOD1_MASK) ? 1 : 0);
- + (g_variant_get_int32(value) & GDK_MOD1_MASK) ? 1 : 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_super_check),
- - (gconf_value_get_int(value) & GDK_SUPER_MASK) ? 1 : 0);
- + (g_variant_get_int32(value) & GDK_SUPER_MASK) ? 1 : 0);
- + g_variant_unref(value);
- }
-
- static void mssh_pref_class_init(MSSHPrefClass *klass)
- --- debian-mssh.orig/src/mssh-pref.h
- +++ debian-mssh/src/mssh-pref.h
- @@ -31,7 +31,7 @@
-
- GType mssh_pref_get_type(void) G_GNUC_CONST;
-
- -GtkWidget* mssh_pref_new(void);
- +GtkWidget* mssh_pref_new(GSettings *settings);
-
- G_END_DECLS
-
- --- debian-mssh.orig/src/mssh-gconf.c
- +++ debian-mssh/src/mssh-gconf.c
- @@ -5,39 +5,38 @@
- #include "mssh-window.h"
- #include "mssh-terminal.h"
-
- -void mssh_gconf_notify_font(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_font(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- PangoFontDescription *font_desc;
- - GConfValue *value;
- + gchar *value;
- int i;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- + value = g_settings_get_string(settings, key);
-
- - font_desc = pango_font_description_from_string(gconf_value_get_string(value));
- + font_desc = pango_font_description_from_string(value);
- for(i = 0; i < window->terminals->len; i++)
- {
- vte_terminal_set_font(VTE_TERMINAL(g_array_index(
- window->terminals, MSSHTerminal*, i)), font_desc);
- }
-
- + g_free(value);
- pango_font_description_free(font_desc);
- }
-
- -void mssh_gconf_notify_fg_colour(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_fg_colour(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- - const gchar *colour_s;
- + gchar *colour_s;
- GdkRGBA colour;
- int i;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + colour_s = g_settings_get_string(settings, key);
- gdk_rgba_parse(&colour, colour_s);
-
- for(i = 0; i < window->terminals->len; i++)
- @@ -45,20 +44,20 @@
- vte_terminal_set_color_foreground(VTE_TERMINAL(g_array_index(
- window->terminals, MSSHTerminal*, i)), &colour);
- }
- +
- + g_free (colour_s);
- }
-
- -void mssh_gconf_notify_bg_colour(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_bg_colour(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- - const gchar *colour_s;
- + gchar *colour_s;
- GdkRGBA colour;
- int i;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + colour_s = g_settings_get_string(settings, key);
- gdk_rgba_parse(&colour, colour_s);
-
- for(i = 0; i < window->terminals->len; i++)
- @@ -66,13 +65,14 @@
- vte_terminal_set_color_background(VTE_TERMINAL(g_array_index(
- window->terminals, MSSHTerminal*, i)), &colour);
- }
- +
- + g_free(colour_s);
- }
-
- -void mssh_gconf_notify_fg_colour_focus(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_fg_colour_focus(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- - const gchar *colour_s;
- + gchar *colour_s;
- GdkRGBA colour;
- int i;
- int idx = -1;
- @@ -80,8 +80,7 @@
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + colour_s = g_settings_get_string(settings, key);
- gdk_rgba_parse(&colour, colour_s);
-
- /* get the currently focused window */
- @@ -103,13 +102,14 @@
- vte_terminal_set_color_foreground(VTE_TERMINAL(g_array_index(
- window->terminals, MSSHTerminal*, idx)), &colour);
- }
- +
- + g_free(colour_s);
- }
-
- -void mssh_gconf_notify_bg_colour_focus(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_bg_colour_focus(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- - const gchar *colour_s;
- + gchar *colour_s;
- GdkRGBA colour;
- int i;
- int idx = -1;
- @@ -117,8 +117,7 @@
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - colour_s = gconf_value_get_string(value);
- + colour_s = g_settings_get_string(settings, key);
- gdk_rgba_parse(&colour, colour_s);
-
- /* get the currently focused window */
- @@ -141,62 +140,55 @@
- window->terminals, MSSHTerminal*, idx)), &colour);
- }
-
- + g_free(colour_s);
- }
- -void mssh_gconf_notify_columns(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_columns(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- int columns;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - columns = gconf_value_get_int(value);
- + columns = g_settings_get_int(settings, key);
-
- if(columns <= 0)
- {
- columns = 1;
- - gconf_client_set_int(client, MSSH_GCONF_KEY_COLUMNS, columns,
- - NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_COLUMNS, columns);
- }
-
- window->columns = columns;
- mssh_window_relayout(window);
- }
-
- -void mssh_gconf_notify_timeout(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_timeout(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- int timeout;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - timeout = gconf_value_get_int(value);
- + timeout = g_settings_get_int(settings, key);
-
- if(timeout < 0)
- {
- timeout = 0;
- - gconf_client_set_int(client, MSSH_GCONF_KEY_TIMEOUT, timeout,
- - NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_TIMEOUT, timeout);
- }
-
- window->timeout = timeout;
- mssh_window_relayout(window);
- }
-
- -void mssh_gconf_notify_close_ended(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_close_ended(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- gboolean close_ended;
- int i;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - close_ended = gconf_value_get_bool(value);
- + close_ended = g_settings_get_boolean(settings, key);
-
- window->close_ended_sessions = close_ended;
-
- @@ -215,54 +207,40 @@
- }
- }
-
- -void mssh_gconf_notify_recolor_focused(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_recolor_focused(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- gboolean recolor_focused;
-
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- - recolor_focused = gconf_value_get_bool(value);
- + recolor_focused = g_settings_get_boolean(settings, key);
-
- window->recolor_focused = recolor_focused;
-
- }
-
- -void mssh_gconf_notify_quit_all_ended(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_quit_all_ended(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- -
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- -
- - window->exit_on_all_closed = gconf_value_get_bool(value);
- + window->exit_on_all_closed = g_settings_get_boolean(settings, key);
- }
-
- -void mssh_gconf_notify_dir_focus(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_dir_focus(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- -
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- -
- - window->dir_focus = gconf_value_get_bool(value);
- + window->dir_focus = g_settings_get_boolean(settings, key);
- }
-
- -void mssh_gconf_notify_modifier(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_notify_modifier(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- -
- MSSHWindow *window = MSSH_WINDOW(data);
-
- - value = gconf_entry_get_value(entry);
- -
- if(window->accel)
- {
- gtk_accel_group_disconnect_key(window->accel, GDK_KEY_Up,
- @@ -275,7 +253,7 @@
- window->modifier);
- }
-
- - window->modifier = gconf_value_get_int(value);
- + window->modifier = g_settings_get_int(settings, key);
-
- if(window->accel)
- {
- @@ -295,10 +273,9 @@
- }
-
-
- -void mssh_gconf_backscroll_buffer_size(GConfClient *client, guint cnxn_id,
- - GConfEntry *entry, gpointer data)
- +void mssh_gconf_backscroll_buffer_size(GSettings *settings, const gchar *key,
- + gpointer data)
- {
- - GConfValue *value;
- gint backscroll_buffer_size;
-
- MSSHWindow *window = MSSH_WINDOW(data);
- @@ -306,15 +283,13 @@
- int i;
- int len = window->terminals->len;
-
- - value = gconf_entry_get_value(entry);
- - backscroll_buffer_size = gconf_value_get_int(value);
- + backscroll_buffer_size = g_settings_get_int(settings, key);
-
-
- if (backscroll_buffer_size < -1)
- {
- backscroll_buffer_size = 5000;
- - gconf_client_set_int(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size,
- - NULL);
- + g_settings_set_int(settings, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size);
- }
-
- window->backscroll_buffer_size = backscroll_buffer_size;
- --- debian-mssh.orig/src/mssh.c
- +++ debian-mssh/src/mssh.c
- @@ -227,6 +227,69 @@
- return commands;
- }
-
- +/* Migrate existing GConf settings. */
- +static gchar *migrate_gconf_settings(const gchar *name)
- +{
- + gboolean needed = TRUE;
- + GError *error = NULL;
- + GKeyFile *kf;
- + gchar **list;
- + gchar *msg = NULL;
- + gsize i, n;
- +
- + kf = g_key_file_new();
- +
- + if (!g_key_file_load_from_data_dirs(kf, "gsettings-data-convert",
- + NULL, G_KEY_FILE_NONE, NULL))
- + {
- + g_key_file_free(kf);
- + return NULL;
- + }
- +
- + list = g_key_file_get_string_list(kf, "State", "converted", &n, NULL);
- +
- + if (list)
- + {
- + for (i = 0; i < n; i++)
- + if (!g_strcmp0(list[i], name))
- + {
- + needed = FALSE;
- + break;
- + }
- +
- + g_strfreev(list);
- + }
- +
- + g_key_file_free(kf);
- +
- + if (needed)
- + {
- + g_spawn_command_line_sync("gsettings-data-convert",
- + NULL, NULL, NULL, &error);
- + if (error)
- + {
- + msg = g_strdup_printf(_("Could not migrate old GConf settings: %s\n"
- + "Please make sure that GConf is installed "
- + "and the gsettings-data-convert tool is in "
- + "your PATH.\nAlternatively, ignore this "
- + "message and convert your old settings "
- + "manually."), error->message);
- + g_error_free(error);
- + }
- + else
- + {
- + msg = g_strdup(_("Old GConf settings were migrated successfully."));
- +
- + /* Allow some time for the GSettings backend to record the
- + changes, otherwise the default values from the new schema
- + might be set. */
- + sleep(1);
- + }
- + }
- +
- + return msg;
- +}
- +
- int main(int argc, char* argv[], char* env[])
- {
- GtkWidget* window;
- @@ -236,6 +299,7 @@
- GData **aliases = NULL;
- GData **commands = NULL;
- GArray *hosts = NULL;
- + gchar *gconf_migration_msg = NULL;
-
- static struct option long_options[] =
- {
- @@ -356,8 +420,23 @@
- bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
- textdomain(GETTEXT_PACKAGE);
-
- + gconf_migration_msg = migrate_gconf_settings("mssh.convert");
- +
- window = GTK_WIDGET(mssh_window_new());
-
- + if (gconf_migration_msg)
- + {
- + GtkWidget *dlg;
- +
- + dlg = gtk_message_dialog_new(GTK_WINDOW(window),
- + GTK_DIALOG_DESTROY_WITH_PARENT,
- + GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
- + "%s", gconf_migration_msg);
- + g_free(gconf_migration_msg);
- + gtk_dialog_run(GTK_DIALOG(dlg));
- + gtk_widget_destroy(dlg);
- + }
- +
- g_signal_connect(G_OBJECT(window), "destroy",
- G_CALLBACK(on_mssh_destroy), NULL);
-
- --- debian-mssh.orig/po/POTFILES.in
- +++ debian-mssh/po/POTFILES.in
- @@ -3,3 +3,4 @@
- ./src/mssh-pref.c
- ./src/mssh-terminal.c
- ./src/mssh-window.c
- +[type: gettext/gsettings]es.hgarcia.mssh.gschema.xml
|