diff --git a/Lib/7z-x64.dll b/Lib/7z-x64.dll index cea996e4f..3d3ba3221 100644 Binary files a/Lib/7z-x64.dll and b/Lib/7z-x64.dll differ diff --git a/Lib/7z.dll b/Lib/7z.dll index 2bdaed6a8..78d20ba75 100644 Binary files a/Lib/7z.dll and b/Lib/7z.dll differ diff --git a/ShareX.HelpersLib/Colors/GradientPickerForm.pt-BR.resx b/ShareX.HelpersLib/Colors/GradientPickerForm.pt-BR.resx index fe19ed617..1bc39b675 100644 --- a/ShareX.HelpersLib/Colors/GradientPickerForm.pt-BR.resx +++ b/ShareX.HelpersLib/Colors/GradientPickerForm.pt-BR.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Gradiente + Degradê Adicionar @@ -139,7 +139,7 @@ Local - Tipo de gradiente: + Tipo de degradê: Local: diff --git a/ShareX.HelpersLib/Controls/ExportImportControl.pt-BR.resx b/ShareX.HelpersLib/Controls/ExportImportControl.pt-BR.resx index 8ded588df..bb0cec4e5 100644 --- a/ShareX.HelpersLib/Controls/ExportImportControl.pt-BR.resx +++ b/ShareX.HelpersLib/Controls/ExportImportControl.pt-BR.resx @@ -130,7 +130,7 @@ Salvar como arquivo... - Upload como texto + Enviar como texto Da área de transferência diff --git a/ShareX.HelpersLib/FFmpegDownloader.cs b/ShareX.HelpersLib/FFmpegDownloader.cs index 46cced5d8..e3d08a22b 100644 --- a/ShareX.HelpersLib/FFmpegDownloader.cs +++ b/ShareX.HelpersLib/FFmpegDownloader.cs @@ -62,11 +62,11 @@ public static bool ExtractFFmpeg(string zipPath, string extractPath) { if (NativeMethods.Is64Bit()) { - SevenZipExtractor.SetLibraryPath(Path.Combine(Application.StartupPath, "7z-x64.dll")); + SevenZipExtractor.SetLibraryPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "7z-x64.dll")); } else { - SevenZipExtractor.SetLibraryPath(Path.Combine(Application.StartupPath, "7z.dll")); + SevenZipExtractor.SetLibraryPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "7z.dll")); } Helpers.CreateDirectoryIfNotExist(extractPath); diff --git a/ShareX.HelpersLib/Forms/HashCheckForm.pt-BR.resx b/ShareX.HelpersLib/Forms/HashCheckForm.pt-BR.resx index 19b06fdb6..4864f10c6 100644 --- a/ShareX.HelpersLib/Forms/HashCheckForm.pt-BR.resx +++ b/ShareX.HelpersLib/Forms/HashCheckForm.pt-BR.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Verificação de hash + Conferir hash Procurar... @@ -138,4 +138,34 @@ Destino: + + Verificar hash de arquivo + + + Copiar tudo + + + Decifrar + + + Decifrar + + + Decifrar + + + Decifrar + + + Binário: + + + Codificar + + + Texto: + + + Conversões de texto + \ No newline at end of file diff --git a/ShareX.HelpersLib/Printer/PrintForm.pt-BR.resx b/ShareX.HelpersLib/Printer/PrintForm.pt-BR.resx index 0d0127d8b..b78f65b76 100644 --- a/ShareX.HelpersLib/Printer/PrintForm.pt-BR.resx +++ b/ShareX.HelpersLib/Printer/PrintForm.pt-BR.resx @@ -133,7 +133,7 @@ Permitir que a imagem alargue - Auto rotação da imagem + Girar imagem Margem: @@ -142,6 +142,6 @@ Centralizar posição da imagem - Auto escala da imagem + Redimensionar imagem \ No newline at end of file diff --git a/ShareX.HelpersLib/Properties/Resources.Designer.cs b/ShareX.HelpersLib/Properties/Resources.Designer.cs index 91014cfb6..229b03c1a 100644 --- a/ShareX.HelpersLib/Properties/Resources.Designer.cs +++ b/ShareX.HelpersLib/Properties/Resources.Designer.cs @@ -205,6 +205,15 @@ internal class Resources { } } + /// + /// Looks up a localized string similar to Show quick task menu. + /// + internal static string AfterCaptureTasks_ShowQuickTaskMenu { + get { + return ResourceManager.GetString("AfterCaptureTasks_ShowQuickTaskMenu", resourceCulture); + } + } + /// /// Looks up a localized string similar to Upload image to host. /// diff --git a/ShareX.HelpersLib/Properties/Resources.resx b/ShareX.HelpersLib/Properties/Resources.resx index 2c018ebe4..6dffdddb3 100644 --- a/ShareX.HelpersLib/Properties/Resources.resx +++ b/ShareX.HelpersLib/Properties/Resources.resx @@ -860,4 +860,7 @@ Would you like to download it? Show "After upload" window + + Show quick task menu + \ No newline at end of file diff --git a/ShareX.HelpersLib/UpdateChecker/DownloaderForm.pt-BR.resx b/ShareX.HelpersLib/UpdateChecker/DownloaderForm.pt-BR.resx index b55b31215..201d6ac51 100644 --- a/ShareX.HelpersLib/UpdateChecker/DownloaderForm.pt-BR.resx +++ b/ShareX.HelpersLib/UpdateChecker/DownloaderForm.pt-BR.resx @@ -133,6 +133,6 @@ Progresso: - Status: + Estado: \ No newline at end of file diff --git a/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.pt-BR.resx b/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.pt-BR.resx index 3b9695b61..5d8a92ee9 100644 --- a/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.pt-BR.resx +++ b/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.pt-BR.resx @@ -127,6 +127,6 @@ Não perguntar de novo até a próxima inicialização do programa - Ver log de mudanças + Ver registro de alterações \ No newline at end of file diff --git a/ShareX.HistoryLib/Properties/Resources.pt-BR.resx b/ShareX.HistoryLib/Properties/Resources.pt-BR.resx index 27860c213..15b25e767 100644 --- a/ShareX.HistoryLib/Properties/Resources.pt-BR.resx +++ b/ShareX.HistoryLib/Properties/Resources.pt-BR.resx @@ -139,13 +139,13 @@ Arquivo - Nome do arquivo + Arquivo Nome do arquivo com extensão - Local do arquivo + Local Pasta diff --git a/ShareX.UploadersLib/FileUploaders/Pomf.cs b/ShareX.UploadersLib/FileUploaders/Pomf.cs index 06b10a65f..a87ba72ba 100644 --- a/ShareX.UploadersLib/FileUploaders/Pomf.cs +++ b/ShareX.UploadersLib/FileUploaders/Pomf.cs @@ -50,7 +50,7 @@ public class Pomf : FileUploader new PomfUploader("http://g.zxq.co/upload.php", "http://y.zxq.co"), new PomfUploader("http://glop.me/upload.php", "http://gateway.glop.me/ipfs"), new PomfUploader("http://kyaa.sg/upload.php", "https://r.kyaa.sg"), - new PomfUploader("https://maxfile.ro/static/upload.php", "https://d.maxfile.ro"), + new PomfUploader("https://maxfile.ro/static/upload.php", "https://d2.maxfile.ro"), new PomfUploader("https://mixtape.moe/upload.php"), new PomfUploader("https://nigger.cat/upload.php"), new PomfUploader("https://pomf.cat/upload.php", "https://a.pomf.cat"), @@ -174,4 +174,4 @@ public override string ToString() } } } -} +} \ No newline at end of file diff --git a/ShareX.UploadersLib/ImageUploaders/VgymeUploader.cs b/ShareX.UploadersLib/ImageUploaders/VgymeUploader.cs index 265bf67d8..0109c973d 100644 --- a/ShareX.UploadersLib/ImageUploaders/VgymeUploader.cs +++ b/ShareX.UploadersLib/ImageUploaders/VgymeUploader.cs @@ -32,7 +32,7 @@ public sealed class VgymeUploader : ImageUploader { public override UploadResult Upload(Stream stream, string fileName) { - UploadResult result = UploadData(stream, "http://vgy.me/upload", fileName); + UploadResult result = UploadData(stream, "https://vgy.me/upload", fileName); if (result.IsSuccess) { diff --git a/ShareX/ApplicationConfig.cs b/ShareX/ApplicationConfig.cs index c42751a05..e0a220676 100644 --- a/ShareX/ApplicationConfig.cs +++ b/ShareX/ApplicationConfig.cs @@ -43,6 +43,7 @@ public class ApplicationConfig : SettingsBase public int NameParserAutoIncrementNumber = 0; public RecentItem[] RecentLinks = null; public bool DisableHotkeys = false; + public List QuickTaskPresets = QuickTaskInfo.DefaultPresets; public ApplicationConfig() { @@ -82,6 +83,14 @@ public ApplicationConfig() #endregion Paths + #region Export / Import + + public bool ExportSettings = true; + public bool ExportHistory = true; + public bool ExportLogs = false; + + #endregion Export / Import + #region Proxy public ProxyInfo ProxySettings = new ProxyInfo(); diff --git a/ShareX/CompanionCube.cs b/ShareX/CompanionCube.cs deleted file mode 100644 index 97f73b8f5..000000000 --- a/ShareX/CompanionCube.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region License Information (GPL v3) - -/* - ShareX - A program that allows you to take screenshots and share any file type - Copyright (c) 2007-2016 ShareX Team - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Optionally you can also view the license at . -*/ - -#endregion License Information (GPL v3) - -using System.Drawing; - -namespace ShareX -{ - public class CompanionCube - { - public bool IsActive { get; set; } - public Point Location { get; set; } - public Size Size { get; set; } - public Rectangle Rectangle => new Rectangle(Location, Size); - public Point Center => new Point(Location.X + (Size.Width / 2), Location.Y + (Size.Height / 2)); - public int Speed { get; set; } - - public CompanionCube(int size, int speed) - { - Size = new Size(size, size); - Speed = speed; - IsActive = true; - } - } -} \ No newline at end of file diff --git a/ShareX/CompanionCubeManager.cs b/ShareX/CompanionCubeManager.cs deleted file mode 100644 index 080413593..000000000 --- a/ShareX/CompanionCubeManager.cs +++ /dev/null @@ -1,189 +0,0 @@ -#region License Information (GPL v3) - -/* - ShareX - A program that allows you to take screenshots and share any file type - Copyright (c) 2007-2016 ShareX Team - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Optionally you can also view the license at . -*/ - -#endregion License Information (GPL v3) - -using ShareX.HelpersLib; -using ShareX.Properties; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; -using System.Linq; -using System.Windows.Forms; - -namespace ShareX -{ - public static class CompanionCubeManager - { - public static bool IsActive { get; set; } - public static int CubeCount { get; } = 50; - public static List Cubes { get; private set; } - - private static CompanionCubesForm cubesForm; - private static Timer timer; - private static Stopwatch startTime; - private static TimeSpan previousElapsed; - private static Rectangle area; - private static Bitmap companionCube; - - public static void Toggle() - { - if (!IsActive) - { - Start(); - } - else - { - Stop(); - } - } - - public static void Start() - { - if (!IsActive) - { - IsActive = true; - - companionCube = Resources.CompanionCube; - - if (cubesForm != null) cubesForm.Close(); - cubesForm = new CompanionCubesForm(); - cubesForm.MouseClick += CubesForm_MouseClick; - cubesForm.Show(); - - area = new Rectangle(0, 0, cubesForm.Width, cubesForm.Height); - - Cubes = new List(CubeCount); - - for (int i = 0; i < CubeCount; i++) - { - CompanionCube cube = new CompanionCube(MathHelpers.Random(50, 100), MathHelpers.Random(250, 500)); - cube.Location = new Point(MathHelpers.Random(area.X, area.X + area.Width - cube.Size.Width), - MathHelpers.Random(area.Y - cube.Size.Height - 500, area.Y - cube.Size.Height)); - Cubes.Add(cube); - } - - previousElapsed = TimeSpan.Zero; - startTime = Stopwatch.StartNew(); - - timer = new Timer(); - timer.Interval = 20; - timer.Tick += Timer_Tick; - timer.Start(); - } - } - - private static void CubesForm_MouseClick(object sender, MouseEventArgs e) - { - foreach (CompanionCube cube in Cubes.Where(x => x.Rectangle.Contains(e.Location))) - { - cube.IsActive = false; - } - } - - public static void Stop() - { - if (IsActive) - { - if (timer != null) - { - timer.Dispose(); - timer = null; - } - - if (cubesForm != null) - { - cubesForm.Close(); - cubesForm = null; - } - - if (companionCube != null) - { - companionCube.Dispose(); - companionCube = null; - } - - if (Cubes != null) - { - Cubes.Clear(); - Cubes = null; - } - - IsActive = false; - } - } - - private static void Timer_Tick(object sender, EventArgs e) - { - TimeSpan elapsed = startTime.Elapsed - previousElapsed; - previousElapsed = startTime.Elapsed; - - IEnumerable cubes = Cubes.Where(x => x.IsActive).OrderBy(x => x.Rectangle.Bottom); - - foreach (CompanionCube cube in cubes) - { - int velocityY = (int)(cube.Speed * elapsed.TotalSeconds); - Point newLocation = new Point(cube.Location.X, cube.Location.Y + velocityY); - Rectangle newRectangle = new Rectangle(newLocation, cube.Size); - bool intersect = false; - - foreach (CompanionCube cube2 in cubes) - { - if (cube != cube2 && (newRectangle.IntersectsWith(cube2.Rectangle) || cube.Rectangle.IntersectsWith(cube2.Rectangle))) - { - intersect = true; - newLocation = new Point(cube.Location.X, cube2.Location.Y - cube.Size.Height); - break; - } - } - - if (!intersect && newLocation.Y + cube.Size.Height > area.Y + area.Height) - { - newLocation = new Point(cube.Location.X, area.Height - cube.Size.Height); - } - - cube.Location = newLocation; - } - - DrawCubes(); - } - - private static void DrawCubes() - { - using (Bitmap surface = new Bitmap(area.Width, area.Height)) - using (Graphics g = Graphics.FromImage(surface)) - { - foreach (CompanionCube cube in Cubes) - { - if (cube.IsActive && area.IntersectsWith(cube.Rectangle)) - { - g.DrawImage(companionCube, new Rectangle(cube.Location, cube.Size)); - } - } - - cubesForm.SelectBitmap(surface); - } - } - } -} \ No newline at end of file diff --git a/ShareX/Enums.cs b/ShareX/Enums.cs index f6eb31eb9..f03bcdb24 100644 --- a/ShareX/Enums.cs +++ b/ShareX/Enums.cs @@ -90,21 +90,22 @@ public enum TaskStatus public enum AfterCaptureTasks // Localized { None = 0, - ShowAfterCaptureWindow = 1, - AddImageEffects = 1 << 1, - AnnotateImage = 1 << 2, - CopyImageToClipboard = 1 << 3, - SendImageToPrinter = 1 << 4, - SaveImageToFile = 1 << 5, - SaveImageToFileWithDialog = 1 << 6, - SaveThumbnailImageToFile = 1 << 7, - PerformActions = 1 << 8, - CopyFileToClipboard = 1 << 9, - CopyFilePathToClipboard = 1 << 10, - ShowInExplorer = 1 << 11, - ShowBeforeUploadWindow = 1 << 12, - UploadImageToHost = 1 << 13, - DeleteFile = 1 << 14 + ShowQuickTaskMenu = 1, + ShowAfterCaptureWindow = 1 << 1, + AddImageEffects = 1 << 2, + AnnotateImage = 1 << 3, + CopyImageToClipboard = 1 << 4, + SendImageToPrinter = 1 << 5, + SaveImageToFile = 1 << 6, + SaveImageToFileWithDialog = 1 << 7, + SaveThumbnailImageToFile = 1 << 8, + PerformActions = 1 << 9, + CopyFileToClipboard = 1 << 10, + CopyFilePathToClipboard = 1 << 11, + ShowInExplorer = 1 << 12, + ShowBeforeUploadWindow = 1 << 13, + UploadImageToHost = 1 << 14, + DeleteFile = 1 << 15 } [Flags] diff --git a/ShareX/ExportImportManager.cs b/ShareX/ExportImportManager.cs new file mode 100644 index 000000000..8fe0ebd49 --- /dev/null +++ b/ShareX/ExportImportManager.cs @@ -0,0 +1,148 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2016 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using SevenZip; +using ShareX.HelpersLib; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace ShareX +{ + public static class ExportImportManager + { + public static bool Export() + { + try + { + string exportFolder; + + using (FolderSelectDialog dlg = new FolderSelectDialog()) + { + if (dlg.ShowDialog()) + { + exportFolder = dlg.FileName; + } + else + { + return false; + } + } + + Set7ZipLibraryPath(); + + SevenZipCompressor zip = new SevenZipCompressor(); + zip.ArchiveFormat = OutArchiveFormat.SevenZip; + zip.CompressionLevel = CompressionLevel.Ultra; + zip.CompressionMethod = CompressionMethod.Lzma2; + + Dictionary files = new Dictionary(); + if (Program.Settings.ExportSettings) + { + AddFileToDictionary(files, Program.ApplicationConfigFilePath); + AddFileToDictionary(files, Program.HotkeysConfigFilePath); + AddFileToDictionary(files, Program.UploadersConfigFilePath); + AddFileToDictionary(files, Program.GreenshotImageEditorConfigFilePath); + } + + if (Program.Settings.ExportHistory) + { + AddFileToDictionary(files, Program.HistoryFilePath); + } + + if (Program.Settings.ExportLogs) + { + foreach (string file in Directory.GetFiles(Program.LogsFolder, "*.txt", SearchOption.TopDirectoryOnly)) + { + AddFileToDictionary(files, file, Path.GetFileName(Program.LogsFolder)); + } + } + + string exportPath = Path.Combine(exportFolder, "ShareX_backup.sxb"); + + zip.CompressFileDictionary(files, exportPath); + + return true; + } + catch (Exception e) + { + DebugHelper.WriteException(e); + MessageBox.Show("Error while exporting backup:\r\n\r\n" + e, "ShareX - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + return false; + } + + private static void AddFileToDictionary(Dictionary files, string filePath, string subFolder = null) + { + string destinationPath = Path.GetFileName(filePath); + + if (!string.IsNullOrEmpty(subFolder)) + { + destinationPath = Path.Combine(subFolder, destinationPath); + } + + files.Add(destinationPath, filePath); + } + + public static bool Import(string filePath) + { + try + { + Set7ZipLibraryPath(); + + Helpers.CreateDirectoryIfNotExist(filePath); + + using (SevenZipExtractor zip = new SevenZipExtractor(filePath)) + { + // TODO + return true; + } + } + catch (Exception e) + { + DebugHelper.WriteException(e); + MessageBox.Show("Error while importing backup:\r\n\r\n" + e, "ShareX - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + return false; + } + + private static void Set7ZipLibraryPath() + { + if (NativeMethods.Is64Bit()) + { + SevenZipBase.SetLibraryPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "7z-x64.dll")); + } + else + { + SevenZipBase.SetLibraryPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "7z.dll")); + } + } + } +} \ No newline at end of file diff --git a/ShareX/Forms/AboutForm.Designer.cs b/ShareX/Forms/AboutForm.Designer.cs index e7e2fdd28..ccf02deef 100644 --- a/ShareX/Forms/AboutForm.Designer.cs +++ b/ShareX/Forms/AboutForm.Designer.cs @@ -193,7 +193,6 @@ private void InitializeComponent() this.Controls.Add(this.cLogo); this.MaximizeBox = false; this.Name = "AboutForm"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AboutForm_FormClosed); this.Shown += new System.EventHandler(this.AboutForm_Shown); ((System.ComponentModel.ISupportInitialize)(this.pbMikeURL)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbAU)).EndInit(); diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index a3263b137..81d6381da 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -158,11 +158,6 @@ private void rtb_LinkClicked(object sender, LinkClickedEventArgs e) URLHelpers.OpenURL(e.LinkText); } - private void AboutForm_FormClosed(object sender, FormClosedEventArgs e) - { - CompanionCubeManager.Stop(); - } - #region Animation private const int w = 200; @@ -245,20 +240,6 @@ private void cLogo_Draw(Graphics g) private void cLogo_MouseDown(object sender, MouseEventArgs e) { -#if STEAM - if (e.Button == MouseButtons.Middle) - { - cLogo.Stop(); - CompanionCubeManager.Toggle(); - return; - } - - if (CompanionCubeManager.IsActive) - { - CompanionCubeManager.Stop(); - } -#endif - if (!isEasterEggStarted) { isPaused = !isPaused; diff --git a/ShareX/Forms/AboutForm.resx b/ShareX/Forms/AboutForm.resx index 41c24db66..36076925b 100644 --- a/ShareX/Forms/AboutForm.resx +++ b/ShareX/Forms/AboutForm.resx @@ -212,7 +212,7 @@ - @Invariant + False @@ -239,7 +239,7 @@ - @Invariant + rtbShareXInfo diff --git a/ShareX/Forms/AfterCaptureForm.cs b/ShareX/Forms/AfterCaptureForm.cs index 8262a5a3d..8176966a3 100644 --- a/ShareX/Forms/AfterCaptureForm.cs +++ b/ShareX/Forms/AfterCaptureForm.cs @@ -78,7 +78,7 @@ private bool IsChecked(ListViewItem lvi) private void AddAfterCaptureItems(AfterCaptureTasks afterCaptureTasks) { - AfterCaptureTasks[] ignore = new AfterCaptureTasks[] { AfterCaptureTasks.None, AfterCaptureTasks.ShowAfterCaptureWindow }; + AfterCaptureTasks[] ignore = new AfterCaptureTasks[] { AfterCaptureTasks.None, AfterCaptureTasks.ShowQuickTaskMenu, AfterCaptureTasks.ShowAfterCaptureWindow }; foreach (AfterCaptureTasks task in Helpers.GetEnums()) { diff --git a/ShareX/Forms/ApplicationSettingsForm.Designer.cs b/ShareX/Forms/ApplicationSettingsForm.Designer.cs index 70798af7d..f52e35cd7 100644 --- a/ShareX/Forms/ApplicationSettingsForm.Designer.cs +++ b/ShareX/Forms/ApplicationSettingsForm.Designer.cs @@ -114,6 +114,12 @@ private void InitializeComponent() this.tpAdvanced = new System.Windows.Forms.TabPage(); this.pgSettings = new System.Windows.Forms.PropertyGrid(); this.tttvMain = new ShareX.HelpersLib.TabToTreeView(); + this.tpExportImport = new System.Windows.Forms.TabPage(); + this.cbExportSettings = new System.Windows.Forms.CheckBox(); + this.cbExportHistory = new System.Windows.Forms.CheckBox(); + this.cbExportLogs = new System.Windows.Forms.CheckBox(); + this.btnExport = new System.Windows.Forms.Button(); + this.btnImport = new System.Windows.Forms.Button(); this.tcSettings.SuspendLayout(); this.tpGeneral.SuspendLayout(); this.tpIntegration.SuspendLayout(); @@ -137,6 +143,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.nudRetryUpload)).BeginInit(); this.tpPrint.SuspendLayout(); this.tpAdvanced.SuspendLayout(); + this.tpExportImport.SuspendLayout(); this.SuspendLayout(); // // tcSettings @@ -145,6 +152,7 @@ private void InitializeComponent() this.tcSettings.Controls.Add(this.tpGeneral); this.tcSettings.Controls.Add(this.tpIntegration); this.tcSettings.Controls.Add(this.tpPaths); + this.tcSettings.Controls.Add(this.tpExportImport); this.tcSettings.Controls.Add(this.tpProxy); this.tcSettings.Controls.Add(this.tpUpload); this.tcSettings.Controls.Add(this.tpPrint); @@ -769,6 +777,52 @@ private void InitializeComponent() this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.tttvMain.TreeViewSize = 175; // + // tpExportImport + // + this.tpExportImport.Controls.Add(this.btnImport); + this.tpExportImport.Controls.Add(this.btnExport); + this.tpExportImport.Controls.Add(this.cbExportLogs); + this.tpExportImport.Controls.Add(this.cbExportHistory); + this.tpExportImport.Controls.Add(this.cbExportSettings); + resources.ApplyResources(this.tpExportImport, "tpExportImport"); + this.tpExportImport.Name = "tpExportImport"; + this.tpExportImport.UseVisualStyleBackColor = true; + // + // cbExportSettings + // + resources.ApplyResources(this.cbExportSettings, "cbExportSettings"); + this.cbExportSettings.Name = "cbExportSettings"; + this.cbExportSettings.UseVisualStyleBackColor = true; + this.cbExportSettings.CheckedChanged += new System.EventHandler(this.cbExportSettings_CheckedChanged); + // + // cbExportHistory + // + resources.ApplyResources(this.cbExportHistory, "cbExportHistory"); + this.cbExportHistory.Name = "cbExportHistory"; + this.cbExportHistory.UseVisualStyleBackColor = true; + this.cbExportHistory.CheckedChanged += new System.EventHandler(this.cbExportHistory_CheckedChanged); + // + // cbExportLogs + // + resources.ApplyResources(this.cbExportLogs, "cbExportLogs"); + this.cbExportLogs.Name = "cbExportLogs"; + this.cbExportLogs.UseVisualStyleBackColor = true; + this.cbExportLogs.CheckedChanged += new System.EventHandler(this.cbExportLogs_CheckedChanged); + // + // btnExport + // + resources.ApplyResources(this.btnExport, "btnExport"); + this.btnExport.Name = "btnExport"; + this.btnExport.UseVisualStyleBackColor = true; + this.btnExport.Click += new System.EventHandler(this.btnExport_Click); + // + // btnImport + // + resources.ApplyResources(this.btnImport, "btnImport"); + this.btnImport.Name = "btnImport"; + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); + // // ApplicationSettingsForm // resources.ApplyResources(this, "$this"); @@ -812,6 +866,8 @@ private void InitializeComponent() this.tpPrint.ResumeLayout(false); this.tpPrint.PerformLayout(); this.tpAdvanced.ResumeLayout(false); + this.tpExportImport.ResumeLayout(false); + this.tpExportImport.PerformLayout(); this.ResumeLayout(false); } @@ -903,5 +959,11 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbSteamShowInApp; private System.Windows.Forms.TabPage tpIntegration; private System.Windows.Forms.GroupBox gbSteam; + private System.Windows.Forms.TabPage tpExportImport; + private System.Windows.Forms.Button btnImport; + private System.Windows.Forms.Button btnExport; + private System.Windows.Forms.CheckBox cbExportLogs; + private System.Windows.Forms.CheckBox cbExportHistory; + private System.Windows.Forms.CheckBox cbExportSettings; } } \ No newline at end of file diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs index bffc62530..0e2825f04 100644 --- a/ShareX/Forms/ApplicationSettingsForm.cs +++ b/ShareX/Forms/ApplicationSettingsForm.cs @@ -91,6 +91,11 @@ private void LoadSettings() CodeMenu.Create(txtSaveImageSubFolderPattern, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn, ReplCodeMenuEntry.i, ReplCodeMenuEntry.width, ReplCodeMenuEntry.height, ReplCodeMenuEntry.n); + // Export / Import + cbExportSettings.Checked = Program.Settings.ExportSettings; + cbExportHistory.Checked = Program.Settings.ExportHistory; + cbExportLogs.Checked = Program.Settings.ExportLogs; + // Proxy cbProxyMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions()); cbProxyMethod.SelectedIndex = (int)Program.Settings.ProxySettings.ProxyMethod; @@ -399,6 +404,34 @@ private void btnOpenScreenshotsFolder_Click(object sender, EventArgs e) #endregion Paths + #region Export / Import + + private void cbExportSettings_CheckedChanged(object sender, EventArgs e) + { + Program.Settings.ExportSettings = cbExportSettings.Checked; + } + + private void cbExportHistory_CheckedChanged(object sender, EventArgs e) + { + Program.Settings.ExportHistory = cbExportHistory.Checked; + } + + private void cbExportLogs_CheckedChanged(object sender, EventArgs e) + { + Program.Settings.ExportLogs = cbExportLogs.Checked; + } + + private void btnExport_Click(object sender, EventArgs e) + { + ExportImportManager.Export(); + } + + private void btnImport_Click(object sender, EventArgs e) + { + } + + #endregion Export / Import + #region Proxy private void cbProxyMethod_SelectedIndexChanged(object sender, EventArgs e) diff --git a/ShareX/Forms/ApplicationSettingsForm.pt-BR.resx b/ShareX/Forms/ApplicationSettingsForm.pt-BR.resx index 550c38816..e1a579f15 100644 --- a/ShareX/Forms/ApplicationSettingsForm.pt-BR.resx +++ b/ShareX/Forms/ApplicationSettingsForm.pt-BR.resx @@ -148,7 +148,7 @@ Não abrir a janela de configurações de impressão da imagem - Número de tentativas se o upload falhar: + Número de tentativas se o envio falhar: Não abrir a janela de impressão do Windows @@ -178,7 +178,7 @@ Mostrar progresso no ícone da bandeja - Usar capturas de tela customizadas + Pasta de capturas de tela customizada Descrição @@ -187,10 +187,10 @@ Formato - Usar hospedagem secundária + Hospedagem alternativa - Formatos da área de transferência + Formatos da área de transferência - aparecem debaixo de Copiar no menu contextual na janela principal Tamanho do buffer: @@ -220,10 +220,10 @@ Modelo de sub pasta: - Limite de uploads simultâneos: + Limite de envios simultâneos: - 0 - 25 (0 desabilita o limite) + 0 - 25 (0 desabilita) Ajude-nos a traduzir o ShareX para o seu idioma! @@ -244,19 +244,19 @@ Proxy - Upload + Enviar Resultados - Hospedagem de arquivos secundária + Hospedagem de arquivos alternativa - Hospedagem de imagens secundária + Hospedagem de imagens alternativa - Hospedagem de texto secundária + Hospedagem de texto alternativa Domínio: @@ -265,7 +265,7 @@ Mostrar botão "Enviar usando ShareX" no menu da shell - Reenvio + Reenviar ... diff --git a/ShareX/Forms/ApplicationSettingsForm.resx b/ShareX/Forms/ApplicationSettingsForm.resx index 0c9df23c5..32a475d48 100644 --- a/ShareX/Forms/ApplicationSettingsForm.resx +++ b/ShareX/Forms/ApplicationSettingsForm.resx @@ -473,7 +473,7 @@ Steam - @Invariant + gbSteam @@ -521,7 +521,7 @@ Chrome - @Invariant + gbChrome @@ -635,7 +635,7 @@ Windows - @Invariant + gbWindows @@ -749,7 +749,7 @@ ... - @Invariant + lblPreviewPersonalFolderPath @@ -992,7 +992,7 @@ ... - @Invariant + lblSaveImageSubFolderPatternPreview @@ -1053,6 +1053,171 @@ 2 + + NoControl + + + 16, 128 + + + 184, 23 + + + 4 + + + Import... + + + btnImport + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 0 + + + 16, 96 + + + 184, 23 + + + 3 + + + Export... + + + btnExport + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 1 + + + True + + + NoControl + + + 16, 64 + + + 78, 17 + + + 2 + + + Export logs + + + cbExportLogs + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 2 + + + True + + + NoControl + + + 16, 40 + + + 89, 17 + + + 1 + + + Export history + + + cbExportHistory + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 3 + + + True + + + 16, 16 + + + 95, 17 + + + 0 + + + Export settings + + + cbExportSettings + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 4 + + + 4, 22 + + + 3, 3, 3, 3 + + + 550, 370 + + + 7 + + + Export / Import + + + tpExportImport + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcSettings + + + 3 + 16, 32 @@ -1336,7 +1501,7 @@ tcSettings - 3 + 4 True @@ -2026,7 +2191,7 @@ tcSettings - 4 + 5 True @@ -2140,7 +2305,7 @@ tcSettings - 5 + 6 Fill @@ -2191,7 +2356,7 @@ tcSettings - 6 + 7 176, 3 diff --git a/ShareX/Forms/CompanionCubesForm.cs b/ShareX/Forms/CompanionCubesForm.cs deleted file mode 100644 index 8db49ec05..000000000 --- a/ShareX/Forms/CompanionCubesForm.cs +++ /dev/null @@ -1,46 +0,0 @@ -#region License Information (GPL v3) - -/* - ShareX - A program that allows you to take screenshots and share any file type - Copyright (c) 2007-2016 ShareX Team - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Optionally you can also view the license at . -*/ - -#endregion License Information (GPL v3) - -using ShareX.HelpersLib; -using System; -using System.Windows.Forms; - -namespace ShareX -{ - public class CompanionCubesForm : LayeredForm - { - public CompanionCubesForm() - { - StartPosition = FormStartPosition.Manual; - Bounds = CaptureHelpers.GetScreenWorkingArea(); - Shown += CompanionCubesForm_Shown; - } - - private void CompanionCubesForm_Shown(object sender, EventArgs e) - { - this.ShowActivate(); - } - } -} \ No newline at end of file diff --git a/ShareX/Forms/FirstTimeConfigForm.pt-BR.resx b/ShareX/Forms/FirstTimeConfigForm.pt-BR.resx index 688be8f86..a20ecec8e 100644 --- a/ShareX/Forms/FirstTimeConfigForm.pt-BR.resx +++ b/ShareX/Forms/FirstTimeConfigForm.pt-BR.resx @@ -127,10 +127,10 @@ Mostrar ShareX no menu "Enviar para" - Mostrar botão "Enviar com ShareX" no menu de contexto do Windows Explorer + Mostrar botão "Enviar com ShareX" no menu contextual do Windows Explorer - Enquanto o programa estiver aberto, mostrar "Em aplicativo" na Steam + Mostrar "Em aplicativo" na Steam enquanto o programa estiver executando Você pode achar estas configurações em "Configs. do programa -> Integração". diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index ed03e21d1..4883d6efa 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -1895,12 +1895,34 @@ private void AfterCapture(Image img, CaptureType captureType, TaskSettings taskS taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects); } - string customFileName; - - if (TaskHelpers.ShowAfterCaptureForm(taskSettings, out customFileName, img)) + if (taskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.ShowQuickTaskMenu)) { - UploadManager.RunImageTask(img, taskSettings, customFileName); + QuickTaskMenu quickTaskMenu = new QuickTaskMenu(); + quickTaskMenu.TaskInfoSelected += taskInfo => + { + if (taskInfo.IsValid) + { + taskSettings.AfterCaptureJob = taskInfo.AfterCaptureTasks; + taskSettings.AfterUploadJob = taskInfo.AfterUploadTasks; + AfterCaptureRunTask(img, taskSettings); + } + }; + quickTaskMenu.ShowMenu(); } + else + { + AfterCaptureRunTask(img, taskSettings); + } + } + } + + private void AfterCaptureRunTask(Image img, TaskSettings taskSettings) + { + string customFileName; + + if (TaskHelpers.ShowAfterCaptureForm(taskSettings, out customFileName, img)) + { + UploadManager.RunImageTask(img, taskSettings, customFileName); } } diff --git a/ShareX/Forms/MainForm.pt-BR.resx b/ShareX/Forms/MainForm.pt-BR.resx index 3c2589235..840d33783 100644 --- a/ShareX/Forms/MainForm.pt-BR.resx +++ b/ShareX/Forms/MainForm.pt-BR.resx @@ -121,19 +121,19 @@ Gasto - Nome do arquivo + Arquivo Progresso - Restando + Restante Velocidade - Status + Estado URL @@ -160,7 +160,7 @@ Tarefas pós-captura - Tarefas pós-upload + Tarefas pós-envio Capturar @@ -208,7 +208,7 @@ Limpar lista - Escolher cor... + Seletor de cores... Copiar @@ -220,13 +220,13 @@ Arquivo - Nome do arquivo + Nome Nome do arquivo com extensão - Local do arquivo + Local Pasta @@ -238,16 +238,16 @@ Link para fórum (BBCode) - Imagem para fórum com link embutido (BBCode) + Imagem para fórum com link (BBCode) - Imagem para HTML + Imagem HTML - Link para HTML + Link HTML - Imagem com link para HTML + Imagem com link HTML Imagem @@ -322,19 +322,19 @@ URL - Upload de arquivo... + Envio de arquivo... - Upload de pasta... + Envio de pasta... - Upload de arquivo... + Envio de arquivo... - Upload de pasta... + Envio de pasta... - Upload do URL... + Envio do URL... Encurtadores de URL @@ -343,10 +343,10 @@ Tuitar mensagem... - Upload da área de transferencia... + Envio da área de transferência... - Upload de arrastar e soltar... + Arrastar e soltar para enviar... Compartilhar URL @@ -364,7 +364,7 @@ Mostrar erros - Parar upload + Parar envio Sobre... @@ -376,13 +376,13 @@ Testar compartilhamento de URL - Testar upload de texto + Testar envio de texto - Testar upload de imagem + Testar envio de imagem - Testar upload de arquivo + Testar envio de arquivo Captura @@ -397,22 +397,22 @@ Régua... - Upload + Enviar Tuitar mensagem... - Upload da área de transferencia... + Envio de arquivo da área de transferência... - Upload de arrastar e soltar... + Arrastar e soltar para enviar... Janela - Upload do URL... + Envio do URL... Teste de monitor... @@ -481,10 +481,10 @@ Envio de arquivos - Desenho à mão livre + Mão livre - Verificação de hash... + Conferir hash... Prévia de imagem @@ -514,16 +514,16 @@ Região - Região (anotar) + Região (Anotar) - Região (leve) + Região (Leve) - Região (transparente) + Região (Transparente) - Seleção de cor da tela + Seletor de cores da tela Gravar tela @@ -538,7 +538,7 @@ Envio de texto - Seleção de cores... + Seletor de cores... Trocador de DNS... @@ -550,7 +550,7 @@ Desenho à mão livre - Verificação de hash + Conferir hash Efeitos de imagem... @@ -589,7 +589,7 @@ Região (transparente) - Seleção de cores da tela... + Seletor de cores da tela... Gravar tela @@ -607,7 +607,7 @@ Serviços de compartilhamento de URLs - Captura de página da web... + Capturar página da web... Workflows @@ -657,4 +657,7 @@ Depurar + + Esconder colunas + \ No newline at end of file diff --git a/ShareX/Forms/QuickTaskInfoEditForm.Designer.cs b/ShareX/Forms/QuickTaskInfoEditForm.Designer.cs new file mode 100644 index 000000000..bfc9cf1f4 --- /dev/null +++ b/ShareX/Forms/QuickTaskInfoEditForm.Designer.cs @@ -0,0 +1,153 @@ +namespace ShareX +{ + partial class QuickTaskInfoEditForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.mbAfterCaptureTasks = new ShareX.HelpersLib.MenuButton(); + this.mbAfterUploadTasks = new ShareX.HelpersLib.MenuButton(); + this.cmsAfterCapture = new System.Windows.Forms.ContextMenuStrip(this.components); + this.cmsAfterUpload = new System.Windows.Forms.ContextMenuStrip(this.components); + this.lblAfterCaptureTasks = new System.Windows.Forms.Label(); + this.lblAfterUploadTasks = new System.Windows.Forms.Label(); + this.lblName = new System.Windows.Forms.Label(); + this.txtName = new System.Windows.Forms.TextBox(); + this.btnOK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // mbAfterCaptureTasks + // + this.mbAfterCaptureTasks.Location = new System.Drawing.Point(8, 72); + this.mbAfterCaptureTasks.Menu = this.cmsAfterCapture; + this.mbAfterCaptureTasks.Name = "mbAfterCaptureTasks"; + this.mbAfterCaptureTasks.Size = new System.Drawing.Size(424, 23); + this.mbAfterCaptureTasks.TabIndex = 0; + this.mbAfterCaptureTasks.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.mbAfterCaptureTasks.UseVisualStyleBackColor = true; + // + // mbAfterUploadTasks + // + this.mbAfterUploadTasks.Location = new System.Drawing.Point(8, 120); + this.mbAfterUploadTasks.Menu = this.cmsAfterUpload; + this.mbAfterUploadTasks.Name = "mbAfterUploadTasks"; + this.mbAfterUploadTasks.Size = new System.Drawing.Size(424, 23); + this.mbAfterUploadTasks.TabIndex = 1; + this.mbAfterUploadTasks.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.mbAfterUploadTasks.UseVisualStyleBackColor = true; + // + // cmsAfterCapture + // + this.cmsAfterCapture.Name = "cmsAfterCapture"; + this.cmsAfterCapture.Size = new System.Drawing.Size(61, 4); + // + // cmsAfterUpload + // + this.cmsAfterUpload.Name = "cmsAfterUpload"; + this.cmsAfterUpload.Size = new System.Drawing.Size(61, 4); + // + // lblAfterCaptureTasks + // + this.lblAfterCaptureTasks.AutoSize = true; + this.lblAfterCaptureTasks.Location = new System.Drawing.Point(5, 56); + this.lblAfterCaptureTasks.Name = "lblAfterCaptureTasks"; + this.lblAfterCaptureTasks.Size = new System.Drawing.Size(99, 13); + this.lblAfterCaptureTasks.TabIndex = 2; + this.lblAfterCaptureTasks.Text = "After capture tasks:"; + // + // lblAfterUploadTasks + // + this.lblAfterUploadTasks.AutoSize = true; + this.lblAfterUploadTasks.Location = new System.Drawing.Point(5, 104); + this.lblAfterUploadTasks.Name = "lblAfterUploadTasks"; + this.lblAfterUploadTasks.Size = new System.Drawing.Size(95, 13); + this.lblAfterUploadTasks.TabIndex = 3; + this.lblAfterUploadTasks.Text = "After upload tasks:"; + // + // lblName + // + this.lblName.AutoSize = true; + this.lblName.Location = new System.Drawing.Point(5, 8); + this.lblName.Name = "lblName"; + this.lblName.Size = new System.Drawing.Size(57, 13); + this.lblName.TabIndex = 4; + this.lblName.Text = "Menu text:"; + // + // txtName + // + this.txtName.Location = new System.Drawing.Point(8, 24); + this.txtName.Name = "txtName"; + this.txtName.Size = new System.Drawing.Size(424, 20); + this.txtName.TabIndex = 5; + this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btnOK.Location = new System.Drawing.Point(312, 160); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(120, 23); + this.btnOK.TabIndex = 6; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + // + // QuickTaskInfoEditForm + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(440, 192); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.txtName); + this.Controls.Add(this.lblName); + this.Controls.Add(this.lblAfterUploadTasks); + this.Controls.Add(this.lblAfterCaptureTasks); + this.Controls.Add(this.mbAfterUploadTasks); + this.Controls.Add(this.mbAfterCaptureTasks); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "QuickTaskInfoEditForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ShareX - Edit quick task menu item"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private HelpersLib.MenuButton mbAfterCaptureTasks; + private HelpersLib.MenuButton mbAfterUploadTasks; + private System.Windows.Forms.ContextMenuStrip cmsAfterCapture; + private System.Windows.Forms.ContextMenuStrip cmsAfterUpload; + private System.Windows.Forms.Label lblAfterCaptureTasks; + private System.Windows.Forms.Label lblAfterUploadTasks; + private System.Windows.Forms.Label lblName; + private System.Windows.Forms.TextBox txtName; + private System.Windows.Forms.Button btnOK; + } +} \ No newline at end of file diff --git a/ShareX/Forms/QuickTaskInfoEditForm.cs b/ShareX/Forms/QuickTaskInfoEditForm.cs new file mode 100644 index 000000000..17e7b031a --- /dev/null +++ b/ShareX/Forms/QuickTaskInfoEditForm.cs @@ -0,0 +1,109 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2016 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using ShareX.HelpersLib; +using ShareX.Properties; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace ShareX +{ + public partial class QuickTaskInfoEditForm : BaseForm + { + public QuickTaskInfo TaskInfo { get; private set; } + + public QuickTaskInfoEditForm(QuickTaskInfo taskInfo) + { + InitializeComponent(); + TaskInfo = taskInfo; + txtName.Text = TaskInfo.Name; + AddMultiEnumItemsContextMenu(x => TaskInfo.AfterCaptureTasks = TaskInfo.AfterCaptureTasks.Swap(x), cmsAfterCapture); + AddMultiEnumItemsContextMenu(x => TaskInfo.AfterUploadTasks = TaskInfo.AfterUploadTasks.Swap(x), cmsAfterUpload); + SetMultiEnumCheckedContextMenu(TaskInfo.AfterCaptureTasks, cmsAfterCapture); + SetMultiEnumCheckedContextMenu(TaskInfo.AfterUploadTasks, cmsAfterUpload); + UpdateUploaderMenuNames(); + } + + private void txtName_TextChanged(object sender, EventArgs e) + { + TaskInfo.Name = txtName.Text; + } + + private void AddMultiEnumItemsContextMenu(Action selectedEnum, params ToolStripDropDown[] parents) + { + string[] enums = Helpers.GetLocalizedEnumDescriptions().Skip(1).Select(x => x.Replace("&", "&&")).ToArray(); + + foreach (ToolStripDropDown parent in parents) + { + for (int i = 0; i < enums.Length; i++) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem(enums[i]); + + int index = i; + + tsmi.Click += (sender, e) => + { + foreach (ToolStripDropDown parent2 in parents) + { + ToolStripMenuItem tsmi2 = (ToolStripMenuItem)parent2.Items[index]; + tsmi2.Checked = !tsmi2.Checked; + } + + selectedEnum((T)Enum.ToObject(typeof(T), 1 << index)); + + UpdateUploaderMenuNames(); + }; + + parent.Items.Add(tsmi); + } + } + } + + private void SetMultiEnumCheckedContextMenu(Enum value, params ToolStripDropDown[] parents) + { + for (int i = 0; i < parents[0].Items.Count; i++) + { + foreach (ToolStripDropDown parent in parents) + { + ToolStripMenuItem tsmi = (ToolStripMenuItem)parent.Items[i]; + tsmi.Checked = value.HasFlag(1 << i); + } + } + } + + private void UpdateUploaderMenuNames() + { + txtName.SetWatermark(TaskInfo.ToString(), true); + mbAfterCaptureTasks.Text = string.Join(", ", TaskInfo.AfterCaptureTasks.GetFlags().Select(x => x.GetLocalizedDescription())); + mbAfterUploadTasks.Text = string.Join(", ", TaskInfo.AfterUploadTasks.GetFlags().Select(x => x.GetLocalizedDescription())); + } + } +} \ No newline at end of file diff --git a/ShareX/Forms/QuickTaskInfoEditForm.resx b/ShareX/Forms/QuickTaskInfoEditForm.resx new file mode 100644 index 000000000..4f2250dc7 --- /dev/null +++ b/ShareX/Forms/QuickTaskInfoEditForm.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 160, 17 + + \ No newline at end of file diff --git a/ShareX/Forms/QuickTaskMenuEditorForm.Designer.cs b/ShareX/Forms/QuickTaskMenuEditorForm.Designer.cs new file mode 100644 index 000000000..9b7b17fa4 --- /dev/null +++ b/ShareX/Forms/QuickTaskMenuEditorForm.Designer.cs @@ -0,0 +1,162 @@ +namespace ShareX +{ + partial class QuickTaskMenuEditorForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lvPresets = new ShareX.HelpersLib.MyListView(); + this.chName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnEdit = new System.Windows.Forms.Button(); + this.btnRemove = new System.Windows.Forms.Button(); + this.btnReset = new System.Windows.Forms.Button(); + this.btnClose = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lvPresets + // + this.lvPresets.AllowDrop = true; + this.lvPresets.AllowItemDrag = true; + this.lvPresets.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvPresets.AutoFillColumn = true; + this.lvPresets.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.chName}); + this.lvPresets.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lvPresets.FullRowSelect = true; + this.lvPresets.GridLines = true; + this.lvPresets.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.lvPresets.Location = new System.Drawing.Point(8, 8); + this.lvPresets.Name = "lvPresets"; + this.lvPresets.Size = new System.Drawing.Size(448, 328); + this.lvPresets.TabIndex = 0; + this.lvPresets.UseCompatibleStateImageBehavior = false; + this.lvPresets.View = System.Windows.Forms.View.Details; + this.lvPresets.ItemMoved += new ShareX.HelpersLib.MyListView.ListViewItemMovedEventHandler(this.lvPresets_ItemMoved); + // + // chName + // + this.chName.Width = 372; + // + // btnAdd + // + this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnAdd.Location = new System.Drawing.Point(8, 368); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.Size = new System.Drawing.Size(144, 23); + this.btnAdd.TabIndex = 1; + this.btnAdd.Text = "Add"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + // + // btnEdit + // + this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnEdit.Location = new System.Drawing.Point(160, 368); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.Size = new System.Drawing.Size(144, 23); + this.btnEdit.TabIndex = 2; + this.btnEdit.Text = "Edit"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); + // + // btnRemove + // + this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnRemove.Location = new System.Drawing.Point(312, 368); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.Size = new System.Drawing.Size(144, 23); + this.btnRemove.TabIndex = 3; + this.btnRemove.Text = "Remove"; + this.btnRemove.UseVisualStyleBackColor = true; + this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); + // + // btnReset + // + this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnReset.Location = new System.Drawing.Point(272, 400); + this.btnReset.Name = "btnReset"; + this.btnReset.Size = new System.Drawing.Size(184, 23); + this.btnReset.TabIndex = 4; + this.btnReset.Text = "Reset to default"; + this.btnReset.UseVisualStyleBackColor = true; + this.btnReset.Click += new System.EventHandler(this.btnReset_Click); + // + // btnClose + // + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btnClose.Location = new System.Drawing.Point(8, 400); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(256, 23); + this.btnClose.TabIndex = 5; + this.btnClose.Text = "Close"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(8, 344); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(341, 13); + this.label1.TabIndex = 6; + this.label1.Text = "Tip: If you add empty task it will be converted to separator line in menu."; + // + // QuickTaskMenuEditorForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(464, 432); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.btnReset); + this.Controls.Add(this.btnRemove); + this.Controls.Add(this.btnEdit); + this.Controls.Add(this.btnAdd); + this.Controls.Add(this.lvPresets); + this.Name = "QuickTaskMenuEditorForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "ShareX - Quick task menu editor"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private HelpersLib.MyListView lvPresets; + private System.Windows.Forms.ColumnHeader chName; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.Button btnEdit; + private System.Windows.Forms.Button btnRemove; + private System.Windows.Forms.Button btnReset; + private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Label label1; + } +} \ No newline at end of file diff --git a/ShareX/Forms/QuickTaskMenuEditorForm.cs b/ShareX/Forms/QuickTaskMenuEditorForm.cs new file mode 100644 index 000000000..6ff6f55bf --- /dev/null +++ b/ShareX/Forms/QuickTaskMenuEditorForm.cs @@ -0,0 +1,118 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2016 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using ShareX.HelpersLib; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace ShareX +{ + public partial class QuickTaskMenuEditorForm : BaseForm + { + public QuickTaskMenuEditorForm() + { + InitializeComponent(); + + if (Program.Settings.QuickTaskPresets == null) + { + Program.Settings.QuickTaskPresets = new List(); + } + + UpdateItems(); + } + + private void UpdateItems() + { + lvPresets.Items.Clear(); + + foreach (QuickTaskInfo taskInfo in Program.Settings.QuickTaskPresets) + { + ListViewItem lvi = new ListViewItem(taskInfo.ToString()); + lvi.Tag = taskInfo; + lvPresets.Items.Add(lvi); + } + } + + private void Edit(QuickTaskInfo taskInfo) + { + new QuickTaskInfoEditForm(taskInfo).ShowDialog(); + } + + private void btnAdd_Click(object sender, EventArgs e) + { + QuickTaskInfo taskInfo = new QuickTaskInfo(); + ListViewItem lvi = new ListViewItem(); + lvi.Tag = taskInfo; + Program.Settings.QuickTaskPresets.Add(taskInfo); + lvPresets.Items.Add(lvi); + Edit(taskInfo); + lvi.Text = taskInfo.ToString(); + } + + private void btnEdit_Click(object sender, EventArgs e) + { + if (lvPresets.SelectedItems.Count > 0) + { + ListViewItem lvi = lvPresets.SelectedItems[0]; + QuickTaskInfo taskInfo = lvi.Tag as QuickTaskInfo; + Edit(taskInfo); + lvi.Text = taskInfo.ToString(); + } + } + + private void btnRemove_Click(object sender, EventArgs e) + { + if (lvPresets.SelectedItems.Count > 0) + { + ListViewItem lvi = lvPresets.SelectedItems[0]; + QuickTaskInfo taskInfo = lvi.Tag as QuickTaskInfo; + Program.Settings.QuickTaskPresets.Remove(taskInfo); + lvPresets.Items.Remove(lvi); + } + } + + private void lvPresets_ItemMoved(object sender, int oldIndex, int newIndex) + { + Program.Settings.QuickTaskPresets.Move(oldIndex, newIndex); + } + + private void btnReset_Click(object sender, EventArgs e) + { + Program.Settings.QuickTaskPresets = QuickTaskInfo.DefaultPresets; + UpdateItems(); + } + + private void btnClose_Click(object sender, EventArgs e) + { + Close(); + } + } +} \ No newline at end of file diff --git a/ShareX/Forms/QuickTaskMenuEditorForm.resx b/ShareX/Forms/QuickTaskMenuEditorForm.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/ShareX/Forms/QuickTaskMenuEditorForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ShareX/Forms/TaskSettingsForm.cs b/ShareX/Forms/TaskSettingsForm.cs index 5277ff901..b2f7d9ab4 100644 --- a/ShareX/Forms/TaskSettingsForm.cs +++ b/ShareX/Forms/TaskSettingsForm.cs @@ -559,11 +559,11 @@ private void UpdateUploaderMenuNames() { btnTask.Text = string.Format(Resources.TaskSettingsForm_UpdateUploaderMenuNames_Task___0_, TaskSettings.Job.GetLocalizedDescription()); - btnAfterCapture.Text = string.Format(Resources.TaskSettingsForm_UpdateUploaderMenuNames_After_capture___0_, string.Join(", ", TaskSettings.AfterCaptureJob.GetFlags(). - Select(x => x.GetLocalizedDescription()).ToArray())); + btnAfterCapture.Text = string.Format(Resources.TaskSettingsForm_UpdateUploaderMenuNames_After_capture___0_, + string.Join(", ", TaskSettings.AfterCaptureJob.GetFlags().Select(x => x.GetLocalizedDescription()))); - btnAfterUpload.Text = string.Format(Resources.TaskSettingsForm_UpdateUploaderMenuNames_After_upload___0_, string.Join(", ", TaskSettings.AfterUploadJob.GetFlags(). - Select(x => x.GetLocalizedDescription()).ToArray())); + btnAfterUpload.Text = string.Format(Resources.TaskSettingsForm_UpdateUploaderMenuNames_After_upload___0_, + string.Join(", ", TaskSettings.AfterUploadJob.GetFlags().Select(x => x.GetLocalizedDescription()))); string imageUploader = TaskSettings.ImageDestination == ImageDestination.FileUploader ? TaskSettings.ImageFileDestination.GetLocalizedDescription() : TaskSettings.ImageDestination.GetLocalizedDescription(); diff --git a/ShareX/Forms/TaskSettingsForm.pt-BR.resx b/ShareX/Forms/TaskSettingsForm.pt-BR.resx index 03bb3ab55..7622f1c3f 100644 --- a/ShareX/Forms/TaskSettingsForm.pt-BR.resx +++ b/ShareX/Forms/TaskSettingsForm.pt-BR.resx @@ -133,7 +133,7 @@ Após captura... - Após upload... + Após envio... Destinos... @@ -187,10 +187,10 @@ Ações - Upload + Envio - Upload da área de transferência + Envio da área de transferência Tarefa @@ -280,7 +280,7 @@ Capturar janela com transparência - Usar fuso-horário diferente: + Utilizar fuso-horário diferente: Duração fixa: @@ -352,7 +352,7 @@ Local da pasta - Se a área de transferência contém um URL: baixar o arquivo e enviá-lo + Se a área de transferência conter um URL: baixar o arquivo e enviá-lo Substituir serviço customizado padrão: @@ -379,13 +379,13 @@ Aplicar efeitos somente em capturas de região - Usar padrão para envios de arquivo também ao invés de usar o nome do arquivo + Utilizar padrão para envio de arquivos ao invés do nome do arquivo - Se a área de transferência contém um URL: usar Encurtador de URL + Se a área de transferência conter um URL: usar Encurtador de URL - Se a área de transferência contém um URL: compartilhar usando serviço de compartilhamento de URL + Se a área de transferência conter um URL: compartilhar usando serviço de compartilhamento de URL Você pode habilitar/desabilitar efeitos de imagem em "Tarefas pós-captura -> Adicionar efeitos de imagem". @@ -421,16 +421,16 @@ Usar opções de imagem nas opções de tarefas da janela principal - Usar opções de upload nas opções de tarefas da janela principal + Utilizar opções de upload nas opções de tarefas da janela principal - Se a área de transferência contém o local de uma pasta: arquivar a pasta e enviar o índice + Se a área de transferência conter o local de uma pasta: arquivar a pasta e enviar o índice Mostrar cursor na gravação - 0 a 100 + 0 - 100 Usar opções de ferramentas nas opções de tarefas da janela principal @@ -444,4 +444,10 @@ Captura rolante + + Utilizar nome da janela para captura de região (ShareX tentará detectar a janela atrás da seleção) + + + Nomeação de arquivos + \ No newline at end of file diff --git a/ShareX/Program.cs b/ShareX/Program.cs index 3ca078f40..42685737a 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -203,13 +203,14 @@ public static string HistoryFilePath } } + public static string LogsFolder => Path.Combine(PersonalFolder, "Logs"); + public static string LogsFilePath { get { - string logsFolder = Path.Combine(PersonalFolder, "Logs"); string filename = string.Format("ShareX-Log-{0:yyyy-MM}.txt", DateTime.Now); - return Path.Combine(logsFolder, filename); + return Path.Combine(LogsFolder, filename); } } @@ -235,8 +236,9 @@ public static string ScreenshotsFolder } } - private static string BackupFolder => Path.Combine(PersonalFolder, "Backup"); - private static string ToolsFolder => Path.Combine(PersonalFolder, "Tools"); + public static string BackupFolder => Path.Combine(PersonalFolder, "Backup"); + public static string ToolsFolder => Path.Combine(PersonalFolder, "Tools"); + public static string GreenshotImageEditorConfigFilePath => Path.Combine(PersonalFolder, "GreenshotImageEditor.ini"); public static string ScreenRecorderCacheFilePath => Path.Combine(PersonalFolder, "ScreenRecorder.avi"); public static string DefaultFFmpegFilePath => Path.Combine(ToolsFolder, "ffmpeg.exe"); public static string ChromeHostManifestFilePath => Path.Combine(ToolsFolder, "Chrome-host-manifest.json"); diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index cd2536f96..23d037034 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -551,16 +551,6 @@ public class Resources { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap CompanionCube { - get { - object obj = ResourceManager.GetObject("CompanionCube", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -916,16 +906,6 @@ public class Resources { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap google_plus { - get { - object obj = ResourceManager.GetObject("google_plus", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX/Properties/Resources.pt-BR.resx b/ShareX/Properties/Resources.pt-BR.resx index 2f5c06366..8254d2a35 100644 --- a/ShareX/Properties/Resources.pt-BR.resx +++ b/ShareX/Properties/Resources.pt-BR.resx @@ -235,13 +235,13 @@ Pressione "Não" para cancelar e desabilitar o upload automático. Compartilhar URL ({0}) - Upload de pasta + Envio de pasta Upload de arquivo - Não mostrar esta mensagem de novo. + Não mostrar esta mensagem novamente. Você tem certeza que deseja fazer o upload de {0} arquivos? @@ -251,7 +251,7 @@ Pressione "Não" para cancelar e desabilitar o upload automático. {0} - Erros de upload + Erros de envio Encurtador de URL: {0} @@ -266,7 +266,7 @@ Pressione "Não" para cancelar e desabilitar o upload automático. Erro - Não foi encontrada uma conta válida do Twitter. + Não foi possível encontrar uma conta válida do Twitter. Tuíte enviado com sucesso. @@ -325,10 +325,10 @@ Pressione "Não" para cancelar e desabilitar o upload automático. Você gostaria de baixar automaticamente? - Fonte de video e audio para o FFmpeg não pode ser vazio. + Fonte de video e áudio do FFmpeg não podem estar vazias. - Não foi possivel encontar uma conta válida de FTP. + Não foi possível encontrar uma conta FTP válida. Copiado para a área de transferência: {0} @@ -366,7 +366,7 @@ Por favor, execute o ShareX como administrador para mudar a pasta de destino. +Por favor, selecione um atalho diferente ou feche o programa conflituoso e reabra o ShareX. Depois da captura: {0} @@ -444,7 +444,7 @@ Por favor, selecione um atalho diferente ou feche a aplicação que está gerand Personalizado - Você pode clicar com o botão direito no icone do ShareX na bandeja do sistema para iniciar captura por região. + Você pode clicar com o botão direito no ícone do ShareX na bandeja do sistema para iniciar uma captura por região. Editor de imagem - como carregar a imagem? @@ -471,7 +471,7 @@ Tem certeza de que quer continuar? Suporte ao Chrome desabilitado. - Notas de atualização + Registro de alterações Não foi possível salvar imagem no local {0}. diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index 07e9dd8f3..44b0a6b6f 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -160,9 +160,6 @@ Press 'No' to cancel the current upload and disable screenshot auto uploading. ..\Resources\bin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\google_plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\toolbox.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -696,9 +693,6 @@ Would you like to restart ShareX? ..\Resources\es.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\CompanionCube.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\layer-shape-polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/ShareX/QuickTaskInfo.cs b/ShareX/QuickTaskInfo.cs new file mode 100644 index 000000000..be3f9caea --- /dev/null +++ b/ShareX/QuickTaskInfo.cs @@ -0,0 +1,98 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2016 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using ShareX.HelpersLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ShareX +{ + public class QuickTaskInfo + { + public string Name { get; set; } + public AfterCaptureTasks AfterCaptureTasks { get; set; } + public AfterUploadTasks AfterUploadTasks { get; set; } + + public bool IsValid + { + get + { + return AfterCaptureTasks != AfterCaptureTasks.None; + } + } + + public static List DefaultPresets { get; } = new List() + { + new QuickTaskInfo("Save, Upload, Copy URL", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard), + new QuickTaskInfo("Save, Copy image", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.CopyImageToClipboard), + new QuickTaskInfo("Save, Copy image file", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.CopyFileToClipboard), + new QuickTaskInfo("Annotate, Save, Upload, Copy URL", AfterCaptureTasks.AnnotateImage | AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard), + new QuickTaskInfo(), + new QuickTaskInfo("Upload, Copy URL", AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard), + new QuickTaskInfo("Save", AfterCaptureTasks.SaveImageToFile), + new QuickTaskInfo("Copy image", AfterCaptureTasks.CopyImageToClipboard), + new QuickTaskInfo("Annotate", AfterCaptureTasks.AnnotateImage) + }; + + public QuickTaskInfo() + { + } + + public QuickTaskInfo(string name, AfterCaptureTasks afterCaptureTasks, AfterUploadTasks afterUploadTasks = AfterUploadTasks.None) + { + Name = name; + AfterCaptureTasks = afterCaptureTasks; + AfterUploadTasks = afterUploadTasks; + } + + public QuickTaskInfo(AfterCaptureTasks afterCaptureTasks, AfterUploadTasks afterUploadTasks = AfterUploadTasks.None) : this(null, afterCaptureTasks, afterUploadTasks) + { + } + + public override string ToString() + { + if (!string.IsNullOrEmpty(Name)) + { + return Name; + } + + string result = string.Join(", ", AfterCaptureTasks.GetFlags().Select(x => x.GetLocalizedDescription())); + + if (AfterCaptureTasks.HasFlag(AfterCaptureTasks.UploadImageToHost)) + { + string[] flags = AfterUploadTasks.GetFlags().Select(x => x.GetLocalizedDescription()).ToArray(); + + if (flags != null && flags.Length > 0) + { + result += ", " + string.Join(", ", flags); + } + } + + return result; + } + } +} \ No newline at end of file diff --git a/ShareX/QuickTaskMenu.cs b/ShareX/QuickTaskMenu.cs new file mode 100644 index 000000000..131993fd5 --- /dev/null +++ b/ShareX/QuickTaskMenu.cs @@ -0,0 +1,104 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2016 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using ShareX.HelpersLib; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace ShareX +{ + public class QuickTaskMenu + { + public delegate void TaskInfoSelectedEventHandler(QuickTaskInfo taskInfo); + public TaskInfoSelectedEventHandler TaskInfoSelected; + + public void ShowMenu() + { + ContextMenuStrip cms = new ContextMenuStrip + { + Font = new Font("Arial", 10f), + AutoClose = false, + ShowImageMargin = false + }; + + if (Program.Settings != null && Program.Settings.QuickTaskPresets != null && Program.Settings.QuickTaskPresets.Count > 0) + { + foreach (QuickTaskInfo taskInfo in Program.Settings.QuickTaskPresets) + { + if (taskInfo.IsValid) + { + ToolStripMenuItem tsmi = new ToolStripMenuItem { Text = taskInfo.ToString().Replace("&", "&&"), Tag = taskInfo }; + tsmi.Click += (sender, e) => + { + QuickTaskInfo selectedTaskInfo = ((ToolStripMenuItem)sender).Tag as QuickTaskInfo; + cms.Close(); + OnTaskInfoSelected(selectedTaskInfo); + }; + cms.Items.Add(tsmi); + } + else + { + cms.Items.Add(new ToolStripSeparator()); + } + } + + cms.Items[0].Select(); + + cms.Items.Add(new ToolStripSeparator()); + } + + // Translate + ToolStripMenuItem tsmiEdit = new ToolStripMenuItem("Edit this menu..."); + tsmiEdit.Click += (sender, e) => + { + cms.Close(); + new QuickTaskMenuEditorForm().ShowDialog(); + }; + cms.Items.Add(tsmiEdit); + + cms.Items.Add(new ToolStripSeparator()); + + ToolStripMenuItem tsmiCancel = new ToolStripMenuItem("Cancel"); + tsmiCancel.Click += (sender, e) => cms.Close(); + cms.Items.Add(tsmiCancel); + + Point cursorPosition = CaptureHelpers.GetCursorPosition(); + cursorPosition.Offset(-10, -10); + cms.Show(cursorPosition); + } + + protected void OnTaskInfoSelected(QuickTaskInfo taskInfo) + { + if (TaskInfoSelected != null) + { + TaskInfoSelected(taskInfo); + } + } + } +} \ No newline at end of file diff --git a/ShareX/Resources/CompanionCube.png b/ShareX/Resources/CompanionCube.png deleted file mode 100644 index d2d27341a..000000000 Binary files a/ShareX/Resources/CompanionCube.png and /dev/null differ diff --git a/ShareX/Resources/google_plus.png b/ShareX/Resources/google_plus.png deleted file mode 100644 index 3c1eda0ba..000000000 Binary files a/ShareX/Resources/google_plus.png and /dev/null differ diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index 2ee2fcebe..398c2d89c 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -85,6 +85,10 @@ ..\packages\Newtonsoft.Json.8.0.2\lib\net40\Newtonsoft.Json.dll True + + ..\packages\SevenZipSharp.0.64\lib\SevenZipSharp.dll + True + 3.5 @@ -97,14 +101,13 @@ - - UserControl BeforeUploadControl.cs + Form @@ -123,9 +126,6 @@ ClipboardFormatForm.cs - - Form - Form @@ -172,6 +172,18 @@ ImageCombinerForm.cs + + Form + + + QuickTaskMenuEditorForm.cs + + + Form + + + QuickTaskInfoEditForm.cs + Form @@ -187,6 +199,8 @@ + + Form @@ -811,6 +825,12 @@ MainForm.cs + + QuickTaskInfoEditForm.cs + + + QuickTaskMenuEditorForm.cs + ScreenColorPicker.cs @@ -1207,7 +1227,6 @@ - @@ -1243,7 +1262,6 @@ - diff --git a/ShareX/packages.config b/ShareX/packages.config index b86a74c61..9ed9d9c55 100644 --- a/ShareX/packages.config +++ b/ShareX/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file