mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
[settings-sync] IJPL-200647, IJPL-200649, IJPL-200650, IJPL-200651: improve "Disable Active Sync" dialog UI
(cherry picked from commit e87b3996883c8eff443f0744b859624d02741e7f) IJ-CR-174183 GitOrigin-RevId: 82d02279a17f59acad04952b2d6e6c12bb2b0e66
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9cb5da9829
commit
cf61e52839
@@ -73,8 +73,8 @@ disable.dialog.text=This will disable Settings Sync for this installation,\nleav
|
||||
# {0} - account type, i.e. JetBrains or Google
|
||||
disable.dialog.remove.data.box=Remove data from {0} account and disable for all IDEs
|
||||
disable.dialog.disable.button=Disable
|
||||
disable.active.sync.title=Disable Active Sync
|
||||
disable.active.sync.message=You need to disable the active sync to switch accounts
|
||||
disable.active.sync.title=Confirm Disabling the Active Sync
|
||||
disable.active.sync.message=The existing sync needs to be disabled before the active account can be changed. Would you like to disable the currently active sync?
|
||||
disable.remove.data.title=Removing Server Data\u2026
|
||||
disable.remove.data.failure=Failed to remove data from server: {0}. Backup and Sync has been disabled locally, but your data may still exist on the server. You can try again later or contact support.
|
||||
status.action.settings.sync=Backup and Sync\u2026
|
||||
|
||||
@@ -22,8 +22,8 @@ import com.intellij.openapi.options.ConfigurableProvider
|
||||
import com.intellij.openapi.project.DumbAwareAction
|
||||
import com.intellij.openapi.ui.DialogPanel
|
||||
import com.intellij.openapi.ui.DialogWrapper
|
||||
import com.intellij.openapi.ui.MessageDialogBuilder.Companion.yesNo
|
||||
import com.intellij.openapi.ui.Messages
|
||||
import com.intellij.openapi.ui.messages.MessagesService
|
||||
import com.intellij.openapi.ui.popup.JBPopup
|
||||
import com.intellij.openapi.ui.popup.ListSeparator
|
||||
import com.intellij.openapi.ui.popup.PopupStep
|
||||
@@ -61,8 +61,6 @@ import com.intellij.util.ui.JBUI
|
||||
import com.intellij.util.ui.NamedColorUtil
|
||||
import com.intellij.util.ui.StartupUiUtil.labelFont
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.time.withTimeout
|
||||
import kotlinx.coroutines.time.withTimeoutOrNull
|
||||
import java.awt.event.ItemEvent
|
||||
import java.util.concurrent.CancellationException
|
||||
import javax.swing.*
|
||||
@@ -422,19 +420,16 @@ internal class SettingsSyncConfigurable(private val coroutineScope: CoroutineSco
|
||||
}
|
||||
|
||||
private fun disableCurrentSyncDialog() : Boolean {
|
||||
val code = MessagesService.getInstance().showMessageDialog(
|
||||
null, null, message("disable.active.sync.message"), message("disable.active.sync.title"),
|
||||
arrayOf(Messages.getCancelButton(), message("disable.dialog.disable.button")),
|
||||
1, -1, Messages.getInformationIcon(), null, false, null
|
||||
)
|
||||
if (code == 1) {
|
||||
val disableSyncConfirmed = yesNo(message("disable.active.sync.title"), message("disable.active.sync.message"))
|
||||
.yesText(message("disable.dialog.disable.button"))
|
||||
.noText(CommonBundle.getCancelButtonText())
|
||||
.guessWindowAndAsk()
|
||||
if (disableSyncConfirmed) {
|
||||
enableCheckbox.isSelected = false
|
||||
disableSyncOption.set(DisableSyncType.DISABLE)
|
||||
handleDisableSync()
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
return disableSyncConfirmed
|
||||
}
|
||||
|
||||
private fun disableAndRemoveData() {
|
||||
@@ -747,10 +742,11 @@ internal class SettingsSyncConfigurable(private val coroutineScope: CoroutineSco
|
||||
|
||||
|
||||
|
||||
private suspend fun checkServerState(syncPanelHolder: SettingsSyncPanelHolder,
|
||||
communicator: SettingsSyncRemoteCommunicator,
|
||||
crossSyncAvailable: Boolean,
|
||||
) : Boolean {
|
||||
private suspend fun checkServerState(
|
||||
syncPanelHolder: SettingsSyncPanelHolder,
|
||||
communicator: SettingsSyncRemoteCommunicator,
|
||||
crossSyncAvailable: Boolean,
|
||||
) : Boolean {
|
||||
communicator.setTemporary(true)
|
||||
val updateResult = try {
|
||||
communicator.receiveUpdates()
|
||||
@@ -846,7 +842,7 @@ internal class SettingsSyncConfigurable(private val coroutineScope: CoroutineSco
|
||||
text(message("enable.dialog.source.option.title")).bold()
|
||||
}
|
||||
row {
|
||||
text(message("enable.dialog.source.option.text", ), 50)
|
||||
text(message("enable.dialog.source.option.text"), 50)
|
||||
}
|
||||
buttonsGroup ("", false) {
|
||||
row {
|
||||
|
||||
Reference in New Issue
Block a user