summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c22
-rw-r--r--ui.glade18
2 files changed, 31 insertions, 9 deletions
diff --git a/main.c b/main.c
index 628d43f..4056276 100644
--- a/main.c
+++ b/main.c
@@ -533,8 +533,8 @@ G_MODULE_EXPORT void search_update(GtkWidget *_widget, gpointer user_data) {
bool success = true;
if (memory_reader) {
- uint64_t value;
- bool same;
+ uint64_t value = 0;
+ bool same = false, not_sure = false;
switch (search_type) {
case SEARCH_ENTER_VALUE: {
GtkEntry *value_entry = GTK_ENTRY(gtk_builder_get_object(builder, "current-value"));
@@ -543,6 +543,8 @@ G_MODULE_EXPORT void search_update(GtkWidget *_widget, gpointer user_data) {
case SEARCH_SAME_DIFFERENT: {
GtkToggleButton *same_button = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "same"));
same = gtk_toggle_button_get_active(same_button);
+ GtkToggleButton *not_sure_button = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "not-sure"));
+ not_sure = gtk_toggle_button_get_active(not_sure_button);
} break;
}
if (success) {
@@ -619,14 +621,16 @@ G_MODULE_EXPORT void search_update(GtkWidget *_widget, gpointer user_data) {
candidates[bitset_index/64] &= ~MASK64(bitset_index % 64);
}
break;
- case SEARCH_SAME_DIFFERENT: {
- void const *prev_value_here = &((uint8_t const *)savchunk)[i * item_size];
- bool this_same = data_equal(data_type, value_here, prev_value_here);
- if (this_same != same) {
- // eliminate this candidate
- candidates[bitset_index/64] &= ~MASK64(bitset_index % 64);
+ case SEARCH_SAME_DIFFERENT:
+ if (!not_sure) {
+ void const *prev_value_here = &((uint8_t const *)savchunk)[i * item_size];
+ bool this_same = data_equal(data_type, value_here, prev_value_here);
+ if (this_same != same) {
+ // eliminate this candidate
+ candidates[bitset_index/64] &= ~MASK64(bitset_index % 64);
+ }
}
- } break;
+ break;
}
++bitset_index;
}
diff --git a/ui.glade b/ui.glade
index ee81f28..4f2329f 100644
--- a/ui.glade
+++ b/ui.glade
@@ -806,6 +806,24 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkRadioButton" id="not-sure">
+ <property name="label" translatable="yes">Not sure</property>
+ <property name="name">not-sure</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Just update the current value, don't worry about what it was before.</property>
+ <property name="active">True</property>
+ <property name="draw-indicator">True</property>
+ <property name="group">same</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>