summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-25 22:20:25 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-25 22:20:25 (GMT)
commit6ed1e4110eb19b78f76154aa095a74414531f04c (patch)
treed1c3562cb6e180baff3c388a3bb3574b0a02213b /src/gui/panels
parent3dc843b3f7991dcd738a30821ff56c7fe13f1094 (diff)
Prepared history for database items.
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/bookmarks.c10
-rw-r--r--src/gui/panels/history.c14
2 files changed, 14 insertions, 10 deletions
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));