mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-18 13:31:41 +02:00
Configuration
Core
Bridge
Controls
Handling
Notification
Other
Settings
Dialogs
DialogSettingsCSS.Designer.cs
DialogSettingsCSS.cs
DialogSettingsCefArgs.Designer.cs
DialogSettingsCefArgs.cs
DialogSettingsManage.Designer.cs
DialogSettingsManage.cs
DialogSettingsRestart.Designer.cs
DialogSettingsRestart.cs
Export
BaseTabSettings.cs
TabSettingsAdvanced.Designer.cs
TabSettingsAdvanced.cs
TabSettingsGeneral.Designer.cs
TabSettingsGeneral.cs
TabSettingsNotifications.Designer.cs
TabSettingsNotifications.cs
TabSettingsSounds.Designer.cs
TabSettingsSounds.cs
FormAbout.Designer.cs
FormAbout.cs
FormAbout.resx
FormMessage.Designer.cs
FormMessage.cs
FormPlugins.Designer.cs
FormPlugins.cs
FormPlugins.resx
FormSettings.Designer.cs
FormSettings.cs
FormSettings.resx
Utils
FormBrowser.Designer.cs
FormBrowser.cs
FormBrowser.resx
TrayIcon.Designer.cs
TrayIcon.cs
Data
Plugins
Properties
Resources
Updates
bld
lib
subprocess
tests
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
_postbuild.bat
packages.config
63 lines
2.1 KiB
C#
63 lines
2.1 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
using TweetDuck.Configuration;
|
|
using TweetDuck.Data;
|
|
|
|
namespace TweetDuck.Core.Other.Settings.Dialogs{
|
|
sealed partial class DialogSettingsRestart : Form{
|
|
private const string DefaultLocale = "en-US";
|
|
|
|
public CommandLineArgs Args { get; private set; }
|
|
|
|
public DialogSettingsRestart(CommandLineArgs currentArgs){
|
|
InitializeComponent();
|
|
|
|
try{
|
|
object[] locales = Directory.EnumerateFiles(Path.Combine(Program.ProgramPath, "locales"), "*.pak", SearchOption.TopDirectoryOnly).Select(Path.GetFileNameWithoutExtension).ToArray<object>();
|
|
comboLocale.Items.AddRange(locales);
|
|
}catch{
|
|
comboLocale.Items.Add(DefaultLocale);
|
|
}
|
|
|
|
cbLogging.Checked = currentArgs.HasFlag(Arguments.ArgLogging);
|
|
cbDebugUpdates.Checked = currentArgs.HasFlag(Arguments.ArgDebugUpdates);
|
|
comboLocale.SelectedItem = currentArgs.GetValue(Arguments.ArgLocale, DefaultLocale);
|
|
tbDataFolder.Text = currentArgs.GetValue(Arguments.ArgDataFolder, string.Empty);
|
|
|
|
Text = Program.BrandName+" Arguments";
|
|
}
|
|
|
|
private void btnRestart_Click(object sender, EventArgs e){
|
|
Args = new CommandLineArgs();
|
|
|
|
if (cbLogging.Checked){
|
|
Args.AddFlag(Arguments.ArgLogging);
|
|
}
|
|
|
|
if (cbDebugUpdates.Checked){
|
|
Args.AddFlag(Arguments.ArgDebugUpdates);
|
|
}
|
|
|
|
string locale = comboLocale.SelectedItem as string;
|
|
|
|
if (!string.IsNullOrWhiteSpace(locale) && locale != DefaultLocale){
|
|
Args.SetValue(Arguments.ArgLocale, locale);
|
|
}
|
|
|
|
if (!string.IsNullOrWhiteSpace(tbDataFolder.Text)){
|
|
Args.SetValue(Arguments.ArgDataFolder, tbDataFolder.Text);
|
|
}
|
|
|
|
DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e){
|
|
DialogResult = DialogResult.Cancel;
|
|
Close();
|
|
}
|
|
}
|
|
}
|