Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ClipDock Windows Panel — Changelog

## 0.2.4

- Import and export clipboard history as a single `.clipdock` backup using the shared Rust core. Merge records, deduplicate content and preserve pinboards without changing application settings.
- Restore stored images and rich-text resources; external file entries retain their original paths. Existing retention settings still apply.
- Keep clipboard capture responsive during backup resource I/O and preserve local pin state in search and pinboard views.
- Refresh preferences styling with native window effects, theme support and keyboard focus indicators.

## 0.2.3

- Rename cards inline from the context menu, F2 or Ctrl+R. Enter or blur saves; Escape cancels; a blank name restores the default label.
Expand Down
4 changes: 2 additions & 2 deletions Windows/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Windows/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clipdock-windows-panel",
"version": "0.2.3",
"version": "0.2.4",
"private": true,
"type": "module",
"scripts": {
Expand Down
163 changes: 161 additions & 2 deletions Windows/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Windows/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clipdock_windows_panel"
version = "0.2.3"
version = "0.2.4"
description = "ClipDock cross-platform panel shell"
authors = ["ClipDock"]
edition = "2021"
Expand All @@ -24,6 +24,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.10"
tauri = { version = "2", features = ["macos-private-api", "protocol-asset", "tray-icon"] }
tauri-plugin-dialog = "2"
url = "2"

[dev-dependencies]
Expand Down
49 changes: 48 additions & 1 deletion Windows/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,57 @@ use clipboard_core::{
SourceConfidence,
};
use serde::Serialize;
use tauri::State;
use tauri::{Emitter, Manager, State};
use tauri_plugin_dialog::DialogExt;

use crate::core_state::CoreState;

#[tauri::command]
pub async fn transfer_clipboard_backup(
app: tauri::AppHandle,
importing: bool,
) -> Result<Option<clipboard_core::BackupResult>, String> {
tauri::async_runtime::spawn_blocking(move || {
let mut dialog = app
.dialog()
.file()
.add_filter("ClipDock backup", &["clipdock"]);
if let Some(window) = app.get_webview_window("preferences") {
dialog = dialog.set_parent(&window);
}
let selected = if importing {
dialog.set_title("导入数据").blocking_pick_file()
} else {
dialog
.set_title("导出数据")
.set_file_name("ClipDock.clipdock")
.blocking_save_file()
};
let Some(selected) = selected else {
return Ok(None);
};
let path = selected.into_path().map_err(|e| e.to_string())?;
// Keep resource I/O off the capture connection's mutex. SQLite provides
// the backup snapshot and the short merge transaction's synchronization.
let mut core = clipboard_core::ClipboardCore::open_for_backup(
app.state::<CoreState>().root_dir(),
)
.map_err(|e| e.to_string())?;
let result = if importing {
core.import_backup(&path)
} else {
core.export_backup(&path)
}
.map_err(|e| e.to_string())?;
if importing {
let _ = app.emit("clipdock://backup-imported", &result);
}
Ok(Some(result))
})
.await
.map_err(|e| e.to_string())?
}

#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CoreInfoResult {
Expand Down
Loading
Loading