1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-10 18:15:44 +02:00

Hide the Manage Options dialog when cancelling profile import from login page

This commit is contained in:
chylex 2018-11-20 20:44:44 +01:00
parent 01b9302b0c
commit 15a4e10da9
2 changed files with 8 additions and 1 deletions
Core

View File

@ -494,7 +494,7 @@ public void OpenProfileImport(){
FormManager.TryFind<FormSettings>()?.Close();
using(DialogSettingsManage dialog = new DialogSettingsManage(plugins, true)){
if (dialog.ShowDialog() == DialogResult.OK && !dialog.IsRestarting){
if (!dialog.IsDisposed && dialog.ShowDialog() == DialogResult.OK && !dialog.IsRestarting){ // needs disposal check because the dialog may be closed in constructor
BrowserProcessHandler.UpdatePrefs();
FormManager.TryFind<FormPlugins>()?.Close();
plugins.Reload(); // also reloads the browser

View File

@ -36,6 +36,7 @@ private bool SelectedItemsForceRestart{
private State currentState;
private ProfileManager importManager;
private bool openImportImmediately;
private bool requestedRestartFromConfig;
private ProfileManager.Items _selectedItems = ProfileManager.Items.None;
@ -51,6 +52,8 @@ public DialogSettingsManage(PluginManager plugins, bool openImportImmediately =
this.checkBoxMap[cbSession] = ProfileManager.Items.Session;
this.checkBoxMap[cbPluginData] = ProfileManager.Items.PluginData;
this.openImportImmediately = openImportImmediately;
if (openImportImmediately){
radioImport.Checked = true;
btnContinue_Click(null, EventArgs.Empty);
@ -88,6 +91,10 @@ private void btnContinue_Click(object sender, EventArgs e){
Filter = "TweetDuck Profile (*.tdsettings)|*.tdsettings"
}){
if (dialog.ShowDialog() != DialogResult.OK){
if (openImportImmediately){
Close();
}
return;
}