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

Stop using BrandName in msg dialogs, update msg titles, fix mistakes from prev commits

This commit is contained in:
chylex 2017-07-09 04:21:33 +02:00
parent 7538aee4f2
commit 441228e2b0
15 changed files with 35 additions and 29 deletions

View File

@ -102,7 +102,7 @@ public void Alert(string type, string contents){
default: icon = MessageBoxIcon.None; break;
}
FormMessage.Show(Program.BrandName+" Browser Message", contents, icon, FormMessage.OK);
FormMessage.Show("TweetDuck Browser Message", contents, icon, FormMessage.OK);
}
public void CrashDebug(string message){

View File

@ -81,7 +81,7 @@ public virtual bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser br
if (saveTarget != null){
BrowserUtils.DownloadFileAsync(parameters.SourceUrl, saveTarget, null, ex => {
FormMessage.Error(Program.BrandName+" Has Failed :(", "An error occurred while downloading the image: "+ex.Message, FormMessage.OK);
FormMessage.Error("Image Download", "An error occurred while downloading the image: "+ex.Message, FormMessage.OK);
});
}

View File

@ -9,17 +9,20 @@ namespace TweetDuck.Core.Handling {
class JavaScriptDialogHandler : IJsDialogHandler{
bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage){
((ChromiumWebBrowser)browserControl).InvokeSafe(() => {
FormMessage form = new FormMessage(Program.BrandName, messageText, MessageBoxIcon.None);
FormMessage form;
TextBox input = null;
if (dialogType == CefJsDialogType.Alert){
form = new FormMessage("TweetDuck Browser Message", messageText, MessageBoxIcon.None);
form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused);
}
else if (dialogType == CefJsDialogType.Confirm){
form = new FormMessage("TweetDuck Browser Confirmation", messageText, MessageBoxIcon.None);
form.AddButton(FormMessage.No, DialogResult.No, ControlType.Cancel);
form.AddButton(FormMessage.Yes, ControlType.Focused);
}
else if (dialogType == CefJsDialogType.Prompt){
form = new FormMessage("TweetDuck Browser Prompt", messageText, MessageBoxIcon.None);
form.AddButton(FormMessage.Cancel, DialogResult.Cancel, ControlType.Cancel);
form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused);
@ -33,6 +36,10 @@ bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, s
form.ActiveControl = input;
form.Height += input.Size.Height+input.Margin.Vertical;
}
else{
callback.Continue(false);
return;
}
bool success = form.ShowDialog() == DialogResult.OK;

View File

@ -11,7 +11,7 @@ public FormAbout(){
Text = "About "+Program.BrandName+" "+Program.VersionTag;
labelDescription.Text = Program.BrandName+" was created by chylex as a replacement to the discontinued official TweetDeck client for Windows.\n\nThe program is available for free under the open source MIT license.";
labelDescription.Text = "TweetDuck was created by chylex as a replacement to the discontinued official TweetDeck client for Windows.\n\nThe program is available for free under the open source MIT license.";
labelWebsite.Links.Add(new LinkLabel.Link(0, labelWebsite.Text.Length, Program.Website));
labelTips.Links.Add(new LinkLabel.Link(0, labelTips.Text.Length, TipsLink));

View File

@ -25,7 +25,7 @@ public virtual void OnReady(){}
public virtual void OnClosing(){}
protected static void PromptRestart(){
if (FormMessage.Information(Program.BrandName+" Options", "The application must restart for the option to take place. Do you want to restart now?", FormMessage.Yes, FormMessage.No)){
if (FormMessage.Information("TweetDuck Options", "The application must restart for the option to take place. Do you want to restart now?", FormMessage.Yes, FormMessage.No)){
Program.Restart();
}
}

View File

@ -58,7 +58,7 @@ private void btnContinue_Click(object sender, EventArgs e){
case State.Deciding:
// Reset
if (radioReset.Checked){
if (FormMessage.Warning("Reset "+Program.BrandName+" Options", "This will reset all of your program options. Plugins will not be affected. Do you want to proceed?", FormMessage.Yes, FormMessage.No)){
if (FormMessage.Warning("Reset TweetDuck Options", "This will reset all of your program options. Plugins will not be affected. Do you want to proceed?", FormMessage.Yes, FormMessage.No)){
Program.ResetConfig();
ShouldReloadUI = true;
@ -74,8 +74,8 @@ private void btnContinue_Click(object sender, EventArgs e){
using(OpenFileDialog dialog = new OpenFileDialog{
AutoUpgradeEnabled = true,
DereferenceLinks = true,
Title = "Import "+Program.BrandName+" Profile",
Filter = Program.BrandName+" Profile (*.tdsettings)|*.tdsettings"
Title = "Import TweetDuck Profile",
Filter = "TweetDuck Profile (*.tdsettings)|*.tdsettings"
}){
if (dialog.ShowDialog() != DialogResult.OK){
return;
@ -116,7 +116,7 @@ private void btnContinue_Click(object sender, EventArgs e){
}
}
else{
Program.Reporter.HandleException("Profile Import Error", "An exception happened while importing "+Program.BrandName+" profile.", true, importManager.LastException);
Program.Reporter.HandleException("Profile Import Error", "An exception happened while importing TweetDuck profile.", true, importManager.LastException);
}
DialogResult = DialogResult.OK;
@ -129,9 +129,9 @@ private void btnContinue_Click(object sender, EventArgs e){
AutoUpgradeEnabled = true,
OverwritePrompt = true,
DefaultExt = "tdsettings",
FileName = Program.BrandName+".tdsettings",
Title = "Export "+Program.BrandName+" Profile",
Filter = Program.BrandName+" Profile (*.tdsettings)|*.tdsettings"
FileName = "TweetDuck.tdsettings",
Title = "Export TweetDuck Profile",
Filter = "TweetDuck Profile (*.tdsettings)|*.tdsettings"
}){
if (dialog.ShowDialog() != DialogResult.OK){
return;
@ -144,7 +144,7 @@ private void btnContinue_Click(object sender, EventArgs e){
ExportManager manager = new ExportManager(file, plugins);
if (!manager.Export(Flags)){
Program.Reporter.HandleException("Profile Export Error", "An exception happened while exporting "+Program.BrandName+" profile.", true, manager.LastException);
Program.Reporter.HandleException("Profile Export Error", "An exception happened while exporting TweetDuck profile.", true, manager.LastException);
}
DialogResult = DialogResult.OK;

View File

@ -138,7 +138,7 @@ public bool Import(ExportFileFlags flags){
}
if (missingPlugins.Count > 0){
FormMessage.Information("Importing "+Program.BrandName+" Profile", "Detected missing plugins when importing plugin data:\n"+string.Join("\n", missingPlugins), FormMessage.OK);
FormMessage.Information("Importing TweetDuck Profile", "Detected missing plugins when importing plugin data:\n"+string.Join("\n", missingPlugins), FormMessage.OK);
}
if (IsRestarting){

View File

@ -56,7 +56,7 @@ public override void OnReady(){
private void btnClearCache_Click(object sender, EventArgs e){
btnClearCache.Enabled = false;
BrowserCache.SetClearOnExit();
FormMessage.Information("Clear Cache", "Cache will be automatically cleared when "+Program.BrandName+" exits.", FormMessage.OK);
FormMessage.Information("Clear Cache", "Cache will be automatically cleared when TweetDuck exits.", FormMessage.OK);
}
private void checkHardwareAcceleration_CheckedChanged(object sender, EventArgs e){

View File

@ -102,7 +102,7 @@ private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){
btnCheckUpdates.Enabled = true;
if (!e.UpdateAvailable){
FormMessage.Information("No Updates Available", "Your version of "+Program.BrandName+" is up to date.", FormMessage.OK);
FormMessage.Information("No Updates Available", "Your version of TweetDuck is up to date.", FormMessage.OK);
}
}
});

View File

@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Windows.Forms;
using TweetDuck.Core.Controls;
using TweetDuck.Core.Notification;
@ -52,7 +51,7 @@ public TabSettingsNotifications(FormNotificationMain notification){
comboBoxIdlePause.Items.Add("5 minutes");
comboBoxIdlePause.SelectedIndex = Math.Max(0, Array.FindIndex(IdlePauseSeconds, val => val == Config.NotificationIdlePauseSeconds));
comboBoxDisplay.Items.Add("(Same As "+Program.BrandName+")");
comboBoxDisplay.Items.Add("(Same as TweetDuck)");
foreach(Screen screen in Screen.AllScreens){
comboBoxDisplay.Items.Add(screen.DeviceName.TrimStart('\\', '.')+" ("+screen.Bounds.Width+"x"+screen.Bounds.Height+")");

View File

@ -125,7 +125,7 @@ private static void SetClipboardData(DataObject obj){
try{
Clipboard.SetDataObject(obj);
}catch(ExternalException e){
Program.Reporter.HandleException("Clipboard Error", Program.BrandName+" could not access the clipboard as it is currently used by another process.", true, e);
Program.Reporter.HandleException("Clipboard Error", "TweetDuck could not access the clipboard as it is currently used by another process.", true, e);
}
}
}

View File

@ -25,7 +25,7 @@ public PluginControl(PluginManager pluginManager, Plugin plugin) : this(){
this.dpiScale = this.GetDPIScale();
this.labelName.Text = plugin.Name;
this.labelDescription.Text = plugin.CanRun ? plugin.Description : "This plugin requires "+Program.BrandName+" "+plugin.RequiredVersion+" or newer.";
this.labelDescription.Text = plugin.CanRun ? plugin.Description : "This plugin requires TweetDuck "+plugin.RequiredVersion+" or newer.";
this.labelVersion.Text = plugin.Version;
this.labelAuthor.Text = plugin.Author;
this.labelWebsite.Text = plugin.Website;

View File

@ -49,7 +49,7 @@ private string GetFullPathOrThrow(int token, PluginFolder folder, string path){
switch(folder){
case PluginFolder.Data: throw new ArgumentException("File path has to be relative to the plugin data folder.");
case PluginFolder.Root: throw new ArgumentException("File path has to be relative to the plugin root folder.");
default: throw new ArgumentException("Invalid folder type "+folder+", this is a "+Program.BrandName+" error.");
default: throw new ArgumentException("Invalid folder type "+folder+", this is a TweetDuck error.");
}
}
else{

View File

@ -63,7 +63,7 @@ static Program(){
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
Reporter = new Reporter(ErrorLogFilePath);
Reporter.SetupUnhandledExceptionHandler(BrandName+" Has Failed :(");
Reporter.SetupUnhandledExceptionHandler("TweetDuck Has Failed :(");
}
[STAThread]
@ -75,7 +75,7 @@ private static void Main(){
SubProcessMessage = NativeMethods.RegisterWindowMessage("TweetDuckSubProcess");
if (!WindowsUtils.CheckFolderWritePermission(StoragePath)){
FormMessage.Warning("Permission Error", BrandName+" does not have write permissions to the storage folder: "+StoragePath, FormMessage.OK);
FormMessage.Warning("Permission Error", "TweetDuck does not have write permissions to the storage folder: "+StoragePath, FormMessage.OK);
return;
}
@ -87,11 +87,11 @@ private static void Main(){
break;
}
else if (lockResult == LockManager.Result.Fail){
FormMessage.Error(BrandName+" Has Failed :(", "An unknown error occurred accessing the data folder. Please, make sure "+BrandName+" is not already running. If the problem persists, try restarting your system.", FormMessage.OK);
FormMessage.Error("TweetDuck Has Failed :(", "An unknown error occurred accessing the data folder. Please, make sure TweetDuck is not already running. If the problem persists, try restarting your system.", FormMessage.OK);
return;
}
else if (attempt == 20){
if (FormMessage.Warning(BrandName+" Cannot Restart", BrandName+" is taking too long to close.", FormMessage.Retry, FormMessage.Exit)){
if (FormMessage.Warning("TweetDuck Cannot Restart", "TweetDuck is taking too long to close.", FormMessage.Retry, FormMessage.Exit)){
attempt /= 2;
continue;
}
@ -116,9 +116,9 @@ private static void Main(){
}
}
if (FormMessage.Error(BrandName+" is Already Running", "Another instance of "+BrandName+" is already running.\nDo you want to close it?", FormMessage.Yes, FormMessage.No)){
if (FormMessage.Error("TweetDuck is Already Running", "Another instance of TweetDuck is already running.\nDo you want to close it?", FormMessage.Yes, FormMessage.No)){
if (!LockManager.CloseLockingProcess(10000, 5000)){
FormMessage.Error(BrandName+" Has Failed :(", "Could not close the other process.", FormMessage.OK);
FormMessage.Error("TweetDuck Has Failed :(", "Could not close the other process.", FormMessage.OK);
return;
}
@ -127,7 +127,7 @@ private static void Main(){
else return;
}
else if (lockResult != LockManager.Result.Success){
FormMessage.Error(BrandName+" Has Failed :(", "An unknown error occurred accessing the data folder. Please, make sure "+BrandName+" is not already running. If the problem persists, try restarting your system.", BrandName+" Has Failed :(", FormMessage.OK);
FormMessage.Error("TweetDuck Has Failed :(", "An unknown error occurred accessing the data folder. Please, make sure TweetDuck is not already running. If the problem persists, try restarting your system.", FormMessage.OK);
return;
}
}

View File

@ -14,7 +14,7 @@ public static string LoadResource(string name, bool silent = false){
return File.ReadAllText(Path.Combine(Program.ScriptPath, name), Encoding.UTF8);
}catch(Exception ex){
if (!silent){
FormMessage.Error(Program.BrandName+" Has Failed :(", "Unfortunately, "+Program.BrandName+" could not load the "+name+" file. The program will continue running with limited functionality.\n\n"+ex.Message, FormMessage.OK);
FormMessage.Error("TweetDuck Has Failed :(", "Unfortunately, TweetDuck could not load the "+name+" file. The program will continue running with limited functionality.\n\n"+ex.Message, FormMessage.OK);
}
return null;