gtk gui conf: disable rewind conf when dynarec & display memory usage

git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@89836 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
SND\ckain_cp 2014-04-09 06:57:12 +00:00
parent 17913e0701
commit 8945a7293b
2 changed files with 52 additions and 16 deletions

View File

@ -1943,7 +1943,7 @@
</packing>
</child>
<child>
<object class="GtkFrame" id="frame20">
<object class="GtkFrame" id="frame_rew">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
@ -1952,7 +1952,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="spacing">10</property>
<property name="spacing">4</property>
<child>
<object class="GtkLabel" id="label70">
<property name="visible">True</property>
@ -1971,9 +1971,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="max-length">5</property>
<property name="width-chars">5 </property>
<property name="input-purpose">GTK_INPUT_PURPOSE_DIGITS</property>
<property name="max-length">3</property>
<property name="width-chars">3</property>
</object>
<packing>
<property name="expand">False</property>
@ -1999,9 +1998,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="max-length">5</property>
<property name="width-chars">5</property>
<property name="input-purpose">GTK_INPUT_PURPOSE_DIGITS</property>
<property name="max-length">3</property>
<property name="width-chars">3</property>
</object>
<packing>
<property name="expand">False</property>
@ -2013,13 +2011,40 @@
<object class="GtkLabel" id="label72">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">rewinds</property>
<property name="label" translatable="yes">rewinds = </property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="GtkEntry_RewindMem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="editable">False</property>
<property name="max-length">5</property>
<property name="width-chars">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label73">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">MB</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
</object>

View File

@ -858,22 +858,25 @@ static void OnCpu_PsxAutoClicked (GtkWidget *widget, gpointer user_data) {
!(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))));
}
// When the interpreter core is deselected, disable the debugger checkbox
// When the interpreter core is deselected, disable the debugger checkbox & rewind
static void OnCpu_CpuClicked(GtkWidget *widget, gpointer user_data) {
GtkWidget *check;
GtkWidget *check, *rew;
check = GTK_WIDGET(gtk_builder_get_object(builder, "GtkCheckButton_Dbg"));
rew = GTK_WIDGET(gtk_builder_get_object(builder, "frame_rew"));
// Debugger is only working with interpreter not recompiler, so let's set it
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE);
}
gtk_widget_set_sensitive (check,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
gtk_widget_set_sensitive (rew,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
}
void OnCpu_Clicked(GtkDialog *dialog, gint arg1, gpointer user_data) {
GtkWidget *widget;
s64 tmp;
long unsigned int tmp;
long t;
widget = GTK_WIDGET(gtk_builder_get_object(builder, "GtkCombo_PsxType"));
@ -959,14 +962,22 @@ void OnConf_Cpu() {
gtk_combo_box_set_active(GTK_COMBO_BOX (widget), Config.PsxType);
gtk_widget_set_sensitive(GTK_WIDGET (widget), !Config.PsxAuto);
snprintf(buf, sizeof(buf), "%lu", Config.RewindCount);
snprintf(buf, sizeof(buf), "%u", Config.RewindCount);
widget = GTK_WIDGET(gtk_builder_get_object(builder, "GtkEntry_RewindCount"));
gtk_entry_set_text(GTK_ENTRY(widget), buf);
snprintf(buf, sizeof(buf), "%lu", Config.RewindInterval);
snprintf(buf, sizeof(buf), "%u", Config.RewindInterval);
widget = GTK_WIDGET(gtk_builder_get_object(builder, "GtkEntry_RewindInterval"));
gtk_entry_set_text(GTK_ENTRY(widget), buf);
// Calculate estimated memory usage
snprintf(buf, sizeof(buf), "%u", ((unsigned int)(((float)Config.RewindCount)*4.2f)));
gtk_entry_set_text(GTK_ENTRY(gtk_builder_get_object(builder, "GtkEntry_RewindMem")),
buf);
// Enabled only if interpreter
gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(builder, "frame_rew")), Config.Cpu);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_Xa")), Config.Xa);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_SioIrq")), Config.SioIrq);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_Mdec")), Config.Mdec);