package org.sikuli.slides.guis;

import java.io.File;

import org.sikuli.slides.utils.Constants;
import org.sikuli.slides.utils.Utils;
import org.sikuli.slides.core.SikuliPowerPoint;


/**
 * 
 * @author Khalid Alharbi
 * Khalid.Alharbi@Colorado.edu
 *
 */

public class Main{
	
	  
	private void intiProject(){
		// create the project working directory directory
		if(!Utils.createWorkingDirectory()){
			System.err.println("Failed to create sikuli-slides working directory in +"+System.getProperty("java.io.tmpdir"));
			System.exit(1);
		}
		//TODO: remove this
		else{
			//System.out.println("created working directory in: "+Constants.workingDirectoryPath);
		}
	}

	/**
	 * starts processing the work
	 */
	public void doSikuliPowerPoint(File file){	
		Constants.Execution_Start_Time=System.currentTimeMillis();
		if(file!=null){
			// run sikuli-slides work
			SikuliPowerPoint sikuliPowerPoint=new SikuliPowerPoint(file);
			sikuliPowerPoint.runSikuliPowerPoint();
		}
	}
	
	public static void main(String[]args){
		Main main=new Main();
		main.intiProject();
		
		// if no arguments are passed, run the GUI mode
		if(args.length==0){
			MainUI.runGuiTool();
		}
		// Otherwise, run the command line tool and get the file name
		else{			
			String FileName=MainCommandLine.runCommandLineTool(args);
			if(FileName!=null){
				main.doSikuliPowerPoint(new File(FileName));
			}
		}
	}
	
}
@@ -560,16 +560,18 @@
  this%0A%09%09
+/*
 else%7B%0A%09%09
@@ -571,18 +571,16 @@
 lse%7B%0A%09%09%09
-//
 System.o
@@ -655,24 +655,26 @@
 ryPath);%0A%09%09%7D
+*/
 %0A%09%7D%0A%0A%09/**%0A%09 
@@ -813,16 +813,16 @@
 llis();%0A
-
 %09%09if(fil
@@ -831,16 +831,208 @@
 =null)%7B%0A
+%09%09%09// display Tutorial Controller UI when tutorial mode is running%0A%09%09%09if(Constants.TUTORIAL_MODE)%7B%0A%09%09%09%09System.out.println(%22Running in tutorial mode...%22);%0A%09%09%09%09TutorialConrollerUI.runUI();%0A%09%09%09%7D%0A
 %09%09%09// ru

add display controller UI when running tutorial mode