mssh-pref.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. #include <gconf/gconf-client.h>
  2. #define GETTEXT_PACKAGE "mssh"
  3. #include <glib/gi18n-lib.h>
  4. #include "mssh-gconf.h"
  5. #include "mssh-pref.h"
  6. static void mssh_pref_init(MSSHPref* pref);
  7. static void mssh_pref_class_init(MSSHPrefClass *klass);
  8. G_DEFINE_TYPE(MSSHPref, mssh_pref, GTK_TYPE_WINDOW)
  9. GtkWidget* mssh_pref_new(void)
  10. {
  11. return g_object_new(MSSH_TYPE_PREF, NULL);
  12. }
  13. static void mssh_pref_close(GtkWidget *widget, gpointer data)
  14. {
  15. MSSHPref *pref = MSSH_PREF(data);
  16. gtk_widget_destroy(GTK_WIDGET(pref));
  17. }
  18. static void mssh_pref_font_select(GtkWidget *widget, gpointer data)
  19. {
  20. GConfClient *client;
  21. const gchar *font;
  22. client = gconf_client_get_default();
  23. font = gtk_font_button_get_font_name(GTK_FONT_BUTTON(widget));
  24. gconf_client_set_string(client, MSSH_GCONF_KEY_FONT, font, NULL);
  25. }
  26. static void mssh_pref_fg_colour_select(GtkWidget *widget, gpointer data)
  27. {
  28. GConfClient *client;
  29. GdkRGBA colour;
  30. const gchar *colour_s;
  31. client = gconf_client_get_default();
  32. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  33. colour_s = gdk_rgba_to_string(&colour);
  34. gconf_client_set_string(client, MSSH_GCONF_KEY_FG_COLOUR, colour_s,
  35. NULL);
  36. }
  37. static void mssh_pref_bg_colour_select(GtkWidget *widget, gpointer data)
  38. {
  39. GConfClient *client;
  40. GdkRGBA colour;
  41. const gchar *colour_s;
  42. client = gconf_client_get_default();
  43. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  44. colour_s = gdk_rgba_to_string(&colour);
  45. gconf_client_set_string(client, MSSH_GCONF_KEY_BG_COLOUR, colour_s,
  46. NULL);
  47. }
  48. static void mssh_pref_fg_colour_select_focus(GtkWidget *widget, gpointer data)
  49. {
  50. GConfClient *client;
  51. GdkRGBA colour;
  52. const gchar *colour_s;
  53. client = gconf_client_get_default();
  54. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  55. colour_s = gdk_rgba_to_string(&colour);
  56. gconf_client_set_string(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, colour_s,
  57. NULL);
  58. }
  59. static void mssh_pref_bg_colour_select_focus(GtkWidget *widget, gpointer data)
  60. {
  61. GConfClient *client;
  62. GdkRGBA colour;
  63. const gchar *colour_s;
  64. client = gconf_client_get_default();
  65. gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(widget), &colour);
  66. colour_s = gdk_rgba_to_string(&colour);
  67. gconf_client_set_string(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, colour_s,
  68. NULL);
  69. }
  70. static void mssh_pref_columns_select(GtkWidget *widget, gpointer data)
  71. {
  72. GConfClient *client;
  73. int columns;
  74. client = gconf_client_get_default();
  75. columns = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
  76. gconf_client_set_int(client, MSSH_GCONF_KEY_COLUMNS, columns, NULL);
  77. }
  78. static void mssh_pref_backscroll_buffer_size_select(GtkWidget *widget, gpointer data)
  79. {
  80. GConfClient *client;
  81. gint backscroll_buffer_size;
  82. client = gconf_client_get_default();
  83. backscroll_buffer_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
  84. gconf_client_set_int(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, backscroll_buffer_size, NULL);
  85. }
  86. static void mssh_pref_timeout_select(GtkWidget *widget, gpointer data)
  87. {
  88. GConfClient *client;
  89. int timeout;
  90. client = gconf_client_get_default();
  91. timeout = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
  92. gconf_client_set_int(client, MSSH_GCONF_KEY_TIMEOUT, timeout, NULL);
  93. }
  94. static void mssh_pref_close_check(GtkWidget *widget, gpointer data)
  95. {
  96. GConfClient *client;
  97. gboolean close;
  98. client = gconf_client_get_default();
  99. close = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  100. gconf_client_set_bool(client, MSSH_GCONF_KEY_CLOSE_ENDED, close, NULL);
  101. }
  102. static void mssh_pref_recolor_focused_check(GtkWidget *widget, gpointer data)
  103. {
  104. GConfClient *client;
  105. gboolean recolor_focused;
  106. client = gconf_client_get_default();
  107. recolor_focused = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  108. gconf_client_set_bool(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED, recolor_focused, NULL);
  109. }
  110. static void mssh_pref_exit_check(GtkWidget *widget, gpointer data)
  111. {
  112. GConfClient *client;
  113. gboolean close;
  114. client = gconf_client_get_default();
  115. close = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  116. gconf_client_set_bool(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED, close,
  117. NULL);
  118. }
  119. static void mssh_pref_dir_focus_check(GtkWidget *widget, gpointer data)
  120. {
  121. GConfClient *client;
  122. gboolean focus;
  123. client = gconf_client_get_default();
  124. focus = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
  125. gconf_client_set_bool(client, MSSH_GCONF_KEY_DIR_FOCUS, focus, NULL);
  126. }
  127. static void mssh_pref_modifier_check(GtkWidget *widget, gpointer data)
  128. {
  129. GConfClient *client;
  130. gboolean ctrl, alt, shift, super;
  131. gint val;
  132. MSSHPref * pref = MSSH_PREF(data);
  133. client = gconf_client_get_default();
  134. ctrl = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->ctrl));
  135. shift = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->shift));
  136. alt = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->alt));
  137. super = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pref->super));
  138. val = (shift << 0) | (ctrl << 2) | (alt << 3) | (super << 26);
  139. gconf_client_set_int(client, MSSH_GCONF_KEY_MODIFIER, val, NULL);
  140. }
  141. static void mssh_pref_init(MSSHPref* pref)
  142. {
  143. GConfClient *client;
  144. GConfEntry *entry;
  145. GConfValue *value;
  146. GdkRGBA colour;
  147. const gchar *colour_s;
  148. GtkWidget *frame = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
  149. GtkWidget *notebook = gtk_notebook_new();
  150. GtkWidget *content = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
  151. GtkWidget *font_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
  152. GtkWidget *font_label = gtk_label_new(_("Font:"));
  153. GtkWidget *font_select = gtk_font_button_new();
  154. GtkWidget *colour_table = gtk_grid_new();
  155. GtkWidget *bg_colour_label = gtk_label_new(_("Background:"));
  156. GtkWidget *bg_colour_select = gtk_color_button_new();
  157. GtkWidget *fg_colour_label = gtk_label_new(_("Foreground:"));
  158. GtkWidget *fg_colour_select = gtk_color_button_new();
  159. GtkWidget *recolor_focused_check = gtk_check_button_new_with_label(
  160. _("Use different color for focused window"));
  161. GtkWidget *colour_table_focus = gtk_grid_new();
  162. GtkWidget *bg_colour_label_focus = gtk_label_new(_("Background for focused window:"));
  163. GtkWidget *bg_colour_select_focus = gtk_color_button_new();
  164. GtkWidget *fg_colour_label_focus = gtk_label_new(_("Foreground for focused window:"));
  165. GtkWidget *fg_colour_select_focus = gtk_color_button_new();
  166. GtkWidget *exit_check = gtk_check_button_new_with_label(
  167. _("Quit after all sessions have ended"));
  168. GtkWidget *close_check = gtk_check_button_new_with_label(
  169. _("Close ended sessions"));
  170. GtkWidget *timeout_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
  171. GtkWidget *timeout_label1 = gtk_label_new(
  172. _("Closed ended sessions after"));
  173. GtkAdjustment *timeout_adj = gtk_adjustment_new(3, 0, 100, 1, 10, 0);
  174. GtkWidget *timeout_select = gtk_spin_button_new(
  175. GTK_ADJUSTMENT(timeout_adj), 1, 0);
  176. GtkWidget *timeout_label2 = gtk_label_new(_("seconds"));
  177. GtkWidget *columns_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
  178. GtkWidget *columns_label = gtk_label_new(_("Columns:"));
  179. GtkAdjustment *columns_adj = gtk_adjustment_new(2, 1, 10, 1, 10, 0);
  180. GtkWidget *columns_select = gtk_spin_button_new(
  181. GTK_ADJUSTMENT(columns_adj), 1, 0);
  182. GtkWidget *backscroll_buffer_size_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
  183. GtkWidget *backscroll_buffer_size_label = gtk_label_new(_("Scrollback Lines:"));
  184. GtkAdjustment *backscroll_buffer_size_adj = gtk_adjustment_new(5000, -1, 65535, 1, 100, 0);
  185. GtkWidget *backscroll_buffer_size_select = gtk_spin_button_new(
  186. GTK_ADJUSTMENT(backscroll_buffer_size_adj), 1, 0);
  187. GtkWidget *mod_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 10);
  188. GtkWidget *mod_label = gtk_label_new(_("Modifier:"));
  189. GtkWidget *mod_ctrl_check = gtk_check_button_new_with_label("Ctrl");
  190. GtkWidget *mod_alt_check = gtk_check_button_new_with_label("Alt");
  191. GtkWidget *mod_shift_check = gtk_check_button_new_with_label("Shift");
  192. GtkWidget *mod_super_check = gtk_check_button_new_with_label("Super");
  193. GtkWidget *close_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
  194. GtkWidget *close_button = gtk_button_new_with_label("Close");
  195. GtkWidget *dir_focus_check = gtk_check_button_new_with_label(
  196. _("Use directional focus"));
  197. pref->ctrl = mod_ctrl_check;
  198. pref->shift = mod_shift_check;
  199. pref->alt = mod_alt_check;
  200. pref->super = mod_super_check;
  201. gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
  202. gtk_notebook_append_page(GTK_NOTEBOOK(notebook), content, NULL);
  203. gtk_box_pack_start(GTK_BOX(font_hbox), font_label, FALSE, TRUE, 0);
  204. gtk_box_pack_start(GTK_BOX(font_hbox), font_select, FALSE, TRUE, 0);
  205. gtk_box_pack_start(GTK_BOX(content), font_hbox, FALSE, TRUE, 0);
  206. gtk_grid_attach(GTK_GRID(colour_table), bg_colour_label,
  207. 0, 0, 1, 1);
  208. gtk_grid_attach(GTK_GRID(colour_table), bg_colour_select,
  209. 1, 0, 1, 1);
  210. gtk_grid_attach(GTK_GRID(colour_table), fg_colour_label,
  211. 0, 1, 1, 1);
  212. gtk_grid_attach(GTK_GRID(colour_table), fg_colour_select,
  213. 1, 1, 1, 1);
  214. gtk_box_pack_start(GTK_BOX(content), colour_table, FALSE, TRUE, 0);
  215. gtk_box_pack_start(GTK_BOX(content), recolor_focused_check, FALSE, TRUE, 0);
  216. gtk_grid_attach(GTK_GRID(colour_table_focus), bg_colour_label_focus,
  217. 0, 0, 1, 1);
  218. gtk_grid_attach(GTK_GRID(colour_table_focus), bg_colour_select_focus,
  219. 1, 0, 1, 1);
  220. gtk_grid_attach(GTK_GRID(colour_table_focus), fg_colour_label_focus,
  221. 0, 1, 1, 1);
  222. gtk_grid_attach(GTK_GRID(colour_table_focus), fg_colour_select_focus,
  223. 1, 1, 1, 1);
  224. gtk_box_pack_start(GTK_BOX(content), colour_table_focus, FALSE, TRUE, 0);
  225. gtk_box_pack_start(GTK_BOX(content), exit_check, FALSE, TRUE, 0);
  226. gtk_box_pack_start(GTK_BOX(content), close_check, FALSE, TRUE, 0);
  227. gtk_box_pack_start(GTK_BOX(content), dir_focus_check, FALSE, TRUE, 0);
  228. gtk_box_pack_start(GTK_BOX(timeout_hbox), timeout_label1, FALSE,
  229. TRUE, 0);
  230. gtk_box_pack_start(GTK_BOX(timeout_hbox), timeout_select, FALSE,
  231. TRUE, 0);
  232. gtk_box_pack_start(GTK_BOX(timeout_hbox), timeout_label2, FALSE,
  233. TRUE, 0);
  234. gtk_box_pack_start(GTK_BOX(content), timeout_hbox, FALSE, TRUE, 0);
  235. gtk_box_pack_start(GTK_BOX(columns_hbox), columns_label, FALSE,
  236. TRUE, 0);
  237. gtk_box_pack_start(GTK_BOX(columns_hbox), columns_select, FALSE,
  238. TRUE, 0);
  239. gtk_box_pack_start(GTK_BOX(content), columns_hbox, FALSE, TRUE, 0);
  240. gtk_box_pack_start(GTK_BOX(backscroll_buffer_size_hbox), backscroll_buffer_size_label, FALSE,
  241. TRUE, 0);
  242. gtk_box_pack_start(GTK_BOX(backscroll_buffer_size_hbox), backscroll_buffer_size_select, FALSE,
  243. TRUE, 0);
  244. gtk_box_pack_start(GTK_BOX(content), backscroll_buffer_size_hbox, FALSE, TRUE, 0);
  245. gtk_box_pack_start(GTK_BOX(mod_hbox), mod_label, FALSE, TRUE, 0);
  246. gtk_box_pack_start(GTK_BOX(mod_hbox), mod_ctrl_check, FALSE, TRUE, 0);
  247. gtk_box_pack_start(GTK_BOX(mod_hbox), mod_alt_check, FALSE, TRUE, 0);
  248. gtk_box_pack_start(GTK_BOX(mod_hbox), mod_shift_check, FALSE, TRUE, 0);
  249. gtk_box_pack_start(GTK_BOX(mod_hbox), mod_super_check, FALSE, TRUE, 0);
  250. gtk_box_pack_start(GTK_BOX(content), mod_hbox, FALSE, TRUE, 0);
  251. gtk_box_pack_end(GTK_BOX(close_hbox), close_button, FALSE, TRUE, 0);
  252. gtk_box_pack_start(GTK_BOX(frame), notebook, TRUE, TRUE, 0);
  253. gtk_box_pack_start(GTK_BOX(frame), close_hbox, FALSE, TRUE, 0);
  254. gtk_container_add(GTK_CONTAINER(pref), frame);
  255. g_signal_connect(G_OBJECT(close_button), "clicked",
  256. G_CALLBACK(mssh_pref_close), pref);
  257. gtk_container_set_border_width(GTK_CONTAINER(content), 6);
  258. gtk_container_set_border_width(GTK_CONTAINER(pref), 15);
  259. gtk_window_set_title(GTK_WINDOW(pref), _("Preferences"));
  260. gtk_window_set_resizable(GTK_WINDOW(pref), FALSE);
  261. g_signal_connect(G_OBJECT(font_select), "font-set",
  262. G_CALLBACK(mssh_pref_font_select), NULL);
  263. g_signal_connect(G_OBJECT(fg_colour_select), "color-set",
  264. G_CALLBACK(mssh_pref_fg_colour_select), NULL);
  265. g_signal_connect(G_OBJECT(bg_colour_select), "color-set",
  266. G_CALLBACK(mssh_pref_bg_colour_select), NULL);
  267. g_signal_connect(G_OBJECT(fg_colour_select_focus), "color-set",
  268. G_CALLBACK(mssh_pref_fg_colour_select_focus), NULL);
  269. g_signal_connect(G_OBJECT(bg_colour_select_focus), "color-set",
  270. G_CALLBACK(mssh_pref_bg_colour_select_focus), NULL);
  271. g_signal_connect(G_OBJECT(columns_select), "value-changed",
  272. G_CALLBACK(mssh_pref_columns_select), NULL);
  273. g_signal_connect(G_OBJECT(backscroll_buffer_size_select), "value-changed",
  274. G_CALLBACK(mssh_pref_backscroll_buffer_size_select), NULL);
  275. g_signal_connect(G_OBJECT(timeout_select), "value-changed",
  276. G_CALLBACK(mssh_pref_timeout_select), NULL);
  277. g_signal_connect(G_OBJECT(close_check), "toggled",
  278. G_CALLBACK(mssh_pref_close_check), NULL);
  279. g_signal_connect(G_OBJECT(recolor_focused_check), "toggled",
  280. G_CALLBACK(mssh_pref_recolor_focused_check), NULL);
  281. g_signal_connect(G_OBJECT(exit_check), "toggled",
  282. G_CALLBACK(mssh_pref_exit_check), NULL);
  283. g_signal_connect(G_OBJECT(dir_focus_check), "toggled",
  284. G_CALLBACK(mssh_pref_dir_focus_check), NULL);
  285. g_signal_connect(G_OBJECT(mod_ctrl_check), "toggled",
  286. G_CALLBACK(mssh_pref_modifier_check), pref);
  287. g_signal_connect(G_OBJECT(mod_alt_check), "toggled",
  288. G_CALLBACK(mssh_pref_modifier_check), pref);
  289. g_signal_connect(G_OBJECT(mod_shift_check), "toggled",
  290. G_CALLBACK(mssh_pref_modifier_check), pref);
  291. g_signal_connect(G_OBJECT(mod_super_check), "toggled",
  292. G_CALLBACK(mssh_pref_modifier_check), pref);
  293. client = gconf_client_get_default();
  294. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FONT, NULL,
  295. TRUE, NULL);
  296. value = gconf_entry_get_value(entry);
  297. gtk_font_button_set_font_name(GTK_FONT_BUTTON(font_select),
  298. gconf_value_get_string(value));
  299. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR, NULL,
  300. TRUE, NULL);
  301. value = gconf_entry_get_value(entry);
  302. colour_s = gconf_value_get_string(value);
  303. gdk_rgba_parse(&colour, colour_s);
  304. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fg_colour_select),
  305. &colour);
  306. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR, NULL,
  307. TRUE, NULL);
  308. value = gconf_entry_get_value(entry);
  309. colour_s = gconf_value_get_string(value);
  310. gdk_rgba_parse(&colour, colour_s);
  311. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(bg_colour_select),
  312. &colour);
  313. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_FG_COLOUR_FOCUS, NULL,
  314. TRUE, NULL);
  315. value = gconf_entry_get_value(entry);
  316. colour_s = gconf_value_get_string(value);
  317. gdk_rgba_parse(&colour, colour_s);
  318. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(fg_colour_select_focus),
  319. &colour);
  320. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BG_COLOUR_FOCUS, NULL,
  321. TRUE, NULL);
  322. value = gconf_entry_get_value(entry);
  323. colour_s = gconf_value_get_string(value);
  324. gdk_rgba_parse(&colour, colour_s);
  325. gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(bg_colour_select_focus),
  326. &colour);
  327. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_COLUMNS, NULL,
  328. TRUE, NULL);
  329. value = gconf_entry_get_value(entry);
  330. gtk_spin_button_set_value(GTK_SPIN_BUTTON(columns_select),
  331. gconf_value_get_int(value));
  332. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_BACKSCROLL_BUFFER_SIZE, NULL,
  333. TRUE, NULL);
  334. value = gconf_entry_get_value(entry);
  335. gtk_spin_button_set_value(GTK_SPIN_BUTTON(backscroll_buffer_size_select),
  336. gconf_value_get_int(value));
  337. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_TIMEOUT, NULL,
  338. TRUE, NULL);
  339. value = gconf_entry_get_value(entry);
  340. gtk_spin_button_set_value(GTK_SPIN_BUTTON(timeout_select),
  341. gconf_value_get_int(value));
  342. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_CLOSE_ENDED,
  343. NULL, TRUE, NULL);
  344. value = gconf_entry_get_value(entry);
  345. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(close_check),
  346. gconf_value_get_bool(value));
  347. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_RECOLOR_FOCUSED,
  348. NULL, TRUE, NULL);
  349. value = gconf_entry_get_value(entry);
  350. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(recolor_focused_check),
  351. gconf_value_get_bool(value));
  352. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_QUIT_ALL_ENDED,
  353. NULL, TRUE, NULL);
  354. value = gconf_entry_get_value(entry);
  355. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(exit_check),
  356. gconf_value_get_bool(value));
  357. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_DIR_FOCUS,
  358. NULL, TRUE, NULL);
  359. value = gconf_entry_get_value(entry);
  360. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dir_focus_check),
  361. gconf_value_get_bool(value));
  362. entry = gconf_client_get_entry(client, MSSH_GCONF_KEY_MODIFIER,
  363. NULL, TRUE, NULL);
  364. value = gconf_entry_get_value(entry);
  365. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_ctrl_check),
  366. (gconf_value_get_int(value) & GDK_CONTROL_MASK) ? 1 : 0);
  367. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_shift_check),
  368. (gconf_value_get_int(value) & GDK_SHIFT_MASK) ? 1 : 0);
  369. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_alt_check),
  370. (gconf_value_get_int(value) & GDK_MOD1_MASK) ? 1 : 0);
  371. gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mod_super_check),
  372. (gconf_value_get_int(value) & GDK_SUPER_MASK) ? 1 : 0);
  373. }
  374. static void mssh_pref_class_init(MSSHPrefClass *klass)
  375. {
  376. }