Commit 36249c7
restructure some gtk callbacks
Changed files (5)
modifiedsrc/ExportTool.valamodifiedsrc/GtkInterface.valamodifiedsrc/Main.valamodifiedsrc/Preview.valamodifiedsrc/TestCases.vala
Diff
@@ -414,6 +414,7 @@ os.put_string ( export_thread.run (); } } catch (ThreadError e) {+ export_mutex.unlock (); warning (e.message); done = false; } @@ -75,6 +75,12 @@ public class GtkWindow : Gtk.Window, NativeWindow { int i; FontDisplay fd = tab.get_display (); + if (fd.get_name () == "Preview") {+ html_canvas.load_html_string ("", ""); + Tool.yield ();+ ExportTool.export_all ();+ }+ MainWindow.glyph_canvas.set_current_glyph (fd); n = fd.is_html_canvas (); @@ -18,7 +18,5 @@ using Birdfont; public static int main (string[] arg) {- GtkWindow gtk_window = new GtkWindow ("Birdfont");- gtk_window.show_all (); return run_gui (arg); }@@ -33,38 +33,6 @@ class Preview : FontDisplay { } public override void selected_canvas () {-/*- WebView w = MainWindow.get_webview ();- string uri = get_uri ();- File new_dest;-- // ExportTool.export_svg_font (); windows requires all fonts to be available- ExportTool.export_all ();- - w.open (uri);- w.reload_bypass_cache ();-- // this hack forces webkit to reload the font and ignore cached data- // it's only required on windows platform and in wine - //- // it would be nice to remove it.- if (Supplement.win32) {- TimeoutSource t1 = new TimeoutSource (300);- t1.set_callback (() => {- w.load_html_string ("<html><body>Loading ...</body></html>", uri);- return false;- });- t1.attach (null);- - TimeoutSource t2 = new TimeoutSource (1000);- t2.set_callback (() => {- w.load_uri (get_uri ());- w.reload_bypass_cache ();- return false;- });- t2.attach (null);- }-*/ } public override string get_uri () {@@ -98,7 +98,7 @@ class TestCases { MenuTab.preview (); // TODO: run this many times on big font- for (int i = 0; i < 10; i++) {+ for (int i = 0; i < 100; i++) { MainWindow.get_tab_bar ().select_tab_name ("Menu"); Tool.yield ();