diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/menus/edition.c | 5 | ||||
-rw-r--r-- | src/gui/panels/bookmarks.c | 10 | ||||
-rw-r--r-- | src/gui/panels/history.c | 14 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/gui/menus/edition.c b/src/gui/menus/edition.c index f4b0712..01f24e8 100644 --- a/src/gui/menus/edition.c +++ b/src/gui/menus/edition.c @@ -722,7 +722,7 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) exist = NULL;//g_db_collection_has_key(collec, &addr); if (exist != NULL) - g_loaded_binary_remove_from_collection(binary, DBF_BOOKMARKS, exist); + ;//g_loaded_binary_remove_from_collection(binary, DBF_BOOKMARKS, exist); else { @@ -746,7 +746,10 @@ static void mcb_edition_bookmarks_toggle(GtkMenuItem *menuitem, GMenuBar *bar) "Do you want to replace it ?")); if (ret != GTK_RESPONSE_YES) + { + g_object_unref(G_OBJECT(bookmark)); goto mcb_ebt_add_finish; + } } diff --git a/src/gui/panels/bookmarks.c b/src/gui/panels/bookmarks.c index f32f9f5..ebe1f62 100644 --- a/src/gui/panels/bookmarks.c +++ b/src/gui/panels/bookmarks.c @@ -473,12 +473,13 @@ static void reload_bookmarks_into_treeview(GBookmarksPanel *panel, GLoadedBinary g_db_collection_rlock(collec); + /* items = g_db_collection_get_items(collec); for (b = g_list_first(items); b != NULL; b = g_list_next(b)) { bookmark = G_DB_BOOKMARK(b->data); - if (!g_db_item_is_active(G_DB_ITEM(bookmark))) continue; + if (!g_db_item_is_enabled(G_DB_ITEM(bookmark))) continue; addr = g_db_bookmark_get_address(bookmark); @@ -500,6 +501,7 @@ static void reload_bookmarks_into_treeview(GBookmarksPanel *panel, GLoadedBinary -1); } + */ g_db_collection_runlock(collec); @@ -543,7 +545,7 @@ static void on_collection_content_changed(GDbCollection *collec, DBAction action store = GTK_LIST_STORE(gtk_builder_get_object(builder, "store")); - if (action == DBA_ADD_ITEM || (action == DBA_CHANGE_STATE && g_db_item_is_active(G_DB_ITEM(bookmark)))) + if (action == DBA_ADD_ITEM || (action == DBA_CHANGE_STATE && g_db_item_is_enabled(G_DB_ITEM(bookmark)))) { proc = g_loaded_binary_get_processor(panel->binary); msize = g_arch_processor_get_memory_size(proc); @@ -568,7 +570,7 @@ static void on_collection_content_changed(GDbCollection *collec, DBAction action } - else /*if (action == DBA_CHANGE_STATE && g_db_item_is_active(G_DB_ITEM(bookmark)))*/ + else /*if (action == DBA_CHANGE_STATE && g_db_item_is_enabled(G_DB_ITEM(bookmark)))*/ { model = GTK_TREE_MODEL(store); @@ -1183,7 +1185,7 @@ static void mcb_bookmarks_panel_delete(GtkMenuItem *menuitem, GBookmarksPanel *p mark = get_selected_panel_bookmark(treeview, NULL); if (mark == NULL) return; - g_loaded_binary_remove_from_collection(panel->binary, DBF_BOOKMARKS, G_DB_ITEM(mark)); + //g_loaded_binary_remove_from_collection(panel->binary, DBF_BOOKMARKS, G_DB_ITEM(mark)); g_object_unref(G_OBJECT(mark)); diff --git a/src/gui/panels/history.c b/src/gui/panels/history.c index 57e6a14..df3fde1 100644 --- a/src/gui/panels/history.c +++ b/src/gui/panels/history.c @@ -330,6 +330,7 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo { g_db_collection_rlock(collections[k]); + /* items = g_db_collection_get_items(collections[k]); for (i = g_list_first(items); i != NULL; i = g_list_next(i)) @@ -342,13 +343,14 @@ static void change_history_panel_current_content(GHistoryPanel *panel, GLoadedCo gtk_list_store_set(store, &iter, HTC_ITEM, item, //HTC_PICTURE, G_BOOKMARKS_PANEL_GET_CLASS(panel)->bookmark_img, - HTC_FOREGROUND, g_db_item_is_active(item) ? NULL : "grey", + HTC_FOREGROUND, g_db_item_is_enabled(item) ? NULL : "grey", HTC_LABEL, label, -1); free(label); } + */ //g_signal_connect_to_main(collections[k], "content-changed", G_CALLBACK(on_history_changed), panel, // g_cclosure_user_marshal_VOID__ENUM_OBJECT); @@ -440,7 +442,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem * gtk_list_store_set(store, &iter, HTC_ITEM, item, //HTC_PICTURE, G_BOOKMARKS_PANEL_GET_CLASS(panel)->bookmark_img, - HTC_FOREGROUND, g_db_item_is_active(item) ? NULL : "grey", + HTC_FOREGROUND, g_db_item_is_enabled(item) ? NULL : "grey", HTC_LABEL, label, -1); @@ -459,7 +461,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem * if (find_changed_item(model, item, &iter)) gtk_list_store_set(store, &iter, - HTC_FOREGROUND, g_db_item_is_active(item) ? NULL : "grey", + HTC_FOREGROUND, g_db_item_is_enabled(item) ? NULL : "grey", -1); break; @@ -480,7 +482,7 @@ static void on_history_changed(GDbCollection *collec, DBAction action, GDbItem * gtk_tree_model_get(_model, _iter, HTC_ITEM, &item, -1); - active = g_db_item_is_active(item); + active = g_db_item_is_enabled(item); g_object_unref(G_OBJECT(item)); @@ -566,10 +568,10 @@ static void on_history_selection_change(GtkTreeSelection *selection, GHistoryPan gtk_tree_model_get(model, &iter, HTC_ITEM, &item, -1); button = GTK_WIDGET(gtk_builder_get_object(builder, "undo")); - gtk_widget_set_sensitive(button, g_db_item_is_active(item)); + gtk_widget_set_sensitive(button, g_db_item_is_enabled(item)); button = GTK_WIDGET(gtk_builder_get_object(builder, "redo")); - gtk_widget_set_sensitive(button, !g_db_item_is_active(item)); + gtk_widget_set_sensitive(button, !g_db_item_is_enabled(item)); g_object_unref(G_OBJECT(item)); |