This commit is contained in:
ranfdev
2023-10-08 16:10:49 +02:00
parent b5b31d6f8c
commit 7866067845
7 changed files with 20 additions and 33 deletions

View File

@ -1,7 +1,7 @@
{
"id": "com.ranfdev.Notify.Devel",
"runtime": "org.gnome.Platform",
"runtime-version": "master",
"runtime-version": "45",
"sdk": "org.gnome.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-stable",
@ -13,7 +13,6 @@
"--share=network",
"--socket=fallback-x11",
"--socket=wayland",
"--socket=session-bus",
"--device=dri",
"--env=RUST_LOG=notify=debug,ntfy_daemon=debug",
"--env=G_MESSAGES_DEBUG=none",

View File

@ -4,32 +4,28 @@
<id>@app-id@</id>
<metadata_license>CC0</metadata_license>
<!-- Insert your license of choice here -->
<!-- <project_license>MIT</project_license> -->
<project_license>GPL-3.0-or-later</project_license>
<name>Notify</name>
<summary>Write a GTK + Rust application</summary>
<summary>Receive notifications from ntfy.sh.</summary>
<description>
<p>A boilerplate template for GTK + Rust. It uses Meson as a build system and has flatpak support by default.</p>
<p>Versatile GTK4 client designed to seamlessly interface with the ntfy.sh notification service</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://gitlab.gnome.org/bilelmoussaoui/notify/raw/master/data/resources/screenshots/screenshot1.png</image>
<caption>Main window</caption>
<image>https://raw.githubusercontent.com/ranfdev/Notify/main/data/screenshots/1.png</image>
<caption>Main window, welcome screen</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/ranfdev/Notify/main/data/screenshots/2.png</image>
<caption>Main window, subscription view</caption>
</screenshot>
</screenshots>
<url type="homepage">https://gitlab.gnome.org/bilelmoussaoui/notify</url>
<url type="bugtracker">https://gitlab.gnome.org/bilelmoussaoui/notify/issues</url>
<url type="homepage">https://github.com/ranfdev/Notify</url>
<url type="bugtracker">https://github.com/ranfdev/Notify/issues</url>
<content_rating type="oars-1.0" />
<releases>
<release version="0.1.0" date="2019-07-11" />
<release version="0.1.0" date="2023-10-13" />
</releases>
<kudos>
<!--
GNOME Software kudos:
https://gitlab.gnome.org/GNOME/gnome-software/-/blob/main/doc/kudos.md
-->
<kudo>ModernToolkit</kudo>
<kudo>HiDpiIcon</kudo>
</kudos>
<developer_name>ranfdev</developer_name>
<update_contact>ranfdev@gmail.com</update_contact>
<translation type="gettext">@gettext-package@</translation>

BIN
data/screenshots/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
data/screenshots/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -15,7 +15,7 @@ fn emoji_map() -> &'static HashMap<String, String> {
}
fn validate_topic(topic: &str) -> Result<&str, Error> {
let re = Regex::new(r"^([A-z]|[0-9]|_)+$").unwrap();
let re = Regex::new(r"^\w+$").unwrap();
if re.is_match(topic) {
Ok(topic)
} else {

View File

@ -1,6 +1,8 @@
use std::path::Path;
use adw::subclass::prelude::*;
use capnp_rpc::{rpc_twoparty_capnp, twoparty, RpcSystem};
use futures::{AsyncRead, AsyncReadExt, AsyncWrite};
use futures::AsyncReadExt;
use gettextrs::gettext;
use gio::SocketClient;
use gio::UnixSocketAddress;
@ -12,9 +14,6 @@ use tracing::{debug, info};
use crate::config::{APP_ID, PKGDATADIR, PROFILE, VERSION};
use crate::widgets::*;
trait RW: AsyncRead + AsyncWrite {}
impl<T: AsyncRead + AsyncWrite> RW for T {}
mod imp {
use std::cell::RefCell;
@ -184,7 +183,8 @@ impl NotifyApplication {
fn ensure_rpc_running(&self, socket_path: &Path) {
let dbpath = glib::user_data_dir().join("com.ranfdev.Notify.sqlite");
info!(database_path = %dbpath.display());
ntfy_daemon::system_client::start(socket.to_owned(), dbpath.to_str().unwrap()).unwrap();
ntfy_daemon::system_client::start(socket_path.to_owned(), dbpath.to_str().unwrap())
.unwrap();
self.imp().hold_guard.set(self.hold()).unwrap();
}

View File

@ -4,9 +4,7 @@ use std::rc::Rc;
use adw::prelude::*;
use capnp::capability::Promise;
use capnp_rpc::pry;
use glib::once_cell::sync::Lazy;
use glib::subclass::prelude::*;
use glib::subclass::Signal;
use glib::Properties;
use gtk::{gio, glib};
use ntfy_daemon::models;
@ -108,13 +106,7 @@ mod imp {
}
#[glib::derived_properties]
impl ObjectImpl for Subscription {
fn signals() -> &'static [Signal] {
static SIGNALS: Lazy<Vec<Signal>> =
Lazy::new(|| vec![Signal::builder("awarded").build()]);
SIGNALS.as_ref()
}
}
impl ObjectImpl for Subscription {}
#[glib::object_subclass]
impl ObjectSubclass for Subscription {