-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
library: Add Email Entry #330
Changes from 1 commit
764a0f6
8d9971e
beb68fd
bf903a1
3616f1e
cea863c
5c7ce18
b59cd30
9dd6f0d
1550f94
967d766
12d9704
c993274
a3966fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,25 @@ | ||||||
using Gtk 4.0; | ||||||
using Adw 1; | ||||||
|
||||||
Adw.StatusPage { | ||||||
title: "Email"; | ||||||
description: _("Compose an email"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
margin-top: 48; | ||||||
|
||||||
Box { | ||||||
orientation: vertical; | ||||||
halign: center; | ||||||
|
||||||
Button button { | ||||||
label: _("Send Email"); | ||||||
margin-bottom: 42; | ||||||
halign: center; | ||||||
styles ["suggested-action"] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
for buttons outside of toolbars |
||||||
} | ||||||
|
||||||
LinkButton { | ||||||
label: "API Reference"; | ||||||
uri: "https://libportal.org/method.Portal.compose_email.html"; | ||||||
} | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Xdp from "gi://Xdp"; | ||
import XdpGtk from "gi://XdpGtk4"; | ||
import Gio from "gi://Gio"; | ||
|
||
const portal = new Xdp.Portal(); | ||
const parent = XdpGtk.parent_new_gtk(workbench.window); | ||
|
||
const button = workbench.builder.get_object("button"); | ||
|
||
function handleClick() { | ||
portal.compose_email( | ||
parent, | ||
["sonicworks05@gmail.com"], | ||
["sriyanshshivam1@gmail.com"], | ||
null, | ||
"Demo Message", | ||
"Demo Content", | ||
null, | ||
Xdp.EmailFlags.NONE, | ||
null, | ||
(parent, result) => { | ||
try { | ||
portal.compose_email_finish(result); | ||
log("Email sent"); | ||
} catch (e) { | ||
logError(e); | ||
} | ||
}, | ||
); | ||
} | ||
|
||
button.connect("clicked", handleClick); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,7 @@ | ||||||
{ | ||||||
"name": "Email", | ||||||
"category": "platform", | ||||||
"description": "Compose an email message", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remember to write description from the perspective of the developer
Suggested change
|
||||||
"panels": ["code", "preview"], | ||||||
"autorun": true | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all user visible strings should be wrapper in
_()
please try to remember