- m_bDoGameInstall = false;
-
- if ( DoModal() == IDCANCEL ) {
- Error( "game selection dialog canceled, cannot continue" );
- return;
- }
-
- if ( m_bDoGameInstall ) {
- DoGameInstall();
- ScanForGames();
- // and we will loop to do another DoModal dialog
- }
- }
-
- // unhook so we can use in other places
- // we manually incref'ed it when creating, it won't be freed (destructor)
- gtk_container_remove( GTK_CONTAINER( mTopBox ), GetGlobalFrame() );
-
- // we save the prefs file
- SavePrefs();
-}
-
-GtkWidget* CGameDialog::GetGlobalFrame(){
- GtkWidget *vbox, *text, *combo, *check;
-
- if ( mFrame != NULL ) {
- return mFrame;
- }
-
- mFrame = gtk_frame_new( NULL );
- gtk_container_set_border_width( GTK_CONTAINER( mFrame ), 5 );
- gtk_widget_show( mFrame );
-
- vbox = gtk_vbox_new( FALSE, 6 );
- gtk_widget_show( vbox );
- gtk_container_add( GTK_CONTAINER( mFrame ), vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
-
- text = gtk_label_new( _( "Select the game:" ) );
- gtk_widget_show( text );
- gtk_box_pack_start( GTK_BOX( vbox ), text, FALSE, FALSE, 0 );
-
- combo = gtk_combo_box_new_text();
- gtk_widget_show( combo );
- gtk_box_pack_start( GTK_BOX( vbox ), combo, FALSE, FALSE, 0 );
- AddDialogData( combo, &m_nComboSelect, DLG_COMBO_BOX_INT );
- mGameCombo = GTK_COMBO_BOX( combo );
-
- UpdateGameCombo();
-
- check = gtk_check_button_new_with_label( _( "Auto load selected game on startup" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bAutoLoadGame, DLG_CHECK_BOOL );
-
- text = gtk_label_new( _( "(this frame is available in the prefs menu if you set auto-select)" ) );
- gtk_widget_show( text );
- gtk_box_pack_start( GTK_BOX( vbox ), text, FALSE, FALSE, 0 );
-
-#ifdef _WIN32
- check = gtk_check_button_new_with_label( _( "Networked install - per-user settings" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bNetRun, DLG_CHECK_BOOL );
-#endif
-
- check = gtk_check_button_new_with_label( _( "Log the console to radiant.log" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLogConsole, DLG_CHECK_BOOL );
-
- // incref it so we can pass it around
- gtk_widget_ref( GTK_WIDGET( mFrame ) );
-
- return mFrame;
-}
-
-void CGameDialog::UpdateData( bool retrieve ) {
- if ( !retrieve ) {
- // use m_sGameFile to set m_nComboSelect
- list<CGameDescription *>::iterator iGame;
- int i = 0;
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ )
- {
- if ( ( *iGame )->mGameFile == m_sGameFile ) {
- m_nComboSelect = i;
- break;
- }
- i++;
- }
-#ifdef _WIN32
- UpdateNetrun( false );
-#endif
- }
- Dialog::UpdateData( retrieve );
- if ( retrieve ) {
- // use m_nComboSelect to set m_sGameFile
- list<CGameDescription *>::iterator iGame = mGames.begin();
- int i;
- for ( i = 0; i < m_nComboSelect; i++ )
- {
- iGame++;
- }
- m_sGameFile = ( *iGame )->mGameFile;
-#ifdef _WIN32
- UpdateNetrun( true );
-#endif
- }
-}
-
-void CGameDialog::SInstallCallback( GtkWidget *widget, gpointer data ) {
- CGameDialog *d = static_cast< CGameDialog* >( data );
- d->m_bDoGameInstall = true;
- d->EndModal( 0 );
-}
-
-void CGameDialog::BuildDialog() {
- GtkWidget *dlg, *vbox1, *button, *setup_button;
-
- dlg = m_pWidget;
- gtk_window_set_title( GTK_WINDOW( dlg ), _( "Select Game" ) );
-
- vbox1 = gtk_vbox_new( FALSE, 0 );
- gtk_widget_show( vbox1 );
- gtk_container_add( GTK_CONTAINER( dlg ), vbox1 );
-
- gtk_container_add( GTK_CONTAINER( vbox1 ), GetGlobalFrame() );
- mTopBox = vbox1;
-
- setup_button = gtk_button_new_with_label( _( "Configure more games" ) );
- gtk_widget_show( setup_button );
- gtk_box_pack_start( GTK_BOX( vbox1 ), setup_button, FALSE, FALSE, 0 );
- gtk_signal_connect( GTK_OBJECT( setup_button ), "clicked",
- GTK_SIGNAL_FUNC( SInstallCallback ), this );
-
- button = gtk_button_new_with_label( _( "OK" ) );
- gtk_widget_show( button );
- gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 );
- AddModalButton( button, IDOK );
-
- button = gtk_button_new_with_label( _( "Cancel" ) );
- gtk_widget_show( button );
- gtk_box_pack_start( GTK_BOX( vbox1 ), button, FALSE, FALSE, 0 );
- AddModalButton( button, IDCANCEL );
-
- gtk_widget_set_usize( button, 60, -2 );
-}
-
-void CGameDialog::UpdateGameCombo() {
- // fill in with the game descriptions
- list<CGameDescription *>::iterator iGame;
-
- if ( mGameCombo == NULL ) {
- Sys_Printf( "mGameCombo == NULL\n" );
- return;
- }
-
- // clear whatever is in - wtf no way to know how many text entries?
- // use set/get active to track
- gtk_combo_box_set_active( mGameCombo, 0 );
- while ( gtk_combo_box_get_active( mGameCombo ) == 0 ) {
- gtk_combo_box_remove_text( mGameCombo, 0 );
- gtk_combo_box_set_active( mGameCombo, 0 );
- }
-
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) {
- gtk_combo_box_append_text( mGameCombo, ( *iGame )->mGameName.GetBuffer() );
- }
- gtk_combo_box_set_active( mGameCombo, 0 );
-}
-
-void CGameDialog::ScanForGames(){
- CString strPath;
- char *dirlist;
- GDir *dir;
- CString strGamesPath = g_strAppPath.GetBuffer();
- strGamesPath += "games";
- const char *path = strGamesPath.GetBuffer();
-
- if ( !mGames.empty() ) {
- Sys_Printf( "Clearing game list\n" );
- list<CGameDescription*>::iterator iGame;
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) {
- delete ( *iGame );
- }
- mGames.clear();
- }
-
- Sys_Printf( "Scanning for game description files: %s\n", path );
-
- /*!
- \todo FIXME LINUX:
- do we put game description files below g_strAppPath, or in ~/.radiant
- i.e. read only or read/write?
- my guess .. readonly cause it's an install
- we will probably want to add ~/.radiant/<version>/games/ scanning on top of that for developers
- (if that's really needed)
- */
-
- // FIXME need to catch the 'no game description' situation and exit with a clean error
-
- dir = g_dir_open( path, 0, NULL );
-
- if ( dir != NULL ) {
- while ( 1 )
- {
- const gchar* name = g_dir_read_name( dir );
- if ( name == NULL ) {
- break;
- }
-
- dirlist = g_strdup( name );
-#ifdef _WIN32
- strlwr( dirlist );
-#endif
- char *ext = strrchr( dirlist, '.' );
- if ( ( ext == NULL ) || ( strcmp( ext, ".game" ) != 0 ) ) {
- continue;
- }
- strPath.Format( "%s/%s", path, dirlist );
- Sys_Printf( "%s\n", strPath.GetBuffer() );
- // got one, load it
- xmlDocPtr pDoc = xmlParseFile( strPath.GetBuffer() );
- if ( pDoc ) {
- mGames.push_front( new CGameDescription( pDoc, dirlist ) );
- }
- else
- {
- Sys_FPrintf( SYS_ERR, "XML parser failed on '%s'\n", strPath.GetBuffer() );
- }
-
- g_free( dirlist );
- }
- g_dir_close( dir );
- }
-
- // entries in the combo need to be updated
- UpdateGameCombo();
-}
-
-CGameDescription* CGameDialog::GameDescriptionForComboItem(){
- list<CGameDescription *>::iterator iGame;
- int i = 0;
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++,i++ ) {
- if ( i == m_nComboSelect ) {
- return ( *iGame );
- }
- }
- return NULL; // not found
-}
-
-void CGameDialog::InitGlobalPrefPath(){
- GString *global_rc_path;
- // configure m_global_rc_path
- // this is the g_strTempPath, and it has already been mkdir'ed
- global_rc_path = g_string_new( g_strTempPath.GetBuffer() );
- g_PrefsDlg.m_global_rc_path = global_rc_path;
-}
-
-void CGameDialog::Reset(){
- if ( !g_PrefsDlg.m_global_rc_path ) {
- InitGlobalPrefPath();
- }
- CString strGlobalPref = g_PrefsDlg.m_global_rc_path->str;
- strGlobalPref += "global.pref";
- remove( strGlobalPref.GetBuffer() );
-}
-
-void CGameDialog::Init(){
- InitGlobalPrefPath();
- ScanForGames();
- if ( mGames.empty() ) {
- DoGameInstall();
- ScanForGames();
- if ( mGames.empty() ) {
- Error( "No games setup, aborting\n" );
- }
- }
- LoadPrefs();
- if ( m_bAutoLoadGame ) {
- // search by .game name
- list<CGameDescription *>::iterator iGame;
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ )
- {
- if ( ( *iGame )->mGameFile == m_sGameFile ) {
- m_pCurrentGameDescription = ( *iGame );
- break;
- }
- }
- }
- if ( !m_bAutoLoadGame || !m_pCurrentGameDescription ) {
- DoGameDialog();
- // use m_nComboSelect to identify the game to run as and set the globals
- m_pCurrentGameDescription = GameDescriptionForComboItem();
- if ( !m_pCurrentGameDescription ) {
- Error( "Lookup of game description object failed, can't continue\n" );
- }
- }
- g_pGameDescription = m_pCurrentGameDescription;
-
- g_strGameToolsPath = g_pGameDescription->mGameToolsPath;
-
- // NOTE TTimo: this is moved from QE_LoadProject in 1.2
- // (probably broken)
- // NOTE Hydra: was broken for win32, we don't use m_strHomeGame or m_strFSBasePath
-#if defined ( __linux__ ) || defined ( __APPLE__ )
- g_qeglobals.m_strHomeGame = g_get_home_dir();
- g_qeglobals.m_strHomeGame += "/";
- g_qeglobals.m_strHomeGame += m_pCurrentGameDescription->mUserPathPrefix.GetBuffer();
- g_qeglobals.m_strHomeGame += "/";
-#else
- g_qeglobals.m_strHomeGame = g_pGameDescription->mEnginePath.GetBuffer();
-#endif
-
- g_pGameDescription->Dump();
-}
-
-CGameDialog::~CGameDialog(){
- if ( mFrame ) {
- // NOTE I'm not too sure how reliable this is
- gtk_widget_unref( GTK_WIDGET( mFrame ) );
- }
- // free all the game descriptions
- list<CGameDescription *>::iterator iGame;
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ )
- {
- delete ( *iGame );
- *iGame = NULL;
- }
-}
-
-void CGameDialog::AddPacksURL( Str &URL ){
- // add the URLs for the list of game packs installed
- // FIXME: this is kinda hardcoded for now..
- list<CGameDescription *>::iterator iGame;
- for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ )
- {
- if ( ( *iGame )->mGameFile == "q3.game" ) {
- URL += "&Games_dlup%5B%5D=1";
- }
- else if ( ( *iGame )->mGameFile == "wolf.game" ) {
- URL += "&Games_dlup%5B%5D=2";
- }
- // FIXME: double entry
- else if ( ( *iGame )->mGameFile == "wolf.game" ) {
- URL += "&Games_dlup%5B%5D=3";
- }
- else if ( ( *iGame )->mGameFile == "jk2.game" ) {
- URL += "&Games_dlup%5B%5D=4";
- }
- else if ( ( *iGame )->mGameFile == "stvef.game" ) {
- URL += "&Games_dlup%5B%5D=5";
- }
- else if ( ( *iGame )->mGameFile == "sof2.game" ) {
- URL += "&Games_dlup%5B%5D=6";
- }
- else if ( ( *iGame )->mGameFile == "ja.game" ) {
- URL += "&Games_dlup%5B%5D=7";
- }
- }
-}
-
-#ifdef _WIN32
-
-#define NETRUN_FILENAME "netrun.conf"
-
-bool CGameDialog::m_bNetRun;
-
-void CGameDialog::UpdateNetrun( bool retrieve ){
- FILE *f_netrun;
- CString strNetrun;
- strNetrun = g_strAppPath; strNetrun += NETRUN_FILENAME;
- if ( !retrieve ) {
- // now check if we are running from a network installation
- // use a dummy file as the flag
- f_netrun = fopen( strNetrun.GetBuffer(), "r" );
- if ( f_netrun ) {
- fclose( f_netrun );
- m_bNetRun = true;
- }
- else{
- m_bNetRun = false;
- }
- }
- else
- {
- if ( m_bNetRun ) {
- f_netrun = fopen( strNetrun.GetBuffer(), "w" );
- if ( !f_netrun ) {
- Sys_FPrintf( SYS_ERR, "ERROR: Failed to create netrun file '%s'\n", strNetrun.GetBuffer() );
- m_bNetRun = false;
- }
- else
- {
- fclose( f_netrun );
- Sys_Printf( "Created/Checked '%s'\n", strNetrun.GetBuffer() );
- }
- }
- else
- {
- if ( remove( strNetrun.GetBuffer() ) == -1 ) {
- if ( errno != ENOENT ) {
- Sys_FPrintf( SYS_ERR, "Failed to remove netrun file '%s'\n", strNetrun.GetBuffer() );
- }
- m_bNetRun = true;
- }
- else
- {
- Sys_Printf( "Netrun mode is disabled\n" );
- }
- }
- }
-}
-
-bool CGameDialog::GetNetrun(){
- return m_bNetRun;
-}
-#endif
-
-/*
- ========
-
- very first prefs init deals with selecting the game and the game tools path
- then we can load .ini stuff
-
- using prefs / ini settings:
- those are per-game
-
- win32:
- look in g_strGameToolsPath for .ini
-
- linux:
- look in ~/.radiant/<version>/gamename
- ========
- */
-
-#define PREFS_LOCAL_FILENAME "local.pref"
-
-void PrefsDlg::Init(){
- mGamesDialog.Init();
-
- // m_global_rc_path has been set above, do m_rc_path with game specific stuff now
- // the win32 and linux versions have been unified for network mode
-#ifdef _WIN32
- if ( !CGameDialog::GetNetrun() ) {
- // legacy prefs settings, this goes where the game pack is installed
- m_rc_path = g_string_new( g_strGameToolsPath.GetBuffer() );
- m_inipath = g_string_new( m_rc_path->str );
- g_string_append( m_inipath, PREFS_LOCAL_FILENAME );
- return;
- }
-#endif
- // this is common to win32 and Linux init now
- m_rc_path = g_string_new( m_global_rc_path->str );
-
- // game sub-dir
- g_string_append( m_rc_path, g_pGameDescription->mGameFile.GetBuffer() );
- g_string_append( m_rc_path, "/" );
- Q_mkdir( m_rc_path->str, 0775 );
-
- // then the ini file
- m_inipath = g_string_new( m_rc_path->str );
- g_string_append( m_inipath, PREFS_LOCAL_FILENAME );
-
-}
-
-void PrefsDlg::UpdateData( bool retrieve ){
- // leo: the "changed" signal confuses the update function
- if ( m_pWidget == NULL ) {
- return;
- }
- mGamesDialog.UpdateData( retrieve );
- Dialog::UpdateData( retrieve );
-}
-
-#ifdef _WIN32
-#define PREFSHSPACE 5
-#else
-#define PREFSHSPACE 0
-#endif
-
-static void UpdateSensitivity( GtkWidget *widget, gpointer data ){
- PrefsDlg *dlg = (PrefsDlg*)data;
- dlg->DoSensitivity();
-}
-
-static void UpdateEditorSensitivity( GtkWidget *widget, gpointer data ){
- PrefsDlg *dlg = (PrefsDlg*)data;
- dlg->DoEditorSensitivity();
-}
-
-// start new prefs dialog
-
-/*! Utility function for swapping notebook pages for tree list selections */
-void PrefsDlg::showPrefPage( int prefpage ){
- if ( gtk_notebook_get_current_page( GTK_NOTEBOOK( notebook ) ) != prefpage ) {
- gtk_notebook_set_page( GTK_NOTEBOOK( notebook ), prefpage );
- }
-
- return;
-}
-
-static void treeSelection( GtkTreeSelection* selection, gpointer data ){
- PrefsDlg *dlg = (PrefsDlg*)data;
-
- GtkTreeModel* model;
- GtkTreeIter selected;
- if ( gtk_tree_selection_get_selected( selection, &model, &selected ) ) {
- int prefpage;
- gtk_tree_model_get( model, &selected, 1, (gpointer*)&prefpage, -1 );
- dlg->showPrefPage( prefpage );
- }
-}
-
-void PrefsDlg::BuildDialog(){
- // Main Preferences dialog
- GtkWidget *dialog, *mainvbox, *hbox, *sc_win, *preflabel;
-
- // Widgets on notebook pages
- GtkWidget *check, *label, *scale, *hbox2, *combo,
- *table, *spin, *entry, *pixmap,
- *radio, *button, *pageframe, *vbox;
-
- GList *combo_list = (GList*)NULL;
-
- GtkObject *adj;
-
- dialog = m_pWidget;
- gtk_window_set_title( GTK_WINDOW( dialog ), _( "GtkRadiant Preferences" ) );
- gtk_widget_realize( dialog );
-
- mainvbox = gtk_vbox_new( FALSE, 5 );
- gtk_container_add( GTK_CONTAINER( dialog ), mainvbox );
- gtk_container_set_border_width( GTK_CONTAINER( mainvbox ), 5 );
- gtk_widget_show( mainvbox );
-
- hbox = gtk_hbox_new( FALSE, 5 );
- gtk_widget_show( hbox );
- gtk_box_pack_end( GTK_BOX( mainvbox ), hbox, FALSE, TRUE, 0 );
-
- button = gtk_button_new_with_label( _( "OK" ) );
- gtk_widget_show( button );
- gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_widget_set_usize( button, 60, -2 );
- AddModalButton( button, IDOK );
-
- button = gtk_button_new_with_label( _( "Cancel" ) );
- gtk_widget_show( button );
- gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_widget_set_usize( button, 60, -2 );
- AddModalButton( button, IDCANCEL );
-
- button = gtk_button_new_with_label( _( "Clean" ) );
- gtk_widget_show( button );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnButtonClean ), this );
- gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
- gtk_widget_set_usize( button, 60, -2 );
-
- hbox = gtk_hbox_new( FALSE, 5 );
- gtk_box_pack_start( GTK_BOX( mainvbox ), hbox, TRUE, TRUE, 0 );
- gtk_widget_show( hbox );
-
- sc_win = gtk_scrolled_window_new( NULL, NULL );
- gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_win ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
- gtk_box_pack_start( GTK_BOX( hbox ), sc_win, FALSE, FALSE, 0 );
- gtk_widget_show( sc_win );
-
- // prefs pages notebook
- notebook = gtk_notebook_new();
- // hide the notebook tabs since its not supposed to look like a notebook
- gtk_notebook_set_show_tabs( GTK_NOTEBOOK( notebook ), FALSE );
- gtk_box_pack_start( GTK_BOX( hbox ), notebook, TRUE, TRUE, 0 );
- gtk_widget_show( notebook );
-
- gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( sc_win ), GTK_SHADOW_IN );
-
- {
- GtkTreeStore* store = gtk_tree_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER );
-
- GtkWidget* view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) );
- gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
-
- {
- GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
- GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( _( "Preferences" ), renderer, "text", 0, NULL );
- gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
- }
-
- {
- GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
- g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( treeSelection ), this );
- }
-
- gtk_widget_show( view );
-
- gtk_container_add( GTK_CONTAINER( sc_win ), view );
-
- {
- /********************************************************************/
- /* Add preference tree options */
- /********************************************************************/
- {
- GtkTreeIter group;
- gtk_tree_store_append( store, &group, NULL );
- gtk_tree_store_set( store, &group, 0, _( "Globals" ), 1, PTAB_FRONT, -1 );
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Game settings" ), 1, (gpointer)PTAB_GAME_SETTINGS, -1 );
- }
- }
-
- {
- GtkTreeIter group;
- gtk_tree_store_append( store, &group, NULL );
- gtk_tree_store_set( store, &group, 0, _( "Display" ), 1, PTAB_FRONT, -1 );
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "2D Display/Rendering" ), 1, (gpointer)PTAB_2D, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "3D View" ), 1, (gpointer)PTAB_CAMERA, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Texture Settings" ), 1, (gpointer)PTAB_TEXTURE, -1 );
- }
- }
-
- {
- GtkTreeIter group;
- gtk_tree_store_append( store, &group, NULL );
- gtk_tree_store_set( store, &group, 0, _( "Interface" ), 1, PTAB_FRONT, -1 );
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Layout" ), 1, (gpointer)PTAB_LAYOUT, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Mouse" ), 1, (gpointer)PTAB_MOUSE, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Editing" ), 1, (gpointer)PTAB_EDITING, -1 );
- }
- }
-
- {
- GtkTreeIter group;
- gtk_tree_store_append( store, &group, NULL );
- gtk_tree_store_set( store, &group, 0, _( "Other" ), 1, PTAB_FRONT, -1 );
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Startup/Auto save" ), 1, (gpointer)PTAB_STARTUP, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Paths" ), 1, (gpointer)PTAB_PATHS, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Brush" ), 1, (gpointer)PTAB_BRUSH, -1 );
- }
- {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "Misc" ), 1, (gpointer)PTAB_MISC, -1 );
- }
- if ( !g_qeglobals.bBSPFrontendPlugin ) {
- GtkTreeIter tab;
- gtk_tree_store_append( store, &tab, &group );
- gtk_tree_store_set( store, &tab, 0, _( "BSP Monitoring" ), 1, (gpointer)PTAB_BSPMONITOR, -1 );
- }
- }
- }
-
- gtk_tree_view_expand_all( GTK_TREE_VIEW( view ) );
-
- g_object_unref( G_OBJECT( store ) );
- }
-
- /**********************************************************************/
- /* build the prefs pages */
- /**********************************************************************/
-
- // Front page...
- // todo : add something interesting here
- // NOTE TTimo: tip of the day? or a logo?
- preflabel = gtk_label_new( _( "Front Page" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( NULL );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_widget_set_usize( GTK_WIDGET( vbox ), 350, -2 );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** global preferences group ****************************/
- preflabel = gtk_label_new( _( "Globals" ) );
- gtk_widget_show( preflabel );
-
- pageframe = mGamesDialog.GetGlobalFrame();
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** 2D prefs group (xy views/rendering options) *********/
- preflabel = gtk_label_new( _( "2D Display" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "2D Display" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // OpenGL Display Lists
- check = gtk_check_button_new_with_label( _( "OpenGL Display Lists" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bDisplayLists, DLG_CHECK_BOOL );
-
- // Antialiased points & lines
- // Fishman - Add antialiazed points and lines support. 09/03/00
- check = gtk_check_button_new_with_label( _( "OpenGL antialiased points and lines" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bAntialiasedPointsAndLines, DLG_CHECK_BOOL );
-
- // Solid selection boxes
- check = gtk_check_button_new_with_label( _( "Solid selection boxes" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bNoStipple, DLG_CHECK_BOOL );
-
- // Display size info
- check = gtk_check_button_new_with_label( _( "Display size info" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bSizePaint, DLG_CHECK_BOOL );
-
- // Alternate vertex/edge handles
- // Gef: Kyro GL_POINT work around 25-aug-2001
- check = gtk_check_button_new_with_label( _( "Alternate vertex/edge handles" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bGlPtWorkaround, DLG_CHECK_BOOL );
-
- g_list_free( combo_list );
-
-#ifdef ATIHACK_812
- // ATI bugs
- check = gtk_check_button_new_with_label( _( "ATI and Intel cards w/ buggy drivers (disappearing polygons)" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bGlATIHack, DLG_CHECK_BOOL );
-#endif
-
-#ifdef NVIDIA_AERO_HACK
- check = gtk_check_button_new_with_label( _( "NVIDIA/Aero bug - disable Windows composition" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bGlNvidiaAeroHack, DLG_CHECK_BOOL );
-#endif
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** 3D Camera view group *********/
- preflabel = gtk_label_new( _( "3D View" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "3D View" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // Directional velocity (Movement Velocity)
- // label container
- hbox2 = gtk_hbox_new( FALSE, 0 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
-
- // label
- label = gtk_label_new( _( "Movement Velocity" ) );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // adjustment
- adj = gtk_adjustment_new( 100, 50, 300, 1, 10, 10 );
- AddDialogData( adj, &m_nMoveSpeed, DLG_ADJ_INT );
-
- // scale
- scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
- gtk_widget_show( scale );
- gtk_box_pack_start( GTK_BOX( vbox ), scale, FALSE, TRUE, 2 );
-
- gtk_scale_set_draw_value( GTK_SCALE( scale ), TRUE );
-
- // Angular velocity (Rotational Velocity)
- // label container
- hbox2 = gtk_hbox_new( FALSE, 0 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
-
- // label
- label = gtk_label_new( _( "Rotational Velocity" ) );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // adjustment
- adj = gtk_adjustment_new( 3, 1, 180, 1, 10, 10 ); // value, low, high, step, page_step, page_size
- AddDialogData( adj, &m_nAngleSpeed, DLG_ADJ_INT );
-
- // scale
- scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
- gtk_widget_show( scale );
- gtk_box_pack_start( GTK_BOX( vbox ), scale, FALSE, TRUE, 2 );
- gtk_scale_set_draw_value( GTK_SCALE( scale ), TRUE );
-
- // Text under the velocity sliders
- // container
- hbox2 = gtk_hbox_new( FALSE, 0 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
-
- // label
- label = gtk_label_new( _( "slow" ) );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // label
- label = gtk_label_new( _( "fast" ) );
- gtk_widget_show( label );
- gtk_box_pack_end( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // Allow drag to select multiple faces/brushes
- // container
- table = gtk_table_new( 2, 1, FALSE );
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- label = gtk_label_new( _( "Use paint-select in camera view:" ) );
- gtk_widget_show( label );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- combo_list = NULL;
- combo_list = g_list_append( combo_list, (void *)_( "No" ) );
- combo_list = g_list_append( combo_list, (void *)_( "Yes" ) );
- combo_list = g_list_append( combo_list, (void *)_( "Yes (Classic Key Setup)" ) );
-
- combo = gtk_combo_new();
- gtk_combo_set_popdown_strings( GTK_COMBO( combo ), combo_list );
- gtk_widget_show( combo );
- gtk_table_attach( GTK_TABLE( table ), combo, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE );
- AddDialogData( combo, &m_nCamDragMultiSelect, DLG_COMBO_INT );
-
- // Freelook in Camera view
- check = gtk_check_button_new_with_label( _( "Freelook in Camera view" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- gtk_label_set_justify( GTK_LABEL( GTK_BIN( check )->child ), GTK_JUSTIFY_LEFT );
- AddDialogData( check, &m_bCamFreeLook, DLG_CHECK_BOOL );
-
- // Freelook in Camera view w/ forward & back strafing instead of up and down looking
- check = gtk_check_button_new_with_label( _( "Freelook strafes Forward and Back" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- gtk_label_set_justify( GTK_LABEL( GTK_BIN( check )->child ), GTK_JUSTIFY_LEFT );
- AddDialogData( check, &m_bCamFreeLookStrafe, DLG_CHECK_BOOL );
-
- // Invert mouse in freelook
- check = gtk_check_button_new_with_label( _( "Invert mouse in freelook" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- gtk_label_set_justify( GTK_LABEL( GTK_BIN( check )->child ), GTK_JUSTIFY_LEFT );
- AddDialogData( check, &m_bCamInverseMouse, DLG_CHECK_BOOL );
-
- // Discrete movement
- check = gtk_check_button_new_with_label( _( "Discrete movement" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- gtk_label_set_justify( GTK_LABEL( GTK_BIN( check )->child ), GTK_JUSTIFY_LEFT );
- AddDialogData( check, &m_bCamDiscrete, DLG_CHECK_BOOL );
-
- // Update XY views on camera move
- check = gtk_check_button_new_with_label( _( "Update XY views on camera move" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- gtk_label_set_justify( GTK_LABEL( GTK_BIN( check )->child ), GTK_JUSTIFY_LEFT );
- AddDialogData( check, &m_bCamXYUpdate, DLG_CHECK_BOOL );
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Texture group *********/
- preflabel = gtk_label_new( _( "Textures" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Textures" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 6 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // Texture quality slider
- // label
- label = gtk_label_new( _( "Texture quality" ) );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, FALSE, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
-
- // adjustment
- adj = gtk_adjustment_new( 0, 0, 4, 1, 1, 1 );
- AddDialogData( adj, &m_nLatchedTextureQuality, DLG_ADJ_INT );
-
- // scale
- scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
- gtk_widget_show( scale );
- gtk_box_pack_start( GTK_BOX( vbox ), scale, FALSE, FALSE, 0 );
- gtk_scale_set_draw_value( GTK_SCALE( scale ), FALSE );
-
- // text under the texture slider
- hbox2 = gtk_hbox_new( FALSE, 0 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
- label = gtk_label_new( _( "low" ) );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
- label = gtk_label_new( _( "high" ) );
- gtk_widget_show( label );
- gtk_box_pack_end( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // texture subsets
- check = gtk_check_button_new_with_label( _( "Texture subsets" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bTextureWindow, DLG_CHECK_BOOL );
-
- // texture scrollbar
- check = gtk_check_button_new_with_label( _( "Texture scrollbar" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bTextureScrollbar, DLG_CHECK_BOOL );
-
- // texture increment matches grid
- check = gtk_check_button_new_with_label( _( "Tex increment matches grid" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bSnapTToGrid, DLG_CHECK_BOOL );
-
- // RIANT
- // Texture compression choice label
- // container
- table = gtk_table_new( 2, 1, FALSE );
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- label = gtk_label_new( _( "Texture Compression (if available):" ) );
- gtk_widget_show( label );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
-
- // Texture compression choice label
- combo_list = NULL;
- // NONE will always be in pos 0
- combo_list = g_list_append( combo_list, (void *)_( "None" ) );
-
- // if OpenGL compression is enabled it will always be
- // in pos 1
- if ( g_qeglobals.m_bOpenGLCompressionSupported ) {
- combo_list = g_list_append( combo_list, (void *)_( "OpenGL ARB" ) );
- }
-
- // If S3 is enabled offer all 3 valid compression schemes in RGBA
- if ( g_qeglobals.m_bS3CompressionSupported ) {
- combo_list = g_list_append( combo_list, (void *)_( "S3TC DXT1" ) );
- combo_list = g_list_append( combo_list, (void *)_( "S3TC DXT3" ) );
- combo_list = g_list_append( combo_list, (void *)_( "S3TC DXT5" ) );
- }
-
- combo = gtk_combo_new();
- gtk_combo_set_popdown_strings( GTK_COMBO( combo ), combo_list );
- gtk_widget_show( combo );
- gtk_table_attach( GTK_TABLE( table ), combo, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE );
- AddDialogData( combo, &m_nTextureCompressionFormat, DLG_COMBO_INT );
- g_list_free( combo_list );
-
- // container
- table = gtk_table_new( 2, 1, FALSE );
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- // Startup shaders
- // label
- label = gtk_label_new( _( "Startup Shaders:" ) );
- gtk_widget_show( label );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
-
- // combo list
- combo_list = NULL;
- combo_list = g_list_append( combo_list, (void *)_( "None" ) );
- if ( g_pGameDescription->mGameFile == "jk2.game" || g_pGameDescription->mGameFile == "ja.game" ) {
- combo_list = g_list_append( combo_list, (void *)_( "System" ) );
- }
- else if ( g_pGameDescription->mGameFile == "sof2.game" ) {
- combo_list = g_list_append( combo_list, (void *)( "Tools" ) );
- }
- else{
- combo_list = g_list_append( combo_list, (void *)_( "Common" ) );
- }
- combo_list = g_list_append( combo_list, (void *)_( "All" ) );
- combo = gtk_combo_new();
- gtk_combo_set_popdown_strings( GTK_COMBO( combo ), combo_list );
- gtk_widget_show( combo );
- gtk_table_attach( GTK_TABLE( table ), combo, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( combo )->entry ), FALSE );
- AddDialogData( combo, &m_nLatchedShader, DLG_COMBO_INT );
- g_list_free( combo_list );
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Layout group *********/
- preflabel = gtk_label_new( _( "Layout" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Layout" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // View types
- // table
- table = gtk_table_new( 2, 4, FALSE );
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- // view type 1
- pixmap = new_pixmap( g_pParentWnd->m_pWidget, "window1.bmp" );
- gtk_widget_show( pixmap );
- gtk_table_attach( GTK_TABLE( table ), pixmap, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 2
- pixmap = new_pixmap( g_pParentWnd->m_pWidget, "window2.bmp" );
- gtk_widget_show( pixmap );
- gtk_table_attach( GTK_TABLE( table ), pixmap, 1, 2, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 3
- pixmap = new_pixmap( g_pParentWnd->m_pWidget, "window3.bmp" );
- gtk_widget_show( pixmap );
- gtk_table_attach( GTK_TABLE( table ), pixmap, 2, 3, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 4
- pixmap = new_pixmap( g_pParentWnd->m_pWidget, "window4.bmp" );
- gtk_widget_show( pixmap );
- gtk_table_attach( GTK_TABLE( table ), pixmap, 3, 4, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 1 selector
- radio = gtk_radio_button_new( NULL );
- gtk_widget_show( radio );
- gtk_table_attach( GTK_TABLE( table ), radio, 0, 1, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 2 selector
- radio = gtk_radio_button_new_from_widget( GTK_RADIO_BUTTON( radio ) );
- gtk_widget_show( radio );
- gtk_table_attach( GTK_TABLE( table ), radio, 1, 2, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 3 selector
- radio = gtk_radio_button_new_from_widget( GTK_RADIO_BUTTON( radio ) );
- gtk_widget_show( radio );
- gtk_table_attach( GTK_TABLE( table ), radio, 2, 3, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // view type 4 selector
- radio = gtk_radio_button_new_from_widget( GTK_RADIO_BUTTON( radio ) );
- gtk_widget_show( radio );
- gtk_table_attach( GTK_TABLE( table ), radio, 3, 4, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- AddDialogData( radio, &m_nLatchedView, DLG_RADIO_INT );
-
- // Floating Z window
- check = gtk_check_button_new_with_label( _( "Floating Z Window" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLatchedFloatingZ, DLG_CHECK_BOOL );
-
- // show menu tear-off seperators
- check = gtk_check_button_new_with_label( _( "Detachable Menus" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLatchedDetachableMenus, DLG_CHECK_BOOL );
-
- if ( !g_pGameDescription->mNoPatch ) {
- // show patch toolbar
- check = gtk_check_button_new_with_label( _( "Patch Toolbar" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- g_object_set_data( G_OBJECT( dialog ), "check_patchtoolbar", check ); // Allow to be disabled for Q1/Q2
- AddDialogData( check, &m_bLatchedPatchToolbar, DLG_CHECK_BOOL );
- }
-
- // use wide toolbar
- check = gtk_check_button_new_with_label( _( "Wide Toolbar" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLatchedWideToolbar, DLG_CHECK_BOOL );
-
- // use plugin toolbar
- check = gtk_check_button_new_with_label( _( "Plugin Toolbar" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLatchedPluginToolbar, DLG_CHECK_BOOL );
-
-#ifdef _WIN32
- // win32 file dialog
- check = gtk_check_button_new_with_label( _( "Use win32 file dialog (hacky)" ) );
- gtk_widget_show( check );
- // gtk_container_add (GTK_CONTAINER (vbox), check);
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bNativeGUI, DLG_CHECK_BOOL );
-
- // position on primary monitor
- check = gtk_check_button_new_with_label( _( "Start on Primary Monitor" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- g_object_set_data( G_OBJECT( dialog ), "check_startonprimary", check );
- gtk_signal_connect( GTK_OBJECT( check ), "clicked", GTK_SIGNAL_FUNC( UpdateSensitivity ), this );
- AddDialogData( check, &m_bStartOnPrimMon, DLG_CHECK_BOOL );
-#endif
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Mouse group *********/
- preflabel = gtk_label_new( _( "Mouse" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Mouse" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // Buttons
- // container
- hbox2 = gtk_hbox_new( FALSE, 5 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
-
- // 2 button radio
- radio = gtk_radio_button_new_with_label( NULL, _( "2 button" ) );
- gtk_widget_show( radio );
- gtk_box_pack_start( GTK_BOX( hbox2 ), radio, FALSE, FALSE, 0 );
-
- // 3 button radio
- radio = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON( radio ), _( "3 button" ) );
- gtk_widget_show( radio );
- gtk_box_pack_start( GTK_BOX( hbox2 ), radio, FALSE, FALSE, 0 );
- AddDialogData( radio, &m_nMouse, DLG_RADIO_INT );
-
- // right click to drop entity
- check = gtk_check_button_new_with_label( _( "Right click to drop entities" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bRightClick, DLG_CHECK_BOOL );
-
- // Mouse chaser (and this does what?)
- check = gtk_check_button_new_with_label( _( "Mouse chaser" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bChaseMouse, DLG_CHECK_BOOL );
-
- // Alt + multi-drag
- check = gtk_check_button_new_with_label( _( "ALT + multi-drag" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bALTEdge, DLG_CHECK_BOOL );
-
- // Mouse wheel increments
- // container
- hbox2 = gtk_hbox_new( FALSE, 5 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
-
- // label
- label = gtk_label_new( _( "Wheel Mouse inc:" ) );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // entry
- entry = gtk_entry_new();
- gtk_widget_show( entry );
- gtk_widget_set_usize( entry, 40, -2 );
- gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
- AddDialogData( entry, &m_nWheelInc, DLG_ENTRY_INT );
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Editing group *********/
- preflabel = gtk_label_new( _( "Editing" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Editing" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // Vertex editing splits faces
- check = gtk_check_button_new_with_label( _( "Vertex editing splits face" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bVertexSplit, DLG_CHECK_BOOL );
-
- // Fix target/targetname collisions
- check = gtk_check_button_new_with_label( _( "Fix target/targetname collisions" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bDoTargetFix, DLG_CHECK_BOOL );
-
- // Clipper tool uses caulk
- check = gtk_check_button_new_with_label( _( "Clipper tool uses caulk" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bClipCaulk, DLG_CHECK_BOOL );
-
- // Don't clamp plane points
- check = gtk_check_button_new_with_label( _( "Don't clamp plane points" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bNoClamp, DLG_CHECK_BOOL );
-
- // Snap to grid
- check = gtk_check_button_new_with_label( _( "Snap to grid" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bSnap, DLG_CHECK_BOOL );
-
- // Select patch by bounding box
- check = gtk_check_button_new_with_label( _( "Select patches by bounding box" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bPatchBBoxSelect, DLG_CHECK_BOOL );
-
- // Rotation increment
- // container
- table = gtk_table_new( 2, 3, FALSE );
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- // label
- label = gtk_label_new( _( "Rotation increment:" ) );
- gtk_widget_show( label );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // entry
- entry = gtk_entry_new();
- gtk_widget_show( entry );
- gtk_widget_set_usize( entry, 60, -2 );
- gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- AddDialogData( entry, &m_nRotation, DLG_ENTRY_INT );
-
- // Undo levels
- // label
- label = gtk_label_new( _( "Undo Levels:" ) );
- gtk_widget_show( label );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // spinner (allows undo levels to be set to zero)
- spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 0, 64, 1, 10, 10 ) ), 1, 0 );
- gtk_widget_show( spin );
- gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
- AddDialogData( spin, &m_nUndoLevels, DLG_SPIN_INT );
-
- // Patch subdivisions
- // label
- label = gtk_label_new( _( "Patch subdivisions:" ) );
- gtk_widget_show( label );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // entry (spinner perhaps? [2-16])
- entry = gtk_entry_new();
- gtk_widget_show( entry );
- gtk_widget_set_usize( entry, 60, -2 );
- gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- AddDialogData( entry, &m_nSubdivisions, DLG_ENTRY_INT );
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Save/Load group *********/
- preflabel = gtk_label_new( _( "Startup/Auto save" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Startup/Auto save" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // Snapshots
- check = gtk_check_button_new_with_label( _( "Snapshots" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bSnapShots, DLG_CHECK_BOOL );
-
- // load last project on open
- check = gtk_check_button_new_with_label( _( "Load last project on open" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLoadLast, DLG_CHECK_BOOL );
-
- // load last map on open
- check = gtk_check_button_new_with_label( _( "Load last map on open" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bLoadLastMap, DLG_CHECK_BOOL );
-
- // Auto save..
- // container
- hbox2 = gtk_hbox_new( FALSE, 5 );
- gtk_widget_show( hbox2 );
- gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
- gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 0 );
-
- // label
- check = gtk_check_button_new_with_label( _( "Auto save every" ) );
- gtk_widget_show( check );
- gtk_box_pack_start( GTK_BOX( hbox2 ), check, FALSE, FALSE, 0 );
- AddDialogData( check, &m_bAutoSave, DLG_CHECK_BOOL );
-
- // spinner
- spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 60, 1, 10, 10 ) ), 1, 0 );
- gtk_widget_show( spin );
- gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, FALSE, 0 );
- gtk_widget_set_usize( spin, 60, -2 );
- AddDialogData( spin, &m_nAutoSave, DLG_SPIN_INT );
-
- // label
- label = gtk_label_new( _( "minutes" ) );
- gtk_widget_show( label );
- gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Paths group *********/
- preflabel = gtk_label_new( _( "Paths" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Paths" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // prefab path
- // table
- table = gtk_table_new( 3, 3, FALSE );
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- // label
- label = gtk_label_new( _( "Prefab path:" ) );
- gtk_widget_show( label );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
-
- // path entry
- entry = gtk_entry_new();
- gtk_widget_show( entry );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 240, -2 );
- gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 1, 0 );
- AddDialogData( entry, &m_strPrefabPath, DLG_ENTRY_TEXT );
-
-#if 0
- // browse button
- button = gtk_button_new_with_label( "..." );
- gtk_widget_show( button );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseprefab ), this );
- gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-#endif
-
- // User ini path
- // label
- label = gtk_label_new( _( "User INI path:" ) );
- gtk_widget_show( label );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
-
- // user ini path entry
- entry = gtk_entry_new();
- gtk_widget_show( entry );
- gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 1, 0 );
- AddDialogData( entry, &m_strUserPath, DLG_ENTRY_TEXT );
-
- // user ini browse button
- button = gtk_button_new_with_label( "..." );
- gtk_widget_show( button );
- gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnBtnBrowseuserini ), this );
- gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // Add the page to the notebook
- gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
-
- /******** Brush group ********/
- preflabel = gtk_label_new( _( "Brush" ) );
- gtk_widget_show( preflabel );
- pageframe = gtk_frame_new( _( "Brush" ) );
- gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
- gtk_widget_show( pageframe );
- vbox = gtk_vbox_new( FALSE, 5 );
- gtk_widget_show( vbox );
- gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
-
- // default texture scale
- // table
- table = gtk_table_new( 2, 1, FALSE ); // I believe that the 2 and 1 are switched here, and this is
- // intentional to be consistent with other calls to gtk_table_new()
- // [that are probably also switched].
- gtk_widget_show( table );
- gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
- gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
- gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
-
- // label
- label = gtk_label_new( _( "Default texture scale:" ) );
- gtk_widget_show( label );
- gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
- gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
- (GtkAttachOptions) ( 0 ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
-
- // scale entry
- entry = gtk_entry_new();
- gtk_widget_show( entry );
- gtk_widget_set_usize( GTK_WIDGET( entry ), 60, -2 );
- gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
- (GtkAttachOptions) ( GTK_FILL ),
- (GtkAttachOptions) ( 0 ), 0, 0 );
- AddDialogData( entry, &m_fDefTextureScale, DLG_ENTRY_FLOAT );