mssh-pref.c 18 KB

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