Diff for /np2/x11/gtk2/gtk_menu.c between versions 1.17 and 1.28

version 1.17, 2011/01/15 16:01:53 version 1.28, 2012/01/23 04:57:24
Line 1 Line 1
 /*      $Id$    */  
   
 /*  /*
  * Copyright (c) 2004 NONAKA Kimihiro (aw9k-nnk@asahi-net.or.jp)   * Copyright (c) 2004-2011 NONAKA Kimihiro
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 243  static GtkRadioActionEntry f12key_entrie Line 241  static GtkRadioActionEntry f12key_entrie
 { "f12mouse", NULL, "F12 = _Mouse",     NULL, NULL, 0 },  { "f12mouse", NULL, "F12 = _Mouse",     NULL, NULL, 0 },
 { "f12copy",  NULL, "F12 = Co_py",      NULL, NULL, 1 },  { "f12copy",  NULL, "F12 = Co_py",      NULL, NULL, 1 },
 { "f12stop",  NULL, "F12 = S_top",      NULL, NULL, 2 },  { "f12stop",  NULL, "F12 = S_top",      NULL, NULL, 2 },
   { "f12help",  NULL, "F12 = _Help",      NULL, NULL, 7 },
 { "f12equal", NULL, "F12 = tenkey [=]", NULL, NULL, 4 },  { "f12equal", NULL, "F12 = tenkey [=]", NULL, NULL, 4 },
 { "f12comma", NULL, "F12 = tenkey [,]", NULL, NULL, 3 },  { "f12comma", NULL, "F12 = tenkey [,]", NULL, NULL, 3 },
 };  };
Line 418  static const gchar *ui_info = Line 417  static const gchar *ui_info =
 "    <menuitem action='f12mouse'/>\n"  "    <menuitem action='f12mouse'/>\n"
 "    <menuitem action='f12copy'/>\n"  "    <menuitem action='f12copy'/>\n"
 "    <menuitem action='f12stop'/>\n"  "    <menuitem action='f12stop'/>\n"
   "    <menuitem action='f12help'/>\n"
 "    <menuitem action='f12equal'/>\n"  "    <menuitem action='f12equal'/>\n"
 "    <menuitem action='f12comma'/>\n"  "    <menuitem action='f12comma'/>\n"
 "   </menu>\n"  "   </menu>\n"
Line 578  cb_bmpsave(GtkAction *action, gpointer u Line 578  cb_bmpsave(GtkAction *action, gpointer u
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 8
           gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog),
               TRUE);
   #endif
         if (strlen(bmpfilefolder) == 0) {          if (strlen(bmpfilefolder) == 0) {
                 g_strlcpy(bmpfilefolder, modulefile, sizeof(bmpfilefolder));                  g_strlcpy(bmpfilefolder, modulefile, sizeof(bmpfilefolder));
                 file_cutname(bmpfilefolder);                  file_cutname(bmpfilefolder);
Line 611  cb_bmpsave(GtkAction *action, gpointer u Line 614  cb_bmpsave(GtkAction *action, gpointer u
         if (utf8) {          if (utf8) {
                 path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);                  path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);
                 if (path) {                  if (path) {
                           gchar *ext = file_getext(path);
                           if (strlen(ext) != 3 || file_cmpname(ext, "bmp")) {
                                   gchar *tmp = g_strjoin(".", path, "bmp", NULL);
                                   g_free(path);
                                   path = tmp;
                           }
                         file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder));                          file_cpyname(bmpfilefolder, path, sizeof(bmpfilefolder));
                         sysmng_update(SYS_UPDATEOSCFG);                          sysmng_update(SYS_UPDATEOSCFG);
                         fh = file_create(path);                          fh = file_create(path);
Line 649  cb_change_font(GtkAction *action, gpoint Line 658  cb_change_font(GtkAction *action, gpoint
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  
         utf8 = g_filename_to_utf8(np2cfg.fontfile, -1, NULL, NULL, NULL);          utf8 = g_filename_to_utf8(np2cfg.fontfile, -1, NULL, NULL, NULL);
         if (utf8) {          if (utf8) {
                 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);                  gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
Line 736  cb_diskopen(GtkAction *action, gpointer  Line 744  cb_diskopen(GtkAction *action, gpointer 
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  
         utf8 = g_filename_to_utf8(fddfolder, -1, NULL, NULL, NULL);          utf8 = g_filename_to_utf8(fddfolder, -1, NULL, NULL, NULL);
         if (utf8) {          if (utf8) {
                 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);                  gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
Line 763  cb_diskopen(GtkAction *action, gpointer  Line 770  cb_diskopen(GtkAction *action, gpointer 
                 gtk_file_filter_add_pattern(filter, "*.2[hH][dD]");                  gtk_file_filter_add_pattern(filter, "*.2[hH][dD]");
                 gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]");                  gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]");
                 gtk_file_filter_add_pattern(filter, "*.[fF][sS]");                  gtk_file_filter_add_pattern(filter, "*.[fF][sS]");
                   gtk_file_filter_add_pattern(filter, "*.[fF][lL][pP]");
                 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);                  gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
         }          }
         filter = gtk_file_filter_new();          filter = gtk_file_filter_new();
Line 779  cb_diskopen(GtkAction *action, gpointer  Line 787  cb_diskopen(GtkAction *action, gpointer 
                 gtk_file_filter_add_pattern(filter, "*.2[hH][dD]");                  gtk_file_filter_add_pattern(filter, "*.2[hH][dD]");
                 gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]");                  gtk_file_filter_add_pattern(filter, "*.[fF][dD][iI]");
                 gtk_file_filter_add_pattern(filter, "*.[fF][sS]");                  gtk_file_filter_add_pattern(filter, "*.[fF][sS]");
                   gtk_file_filter_add_pattern(filter, "*.[fF][lL][pP]");
                 gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);                  gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
         }          }
         gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);          gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
Line 845  cb_ataopen(GtkAction *action, gpointer u Line 854  cb_ataopen(GtkAction *action, gpointer u
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  
         utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);          utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
         if (utf8) {          if (utf8) {
                 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);                  gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
Line 932  cb_atapiopen(GtkAction *action, gpointer Line 940  cb_atapiopen(GtkAction *action, gpointer
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  
         utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);          utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
         if (utf8) {          if (utf8) {
                 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);                  gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
Line 1033  cb_newdisk(GtkAction *action, gpointer u Line 1040  cb_newdisk(GtkAction *action, gpointer u
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  #if GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 8
           gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog),
               TRUE);
   #endif
         if (strlen(fddfolder) == 0) {          if (strlen(fddfolder) == 0) {
                 g_strlcpy(fddfolder, modulefile, sizeof(fddfolder));                  g_strlcpy(fddfolder, modulefile, sizeof(fddfolder));
                 file_cutname(fddfolder);                  file_cutname(fddfolder);
Line 1175  cb_sasiopen(GtkAction *action, gpointer  Line 1185  cb_sasiopen(GtkAction *action, gpointer 
         if (dialog == NULL)          if (dialog == NULL)
                 goto end;                  goto end;
   
         g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);          gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
         gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);  
         utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);          utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
         if (utf8) {          if (utf8) {
                 gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);                  gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
Line 1713  cb_soundboard(gint idx) Line 1722  cb_soundboard(gint idx)
 static void  static void
 cb_radio(GtkRadioAction *action, GtkRadioAction *current, gpointer user_data)  cb_radio(GtkRadioAction *action, GtkRadioAction *current, gpointer user_data)
 {  {
         guint value = (guint)gtk_radio_action_get_current_value(action);          gint value = gtk_radio_action_get_current_value(action);
         guint menu_idx = (guint)GPOINTER_TO_INT(user_data);          guint menu_idx = (guint)GPOINTER_TO_INT(user_data);
         gint i;          gint i;
   

Removed from v.1.17  
changed lines
  Added in v.1.28


RetroPC.NET-CVS <cvs@retropc.net>