mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:18:11 +00:00
Help: Replace InProcessWebView with OutOfProcessWebView
This commit is contained in:
parent
95a6019ff0
commit
870dd44ba9
1 changed files with 11 additions and 7 deletions
|
@ -47,8 +47,7 @@
|
||||||
#include <LibGUI/TreeView.h>
|
#include <LibGUI/TreeView.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <LibMarkdown/Document.h>
|
#include <LibMarkdown/Document.h>
|
||||||
#include <LibWeb/InProcessWebView.h>
|
#include <LibWeb/OutOfProcessWebView.h>
|
||||||
#include <LibWeb/Layout/LayoutNode.h>
|
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -82,6 +81,11 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unveil("/tmp/portal/webcontent", "rw") < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
unveil(nullptr, nullptr);
|
unveil(nullptr, nullptr);
|
||||||
|
|
||||||
const char* term_to_search_for_at_launch = nullptr;
|
const char* term_to_search_for_at_launch = nullptr;
|
||||||
|
@ -137,7 +141,7 @@ int main(int argc, char* argv[])
|
||||||
left_tab_bar.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
left_tab_bar.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||||
left_tab_bar.set_preferred_size(200, 500);
|
left_tab_bar.set_preferred_size(200, 500);
|
||||||
|
|
||||||
auto& page_view = splitter.add<Web::InProcessWebView>();
|
auto& page_view = splitter.add<Web::OutOfProcessWebView>();
|
||||||
|
|
||||||
History history;
|
History history;
|
||||||
|
|
||||||
|
@ -151,7 +155,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
auto open_page = [&](const String& path) {
|
auto open_page = [&](const String& path) {
|
||||||
if (path.is_null()) {
|
if (path.is_null()) {
|
||||||
page_view.set_document(nullptr);
|
page_view.load_empty_document();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +182,7 @@ int main(int argc, char* argv[])
|
||||||
tree_view.on_selection_change = [&] {
|
tree_view.on_selection_change = [&] {
|
||||||
String path = model->page_path(tree_view.selection().first());
|
String path = model->page_path(tree_view.selection().first());
|
||||||
if (path.is_null()) {
|
if (path.is_null()) {
|
||||||
page_view.set_document(nullptr);
|
page_view.load_empty_document();
|
||||||
window->set_title("Help");
|
window->set_title("Help");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -207,12 +211,12 @@ int main(int argc, char* argv[])
|
||||||
auto& search_model = *static_cast<GUI::FilteringProxyModel*>(model);
|
auto& search_model = *static_cast<GUI::FilteringProxyModel*>(model);
|
||||||
index = search_model.map(index);
|
index = search_model.map(index);
|
||||||
} else {
|
} else {
|
||||||
page_view.set_document(nullptr);
|
page_view.load_empty_document();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String path = model->page_path(index);
|
String path = model->page_path(index);
|
||||||
if (path.is_null()) {
|
if (path.is_null()) {
|
||||||
page_view.set_document(nullptr);
|
page_view.load_empty_document();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tree_view.selection().clear();
|
tree_view.selection().clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue