-
Notifications
You must be signed in to change notification settings - Fork 30
little UI impovements: combined logs and targets tool windows into one, removed verbose widget #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/actions/ChangeVerboseModeAction.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.utbot.cpp.clion.plugin.actions | ||
|
||
import com.intellij.openapi.actionSystem.ActionPlaces | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.actionSystem.CommonDataKeys | ||
import com.intellij.openapi.actionSystem.ToggleAction | ||
import com.intellij.openapi.project.Project | ||
import org.utbot.cpp.clion.plugin.UTBot | ||
import org.utbot.cpp.clion.plugin.settings.settings | ||
|
||
class ChangeVerboseModeAction : ToggleAction() { | ||
override fun isSelected(e: AnActionEvent): Boolean { | ||
updateActionText(e) | ||
return e.getRequiredData(CommonDataKeys.PROJECT).settings.storedSettings.verbose | ||
} | ||
|
||
override fun isDumbAware(): Boolean = true | ||
|
||
override fun update(e: AnActionEvent) { | ||
super.update(e) | ||
e.presentation.isEnabledAndVisible = (e.project != null) | ||
} | ||
|
||
override fun setSelected(e: AnActionEvent, state: Boolean) { | ||
with(e.getRequiredData(CommonDataKeys.PROJECT).settings) { | ||
storedSettings.verbose = state | ||
fireUTBotSettingsChanged() | ||
} | ||
updateActionText(e) | ||
} | ||
|
||
private fun updateActionText(e: AnActionEvent) { | ||
e.presentation.text = getActionText(e.getRequiredData(CommonDataKeys.PROJECT), e.place) | ||
} | ||
|
||
companion object { | ||
private fun getActionText(project: Project, place: String? = null): String { | ||
val isVerboseEnabled = project.settings.storedSettings.verbose | ||
var newText = if (isVerboseEnabled) UTBot.message("actions.verbose.enabled") | ||
else UTBot.message("actions.verbose.disabled") | ||
if (place != null && ActionPlaces.isPopupPlace(place)) { | ||
newText = if (isVerboseEnabled) | ||
UTBot.message("actions.verbose.menu.enabled") | ||
else UTBot.message("actions.verbose.menu.disabled") | ||
} | ||
return newText | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
...in/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/statusBar/UTBotStatusBarVerboseWidget.kt
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
...lugin/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/statusBar/VerboseModeWidgetFactory.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...n/kotlin/org/utbot/cpp/clion/plugin/ui/targetsToolWindow/UTBotTargetsToolWindowFactory.kt
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/userLog/ConsoleToolWindowProvider.kt
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
...n/src/main/kotlin/org/utbot/cpp/clion/plugin/ui/utbotToolWindow/UTBotToolWindowFactory.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.utbot.cpp.clion.plugin.ui.utbotToolWindow | ||
|
||
import com.intellij.openapi.components.service | ||
import com.intellij.openapi.diagnostic.Logger | ||
import com.intellij.openapi.project.DumbAware | ||
import com.intellij.openapi.project.Project | ||
import com.intellij.openapi.wm.ToolWindow | ||
import com.intellij.openapi.wm.ToolWindowFactory | ||
import org.utbot.cpp.clion.plugin.UTBot | ||
import org.utbot.cpp.clion.plugin.ui.utbotToolWindow.logsToolWindow.ConsoleToolWindow | ||
import org.utbot.cpp.clion.plugin.ui.utbotToolWindow.targetToolWindow.UTBotTargetsController | ||
|
||
class UTBotToolWindowFactory : ToolWindowFactory, DumbAware { | ||
private val logger = Logger.getInstance(this::class.java) | ||
|
||
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) { | ||
logger.info("createToolWindowContent was called") | ||
val contentManager = toolWindow.contentManager | ||
val targetsToolWindow = contentManager.factory.createContent( | ||
project.service<UTBotTargetsController>().targetsToolWindow, UTBot.message("toolwindow.targets.displayName"), false | ||
) | ||
val logsToolWindow = | ||
contentManager.factory.createContent(ConsoleToolWindow(project), UTBot.message("toolwindow.logs.displayName"), false) | ||
toolWindow.contentManager.addContent(logsToolWindow) | ||
toolWindow.contentManager.addContent(targetsToolWindow) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...on/plugin/ui/userLog/ConsoleToolWindow.kt → ...indow/logsToolWindow/ConsoleToolWindow.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rgetsToolWindow/UTBotTargetsController.kt → ...argetToolWindow/UTBotTargetsController.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes #443