Skip to content

Commit 962d1ad

Browse files
vasfvitordreyfus92
andauthored
fix get_window (tauri-apps#2007)
Co-authored-by: Paul Valladares <[email protected]>
1 parent 6483036 commit 962d1ad

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

src/content/docs/_ko/guides/debug/application.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ WebView에서 우클릭한 후, `요소 검사`를 선택합니다. 이렇게
5050

5151
### 프로그래밍으로 Devtools 열기
5252

53-
[`Window::open_devtools`][][`Window::close_devtools`][] 기능을 사용하여 검사기 창을 제어할 수 있습니다.
53+
[`WebviewWindow::open_devtools`][][`WebviewWindow::close_devtools`][] 기능을 사용하여 검사기 창을 제어할 수 있습니다.
5454

5555
```rust
56-
use tauri::Manager;
5756
tauri::Builder::default()
5857
.setup(|app| {
5958
#[cfg(debug_assertions)] // 디버그 빌드에만 이 코드를 포함
6059
{
61-
let window = app.get_window("main").unwrap();
60+
let window = app.get_webview_window("main").unwrap();
6261
window.open_devtools();
6362
window.close_devtools();
6463
}
@@ -105,5 +104,5 @@ tauri = { version = "...", features = ["...", "devtools"] }
105104
핵심 프로세스는 Rust로 구동되므로 GDB 또는 LLDB를 사용하여 디버깅할 수 있습니다. [VS Code에서 디버깅][] 가이드에 따라 LLDB VS Code 확장을 사용하여 Tauri 애플리케이션의 핵심 프로세스를 디버깅하는 방법을 알아볼 수 있습니다.
106105

107106
[VS Code에서 디버깅]: /ko/guides/debug/vs-code
108-
[`Window::open_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.open_devtools
109-
[`Window::close_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.close_devtools
107+
[`WebviewWindow::open_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.open_devtools
108+
[`WebviewWindow::close_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.close_devtools

src/content/docs/fr/guides/debug/application.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ L'inspecteur est spécifique à la plate-forme, rendant le webkit2gtk WebInspect
4949

5050
### Ouverture de Devtools par programmation
5151

52-
Vous pouvez contrôler la visibilité de la fenêtre d'inspection en utilisant les fonctions [`Window::open_devtools`][] et [`Window::close_devtools`][] :
52+
Vous pouvez contrôler la visibilité de la fenêtre d'inspection en utilisant les fonctions [`WebviewWindow::open_devtools`][] et [`WebviewWindow::close_devtools`][] :
5353

5454
```rust
55-
use tauri::Manager;
5655
tauri::Builder::default()
5756
.setup(|app| {
5857
#[cfg(debug_assertions)] // n'incluez ce code que sur les versions de débogage
5958
{
60-
let window = app.get_window("main").unwrap();
59+
let window = app.get_webview_window("main").unwrap();
6160
window.open_devtools();
6261
window.close_devtools();
6362
}
@@ -104,5 +103,5 @@ tauri = { version = "...", features = ["...", "devtools"] }
104103
Le processus Core est alimenté par Rust, vous pouvez donc utiliser GDB ou LLDB pour le déboguer. Vous pouvez suivre le guide [Débogage dans VS Code][] pour apprendre à utiliser l'extension LLDB VS Code pour déboguer le processus principal des applications Tauri.
105104

106105
[Débogage dans VS Code]: /fr/guides/debug/vs-code
107-
[`Window::open_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.open_devtools
108-
[`Window::close_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.close_devtools
106+
[`WebviewWindow::open_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.open_devtools
107+
[`WebviewWindow::close_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.close_devtools

src/content/docs/guides/debug/application.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ The inspector is platform-specific, rendering the webkit2gtk WebInspector on Lin
5555

5656
### Opening Devtools Programmatically
5757

58-
You can control the inspector window visibility by using the [`Window::open_devtools`] and [`Window::close_devtools`] functions:
58+
You can control the inspector window visibility by using the [`WebviewWindow::open_devtools`] and [`WebviewWindow::close_devtools`] functions:
5959

6060
```rust
61-
use tauri::Manager;
6261
tauri::Builder::default()
6362
.setup(|app| {
6463
#[cfg(debug_assertions)] // only include this code on debug builds
@@ -111,5 +110,5 @@ tauri = { version = "...", features = ["...", "devtools"] }
111110
The Core process is powered by Rust so you can use GDB or LLDB to debug it. You can follow the [Debugging in VS Code] guide to learn how to use the LLDB VS Code Extension to debug the Core Process of Tauri applications.
112111

113112
[debugging in vs code]: /guides/debug/vs-code
114-
[`window::open_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.open_devtools
115-
[`window::close_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.close_devtools
113+
[`WebviewWindow::open_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.open_devtools
114+
[`WebviewWindow::close_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.close_devtools

src/content/docs/zh-cn/guides/debug/application.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@ For more information about this error, try `rustc --explain E0425`.
5454

5555
### 通过程序打开 Devtools
5656

57-
您可以使用 [`Window::open_devtools`][`Window::close_devtools`] 函数来控制检查器窗口的可见性:
57+
您可以使用 [`WebviewWindow::open_devtools`][`WebviewWindow::close_devtools`] 函数来控制检查器窗口的可见性:
5858

5959
```rust
60-
use tauri::Manager;
6160
tauri::Builder::default()
6261
.setup(|app| {
6362
#[cfg(debug_assertions)] // 仅在调试构建时包含此代码
6463
{
65-
let window = app.get_window("main").unwrap();
64+
let window = app.get_webview_window("main").unwrap();
6665
window.open_devtools();
6766
window.close_devtools();
6867
}
@@ -110,5 +109,5 @@ tauri = { version = "...", features = ["...", "devtools"] }
110109
核心进程由 Rust 支持,因此您可以使用 GDB 或 LLDB 进行调试。您可以按照[在 VS Code 中调试]指南学习如何使用 LLDB VS 代码扩展来调试 Tauri 应用程序的核心进程。
111110

112111
[在 VS Code 中调试]: /guides/debug/vs-code
113-
[`window::open_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.open_devtools
114-
[`window::close_devtools`]: https://docs.rs/tauri/1/tauri/window/struct.Window.html#method.close_devtools
112+
[`WebviewWindow::open_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.open_devtools
113+
[`WebviewWindow::close_devtools`]: https://docs.rs/tauri/2.0.0-beta/tauri/webview/struct.WebviewWindow.html#method.close_devtools

0 commit comments

Comments
 (0)