[Cxplorer-cvs 01300] CVS update: cxplorer/src

Back to archive index

Yasumichi Akahoshi yasum****@users*****
2005年 9月 30日 (金) 02:24:18 JST


Index: cxplorer/src/cxplorer-window.c
diff -u cxplorer/src/cxplorer-window.c:1.65 cxplorer/src/cxplorer-window.c:1.66
--- cxplorer/src/cxplorer-window.c:1.65	Fri Sep 30 02:11:47 2005
+++ cxplorer/src/cxplorer-window.c	Fri Sep 30 02:24:18 2005
@@ -102,6 +102,7 @@
 void cxplorer_window_delete_action (GtkWidget * widget, gpointer user_data);
 static void cxplorer_window_rename_action (GtkWidget *widget, gpointer user_data);
 static void cxplorer_window_send_mail_action (GtkWidget *widget, gpointer user_data);
+static void cxplorer_window_set_cmd_action (GtkWidget *widget, gpointer user_data);
 static void cxplorer_window_property_action (GtkWidget * widget, gpointer user_data);
 static void cxplorer_window_copy_action (GtkWidget * widget, gpointer user_data);
 static void cxplorer_window_paste_action (GtkWidget *widget, gpointer user_data);
@@ -134,7 +135,7 @@
 	{"RenameAction", NULL, N_("_Rename..."), NULL, NULL, G_CALLBACK(cxplorer_window_rename_action)},
 	{"SendAction", NULL, N_("_Send to"), NULL, NULL, NULL},
 	{"MailAction", NULL, N_("_Mail"), NULL, NULL, G_CALLBACK(cxplorer_window_send_mail_action)},
-	{"SetCmdAction", NULL, N_("Set related command..."), NULL, NULL, NULL},
+	{"SetCmdAction", NULL, N_("Set related command..."), NULL, NULL, G_CALLBACK(cxplorer_window_set_cmd_action)},
 	{"PropAction", "gtk-properties", N_("_Property"), NULL, NULL, G_CALLBACK(cxplorer_window_property_action)},
 	{"QuitAction", "gtk-quit", N_("_Quit"), NULL, NULL, gtk_main_quit},
 	/* Edit menu */
@@ -747,6 +748,27 @@
 	g_free (cmd_format);
 }
 
+static void cxplorer_window_set_cmd_action (GtkWidget *widget, gpointer user_data)
+{
+	CxplorerWindowPrivate *private = CXPLORER_WINDOW_GET_PRIVATE (user_data);
+	GtkWidget *dialog;
+	gchar *fullpath;
+	gchar *mime_type;
+	GError *gerror = NULL;
+
+
+	if ((fullpath = cxp_right_pane_get_active_file_name (CXP_RIGHT_PANE(private->right_pane))) != NULL)
+	{
+		mime_type = cxp_get_mime_type_for_file (fullpath);
+		dialog = cxp_mime_cmd_dialog_new (mime_type);
+		gtk_dialog_run (GTK_DIALOG (dialog));
+		gtk_widget_destroy (dialog);
+
+		g_free (mime_type);
+		g_free (fullpath);
+	}
+}
+
 /**
  * This function show property of selected file when user click
  * "File->Property".


Cxplorer-cvs メーリングリストの案内
Back to archive index