CallPipe/src/application.vala
Vasiliy Doylov 693b51ab80
Initial commit
Gnome Builder Template

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
2025-06-10 23:40:50 +03:00

64 lines
2.1 KiB
Vala

/* application.vala
*
* Copyright 2025 Unknown
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
public class Callpipe.Application : Adw.Application {
public Application () {
Object (
application_id: "io.gitlab.nekocwd.callpipe",
flags: ApplicationFlags.DEFAULT_FLAGS,
resource_base_path: "/io/gitlab/nekocwd/callpipe"
);
}
construct {
ActionEntry[] action_entries = {
{ "about", this.on_about_action },
{ "preferences", this.on_preferences_action },
{ "quit", this.quit }
};
this.add_action_entries (action_entries, this);
this.set_accels_for_action ("app.quit", {"<primary>q"});
}
public override void activate () {
base.activate ();
var win = this.active_window ?? new Callpipe.Window (this);
win.present ();
}
private void on_about_action () {
string[] developers = { "Unknown" };
var about = new Adw.AboutDialog () {
application_name = "callpipe",
application_icon = "io.gitlab.nekocwd.callpipe",
developer_name = "Unknown",
translator_credits = _("translator-credits"),
version = "0.1.0",
developers = developers,
copyright = "© 2025 Unknown",
};
about.present (this.active_window);
}
private void on_preferences_action () {
message ("app.preferences action activated");
}
}