Commit 206035ca authored by Julian Sparber's avatar Julian Sparber

gspell: add basic spell check

* add gspell as spell checker to fractal, currently only accessible form
the context menu
parent 7dcfa2f4
Pipeline #11579 failed with stages
in 4 minutes and 40 seconds
......@@ -399,6 +399,7 @@ dependencies = [
"gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gspell 0.1.0 (git+https://gitlab.gnome.org/jsparber/gspell-rs)",
"gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html2pango 0.1.0 (git+https://gitlab.gnome.org/World/html2pango)",
"html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -576,6 +577,43 @@ dependencies = [
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gspell"
version = "0.1.0"
source = "git+https://gitlab.gnome.org/jsparber/gspell-rs#667699e3006d6f43499376181d0ad928a06282a1"
dependencies = [
"bitflags 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gspell-sys 0.2.0 (git+https://gitlab.gnome.org/jsparber/gspell-sys-rs)",
"gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
"notify-rust 3.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gspell-sys"
version = "0.2.0"
source = "git+https://gitlab.gnome.org/jsparber/gspell-sys-rs#96e2dd5fd909892e7092927cbe1d386124854277"
dependencies = [
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.40 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gtk"
version = "0.4.0"
......@@ -1997,6 +2035,8 @@ dependencies = [
"checksum glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61"
"checksum glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408"
"checksum gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70409d6405db8b1591602fcd0cbe8af52cd9976dd39194442b4c149ba343f86d"
"checksum gspell 0.1.0 (git+https://gitlab.gnome.org/jsparber/gspell-rs)" = "<none>"
"checksum gspell-sys 0.2.0 (git+https://gitlab.gnome.org/jsparber/gspell-sys-rs)" = "<none>"
"checksum gtk 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "414f3522f550a0b4f65e089f00ffcd3987dab8b0be284cb979aa7f6a03d60516"
"checksum gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d9554cf5b3a85a13fb39258c65b04b262989c1d7a758f8f555b77a478621a91"
"checksum html2pango 0.1.0 (git+https://gitlab.gnome.org/World/html2pango)" = "<none>"
......
......@@ -39,6 +39,9 @@ version = "0.4.2"
[dependencies.fractal-api]
path = "../fractal-api"
[dependencies.gspell]
git = "https://gitlab.gnome.org/jsparber/gspell-rs"
[dependencies.gtk]
features = ["v3_22"]
version = "0.4.0"
......@@ -20,6 +20,7 @@ mod roomlist_search;
mod scroll;
mod search;
mod send;
mod spellcheck;
use app::App;
......@@ -73,6 +74,7 @@ impl App {
self.connect_attach();
self.connect_markdown();
self.connect_autocomplete();
self.connect_spellcheck();
self.connect_directory();
self.connect_room_config();
......
extern crate gtk;
use gspell;
use gspell::EntryExt;
use app::App;
impl App {
pub fn connect_spellcheck(&self) {
let msg_entry: gtk::Entry = self.ui.builder
.get_object("msg_entry")
.expect("Couldn't find msg_entry in ui file.");
/* Add gspell to the send Entry and enable the basic configuration */
if let Some(gspell_entry) = gspell::Entry::get_from_gtk_entry(&msg_entry) {
gspell::Entry::basic_setup(&gspell_entry);
}
}
}
......@@ -13,6 +13,8 @@ extern crate fractal_api;
extern crate html2pango;
extern crate gspell;
use fractal_api::backend;
use fractal_api::types;
use fractal_api::error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment