Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

add confirmation dialog after successful import of data from other browser #4190

Merged
merged 1 commit into from
Sep 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/aboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,17 @@ module.exports.showImportWarning = function () {
})
}, 50)
}

module.exports.showImportSuccess = function () {
// The timeout is in case there's a call just after the modal to hide the menu.
// showMessageBox is a modal and blocks everything otherwise, so menu would remain open
// while the dialog is displayed.
setTimeout(() => {
dialog.showMessageBox({
title: 'Brave',
message: `${locale.translation('importSuccess')}`,
icon: path.join(__dirname, '..', 'app', 'extensions', 'brave', 'img', 'braveAbout.png'),
buttons: ['Ok']
})
}, 50)
}
1 change: 1 addition & 0 deletions app/extensions/brave/locales/en-US/app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ importBrowserData=Import browser data
import=Import
importDataWarning=Note: Each browser has a different set of importable data.
importDataCloseBrowserWarning=Please make sure the selected browser is closed before importing your data.
importSuccess=Your data has been imported to Brave successfully.
closeFirefoxWarning=Firefox must be closed during data import. Please close and try again.
favoritesOrBookmarks=Favorites/Bookmarks
mergeIntoBookmarksToolbar=Merge Favorites into Bookmarks Toolbar
Expand Down
9 changes: 8 additions & 1 deletion app/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const dialog = electron.dialog
const BrowserWindow = electron.BrowserWindow
const session = electron.session
const Immutable = require('immutable')
const showImportWarning = require('./aboutDialog').showImportWarning
const { showImportWarning, showImportSuccess } = require('./aboutDialog')
const siteUtil = require('../js/state/siteUtil')
const AppStore = require('../js/stores/appStore')
const siteTags = require('../js/constants/siteTags')
Expand Down Expand Up @@ -179,3 +179,10 @@ importer.on('add-cookies', (e, cookies) => {
importer.on('show-warning-dialog', (e) => {
showImportWarning()
})

importer.on('import-success', (e) => {
showImportSuccess()
})

importer.on('import-dismiss', (e) => {
})
3 changes: 2 additions & 1 deletion app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ var rendererIdentifiers = function () {
'windowCaptionButtonMaximize',
'windowCaptionButtonRestore',
'windowCaptionButtonClose',
'closeFirefoxWarning'
'closeFirefoxWarning',
'importSuccess'
]
}

Expand Down