X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=radiant%2Fmainframe.cpp;h=f39805bfd3bf09f0896abbf9cafad7415afbb59b;hp=8a7691af94b0d16d92cd740429f47d90e6b2c832;hb=6ed444ce55f3a5c07f4d4a8625352f239dd1f25b;hpb=65161b9bd15a81a20105a8e06daf4768d4d23c73 diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 8a7691af..f39805bf 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -574,39 +574,28 @@ struct PakPath4 { bool g_disableEnginePath = false; bool g_disableHomePath = false; -void Paths_constructPreferences( PreferencesPage& page ){ +void Paths_constructBasicPreferences( PreferencesPage& page ) { page.appendPathEntry( "Engine Path", true, make_property(g_strEnginePath) ); +} - page.appendCheckBox( - "", "Do not use Engine Path", - g_disableEnginePath - ); +void Paths_constructPreferences( PreferencesPage& page ){ + Paths_constructBasicPreferences( page ); - page.appendCheckBox( - "", "Do not use Home Path", - g_disableHomePath - ); + page.appendSpacer( 4 ); + page.appendLabel( "", "Advanced options" ); + page.appendCheckBox( "", "Do not use Engine Path", g_disableEnginePath ); + page.appendCheckBox( "", "Do not use Home Path", g_disableHomePath ); - for ( int i = 0; i < g_pakPathCount; i++ ) { - std::string label = "Pak Path " + std::to_string(i); - switch (i) { - case 0: - page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); - break; - case 1: - page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); - break; - case 2: - page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); - break; - case 3: - page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); - break; - case 4: - page.appendPathEntry( label.c_str(), true, make_property( g_strPakPath[i] ) ); - break; - } - } + page.appendSpacer( 4 ); + page.appendLabel( "", "Only a very few games support Pak Paths," ); + page.appendLabel( "", "if you don't know what it is, leave this blank." ); + + const char *label = "Pak Path "; + page.appendPathEntry( label, true, make_property( g_strPakPath[0] ) ); + page.appendPathEntry( label, true, make_property( g_strPakPath[1] ) ); + page.appendPathEntry( label, true, make_property( g_strPakPath[2] ) ); + page.appendPathEntry( label, true, make_property( g_strPakPath[3] ) ); + page.appendPathEntry( label, true, make_property( g_strPakPath[4] ) ); } void Paths_constructPage( PreferenceGroup& group ){ @@ -623,14 +612,14 @@ class PathsDialog : public Dialog { public: ui::Window BuildDialog(){ - auto frame = create_dialog_frame( "Path settings", ui::Shadow::ETCHED_IN ); + auto frame = create_dialog_frame( "Path Settings", ui::Shadow::ETCHED_IN ); auto vbox2 = create_dialog_vbox( 0, 4 ); frame.add(vbox2); { - PreferencesPage preferencesPage( *this, vbox2 ); - Paths_constructPreferences( preferencesPage ); + PreferencesPage page( *this, vbox2 ); + Paths_constructBasicPreferences( page ); } return ui::Window(create_simple_modal_dialog_window( "Engine Path Not Found", m_modal, frame )); @@ -1815,9 +1804,11 @@ void Selection_SnapToGrid(){ static gint qe_every_second( gpointer data ){ - GdkModifierType mask; + if (g_pParentWnd == nullptr) + return TRUE; - gdk_window_get_pointer( 0, 0, 0, &mask ); + GdkModifierType mask; + gdk_window_get_pointer( gtk_widget_get_window(g_pParentWnd->m_window), nullptr, nullptr, &mask ); if ( ( mask & ( GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK ) ) == 0 ) { QE_CheckAutoSave(); @@ -1929,15 +1920,18 @@ void ScreenUpdates_Disable( const char* message, const char* title ){ bool isActiveApp = MainFrame_isActiveApp(); g_wait = create_wait_dialog( title, message ); - gtk_grab_add( g_wait.m_window ); if ( isActiveApp ) { g_wait.m_window.show(); + gtk_grab_add( g_wait.m_window ); ScreenUpdates_process(); } } else if ( g_wait.m_window.visible() ) { g_wait.m_label.text(message); + if ( GTK_IS_WINDOW(g_wait.m_window) ) { + gtk_grab_add(g_wait.m_window); + } ScreenUpdates_process(); } g_wait_stack.push_back( message ); @@ -2775,10 +2769,14 @@ MainFrame::~MainFrame(){ for ( std::vector::iterator i = g_floating_windows.begin(); i != g_floating_windows.end(); ++i ) { +#ifndef WORKAROUND_MACOS_GTK2_DESTROY i->destroy(); +#endif } +#ifndef WORKAROUND_MACOS_GTK2_DESTROY m_window.destroy(); +#endif } void MainFrame::SetActiveXY( XYWnd* p ){ @@ -3306,7 +3304,7 @@ void MainFrame::SetStatusText( CopiedString& status_text, const char* pText ){ } void Sys_Status( const char* status ){ - if ( g_pParentWnd != 0 ) { + if ( g_pParentWnd != nullptr ) { g_pParentWnd->SetStatusText( g_pParentWnd->m_command_status, status ); } } @@ -3338,7 +3336,7 @@ void MainFrame::SetGridStatus(){ } void GridStatus_onTextureLockEnabledChanged(){ - if ( g_pParentWnd != 0 ) { + if ( g_pParentWnd != nullptr ) { g_pParentWnd->SetGridStatus(); } }