Hello community, here is the log from the commit of package quilter for openSUSE:Factory checked in at 2020-08-29 20:40:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/quilter (Old) and /work/SRC/openSUSE:Factory/.quilter.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "quilter" Sat Aug 29 20:40:07 2020 rev:29 rq:830116 version:2.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/quilter/quilter.changes 2020-05-07 14:56:51.746549003 +0200 +++ /work/SRC/openSUSE:Factory/.quilter.new.3399/quilter.changes 2020-08-29 20:40:36.993421694 +0200 @@ -1,0 +2,6 @@ +Thu Aug 13 19:03:03 UTC 2020 - Alexei Podvalsky <[email protected]> + +- Update to 2.5.0: + * Fix: Many file operation fixes both in backend and in UI. + +------------------------------------------------------------------- Old: ---- quilter-2.2.4.tar.gz New: ---- quilter-2.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ quilter.spec ++++++ --- /var/tmp/diff_new_pack.PP9PG1/_old 2020-08-29 20:40:38.901422498 +0200 +++ /var/tmp/diff_new_pack.PP9PG1/_new 2020-08-29 20:40:38.901422498 +0200 @@ -17,7 +17,7 @@ Name: quilter -Version: 2.2.4 +Version: 2.5.0 Release: 0 Summary: Writing application License: GPL-3.0-only ++++++ quilter-2.2.4.tar.gz -> quilter-2.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quilter-2.2.4/data/com.github.lainsce.quilter.appdata.xml.in new/quilter-2.5.0/data/com.github.lainsce.quilter.appdata.xml.in --- old/quilter-2.2.4/data/com.github.lainsce.quilter.appdata.xml.in 2020-04-13 08:17:13.000000000 +0200 +++ new/quilter-2.5.0/data/com.github.lainsce.quilter.appdata.xml.in 2020-07-21 16:04:44.000000000 +0200 @@ -55,6 +55,14 @@ <content_attribute id="money-gambling">none</content_attribute> </content_rating> <releases> + <release version="2.5.0" date="2020-07-24"> + <description> + <p>Release: Power Up</p> + <ul> + <li>Fix: Many file operation fixes both in backend and in UI.</li> + </ul> + </description> + </release> <release version="2.2.4" date="2020-04-24"> <description> <p>Release: Just What You Needed</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quilter-2.2.4/src/MainWindow.vala new/quilter-2.5.0/src/MainWindow.vala --- old/quilter-2.2.4/src/MainWindow.vala 2020-04-13 08:17:13.000000000 +0200 +++ new/quilter-2.5.0/src/MainWindow.vala 2020-07-21 16:04:44.000000000 +0200 @@ -358,7 +358,6 @@ statusbar = new Widgets.StatusBar (edit_view_content.buffer); sidebar = new Widgets.SideBar (this); - sidebar.row_selected.connect (on_sidebar_row_selected); sidebar.save_as.connect (() => on_save_as ()); searchbar = new Widgets.SearchBar (this); @@ -413,9 +412,6 @@ } update_title (); - if (Quilter.Application.gsettings.get_string("current-file") != "") { - on_sidebar_row_selected (sidebar.get_selected_row ()); - } Gtk.Adjustment eadj = edit_view.get_vadjustment (); Gtk.Adjustment padj = preview_view.get_vadjustment (); @@ -671,131 +667,124 @@ } } - private void on_create_new () { - var dialog = new Services.DialogUtils.Dialog (); - dialog.transient_for = this; - - dialog.response.connect ((response_id) => { - switch (response_id) { - case Gtk.ResponseType.OK: - debug ("User saves the file."); - unowned Widgets.SideBarBox? row = sidebar.get_selected_row (); - if (row != null && row.path != null) { - on_save (); - } else { - on_save_as (); - } - - edit_view_content.modified = false; - dialog.close (); - break; - case Gtk.ResponseType.NO: - edit_view_content.modified = false; - dialog.close (); - break; - case Gtk.ResponseType.CANCEL: - case Gtk.ResponseType.CLOSE: - case Gtk.ResponseType.DELETE_EVENT: - dialog.close (); - return; - default: - assert_not_reached (); - } - }); - - - if (edit_view_content.modified) { - dialog.run (); - } - - debug ("Creating new document"); - on_save (); - sidebar.add_file (Services.FileManager.get_temp_document_path ()); - edit_view_content.text = ""; - edit_view_content.modified = true; - on_save (); - } - - private void on_open () { - string contents; - string path = Services.FileManager.open (out contents); - - edit_view_content.text = contents; - - if (path == Quilter.Application.gsettings.get_string("current-file")) { - sidebar.delete_row (); - sidebar.add_file (path); - } else { - sidebar.add_file (path); - } - } - - private void on_save () { - unowned Widgets.SideBarBox? row = sidebar.get_selected_row (); - if (row != null) { - try { - Services.FileManager.save_file (row.path ?? Services.FileManager.get_temp_document_path (), edit_view_content.text); - edit_view_content.modified = false; - } catch (Error e) { - warning ("Unexpected error during save: " + e.message); - } - } - } - - private void on_save_as () { - unowned Widgets.SideBarBox? row = sidebar.get_selected_row (); - if (row != null) { - try { - - string path; - Services.FileManager.save_as (edit_view_content.text, out path); - edit_view_content.modified = false; - - for (int i = 0; i < Quilter.Application.gsettings.get_strv("last-files").length; i++) { - if (Quilter.Application.gsettings.get_strv("last-files")[i] != null) { - sidebar.delete_row_with_name (); - sidebar.add_file (path); - } else { - sidebar.delete_row (); - sidebar.add_file (path); - } - } - } catch (Error e) { - warning ("Unexpected error during save: " + e.message); - } - } - } - - private void on_sidebar_row_selected (Widgets.SideBarBox? box) { - if (box != null) { - try { - string file_path = box.path; - - Quilter.Application.gsettings.set_string("current-file", box.path); - - string text; - GLib.FileUtils.get_contents (file_path, out text); - - if (Quilter.Application.gsettings.get_string("current-file") != file_path) { - if (Quilter.Application.gsettings.get_boolean("autosave") == true) { - on_save (); - } - } else if (Quilter.Application.gsettings.get_string("current-file") == _("No Documents Open")) { - return; - } - - if (edit_view_content.modified) { - Services.FileManager.save_file (file_path, text); - edit_view_content.modified = false; - } - - edit_view_content.text = text; - } catch (Error e) { - warning ("Unexpected error during selection: " + e.message); - } - } - - update_title (); - } + public void save_last_files () { + string[] rows = {}; + foreach (var child in sidebar.column.get_children ()) { + rows += ((Widgets.SideBarBox)child).path; + } + Quilter.Application.gsettings.set_strv ("last-files", rows); + } + + private void on_create_new () { + var dialog = new Services.DialogUtils.Dialog (); + dialog.transient_for = this; + + dialog.response.connect ((response_id) => { + switch (response_id) { + case Gtk.ResponseType.OK: + debug ("User saves the file."); + unowned Widgets.SideBarBox? row = sidebar.get_selected_row (); + if (row != null && row.path != null) { + on_save (); + } else { + on_save_as (); + } + + edit_view_content.modified = false; + dialog.close (); + break; + case Gtk.ResponseType.NO: + edit_view_content.modified = false; + dialog.close (); + break; + case Gtk.ResponseType.CANCEL: + case Gtk.ResponseType.CLOSE: + case Gtk.ResponseType.DELETE_EVENT: + dialog.close (); + return; + default: + assert_not_reached (); + } + }); + + + if (edit_view_content.modified) { + dialog.run (); + } + + debug ("Creating new document"); + on_save (); + sidebar.add_file (Services.FileManager.get_temp_document_path ()); + sidebar.is_modified = true; + save_last_files (); + edit_view_content.text = ""; + edit_view_content.modified = true; + sidebar.store.clear (); + sidebar.outline_populate (); + sidebar.view.expand_all (); + on_save (); + } + + private void on_open () { + string contents; + string path = Services.FileManager.open (out contents); + + if (sidebar.column.get_children () != null) { + foreach (var child in sidebar.column.get_children ()) { + if (((Widgets.SideBarBox)child).path == path) { + sidebar.column.select_row (((Widgets.SideBarBox)child)); + break; + } else { + sidebar.add_file (path); + sidebar.is_modified = true; + break; + } + } + } else { + sidebar.add_file (path); + sidebar.is_modified = true; + } + edit_view_content.text = contents; + save_last_files (); + sidebar.store.clear (); + sidebar.outline_populate (); + sidebar.view.expand_all (); + } + + public void on_save () { + unowned Widgets.SideBarBox? row = sidebar.get_selected_row (); + if (row != null) { + try { + Services.FileManager.save_file (row.path, edit_view_content.text); + edit_view_content.modified = false; + } catch (Error e) { + warning ("Unexpected error during save: " + e.message); + } + } + } + + private void on_save_as () { + unowned Widgets.SideBarBox? row = sidebar.get_selected_row (); + if (row != null) { + try { + + string path; + Services.FileManager.save_as (edit_view_content.text, out path); + edit_view_content.modified = false; + sidebar.store.clear (); + sidebar.outline_populate (); + sidebar.view.expand_all (); + + foreach (var child in sidebar.column.get_children ()) { + if (((Widgets.SideBarBox)child).path == Services.FileManager.get_temp_document_path ()) { + ((Widgets.SideBarBox)child).path = path; + break; + } + } + } catch (Error e) { + warning ("Unexpected error during save: " + e.message); + } + } + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quilter-2.2.4/src/Widgets/Cheatsheet.vala new/quilter-2.5.0/src/Widgets/Cheatsheet.vala --- old/quilter-2.2.4/src/Widgets/Cheatsheet.vala 2020-04-13 08:17:13.000000000 +0200 +++ new/quilter-2.5.0/src/Widgets/Cheatsheet.vala 2020-07-21 16:04:44.000000000 +0200 @@ -132,7 +132,7 @@ var hr_label = new Label (_("This creates a horizontal rule → ---")); var sp_image_label = new Label (_("This embeds a local image → /Folder/Image.png :image")); var sp_file_label = new Label (_("This embeds a local Markdown file → /Folder/File.md :file")); - var lx_label = new Label (_("LaTeX is processed with:\n\t- $$…$$ for equation block.\n\t- \\(…\\) or \\[\\] for inline equation.")); + var lx_label = new Label (_("LaTeX is processed with:\n\t- $$…$$ for equation block.\n\t- \\\\(…\\\\) for inline equation.")); var mm_label = new Label (_("Mermaid is processed with:\n\t<div class=\"mermaid\">...</div>\n\tUsing Mermaid.js in other forms may clash with\n\tthe Code Highlightning plugin.")); links_grid.attach (link_header, 0, 0, 5, 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quilter-2.2.4/src/Widgets/SideBar.vala new/quilter-2.5.0/src/Widgets/SideBar.vala --- old/quilter-2.2.4/src/Widgets/SideBar.vala 2020-04-13 08:17:13.000000000 +0200 +++ new/quilter-2.5.0/src/Widgets/SideBar.vala 2020-07-21 16:04:44.000000000 +0200 @@ -19,6 +19,7 @@ namespace Quilter.Widgets { public class SideBar : Gtk.Revealer { public Gtk.ListBox column; + private Widgets.SideBarBox[] rows; public Widgets.SideBarBox row; public Widgets.SideBarBox filebox; public Widgets.EditView ev; @@ -41,6 +42,7 @@ private Gtk.Label no_files; private string[] files; public Gee.LinkedList<SideBarBox> s_files = null; + public bool is_modified {get; set; default = false;} public signal void save_as (); public signal void row_selected (Widgets.SideBarBox box); @@ -124,20 +126,30 @@ column.set_placeholder (no_files); for (int i = 0; i < Quilter.Application.gsettings.get_strv("last-files").length; i++) { - var row = add_file (Quilter.Application.gsettings.get_strv("last-files")[i]); - if (Quilter.Application.gsettings.get_strv("last-files")[i] == Quilter.Application.gsettings.get_string("current-file")) { - column.select_row (row); - } + rows += add_file (Quilter.Application.gsettings.get_strv("last-files")[i]); } - column.row_selected.connect ((row) => { - if (((Widgets.SideBarBox)row) != null) { - row_selected ((Widgets.SideBarBox)row); + column.row_selected.connect ((selected_row) => { + foreach (var row in rows) { + row.file_remove_button.visible = (row == get_selected_row ()); } - }); - - column.show_all (); + try { + row = get_selected_row (); + string text = ""; + GLib.FileUtils.get_contents (row.path, out text); + Quilter.Application.gsettings.set_string("current-file", row.path); + + if (win.edit_view_content.modified) { + Services.FileManager.save_file (row.path, text); + win.edit_view_content.modified = false; + } + + win.edit_view_content.text = text; + } catch (Error e) { + warning ("Unexpected error during selection: " + e.message); + } + }); files_grid = new Gtk.Grid (); files_grid.hexpand = false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quilter-2.2.4/src/Widgets/SideBarBox.vala new/quilter-2.5.0/src/Widgets/SideBarBox.vala --- old/quilter-2.2.4/src/Widgets/SideBarBox.vala 2020-04-13 08:17:13.000000000 +0200 +++ new/quilter-2.5.0/src/Widgets/SideBarBox.vala 2020-07-21 16:04:44.000000000 +0200 @@ -23,6 +23,7 @@ private Gtk.Label file_label; public Gtk.Grid file_grid; public EditView ev; + public Gtk.Button file_remove_button; private string? _path; public new string? path { @@ -77,7 +78,7 @@ var file_icon = new Gtk.Image.from_icon_name ("text-markdown", Gtk.IconSize.DND); - var file_remove_button = new Gtk.Button (); + file_remove_button = new Gtk.Button (); file_remove_button.always_show_image = true; file_remove_button.vexpand = false; file_remove_button.hexpand = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/quilter-2.2.4/src/Widgets/WebView.vala new/quilter-2.5.0/src/Widgets/WebView.vala --- old/quilter-2.2.4/src/Widgets/WebView.vala 2020-04-13 08:17:13.000000000 +0200 +++ new/quilter-2.5.0/src/Widgets/WebView.vala 2020-07-21 16:04:44.000000000 +0200 @@ -235,13 +235,13 @@ public void update_html_view () { string processed_mk; process_frontmatter (buf.text, out processed_mk); - var mkd = new Markdown.Document.from_string (processed_mk.data, + var mkd = new Markdown.Document.from_gfm_string (processed_mk.data, 0x00000100 + 0x00001000 + 0x00040000 + 0x00200000 ); - mkd.compile (0x00001000 + - 0x00000100 + + mkd.compile (0x00000100 + + 0x00001000 + 0x00040000 + 0x00200000 ); @@ -250,26 +250,42 @@ string highlight = set_highlight(); string latex = set_latex(); string mermaid = set_mermaid(); - string font_stylesheet = set_font_stylesheet (); - string stylesheet = set_stylesheet (); - string markdown = process_plugins (result); + string font = set_font_stylesheet (); + string style = set_stylesheet (); + string md = process_plugins (result); + + bool focus_active = Quilter.Application.gsettings.get_boolean("focus-mode"); + bool typewriter_active = Quilter.Application.gsettings.get_boolean("typewriter-scrolling"); + if (focus_active && typewriter_active) { + style += """ + html { + padding-top: 50%; + padding-bottom: 50%; + } + """; + } else { + style += """ + html { + padding-bottom: 10%; + } + """; + } + html = """ <!doctype html> <html> <head> <meta charset="utf-8"> + <style>%s</style> %s %s <link rel="stylesheet" href="%s"/> - <style>"%s"</style> </head> <body> %s - <div class=\"markdown-body\"> - %s - </div> + %s </body> - </html>""".printf(highlight, latex, font_stylesheet, stylesheet, mermaid, markdown); + </html>""".printf(style, highlight, latex, font, mermaid, md); this.load_html (html, "file:///"); }
