X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fbuild.cpp;h=3a524a76465f7fa727d966f19eab7f445b7a820f;hb=839c9693774fdb0e420391f65b8066e8bd04c591;hp=6462e382ab66aa3f61ccdadb2cfca67fdcead48d;hpb=1b43d194324664a27b2639b326ae55ec996a4c01;p=xonotic%2Fnetradiant.git diff --git a/radiant/build.cpp b/radiant/build.cpp index 6462e382..3a524a76 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -652,6 +652,7 @@ class ProjectList public: Project& m_project; ui::ListStore m_store{ui::null}; +GtkWidget* m_buildView; bool m_changed; ProjectList( Project& project ) : m_project( project ), m_changed( false ){ } @@ -686,6 +687,8 @@ gboolean project_cell_edited(ui::CellRendererText cell, gchar* path_string, gcha gtk_list_store_set( projectList->m_store, &iter, 0, new_text, -1 ); projectList->m_store.append(); + //make command field activatable + g_signal_emit_by_name( G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( projectList->m_buildView ) ) ), "changed" ); } gtk_tree_path_free( path ); @@ -864,6 +867,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi view.show(); + projectList.m_buildView = buildView; projectList.m_store = store; scr.add(view); @@ -919,6 +923,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi namespace { CopiedString g_buildMenu; +CopiedString g_lastExecutedBuild; } void LoadBuildMenu(); @@ -959,6 +964,7 @@ BuildMenuItem( const char* name, ui::MenuItem item ) : m_name( name ), m_item( item ){ } void run(){ + g_lastExecutedBuild = m_name; RunBSP( m_name ); } typedef MemberCaller RunCaller; @@ -1032,3 +1038,13 @@ void BuildMenu_Construct(){ void BuildMenu_Destroy(){ SaveBuildMenu(); } + + +void Build_runRecentExecutedBuild(){ + if( g_lastExecutedBuild.empty() ){ + g_BuildMenuItems.begin()->run(); + } + else{ + RunBSP( g_lastExecutedBuild.c_str() ); + } +}