Merge pull request #475 into sdl2 from CelticMinstrel:quit-confirm2

This commit is contained in:
Andreas Löf 2015-09-11 18:55:11 +12:00
commit 22cff55dc8
22 changed files with 158 additions and 92 deletions

View file

@ -347,12 +347,14 @@
key=5
[/hotkey]
#ifndef APPLE
[hotkey]
command="editor-quit-to-desktop"
command="quit-to-desktop"
key="q"
shift=yes
{IF_APPLE_CMD_ELSE_CTRL}
ctrl=yes
[/hotkey]
#endif
[hotkey]
command="editor-partial-undo"

View file

@ -105,7 +105,7 @@
id=menu-main
title= _ "Menu"
image=classic/lite
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit,quit-to-desktop
ref=top-panel
rect="=+3,=+1,+100,=-4"
xanchor=fixed

View file

@ -79,7 +79,7 @@
id=menu-main
title= _ "Menu"
image=button_menu/menu_button_copper_H20
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,menu-autosaves,help,stopnetwork,startnetwork,quit
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,menu-autosaves,help,stopnetwork,startnetwork,quit,quit-to-desktop
ref=top-panel
rect="=+3,=+1,+100,=-4"
xanchor=fixed

View file

@ -61,7 +61,7 @@
title= _ "File"
type=turbo
font_size=9
items=editor-scenario-edit,statustable,unitlist,editor-map-new,editor-scenario-new,editor-map-load,editor-map-revert,editor-map-save,editor-map-save-as,editor-scenario-save-as,editor-map-save-all,preferences,help,editor-close-map,quit,editor-quit-to-desktop
items=editor-scenario-edit,statustable,unitlist,editor-map-new,editor-scenario-new,editor-map-load,editor-map-revert,editor-map-save,editor-map-save-as,editor-scenario-save-as,editor-map-save-all,preferences,help,editor-close-map,quit,quit-to-desktop
ref=top-panel
rect="=+1,=+1,+100,+20"
xanchor=fixed

View file

@ -106,7 +106,7 @@
id=menu-main
title= _ "Menu"
image=button_menu/menu_button_copper_H20
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit,quit-to-desktop
ref=top-panel
rect="=+3,=+1,+100,=-4"
xanchor=fixed

View file

@ -136,7 +136,7 @@
id=menu-main
title= _ "Menu"
image=button_menu/menu_button_copper_H20
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit
items=objectives,statistics,unitlist,statustable,save,savereplay,savemap,load,preferences,chatlog,AUTOSAVES,help,stopnetwork,startnetwork,quit,quit-to-desktop
ref=top-panel
rect="=+3,=+1,+100,=-4"
xanchor=fixed

View file

@ -7,6 +7,9 @@
#import "SDL.h"
#import "SDLMain.h"
#if SDL_VERSION_ATLEAST(2, 0, 0)
extern int wesnoth_main(int argc, char **argv);
#endif
static int gArgc;
static char **gArgv;
@ -73,7 +76,11 @@ static char **gArgv;
//setenv("PYTHONHOME", ".", 1); //not needed because we don't use Python anymore
/* Hand off to main application code */
#if SDL_VERSION_ATLEAST(2, 0, 0)
status = wesnoth_main (gArgc, gArgv);
#else
status = SDL_main (gArgc, gArgv);
#endif
/* We're done, thank you for playing */
exit(status);

View file

@ -17,11 +17,11 @@
#ifdef main
# undef main
#endif
int SDL_main (int argc, char **argv);
extern int SDL_main (int argc, char **argv);
int main (int argc, char **argv)
{
return SDL_main(argc, argv);
}
}
#endif

View file

