Merge branches 'icon-swap' and 'right-click' into merged

This commit is contained in:
James Rowe 2019-12-06 02:12:22 -07:00
commit 9b58c273d1
6 changed files with 40 additions and 11 deletions

View File

@ -43,7 +43,8 @@ extern "C" int saveShortcut(
const wchar_t *description,
const wchar_t *path,
const wchar_t *args,
const wchar_t *workingDir)
const wchar_t *workingDir,
const wchar_t *exePath)
{
const char *errStr = NULL;
HRESULT h;
@ -82,6 +83,9 @@ extern "C" int saveShortcut(
shellLink->SetDescription(description);
if (path != NULL)
shellLink->SetPath(path);
// default to using the first icon in the exe (usually correct)
if (exePath != NULL)
shellLink->SetIconLocation(exePath, 0);
if (args != NULL)
shellLink->SetArguments(args);
if (workingDir != NULL)

View File

@ -39,6 +39,7 @@ mod natives {
path: *const winapi::ctypes::wchar_t,
args: *const winapi::ctypes::wchar_t,
workingDir: *const winapi::ctypes::wchar_t,
exePath: *const winapi::ctypes::wchar_t,
) -> ::std::os::raw::c_int;
pub fn isDarkThemeActive() -> ::std::os::raw::c_uint;
@ -59,6 +60,7 @@ mod natives {
target: &str,
args: &str,
working_dir: &str,
exe_path: &str,
) -> Result<String, String> {
let source_file = format!(
"{}\\Microsoft\\Windows\\Start Menu\\Programs\\{}.lnk",
@ -78,6 +80,8 @@ mod natives {
U16CString::from_str(args).log_expect("Error while converting to wchar_t");
let native_working_dir =
U16CString::from_str(working_dir).log_expect("Error while converting to wchar_t");
let native_exe_path =
U16CString::from_str(exe_path).log_expect("Error while converting to wchar_t");
let shortcutResult = unsafe {
saveShortcut(
@ -86,6 +90,7 @@ mod natives {
native_target.as_ptr(),
native_args.as_ptr(),
native_working_dir.as_ptr(),
native_exe_path.as_ptr(),
)
};

View File

@ -58,6 +58,7 @@ impl Task for InstallGlobalShortcutsTask {
// TODO: Send by list
"",
&starting_dir,
"",
)?;
if !shortcut_file.is_empty() {

View File

@ -83,6 +83,7 @@ impl Task for InstallShortcutsTask {
// TODO: Send by list
&format!("--launcher \"{}\"", exe_path),
&starting_dir,
exe_path,
)?);
}

View File

@ -148,7 +148,7 @@ pre {
}
/* Dark mode */
body.has-background-black-ter .subtitle, body.has-background-black-ter .column > div {
body.has-background-black-ter .subtitle, body.has-background-black-ter .column > div, body.has-background-black-ter section {
color: hsl(0, 0%, 96%);
}

View File

@ -1,5 +1,6 @@
<template>
<div class="column has-padding">
<section>
<b-message type="is-info" :active.sync="browser_opened">
Page opened! Check your default browser for the page, and follow the instructions there to link your patreon account.
When you are done, enter the token below.
@ -14,15 +15,24 @@
<br>
If you are not already a subscriber, <a v-on:click="launch_browser('https://www.patreon.com/join/yuzuteam/checkout?rid=2822069')">click here to become one</a>
</div>
<br>
<div class="control">
<label for="token">Token</label>
<input class="input" type="text" v-model="combined_token" placeholder="Token" id="token">
</div>
</section>
<br>
<section>
<p>Token</p>
<b-field>
<b-input type="text" v-model="combined_token" placeholder="Token" id="token" style='width: 50em;'></b-input>
<p class="control">
<button class="button is-info" v-on:click="paste">Paste</button>
</p>
</b-field>
</section>
<br>
<section>
<b-message type="is-danger" :active.sync="invalid_token">
Login failed!
Double check that your token is correct and try again
@ -47,6 +57,7 @@
Your patreon is linked, and you are supporting the project, but you must first join the Early Access reward tier!
<a v-on:click="launch_browser('https://www.patreon.com/join/yuzuteam/checkout?rid=2822069')">Log into your patreon account</a> and choose to back the Early Access reward tier.
</b-message>
</section>
<div class="is-left-floating is-bottom-floating">
<p class="control">
@ -63,6 +74,8 @@
</template>
<script>
export default {
name: 'AuthenticationView',
created: function() {
@ -120,6 +133,11 @@ export default {
go_back: function () {
this.$router.go(-1)
},
paste: function () {
document.getElementById("token").focus();
document.execCommand("paste");
},
launch_browser: function(url) {
const that = this;
let app = this.$root;