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

Back to archive index

Yasumichi Akahoshi yasum****@users*****
2005年 4月 9日 (土) 16:50:55 JST


Index: cxplorer/src/cxplorer-window.c
diff -u cxplorer/src/cxplorer-window.c:1.16 cxplorer/src/cxplorer-window.c:1.17
--- cxplorer/src/cxplorer-window.c:1.16	Sat Apr  9 16:33:01 2005
+++ cxplorer/src/cxplorer-window.c	Sat Apr  9 16:50:55 2005
@@ -79,6 +79,9 @@
 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);
+static void cxplorer_window_refresh_views_action (GtkWidget *widget, gpointer user_data);
+static void cxplorer_window_go_up_action (GtkWidget *widget, gpointer user_data);
+static void cxplorer_window_go_home_action (GtkWidget *widget, gpointer user_data);
 
 /**
  * Actions
@@ -104,11 +107,11 @@
 	{"PrefAction", "gtk-preferences", N_("_Preferences"), NULL, NULL, NULL},
 	/* View menu */
 	{"ViewAction", NULL, N_("_View"), NULL, NULL, NULL},
-	{"RefreshAct", "gtk-refresh", N_("_Refresh"), NULL, NULL, NULL},
+	{"RefreshAct", "gtk-refresh", N_("_Refresh"), NULL, NULL, G_CALLBACK(cxplorer_window_refresh_views_action)},
 	/* Move menu */
 	{"GoAction", NULL, N_("_Go"), NULL, NULL, NULL},
-	{"UpAction", "gtk-go-up", N_("_Up"), NULL, NULL, NULL},
-	{"HomeAct", "gtk-home", N_("_Home"), NULL, NULL, NULL},
+	{"UpAction", "gtk-go-up", N_("_Up"), NULL, NULL, G_CALLBACK(cxplorer_window_go_up_action)},
+	{"HomeAct", "gtk-home", N_("_Home"), NULL, NULL, G_CALLBACK(cxplorer_window_go_home_action)},
 	{"BookmarkAct", NULL, N_("_Bookmark..."), NULL, NULL, NULL},
 	/* Help menu */
 	{"HelpAction", NULL, N_("_Help"), NULL, NULL, NULL},
@@ -467,6 +470,51 @@
 }
 
 /**
+ * This function refresh views When user request.
+ * @param widget [in] Pointer to GtkWidget which calls this function.
+ * @param user_data [in] Pointer to data which is defined by user.
+ */
+static void cxplorer_window_refresh_views_action (GtkWidget *widget, gpointer user_data)
+{
+	CxplorerWindowPrivate *private = CXPLORER_WINDOW_GET_PRIVATE (user_data);
+
+	cxp_dir_view_refresh (CXP_DIR_VIEW(private->dirview));
+}
+
+/**
+ * This function select parent directory when user request.
+ * @param widget [in] Pointer to GtkWidget which calls this function.
+ * @param user_data [in] Pointer to data which is defined by user.
+ */
+static void cxplorer_window_go_up_action (GtkWidget *widget, gpointer user_data)
+{
+	CxplorerWindowPrivate *private = CXPLORER_WINDOW_GET_PRIVATE (user_data);
+	gchar *up_dir;
+	gchar *current_dir;
+
+	current_dir = cxp_dir_view_get_current_directory (CXP_DIR_VIEW(private->dirview));
+	if (current_dir != NULL)
+	{
+		up_dir = g_path_get_dirname (current_dir);
+		cxp_dir_view_change_directory (CXP_DIR_VIEW(private->dirview), up_dir);
+		g_free (up_dir);
+		g_free (current_dir);
+	}
+}
+
+/**
+ * This function select home directory when user request.
+ * @param widget [in] Pointer to GtkWidget which calls this function.
+ * @param user_data [in] Pointer to data which is defined by user.
+ */
+static void cxplorer_window_go_home_action (GtkWidget *widget, gpointer user_data)
+{
+	CxplorerWindowPrivate *private = CXPLORER_WINDOW_GET_PRIVATE (user_data);
+
+	cxp_dir_view_change_directory (CXP_DIR_VIEW(private->dirview), g_get_home_dir ());
+}
+
+/**
  * This function show about dialog when user click "Help->About".
  * @param menuitem [in] Pointer to menu item "Help->About".
  * @param user_data [in] Pointer to data which is defined by user, but it isn't


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