showEditProfileDialog displays a dialog for editing an existing connection profile.
(profileName string)
| 769 | // showEditProfileDialog displays a dialog for editing an existing connection profile. |
| 770 | |
| 771 | func (a *App) showEditProfileDialog(profileName string) { |
| 772 | |
| 773 | // Store last focused primitive |
| 774 | |
| 775 | a.lastFocus = a.GetFocus() |
| 776 | |
| 777 | // Get the existing profile |
| 778 | |
| 779 | profiles := a.config.Profiles |
| 780 | |
| 781 | if profiles == nil { |
| 782 | |
| 783 | profiles = make(map[string]config.ProfileConfig) |
| 784 | |
| 785 | } |
| 786 | |
| 787 | profile, exists := profiles[profileName] |
| 788 | |
| 789 | if !exists { |
| 790 | |
| 791 | a.showMessageSafe("Profile '" + profileName + "' not found!") |
| 792 | |
| 793 | return |
| 794 | |
| 795 | } |
| 796 | |
| 797 | // Create a temporary config for the wizard with proper profile structure |
| 798 | |
| 799 | tempConfig := &config.Config{ |
| 800 | |
| 801 | Profiles: make(map[string]config.ProfileConfig), |
| 802 | |
| 803 | DefaultProfile: profileName, |
| 804 | |
| 805 | Debug: a.config.Debug, |
| 806 | |
| 807 | CacheDir: a.config.CacheDir, |
| 808 | |
| 809 | Theme: a.config.Theme, |
| 810 | } |
| 811 | |
| 812 | // Copy the profile data into the temporary config's profiles map |
| 813 | |
| 814 | tempConfig.Profiles[profileName] = profile |
| 815 | |
| 816 | // Create a channel for the wizard result |
| 817 | |
| 818 | resultChan := make(chan WizardResult, 1) |
| 819 | |
| 820 | // Create the wizard page using our embedded version |
| 821 | |
| 822 | wizardPage := a.createEmbeddedConfigWizard(tempConfig, resultChan) |
| 823 | |
| 824 | // Add the wizard page |
| 825 | |
| 826 | a.pages.AddPage("profileWizard", wizardPage, true, true) |
| 827 | |
| 828 | a.SetFocus(wizardPage) |
no test coverage detected