Fixed Elves in Linux, and implemented two out of three menu items.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1688 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-08-27 11:58:18 +00:00
parent 6ee99d7cbb
commit 973282bd6c
5 changed files with 141 additions and 44 deletions

View File

@ -284,6 +284,7 @@ void StartGui()
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget(MainWindow, "patch_browser1")), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget(MainWindow, "patch_finder2")), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget(MainWindow, "GtkMenuItem_EnterDebugger")), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget(MainWindow, "iso_image1")), FALSE);
#ifndef PCSX2_DEVBUILD
/*gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget(MainWindow, "GtkMenuItem_Logging")), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lookup_widget(MainWindow, "GtkMenuItem_Arguments")), FALSE);*/
@ -385,16 +386,16 @@ void OnFile_BlockDump(GtkMenuItem *menuitem, gpointer user_data)
// Currently this OnRunElf function uses the CDVDplugin source. It's also valid to use the
// Iso and NoDisc sources when running ELF files, although those need new menu commands and
// are outside the scope of my GTK capabilities. ;) -- air
static CDVD_SourceType source = CDVDsrc_NoDisc;
void OnRunElf_Ok(GtkButton* button, gpointer user_data)
{
gchar *File;
File = (gchar*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
strcpy(g_Startup.ElfFile, File);
g_Startup.ElfFile = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSel));
gtk_widget_destroy(FileSel);
SysReset();
CDVDsys_ChangeSource( CDVDsrc_Plugin );
CDVDsys_ChangeSource( source );
OpenCDVD( NULL );
SysPrepareExecution(g_Startup.ElfFile);
}
@ -404,7 +405,7 @@ void OnRunElf_Cancel(GtkButton* button, gpointer user_data)
gtk_widget_destroy(FileSel);
}
void OnFile_LoadElf(GtkMenuItem *menuitem, gpointer user_data)
void OnFile_RunElf()
{
GtkWidget *Ok, *Cancel;
@ -422,6 +423,24 @@ void OnFile_LoadElf(GtkMenuItem *menuitem, gpointer user_data)
gdk_window_raise(FileSel->window);
}
void OnFile_RunElf_NoDisc(GtkMenuItem *menuitem, gpointer user_data)
{
source = CDVDsrc_NoDisc;
OnFile_RunElf();
}
void OnFile_RunElf_ISO(GtkMenuItem *menuitem, gpointer user_data)
{
source = CDVDsrc_Iso;
OnFile_RunElf();
}
void OnFile_RunElf_CD(GtkMenuItem *menuitem, gpointer user_data)
{
source = CDVDsrc_Plugin;
OnFile_RunElf();
}
void pcsx2_exit()
{
DIR *dir;

View File

@ -151,11 +151,31 @@ OnDelete (GtkWidget *widget,
gpointer user_data);
void
OnFile_RunCD (GtkMenuItem *menuitem,
OnFile_LoadElf (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_LoadElf (GtkMenuItem *menuitem,
OnFile_RunElf_ISO (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_RunElf_CD (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_RunElf_NoDisc (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_RunBIOS (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_RunIso (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_RunCD (GtkMenuItem *menuitem,
gpointer user_data);
void
@ -230,6 +250,10 @@ void
on_enable_patches1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
OnFile_BlockDump (GtkMenuItem *menuitem,
gpointer user_data);
void
OnPrintCdvdInfo (GtkMenuItem *menuitem,
gpointer user_data);
@ -265,15 +289,3 @@ 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);
void
OnFile_RunBIOS (GtkMenuItem *menuitem,
gpointer user_data);

View File

@ -2769,9 +2769,13 @@ create_MainWindow (void)
GtkWidget *GtkMenuItem_File;
GtkWidget *GtkMenuItem_File_menu;
GtkWidget *GtkMenuItem_LoadElf;
GtkWidget *GtkMenuItem_LoadElf_menu;
GtkWidget *iso_image1;
GtkWidget *cdvd_plugin1;
GtkWidget *no_disc1;
GtkWidget *run_bios__no_disc_1;
GtkWidget *run_iso1;
GtkWidget *run_cd1;
GtkWidget *run_bios__no_disc_1;
GtkWidget *separator2;
GtkWidget *states1;
GtkWidget *states1_menu;
@ -2859,11 +2863,35 @@ create_MainWindow (void)
gtk_widget_set_name (GtkMenuItem_File_menu, "GtkMenuItem_File_menu");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_File), GtkMenuItem_File_menu);
GtkMenuItem_LoadElf = gtk_menu_item_new_with_mnemonic (_("_Open ELF File.."));
GtkMenuItem_LoadElf = gtk_menu_item_new_with_mnemonic (_("_Run ELF File.."));
gtk_widget_set_name (GtkMenuItem_LoadElf, "GtkMenuItem_LoadElf");
gtk_widget_show (GtkMenuItem_LoadElf);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), GtkMenuItem_LoadElf);
GtkMenuItem_LoadElf_menu = gtk_menu_new ();
gtk_widget_set_name (GtkMenuItem_LoadElf_menu, "GtkMenuItem_LoadElf_menu");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (GtkMenuItem_LoadElf), GtkMenuItem_LoadElf_menu);
iso_image1 = gtk_menu_item_new_with_mnemonic (_("Iso Image..."));
gtk_widget_set_name (iso_image1, "iso_image1");
gtk_widget_show (iso_image1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_LoadElf_menu), iso_image1);
cdvd_plugin1 = gtk_menu_item_new_with_mnemonic (_("CDVD Plugin"));
gtk_widget_set_name (cdvd_plugin1, "cdvd_plugin1");
gtk_widget_show (cdvd_plugin1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_LoadElf_menu), cdvd_plugin1);
no_disc1 = gtk_menu_item_new_with_mnemonic (_("No Disc"));
gtk_widget_set_name (no_disc1, "no_disc1");
gtk_widget_show (no_disc1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_LoadElf_menu), no_disc1);
run_bios__no_disc_1 = gtk_menu_item_new_with_mnemonic (_("_Run Bios (No Disc)"));
gtk_widget_set_name (run_bios__no_disc_1, "run_bios__no_disc_1");
gtk_widget_show (run_bios__no_disc_1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_bios__no_disc_1);
run_iso1 = gtk_menu_item_new_with_mnemonic (_("_Run Iso Image..."));
gtk_widget_set_name (run_iso1, "run_iso1");
gtk_widget_show (run_iso1);
@ -2874,11 +2902,6 @@ create_MainWindow (void)
gtk_widget_show (run_cd1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_cd1);
run_bios__no_disc_1 = gtk_menu_item_new_with_mnemonic (_("_Run Bios (No Disc)"));
gtk_widget_set_name (run_bios__no_disc_1, "run_bios__no_disc_1");
gtk_widget_show (run_bios__no_disc_1);
gtk_container_add (GTK_CONTAINER (GtkMenuItem_File_menu), run_bios__no_disc_1);
separator2 = gtk_separator_menu_item_new ();
gtk_widget_set_name (separator2, "separator2");
gtk_widget_show (separator2);
@ -3192,8 +3215,17 @@ create_MainWindow (void)
g_signal_connect ((gpointer) MainWindow, "delete_event",
G_CALLBACK (OnDelete),
NULL);
g_signal_connect ((gpointer) GtkMenuItem_LoadElf, "activate",
G_CALLBACK (OnFile_LoadElf),
g_signal_connect ((gpointer) iso_image1, "activate",
G_CALLBACK (OnFile_RunElf_ISO),
NULL);
g_signal_connect ((gpointer) cdvd_plugin1, "activate",
G_CALLBACK (OnFile_RunElf_CD),
NULL);
g_signal_connect ((gpointer) no_disc1, "activate",
G_CALLBACK (OnFile_RunElf_NoDisc),
NULL);
g_signal_connect ((gpointer) run_bios__no_disc_1, "activate",
G_CALLBACK (OnFile_RunBIOS),
NULL);
g_signal_connect ((gpointer) run_iso1, "activate",
G_CALLBACK (OnFile_RunIso),
@ -3201,9 +3233,6 @@ create_MainWindow (void)
g_signal_connect ((gpointer) run_cd1, "activate",
G_CALLBACK (OnFile_RunCD),
NULL);
g_signal_connect ((gpointer) run_bios__no_disc_1, "activate",
G_CALLBACK (OnFile_RunBIOS),
NULL);
g_signal_connect ((gpointer) load_slot_0, "activate",
G_CALLBACK (OnStates_Load),
NULL);
@ -3326,9 +3355,13 @@ 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, GtkMenuItem_LoadElf, "GtkMenuItem_LoadElf");
GLADE_HOOKUP_OBJECT (MainWindow, GtkMenuItem_LoadElf_menu, "GtkMenuItem_LoadElf_menu");
GLADE_HOOKUP_OBJECT (MainWindow, iso_image1, "iso_image1");
GLADE_HOOKUP_OBJECT (MainWindow, cdvd_plugin1, "cdvd_plugin1");
GLADE_HOOKUP_OBJECT (MainWindow, no_disc1, "no_disc1");
GLADE_HOOKUP_OBJECT (MainWindow, run_bios__no_disc_1, "run_bios__no_disc_1");
GLADE_HOOKUP_OBJECT (MainWindow, run_iso1, "run_iso1");
GLADE_HOOKUP_OBJECT (MainWindow, run_cd1, "run_cd1");
GLADE_HOOKUP_OBJECT (MainWindow, run_bios__no_disc_1, "run_bios__no_disc_1");
GLADE_HOOKUP_OBJECT (MainWindow, separator2, "separator2");
GLADE_HOOKUP_OBJECT (MainWindow, states1, "states1");
GLADE_HOOKUP_OBJECT (MainWindow, states1_menu, "states1_menu");

View File

@ -4883,9 +4883,49 @@ Version x.x</property>
<child>
<widget class="GtkMenuItem" id="GtkMenuItem_LoadElf">
<property name="visible">True</property>
<property name="label" translatable="yes">_Open ELF File..</property>
<property name="label" translatable="yes">_Run ELF File..</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_LoadElf"/>
<child>
<widget class="GtkMenu" id="GtkMenuItem_LoadElf_menu">
<child>
<widget class="GtkMenuItem" id="iso_image1">
<property name="visible">True</property>
<property name="label" translatable="yes">Iso Image...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_RunElf_ISO" last_modification_time="Thu, 27 Aug 2009 09:17:37 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="cdvd_plugin1">
<property name="visible">True</property>
<property name="label" translatable="yes">CDVD Plugin</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_RunElf_CD" last_modification_time="Thu, 27 Aug 2009 09:17:25 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="no_disc1">
<property name="visible">True</property>
<property name="label" translatable="yes">No Disc</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_RunElf_NoDisc" last_modification_time="Thu, 27 Aug 2009 09:17:12 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="run_bios_(no_disc)1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Run Bios (No Disc)</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_RunBIOS" last_modification_time="Wed, 15 Jul 2009 06:35:22 GMT"/>
</widget>
</child>
@ -4907,15 +4947,6 @@ Version x.x</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="run_bios_(no_disc)1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Run Bios (No Disc)</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnFile_RunBIOS" last_modification_time="Wed, 15 Jul 2009 06:35:22 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator2">
<property name="visible">True</property>

View File

@ -8,6 +8,7 @@
// Microsoft specific STL extensions for bounds checking and stuff: Enabled in devbuilds,
// disabled in release builds. :)
#if defined(_MSC_VER)
#if _MSC_VER < 1600
# pragma warning(disable:4244) // disable warning C4244: '=' : conversion from 'big' to 'small', possible loss of data
# ifdef PCSX2_DEVBUILD
@ -17,6 +18,7 @@
# define _SECURE_SCL 0
# endif
#endif
#endif
#define NOMINMAX // Disables other libs inclusion of their own min/max macros (we use std instead)