diff --git a/README-ZH_CN.md b/README-ZH_CN.md index 042cb46..d2338fb 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -22,9 +22,9 @@ **最新版:** -- `Mac`: [ChatGPT_0.7.1_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.1/ChatGPT_0.7.1_x64.dmg) -- `Linux`: [chat-gpt_0.7.1_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.1/chat-gpt_0.7.1_amd64.deb) -- `Windows`: [ChatGPT_0.7.1_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.1/ChatGPT_0.7.1_x64_en-US.msi) +- `Mac`: [ChatGPT_0.7.2_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64.dmg) +- `Linux`: [chat-gpt_0.7.2_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/chat-gpt_0.7.2_amd64.deb) +- `Windows`: [ChatGPT_0.7.2_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64_en-US.msi) [其他版本...](https://github.com/lencx/ChatGPT/releases) @@ -74,7 +74,7 @@ cask "popcorn-time", args: { "no-quarantine": true } - 系统托盘悬浮窗 - 应用菜单功能强大 - 支持斜杠命令及其配置(可手动配置或从文件同步 [#55](https://github.com/lencx/ChatGPT/issues/55)) -- 进入应用的全局快捷键 (mac: `command+shift+o`, windows: `ctrl+shift+o`) + ### 菜单项 diff --git a/README.md b/README.md index 209027b..30df12b 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ **Latest:** -- `Mac`: [ChatGPT_0.7.1_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.1/ChatGPT_0.7.1_x64.dmg) -- `Linux`: [chat-gpt_0.7.1_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.1/chat-gpt_0.7.1_amd64.deb) -- `Windows`: [ChatGPT_0.7.1_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.1/ChatGPT_0.7.1_x64_en-US.msi) +- `Mac`: [ChatGPT_0.7.2_x64.dmg](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64.dmg) +- `Linux`: [chat-gpt_0.7.2_amd64.deb](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/chat-gpt_0.7.2_amd64.deb) +- `Windows`: [ChatGPT_0.7.2_x64_en-US.msi](https://github.com/lencx/ChatGPT/releases/download/v0.7.2/ChatGPT_0.7.2_x64_en-US.msi) [Other version...](https://github.com/lencx/ChatGPT/releases) @@ -76,7 +76,7 @@ In the chatgpt text input area, type a character starting with `/` to bring up t - System tray hover window - Powerful menu items - Support for slash commands and their configuration (can be configured manually or synchronized from a file [#55](https://github.com/lencx/ChatGPT/issues/55)) -- Global shortcuts to the chatgpt app (mac: `command+shift+o`, windows: `ctrl+shift+o`) + ### MenuItem diff --git a/UPDATE_LOG.md b/UPDATE_LOG.md index 50498fa..e918c71 100644 --- a/UPDATE_LOG.md +++ b/UPDATE_LOG.md @@ -1,5 +1,9 @@ # UPDATE LOG +## v0.7.2 + +fix: some windows systems cannot start the application + ## v0.7.1 fix: @@ -15,7 +19,7 @@ fix: feat: - use the keyboard `⇧` (arrow up) and `⇩` (arrow down) keys to select the slash command -- global shortcuts to the chatgpt app (mac: command+shift+o, windows: ctrl+shift+o) + ## v0.6.10 diff --git a/src-tauri/icons/tray-icon-light.png b/src-tauri/icons/tray-icon-light.png index bbeffbb..f6964f6 100644 Binary files a/src-tauri/icons/tray-icon-light.png and b/src-tauri/icons/tray-icon-light.png differ diff --git a/src-tauri/src/app/menu.rs b/src-tauri/src/app/menu.rs index 92d28e1..93d87bf 100644 --- a/src-tauri/src/app/menu.rs +++ b/src-tauri/src/app/menu.rs @@ -3,11 +3,14 @@ use crate::{ utils, }; use tauri::{ - AboutMetadata, AppHandle, CustomMenuItem, Manager, Menu, MenuItem, Submenu, SystemTray, - SystemTrayEvent, SystemTrayMenu, SystemTrayMenuItem, WindowMenuEvent, + AppHandle, CustomMenuItem, Manager, Menu, MenuItem, Submenu, SystemTray, SystemTrayEvent, + SystemTrayMenu, SystemTrayMenuItem, WindowMenuEvent, }; use tauri_plugin_positioner::{on_tray_event, Position, WindowExt}; +#[cfg(target_os = "macos")] +use tauri::AboutMetadata; + use super::window; // --- Menu @@ -20,15 +23,15 @@ pub fn init() -> Menu { #[cfg(target_os = "macos")] MenuItem::About(name.into(), AboutMetadata::default()).into(), #[cfg(not(target_os = "macos"))] - CustomMenuItem::new("about".to_string(), "About ChatGPT") - .into(), + CustomMenuItem::new("about".to_string(), "About ChatGPT").into(), MenuItem::Services.into(), MenuItem::Hide.into(), MenuItem::HideOthers.into(), MenuItem::ShowAll.into(), MenuItem::Separator.into(), MenuItem::Quit.into(), - ])); + ]), + ); let stay_on_top = CustomMenuItem::new("stay_on_top".to_string(), "Stay On Top").accelerator("CmdOrCtrl+T"); @@ -183,7 +186,11 @@ pub fn menu_handler(event: WindowMenuEvent) { // App "about" => { let tauri_conf = utils::get_tauri_conf().unwrap(); - tauri::api::dialog::message(app.get_window("core").as_ref(), "ChatGPT", format!("Version {}", tauri_conf.package.version.unwrap())); + tauri::api::dialog::message( + app.get_window("core").as_ref(), + "ChatGPT", + format!("Version {}", tauri_conf.package.version.unwrap()), + ); } // Preferences "control_center" => window::control_window(&app), diff --git a/src-tauri/src/app/setup.rs b/src-tauri/src/app/setup.rs index 8c3eae6..65f5be1 100644 --- a/src-tauri/src/app/setup.rs +++ b/src-tauri/src/app/setup.rs @@ -1,5 +1,6 @@ use crate::{app::window, conf::ChatConfJson, utils}; -use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, GlobalShortcutManager, Manager}; +use log::info; +use tauri::{utils::config::WindowUrl, window::WindowBuilder, App, Manager}; pub fn init(app: &mut App) -> std::result::Result<(), Box> { let chat_conf = ChatConfJson::get_chat_conf(); @@ -11,26 +12,31 @@ pub fn init(app: &mut App) -> std::result::Result<(), Box window::tray_window(&handle); }); - { - let handle = app.app_handle(); - let mut shortcut = app.global_shortcut_manager(); - let is_mini_key = shortcut.is_registered("CmdOrCtrl+Shift+O"); + info!("stepup"); - if !is_mini_key.unwrap() { - shortcut - .register("CmdOrCtrl+Shift+O", move || { - if let Some(w) = handle.get_window("core") { - if w.is_visible().unwrap() { - w.hide().unwrap(); - } else { - w.show().unwrap(); - w.set_focus().unwrap(); - } - } - }) - .unwrap(); - }; - } + // fix: Global shortcuts can cause programs to exit under windows + // { + // info!("global_shortcut_start"); + // let handle = app.app_handle(); + // let mut shortcut = app.global_shortcut_manager(); + // let is_mini_key = shortcut.is_registered("CmdOrCtrl+Shift+O"); + + // if is_mini_key.is_ok() { + // shortcut + // .register("CmdOrCtrl+Shift+O", move || { + // if let Some(w) = handle.get_window("core") { + // if w.is_visible().unwrap() { + // w.hide().unwrap(); + // } else { + // w.show().unwrap(); + // w.set_focus().unwrap(); + // } + // } + // }) + // .unwrap(); + // }; + // info!("global_shortcut_end"); + // } if chat_conf.hide_dock_icon { #[cfg(target_os = "macos")] diff --git a/src-tauri/src/utils.rs b/src-tauri/src/utils.rs index 4b612c0..79920cd 100644 --- a/src-tauri/src/utils.rs +++ b/src-tauri/src/utils.rs @@ -8,7 +8,7 @@ use std::{ path::{Path, PathBuf}, process::Command, }; -use tauri::{Manager, utils::config::Config}; +use tauri::{utils::config::Config, Manager}; pub fn chat_root() -> PathBuf { tauri::api::path::home_dir().unwrap().join(".chatgpt") diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index b7ded6e..cac6ed8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "ChatGPT", - "version": "0.7.1" + "version": "0.7.2" }, "tauri": { "allowlist": { @@ -30,8 +30,8 @@ } }, "systemTray": { - "iconPath": "icons/tray-icon.png", - "iconAsTemplate": true, + "iconPath": "icons/tray-icon-light.png", + "iconAsTemplate": false, "menuOnLeftClick": false }, "bundle": {