IJPL-158105 Settings sync between 2024.1 and 2024.2 prompts to disable new UI in 2024.2 if is was disabled in 2024.1

GitOrigin-RevId: dc14421be467633cb1702293d2cc157b92d55c89
This commit is contained in:
Sergey Pak
2024-07-10 17:47:08 +02:00
committed by intellij-monorepo-bot
parent 9011339c6c
commit e8d44eaeea
3 changed files with 1 additions and 21 deletions

View File

@@ -73,16 +73,12 @@ sync.restart.notification.title=Restart required after syncing settings
sync.notification.restart.message.plugin.install=Restart the IDE to install {0,choice,1#plugin|2#plugins}: {1}{0,choice,3#...}
sync.notification.restart.message.plugin.enable=Restart the IDE to enable {0,choice,1#plugin|2#plugins}: {1}{0,choice,3#...}
sync.notification.restart.message.plugin.disable=Restart the IDE to disable {0,choice,1#plugin|2#plugins}: {1}{0,choice,3#...}
sync.notification.restart.message.new.ui.enable=Restart the IDE to enable new UI
sync.notification.restart.message.new.ui.disable=Restart the IDE to disable new UI
sync.notification.restart.message.list.title=Restart the IDE to complete the following actions:
# {0} - count of plugins, {1} - coma separated list of plugins (max two plugins)
sync.notification.restart.message.list.entry.plugin.install=Install {0,choice,1#plugin|2#plugins}: {1}{0,choice,3#...}
sync.notification.restart.message.list.entry.plugin.enable=Enable {0,choice,1#plugin|2#plugins}: {1}{0,choice,3#...}
sync.notification.restart.message.list.entry.plugin.disable=Disable {0,choice,1#plugin|2#plugins}: {1}{0,choice,3#...}
sync.notification.restart.message.list.entry.new.ui.enable=Enable new UI
sync.notification.restart.message.list.entry.new.ui.disable=Disable new UI
# {0} - action (install, enable, disable), {1} - comma separated list of plugins
sync.restart.notification.submessage.plugins={0} plugin(s): {1}...

View File

@@ -111,15 +111,4 @@ internal class RestartForPluginDisable(val plugins: Collection<String>) : Restar
override fun getMultiReasonNotificationListEntry(number: Int): String {
return "$number. " + SettingsSyncBundle.message("sync.notification.restart.message.list.entry.plugin.disable", plugins.size, plugins.take(2).joinToString(", "))
}
}
internal class RestartForNewUI(val enable: Boolean) : RestartReason() {
override val sortingPriority = 3
override fun getSingleReasonNotificationMessage(): String {
return SettingsSyncBundle.message(if (enable) "sync.notification.restart.message.new.ui.enable" else "sync.notification.restart.message.new.ui.disable")
}
override fun getMultiReasonNotificationListEntry(number: Int): String {
return "$number. " + SettingsSyncBundle.message(if (enable) "sync.notification.restart.message.list.entry.new.ui.enable" else "sync.notification.restart.message.list.entry.new.ui.disable")
}
}
}

View File

@@ -107,7 +107,6 @@ internal class SettingsSyncIdeMediatorImpl(private val componentStore: Component
RestartForPluginInstall::class.java -> RestartForPluginInstall(reasons.flatMap { (it as RestartForPluginInstall).plugins })
RestartForPluginEnable::class.java -> RestartForPluginEnable(reasons.flatMap { (it as RestartForPluginEnable).plugins })
RestartForPluginDisable::class.java -> RestartForPluginDisable(reasons.flatMap { (it as RestartForPluginDisable).plugins })
RestartForNewUI::class.java -> reasons.lastOrNull()
else -> null
}
}
@@ -288,10 +287,6 @@ internal class SettingsSyncIdeMediatorImpl(private val componentStore: Component
if (lastChanged.isNotEmpty()) {
componentStore.reloadComponents(lastChanged, emptyList())
}
val newUI = Registry.get(NewUiValue.KEY)
if (newUI.isChangedSinceAppStart) {
SettingsSyncEvents.getInstance().fireRestartRequired(RestartForNewUI(newUI.asBoolean()))
}
}
}