Drop Granite.Application

This commit is contained in:
Bleak Grey 2020-05-31 15:47:12 +03:00
parent 024a870228
commit 94c3d43fe1
2 changed files with 19 additions and 8 deletions

View File

@ -21,7 +21,7 @@ namespace Tootle {
public static bool start_hidden = false;
public class Application : Granite.Application {
public class Application : Gtk.Application {
// These are used for the GTK Inspector
public Settings app_settings { get {return Tootle.settings; } }
@ -49,8 +49,6 @@ namespace Tootle {
construct {
application_id = Build.DOMAIN;
flags = ApplicationFlags.FLAGS_NONE;
program_name = Build.NAME;
build_version = Build.VERSION;
}
public string[] ACCEL_NEW_POST = {"<Ctrl>T"};
@ -79,7 +77,7 @@ namespace Tootle {
protected override void startup () {
base.startup ();
Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.INFO;
Build.print_info ();
settings = new Settings ();
streams = new Streams ();
@ -126,19 +124,19 @@ namespace Tootle {
message_dialog.destroy ();
}
private void compose_activated () {
void compose_activated () {
new Dialogs.Compose ();
}
private void back_activated () {
void back_activated () {
window.back ();
}
private void refresh_activated () {
void refresh_activated () {
refresh ();
}
private void switch_timeline_activated (SimpleAction a, Variant? v) {
void switch_timeline_activated (SimpleAction a, Variant? v) {
int32 num = v.get_int32 ();
window.switch_timeline (num);
}

View File

@ -6,4 +6,17 @@ public class Build {
public const string RESOURCES = "/com/github/bleakgrey/tootle/";
public const string VERSION = "1.0.0";
public static void print_info () {
var os_name = get_os_info ("NAME");
var os_ver = get_os_info ("VERSION");
message (@"$(Build.NAME) $(Build.VERSION)");
message (@"Running on: $os_name $os_ver");
message (@"Build type: FROM_SOURCE");
}
static string get_os_info (string key) {
var result = GLib.Environment.get_os_info (key);
return result == null ? "Unknown" : result;
}
}