Skip to content

Commit 845ebf9

Browse files
committed
change setting button to click instead of hover
1 parent 59b458d commit 845ebf9

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

java/src/main/kotlin/org/digma/intellij/plugin/idea/runcfg/AutoOtelAgentRunConfigurationExtension.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class AutoOtelAgentRunConfigurationExtension : RunConfigurationExtension() {
149149

150150
private fun cleanGradleSettings(configuration: RunConfigurationBase<*>) {
151151
configuration as GradleRunConfiguration
152+
Log.log(logger::debug,"Cleaning gradle configuration {}",configuration)
152153
if (configuration.settings.env.containsKey(ORG_GRADLE_JAVA_TOOL_OPTIONS)){
153154
val orgJavaToolOptions = configuration.settings.env[ORG_GRADLE_JAVA_TOOL_OPTIONS]
154155
configuration.settings.env[JAVA_TOOL_OPTIONS] = orgJavaToolOptions

java/src/main/kotlin/org/digma/intellij/plugin/idea/runcfg/OTELJarProvider.kt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import org.digma.intellij.plugin.log.Log
1111
import java.io.File
1212
import java.util.concurrent.locks.ReentrantLock
1313

14+
private const val TEMP_JARS_DIR_PREFIX = "temp-digma-otel-jars"
15+
1416
class OTELJarProvider {
1517

1618
private val logger: Logger = Logger.getInstance(OTELJarProvider::class.java)
@@ -76,7 +78,8 @@ class OTELJarProvider {
7678
return true
7779
}
7880
if (downloadDir == null || !filesExist(project)) {
79-
downloadDir = FileUtil.createTempDirectory("digma-otel-jars", null, true)
81+
downloadDir = FileUtil.createTempDirectory(TEMP_JARS_DIR_PREFIX, null, true)
82+
deleteOldDirsThatMayStillBeThere(downloadDir)
8083
Log.log(logger::debug,"downloading otel agent jar to {}", downloadDir)
8184
downloadJars(project,downloadDir!!,startup)
8285
//on startup the download is in background so just return true
@@ -96,6 +99,20 @@ class OTELJarProvider {
9699
return true
97100
}
98101

102+
private fun deleteOldDirsThatMayStillBeThere(nextDownloadDir: File?) {
103+
nextDownloadDir?.let { dir ->
104+
val parentDir = dir.parentFile
105+
parentDir?.let {parentDir ->
106+
parentDir.listFiles { file ->
107+
!file.name.equals(nextDownloadDir.name) && file.isDirectory && file.name.contains(TEMP_JARS_DIR_PREFIX)
108+
}.forEach { dirToDelete ->
109+
Log.log(logger::debug,"deleting old temp dir {}", dirToDelete)
110+
dirToDelete.delete()
111+
}
112+
}
113+
}
114+
}
115+
99116
private fun filesExist(project: Project): Boolean {
100117
val otelJar = getOtelAgentJar(project)
101118
val digmaJar = getDigmaAgentExtensionJar(project)

src/main/kotlin/org/digma/intellij/plugin/ui/common/NavigationPanel.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,6 @@ class NavigationPanel(
177177
project = project
178178
)
179179
}
180-
override fun mouseEntered(e: MouseEvent?) {
181-
showSettingsMessage(
182-
threeDotsIcon = iconLabel,
183-
project = project
184-
)
185-
}
186180
override fun mouseExited(e: MouseEvent?) {}
187181
override fun mousePressed(e: MouseEvent?) {}
188182
})
@@ -195,6 +189,6 @@ class NavigationPanel(
195189
}
196190

197191
private fun showSettingsMessage(threeDotsIcon: JLabel, project: Project) {
198-
HintManager.getInstance().showHint(SettingsHintPanel(project), RelativePoint.getSouthWestOf(threeDotsIcon), HintManager.HIDE_BY_ESCAPE, 4000)
192+
HintManager.getInstance().showHint(SettingsHintPanel(project), RelativePoint.getSouthWestOf(threeDotsIcon), HintManager.HIDE_BY_ESCAPE, 5000)
199193
}
200194
}

0 commit comments

Comments
 (0)