summaryrefslogtreecommitdiff
path: root/src/vala/main.vala
blob: 535baf66d6f031bce9902bac81c581eb92e3a5c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
int main (string[] args) {
	Intl.setlocale (LocaleCategory.ALL, "");
	var name = "eu.planete_kraus.Disfluid";
	if (Disfluid.is_nightly ()) {
		name += ".Devel";
	}
	var app = new Adw.Application(
		name,
		ApplicationFlags.FLAGS_NONE
		);
	app.activate.connect(() => {
			var cache_entry = new Disfluid.CacheEntry.alloc (512, 4096, 2 * 1024 * 1024);
			cache_entry.set_request_gdate (new GLib.DateTime.utc (2023, 03, 26, 19, 38, 00));
			cache_entry.set_response_gdate (new GLib.DateTime.now ());
			cache_entry.set_key ("GET https://example.com\r\n");
			cache_entry.set_response_header ("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n");
			cache_entry.set_response_body ((char[]) "Hello");
			var cache_entry_view = new Disfluid.CacheEntryView.with_value ("/tmp/test.cache", cache_entry);
			var cache_view = new Adw.PreferencesPage ();
			cache_view.add (cache_entry_view);
			var window = new Disfluid.MainWindow (cache_view);
			window.set_application (app);
			window.present();
		});
  return app.run(args);
}