]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/build.cpp
Merge commit 'e7c45da823515747a88569374d62717b72dcf078' into garux-merge
[xonotic/netradiant.git] / radiant / build.cpp
index 6462e382ab66aa3f61ccdadb2cfca67fdcead48d..3a524a76465f7fa727d966f19eab7f445b7a820f 100644 (file)
@@ -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<BuildMenuItem, void(), &BuildMenuItem::run> 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() );
+       }
+}