--- np2/x11/gtk2/gtk_menu.c 2011/01/15 16:01:53 1.17
+++ np2/x11/gtk2/gtk_menu.c 2011/12/20 03:50:36 1.27
@@ -1,7 +1,5 @@
-/* $Id: gtk_menu.c,v 1.17 2011/01/15 16:01:53 monaka Exp $ */
-
/*
- * Copyright (c) 2004 NONAKA Kimihiro (aw9k-nnk@asahi-net.or.jp)
+ * Copyright (c) 2004-2011 NONAKA Kimihiro
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -243,6 +241,7 @@ static GtkRadioActionEntry f12key_entrie
{ "f12mouse", NULL, "F12 = _Mouse", NULL, NULL, 0 },
{ "f12copy", NULL, "F12 = Co_py", NULL, NULL, 1 },
{ "f12stop", NULL, "F12 = S_top", NULL, NULL, 2 },
+{ "f12help", NULL, "F12 = _Help", NULL, NULL, 7 },
{ "f12equal", NULL, "F12 = tenkey [=]", NULL, NULL, 4 },
{ "f12comma", NULL, "F12 = tenkey [,]", NULL, NULL, 3 },
};
@@ -418,6 +417,7 @@ static const gchar *ui_info =
" \n"
" \n"
" \n"
+" \n"
" \n"
" \n"
" \n"
@@ -578,8 +578,11 @@ cb_bmpsave(GtkAction *action, gpointer u
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
+#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) {
g_strlcpy(bmpfilefolder, modulefile, sizeof(bmpfilefolder));
file_cutname(bmpfilefolder);
@@ -611,6 +614,12 @@ cb_bmpsave(GtkAction *action, gpointer u
if (utf8) {
path = g_filename_from_utf8(utf8, -1, NULL, NULL, NULL);
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));
sysmng_update(SYS_UPDATEOSCFG);
fh = file_create(path);
@@ -649,8 +658,7 @@ cb_change_font(GtkAction *action, gpoint
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
utf8 = g_filename_to_utf8(np2cfg.fontfile, -1, NULL, NULL, NULL);
if (utf8) {
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
@@ -736,8 +744,7 @@ cb_diskopen(GtkAction *action, gpointer
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
utf8 = g_filename_to_utf8(fddfolder, -1, NULL, NULL, NULL);
if (utf8) {
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
@@ -763,6 +770,7 @@ cb_diskopen(GtkAction *action, gpointer
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][sS]");
+ gtk_file_filter_add_pattern(filter, "*.[fF][lL][pP]");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
}
filter = gtk_file_filter_new();
@@ -779,6 +787,7 @@ cb_diskopen(GtkAction *action, gpointer
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][sS]");
+ gtk_file_filter_add_pattern(filter, "*.[fF][lL][pP]");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
}
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
@@ -845,8 +854,7 @@ cb_ataopen(GtkAction *action, gpointer u
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
if (utf8) {
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
@@ -932,8 +940,7 @@ cb_atapiopen(GtkAction *action, gpointer
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
if (utf8) {
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);
@@ -1033,8 +1040,11 @@ cb_newdisk(GtkAction *action, gpointer u
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
+#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) {
g_strlcpy(fddfolder, modulefile, sizeof(fddfolder));
file_cutname(fddfolder);
@@ -1175,8 +1185,7 @@ cb_sasiopen(GtkAction *action, gpointer
if (dialog == NULL)
goto end;
- g_object_set(G_OBJECT(dialog), "show-hidden", TRUE, NULL);
- gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
utf8 = g_filename_to_utf8(hddfolder, -1, NULL, NULL, NULL);
if (utf8) {
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), utf8);