@ -75,6 +75,8 @@
62D24F351519995200350848 /* palette_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62D24F341519995200350848 /* palette_manager.cpp */; };
62E48250154D865E001DD4FC /* pane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62E4824E154D865E001DD4FC /* pane.cpp */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
911F2DAD1BA086A400E3102E /* window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 911F2DAB1BA086A400E3102E /* window.cpp */; };
911F2DB01BA086FA00E3102E /* alpha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 911F2DAE1BA086F900E3102E /* alpha.cpp */; };
91B6217C1B74E6D200B00E0F /* label_settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B6217A1B74E6D100B00E0F /* label_settings.cpp */; };
91B6219F1B7673D800B00E0F /* portrait.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B6219E1B7673D800B00E0F /* portrait.cpp */; };
91B621A21B76A3CC00B00E0F /* build_info.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B621A11B76A3CC00B00E0F /* build_info.cpp */; };
@ -149,7 +151,7 @@
B513B1E70ED345EB0006E551 /* pango.modules in Resources */ = {isa = PBXBuildFile; fileRef = B513B1C80ED345EA0006E551 /* pango.modules */; };
B513B21E0ED346090006E551 /* pango in Resources */ = {isa = PBXBuildFile; fileRef = B513B2000ED346090006E551 /* pango */; };
B513B2290ED36BFB0006E551 /* libcairo.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B513B2270ED36BFB0006E551 /* libcairo.2.dylib */; };
B513B2790ED372210006E551 /* SDL_ttf.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5599E9B0EC68BF2008DD061 /* SDL_ttf.framework */; };
B513B2790ED372210006E551 /* SDL2_ttf.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B5599E9B0EC68BF2008DD061 /* SDL2_ttf.framework */; };
B514C70B0F5450CC00E273F0 /* addon_list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B514C7090F5450CC00E273F0 /* addon_list.cpp */; };
B52EE8841213585300CFBDAB /* tod_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B52EE8821213585300CFBDAB /* tod_manager.cpp */; };
B52EE8851213585300CFBDAB /* tod_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B52EE8821213585300CFBDAB /* tod_manager.cpp */; };
@ -290,10 +292,10 @@
B553B6BA12189C5900CC8C58 /* utility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B553B6B812189C5900CC8C58 /* utility.cpp */; };
B553B6BB12189C5900CC8C58 /* utility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B553B6B812189C5900CC8C58 /* utility.cpp */; };
B559986C0EC616B3008DD061 /* SDLMain.m in Sources */ = {isa = PBXBuildFile; fileRef = B559986B0EC616B3008DD061 /* SDLMain.m */; settings = {COMPILER_FLAGS = "-w"; }; };
B55998F80EC61EA5008DD061 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL.framework */; };
B55999250EC61F59008DD061 /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999220EC61F59008DD061 /* SDL_image.framework */; };
B55999260EC61F59008DD061 /* SDL_net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL_net.framework */; };
B55999270EC61F59008DD061 /* SDL_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999240EC61F59008DD061 /* SDL_mixer.framework */; };
B55998F80EC61EA5008DD061 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL2.framework */; };
B55999250EC61F59008DD061 /* SDL2_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999220EC61F59008DD061 /* SDL2_image.framework */; };
B55999260EC61F59008DD061 /* SDL2_net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL2_net.framework */; };
B55999270EC61F59008DD061 /* SDL2_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999240EC61F59008DD061 /* SDL2_mixer.framework */; };
B5599AD30EC62181008DD061 /* wml_exception.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55999430EC62181008DD061 /* wml_exception.cpp */; };
B5599AD40EC62181008DD061 /* button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55999450EC62181008DD061 /* button.cpp */; };
B5599AD50EC62181008DD061 /* combo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55999470EC62181008DD061 /* combo.cpp */; };
@ -397,11 +399,11 @@
B5599B8B0EC62181008DD061 /* about.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599AC60EC62181008DD061 /* about.cpp */; };
B5599B8E0EC62181008DD061 /* attack_prediction_display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599ACA0EC62181008DD061 /* attack_prediction_display.cpp */; };
B5599B910EC62181008DD061 /* attack_prediction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599AD00EC62181008DD061 /* attack_prediction.cpp */; };
B5599E8B0EC64CF2008DD061 /* SDL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL.framework */; };
B5599E8C0EC64CF2008DD061 /* SDL_image.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55999220EC61F59008DD061 /* SDL_image.framework */; };
B5599E8D0EC64CF2008DD061 /* SDL_net.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL_net.framework */; };
B5599E8E0EC64CF2008DD061 /* SDL_mixer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55999240EC61F59008DD061 /* SDL_mixer.framework */; };
B5599E9C0EC68BF2008DD061 /* SDL_ttf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5599E9B0EC68BF2008DD061 /* SDL_ttf.framework */; };
B5599E8B0EC64CF2008DD061 /* SDL2.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL2.framework */; };
B5599E8C0EC64CF2008DD061 /* SDL2_image.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55999220EC61F59008DD061 /* SDL2_image.framework */; };
B5599E8D0EC64CF2008DD061 /* SDL2_net.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL2_net.framework */; };
B5599E8E0EC64CF2008DD061 /* SDL2_mixer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B55999240EC61F59008DD061 /* SDL2_mixer.framework */; };
B5599E9C0EC68BF2008DD061 /* SDL2_ttf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5599E9B0EC68BF2008DD061 /* SDL2_ttf.framework */; };
B5599FCB0EC8FBCB008DD061 /* libfreetype.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B5599FC90EC8FBCB008DD061 /* libfreetype.6.dylib */; };
B559A0140EC8FE2E008DD061 /* editor_display.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599FFF0EC8FE2E008DD061 /* editor_display.cpp */; };
B559A0160EC8FE2E008DD061 /* editor_main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B559A0030EC8FE2E008DD061 /* editor_main.cpp */; };
@ -469,11 +471,11 @@
B597C51D0FACD56200CE81F5 /* libcairo.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B513B2270ED36BFB0006E551 /* libcairo.2.dylib */; };
B597C51E0FACD56600CE81F5 /* libpixman-1.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B513B2280ED36BFB0006E551 /* libpixman-1.0.dylib */; };
B597C51F0FACD56A00CE81F5 /* libfreetype.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = B5599FC90EC8FBCB008DD061 /* libfreetype.6.dylib */; };
B597C5260FACD58400CE81F5 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL.framework */; };
B597C5270FACD58400CE81F5 /* SDL_ttf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5599E9B0EC68BF2008DD061 /* SDL_ttf.framework */; };
B597C5280FACD58400CE81F5 /* SDL_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999220EC61F59008DD061 /* SDL_image.framework */; };
B597C5290FACD58400CE81F5 /* SDL_net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL_net.framework */; };
B597C52A0FACD58400CE81F5 /* SDL_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999240EC61F59008DD061 /* SDL_mixer.framework */; };
B597C5260FACD58400CE81F5 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL2.framework */; };
B597C5270FACD58400CE81F5 /* SDL2_ttf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5599E9B0EC68BF2008DD061 /* SDL2_ttf.framework */; };
B597C5280FACD58400CE81F5 /* SDL2_image.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999220EC61F59008DD061 /* SDL2_image.framework */; };
B597C5290FACD58400CE81F5 /* SDL2_net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL2_net.framework */; };
B597C52A0FACD58400CE81F5 /* SDL2_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999240EC61F59008DD061 /* SDL2_mixer.framework */; };
B597C5310FACD6CA00CE81F5 /* callable_objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599AB00EC62181008DD061 /* callable_objects.cpp */; };
B597C5330FACD6CA00CE81F5 /* generator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5795A670F05858100EB190E /* generator.cpp */; };
B597C5340FACD6CA00CE81F5 /* cursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599A9D0EC62181008DD061 /* cursor.cpp */; };
@ -722,8 +724,8 @@
B5BB6B8B0F893E7500444FBF /* ban.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5BB6B7C0F893E7500444FBF /* ban.cpp */; };
B5BB6B8D0F893F2300444FBF /* config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599AA80EC62181008DD061 /* config.cpp */; };
B5BB6BC60F89406100444FBF /* network.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55999DA0EC62181008DD061 /* network.cpp */; };
B5BB6BC80F89407D00444FBF /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL.framework */; };
B5BB6BCB0F89408500444FBF /* SDL_net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL_net.framework */; };
B5BB6BC80F89407D00444FBF /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55998F70EC61EA5008DD061 /* SDL2.framework */; };
B5BB6BCB0F89408500444FBF /* SDL2_net.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B55999230EC61F59008DD061 /* SDL2_net.framework */; };
B5BB6BCD0F8940A000444FBF /* network_worker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55999D60EC62181008DD061 /* network_worker.cpp */; };
B5BB6C670F8940FF00444FBF /* thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B559998B0EC62181008DD061 /* thread.cpp */; };
B5BB6C6F0F8941CD00444FBF /* game_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5599A800EC62181008DD061 /* game_config.cpp */; };
@ -1087,11 +1089,11 @@
91B6221A1B76C0A600B00E0F /* libpixman-1.0.dylib in CopyFiles */,
91B6221B1B76C0A600B00E0F /* libpng16.16.dylib in CopyFiles */,
91B6221C1B76C0A600B00E0F /* libz.1.dylib in CopyFiles */,
B5599E8C0EC64CF2008DD061 /* SDL_image.framework in CopyFiles */,
B5599E8E0EC64CF2008DD061 /* SDL_mixer.framework in CopyFiles */,
B5599E8D0EC64CF2008DD061 /* SDL_net.framework in CopyFiles */,
B513B2790ED372210006E551 /* SDL_ttf.framework in CopyFiles */,
B5599E8B0EC64CF2008DD061 /* SDL.framework in CopyFiles */,
B5599E8C0EC64CF2008DD061 /* SDL2_image.framework in CopyFiles */,
B5599E8E0EC64CF2008DD061 /* SDL2_mixer.framework in CopyFiles */,
B5599E8D0EC64CF2008DD061 /* SDL2_net.framework in CopyFiles */,
B513B2790ED372210006E551 /* SDL2_ttf.framework in CopyFiles */,
B5599E8B0EC64CF2008DD061 /* SDL2.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1245,6 +1247,11 @@
62E4824F154D865E001DD4FC /* pane.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pane.hpp; sourceTree = "<group>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* Wesnoth.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wesnoth.app; sourceTree = BUILT_PRODUCTS_DIR; };
911F2DAB1BA086A400E3102E /* window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = window.cpp; sourceTree = "<group>"; };
911F2DAC1BA086A400E3102E /* window.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = window.hpp; sourceTree = "<group>"; };
911F2DAE1BA086F900E3102E /* alpha.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alpha.cpp; sourceTree = "<group>"; };
911F2DAF1BA086FA00E3102E /* alpha.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = alpha.hpp; sourceTree = "<group>"; };
911F2DB11BA0870E00E3102E /* compat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = compat.hpp; sourceTree = "<group>"; };
91B6217A1B74E6D100B00E0F /* label_settings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = label_settings.cpp; sourceTree = "<group>"; };
91B6217B1B74E6D100B00E0F /* label_settings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = label_settings.hpp; sourceTree = "<group>"; };
91B621801B766ED500B00E0F /* buffered_istream.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = buffered_istream.hpp; sourceTree = "<group>"; };
@ -1546,10 +1553,10 @@
B553B6B912189C5900CC8C58 /* utility.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utility.hpp; sourceTree = "<group>"; };
B559986A0EC616B3008DD061 /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDLMain.h; path = "Mac Sources/SDLMain.h"; sourceTree = "<group>"; };
B559986B0EC616B3008DD061 /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLMain.m; path = "Mac Sources/SDLMain.m"; sourceTree = "<group>"; };
B55998F70EC61EA5008DD061 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = lib/SDL.framework; sourceTree = "<group>"; };
B55999220EC61F59008DD061 /* SDL_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_image.framework; path = lib/SDL_image.framework; sourceTree = "<group>"; };
B55999230EC61F59008DD061 /* SDL_net.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_net.framework; path = lib/SDL_net.framework; sourceTree = "<group>"; };
B55999240EC61F59008DD061 /* SDL_mixer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_mixer.framework; path = lib/SDL_mixer.framework; sourceTree = "<group>"; };
B55998F70EC61EA5008DD061 /* SDL2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2.framework; path = lib/SDL2.framework; sourceTree = "<group>"; };
B55999220EC61F59008DD061 /* SDL2_image.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2_image.framework; path = lib/SDL2_image.framework; sourceTree = "<group>"; };
B55999230EC61F59008DD061 /* SDL2_net.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2_net.framework; path = lib/SDL2_net.framework; sourceTree = "<group>"; };
B55999240EC61F59008DD061 /* SDL2_mixer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2_mixer.framework; path = lib/SDL2_mixer.framework; sourceTree = "<group>"; };
B55999410EC62181008DD061 /* wml_separators.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = wml_separators.hpp; path = ../src/wml_separators.hpp; sourceTree = "<group>"; };
B55999420EC62181008DD061 /* wml_exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = wml_exception.hpp; path = ../src/wml_exception.hpp; sourceTree = "<group>"; };
B55999430EC62181008DD061 /* wml_exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wml_exception.cpp; path = ../src/wml_exception.cpp; sourceTree = "<group>"; };
@ -1771,7 +1778,7 @@
B5599ACA0EC62181008DD061 /* attack_prediction_display.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = attack_prediction_display.cpp; path = ../src/attack_prediction_display.cpp; sourceTree = "<group>"; };
B5599ACB0EC62181008DD061 /* attack_prediction.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = attack_prediction.hpp; path = ../src/attack_prediction.hpp; sourceTree = "<group>"; };
B5599AD00EC62181008DD061 /* attack_prediction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = attack_prediction.cpp; path = ../src/attack_prediction.cpp; sourceTree = "<group>"; };
B5599E9B0EC68BF2008DD061 /* SDL_ttf.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL_ttf.framework; path = lib/SDL_ttf.framework; sourceTree = "<group>"; };
B5599E9B0EC68BF2008DD061 /* SDL2_ttf.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL2_ttf.framework; path = lib/SDL2_ttf.framework; sourceTree = "<group>"; };
B5599FC90EC8FBCB008DD061 /* libfreetype.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfreetype.6.dylib; path = lib/libfreetype.6.dylib; sourceTree = "<group>"; };
B5599FFC0EC8FE2E008DD061 /* editor_common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = editor_common.hpp; sourceTree = "<group>"; };
B5599FFF0EC8FE2E008DD061 /* editor_display.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = editor_display.cpp; sourceTree = "<group>"; };
@ -2457,11 +2464,11 @@
EC1D88DB18EF413100E66AC1 /* libpixman-1.0.dylib in Frameworks */,
EC5C244A18EF07B4001FA499 /* libpng16.16.dylib in Frameworks */,
EC5C245318EF07B4001FA499 /* libz.1.dylib in Frameworks */,
B55999250EC61F59008DD061 /* SDL_image.framework in Frameworks */,
B55999270EC61F59008DD061 /* SDL_mixer.framework in Frameworks */,
B55999260EC61F59008DD061 /* SDL_net.framework in Frameworks */,
B5599E9C0EC68BF2008DD061 /* SDL_ttf.framework in Frameworks */,
B55998F80EC61EA5008DD061 /* SDL.framework in Frameworks */,
B55999250EC61F59008DD061 /* SDL2_image.framework in Frameworks */,
B55999270EC61F59008DD061 /* SDL2_mixer.framework in Frameworks */,
B55999260EC61F59008DD061 /* SDL2_net.framework in Frameworks */,
B5599E9C0EC68BF2008DD061 /* SDL2_ttf.framework in Frameworks */,
B55998F80EC61EA5008DD061 /* SDL2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2473,11 +2480,11 @@
B597C51D0FACD56200CE81F5 /* libcairo.2.dylib in Frameworks */,
B597C51F0FACD56A00CE81F5 /* libfreetype.6.dylib in Frameworks */,
B597C51E0FACD56600CE81F5 /* libpixman-1.0.dylib in Frameworks */,
B597C5280FACD58400CE81F5 /* SDL_image.framework in Frameworks */,
B597C52A0FACD58400CE81F5 /* SDL_mixer.framework in Frameworks */,
B597C5290FACD58400CE81F5 /* SDL_net.framework in Frameworks */,
B597C5270FACD58400CE81F5 /* SDL_ttf.framework in Frameworks */,
B597C5260FACD58400CE81F5 /* SDL.framework in Frameworks */,
B597C5280FACD58400CE81F5 /* SDL2_image.framework in Frameworks */,
B597C52A0FACD58400CE81F5 /* SDL2_mixer.framework in Frameworks */,
B597C5290FACD58400CE81F5 /* SDL2_net.framework in Frameworks */,
B597C5270FACD58400CE81F5 /* SDL2_ttf.framework in Frameworks */,
B597C5260FACD58400CE81F5 /* SDL2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2492,8 +2499,8 @@
EC64D7681A085F4A0092EF75 /* libboost_randomw.dylib in Frameworks */,
ECF9D44219F4050E00E6C9D9 /* libboost_systemw.dylib in Frameworks */,
EC225C9718EF0ABC00025EC4 /* libintl.8.dylib in Frameworks */,
B5BB6BCB0F89408500444FBF /* SDL_net.framework in Frameworks */,
B5BB6BC80F89407D00444FBF /* SDL.framework in Frameworks */,
B5BB6BCB0F89408500444FBF /* SDL2_net.framework in Frameworks */,
B5BB6BC80F89407D00444FBF /* SDL2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2526,11 +2533,11 @@
isa = PBXGroup;
children = (
B508D13E10013BF900B12852 /* Growl.framework */,
B55999220EC61F59008DD061 /* SDL_image.framework */,
B55999240EC61F59008DD061 /* SDL_mixer.framework */,
B55999230EC61F59008DD061 /* SDL_net.framework */,
B5599E9B0EC68BF2008DD061 /* SDL_ttf.framework */,
B55998F70EC61EA5008DD061 /* SDL.framework */,
B55999220EC61F59008DD061 /* SDL2_image.framework */,
B55999240EC61F59008DD061 /* SDL2_mixer.framework */,
B55999230EC61F59008DD061 /* SDL2_net.framework */,
B5599E9B0EC68BF2008DD061 /* SDL2_ttf.framework */,
B55998F70EC61EA5008DD061 /* SDL2.framework */,
);
name = "Included Frameworks";
sourceTree = "<group>";
@ -3252,6 +3259,9 @@
91B621A61B76A7CD00B00E0F /* sdl */ = {
isa = PBXGroup;
children = (
911F2DAE1BA086F900E3102E /* alpha.cpp */,
911F2DAF1BA086FA00E3102E /* alpha.hpp */,
911F2DB11BA0870E00E3102E /* compat.hpp */,
EC84246F18F30DB700FC1EEF /* exception.cpp */,
EC84247018F30DB700FC1EEF /* exception.hpp */,
ECFB9FAB193BFB6E00146ED0 /* rect.cpp */,
@ -3260,6 +3270,8 @@
EC2F60231A04985A0018C9D6 /* savepng.h */,
EC28C58D19423426003B0F5E /* utils.cpp */,
EC28C58E19423426003B0F5E /* utils.hpp */,
911F2DAB1BA086A400E3102E /* window.cpp */,
911F2DAC1BA086A400E3102E /* window.hpp */,
);
path = sdl;
sourceTree = "<group>";
@ -5000,6 +5012,8 @@
91B621BA1B76B2C900B00E0F /* version.cpp in Sources */,
91ECD5D21BA11A5200B25CF1 /* unit_creator.cpp in Sources */,
91ECD5D51BA11A6400B25CF1 /* mp_replay_controller.cpp in Sources */,
911F2DAD1BA086A400E3102E /* window.cpp in Sources */,
911F2DB01BA086FA00E3102E /* alpha.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -5607,11 +5621,11 @@
./Headers/lua_5.1.4,
"./Headers/glib-2.0",
./Headers/cairo,
./lib/SDL.framework/Headers,
./lib/SDL_ttf.framework/Headers,
./lib/SDL_image.framework/Headers,
./lib/SDL_mixer.framework/Headers,
./lib/SDL_net.framework/Headers,
./lib/SDL2.framework/Headers,
./lib/SDL2_ttf.framework/Headers,
./lib/SDL2_image.framework/Headers,
./lib/SDL2_mixer.framework/Headers,
./lib/SDL2_net.framework/Headers,
);
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
LIBRARY_SEARCH_PATHS = ./lib;
@ -5653,11 +5667,11 @@
./Headers/lua_5.1.4,
"./Headers/glib-2.0",
./Headers/cairo,
./lib/SDL.framework/Headers,
./lib/SDL_ttf.framework/Headers,
./lib/SDL_image.framework/Headers,
./lib/SDL_mixer.framework/Headers,
./lib/SDL_net.framework/Headers,
./lib/SDL2.framework/Headers,
./lib/SDL2_ttf.framework/Headers,
./lib/SDL2_image.framework/Headers,
./lib/SDL2_mixer.framework/Headers,
./lib/SDL2_net.framework/Headers,
);
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
LIBRARY_SEARCH_PATHS = ./lib;

View file

@ -49,12 +49,18 @@ void controller_base::handle_event(const SDL_Event& event)
if(gui::in_dialog()) {
return;
}
static const hotkey::hotkey_command& quit_hotkey = hotkey::hotkey_command::get_command_by_command(hotkey::HOTKEY_QUIT_GAME);
switch(event.type) {
case SDL_KEYDOWN:
// Detect key press events, unless there something that has keyboard focus
// in which case the key press events should go only to it.
if(have_keyboard_focus()) {
if(event.key.keysym.sym == SDLK_ESCAPE) {
hotkey::execute_command(get_display(), quit_hotkey, get_hotkey_command_executor());
break;
}
process_keydown_event(event);
hotkey::key_event(get_display(), event, get_hotkey_command_executor());
} else {

View file

@ -108,7 +108,7 @@ protected:
/**
* Process mouse- and keypress-events from SDL.
* Not virtual but calls various virtual function to allow specialized
* Calls various virtual function to allow specialized
* behavior of derived classes.
*/
void handle_event(const SDL_Event& event);

View file

@ -323,7 +323,7 @@ bool editor_controller::can_execute_command(const hotkey::hotkey_command& cmd, i
case HOTKEY_EDITOR_PARTIAL_UNDO:
return context_manager_->get_map_context().can_undo();
case TITLE_SCREEN__RELOAD_WML:
case HOTKEY_EDITOR_QUIT_TO_DESKTOP:
case HOTKEY_QUIT_TO_DESKTOP:
case HOTKEY_EDITOR_CUSTOM_TODS:
case HOTKEY_EDITOR_MAP_NEW:
case HOTKEY_EDITOR_SCENARIO_NEW:
@ -714,7 +714,7 @@ bool editor_controller::execute_command(const hotkey::hotkey_command& cmd, int i
case HOTKEY_QUIT_GAME:
quit_confirm(EXIT_NORMAL);
return true;
case HOTKEY_EDITOR_QUIT_TO_DESKTOP:
case HOTKEY_QUIT_TO_DESKTOP:
quit_confirm(EXIT_QUIT_TO_DESKTOP);
return true;
case TITLE_SCREEN__RELOAD_WML:

View file

@ -164,13 +164,11 @@ event_context::~event_context()
event_contexts.pop_back();
}
sdl_handler::sdl_handler(const bool auto_join)
#if SDL_VERSION_ATLEAST(2, 0, 0)
: unicode_(1)
#else
: unicode_(SDL_EnableUNICODE(1))
sdl_handler::sdl_handler(const bool auto_join) :
#if !SDL_VERSION_ATLEAST(2, 0, 0)
unicode_(SDL_EnableUNICODE(1)),
#endif
, has_joined_(false)
has_joined_(false)
{
#if !SDL_VERSION_ATLEAST(2, 0, 0)
@ -399,6 +397,16 @@ void pump()
}
break;
}
#ifndef __APPLE__
case SDL_KEYDOWN: {
if(event.key.keysym.sym == SDLK_F4 && (event.key.keysym.mod == KMOD_RALT || event.key.keysym.mod == KMOD_LALT)) {
quit_confirmation::quit();
continue; // this event is already handled
}
break;
}
#endif
#if defined(_X11) && !defined(__APPLE__)
case SDL_SYSWMEVENT: {

View file

@ -64,7 +64,9 @@ protected:
}
private:
#if !SDL_VERSION_ATLEAST(2, 0, 0)
int unicode_;
#endif
bool has_joined_;
};

