Linux: Implemented the gui side of the new built in ISO loading functions in Linux.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1506 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-07-14 10:36:56 +00:00
parent b8b7e8d14d
commit 60e1365e8a
4 changed files with 93 additions and 2 deletions

View File

@ -17,6 +17,7 @@
*/
#include "LnxMain.h"
#include "CDVD/CDVDisoReader.h"
using namespace R5900;
@ -334,10 +335,53 @@ void OnLanguage(GtkMenuItem *menuitem, gpointer user_data)
void OnFile_RunCD(GtkMenuItem *menuitem, gpointer user_data)
{
loadFromISO = false;
SysReset();
SysPrepareExecution(NULL);
}
void OnRunIso_Ok(GtkButton* button, gpointer user_data)
{
gchar *File;
loadFromISO = true;
File = (gchar*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
strcpy(isoFileName, File);
gtk_widget_destroy(FileSel);
SysReset();
SysPrepareExecution( NULL );
}
void OnRunIso_Cancel(GtkButton* button, gpointer user_data)
{
gtk_widget_destroy(FileSel);
}
void OnFile_RunIso(GtkMenuItem *menuitem, gpointer user_data)
{
GtkWidget *Ok, *Cancel;
FileSel = gtk_file_selection_new("Select Iso File");
Ok = GTK_FILE_SELECTION(FileSel)->ok_button;
gtk_signal_connect(GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnRunIso_Ok), NULL);
gtk_widget_show(Ok);
Cancel = GTK_FILE_SELECTION(FileSel)->cancel_button;
gtk_signal_connect(GTK_OBJECT(Cancel), "clicked", GTK_SIGNAL_FUNC(OnRunIso_Cancel), NULL);
gtk_widget_show(Cancel);
gtk_widget_show(FileSel);
gdk_window_raise(FileSel->window);
}
void OnFile_BlockDump(GtkMenuItem *menuitem, gpointer user_data)
{
Config.Blockdump = (int)gtk_check_menu_item_get_active((GtkCheckMenuItem*)menuitem);
SaveConfig();
}
void OnRunElf_Ok(GtkButton* button, gpointer user_data)
{
gchar *File;

View File

@ -265,3 +265,11 @@ OnLogging_Ok (GtkButton *button,
void
OnMemcards_Ok (GtkButton *button,
gpointer user_data);
void
OnFile_RunIso (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_BlockDump (GtkMenuItem *menuitem,
gpointer user_data);

View File

@ -2769,7 +2769,9 @@ create_MainWindow (void)
GtkWidget *GtkMenuItem_File;
GtkWidget *GtkMenuItem_File_menu;
GtkWidget *run_cd1;
GtkWidget *run_iso1;
GtkWidget *GtkMenuItem_LoadElf;
GtkWidget *enable_blockdump1;
GtkWidget *separator2;
GtkWidget *states1;
GtkWidget *states1_menu;
@ -2861,11 +2863,21 @@ create_MainWindow (void)
gtk_widget_show (run_cd1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_cd1);
GtkMenuItem_LoadElf = gtk_menu_item_new_with_mnemonic (_("_Load Elf"));
run_iso1 = gtk_menu_item_new_with_mnemonic (_("_Run Iso..."));
gtk_widget_set_name (run_iso1, "run_iso1");
gtk_widget_show (run_iso1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_iso1);
GtkMenuItem_LoadElf = gtk_menu_item_new_with_mnemonic (_("_Load Elf..."));
gtk_widget_set_name (GtkMenuItem_LoadElf, "GtkMenuItem_LoadElf");
gtk_widget_show (GtkMenuItem_LoadElf);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), GtkMenuItem_LoadElf);
enable_blockdump1 = gtk_check_menu_item_new_with_mnemonic (_("_Enable Blockdump"));
gtk_widget_set_name (enable_blockdump1, "enable_blockdump1");
gtk_widget_show (enable_blockdump1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), enable_blockdump1);
separator2 = gtk_separator_menu_item_new ();
gtk_widget_set_name (separator2, "separator2");
gtk_widget_show (separator2);
@ -3177,9 +3189,15 @@ create_MainWindow (void)
g_signal_connect ((gpointer) run_cd1, "activate",
G_CALLBACK (OnFile_RunCD),
NULL);
g_signal_connect ((gpointer) run_iso1, "activate",
G_CALLBACK (OnFile_RunIso),
NULL);
g_signal_connect ((gpointer) GtkMenuItem_LoadElf, "activate",
G_CALLBACK (OnFile_LoadElf),
NULL);
g_signal_connect ((gpointer) enable_blockdump1, "activate",
G_CALLBACK (OnFile_BlockDump),
NULL);
g_signal_connect ((gpointer) load_slot_0, "activate",
G_CALLBACK (OnStates_Load),
NULL);
@ -3299,7 +3317,9 @@ create_MainWindow (void)
GLADE_HOOKUP_OBJECT (MainWindow, GtkMenuItem_File, "GtkMenuItem_File");
GLADE_HOOKUP_OBJECT (MainWindow, GtkMenuItem_File_menu, "GtkMenuItem_File_menu");
GLADE_HOOKUP_OBJECT (MainWindow, run_cd1, "run_cd1");
GLADE_HOOKUP_OBJECT (MainWindow, run_iso1, "run_iso1");
GLADE_HOOKUP_OBJECT (MainWindow, GtkMenuItem_LoadElf, "GtkMenuItem_LoadElf");
GLADE_HOOKUP_OBJECT (MainWindow, enable_blockdump1, "enable_blockdump1");
GLADE_HOOKUP_OBJECT (MainWindow, separator2, "separator2");
GLADE_HOOKUP_OBJECT (MainWindow, states1, "states1");
GLADE_HOOKUP_OBJECT (MainWindow, states1_menu, "states1_menu");

View File

@ -4889,15 +4889,34 @@ Version x.x</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="run_iso1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Run Iso...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_RunIso" last_modification_time="Tue, 14 Jul 2009 10:07:31 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="GtkMenuItem_LoadElf">
<property name="visible">True</property>
<property name="label" translatable="yes">_Load Elf</property>
<property name="label" translatable="yes">_Load Elf...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_LoadElf"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="enable_blockdump1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Enable Blockdump</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="OnFile_BlockDump" last_modification_time="Tue, 14 Jul 2009 10:09:00 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator2">
<property name="visible">True</property>