mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[lvcs] show new local history in a dialog by default for a file or directory
GitOrigin-RevId: 7ec093462238ce45ecb5cf33fd46b1f98e5d3bfc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ee02c88786
commit
e4452e15b8
@@ -81,13 +81,6 @@
|
||||
<advancedSetting id="localHistory.daysToKeep" default="5" groupKey="group.advanced.settings.ide"/>
|
||||
|
||||
<statistics.counterUsagesCollector implementationClass="com.intellij.platform.lvcs.impl.statistics.LocalHistoryCounter"/>
|
||||
|
||||
<applicationService serviceImplementation="com.intellij.platform.lvcs.impl.settings.ActivityViewApplicationSettings"/>
|
||||
<applicationConfigurable id="lvcs.activity"
|
||||
parentId="project.propVCSSupport.Mappings"
|
||||
provider="com.intellij.platform.lvcs.impl.settings.ActivityConfigurableProvider"
|
||||
key="activity.configurable.title"
|
||||
bundle="messages.LocalHistoryBundle"/>
|
||||
</extensions>
|
||||
|
||||
<applicationListeners>
|
||||
|
||||
@@ -91,10 +91,6 @@ action.ActivityView.Revert.text=Revert to Revision
|
||||
action.ActivityView.RevertDifferences.text=Revert Selection
|
||||
action.ActivityView.CreatePatch.text=Create Patch\u2026
|
||||
|
||||
activity.configurable.title=Activity History
|
||||
activity.configurable.enable.checkbox.title=Enable the Local History tool window
|
||||
activity.configurable.enable.checkbox.comment=When disabled, Local History is shown in a new window
|
||||
|
||||
# used externally
|
||||
dialog.title.revert=Revert
|
||||
message.do.you.want.to.proceed={0}\n\nDo you want to proceed?
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class ShowHistoryAction extends LocalHistoryAction {
|
||||
protected void actionPerformed(@NotNull Project p, @NotNull IdeaGateway gw, @NotNull AnActionEvent e) {
|
||||
VirtualFile f = Objects.requireNonNull(getFile(e));
|
||||
if (ActivityView.isViewEnabled()) {
|
||||
ActivityView.showInToolWindow(p, gw, ActivityScope.fromFile(f));
|
||||
ActivityView.showInDialog(p, gw, ActivityScope.fromFile(f));
|
||||
}
|
||||
else if (f.isDirectory()) {
|
||||
LocalHistoryCounter.INSTANCE.logLocalHistoryOpened(LocalHistoryCounter.Kind.Directory);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public final class ShowSelectionHistoryAction extends ShowHistoryAction {
|
||||
int to = sel.getSelectionEndLineNumber();
|
||||
|
||||
if (ActivityView.isViewEnabled()) {
|
||||
ActivityView.showInToolWindow(p, gw, new ActivityScope.Selection(f, from, to));
|
||||
ActivityView.showInDialog(p, gw, new ActivityScope.Selection(f, from, to));
|
||||
}
|
||||
else {
|
||||
LocalHistoryCounter.INSTANCE.logLocalHistoryOpened(LocalHistoryCounter.Kind.Selection);
|
||||
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.lvcs.impl.settings
|
||||
|
||||
import com.intellij.application.options.editor.CheckboxDescriptor
|
||||
import com.intellij.application.options.editor.checkBox
|
||||
import com.intellij.history.integration.LocalHistoryBundle
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.options.BoundConfigurable
|
||||
import com.intellij.openapi.options.Configurable
|
||||
import com.intellij.openapi.options.ConfigurableProvider
|
||||
import com.intellij.openapi.options.SearchableConfigurable
|
||||
import com.intellij.openapi.ui.DialogPanel
|
||||
import com.intellij.platform.lvcs.impl.ui.ActivityView
|
||||
import com.intellij.ui.dsl.builder.panel
|
||||
|
||||
class ActivityConfigurable : BoundConfigurable(LocalHistoryBundle.message("activity.configurable.title")), SearchableConfigurable {
|
||||
override fun createPanel(): DialogPanel = panel {
|
||||
val activityViewApplicationSettings = service<ActivityViewApplicationSettings>()
|
||||
row {
|
||||
checkBox(CheckboxDescriptor(LocalHistoryBundle.message("activity.configurable.enable.checkbox.title"),
|
||||
activityViewApplicationSettings::isActivityToolWindowEnabled))
|
||||
.comment(LocalHistoryBundle.message("activity.configurable.enable.checkbox.comment"))
|
||||
}
|
||||
}
|
||||
|
||||
override fun getId(): String = "lvcs.activity"
|
||||
}
|
||||
|
||||
class ActivityConfigurableProvider : ConfigurableProvider() {
|
||||
override fun createConfigurable(): Configurable? {
|
||||
if (!ActivityView.isViewAvailable()) return null
|
||||
return ActivityConfigurable()
|
||||
}
|
||||
|
||||
override fun canCreateConfigurable() = ActivityView.isViewAvailable()
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.lvcs.impl.settings
|
||||
|
||||
import com.intellij.openapi.components.*
|
||||
|
||||
@State(name = "Lvcs.Activity.App.Settings", storages = [Storage("lvcs.xml")], category = SettingsCategory.UI)
|
||||
class ActivityViewApplicationSettings : SimplePersistentStateComponent<ActivityViewApplicationSettings.State>(State()) {
|
||||
|
||||
class State : BaseState() {
|
||||
var isActivityToolWindowEnabled by property(true)
|
||||
}
|
||||
|
||||
var isActivityToolWindowEnabled: Boolean
|
||||
get() = state.isActivityToolWindowEnabled
|
||||
set(value) {
|
||||
state.isActivityToolWindowEnabled = value
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import com.intellij.history.integration.LocalHistoryBundle
|
||||
import com.intellij.history.integration.ui.views.FileHistoryDialog
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager
|
||||
@@ -28,7 +27,6 @@ import com.intellij.openapi.vcs.changes.VcsEditorTabFilesManager
|
||||
import com.intellij.openapi.vcs.changes.ui.TreeHandlerEditorDiffPreview
|
||||
import com.intellij.openapi.wm.IdeFocusManager
|
||||
import com.intellij.platform.lvcs.impl.*
|
||||
import com.intellij.platform.lvcs.impl.settings.ActivityViewApplicationSettings
|
||||
import com.intellij.platform.lvcs.impl.statistics.LocalHistoryCounter
|
||||
import com.intellij.platform.lvcs.impl.ui.SingleFileActivityDiffPreview.Companion.DIFF_PLACE
|
||||
import com.intellij.platform.util.coroutines.childScope
|
||||
@@ -347,15 +345,10 @@ class ActivityView(private val project: Project, gateway: IdeaGateway, val activ
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isViewEnabled(): Boolean {
|
||||
if (!isViewAvailable()) return false
|
||||
return service<ActivityViewApplicationSettings>().isActivityToolWindowEnabled
|
||||
}
|
||||
fun isViewEnabled(): Boolean = isViewAvailable()
|
||||
|
||||
@JvmStatic
|
||||
fun isViewAvailable(): Boolean {
|
||||
return ApplicationInfo.getInstance().isEAP || Registry.`is`("lvcs.show.activity.view")
|
||||
}
|
||||
fun isViewAvailable(): Boolean = Registry.`is`("lvcs.show.activity.view")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -732,8 +732,8 @@ compiler.process.use.portable.caches=false
|
||||
compiler.process.use.portable.caches.restartRequired=true
|
||||
compiler.process.use.portable.caches.description=Warning: for Intellij project only! \nTurn on to download compilation caches for reducing build time.
|
||||
|
||||
lvcs.show.activity.view=false
|
||||
lvcs.show.activity.view.description=Show "Local History" in a toolwindow
|
||||
lvcs.show.activity.view=true
|
||||
lvcs.show.activity.view.description=Show new ui for the "Local History"
|
||||
lvcs.open.diff.automatically=true
|
||||
lvcs.open.diff.automatically.description=Open diff tab (if it is configured to be opened in the editor) when "Local History" tab is shown.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user