 
   openFolder: (e) ->
     console.log 'openFolder'
+    el = e.currentTarget
+    if el.classList.contains(disabled) is true
+      return
     atom.pickFolder (paths) =>
       if paths?
-        console.log "select path:#{paths[0]}"
-        @modulePath.html paths[0]
+        path = paths[0]
+        selectEl = @selectProject[0]
+        console.log "select path:#{path}"
+        if el is selectEl
+          if @checkProjectPath(path)
+            for opt in selectEl.options
+              console.log opt,opt.value,path,opt.value is path
+              if opt.value is path
+                opt.selected = true
+                console.log '...'
+                return
+            @selectProject.find('option[value=""]').remove()
+            @setSelectItem path,null,null,true,true
+            console.log '!!!'
+            # optionExists = false
+            # @projects.forEach (projectPath,i) =>
+            #   if projectPath is
+            # if optionExists is no
+            # @selectProject.find("option[value='#{path}]'").prop 'selected',true
+          else
+            alert desc.selectProjectPath
+        else
+          @modulePath.html path
 
   onSelectChange: (e) ->
     el = e.currentTarget
-    # console.log el.value
-    @modulePath.html el.value
+    console.log el.value
+    if el.value is 'other'
+      @openFolder(e)
+    # @modulePath.html el.value
     @checkPath()
+
+  checkProjectPath: (path) ->
+    result = null
+    configPath = pathM.join path,desc.ProjectConfigFileName
+    return Util.isFileExist configPath,'sync'
 
   checkPath: ->
     path = @moduleId.getText().trim()

    @moduleName.getModel().onDidChange => @checkInput()
    # @mainEntry.getModel().onDidChange => @checkInput()
    @selectProject.on 'change',(e) => @onSelectChange(e)
    @moduleName.setText ''
    @moduleId.setText ''
    # @mainEntry.setText desc.mainEntryFileName

        @errorMsg2.addClass('hide')
      else
        @errorMsg2.removeClass('hide')
      projectPath = @getPath().trim()
      isProject = @modulePath.isProject = @checkProjectPath projectPath
      projectPath = pathM.join projectPath,'modules' if isProject


