gsettings-port.patch 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567
  1. Description: Port to GSettings.
  2. Debian-Bug: https://bugs.debian.org/886055
  3. Author: Yavor Doganov <[email protected]>
  4. Forwarded: no
  5. Last-Update: 2018-10-23
  6. ---
  7. --- debian-mssh.orig/Makefile.am
  8. +++ debian-mssh/Makefile.am
  9. @@ -2,15 +2,12 @@
  10. EXTRA_DIST = config.rpath mkinstalldirs m4/Makefile.in mssh.schemas mssh_clusters.conf
  11. -SCHEMAS_FILE = mssh.schemas
  12. +data_convertdir = $(datadir)/GConf/gsettings
  13. +dist_data_convert_DATA = mssh.convert
  14. -schemadir = $(GCONF_SCHEMA_FILE_DIR)
  15. -schema_DATA = $(SCHEMAS_FILE)
  16. -
  17. -if GCONF_SCHEMAS_INSTALL
  18. -install-data-local:
  19. - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/$(schema_DATA)
  20. -endif
  21. +gsettings_SCHEMAS = es.hgarcia.mssh.gschema.xml
  22. +EXTRA_DIST += $(gsettings_SCHEMAS)
  23. +@GSETTINGS_RULES@
  24. man1_MANS = mssh.1
  25. --- debian-mssh.orig/configure.ac
  26. +++ debian-mssh/configure.ac
  27. @@ -6,7 +6,7 @@
  28. AC_SUBST(GETTEXT_PACKAGE)
  29. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
  30. [The prefix for our gettext translation domains.])
  31. -IT_PROG_INTLTOOL(0.26)
  32. +IT_PROG_INTLTOOL([0.50.1])
  33. #AM_GNU_GETTEXT([external])
  34. @@ -16,17 +16,11 @@
  35. AC_PROG_CC
  36. -PKG_CHECK_MODULES(MSSH, [gtk+-3.0 vte-2.91 gconf-2.0])
  37. +PKG_CHECK_MODULES(MSSH, [gtk+-3.0 vte-2.91])
  38. AC_SUBST(MSSH_CFLAGS)
  39. AC_SUBST(MSSH_LIBS)
  40. -AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
  41. -
  42. -if test x"$GCONFTOOL" = xno; then
  43. - AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
  44. -fi
  45. -
  46. -AM_GCONF_SOURCE_2
  47. +GLIB_GSETTINGS
  48. AC_OUTPUT( po/Makefile.in
  49. Makefile
  50. --- /dev/null
  51. +++ debian-mssh/es.hgarcia.mssh.gschema.xml
  52. @@ -0,0 +1,74 @@
  53. +<schemalist gettext-domain="mssh">
  54. + <schema id="es.hgarcia.mssh" path="/es/hgarcia/mssh/">
  55. + <key name="font" type="s">
  56. + <default>'Monospace 10'</default>
  57. + <summary>Terminal font</summary>
  58. + <description>Font to use for all MSSH terminals</description>
  59. + </key>
  60. + <key name="fg-colour" type="s">
  61. + <default>'#ffffffffffff'</default>
  62. + <summary>Terminal foreground colour</summary>
  63. + <description>Foreground colour to use for all MSSH terminals</description>
  64. + </key>
  65. + <key name="bg-colour" type="s">
  66. + <default>'#000000000000'</default>
  67. + <summary>Terminal background colour</summary>
  68. + <description>Background colour to use for all MSSH terminals</description>
  69. + </key>
  70. + <key name="recolor-focused" type="b">
  71. + <default>true</default>
  72. + <summary>Recolor focused window</summary>
  73. + <description>Use different Back- and Foreground color for focused window</description>
  74. + </key>
  75. + <key name="fg-colour-focus" type="s">
  76. + <default>'#ffffffffffff'</default>
  77. + <summary>Terminal foreground colour for the focused window</summary>
  78. + <description>Foreground colour to use for the currently focused MSSH terminal</description>
  79. + </key>
  80. + <key name="bg-colour-focus" type="s">
  81. + <default>'#000000000000'</default>
  82. + <summary>Terminal background colour for the focused window</summary>
  83. + <description>Background colour to use for the currently focused MSSH terminal</description>
  84. + </key>
  85. + <key name="columns" type="i">
  86. + <default>2</default>
  87. + <summary>Terminal columns</summary>
  88. + <description>Number of columns of tiled terminals</description>
  89. + </key>
  90. + <key name="timeout" type="i">
  91. + <default>2</default>
  92. + <summary>Terminal close timeout</summary>
  93. + <description>Timeout after which to close ended sessions</description>
  94. + </key>
  95. + <key name="close-ended" type="b">
  96. + <default>true</default>
  97. + <summary>Close ended sessions</summary>
  98. + <description>Close ended ssh sessions</description>
  99. + </key>
  100. + <key name="quit-all-ended" type="b">
  101. + <default>false</default>
  102. + <summary>Quit after all sessions ended</summary>
  103. + <description>Quit MSSH when all ssh sessions have ended</description>
  104. + </key>
  105. + <key name="dir-focus" type="b">
  106. + <default>true</default>
  107. + <summary>Use directional focus</summary>
  108. + <description>Uses directional focus rather than linear focus</description>
  109. + </key>
  110. + <key name="use-pattern-expansion" type="b">
  111. + <default>true</default>
  112. + <summary>Allow expansion of curly braces when adding new sessions</summary>
  113. + <description>Use curly bracket expansion when adding new sessions</description>
  114. + </key>
  115. + <key name="modifier" type="i">
  116. + <default>8</default>
  117. + <summary>Shortcut modifier</summary>
  118. + <description>Modifier used in focus shortcuts</description>
  119. + </key>
  120. + <key name="backscroll-buffer-size" type="i">
  121. + <default>5000</default>
  122. + <summary>Backscroll buffer size</summary>
  123. + <description>Number of lines to keep for every window as a backscroll buffer. Set to -1 to make it infinite</description>
  124. + </key>
  125. + </schema>
  126. +</schemalist>
  127. --- /dev/null
  128. +++ debian-mssh/mssh.convert
  129. @@ -0,0 +1,15 @@
  130. +[es.hgarcia.mssh]
  131. +font = /apps/mssh/font
  132. +fg-colour = /apps/mssh/fg_colour
  133. +bg-colour = /apps/mssh/bg_colour
  134. +recolor-focused = /apps/mssh/recolor_focused
  135. +fg-colour-focus = /apps/mssh/fg_colour_focus
  136. +bg-colour-focus = /apps/mssh/bg_colour_focus
  137. +columns = /apps/mssh/columns
  138. +timeout = /apps/mssh/timeout
  139. +close-ended = /apps/mssh/close_ended
  140. +quit-all-ended = /apps/mssh/quit_all_ended
  141. +dir-focus = /apps/mssh/dir_focus
  142. +use-pattern-expansion = /apps/mssh/use_pattern_expansion
  143. +modifier = /apps/mssh/modifier
  144. +backscroll-buffer-size = /apps/mssh/backscroll_buffer_size
  145. --- debian-mssh.orig/mssh.schemas
  146. +++ /dev/null
  147. @@ -1,158 +0,0 @@
  148. -<gconfschemafile>
  149. - <schemalist>
  150. - <schema>
  151. - <key>/schemas/apps/mssh/font</key>
  152. - <applyto>/apps/mssh/font</applyto>
  153. - <owner>mssh</owner>
  154. - <type>string</type>
  155. - <default>Monospace 10</default>
  156. - <locale name="C">
  157. - <short>Terminal font</short>
  158. - <long>Font to use for all MSSH terminals</long>
  159. - </locale>
  160. - </schema>
  161. - <schema>
  162. - <key>/schemas/apps/mssh/fg_colour</key>
  163. - <applyto>/apps/mssh/fg_colour</applyto>
  164. - <owner>mssh</owner>
  165. - <type>string</type>
  166. - <default>#ffffffffffff</default>
  167. - <locale name="C">
  168. - <short>Terminal foreground colour</short>
  169. - <long>Foreground colour to use for all MSSH terminals</long>
  170. - </locale>
  171. - </schema>
  172. - <schema>
  173. - <key>/schemas/apps/mssh/bg_colour</key>
  174. - <applyto>/apps/mssh/bg_colour</applyto>
  175. - <owner>mssh</owner>
  176. - <type>string</type>
  177. - <default>#000000000000</default>
  178. - <locale name="C">
  179. - <short>Terminal background colour</short>
  180. - <long>Background colour to use for all MSSH terminals</long>
  181. - </locale>
  182. - </schema>
  183. - <schema>
  184. - <key>/schemas/apps/mssh/recolor_focused</key>
  185. - <applyto>/apps/mssh/recolor_focused</applyto>
  186. - <owner>mssh</owner>
  187. - <type>bool</type>
  188. - <default>true</default>
  189. - <locale name="C">
  190. - <short>Recolor focused window</short>
  191. - <long>Use different Back- and Foreground color for focused window</long>
  192. - </locale>
  193. - </schema>
  194. - <schema>
  195. - <key>/schemas/apps/mssh/fg_colour_focus</key>
  196. - <applyto>/apps/mssh/fg_colour_focus</applyto>
  197. - <owner>mssh</owner>
  198. - <type>string</type>
  199. - <default>#ffffffffffff</default>
  200. - <locale name="C">
  201. - <short>Terminal foreground colour for the focused window</short>
  202. - <long>Foreground colour to use for the currently focused MSSH terminal</long>
  203. - </locale>
  204. - </schema>
  205. - <schema>
  206. - <key>/schemas/apps/mssh/bg_colour_focus</key>
  207. - <applyto>/apps/mssh/bg_colour_focus</applyto>
  208. - <owner>mssh</owner>
  209. - <type>string</type>
  210. - <default>#000000000000</default>
  211. - <locale name="C">
  212. - <short>Terminal background colour for the focused window</short>
  213. - <long>Background colour to use for the currently focused MSSH terminal</long>
  214. - </locale>
  215. - </schema>
  216. - <schema>
  217. - <key>/schemas/apps/mssh/coloums</key>
  218. - <applyto>/apps/mssh/columns</applyto>
  219. - <owner>mssh</owner>
  220. - <type>int</type>
  221. - <default>2</default>
  222. - <locale name="C">
  223. - <short>Terminal columns</short>
  224. - <long>Number of columns of tiled terminals</long>
  225. - </locale>
  226. - </schema>
  227. - <schema>
  228. - <key>/schemas/apps/mssh/timeout</key>
  229. - <applyto>/apps/mssh/timeout</applyto>
  230. - <owner>mssh</owner>
  231. - <type>int</type>
  232. - <default>2</default>
  233. - <locale name="C">
  234. - <short>Terminal close timeout</short>
  235. - <long>Timeout after which to close ended sessions</long>
  236. - </locale>
  237. - </schema>
  238. - <schema>
  239. - <key>/schemas/apps/mssh/close_ended</key>
  240. - <applyto>/apps/mssh/close_ended</applyto>
  241. - <owner>mssh</owner>
  242. - <type>bool</type>
  243. - <default>true</default>
  244. - <locale name="C">
  245. - <short>Close ended sessions</short>
  246. - <long>Close ended ssh sessions</long>
  247. - </locale>
  248. - </schema>
  249. - <schema>
  250. - <key>/schemas/apps/mssh/quit_all_ended</key>
  251. - <applyto>/apps/mssh/quit_all_ended</applyto>
  252. - <owner>mssh</owner>
  253. - <type>bool</type>
  254. - <default>false</default>
  255. - <locale name="C">
  256. - <short>Quit after all sessions ended</short>
  257. - <long>Quit MSSH when all ssh sessions have ended</long>
  258. - </locale>
  259. - </schema>
  260. - <schema>
  261. - <key>/schemas/apps/mssh/dir_focus</key>
  262. - <applyto>/apps/mssh/dir_focus</applyto>
  263. - <owner>mssh</owner>
  264. - <type>bool</type>
  265. - <default>true</default>
  266. - <locale name="C">
  267. - <short>Use directional focus</short>
  268. - <long>Uses directional focus rather than linear focus</long>
  269. - </locale>
  270. - </schema>
  271. - <schema>
  272. - <key>/schemas/apps/mssh/use_pattern_expansion</key>
  273. - <applyto>/apps/mssh/use_pattern_expansion</applyto>
  274. - <owner>mssh</owner>
  275. - <type>bool</type>
  276. - <default>true</default>
  277. - <locale name="C">
  278. - <short>Allow expansion of curly braces when adding new sessions</short>
  279. - <long>Use curly bracket expansion when adding new sessions</long>
  280. - </locale>
  281. - </schema>
  282. - <schema>
  283. - <key>/schemas/apps/mssh/modifier</key>
  284. - <applyto>/apps/mssh/modifier</applyto>
  285. - <owner>mssh</owner>
  286. - <type>int</type>
  287. - <default>8</default>
  288. - <locale name="C">
  289. - <short>Shortcut modifier</short>
  290. - <long>Modifier used in focus shortcuts</long>
  291. - </locale>
  292. - </schema>
  293. - <schema>
  294. - <key>/schemas/apps/mssh/backscroll_buffer_size</key>
  295. - <applyto>/apps/mssh/backscroll_buffer_size</applyto>
  296. - <owner>mssh</owner>
  297. - <type>int</type>
  298. - <default>5000</default>
  299. - <locale name="C">
  300. - <short>Backscroll buffer size</short>
  301. - <long>Number of lines to keep for every window as a backscroll buffer. Set to -1 to make it infinite</long>
  302. - </locale>
  303. - </schema>
  304. - </schemalist>
  305. -</gconfschemafile>
  306. --- debian-mssh.orig/src/mssh-window.c
  307. +++ debian-mssh/src/mssh-window.c
  308. @@ -2,7 +2,6 @@
  309. #include <stdlib.h>
  310. #include <stdio.h>
  311. -#include <gconf/gconf-client.h>
  312. #include <gdk/gdkkeysyms.h>
  313. #include <gtk/gtk.h>
  314. @@ -94,7 +93,7 @@
  315. static void mssh_window_pref(GtkWidget *widget, gpointer data)
  316. {
  317. MSSHWindow *window = MSSH_WINDOW(data);
  318. - GtkWidget *pref = mssh_pref_new();
  319. + GtkWidget *pref = mssh_pref_new(window->settings);
  320. gtk_window_set_transient_for(GTK_WINDOW(pref), GTK_WINDOW(window));
  321. gtk_window_set_modal(GTK_WINDOW(pref), TRUE);
  322. @@ -139,22 +138,16 @@
  323. static gboolean mssh_window_entry_focused(GtkWidget *widget,
  324. GtkDirectionType dir, gpointer data)
  325. {
  326. - GConfClient *client;
  327. - GConfEntry *entry;
  328. MSSHWindow *window = MSSH_WINDOW(data);
  329. gtk_window_set_title(GTK_WINDOW(window), PACKAGE_NAME" - All");
  330. window->last_focus = NULL;
  331. /* clear the coloring for the focused window */
  332. - client = gconf_client_get_default();
  333. -
  334. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  335. - TRUE, NULL);
  336. - mssh_gconf_notify_fg_colour(client, 0, entry, window);
  337. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  338. - TRUE, NULL);
  339. - mssh_gconf_notify_bg_colour(client, 0, entry, window);
  340. + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
  341. + window);
  342. + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
  343. + window);
  344. return FALSE;
  345. }
  346. @@ -163,8 +156,6 @@
  347. {
  348. MSSHWindow *window = MSSH_WINDOW(data);
  349. GtkWidget *focus;
  350. - GConfClient *client;
  351. - GConfEntry *entry;
  352. int i, idx = -1, len = window->terminals->len;
  353. int wcols = window->columns_override ? window->columns_override :
  354. @@ -183,16 +174,12 @@
  355. }
  356. }
  357. - client = gconf_client_get_default();
  358. -
  359. /* recolor the windows */
  360. if (window->recolor_focused) {
  361. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  362. - TRUE, NULL);
  363. - mssh_gconf_notify_fg_colour(client, 0, entry, window);
  364. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  365. - TRUE, NULL);
  366. - mssh_gconf_notify_bg_colour(client, 0, entry, window);
  367. + mssh_gconf_notify_fg_colour(window->settings,
  368. + MSSH_GCONF_KEY_FG_COLOUR, window);
  369. + mssh_gconf_notify_bg_colour(window->settings,
  370. + MSSH_GCONF_KEY_BG_COLOUR, window);
  371. }
  372. if(focus == window->global_entry && keyval == GDK_KEY_Down &&
  373. window->dir_focus)
  374. @@ -326,8 +313,6 @@
  375. char *title;
  376. size_t len;
  377. - GConfClient *client;
  378. - GConfEntry *entry;
  379. MSSHWindow *window = MSSH_WINDOW(data);
  380. len = strlen(PACKAGE_NAME" - ") + strlen(terminal->hostname) + 1;
  381. @@ -338,31 +323,26 @@
  382. gtk_window_set_title(GTK_WINDOW(window), title);
  383. free(title);
  384. - client = gconf_client_get_default();
  385. /* recolor all windows */
  386. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  387. - TRUE, NULL);
  388. - mssh_gconf_notify_fg_colour(client, 0, entry, window);
  389. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  390. - TRUE, NULL);
  391. - mssh_gconf_notify_bg_colour(client, 0, entry, window);
  392. + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
  393. + window);
  394. + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
  395. + window);
  396. /* recolor the focused window - if needed */
  397. if (window->recolor_focused && window->is_maximized == 0) {
  398. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
  399. - TRUE, NULL);
  400. - mssh_gconf_notify_fg_colour_focus(client, 0, entry, window);
  401. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
  402. - TRUE, NULL);
  403. - mssh_gconf_notify_bg_colour_focus(client, 0, entry, window);
  404. + mssh_gconf_notify_fg_colour_focus(window->settings,
  405. + MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
  406. + window);
  407. + mssh_gconf_notify_bg_colour_focus(window->settings,
  408. + MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
  409. + window);
  410. }
  411. }
  412. void mssh_window_relayout(MSSHWindow *window)
  413. {
  414. - GConfClient *client;
  415. - GConfEntry *entry;
  416. GtkWidget *focus;
  417. int i, len = window->terminals->len;
  418. int wcols = window->columns_override ? window->columns_override :
  419. @@ -428,19 +408,13 @@
  420. }
  421. }
  422. - client = gconf_client_get_default();
  423. -
  424. gtk_widget_show_all(GTK_WIDGET(window));
  425. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FONT, NULL,
  426. - TRUE, NULL);
  427. - mssh_gconf_notify_font(client, 0, entry, window);
  428. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  429. - TRUE, NULL);
  430. - mssh_gconf_notify_fg_colour(client, 0, entry, window);
  431. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  432. - TRUE, NULL);
  433. - mssh_gconf_notify_bg_colour(client, 0, entry, window);
  434. + mssh_gconf_notify_font(window->settings, MSSH_GCONF_KEY_FONT, window);
  435. + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
  436. + window);
  437. + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
  438. + window);
  439. gtk_window_set_focus(GTK_WINDOW(window), GTK_WIDGET(focus));
  440. }
  441. @@ -467,8 +441,6 @@
  442. static void mssh_window_init(MSSHWindow* window)
  443. {
  444. - GConfClient *client;
  445. -
  446. GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
  447. GtkWidget *entry = gtk_entry_new();
  448. @@ -553,46 +525,54 @@
  449. gtk_window_set_default_size(GTK_WINDOW(window), 1024, 768);
  450. gtk_window_set_title(GTK_WINDOW(window), PACKAGE_NAME);
  451. - client = gconf_client_get_default();
  452. + window->settings = g_settings_new("es.hgarcia.mssh");
  453. - gconf_client_add_dir(client, MSSH_GCONF_PATH,
  454. - GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
  455. -
  456. - gconf_client_notify_add(client, MSSH_GCONF_KEY_FONT,
  457. - mssh_gconf_notify_font, window, NULL, NULL);
  458. - gconf_client_notify_add(client, MSSH_GCONF_KEY_FG_COLOUR,
  459. - mssh_gconf_notify_fg_colour, window, NULL, NULL);
  460. - gconf_client_notify_add(client, MSSH_GCONF_KEY_BG_COLOUR,
  461. - mssh_gconf_notify_bg_colour, window, NULL, NULL);
  462. - gconf_client_notify_add(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
  463. - mssh_gconf_notify_fg_colour_focus, window, NULL, NULL);
  464. - gconf_client_notify_add(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
  465. - mssh_gconf_notify_bg_colour_focus, window, NULL, NULL);
  466. - gconf_client_notify_add(client, MSSH_GCONF_KEY_COLUMNS,
  467. - mssh_gconf_notify_columns, window, NULL, NULL);
  468. - gconf_client_notify_add(client, MSSH_GCONF_KEY_TIMEOUT,
  469. - mssh_gconf_notify_timeout, window, NULL, NULL);
  470. - gconf_client_notify_add(client, MSSH_GCONF_KEY_CLOSE_ENDED,
  471. - mssh_gconf_notify_close_ended, window, NULL, NULL);
  472. - gconf_client_notify_add(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED,
  473. - mssh_gconf_notify_recolor_focused, window, NULL, NULL);
  474. - gconf_client_notify_add(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED,
  475. - mssh_gconf_notify_quit_all_ended, window, NULL, NULL);
  476. - gconf_client_notify_add(client, MSSH_GCONF_KEY_DIR_FOCUS,
  477. - mssh_gconf_notify_dir_focus, window, NULL, NULL);
  478. - gconf_client_notify_add(client, MSSH_GCONF_KEY_MODIFIER,
  479. - mssh_gconf_notify_modifier, window, NULL, NULL);
  480. - gconf_client_notify_add(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE,
  481. - mssh_gconf_backscroll_buffer_size, window, NULL, NULL);
  482. -
  483. - gconf_client_notify(client, MSSH_GCONF_KEY_COLUMNS);
  484. - gconf_client_notify(client, MSSH_GCONF_KEY_TIMEOUT);
  485. - gconf_client_notify(client, MSSH_GCONF_KEY_CLOSE_ENDED);
  486. - gconf_client_notify(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED);
  487. - gconf_client_notify(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED);
  488. - gconf_client_notify(client, MSSH_GCONF_KEY_DIR_FOCUS);
  489. - gconf_client_notify(client, MSSH_GCONF_KEY_MODIFIER);
  490. - gconf_client_notify(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE);
  491. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_FONT,
  492. + G_CALLBACK(mssh_gconf_notify_font), window);
  493. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_FG_COLOUR,
  494. + G_CALLBACK(mssh_gconf_notify_fg_colour), window);
  495. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_BG_COLOUR,
  496. + G_CALLBACK(mssh_gconf_notify_bg_colour), window);
  497. + g_signal_connect(window->settings,
  498. + "changed::"MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
  499. + G_CALLBACK(mssh_gconf_notify_fg_colour_focus), window);
  500. + g_signal_connect(window->settings,
  501. + "changed::"MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
  502. + G_CALLBACK(mssh_gconf_notify_bg_colour_focus), window);
  503. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_COLUMNS,
  504. + G_CALLBACK(mssh_gconf_notify_columns), window);
  505. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_TIMEOUT,
  506. + G_CALLBACK(mssh_gconf_notify_timeout), window);
  507. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_CLOSE_ENDED,
  508. + G_CALLBACK(mssh_gconf_notify_close_ended), window);
  509. + g_signal_connect(window->settings,
  510. + "changed::"MSSH_GCONF_KEY_RECOLOR_FOCUSED,
  511. + G_CALLBACK(mssh_gconf_notify_recolor_focused), window);
  512. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_QUIT_ALL_ENDED,
  513. + G_CALLBACK(mssh_gconf_notify_quit_all_ended), window);
  514. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_DIR_FOCUS,
  515. + G_CALLBACK(mssh_gconf_notify_dir_focus), window);
  516. + g_signal_connect(window->settings, "changed::"MSSH_GCONF_KEY_MODIFIER,
  517. + G_CALLBACK(mssh_gconf_notify_modifier), window);
  518. + g_signal_connect(window->settings,
  519. + "changed::"MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE,
  520. + G_CALLBACK(mssh_gconf_backscroll_buffer_size), window);
  521. +
  522. + mssh_gconf_notify_columns(window->settings, MSSH_GCONF_KEY_COLUMNS, window);
  523. + mssh_gconf_notify_timeout(window->settings, MSSH_GCONF_KEY_TIMEOUT, window);
  524. + mssh_gconf_notify_close_ended(window->settings, MSSH_GCONF_KEY_CLOSE_ENDED,
  525. + window);
  526. + mssh_gconf_notify_recolor_focused(window->settings,
  527. + MSSH_GCONF_KEY_RECOLOR_FOCUSED, window);
  528. + mssh_gconf_notify_quit_all_ended(window->settings,
  529. + MSSH_GCONF_KEY_QUIT_ALL_ENDED, window);
  530. + mssh_gconf_notify_dir_focus(window->settings, MSSH_GCONF_KEY_DIR_FOCUS,
  531. + window);
  532. + mssh_gconf_notify_modifier(window->settings, MSSH_GCONF_KEY_MODIFIER,
  533. + window);
  534. + mssh_gconf_backscroll_buffer_size(window->settings,
  535. + MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE,
  536. + window);
  537. gtk_accel_group_connect(accel, GDK_KEY_Up, window->modifier,
  538. GTK_ACCEL_VISIBLE, g_cclosure_new(
  539. @@ -667,8 +647,6 @@
  540. void mssh_window_relayout_for_one(MSSHWindow *window, GtkWidget *t)
  541. {
  542. - GConfClient *client;
  543. - GConfEntry *entry;
  544. int len = window->terminals->len;
  545. int wcols = window->columns_override ? window->columns_override :
  546. window->columns;
  547. @@ -692,14 +670,10 @@
  548. /* remove the coloring */
  549. if (window->recolor_focused) {
  550. - client = gconf_client_get_default();
  551. -
  552. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  553. - TRUE, NULL);
  554. - mssh_gconf_notify_fg_colour(client, 0, entry, window);
  555. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  556. - TRUE, NULL);
  557. - mssh_gconf_notify_bg_colour(client, 0, entry, window);
  558. + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
  559. + window);
  560. + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
  561. + window);
  562. }
  563. g_object_unref(terminal);
  564. @@ -731,8 +705,6 @@
  565. int i;
  566. int idx = -1;
  567. int len = window->terminals->len;
  568. - GConfClient *client;
  569. - GConfEntry *entry;
  570. /* get the currently focused window */
  571. GtkWidget *focus = gtk_window_get_focus(GTK_WINDOW(window));
  572. @@ -752,14 +724,10 @@
  573. /* recolor the window with the normal color */
  574. if (window->recolor_focused) {
  575. - client = gconf_client_get_default();
  576. -
  577. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  578. - TRUE, NULL);
  579. - mssh_gconf_notify_fg_colour(client, 0, entry, window);
  580. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  581. - TRUE, NULL);
  582. - mssh_gconf_notify_bg_colour(client, 0, entry, window);
  583. + mssh_gconf_notify_fg_colour(window->settings, MSSH_GCONF_KEY_FG_COLOUR,
  584. + window);
  585. + mssh_gconf_notify_bg_colour(window->settings, MSSH_GCONF_KEY_BG_COLOUR,
  586. + window);
  587. }
  588. if (idx == -1) {
  589. /* there's no window focused, do nothing */
  590. @@ -774,8 +742,6 @@
  591. static void mssh_window_restore_layout(GtkWidget *widget, gpointer data)
  592. {
  593. - GConfClient *client;
  594. - GConfEntry *entry;
  595. /* get the window */
  596. MSSHWindow *window = MSSH_WINDOW(data);
  597. @@ -789,14 +755,13 @@
  598. }
  599. /* recolor the focused window - if needed */
  600. - client = gconf_client_get_default();
  601. if (window->recolor_focused && window->is_maximized == 0) {
  602. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
  603. - TRUE, NULL);
  604. - mssh_gconf_notify_fg_colour_focus(client, 0, entry, window);
  605. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
  606. - TRUE, NULL);
  607. - mssh_gconf_notify_bg_colour_focus(client, 0, entry, window);
  608. + mssh_gconf_notify_fg_colour_focus(window->settings,
  609. + MSSH_GCONF_KEY_FG_COLOUR_FOCUS,
  610. + window);
  611. + mssh_gconf_notify_bg_colour_focus(window->settings,
  612. + MSSH_GCONF_KEY_BG_COLOUR_FOCUS,
  613. + window);
  614. }
  615. }
  616. --- debian-mssh.orig/src/mssh-window.h
  617. +++ debian-mssh/src/mssh-window.h
  618. @@ -41,6 +41,7 @@
  619. int is_maximized;
  620. gboolean recolor_focused;
  621. GData **commands;
  622. + GSettings *settings;
  623. } MSSHWindow;
  624. typedef struct
  625. --- debian-mssh.orig/src/mssh-gconf.h
  626. +++ debian-mssh/src/mssh-gconf.h
  627. @@ -1,48 +1,47 @@
  628. #ifndef __MSSH_GCONF__
  629. #define __MSSH_GCONF__
  630. -#include <gconf/gconf-client.h>
  631. +#include <gio/gio.h>
  632. -#define MSSH_GCONF_PATH "/apps/mssh"
  633. -#define MSSH_GCONF_KEY_FONT MSSH_GCONF_PATH"/font"
  634. -#define MSSH_GCONF_KEY_FG_COLOUR MSSH_GCONF_PATH"/fg_colour"
  635. -#define MSSH_GCONF_KEY_BG_COLOUR MSSH_GCONF_PATH"/bg_colour"
  636. -#define MSSH_GCONF_KEY_FG_COLOUR_FOCUS MSSH_GCONF_PATH"/fg_colour_focus"
  637. -#define MSSH_GCONF_KEY_BG_COLOUR_FOCUS MSSH_GCONF_PATH"/bg_colour_focus"
  638. -#define MSSH_GCONF_KEY_COLUMNS MSSH_GCONF_PATH"/columns"
  639. -#define MSSH_GCONF_KEY_TIMEOUT MSSH_GCONF_PATH"/timeout"
  640. -#define MSSH_GCONF_KEY_CLOSE_ENDED MSSH_GCONF_PATH"/close_ended"
  641. -#define MSSH_GCONF_KEY_RECOLOR_FOCUSED MSSH_GCONF_PATH"/recolor_focused"
  642. -#define MSSH_GCONF_KEY_QUIT_ALL_ENDED MSSH_GCONF_PATH"/quit_all_ended"
  643. -#define MSSH_GCONF_KEY_MODIFIER MSSH_GCONF_PATH"/modifier"
  644. -#define MSSH_GCONF_KEY_DIR_FOCUS MSSH_GCONF_PATH"/dir_focus"
  645. -#define MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE MSSH_GCONF_PATH"/backscroll_buffer_size"
  646. +#define MSSH_GCONF_KEY_FONT "font"
  647. +#define MSSH_GCONF_KEY_FG_COLOUR "fg-colour"
  648. +#define MSSH_GCONF_KEY_BG_COLOUR "bg-colour"
  649. +#define MSSH_GCONF_KEY_FG_COLOUR_FOCUS "fg-colour-focus"
  650. +#define MSSH_GCONF_KEY_BG_COLOUR_FOCUS "bg-colour-focus"
  651. +#define MSSH_GCONF_KEY_COLUMNS "columns"
  652. +#define MSSH_GCONF_KEY_TIMEOUT "timeout"
  653. +#define MSSH_GCONF_KEY_CLOSE_ENDED "close-ended"
  654. +#define MSSH_GCONF_KEY_RECOLOR_FOCUSED "recolor-focused"
  655. +#define MSSH_GCONF_KEY_QUIT_ALL_ENDED "quit-all-ended"
  656. +#define MSSH_GCONF_KEY_MODIFIER "modifier"
  657. +#define MSSH_GCONF_KEY_DIR_FOCUS "dir-focus"
  658. +#define MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE "backscroll-buffer-size"
  659. -void mssh_gconf_notify_font(GConfClient *client, guint cnxn_id,
  660. - GConfEntry *entry, gpointer data);
  661. -void mssh_gconf_notify_fg_colour(GConfClient *client, guint cnxn_id,
  662. - GConfEntry *entry, gpointer data);
  663. -void mssh_gconf_notify_bg_colour(GConfClient *client, guint cnxn_id,
  664. - GConfEntry *entry, gpointer data);
  665. -void mssh_gconf_notify_fg_colour_focus(GConfClient *client, guint cnxn_id,
  666. - GConfEntry *entry, gpointer data);
  667. -void mssh_gconf_notify_bg_colour_focus(GConfClient *client, guint cnxn_id,
  668. - GConfEntry *entry, gpointer data);
  669. -void mssh_gconf_notify_columns(GConfClient *client, guint cnxn_id,
  670. - GConfEntry *entry, gpointer data);
  671. -void mssh_gconf_notify_timeout(GConfClient *client, guint cnxn_id,
  672. - GConfEntry *entry, gpointer data);
  673. -void mssh_gconf_notify_close_ended(GConfClient *client, guint cnxn_id,
  674. - GConfEntry *entry, gpointer data);
  675. -void mssh_gconf_notify_quit_all_ended(GConfClient *client, guint cnxn_id,
  676. - GConfEntry *entry, gpointer data);
  677. -void mssh_gconf_notify_modifier(GConfClient *client, guint cnxn_id,
  678. - GConfEntry *entry, gpointer data);
  679. -void mssh_gconf_notify_dir_focus(GConfClient *client, guint cnxn_id,
  680. - GConfEntry *entry, gpointer data);
  681. -void mssh_gconf_backscroll_buffer_size(GConfClient *client, guint cnxn_id,
  682. - GConfEntry *entry, gpointer data);
  683. -void mssh_gconf_notify_recolor_focused(GConfClient *client, guint cnxn_id,
  684. - GConfEntry *entry, gpointer data);
  685. +void mssh_gconf_notify_font(GSettings *settings, const gchar *key,
  686. + gpointer data);
  687. +void mssh_gconf_notify_fg_colour(GSettings *settings, const gchar *key,
  688. + gpointer data);
  689. +void mssh_gconf_notify_bg_colour(GSettings *settings, const gchar *key,
  690. + gpointer data);
  691. +void mssh_gconf_notify_fg_colour_focus(GSettings *settings, const gchar *key,
  692. + gpointer data);
  693. +void mssh_gconf_notify_bg_colour_focus(GSettings *settings, const gchar *key,
  694. + gpointer data);
  695. +void mssh_gconf_notify_columns(GSettings *settings, const gchar *key,
  696. + gpointer data);
  697. +void mssh_gconf_notify_timeout(GSettings *settings, const gchar *key,
  698. + gpointer data);
  699. +void mssh_gconf_notify_close_ended(GSettings *settings, const gchar *key,
  700. + gpointer data);
  701. +void mssh_gconf_notify_quit_all_ended(GSettings *settings, const gchar *key,
  702. + gpointer data);
  703. +void mssh_gconf_notify_modifier(GSettings *settings, const gchar *key,
  704. + gpointer data);
  705. +void mssh_gconf_notify_dir_focus(GSettings *settings, const gchar *key,
  706. + gpointer data);
  707. +void mssh_gconf_backscroll_buffer_size(GSettings *settings, const gchar *key,
  708. + gpointer data);
  709. +void mssh_gconf_notify_recolor_focused(GSettings *settings, const gchar *key,
  710. + gpointer data);
  711. #endif
  712. --- debian-mssh.orig/src/mssh-pref.c
  713. +++ debian-mssh/src/mssh-pref.c
  714. @@ -1,5 +1,3 @@
  715. -#include <gconf/gconf-client.h>
  716. -
  717. #define GETTEXT_PACKAGE "mssh"
  718. #include <glib/gi18n-lib.h>
  719. @@ -7,13 +5,17 @@
  720. #include "mssh-pref.h"
  721. +GSettings *settings;
  722. +
  723. static void mssh_pref_init(MSSHPref* pref);
  724. static void mssh_pref_class_init(MSSHPrefClass *klass);
  725. G_DEFINE_TYPE(MSSHPref, mssh_pref, GTK_TYPE_WINDOW)
  726. -GtkWidget* mssh_pref_new(void)
  727. +GtkWidget* mssh_pref_new(GSettings *window_settings)
  728. {
  729. + settings = window_settings;
  730. +
  731. return g_object_new(MSSH_TYPE_PREF, NULL);
  732. }
  733. @@ -26,169 +28,125 @@
  734. static void mssh_pref_font_select(GtkWidget *widget, gpointer data)
  735. {
  736. - GConfClient *client;
  737. const gchar *font;
  738. - client = gconf_client_get_default();
  739. -
  740. font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER(widget));
  741. - gconf_client_set_string(client, MSSH_GCONF_KEY_FONT, font, NULL);
  742. + g_settings_set_string(settings, MSSH_GCONF_KEY_FONT, font);
  743. }
  744. static void mssh_pref_fg_colour_select(GtkWidget *widget, gpointer data)
  745. {
  746. - GConfClient *client;
  747. GdkRGBA colour;
  748. const gchar *colour_s;
  749. - client = gconf_client_get_default();
  750. -
  751. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  752. colour_s = gdk_rgba_to_string(&colour);
  753. - gconf_client_set_string(client, MSSH_GCONF_KEY_FG_COLOUR, colour_s,
  754. - NULL);
  755. + g_settings_set_string(settings, MSSH_GCONF_KEY_FG_COLOUR, colour_s);
  756. }
  757. static void mssh_pref_bg_colour_select(GtkWidget *widget, gpointer data)
  758. {
  759. - GConfClient *client;
  760. GdkRGBA colour;
  761. const gchar *colour_s;
  762. - client = gconf_client_get_default();
  763. -
  764. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  765. colour_s = gdk_rgba_to_string(&colour);
  766. - gconf_client_set_string(client, MSSH_GCONF_KEY_BG_COLOUR, colour_s,
  767. - NULL);
  768. + g_settings_set_string(settings, MSSH_GCONF_KEY_BG_COLOUR, colour_s);
  769. }
  770. static void mssh_pref_fg_colour_select_focus(GtkWidget *widget, gpointer data)
  771. {
  772. - GConfClient *client;
  773. GdkRGBA colour;
  774. const gchar *colour_s;
  775. - client = gconf_client_get_default();
  776. -
  777. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  778. colour_s = gdk_rgba_to_string(&colour);
  779. - gconf_client_set_string(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, colour_s,
  780. - NULL);
  781. + g_settings_set_string(settings, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, colour_s);
  782. }
  783. static void mssh_pref_bg_colour_select_focus(GtkWidget *widget, gpointer data)
  784. {
  785. - GConfClient *client;
  786. GdkRGBA colour;
  787. const gchar *colour_s;
  788. - client = gconf_client_get_default();
  789. -
  790. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  791. colour_s = gdk_rgba_to_string(&colour);
  792. - gconf_client_set_string(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, colour_s,
  793. - NULL);
  794. + g_settings_set_string(settings, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, colour_s);
  795. }
  796. static void mssh_pref_columns_select(GtkWidget *widget, gpointer data)
  797. {
  798. - GConfClient *client;
  799. int columns;
  800. - client = gconf_client_get_default();
  801. -
  802. columns = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
  803. - gconf_client_set_int(client, MSSH_GCONF_KEY_COLUMNS, columns, NULL);
  804. + g_settings_set_int(settings, MSSH_GCONF_KEY_COLUMNS, columns);
  805. }
  806. static void mssh_pref_backscroll_buffer_size_select(GtkWidget *widget, gpointer data)
  807. {
  808. - GConfClient *client;
  809. gint backscroll_buffer_size;
  810. - client = gconf_client_get_default();
  811. -
  812. backscroll_buffer_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
  813. - gconf_client_set_int(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size, NULL);
  814. + g_settings_set_int(settings, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size);
  815. }
  816. static void mssh_pref_timeout_select(GtkWidget *widget, gpointer data)
  817. {
  818. - GConfClient *client;
  819. int timeout;
  820. - client = gconf_client_get_default();
  821. -
  822. timeout = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
  823. - gconf_client_set_int(client, MSSH_GCONF_KEY_TIMEOUT, timeout, NULL);
  824. + g_settings_set_int(settings, MSSH_GCONF_KEY_TIMEOUT, timeout);
  825. }
  826. static void mssh_pref_close_check(GtkWidget *widget, gpointer data)
  827. {
  828. - GConfClient *client;
  829. gboolean close;
  830. - client = gconf_client_get_default();
  831. -
  832. close = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  833. - gconf_client_set_bool(client, MSSH_GCONF_KEY_CLOSE_ENDED, close, NULL);
  834. + g_settings_set_boolean(settings, MSSH_GCONF_KEY_CLOSE_ENDED, close);
  835. }
  836. static void mssh_pref_recolor_focused_check(GtkWidget *widget, gpointer data)
  837. {
  838. - GConfClient *client;
  839. gboolean recolor_focused;
  840. - client = gconf_client_get_default();
  841. -
  842. recolor_focused = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  843. - gconf_client_set_bool(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED, recolor_focused, NULL);
  844. + g_settings_set_boolean(settings, MSSH_GCONF_KEY_RECOLOR_FOCUSED, recolor_focused);
  845. }
  846. static void mssh_pref_exit_check(GtkWidget *widget, gpointer data)
  847. {
  848. - GConfClient *client;
  849. gboolean close;
  850. - client = gconf_client_get_default();
  851. -
  852. close = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  853. - gconf_client_set_bool(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED, close,
  854. - NULL);
  855. + g_settings_set_boolean(settings, MSSH_GCONF_KEY_QUIT_ALL_ENDED, close);
  856. }
  857. static void mssh_pref_dir_focus_check(GtkWidget *widget, gpointer data)
  858. {
  859. - GConfClient *client;
  860. gboolean focus;
  861. - client = gconf_client_get_default();
  862. -
  863. focus = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  864. - gconf_client_set_bool(client, MSSH_GCONF_KEY_DIR_FOCUS, focus, NULL);
  865. + g_settings_set_boolean(settings, MSSH_GCONF_KEY_DIR_FOCUS, focus);
  866. }
  867. static void mssh_pref_modifier_check(GtkWidget *widget, gpointer data)
  868. {
  869. - GConfClient *client;
  870. gboolean ctrl, alt, shift, super;
  871. gint val;
  872. MSSHPref * pref = MSSH_PREF(data);
  873. - client = gconf_client_get_default();
  874. -
  875. ctrl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->ctrl));
  876. shift = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->shift));
  877. alt = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->alt));
  878. @@ -196,14 +154,12 @@
  879. val = (shift << 0) | (ctrl << 2) | (alt << 3) | (super << 26);
  880. - gconf_client_set_int(client, MSSH_GCONF_KEY_MODIFIER, val, NULL);
  881. + g_settings_set_int(settings, MSSH_GCONF_KEY_MODIFIER, val);
  882. }
  883. static void mssh_pref_init(MSSHPref* pref)
  884. {
  885. - GConfClient *client;
  886. - GConfEntry *entry;
  887. - GConfValue *value;
  888. + GVariant *value;
  889. GdkRGBA colour;
  890. const gchar *colour_s;
  891. @@ -378,99 +334,84 @@
  892. g_signal_connect(G_OBJECT(mod_super_check), "toggled",
  893. G_CALLBACK(mssh_pref_modifier_check), pref);
  894. - client = gconf_client_get_default();
  895. -
  896. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FONT, NULL,
  897. - TRUE, NULL);
  898. - value = gconf_entry_get_value(entry);
  899. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_FONT);
  900. gtk_font_chooser_set_font(GTK_FONT_CHOOSER(font_select),
  901. - gconf_value_get_string(value));
  902. + g_variant_get_string(value, NULL));
  903. + g_variant_unref(value);
  904. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  905. - TRUE, NULL);
  906. - value = gconf_entry_get_value(entry);
  907. - colour_s = gconf_value_get_string(value);
  908. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_FG_COLOUR);
  909. + colour_s = g_variant_get_string(value, NULL);
  910. gdk_rgba_parse(&colour, colour_s);
  911. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fg_colour_select),
  912. &colour);
  913. + g_variant_unref(value);
  914. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  915. - TRUE, NULL);
  916. - value = gconf_entry_get_value(entry);
  917. - colour_s = gconf_value_get_string(value);
  918. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_BG_COLOUR);
  919. + colour_s = g_variant_get_string(value, NULL);
  920. gdk_rgba_parse(&colour, colour_s);
  921. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(bg_colour_select),
  922. &colour);
  923. + g_variant_unref(value);
  924. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
  925. - TRUE, NULL);
  926. - value = gconf_entry_get_value(entry);
  927. - colour_s = gconf_value_get_string(value);
  928. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_FG_COLOUR_FOCUS);
  929. + colour_s = g_variant_get_string(value, NULL);
  930. gdk_rgba_parse(&colour, colour_s);
  931. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fg_colour_select_focus),
  932. &colour);
  933. + g_variant_unref(value);
  934. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
  935. - TRUE, NULL);
  936. - value = gconf_entry_get_value(entry);
  937. - colour_s = gconf_value_get_string(value);
  938. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_BG_COLOUR_FOCUS);
  939. + colour_s = g_variant_get_string(value, NULL);
  940. gdk_rgba_parse(&colour, colour_s);
  941. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(bg_colour_select_focus),
  942. &colour);
  943. + g_variant_unref(value);
  944. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_COLUMNS, NULL,
  945. - TRUE, NULL);
  946. - value = gconf_entry_get_value(entry);
  947. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_COLUMNS);
  948. gtk_spin_button_set_value(GTK_SPIN_BUTTON(columns_select),
  949. - gconf_value_get_int(value));
  950. + g_variant_get_int32(value));
  951. + g_variant_unref(value);
  952. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, NULL,
  953. - TRUE, NULL);
  954. - value = gconf_entry_get_value(entry);
  955. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE);
  956. gtk_spin_button_set_value(GTK_SPIN_BUTTON(backscroll_buffer_size_select),
  957. - gconf_value_get_int(value));
  958. + g_variant_get_int32(value));
  959. + g_variant_unref(value);
  960. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_TIMEOUT, NULL,
  961. - TRUE, NULL);
  962. - value = gconf_entry_get_value(entry);
  963. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_TIMEOUT);
  964. gtk_spin_button_set_value(GTK_SPIN_BUTTON(timeout_select),
  965. - gconf_value_get_int(value));
  966. + g_variant_get_int32(value));
  967. + g_variant_unref(value);
  968. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_CLOSE_ENDED,
  969. - NULL, TRUE, NULL);
  970. - value = gconf_entry_get_value(entry);
  971. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_CLOSE_ENDED);
  972. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(close_check),
  973. - gconf_value_get_bool(value));
  974. + g_variant_get_boolean(value));
  975. + g_variant_unref(value);
  976. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED,
  977. - NULL, TRUE, NULL);
  978. - value = gconf_entry_get_value(entry);
  979. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_RECOLOR_FOCUSED);
  980. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(recolor_focused_check),
  981. - gconf_value_get_bool(value));
  982. + g_variant_get_boolean(value));
  983. + g_variant_unref(value);
  984. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED,
  985. - NULL, TRUE, NULL);
  986. - value = gconf_entry_get_value(entry);
  987. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_QUIT_ALL_ENDED);
  988. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(exit_check),
  989. - gconf_value_get_bool(value));
  990. + g_variant_get_boolean(value));
  991. + g_variant_unref(value);
  992. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_DIR_FOCUS,
  993. - NULL, TRUE, NULL);
  994. - value = gconf_entry_get_value(entry);
  995. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_DIR_FOCUS);
  996. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dir_focus_check),
  997. - gconf_value_get_bool(value));
  998. + g_variant_get_boolean(value));
  999. + g_variant_unref(value);
  1000. - entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_MODIFIER,
  1001. - NULL, TRUE, NULL);
  1002. - value = gconf_entry_get_value(entry);
  1003. + value = g_settings_get_value(settings, MSSH_GCONF_KEY_MODIFIER);
  1004. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_ctrl_check),
  1005. - (gconf_value_get_int(value) & GDK_CONTROL_MASK) ? 1 : 0);
  1006. + (g_variant_get_int32(value) & GDK_CONTROL_MASK) ? 1 : 0);
  1007. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_shift_check),
  1008. - (gconf_value_get_int(value) & GDK_SHIFT_MASK) ? 1 : 0);
  1009. + (g_variant_get_int32(value) & GDK_SHIFT_MASK) ? 1 : 0);
  1010. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_alt_check),
  1011. - (gconf_value_get_int(value) & GDK_MOD1_MASK) ? 1 : 0);
  1012. + (g_variant_get_int32(value) & GDK_MOD1_MASK) ? 1 : 0);
  1013. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_super_check),
  1014. - (gconf_value_get_int(value) & GDK_SUPER_MASK) ? 1 : 0);
  1015. + (g_variant_get_int32(value) & GDK_SUPER_MASK) ? 1 : 0);
  1016. + g_variant_unref(value);
  1017. }
  1018. static void mssh_pref_class_init(MSSHPrefClass *klass)
  1019. --- debian-mssh.orig/src/mssh-pref.h
  1020. +++ debian-mssh/src/mssh-pref.h
  1021. @@ -31,7 +31,7 @@
  1022. GType mssh_pref_get_type(void) G_GNUC_CONST;
  1023. -GtkWidget* mssh_pref_new(void);
  1024. +GtkWidget* mssh_pref_new(GSettings *settings);
  1025. G_END_DECLS
  1026. --- debian-mssh.orig/src/mssh-gconf.c
  1027. +++ debian-mssh/src/mssh-gconf.c
  1028. @@ -5,39 +5,38 @@
  1029. #include "mssh-window.h"
  1030. #include "mssh-terminal.h"
  1031. -void mssh_gconf_notify_font(GConfClient *client, guint cnxn_id,
  1032. - GConfEntry *entry, gpointer data)
  1033. +void mssh_gconf_notify_font(GSettings *settings, const gchar *key,
  1034. + gpointer data)
  1035. {
  1036. PangoFontDescription *font_desc;
  1037. - GConfValue *value;
  1038. + gchar *value;
  1039. int i;
  1040. MSSHWindow *window = MSSH_WINDOW(data);
  1041. - value = gconf_entry_get_value(entry);
  1042. + value = g_settings_get_string(settings, key);
  1043. - font_desc = pango_font_description_from_string(gconf_value_get_string(value));
  1044. + font_desc = pango_font_description_from_string(value);
  1045. for(i = 0; i < window->terminals->len; i++)
  1046. {
  1047. vte_terminal_set_font(VTE_TERMINAL(g_array_index(
  1048. window->terminals, MSSHTerminal*, i)), font_desc);
  1049. }
  1050. + g_free(value);
  1051. pango_font_description_free(font_desc);
  1052. }
  1053. -void mssh_gconf_notify_fg_colour(GConfClient *client, guint cnxn_id,
  1054. - GConfEntry *entry, gpointer data)
  1055. +void mssh_gconf_notify_fg_colour(GSettings *settings, const gchar *key,
  1056. + gpointer data)
  1057. {
  1058. - GConfValue *value;
  1059. - const gchar *colour_s;
  1060. + gchar *colour_s;
  1061. GdkRGBA colour;
  1062. int i;
  1063. MSSHWindow *window = MSSH_WINDOW(data);
  1064. - value = gconf_entry_get_value(entry);
  1065. - colour_s = gconf_value_get_string(value);
  1066. + colour_s = g_settings_get_string(settings, key);
  1067. gdk_rgba_parse(&colour, colour_s);
  1068. for(i = 0; i < window->terminals->len; i++)
  1069. @@ -45,20 +44,20 @@
  1070. vte_terminal_set_color_foreground(VTE_TERMINAL(g_array_index(
  1071. window->terminals, MSSHTerminal*, i)), &colour);
  1072. }
  1073. +
  1074. + g_free (colour_s);
  1075. }
  1076. -void mssh_gconf_notify_bg_colour(GConfClient *client, guint cnxn_id,
  1077. - GConfEntry *entry, gpointer data)
  1078. +void mssh_gconf_notify_bg_colour(GSettings *settings, const gchar *key,
  1079. + gpointer data)
  1080. {
  1081. - GConfValue *value;
  1082. - const gchar *colour_s;
  1083. + gchar *colour_s;
  1084. GdkRGBA colour;
  1085. int i;
  1086. MSSHWindow *window = MSSH_WINDOW(data);
  1087. - value = gconf_entry_get_value(entry);
  1088. - colour_s = gconf_value_get_string(value);
  1089. + colour_s = g_settings_get_string(settings, key);
  1090. gdk_rgba_parse(&colour, colour_s);
  1091. for(i = 0; i < window->terminals->len; i++)
  1092. @@ -66,13 +65,14 @@
  1093. vte_terminal_set_color_background(VTE_TERMINAL(g_array_index(
  1094. window->terminals, MSSHTerminal*, i)), &colour);
  1095. }
  1096. +
  1097. + g_free(colour_s);
  1098. }
  1099. -void mssh_gconf_notify_fg_colour_focus(GConfClient *client, guint cnxn_id,
  1100. - GConfEntry *entry, gpointer data)
  1101. +void mssh_gconf_notify_fg_colour_focus(GSettings *settings, const gchar *key,
  1102. + gpointer data)
  1103. {
  1104. - GConfValue *value;
  1105. - const gchar *colour_s;
  1106. + gchar *colour_s;
  1107. GdkRGBA colour;
  1108. int i;
  1109. int idx = -1;
  1110. @@ -80,8 +80,7 @@
  1111. MSSHWindow *window = MSSH_WINDOW(data);
  1112. - value = gconf_entry_get_value(entry);
  1113. - colour_s = gconf_value_get_string(value);
  1114. + colour_s = g_settings_get_string(settings, key);
  1115. gdk_rgba_parse(&colour, colour_s);
  1116. /* get the currently focused window */
  1117. @@ -103,13 +102,14 @@
  1118. vte_terminal_set_color_foreground(VTE_TERMINAL(g_array_index(
  1119. window->terminals, MSSHTerminal*, idx)), &colour);
  1120. }
  1121. +
  1122. + g_free(colour_s);
  1123. }
  1124. -void mssh_gconf_notify_bg_colour_focus(GConfClient *client, guint cnxn_id,
  1125. - GConfEntry *entry, gpointer data)
  1126. +void mssh_gconf_notify_bg_colour_focus(GSettings *settings, const gchar *key,
  1127. + gpointer data)
  1128. {
  1129. - GConfValue *value;
  1130. - const gchar *colour_s;
  1131. + gchar *colour_s;
  1132. GdkRGBA colour;
  1133. int i;
  1134. int idx = -1;
  1135. @@ -117,8 +117,7 @@
  1136. MSSHWindow *window = MSSH_WINDOW(data);
  1137. - value = gconf_entry_get_value(entry);
  1138. - colour_s = gconf_value_get_string(value);
  1139. + colour_s = g_settings_get_string(settings, key);
  1140. gdk_rgba_parse(&colour, colour_s);
  1141. /* get the currently focused window */
  1142. @@ -141,62 +140,55 @@
  1143. window->terminals, MSSHTerminal*, idx)), &colour);
  1144. }
  1145. + g_free(colour_s);
  1146. }
  1147. -void mssh_gconf_notify_columns(GConfClient *client, guint cnxn_id,
  1148. - GConfEntry *entry, gpointer data)
  1149. +void mssh_gconf_notify_columns(GSettings *settings, const gchar *key,
  1150. + gpointer data)
  1151. {
  1152. - GConfValue *value;
  1153. int columns;
  1154. MSSHWindow *window = MSSH_WINDOW(data);
  1155. - value = gconf_entry_get_value(entry);
  1156. - columns = gconf_value_get_int(value);
  1157. + columns = g_settings_get_int(settings, key);
  1158. if(columns <= 0)
  1159. {
  1160. columns = 1;
  1161. - gconf_client_set_int(client, MSSH_GCONF_KEY_COLUMNS, columns,
  1162. - NULL);
  1163. + g_settings_set_int(settings, MSSH_GCONF_KEY_COLUMNS, columns);
  1164. }
  1165. window->columns = columns;
  1166. mssh_window_relayout(window);
  1167. }
  1168. -void mssh_gconf_notify_timeout(GConfClient *client, guint cnxn_id,
  1169. - GConfEntry *entry, gpointer data)
  1170. +void mssh_gconf_notify_timeout(GSettings *settings, const gchar *key,
  1171. + gpointer data)
  1172. {
  1173. - GConfValue *value;
  1174. int timeout;
  1175. MSSHWindow *window = MSSH_WINDOW(data);
  1176. - value = gconf_entry_get_value(entry);
  1177. - timeout = gconf_value_get_int(value);
  1178. + timeout = g_settings_get_int(settings, key);
  1179. if(timeout < 0)
  1180. {
  1181. timeout = 0;
  1182. - gconf_client_set_int(client, MSSH_GCONF_KEY_TIMEOUT, timeout,
  1183. - NULL);
  1184. + g_settings_set_int(settings, MSSH_GCONF_KEY_TIMEOUT, timeout);
  1185. }
  1186. window->timeout = timeout;
  1187. mssh_window_relayout(window);
  1188. }
  1189. -void mssh_gconf_notify_close_ended(GConfClient *client, guint cnxn_id,
  1190. - GConfEntry *entry, gpointer data)
  1191. +void mssh_gconf_notify_close_ended(GSettings *settings, const gchar *key,
  1192. + gpointer data)
  1193. {
  1194. - GConfValue *value;
  1195. gboolean close_ended;
  1196. int i;
  1197. MSSHWindow *window = MSSH_WINDOW(data);
  1198. - value = gconf_entry_get_value(entry);
  1199. - close_ended = gconf_value_get_bool(value);
  1200. + close_ended = g_settings_get_boolean(settings, key);
  1201. window->close_ended_sessions = close_ended;
  1202. @@ -215,54 +207,40 @@
  1203. }
  1204. }
  1205. -void mssh_gconf_notify_recolor_focused(GConfClient *client, guint cnxn_id,
  1206. - GConfEntry *entry, gpointer data)
  1207. +void mssh_gconf_notify_recolor_focused(GSettings *settings, const gchar *key,
  1208. + gpointer data)
  1209. {
  1210. - GConfValue *value;
  1211. gboolean recolor_focused;
  1212. MSSHWindow *window = MSSH_WINDOW(data);
  1213. - value = gconf_entry_get_value(entry);
  1214. - recolor_focused = gconf_value_get_bool(value);
  1215. + recolor_focused = g_settings_get_boolean(settings, key);
  1216. window->recolor_focused = recolor_focused;
  1217. }
  1218. -void mssh_gconf_notify_quit_all_ended(GConfClient *client, guint cnxn_id,
  1219. - GConfEntry *entry, gpointer data)
  1220. +void mssh_gconf_notify_quit_all_ended(GSettings *settings, const gchar *key,
  1221. + gpointer data)
  1222. {
  1223. - GConfValue *value;
  1224. -
  1225. MSSHWindow *window = MSSH_WINDOW(data);
  1226. - value = gconf_entry_get_value(entry);
  1227. -
  1228. - window->exit_on_all_closed = gconf_value_get_bool(value);
  1229. + window->exit_on_all_closed = g_settings_get_boolean(settings, key);
  1230. }
  1231. -void mssh_gconf_notify_dir_focus(GConfClient *client, guint cnxn_id,
  1232. - GConfEntry *entry, gpointer data)
  1233. +void mssh_gconf_notify_dir_focus(GSettings *settings, const gchar *key,
  1234. + gpointer data)
  1235. {
  1236. - GConfValue *value;
  1237. -
  1238. MSSHWindow *window = MSSH_WINDOW(data);
  1239. - value = gconf_entry_get_value(entry);
  1240. -
  1241. - window->dir_focus = gconf_value_get_bool(value);
  1242. + window->dir_focus = g_settings_get_boolean(settings, key);
  1243. }
  1244. -void mssh_gconf_notify_modifier(GConfClient *client, guint cnxn_id,
  1245. - GConfEntry *entry, gpointer data)
  1246. +void mssh_gconf_notify_modifier(GSettings *settings, const gchar *key,
  1247. + gpointer data)
  1248. {
  1249. - GConfValue *value;
  1250. -
  1251. MSSHWindow *window = MSSH_WINDOW(data);
  1252. - value = gconf_entry_get_value(entry);
  1253. -
  1254. if(window->accel)
  1255. {
  1256. gtk_accel_group_disconnect_key(window->accel, GDK_KEY_Up,
  1257. @@ -275,7 +253,7 @@
  1258. window->modifier);
  1259. }
  1260. - window->modifier = gconf_value_get_int(value);
  1261. + window->modifier = g_settings_get_int(settings, key);
  1262. if(window->accel)
  1263. {
  1264. @@ -295,10 +273,9 @@
  1265. }
  1266. -void mssh_gconf_backscroll_buffer_size(GConfClient *client, guint cnxn_id,
  1267. - GConfEntry *entry, gpointer data)
  1268. +void mssh_gconf_backscroll_buffer_size(GSettings *settings, const gchar *key,
  1269. + gpointer data)
  1270. {
  1271. - GConfValue *value;
  1272. gint backscroll_buffer_size;
  1273. MSSHWindow *window = MSSH_WINDOW(data);
  1274. @@ -306,15 +283,13 @@
  1275. int i;
  1276. int len = window->terminals->len;
  1277. - value = gconf_entry_get_value(entry);
  1278. - backscroll_buffer_size = gconf_value_get_int(value);
  1279. + backscroll_buffer_size = g_settings_get_int(settings, key);
  1280. if (backscroll_buffer_size < -1)
  1281. {
  1282. backscroll_buffer_size = 5000;
  1283. - gconf_client_set_int(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size,
  1284. - NULL);
  1285. + g_settings_set_int(settings, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size);
  1286. }
  1287. window->backscroll_buffer_size = backscroll_buffer_size;
  1288. --- debian-mssh.orig/src/mssh.c
  1289. +++ debian-mssh/src/mssh.c
  1290. @@ -227,6 +227,69 @@
  1291. return commands;
  1292. }
  1293. +/* Migrate existing GConf settings. */
  1294. +static gchar *migrate_gconf_settings(const gchar *name)
  1295. +{
  1296. + gboolean needed = TRUE;
  1297. + GError *error = NULL;
  1298. + GKeyFile *kf;
  1299. + gchar **list;
  1300. + gchar *msg = NULL;
  1301. + gsize i, n;
  1302. +
  1303. + kf = g_key_file_new();
  1304. +
  1305. + if (!g_key_file_load_from_data_dirs(kf, "gsettings-data-convert",
  1306. + NULL, G_KEY_FILE_NONE, NULL))
  1307. + {
  1308. + g_key_file_free(kf);
  1309. + return NULL;
  1310. + }
  1311. +
  1312. + list = g_key_file_get_string_list(kf, "State", "converted", &n, NULL);
  1313. +
  1314. + if (list)
  1315. + {
  1316. + for (i = 0; i < n; i++)
  1317. + if (!g_strcmp0(list[i], name))
  1318. + {
  1319. + needed = FALSE;
  1320. + break;
  1321. + }
  1322. +
  1323. + g_strfreev(list);
  1324. + }
  1325. +
  1326. + g_key_file_free(kf);
  1327. +
  1328. + if (needed)
  1329. + {
  1330. + g_spawn_command_line_sync("gsettings-data-convert",
  1331. + NULL, NULL, NULL, &error);
  1332. + if (error)
  1333. + {
  1334. + msg = g_strdup_printf(_("Could not migrate old GConf settings: %s\n"
  1335. + "Please make sure that GConf is installed "
  1336. + "and the gsettings-data-convert tool is in "
  1337. + "your PATH.\nAlternatively, ignore this "
  1338. + "message and convert your old settings "
  1339. + "manually."), error->message);
  1340. + g_error_free(error);
  1341. + }
  1342. + else
  1343. + {
  1344. + msg = g_strdup(_("Old GConf settings were migrated successfully."));
  1345. +
  1346. + /* Allow some time for the GSettings backend to record the
  1347. + changes, otherwise the default values from the new schema
  1348. + might be set. */
  1349. + sleep(1);
  1350. + }
  1351. + }
  1352. +
  1353. + return msg;
  1354. +}
  1355. +
  1356. int main(int argc, char* argv[], char* env[])
  1357. {
  1358. GtkWidget* window;
  1359. @@ -236,6 +299,7 @@
  1360. GData **aliases = NULL;
  1361. GData **commands = NULL;
  1362. GArray *hosts = NULL;
  1363. + gchar *gconf_migration_msg = NULL;
  1364. static struct option long_options[] =
  1365. {
  1366. @@ -356,8 +420,23 @@
  1367. bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
  1368. textdomain(GETTEXT_PACKAGE);
  1369. + gconf_migration_msg = migrate_gconf_settings("mssh.convert");
  1370. +
  1371. window = GTK_WIDGET(mssh_window_new());
  1372. + if (gconf_migration_msg)
  1373. + {
  1374. + GtkWidget *dlg;
  1375. +
  1376. + dlg = gtk_message_dialog_new(GTK_WINDOW(window),
  1377. + GTK_DIALOG_DESTROY_WITH_PARENT,
  1378. + GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
  1379. + "%s", gconf_migration_msg);
  1380. + g_free(gconf_migration_msg);
  1381. + gtk_dialog_run(GTK_DIALOG(dlg));
  1382. + gtk_widget_destroy(dlg);
  1383. + }
  1384. +
  1385. g_signal_connect(G_OBJECT(window), "destroy",
  1386. G_CALLBACK(on_mssh_destroy), NULL);
  1387. --- debian-mssh.orig/po/POTFILES.in
  1388. +++ debian-mssh/po/POTFILES.in
  1389. @@ -3,3 +3,4 @@
  1390. ./src/mssh-pref.c
  1391. ./src/mssh-terminal.c
  1392. ./src/mssh-window.c
  1393. +[type: gettext/gsettings]es.hgarcia.mssh.gschema.xml