Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f4e344449 | ||
|
|
a97bb39103 | ||
|
|
b74b411e78 | ||
|
|
deca5cf7f2 | ||
|
|
8d44365776 | ||
|
|
9734cb5f9d | ||
|
|
d6dcccad71 | ||
|
|
92fbde025b |
@@ -0,0 +1,34 @@
|
||||
version: 1.0.{build}
|
||||
image: Visual Studio 2017
|
||||
|
||||
init:
|
||||
- ps: >-
|
||||
if ($env:APPVEYOR_REPO_TAG -eq "true")
|
||||
{
|
||||
Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME"
|
||||
}
|
||||
else
|
||||
{
|
||||
Update-AppveyorBuild -Version "dev-$($env:APPVEYOR_REPO_COMMIT.substring(0,7))"
|
||||
}
|
||||
|
||||
before_build:
|
||||
- cmd: nuget restore src/JiraTimeBot.sln
|
||||
|
||||
build:
|
||||
project: src/JiraTimeBot.sln
|
||||
|
||||
after_build:
|
||||
- cmd: 7z a JiraTimeBot.zip %APPVEYOR_BUILD_FOLDER%/src/JiraTimeBot/bin/Debug/*
|
||||
|
||||
artifacts:
|
||||
- path: JiraTimeBot.zip
|
||||
name: JiraTimeBot.zip
|
||||
|
||||
deploy:
|
||||
- provider: GitHub
|
||||
auth_token:
|
||||
secure: Jg8vtDMtgadXE5uifFSr5y9KNrGAjvFntqnRHzyuVWkssitctTtVq086svS2zXAq
|
||||
artifact: JiraTimeBot.zip
|
||||
on:
|
||||
APPVEYOR_REPO_TAG: true
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.0.28
|
||||
1.0.33
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
language: csharp
|
||||
solution: src/JiraTimeBot.sln
|
||||
|
||||
before_deploy:
|
||||
- "zip -j JiraTimeBot.zip src/JiraTimeBot/bin/Release/*"
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: $GITHUB_OAUTH_TOKEN
|
||||
overwrite: true
|
||||
file: JiraTimeBot.zip
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: always
|
||||
@@ -1,4 +1,4 @@
|
||||
# JiraTimeBot [](https://travis-ci.org/monster1025/JiraTimeBot)
|
||||
# JiraTimeBot [](https://ci.appveyor.com/project/Monster1025/JiraTimeBot)
|
||||
Приложение для автоматического добавления Jira Worklog'ов исходя из количества коммитов в ветку.
|
||||
|
||||
# Ограничения
|
||||
|
||||
@@ -17,10 +17,10 @@ namespace JiraTimeBot.Configuration
|
||||
{
|
||||
byte[] entropy = GetEntropy(address + username);
|
||||
byte[] pass = Encoding.UTF8.GetBytes(password);
|
||||
byte[] crypted = ProtectedData.Protect(pass, entropy, DataProtectionScope.LocalMachine);
|
||||
var cryptedBase64 = Convert.ToBase64String(crypted);
|
||||
byte[] encrypted = ProtectedData.Protect(pass, entropy, DataProtectionScope.LocalMachine);
|
||||
var encryptedBase64 = Convert.ToBase64String(encrypted);
|
||||
|
||||
return cryptedBase64;
|
||||
return encryptedBase64;
|
||||
}
|
||||
|
||||
public string Decrypt(string username, string password, string address)
|
||||
@@ -32,7 +32,7 @@ namespace JiraTimeBot.Configuration
|
||||
pass = ProtectedData.Unprotect(pass, entropy, DataProtectionScope.LocalMachine);
|
||||
return Encoding.UTF8.GetString(pass);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
<Compile Include="UI\frmSettings.Designer.cs">
|
||||
<DependentUpon>frmSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Tray\SingleInstance.cs" />
|
||||
<Compile Include="UI\Tray\ITrayMenu.cs" />
|
||||
<Compile Include="UI\Tray\RestoreFromTray.cs" />
|
||||
<Compile Include="UI\Tray\TrayMenu.cs" />
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using JiraTimeBot.UI.Tray;
|
||||
|
||||
namespace JiraTimeBot
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace JiraTimeBot
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Another instance of the app is already running.");
|
||||
SingleInstance.ShowFirstInstance();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.28")]
|
||||
[assembly: AssemblyFileVersion("1.0.28")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.28")]
|
||||
[assembly: AssemblyVersion("1.0.33")]
|
||||
[assembly: AssemblyFileVersion("1.0.33")]
|
||||
[assembly: AssemblyInformationalVersion("1.0.33")]
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace JiraTimeBot.TaskTime
|
||||
Time = TimeSpan.FromMinutes(30),
|
||||
Branch = settings.TimeControlTask,
|
||||
Commits = 1,
|
||||
Description = "Время на учет задач",
|
||||
Description = "Ведение учета времени",
|
||||
StartTime = DateTime.Now.Date
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace JiraTimeBot.UI.Tray
|
||||
{
|
||||
static class SingleInstance
|
||||
{
|
||||
public static readonly int WM_SHOWFIRSTINSTANCE = RegisterWindowMessage($"WM_SHOWFIRSTINSTANCE|{AssemblyGuid}");
|
||||
|
||||
public static void ShowFirstInstance()
|
||||
{
|
||||
const int HWND_BROADCAST = 0xffff;
|
||||
PostMessage((IntPtr)HWND_BROADCAST, WM_SHOWFIRSTINSTANCE, IntPtr.Zero, IntPtr.Zero);
|
||||
}
|
||||
|
||||
public static string AssemblyGuid
|
||||
{
|
||||
get
|
||||
{
|
||||
object[] attributes = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), false);
|
||||
if (attributes.Length == 0) {
|
||||
return string.Empty;
|
||||
}
|
||||
return ((GuidAttribute)attributes[0]).Value;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("user32")]
|
||||
public static extern int RegisterWindowMessage(string message);
|
||||
|
||||
[DllImport("user32")]
|
||||
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,16 @@ namespace JiraTimeBot.UI
|
||||
private readonly Action<string> _settingsErrorReporter;
|
||||
private bool _updateChecked;
|
||||
|
||||
protected override void WndProc(ref Message message)
|
||||
{
|
||||
if (message.Msg == SingleInstance.WM_SHOWFIRSTINSTANCE) {
|
||||
this.Show();
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
_trayIcon.Hide();
|
||||
}
|
||||
base.WndProc(ref message);
|
||||
}
|
||||
|
||||
private CancellationTokenSource GetTokenSource()
|
||||
{
|
||||
var tokenSource = new CancellationTokenSource();
|
||||
@@ -100,6 +110,7 @@ namespace JiraTimeBot.UI
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
_log.Trace("Приложение запущено в режиме отладки. Отключаю обновление.");
|
||||
//tmrUpdate.Enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace JiraTimeBot.Update
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user