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

アーカイブの一覧に戻る

Yasumichi Akahoshi yasum****@users*****
2005年 9月 27日 (火) 00:41:00 JST


Index: cxplorer/src/cxp-pref-dialog.c
diff -u cxplorer/src/cxp-pref-dialog.c:1.9 cxplorer/src/cxp-pref-dialog.c:1.10
--- cxplorer/src/cxp-pref-dialog.c:1.9	Thu Sep  8 23:07:53 2005
+++ cxplorer/src/cxp-pref-dialog.c	Tue Sep 27 00:41:00 2005
@@ -5,7 +5,7 @@
  * A widget of Property dialog
  * @author Yasumichi Akahoshi <yasum****@users*****>
  * @date Sun Apr 3 02:53:00 2005
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
  ****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -108,7 +108,6 @@
 static void cxp_pref_dialog_construct_child (CxpPrefDialog *self)
 {
 	CxpPrefDialogPrivate *private = CXP_PREF_DIALOG_GET_PRIVATE(self);
-	GtkWidget *apply_button;
 	GtkWidget *cancel_button;
 	GtkWidget *ok_button;
 	GtkWidget *custom_button;
@@ -168,12 +167,6 @@
 	label = gtk_label_new (_("Send To"));
 	gtk_notebook_append_page (GTK_NOTEBOOK(notebook), vbox, label);
 
-	/*
-	apply_button = gtk_button_new_from_stock("gtk-apply");
-	gtk_dialog_add_action_widget (GTK_DIALOG (self), apply_button, GTK_RESPONSE_NONE);
-	gtk_widget_show (apply_button);
-	*/
-
 	cancel_button = gtk_button_new_from_stock("gtk-cancel");
 	gtk_dialog_add_action_widget (GTK_DIALOG (self), cancel_button, GTK_RESPONSE_CANCEL);
 	gtk_widget_show (cancel_button);
Index: cxplorer/src/cxp-property-dialog.c
diff -u cxplorer/src/cxp-property-dialog.c:1.5 cxplorer/src/cxp-property-dialog.c:1.6
--- cxplorer/src/cxp-property-dialog.c:1.5	Thu Sep  1 01:00:32 2005
+++ cxplorer/src/cxp-property-dialog.c	Tue Sep 27 00:41:00 2005
@@ -5,7 +5,7 @@
  * A widget of Property dialog
  * @author Yasumichi Akahoshi <yasum****@users*****>
  * @date Sun Apr 3 02:53:00 2005
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
  ****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -42,6 +42,7 @@
 {
 	gchar *filename;
 	GtkWidget *info_labels[INFO_COUNT];
+	GtkWidget *check_boxs[9];
 	gboolean dispose_has_run;
 } CxpPropertyDialogPrivate;
 
@@ -99,6 +100,8 @@
 	CxpPropertyDialogPrivate *private = CXP_PROPERTY_DIALOG_GET_PRIVATE(self);
 	GtkWidget *close_button;
 	GtkWidget *table;
+	GtkWidget *table2;
+	GtkWidget *frame;
 	GtkWidget *title_label;
 	gchar *info_title[] = {
 		N_("Filename:"),
@@ -111,7 +114,19 @@
 		N_("last modification:"),
 		N_("last access:")
 	};
+	const gchar *permit_type[] = {
+		N_("read"),
+		N_("write"),
+		N_("execute")
+	};
+	const gchar *person_type[] = {
+		N_("owner:"),
+		N_("group:"),
+		N_("other:")
+	};
 	gint index;
+	gint col;
+	gint row;
 
 	private->filename = NULL;
 	private->dispose_has_run = FALSE;
@@ -133,6 +148,29 @@
 	}
 	gtk_widget_show (table);
 
+
+	frame = gtk_frame_new (_("permissions"));
+	gtk_box_pack_start (GTK_BOX(GTK_DIALOG(self)->vbox), frame, FALSE, FALSE, 0);
+	gtk_widget_show (frame);
+
+	table2 = gtk_table_new (4, 3, FALSE);
+	gtk_container_add (GTK_CONTAINER(frame), table2);
+	for(row = 0; row < 3; row++)
+	{
+		title_label = gtk_label_new(_(person_type[row]));
+		gtk_table_attach (GTK_TABLE(table2), title_label, 0, 1, row, row+1, GTK_FILL, 0, 2, 2);
+		gtk_widget_show (title_label);
+		for(col = 1; col < 4; col++)
+		{
+			index = col - 1 + row * 3;
+			private->check_boxs[index] = gtk_check_button_new_with_label (_(permit_type[col-1]));
+			gtk_table_attach (GTK_TABLE(table2), private->check_boxs[index], col, col+1, row, row+1, GTK_FILL, 0, 2, 2);
+			gtk_widget_show (private->check_boxs[index]);
+		}
+	}
+	gtk_widget_show (table2);
+
+
 	close_button = gtk_button_new_from_stock("gtk-close");
 	gtk_dialog_add_action_widget (GTK_DIALOG (self), close_button, GTK_RESPONSE_CLOSE);
 	gtk_widget_show (close_button);
@@ -257,6 +295,8 @@
 	struct stat status;
 	struct passwd *spasswd;
 	struct group *sgroup;
+	gint index;
+	mode_t mask = S_IRUSR;
 
 	g_return_if_fail (filename != NULL);
 
