mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-21 19:40:56 +00:00
Merge remote-tracking branch 'etlegacy/master'
This commit is contained in:
commit
b6e91568a8
5 changed files with 36 additions and 67 deletions
49
config.py
49
config.py
|
@ -3,19 +3,12 @@ import sys, traceback, platform, re, commands, platform, subprocess
|
|||
if __name__ != '__main__':
|
||||
from SCons.Script import *
|
||||
|
||||
import utils, urllib2, zipfile, shutil, pprint, subprocess, re
|
||||
import utils, urllib2, zipfile, shutil, pprint, subprocess, re, os.path
|
||||
|
||||
# config = debug release
|
||||
# aliases are going to be very needed here
|
||||
# we have dependency situations too
|
||||
# target =
|
||||
|
||||
class Config:
|
||||
# not used atm, but useful to keep a list in mind
|
||||
# may use them eventually for the 'all' and other aliases expansions?
|
||||
target_choices = utils.Enum( 'radiant', 'q3map2', 'q3data', 'setup' )
|
||||
config_choices = utils.Enum( 'debug', 'release' )
|
||||
|
||||
# aliases
|
||||
# 'all' -> for each choices
|
||||
# 'gamecode' for the targets, 'game' 'cgame' 'ui'
|
||||
|
@ -32,8 +25,8 @@ class Config:
|
|||
|
||||
# platforms for which to assemble a setup
|
||||
self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ]
|
||||
# paks to assemble in the setup
|
||||
self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ]
|
||||
# paks to assemble in the setup (only the Enemy Territory one by default)
|
||||
self.setup_packs = [ 'ETPack' ] # [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ]
|
||||
|
||||
def __repr__( self ):
|
||||
return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected )
|
||||
|
@ -219,42 +212,24 @@ class Config:
|
|||
env.Append( LINKFLAGS = xml2libs.split( ' ' ) )
|
||||
baseflags = [ '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ]
|
||||
|
||||
if ( self.platform == 'Darwin' ):
|
||||
env.Append( CPPPATH = [ '/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' ] )
|
||||
|
||||
if ( useGtk ):
|
||||
( ret, gtk2 ) = commands.getstatusoutput( 'pkg-config gtk+-2.0 --cflags' )
|
||||
if ( ret != 0 ):
|
||||
print 'pkg-config gtk+-2.0 failed'
|
||||
assert( False )
|
||||
baseflags += gtk2.split( ' ' )
|
||||
gtk2libs = commands.getoutput( 'pkg-config gtk+-2.0 --libs' )
|
||||
env.Append( LINKFLAGS = gtk2libs.split( ' ' ) )
|
||||
env.ParseConfig( 'pkg-config gtk+-2.0 --cflags --libs' )
|
||||
env.ParseConfig( 'pkg-config x11 --cflags --libs' )
|
||||
else:
|
||||
# always setup at least glib
|
||||
( ret, glib ) = commands.getstatusoutput( 'pkg-config glib-2.0 --cflags' )
|
||||
if ( ret != 0 ):
|
||||
print 'pkg-config glib-2.0 failed'
|
||||
assert( False )
|
||||
baseflags += glib.split( ' ' )
|
||||
gliblibs = commands.getoutput( 'pkg-config glib-2.0 --libs' )
|
||||
env.Append( LINKFLAGS = gliblibs.split( ' ' ) )
|
||||
env.ParseConfig( 'pkg-config glib-2.0 --cflags --libs' )
|
||||
|
||||
if ( useGtkGL ):
|
||||
( ret, gtkgl ) = commands.getstatusoutput( 'pkg-config gtkglext-1.0 --cflags' )
|
||||
if ( ret != 0 ):
|
||||
print 'pkg-config gtkglext-1.0 failed'
|
||||
assert( False )
|
||||
baseflags += gtkgl.split( ' ' )
|
||||
gtkgllibs = commands.getoutput( 'pkg-config gtkglext-1.0 --libs' )
|
||||
env.Append( LINKFLAGS = gtkgllibs.split( ' ' ) )
|
||||
env.ParseConfig( 'pkg-config glu --cflags --libs' )
|
||||
env.ParseConfig( 'pkg-config gtkglext-1.0 --cflags --libs' )
|
||||
if ( useJPEG ):
|
||||
env.Append( LIBS = 'jpeg' )
|
||||
if ( usePNG ):
|
||||
pnglibs = 'png z'
|
||||
pnglibs = 'png'
|
||||
env.Append( LIBS = pnglibs.split( ' ' ) )
|
||||
if ( useZ ):
|
||||
env.Append( LIBS = 'z' )
|
||||
env.ParseConfig( 'pkg-config zlib --cflags --libs' )
|
||||
if ( useZ ):
|
||||
env.ParseConfig( 'pkg-config zlib --cflags --libs' )
|
||||
|
||||
env.Append( CCFLAGS = baseflags )
|
||||
env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] )
|
||||
|
|
|
@ -2689,7 +2689,9 @@ void DoCommandListDlg(){
|
|||
int loop = 1, ret = IDCANCEL;
|
||||
|
||||
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
||||
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Mapped Commands" ) );
|
||||
gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
|
||||
gtk_window_set_position( GTK_WINDOW( dlg ), GTK_WIN_POS_CENTER_ON_PARENT );
|
||||
gtk_window_set_title( GTK_WINDOW( dlg ), _( "Shortcut List" ) );
|
||||
gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
|
||||
GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
|
||||
gtk_signal_connect( GTK_OBJECT( dlg ), "destroy",
|
||||
|
|
|
@ -1707,26 +1707,20 @@ bool WINAPI color_dialog( void *parent, float *color, const char* title ){
|
|||
}
|
||||
|
||||
void OpenURL( const char *url ){
|
||||
// let's put a little comment
|
||||
Sys_Printf( "OpenURL: %s\n", url );
|
||||
#ifdef __linux__
|
||||
// \todo FIXME: the way we open URLs on *nix should be improved. A script is good (see how I do on RTCW)
|
||||
char command[2 * PATH_MAX];
|
||||
snprintf( command, sizeof( command ), "%s/openurl.sh \"%s\" &", g_strAppPath.GetBuffer(), url );
|
||||
if ( system( command ) != 0 ) {
|
||||
gtk_MessageBox( g_pParentWnd->m_pWidget, "Failed to launch Netscape!" );
|
||||
}
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
char command[2 * PATH_MAX];
|
||||
snprintf( command, sizeof( command ),
|
||||
"open \"%s\" &", url, url );
|
||||
if ( system( command ) != 0 ) {
|
||||
gtk_MessageBox( g_pParentWnd->m_pWidget, "Unable to launch browser!" );
|
||||
}
|
||||
#endif
|
||||
char command[2 * PATH_MAX];
|
||||
|
||||
Sys_Printf( "OpenURL: %s\n", url );
|
||||
#ifdef _WIN32
|
||||
ShellExecute( (HWND)GDK_WINDOW_HWND( g_pParentWnd->m_pWidget->window ), "open", url, NULL, NULL, SW_SHOW );
|
||||
ShellExecute( (HWND)GDK_WINDOW_HWND( g_pParentWnd->m_pWidget->window ), "open", url, NULL, NULL, SW_SHOW );
|
||||
#else
|
||||
# ifdef __APPLE__
|
||||
snprintf(command, sizeof(command), "open '%s' &", url);
|
||||
# else
|
||||
snprintf(command, sizeof(command), "xdg-open '%s' &", url);
|
||||
# endif
|
||||
if (system(command) != 0) {
|
||||
gtk_MessageBox( g_pParentWnd->m_pWidget, "Failed to launch web browser!" );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1561,7 +1561,7 @@ void MainFrame::create_main_menu( GtkWidget *window, GtkWidget *vbox ){
|
|||
menu_tearoff( menu );
|
||||
}
|
||||
|
||||
item = create_menu_item_with_mnemonic( menu, _( "Manual" ),
|
||||
item = create_menu_item_with_mnemonic( menu, _( "GtkRadiant Manual" ),
|
||||
GTK_SIGNAL_FUNC( HandleCommand ), ID_HELP );
|
||||
gtk_widget_add_accelerator( item, "activate", accel, GDK_F1, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
|
||||
|
||||
|
@ -1572,11 +1572,11 @@ void MainFrame::create_main_menu( GtkWidget *window, GtkWidget *vbox ){
|
|||
// TTimo: this is in global.xlink now
|
||||
//create_menu_item_with_mnemonic (menu, "Links",
|
||||
// GTK_SIGNAL_FUNC (HandleCommand), ID_HELP_LINKS);
|
||||
create_menu_item_with_mnemonic( menu, _( "Bug report" ),
|
||||
create_menu_item_with_mnemonic( menu, _( "Report a Bug" ),
|
||||
GTK_SIGNAL_FUNC( HandleCommand ), ID_HELP_BUGREPORT );
|
||||
create_menu_item_with_mnemonic( menu, _( "Shortcuts list" ),
|
||||
create_menu_item_with_mnemonic( menu, _( "View Shortcuts" ),
|
||||
GTK_SIGNAL_FUNC( HandleCommand ), ID_HELP_COMMANDLIST );
|
||||
create_menu_item_with_mnemonic( menu, _( "_About" ),
|
||||
create_menu_item_with_mnemonic( menu, _( "_About GtkRadiant" ),
|
||||
GTK_SIGNAL_FUNC( HandleCommand ), ID_HELP_ABOUT );
|
||||
|
||||
|
||||
|
@ -6476,11 +6476,7 @@ void MainFrame::OnPluginsRefresh(){
|
|||
|
||||
// open the Q3Rad manual
|
||||
void MainFrame::OnHelp(){
|
||||
// at least on win32, g_strGameToolsPath + "Q3Rad_Manual/index.htm"
|
||||
Str help;
|
||||
help = g_strAppPath;
|
||||
help += "Q3Rad_Manual/index.htm";
|
||||
OpenURL( help.GetBuffer() );
|
||||
OpenURL( "http://icculus.org/gtkradiant/documentation/q3radiant_manual/index.htm" );
|
||||
}
|
||||
|
||||
// FIXME: we'll go towards a unified help thing soon
|
||||
|
@ -6492,7 +6488,7 @@ void MainFrame::OnHelpLinks(){
|
|||
}
|
||||
|
||||
void MainFrame::OnHelpBugreport(){
|
||||
OpenURL( "http://www.qeradiant.com/faq/fom-serve/cache/138.html" );
|
||||
OpenURL( "https://github.com/TTimo/GtkRadiant/issues" );
|
||||
}
|
||||
|
||||
void MainFrame::OnHelpCommandlist(){
|
||||
|
|
|
@ -1526,6 +1526,8 @@ void PrefsDlg::BuildDialog(){
|
|||
|
||||
dialog = m_pWidget;
|
||||
gtk_window_set_title( GTK_WINDOW( dialog ), _( "GtkRadiant Preferences" ) );
|
||||
gtk_window_set_transient_for( GTK_WINDOW( dialog ), GTK_WINDOW( g_pParentWnd->m_pWidget ) );
|
||||
gtk_window_set_position( GTK_WINDOW( dialog ), GTK_WIN_POS_CENTER_ON_PARENT );
|
||||
gtk_widget_realize( dialog );
|
||||
|
||||
mainvbox = gtk_vbox_new( FALSE, 5 );
|
||||
|
|
Loading…
Reference in a new issue