2018-04-14 12:09:06 +00:00
|
|
|
using Gtk;
|
|
|
|
using Granite;
|
|
|
|
|
|
|
|
namespace Tootle{
|
|
|
|
|
|
|
|
public static Application app;
|
2018-05-03 08:56:04 +00:00
|
|
|
public static MainWindow? window;
|
2018-04-27 18:50:08 +00:00
|
|
|
|
|
|
|
public static SettingsManager settings;
|
|
|
|
public static AccountManager accounts;
|
|
|
|
public static NetManager network;
|
|
|
|
public static CacheManager cache;
|
2018-04-14 12:09:06 +00:00
|
|
|
|
|
|
|
public class Application : Granite.Application {
|
|
|
|
|
2018-05-05 15:38:01 +00:00
|
|
|
public abstract signal void refresh ();
|
|
|
|
public abstract signal void toast (string title);
|
|
|
|
public abstract signal void error (string title, string text);
|
2018-04-14 12:09:06 +00:00
|
|
|
|
|
|
|
construct {
|
|
|
|
application_id = "com.github.bleakgrey.tootle";
|
|
|
|
flags = ApplicationFlags.FLAGS_NONE;
|
2018-05-03 08:56:04 +00:00
|
|
|
program_name = "Tootle";
|
2018-04-14 12:09:06 +00:00
|
|
|
build_version = "0.1.0";
|
2018-04-27 18:50:08 +00:00
|
|
|
settings = new SettingsManager ();
|
|
|
|
accounts = new AccountManager ();
|
|
|
|
network = new NetManager ();
|
|
|
|
cache = new CacheManager ();
|
2018-04-14 12:09:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int main (string[] args) {
|
2018-05-03 08:56:04 +00:00
|
|
|
Gtk.init (ref args);
|
2018-04-14 12:09:06 +00:00
|
|
|
app = new Application ();
|
|
|
|
return app.run (args);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void startup () {
|
|
|
|
base.startup ();
|
|
|
|
Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG;
|
|
|
|
window = new MainWindow (this);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void activate () {
|
2018-05-03 09:09:55 +00:00
|
|
|
if (window != null)
|
2018-05-03 08:56:04 +00:00
|
|
|
window.present ();
|
|
|
|
else {
|
|
|
|
window = new MainWindow (this);
|
|
|
|
window.present ();
|
|
|
|
}
|
2018-04-14 12:09:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|