[Patch] fixes
Nicolas Centa <[email protected]> Mon, 27 Oct 2003 16:34:50 +0100
| Newsgroups | gmane.editors.mlview.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Finally the pasted node's expansion is set according to /apps/mlview/default-tree-expansion-depth in gconf. (Do not apply the previous patch, this one is the same, corrected) Nicolas Centa "HappyPeng"
patch.diff
(application/octet-stream, 4 KB)
? depcomp
? install-sh
? missing
? mkinstalldirs
? patch.diff
? schemas/Makefile.in
Index: src/mlview-icon-tree.c
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-icon-tree.c,v
retrieving revision 1.2
diff -a -u -r1.2 mlview-icon-tree.c
--- src/mlview-icon-tree.c 26 Oct 2003 19:09:52 -0000 1.2
+++ src/mlview-icon-tree.c 27 Oct 2003 15:31:08 -0000
@@ -765,6 +765,9 @@
"editable", IS_EDITABLE_COLUMN,
NULL);
gtk_tree_view_append_column (tree_view, column);
+ g_signal_connect (G_OBJECT (renderer),
+ "edited", G_CALLBACK (node_cell_edited_cb),
+ a_this);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes
Index: src/mlview-tree-editor2.c
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-tree-editor2.c,v
retrieving revision 1.41
diff -a -u -r1.41 mlview-tree-editor2.c
--- src/mlview-tree-editor2.c 26 Oct 2003 09:53:13 -0000 1.41
+++ src/mlview-tree-editor2.c 27 Oct 2003 15:31:09 -0000
@@ -142,17 +142,11 @@
NODE_TYPE_COLUMN_OFFSET
} ;
-#define MLVIEW_TREE_EDITOR2_NODE_CLIPBOARD_SIZE 128
-static const gint TREE_EDITOR_NUMBER_OF_COLUMNS = 1;
-static const gint TREE_EDITOR_TREE_COLUMN = 0;
-static const gint TREE_EDITOR_SPACE_BETWEEN_PIXMAP_AND_TEXT = 2;
-static const gint MLVIEW_CONTENT_MAX_LEN = 512;
-static const gint MLVIEW_DEFAULT_EXPANSION_DEPTH = 2;
static guint gv_signals[NUMBER_OF_SIGNALS] = { 0 };
static GtkVBoxClass *gv_parent_class = NULL;
static GtkTargetEntry row_targets[] = {
{(gchar *)"GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0}
-} ;
+ } ;
static void xml_doc_prev_sibling_node_inserted_cb (MlViewXMLDocument *a_this,
xmlNode *a_sibling_node,
@@ -3325,6 +3319,7 @@
GtkTreeIter iter = { 0 };
GtkTreeView *tree_view = NULL ;
enum MlViewStatus status = MLVIEW_OK;
+ struct MlViewAppSettings *settings = NULL ;
g_return_val_if_fail (a_this
&& MLVIEW_IS_TREE_EDITOR2 (a_this)
@@ -3366,8 +3361,12 @@
tree_view = mlview_tree_editor2_get_tree_view (a_this) ;
mlview_tree_editor2_get_iter (a_this, a_inserted_node,
&iter) ;
+
+ settings = mlview_app_context_get_settings
+ (a_this->app_context) ;
mlview_utils_gtk_tree_view_expand_row_to_depth2
- (tree_view, &iter, -1) ;
+ (tree_view, &iter, settings->default_doc_expansion_depth);
+
mlview_tree_editor2_select_node (a_this, a_inserted_node) ;
status = mlview_tree_editor2_update_visual_node
(a_this, &iter);
@@ -3637,7 +3636,7 @@
xmlNode *a_node)
{
enum MlViewStatus status = MLVIEW_OK ;
- GtkTreePath *tree_path = NULL ;
+ GtkTreePath *tree_path = NULL, *parent_path = NULL ;
GtkTreeIter iter = {0} ;
GtkTreeModel * model = NULL ;
GtkTreeView *tree_view = NULL ;
@@ -3650,15 +3649,25 @@
g_return_if_fail (model) ;
tree_view = mlview_tree_editor2_get_tree_view (a_this) ;
g_return_if_fail (tree_view) ;
+
tree_path = gtk_tree_model_get_path (model, &iter) ;
+ parent_path = gtk_tree_path_copy (tree_path);
+ gtk_tree_path_up (parent_path);
+
g_return_if_fail (tree_path) ;
tree_sel = gtk_tree_view_get_selection (tree_view) ;
g_return_if_fail (tree_sel) ;
- gtk_tree_view_expand_to_path (tree_view, tree_path) ;
+
+ gtk_tree_view_expand_to_path (tree_view, parent_path) ;
+
gtk_tree_selection_select_path (tree_sel, tree_path);
if (tree_path) {
gtk_tree_path_free (tree_path) ;
tree_path = NULL ;
+ }
+ if (parent_path) {
+ gtk_tree_path_free (parent_path) ;
+ parent_path = NULL ;
}
}