Merge pull request #58 from federico-terzi/dev

Version 0.2.2
This commit is contained in:
Federico Terzi 2019-09-30 23:07:27 +02:00 committed by GitHub
commit d7cb65aeaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 8 deletions

2
Cargo.lock generated
View File

@ -329,7 +329,7 @@ dependencies = [
[[package]] [[package]]
name = "espanso" name = "espanso"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", "backtrace 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "espanso" name = "espanso"
version = "0.2.1" version = "0.2.2"
authors = ["Federico Terzi <federicoterzi96@gmail.com>"] authors = ["Federico Terzi <federicoterzi96@gmail.com>"]
license = "GPL-3.0" license = "GPL-3.0"
description = "Cross-platform Text Expander written in Rust" description = "Cross-platform Text Expander written in Rust"

View File

@ -59,6 +59,8 @@ HBITMAP g_espanso_bmp = NULL;
HICON g_espanso_ico = NULL; HICON g_espanso_ico = NULL;
NOTIFYICONDATA nid = {}; NOTIFYICONDATA nid = {};
UINT WM_TASKBARCREATED = RegisterWindowMessage(L"TaskbarCreated");
// Callbacks // Callbacks
KeypressCallback keypress_callback = NULL; KeypressCallback keypress_callback = NULL;
@ -258,6 +260,9 @@ LRESULT CALLBACK window_procedure(HWND window, unsigned int msg, WPARAM wp, LPAR
return 0; return 0;
} }
default: default:
if (msg == WM_TASKBARCREATED) { // Explorer crashed, recreate the icon
Shell_NotifyIcon(NIM_ADD, &nid);
}
return DefWindowProc(window, msg, wp, lp); return DefWindowProc(window, msg, wp, lp);
} }
} }

View File

@ -6,6 +6,7 @@ import hashlib
import click import click
import shutil import shutil
import toml import toml
import urllib.request
from dataclasses import dataclass from dataclasses import dataclass
PACKAGER_TARGET_DIR = "target/packager" PACKAGER_TARGET_DIR = "target/packager"
@ -75,6 +76,10 @@ def build_windows(package_info):
TARGET_DIR = os.path.join(PACKAGER_TARGET_DIR, "win") TARGET_DIR = os.path.join(PACKAGER_TARGET_DIR, "win")
os.makedirs(TARGET_DIR, exist_ok=True) os.makedirs(TARGET_DIR, exist_ok=True)
print("Downloading Visual C++ redistributable")
vc_redist_file = os.path.join(TARGET_DIR, "vc_redist.x64.exe")
urllib.request.urlretrieve("https://aka.ms/vs/16/release/vc_redist.x64.exe", vc_redist_file)
INSTALLER_NAME = f"espanso-win-installer" INSTALLER_NAME = f"espanso-win-installer"
# Inno setup # Inno setup

View File

@ -170,7 +170,7 @@ var
begin begin
taskname := ModPathName; taskname := ModPathName;
if CurStep = ssPostInstall then if CurStep = ssPostInstall then
if IsTaskSelected(taskname) then if WizardIsTaskSelected(taskname) then
ModPath(); ModPath();
end; end;

View File

@ -37,11 +37,12 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "{{{executable_path}}}"; DestDir: "{app}"; Flags: ignoreversion Source: "{{{executable_path}}}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{{{app_icon}}}"; DestDir: "{app}"; Flags: ignoreversion Source: "{{{app_icon}}}"; DestDir: "{app}"; Flags: ignoreversion
Source: "vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons] [Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon.ico" Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; IconFilename: "{app}\icon.ico"
Name: "{userstartup}\espanso"; Filename: "{app}\espanso.exe"; Tasks:StartMenuEntry; Name: "{userstartup}\espanso"; Filename: "{app}\espanso.exe"; Parameters: "start"; Tasks:StartMenuEntry;
[Tasks] [Tasks]
Name: modifypath; Description: Add espanso to PATH ( recommended ); Name: modifypath; Description: Add espanso to PATH ( recommended );
@ -60,7 +61,10 @@ end;
#include "modpath.iss" #include "modpath.iss"
[Run] [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Filename: {tmp}\vc_redist.x64.exe; \
Parameters: "/install /quiet"; \
StatusMsg: "Installing Visual C++ 2019 Redistributable";
Filename: "{app}\{#MyAppExeName}"; Parameters: "start"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[UninstallRun] [UninstallRun]
Filename: "{cmd}"; Parameters: "/C ""taskkill /im espanso.exe /f /t" Filename: "{cmd}"; Parameters: "/C ""taskkill /im espanso.exe /f /t"

View File

@ -18,7 +18,7 @@
*/ */
use serde_yaml::{Mapping, Value}; use serde_yaml::{Mapping, Value};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Local};
pub struct DateExtension {} pub struct DateExtension {}
@ -34,7 +34,7 @@ impl super::Extension for DateExtension {
} }
fn calculate(&self, params: &Mapping) -> Option<String> { fn calculate(&self, params: &Mapping) -> Option<String> {
let now: DateTime<Utc> = Utc::now(); let now: DateTime<Local> = Local::now();
let format = params.get(&Value::from("format")); let format = params.get(&Value::from("format"));