Denis Auroux twisted the bytes to say:

Hi Denis,

I am going to split the two features into two threads so we don't ignore
one for the other



 Denis> - An option to make the creation of new pages use default style paper 
 Denis> (only if the current page is a PDF page? always?)  The current behavior 
 Denis> is to always imitate the current page, which some seem to find 
confusing 
 Denis> when the current page is a PDF page. This would probably be only in the 
 Denis> config file, perhaps turned off by default -- the page menu is already 
 Denis> cluttered enough as it is, and non-power users can always do "Page -> 
 Denis> Default paper" after creating the new page.
 Denis> Or is the request to create a completely blank white page of the same 
 Denis> size as the PDF page that would be created, rather than a default-style 
 Denis> page? (i.e., continue to create pages that "look like" the current one, 
 Denis> but make an exception for PDF pages to make a blank white page instead?)

Here is the code that matters (I implemented it sometime ago and have
not looked into it for a long time, but it was in my messy fork that has
lots of features integrated... 

I created a flag (loaded from config and an option in the menu) to be
used if the document has a background.

ui.bg_new_background_from_pdf

if true, new page uses current behaviour
if false, new page uses default page

in struct Page *new_page(struct Page *template):

-----
  if (pg->bg->type == BG_PDF && !ui.bg_new_background_from_pdf) {
    // for pdfs load trhe default background
    pg->bg = (struct Background *)g_memdup(ui.default_page.bg, sizeof(struct 
Background));
  } else {
    pg->bg = (struct Background *)g_memdup(template->bg, sizeof(struct 
Background));
  }
---
To implement it only in the config:

in typedef struct UIData {

  gboolean bg_new_background_from_pdf;

--

in void init_config_default(void):


  ui.bg_new_background_from_pdf = FALSE;


...
in void save_config_to_file(void)

I think that is all that is needed, plus the code for the variable:

  update_keyval("paper", "new_background_from_pdf", 
                _("If a pdf is loaded, if true new pages are created by copying 
current PDF page, otherwise it creates new page with default paper"),
                g_strdup(ui.bg_new_background_from_pdf?"true":"false"));

...
in void load_config_from_file(void)

  parse_keyval_boolean("paper", "new_background_from_pdf", 
&ui.bg_new_background_from_pdf);





 Denis> Daniel, I think you have opinions on both of these items; let me know 
 Denis> what you think. Also, any other items that seem similarly highly 
 Denis> desirable, easy to implement (or review if already implemented 
 Denis> somewhere), and useful to many users?

 Denis> Denis

 Denis> -- 
 Denis> Denis Auroux
 Denis> University of California, Berkeley      aur...@math.berkeley.edu
 Denis> Department of Mathematics               Tel: 510-642-4367
 Denis> 817 Evans Hall # 3840                   Fax: 510-642-8204
 Denis> Berkeley, CA 94720-3840

 Denis> 
------------------------------------------------------------------------------
 Denis> Learn Graph Databases - Download FREE O'Reilly Book
 Denis> "Graph Databases" is the definitive new guide to graph databases and 
their
 Denis> applications. Written by three acclaimed leaders in the field,
 Denis> this first edition is now available. Download your free book today!
 Denis> http://p.sf.net/sfu/13534_NeoTech
 Denis> _______________________________________________
 Denis> Xournal-devel mailing list
 Denis> Xournal-devel@lists.sourceforge.net
 Denis> https://lists.sourceforge.net/lists/listinfo/xournal-devel


--
Daniel M. German                  "Never attribute to malice
                                   that which can be adequately
    Robert Heinlein ->             explained by stupidity. "
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .

 

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Xournal-devel mailing list
Xournal-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xournal-devel

Reply via email to