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

Back to archive index

Yasumichi Akahoshi yasum****@users*****
2005年 2月 13日 (日) 01:19:02 JST


Index: cxplorer/src/actcalls.c
diff -u cxplorer/src/actcalls.c:1.28 cxplorer/src/actcalls.c:1.29
--- cxplorer/src/actcalls.c:1.28	Thu Feb 10 23:31:47 2005
+++ cxplorer/src/actcalls.c	Sun Feb 13 01:19:02 2005
@@ -22,7 +22,7 @@
  * GtkButton on toolbar.
  * @author  Yasumichi Akahoshi <yasum****@users*****>
  * @date Fri Jun 11 00:16:18 2004
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -50,15 +50,18 @@
 {
 	Cxplorer *cxplorer;
 	gchar *user_input;
+	GtkWidget *dialog;
 
 	cxplorer = (Cxplorer *) user_data;
-	user_input = cxp_input_box (GTK_WINDOW (cxplorer->gwWindow),
-				    _("Input new filename"), _("NewFile"));
-	if (user_input != NULL)
+	dialog = cxp_entry_dialog_new(_("Making new file"), _("Please, input new filename."), _("NewFile"));
+	if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
 	{
+		user_input = cxp_entry_dialog_get_entry_text (CXP_ENTRY_DIALOG(dialog));
 		cxp_right_pane_make_file (CXP_RIGHT_PANE (cxplorer->right_pane),
 					  user_input);
+		g_free(user_input);
 	}
+	gtk_widget_destroy(dialog);
 }
 
 /**
Index: cxplorer/src/cxp-right-pane.c
diff -u cxplorer/src/cxp-right-pane.c:1.12 cxplorer/src/cxp-right-pane.c:1.13
--- cxplorer/src/cxp-right-pane.c:1.12	Fri Feb 11 01:20:46 2005
+++ cxplorer/src/cxp-right-pane.c	Sun Feb 13 01:19:02 2005
@@ -965,9 +965,11 @@
 		gtk_tree_model_get (model, &iter, COL_FILE_PATH, &srcpath, COL_TERMINATOR);
 		dirname = g_path_get_dirname (srcpath);
 		srcbase = cxp_path_get_basename_of_utf8 (srcpath);
-		destbase = cxp_input_box (NULL,  _("Input new filename"), srcbase);
-		if (destbase != NULL)
+		dialog = cxp_entry_dialog_new(_("Renaming file"), _("Please, input new filename"), srcbase);
+		if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
 		{
+			destbase = cxp_entry_dialog_get_entry_text(CXP_ENTRY_DIALOG(dialog));
+			gtk_widget_destroy(dialog);
 			destbase_locale = g_locale_from_utf8 (destbase, -1, NULL, NULL,NULL);
 			destpath = g_build_filename (dirname, destbase_locale, NULL);
 
@@ -1006,6 +1008,10 @@
 			g_free (destbase);
 			g_free (destbase_locale);
 		}
+		else
+		{
+			gtk_widget_destroy(dialog);
+		}
 		g_free (dirname);
 		g_free (srcbase);
 		g_free (srcpath);
Index: cxplorer/src/menubar.c
diff -u cxplorer/src/menubar.c:1.30 cxplorer/src/menubar.c:1.31
--- cxplorer/src/menubar.c:1.30	Fri Feb 11 01:20:46 2005
+++ cxplorer/src/menubar.c	Sun Feb 13 01:19:02 2005
@@ -5,7 +5,7 @@
  * This file contains functions which related menubar.
  * @author Yasumichi Akahoshi <yasum****@users*****>
  * @date Tue Jun  8 22:32:55 2004
- * $Revision: 1.30 $
+ * $Revision: 1.31 $
  ****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -18,6 +18,7 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <errno.h>
 #include "cxplorer.h"
 #include "interface.h"
 #include "support.h"
@@ -311,14 +312,14 @@
 	gchar *gcFullPath;
 	gchar *gcLabel;
 	gchar *gcNameOfLocale;
+	GtkWidget *dialog;
 
 	cxplorer = (Cxplorer *) user_data;
-	gcLabel =
-		cxp_input_box (GTK_WINDOW (cxplorer->gwWindow),
-			       _("Input new directory name"),
-			       _("NewDirectory"));
-	if (gcLabel != NULL)
+	dialog = cxp_entry_dialog_new(_("Making new directory"), _("Plese, input name of new directory."), _("NewDirectory"));
+	if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
 	{
+		gcLabel = cxp_entry_dialog_get_entry_text(CXP_ENTRY_DIALOG(dialog));
+		gtk_widget_destroy(dialog);
 		gcNameOfLocale =
 			g_locale_from_utf8 (gcLabel, -1, NULL, NULL, NULL);
 		if (gcNameOfLocale != NULL)
@@ -330,9 +331,24 @@
 			{
 				cxp_dir_view_refresh(cxplorer->dirview);
 			}
+			else
+			{
+				dialog = gtk_message_dialog_new (NULL,
+						GTK_DIALOG_DESTROY_WITH_PARENT,
+						GTK_MESSAGE_ERROR,
+						GTK_BUTTONS_CLOSE,
+						"%s",
+						g_strerror (errno));
+				gtk_dialog_run (GTK_DIALOG (dialog));
+				gtk_widget_destroy (dialog);
+			}
 			g_free (gcLabel);
 		}
 	}
+	else
+	{
+		gtk_widget_destroy(dialog);
+	}
 }
 
 /**


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