Skip to content

Conversation

gadfly3173
Copy link
Contributor

No description provided.

@love-linger
Copy link
Collaborator

Workspace configuration will be saved after SourceGit.Views.ConfigureWorkspace window closed. See code:

using Avalonia.Controls;

namespace SourceGit.Views
{
    public partial class ConfigureWorkspace : ChromelessWindow
    {
        public ConfigureWorkspace()
        {
            InitializeComponent();
        }

        protected override void OnClosing(WindowClosingEventArgs e)
        {
            ViewModels.Preferences.Instance.Save();
            base.OnClosing(e);
        }
    }
}

@gadfly3173
Copy link
Contributor Author

My goal is to save the opened repositories/workspace even when exiting abnormally. For example, when Linux shuts down/kill by deb preinst, it may not exit normally.

@love-linger
Copy link
Collaborator

我反而认为这样做没有必要。即便是你所举例的情况下。

@love-linger
Copy link
Collaborator

以OpenAIServices为例,该配置中包含了大量的字符串输入,尤其是prompt相关的,property变化时就需要存储,那配置完一个Service,可以想像需要存储多少次

@gadfly3173
Copy link
Contributor Author

好吧,那切换workspace之后和关闭preference窗口之后保存如何呢?

@love-linger
Copy link
Collaborator

好吧,那切换workspace之后和关闭preference窗口之后保存如何呢?

我认为这是完全OK的。

@gadfly3173 gadfly3173 changed the title enhance: Add auto-save for OpenAIServices and Workspaces enhance: Save Preferences after switched Workspace and closed Preferences Mar 10, 2025
@love-linger love-linger self-assigned this Mar 10, 2025
@love-linger love-linger added the enhancement New feature or request label Mar 10, 2025
@love-linger love-linger merged commit c1c0e7b into sourcegit-scm:develop Mar 10, 2025
13 checks passed
@gadfly3173 gadfly3173 deleted the fix/save branch March 10, 2025 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants