Revision: 6723
Author: deton.kih
Date: Sat Aug 14 16:49:23 2010
Log: * helper/pref-gtk.c
  - (check_dot_uim_file): Suppress ~/.uim check and warning dialog
  if uim-pref-suppress-dot-uim-warning-dialog? is #t.

http://code.google.com/p/uim/source/detail?r=6723

Modified:
 /trunk/helper/pref-gtk.c

=======================================
--- /trunk/helper/pref-gtk.c    Thu Jul 15 19:00:23 2010
+++ /trunk/helper/pref-gtk.c    Sat Aug 14 16:49:23 2010
@@ -43,6 +43,7 @@

 #include "uim/uim.h"
 #include "uim/uim-custom.h"
+#include "uim/uim-scm.h"
 #include "uim/gettext.h"
 #include "pref-gtk-custom-widgets.h"
 #include "../gtk/key-util-gtk.h"
@@ -567,14 +568,23 @@
 static gboolean
 check_dot_uim_file(void)
 {
-  GString *dot_uim = g_string_new(g_get_home_dir());
+  GString *dot_uim;
   GtkWidget *dialog;
   const gchar *message =
     N_("The user customize file \"~/.uim\" is found.\n"
        "This file will override all conflicted settings set by\n"
        "this tool (stored in ~/.uim.d/customs/*.scm).\n"
-       "Please check the file if you find your settings aren't applied.");
-
+ "Please check the file if you find your settings aren't applied.\n\n"
+       "(To suppress this dialog, add following line to ~/.uim)\n"
+       "(define uim-pref-suppress-dot-uim-warning-dialog? #t)");
+  uim_bool suppress_dialog;
+
+ suppress_dialog = uim_scm_symbol_value_bool("uim-pref-suppress-dot-uim-warning-dialog?");
+  if (suppress_dialog) {
+    return FALSE;
+  }
+
+  dot_uim = g_string_new(g_get_home_dir());
   g_string_append(dot_uim, "/.uim");

   if (!g_file_test(dot_uim->str, G_FILE_TEST_EXISTS)) {
@@ -592,12 +602,6 @@
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(pref_window)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
   }
-
-  /*
-   *  2005-02-07 Takuro Ashie <[email protected]>
-   *    FIXME! We shoud add a check box like
-   *    "Show this message every time on start up.".
-   */

   gtk_dialog_run(GTK_DIALOG(dialog));
   gtk_widget_destroy(GTK_WIDGET(dialog));

Reply via email to