forked from qt-creator/qt-creator
		
	Lua: Add function to stop running configurations
Change-Id: I85cb9113efeb0c7b1bdd6e12eb7cabe369458dee Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
		@@ -113,6 +113,26 @@ void setupProjectModule()
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
        result["stopRunConfigurationsByName"] =
 | 
			
		||||
            [](const QString &displayName, const std::optional<bool> &force) -> int {
 | 
			
		||||
                const auto runControls = ProjectExplorerPlugin::instance()->allRunControls();
 | 
			
		||||
 | 
			
		||||
                int stoppedCount = 0;
 | 
			
		||||
                for (const auto rc : runControls) {
 | 
			
		||||
                    if (rc && rc->displayName() == displayName) {
 | 
			
		||||
                        stoppedCount++;
 | 
			
		||||
 | 
			
		||||
                        if (force.has_value() && force.value()) {
 | 
			
		||||
                            rc->forceStop();
 | 
			
		||||
                        } else {
 | 
			
		||||
                            rc->initiateStop();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return stoppedCount;
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
        result["RunMode"] = lua.create_table_with(
 | 
			
		||||
            "Normal", Constants::NORMAL_RUN_MODE, "Debug", Constants::DEBUG_RUN_MODE);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user