GTK: fixed bug where palettes wouldn't open via GTK
GTK: code cleanup and compile warning silencing
This commit is contained in:
parent
a875e87a3f
commit
a0924098ad
|
@ -39,7 +39,11 @@ LoadCPalette(const std::string &file)
|
||||||
printf(" Error loading custom palette from file: %s\n", file.c_str());
|
printf(" Error loading custom palette from file: %s\n", file.c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
fread(tmpp, 1, 192, fp);
|
size_t result = fread(tmpp, 1, 192, fp);
|
||||||
|
if(result != 192) {
|
||||||
|
printf(" Error reading custom palette from file: %s\n", file.c_str());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
FCEUI_SetPaletteArray(tmpp);
|
FCEUI_SetPaletteArray(tmpp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -143,7 +143,7 @@ void loadPalette (GtkWidget* w, gpointer p)
|
||||||
|
|
||||||
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
|
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
|
||||||
g_config->setOption("SDL.Palette", filename);
|
g_config->setOption("SDL.Palette", filename);
|
||||||
if(LoadCPalette(filename))
|
if(LoadCPalette(filename) == 0)
|
||||||
{
|
{
|
||||||
GtkWidget* msgbox;
|
GtkWidget* msgbox;
|
||||||
msgbox = gtk_message_dialog_new(GTK_WINDOW(MainWindow), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
|
msgbox = gtk_message_dialog_new(GTK_WINDOW(MainWindow), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
|
||||||
|
@ -261,6 +261,7 @@ void openPaletteConfig()
|
||||||
GtkWidget* ipEntry;
|
GtkWidget* ipEntry;
|
||||||
GtkWidget* portSpin;
|
GtkWidget* portSpin;
|
||||||
GtkWidget* pwEntry;
|
GtkWidget* pwEntry;
|
||||||
|
|
||||||
void launchNet(GtkWidget* w, gpointer p)
|
void launchNet(GtkWidget* w, gpointer p)
|
||||||
{
|
{
|
||||||
char* ip = (char*)gtk_entry_get_text(GTK_ENTRY(ipEntry));
|
char* ip = (char*)gtk_entry_get_text(GTK_ENTRY(ipEntry));
|
||||||
|
@ -374,7 +375,7 @@ void openNetworkConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
// creates and opens hotkey config window
|
// creates and opens hotkey config window
|
||||||
void openHotkeyConfig()
|
/*void openHotkeyConfig()
|
||||||
{
|
{
|
||||||
std::string prefix = "SDL.Hotkeys.";
|
std::string prefix = "SDL.Hotkeys.";
|
||||||
GtkWidget* win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
GtkWidget* win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
@ -408,7 +409,7 @@ void openHotkeyConfig()
|
||||||
|
|
||||||
gtk_container_add(GTK_CONTAINER(win),tree);
|
gtk_container_add(GTK_CONTAINER(win),tree);
|
||||||
gtk_widget_show_all(win);
|
gtk_widget_show_all(win);
|
||||||
}
|
}*/
|
||||||
GtkWidget* typeCombo;
|
GtkWidget* typeCombo;
|
||||||
|
|
||||||
// TODO: finish this
|
// TODO: finish this
|
||||||
|
@ -416,7 +417,7 @@ int setInputDevice(GtkWidget* w, gpointer p)
|
||||||
{
|
{
|
||||||
std::string s = "SDL.Input.";
|
std::string s = "SDL.Input.";
|
||||||
s = s + (char*)p;
|
s = s + (char*)p;
|
||||||
printf("%s", s);
|
printf("%s", s.c_str());
|
||||||
g_config->setOption(s, gtk_combo_box_get_active_text(GTK_COMBO_BOX(typeCombo)));
|
g_config->setOption(s, gtk_combo_box_get_active_text(GTK_COMBO_BOX(typeCombo)));
|
||||||
g_config->save();
|
g_config->save();
|
||||||
|
|
||||||
|
@ -990,8 +991,6 @@ void recordMovieAs ()
|
||||||
fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
|
fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (fileChooser));
|
||||||
if (!fname.size())
|
if (!fname.size())
|
||||||
return; // no filename selected, quit the whole thing
|
return; // no filename selected, quit the whole thing
|
||||||
// TODO: don't use GetUserText; or implement it in GTK rather than zenity
|
|
||||||
GtkWidget* ad = gtk_input_dialog_new();
|
|
||||||
|
|
||||||
std::string s = GetUserText("Author name");
|
std::string s = GetUserText("Author name");
|
||||||
std::wstring author(s.begin(), s.end());
|
std::wstring author(s.begin(), s.end());
|
||||||
|
|
Loading…
Reference in New Issue