@@ -338,4 +378,9 @@
 	value = cxp_strftime (&status.st_atime);
 	gtk_label_set_text(GTK_LABEL(labels[INFO_LAST_ACCESS]), value);
 	g_free (value);
+
+	for(index=0; index<9; index++)
+	{
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(private->check_boxs[index]), status.st_mode & mask >> index);
+	}
 }
Index: cxplorer/src/cxp-right-pane.c
diff -u cxplorer/src/cxp-right-pane.c:1.76 cxplorer/src/cxp-right-pane.c:1.77
--- cxplorer/src/cxp-right-pane.c:1.76	Mon Sep 26 22:30:45 2005
+++ cxplorer/src/cxp-right-pane.c	Tue Sep 27 00:41:00 2005
@@ -1217,7 +1217,7 @@
 		g_free (fullpath);
 		cur = g_list_next (cur);
 	}
-	g_list_foreach (list, gtk_tree_path_free, NULL);
+	g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
 	g_list_free (list);
 
 	gtk_clipboard_set_text (clipboard, copy_files->str, copy_files->len);
@@ -1348,7 +1348,7 @@
 		g_free (fullpath);
 		cur = g_list_next (cur);
 	}
-	g_list_foreach (list, gtk_tree_path_free, NULL);
+	g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
 	g_list_free (list);
 
 	if (g_spawn_command_line_async (fullcmd->str, &gerror) == FALSE)
@@ -1408,7 +1408,7 @@
 		g_free (fullpath);
 		cur = g_list_next (cur);
 	}
-	g_list_foreach (list, gtk_tree_path_free, NULL);
+	g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
 	g_list_free (list);
 
 	gtk_selection_data_set (selection_data, GDK_TARGET_STRING, 8, move_files->str, move_files->len); 
@@ -1442,9 +1442,7 @@
 	GtkTreeModel *model;
 	GtkTreePath *path;
 	GtkTreeIter iter;
-	gchar *cur_dir;
 
-	g_print("called\n");
 	model = gtk_tree_view_get_model (GTK_TREE_VIEW(priv->file_list));
 	if(gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW(priv->file_list), x, y, &path, &pos))
 	{
@@ -1473,79 +1471,16 @@
 				g_free (dest_dir);
 				g_strfreev (move_file);
 
-				/*
-				cur_dir = g_strdup (priv->cur_dir);
-				cxp_right_pane_change_directory (CXP_RIGHT_PANE(data),
-						cur_dir);
-				g_free (cur_dir);
-				*/
 				gtk_drag_finish (dc, TRUE, TRUE, t);
 			}
 		}
 	}
-	g_signal_stop_emission_by_name (priv->file_list, "drag_data_recieved");
+	g_signal_stop_emission_by_name (priv->file_list, "drag_data_received");
 }
 
 gboolean cxp_right_pane_drag_drop (GtkWidget *widget, GdkDragContext *dc, gint x, gint y, guint t, gpointer data)
 {
-	CxpRightPanePrivate *priv = CXP_RIGHT_PANE_GET_PRIVATE (data);
-	GtkTreeViewDropPosition pos;
-	GtkTreeModel *model;
-	GtkTreePath *path;
-	GtkTreeIter iter;
-	gchar *cur_dir;
-	gchar *dest_dir;
-	gchar *src_path;
-	gchar *src_base;
-	gchar *dest_path;
-
-	GtkTreeSelection *selection;
-	GList *list, *cur;
-
-	model = gtk_tree_view_get_model (GTK_TREE_VIEW(priv->file_list));
-	if(gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW(priv->file_list), x, y, &path, &pos))
-	{
-		if (gtk_tree_model_get_iter(model, &iter, path))
-		{
-			gtk_tree_model_get (model, &iter, FILE_LIST_COL_FULLPATH, &dest_dir, -1);
-			if(g_file_test(dest_dir, G_FILE_TEST_IS_DIR))
-			{
-				/*
-				selection =
-					gtk_tree_view_get_selection (GTK_TREE_VIEW (dc->source_window));
-
-				list = gtk_tree_selection_get_selected_rows (selection, &model);
-				cur = list;
-				while (cur != NULL)
-				{
-					gtk_tree_model_get_iter (model, &iter, cur->data);
-					gtk_tree_model_get (model, &iter, FILE_LIST_COL_FULLPATH,
-							&src_path, -1);
-					src_base = g_path_get_basename (src_path);
-					dest_path = g_build_filename (dest_dir, src_base, NULL);
-					errno = 0;
-					if(rename(src_path, dest_path) == -1)
-					{
-						cxp_error_dialog_run_about_file (src_base);
-					}
-					g_free (dest_path);
-					g_free (src_base);
-					g_free (src_path);
-					cur = g_list_next (cur);
-				}
-				gtk_drag_finish (dc, TRUE, TRUE, t);
-				*/
-				gtk_drag_get_data (widget, dc, GDK_TARGET_STRING, t);
-
-				return	TRUE;
-			}
-		}
-	}
-
-	/*
-	gtk_drag_finish (dc, FALSE, FALSE, t);
-	*/
-	g_signal_stop_emission_by_name (priv->file_list, "drag_drop");
+	gtk_drag_get_data (widget, dc, GDK_TARGET_STRING, t);
 
-	return	FALSE;
+	return	TRUE;
 }


Cxplorer-cvs メーリングリストの案内
アーカイブの一覧に戻る