View file

@ -267,7 +267,7 @@ void ttitle_screen::post_build(CVideo& video, twindow& window)
hotkey::TITLE_SCREEN__CREDITS,
boost::bind(&hotkey, boost::ref(window), SHOW_ABOUT));
window.register_hotkey(hotkey::HOTKEY_QUIT_GAME,
window.register_hotkey(hotkey::HOTKEY_QUIT_TO_DESKTOP,
boost::bind(&hotkey, boost::ref(window), QUIT_GAME));
window.register_hotkey(

View file

@ -517,17 +517,6 @@ void jhat_event(display& disp, const SDL_Event& event, command_executor* executo
void key_event(display& disp, const SDL_Event& event, command_executor* executor)
{
if (!executor) return;
if(event.key.keysym.sym == SDLK_ESCAPE && disp.in_game()) {
LOG_G << "escape pressed..showing quit\n";
const int res = gui2::show_message(disp.video(), _("Quit"),
_("Do you really want to quit?"), gui2::tmessage::yes_no_buttons);
if(res != gui2::twindow::CANCEL) {
throw_quit_game_exception();
} else {
return;
}
}
event_execute(disp, event,executor);
}
@ -643,13 +632,18 @@ void execute_command(display& disp, const hotkey_command& command, command_execu
}
}
break;
case HOTKEY_QUIT_TO_DESKTOP:
case HOTKEY_QUIT_GAME: {
if (disp.in_game()) {
DBG_G << "is in game -- showing quit message\n";
const int res = gui2::show_message(disp.video(), _("Quit"),
_("Do you really want to quit?"), gui2::tmessage::yes_no_buttons);
if (res != gui2::twindow::CANCEL) {
throw_quit_game_exception();
if (command.id == HOTKEY_QUIT_TO_DESKTOP) {
throw CVideo::quit();
} else {
throw_quit_game_exception();
}
}
}
break;

View file

@ -88,7 +88,7 @@ hotkey::hotkey_command_temp hotkey_list_[] = {
{ hotkey::HOTKEY_STATISTICS, "statistics", N_("Statistics"), false, scope_game, "" },
{ hotkey::HOTKEY_STOP_NETWORK, "stopnetwork", N_("Pause Network Game"), false, scope_game, "" },
{ hotkey::HOTKEY_START_NETWORK, "startnetwork", N_("Continue Network Game"), false, scope_game, "" },
{ hotkey::HOTKEY_QUIT_GAME, "quit", N_("Quit to Titlescreen"), false, scope_game | scope_editor | scope_main, "" },
{ hotkey::HOTKEY_QUIT_GAME, "quit", N_("Quit to Titlescreen"), false, scope_game | scope_editor, "" },
{ hotkey::HOTKEY_LABEL_TEAM_TERRAIN, "labelteamterrain", N_("Set Team Label"), false, scope_game, "" },
{ hotkey::HOTKEY_LABEL_TERRAIN, "labelterrain", N_("Set Label"), false, scope_game, "" },
{ hotkey::HOTKEY_CLEAR_LABELS, "clearlabels", N_("Clear Labels"), false, scope_game, "" },
@ -121,7 +121,7 @@ hotkey::hotkey_command_temp hotkey_list_[] = {
// TRANSLATORS: whiteboard menu entry: plan as though the chosen unit were dead
{ hotkey::HOTKEY_WB_SUPPOSE_DEAD, "wbsupposedead", N_("whiteboard^Suppose Dead"), false, scope_game, "" },
{ hotkey::HOTKEY_EDITOR_QUIT_TO_DESKTOP, "editor-quit-to-desktop", N_("Quit to Desktop"), false, scope_editor, "" },
{ hotkey::HOTKEY_QUIT_TO_DESKTOP, "quit-to-desktop", N_("Quit to Desktop"), false, scope_game | scope_editor | scope_main, "" },
{ hotkey::HOTKEY_EDITOR_MAP_CLOSE, "editor-close-map", N_("Close Map"), false, scope_editor, "" },
// These are not really hotkey items but menu entries to get expanded.

View file

@ -48,7 +48,7 @@ enum HOTKEY_COMMAND {
HOTKEY_RECRUIT, HOTKEY_REPEAT_RECRUIT, HOTKEY_RECALL, HOTKEY_ENDTURN,
HOTKEY_TOGGLE_ELLIPSES, HOTKEY_TOGGLE_GRID, HOTKEY_STATUS_TABLE, HOTKEY_MUTE, HOTKEY_MOUSE_SCROLL,
HOTKEY_SPEAK, HOTKEY_CREATE_UNIT, HOTKEY_CHANGE_SIDE, HOTKEY_KILL_UNIT, HOTKEY_PREFERENCES,
HOTKEY_OBJECTIVES, HOTKEY_UNIT_LIST, HOTKEY_STATISTICS, HOTKEY_STOP_NETWORK, HOTKEY_START_NETWORK, HOTKEY_QUIT_GAME,
HOTKEY_OBJECTIVES, HOTKEY_UNIT_LIST, HOTKEY_STATISTICS, HOTKEY_STOP_NETWORK, HOTKEY_START_NETWORK, HOTKEY_QUIT_GAME, HOTKEY_QUIT_TO_DESKTOP,
HOTKEY_LABEL_TEAM_TERRAIN, HOTKEY_LABEL_TERRAIN, HOTKEY_CLEAR_LABELS,HOTKEY_SHOW_ENEMY_MOVES, HOTKEY_BEST_ENEMY_MOVES,
HOTKEY_DELAY_SHROUD, HOTKEY_UPDATE_SHROUD, HOTKEY_CONTINUE_MOVE,
HOTKEY_SEARCH, HOTKEY_SPEAK_ALLY, HOTKEY_SPEAK_ALL, HOTKEY_HELP,
@ -102,7 +102,6 @@ enum HOTKEY_COMMAND {
HOTKEY_WML,
/* Editor commands */
HOTKEY_EDITOR_QUIT_TO_DESKTOP,
HOTKEY_EDITOR_CUSTOM_TODS,
HOTKEY_EDITOR_PARTIAL_UNDO,

View file

@ -476,6 +476,18 @@ std::string get_names(std::string id)
names.push_back(item->get_name());
}
}
// These are hard-coded, non-rebindable hotkeys
if (id == "quit") {
names.push_back("escape");
}
else if (id == "quit-to-desktop") {
#ifdef __APPLE__
names.push_back("cmd+q");
#else
names.push_back("alt+F4");
#endif
}
return boost::algorithm::join(names, ", ");
}

View file

@ -281,6 +281,7 @@ bool play_controller::hotkey_handler::can_execute_command(const hotkey::hotkey_c
case hotkey::HOTKEY_UNIT_LIST:
case hotkey::HOTKEY_STATISTICS:
case hotkey::HOTKEY_QUIT_GAME:
case hotkey::HOTKEY_QUIT_TO_DESKTOP:
case hotkey::HOTKEY_SEARCH:
case hotkey::HOTKEY_HELP:
case hotkey::HOTKEY_USER_CMD:

View file

@ -124,7 +124,9 @@ static lg::log_domain log_config("config");
#ifndef SIGHUP
#define SIGHUP 20
#endif
/** @todo FIXME: should define SIGINT here too, but to what? */
/**
@todo FIXME: should define SIGINT here too, but to what?
*/
static sig_atomic_t config_reload = 0;

View file

@ -66,6 +66,10 @@
#include "desktop/windows_console.hpp"
#endif // _WIN32
#ifndef _WIN32
#include <signal.h>
#endif
#include <SDL.h> // for SDL_Init, SDL_INIT_TIMER
#include <boost/foreach.hpp> // for auto_any_base, etc
#include <boost/iostreams/categories.hpp> // for input, output
@ -872,8 +876,14 @@ static std::vector<std::string> parse_commandline_arguments(std::string input)
}
#endif
#ifndef _WIN32
static void wesnoth_terminate_handler(int) {
exit(0);
}
#endif
#ifdef __native_client__
#if defined(__native_client__) || (defined(__APPLE__) && SDL_VERSION_ATLEAST(2, 0, 0))
extern "C" int wesnoth_main(int argc, char** argv);
int wesnoth_main(int argc, char** argv)
#else
int main(int argc, char** argv)
@ -938,6 +948,15 @@ int main(int argc, char** argv)
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
return(1);
}
#ifndef _WIN32
struct sigaction terminate_handler;
terminate_handler.sa_handler = wesnoth_terminate_handler;
terminate_handler.sa_flags = 0;
sigemptyset(&terminate_handler.sa_mask);
sigaction(SIGTERM, &terminate_handler, NULL);
sigaction(SIGINT, &terminate_handler, NULL);
#endif
try {
std::cerr << "Battle for Wesnoth v" << game_config::revision << '\n';