Skip to content

Commit

Permalink
[v0.2.3] Fix fatal bug!
Browse files Browse the repository at this point in the history
  • Loading branch information
zxj5470 committed Apr 12, 2018
1 parent 80fc23f commit 56cbf41
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 38 deletions.
41 changes: 27 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,40 @@ plugins {
id "org.jetbrains.intellij" version '0.3.1'
}

def useCLion = true
//def useCLion = false
def bugKtDoc = []
def local_path = ""

switch (alternative_ide) {
case 'IJ':
break
case 'CL':
local_path = clion_path
bugKtDoc += clion_kn
break
case 'AC':
local_path = appcode_path
bugKtDoc += appcode_kn
break
}

allprojects {
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.intellij'
intellij {
type idea_type
updateSinceUntilBuild false
if (useCLion) {
localPath local_path
bugKtDoc += 'org.intellij.plugins.markdown:181.2668'
bugKtDoc += 'org.jetbrains.kotlin.native.clion:181.4445.17'
} else {
version idea_version
bugKtDoc += 'kotlin'
}
plugins bugKtDoc.toArray()
}

intellij {
type idea_type
updateSinceUntilBuild false
version idea_version
if (local_path != "") {
localPath local_path
alternativeIdePath local_path
bugKtDoc += 'org.intellij.plugins.markdown:181.2668'
} else {
bugKtDoc += 'kotlin'
}
plugins bugKtDoc.toArray()
}

patchPluginXml {
Expand Down
4 changes: 4 additions & 0 deletions changeNotes.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.2.3<br/>
<ul>
<li>Fix fatal bug!</li>
</ul>
v0.2.2<br/>
<ul>
<li>Big News: Add supports to CLion and AppCode!</li>
Expand Down
11 changes: 9 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@ plugin_name=BugKotlinDocument
idea_version=2017.3
idea_type=IC
systemProp.file.encoding=UTF-8
plugin_version=0.2.2
local_path=/Users/paul/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/181.4445.17/CLion.app/Contents/
plugin_version=0.2.3
#alternative_ide=IJ
alternative_ide=CL
#alternative_ide=AC
clion_path=/Volumes/OS_X_Files/jetbrains/apps/CLion/ch-1/181.4445.17/CLion.app/Contents/
clion_kn=org.jetbrains.kotlin.native.clion:181.4445.17
appcode_path=/Volumes/OS_X_Files/jetbrains/apps/AppCode/ch-0/181.4445.86/AppCode.app/Contents
appcode_kn=org.jetbrains.kotlin.native.appcode:181.4445.101

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package com.github.zxj5470.bugktdoc.options

import com.github.zxj5470.bugktdoc.BugKtDocBundle
import com.github.zxj5470.bugktdoc.globalSettings
import com.github.zxj5470.bugktdoc.isKotlinNative
import com.github.zxj5470.bugktdoc.util.*
import com.intellij.ui.layout.verticalPanel
import com.intellij.util.PlatformUtils
import javax.swing.JCheckBox
import javax.swing.JPanel

Expand Down Expand Up @@ -37,39 +35,31 @@ class BugKtDocConfigureFormImpl : BugKtDocConfigureForm() {
}

init {
if (isKotlinNative) {
thisPanel
}
thisPanel
addSwitchListener()
initListener()
observer()
}

private fun addSwitchListener() {
useBugKtDoc.addActionListener {
useBugKtDoc.isSelected {
useBugKtDoc?.addActionListener {
observer()
}
}

private fun observer() {
useBugKtDoc?.apply {
if (this.isSelected) {
showUnitTypeDefault.isEnabled = true
showClassFieldProperty.isEnabled = true
showConstructor.isEnabled = true
}.orElse {
} else {
showUnitTypeDefault.isEnabled = false
showClassFieldProperty.isEnabled = false
showConstructor.isEnabled = false
}
}
}

private fun initListener() {
useBugKtDoc.isSelected {
showUnitTypeDefault.isEnabled = true
showClassFieldProperty.isEnabled = true
showConstructor.isEnabled = true
}.orElse {
showUnitTypeDefault.isEnabled = false
showClassFieldProperty.isEnabled = false
showConstructor.isEnabled = false
}
}

override fun isModified(): Boolean {
return true
}
Expand All @@ -79,7 +69,7 @@ class BugKtDocConfigureFormImpl : BugKtDocConfigureForm() {
globalSettings.alwaysShowUnitReturnType = false
globalSettings.alwaysShowClassFieldProperty = true
globalSettings.alwaysShowConstructor = true
initListener()
observer()
}

override fun getDisplayName() = BugKtDocBundle.message("bugktdoc.settings.title")
Expand Down

0 comments on commit 56cbf41

Please sign in to comment.