Re: SV: Towards RC4/final release

2011-07-28 Thread Helge Hafting

On 19. juli 2011 08:44, Jürgen Spitzmüller wrote:

Uwe Stöhr wrote:

There is the ideal, and there is what we have. The ideal way would be
to ensure that the extra paragraph types for running headers appear if
and only if page layout fancy is checked. Currently, that can't be
done with modules.  But at least we have the running headers now, which
is nice.


Well spoken. We were aware of that issue but what we have now is much better
than before and the  header/footer issue came up very often in the user
mailing list.


The problem is that we begin to weaken the module concept. I fear we end up
with modules being a wastebin category, where we put everything we are to
lazy to develop a decent GUI for.

That would be a pity, since the module concept is very valuable in itself.


In this particular case, it looks like no extra GUI is needed at all, 
only programming. The GUI is present already:


Currently, the running header paragraph types becomes available when the 
user selects the module. All we need then, is to remove the module

from the module list, and tie it to  headings style == fancy instead.

Consider that a whishlist item, that would remove one way of getting
compile errors. :-)



For other cases, it seems that LyX is moving tovards modules so powerful 
that a lot of things might not need any other GUI. I.e. if we get styles 
with optional arguments, and also flex insets that cannot be typed in 
(similar to TOC).


Helge Hafting


Re: SV: Towards RC4/final release

2011-07-28 Thread Jürgen Spitzmüller
Helge Hafting wrote:
 In this particular case, it looks like no extra GUI is needed at all, 
 only programming. The GUI is present already:
 
 Currently, the running header paragraph types becomes available when the 
 user selects the module. All we need then, is to remove the module
 from the module list, and tie it to  headings style == fancy instead.

IMHO, the header definition should not be done with paragraph styles (as the 
module does), but rather in the document dialog. Many people want automatic 
headers (running headers), not some hardcoded strings. I do not think this can 
be achieved elegantly with the paragraph style based approach. Furthermore, we 
should provide some customization possibilites. Also something we need the 
dialog for.
Then, we should consider class specific issues (classes such as KOMA and 
memoir ship their own header interfaces that should be used instead of 
fancyhdr).

 For other cases, it seems that LyX is moving tovards modules so powerful
 that a lot of things might not need any other GUI. 

I really hope you're wrong.

Jürgen


Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Hi all,

in order to raise your attention to the Image/External-Material 
Lifecycle patches I've been working to in the last few days, I just 
built up a video:


  http://www.youtube.com/watch?v=eJUj70islB4

so that you can conveniently see how it works and comment on it, even if 
you don't have the time to try the patch yourself.


I'd like to gather comments on this, whether it may be acceptable for 
the next LyX release, how it can be finalized, etc. Needless to say, I'd 
personally love to have this in. This is a quick description of what I'm 
talking about, in case you didn't follow the previous threads on lyx-devel:


  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.
  The key point is that a [Create/Edit] button allows one to
  create a new, non-existing file copying it from a sample
  file that is shipped together with LyX. Then, the user can
  conveniently edit the new file to suit his/her own needs.

Thanks, bye.

T.


Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Edwin Leuven
Tommaso Cucinotta tomm...@lyx.org wrote:
  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop

ed.


Re: LyX construct for LaTeX commands having no arguments

2011-07-28 Thread Jacob Barandes
So it presumably wouldn't work so well as a paragraph style. But what about
a modified flex inset, by having a new binary option in the InsetLayout
block that simply deactivates opening the box in LyX?

Jacob


On Wed, Jul 27, 2011 at 9:53 PM, Richard Heck rgh...@comcast.net wrote:

 On 07/27/2011 06:04 PM, Jacob Barandes wrote:
  It could be as rudimentary as just including an additional binary
  option UserInput [0/1] in the Style and FlexInset blocks that
  deactivates text input in LyX for the given construct.
 
 This is more difficult than it seems, due to what happens, e.g., if you
 hit the delete key when you are at the end of such a paragraph. Better
 to have a custom inset similar to the command insets we already have.

 rh




Re: LyX construct for LaTeX commands having no arguments

2011-07-28 Thread Richard Heck
On 07/28/2011 11:44 AM, Jacob Barandes wrote:
 So it presumably wouldn't work so well as a paragraph style. But what
 about a modified flex inset, by having a new binary option in the
 InsetLayout block that simply deactivates opening the box in LyX?

Interesting idea. But if I get to the more general approach, which would
allow for arguments (e.g., like the hyperlink inset), then it would
absorb this one, too.

rh



 On Wed, Jul 27, 2011 at 9:53 PM, Richard Heck rgh...@comcast.net
 mailto:rgh...@comcast.net wrote:

 On 07/27/2011 06:04 PM, Jacob Barandes wrote:
  It could be as rudimentary as just including an additional binary
  option UserInput [0/1] in the Style and FlexInset blocks that
  deactivates text input in LyX for the given construct.
 
 This is more difficult than it seems, due to what happens, e.g.,
 if you
 hit the delete key when you are at the end of such a paragraph. Better
 to have a custom inset similar to the command insets we already have.

 rh





Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Il 28/07/2011 17:29, Edwin Leuven ha scritto:

Tommaso Cucinottatomm...@lyx.org  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop


they are compatible: one way doesn't preclude that the other can be 
realised as well.


T.



Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Xu Wang
Tomasso,

This looks great! Also, sending an email is a great way to show what your
new feature does. I think more bug reports and/or fixes should have videos
attached.

Thanks, Xu

On Thu, Jul 28, 2011 at 2:29 PM, Tommaso Cucinotta tomm...@lyx.org wrote:

 Il 28/07/2011 17:29, Edwin Leuven ha scritto:

  Tommaso Cucinottatomm...@lyx.org  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

 fwiw, i'd rather be able to drag-n-drop


 they are compatible: one way doesn't preclude that the other can be
 realised as well.

T.




Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Il 28/07/2011 17:29, Edwin Leuven ha scritto:

Tommaso Cucinottatomm...@lyx.org  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop


Please, try the attached (preliminary) patch.

If you drag'n'drop at least .eps, .fig, .dia, .png files, then they get 
automatically inserted as InsetGraphics, and immediately previewed in 
LyX. If you drag'n'drop a .lyx file, then it is regularly opened.


Is this that you meant ?

And, the funny part, is that the patch was *mainly a removal of code*. 
Comments ?


T.

Index: src/frontends/qt4/GuiView.cpp
===
--- src/frontends/qt4/GuiView.cpp	(revisione 39381)
+++ src/frontends/qt4/GuiView.cpp	(copia locale)
@@ -893,12 +893,10 @@
 		vectorconst Format * found_formats;
 
 		// Find all formats that have the correct extension.
-		vectorconst Format * const  import_formats
-			= theConverters().importableFormats();
-		vectorconst Format *::const_iterator it = import_formats.begin();
-		for (; it != import_formats.end(); ++it)
-			if ((*it)-extension() == ext)
-found_formats.push_back(*it);
+		Formats::const_iterator it = formats.begin();
+		for (; it != formats.end(); ++it)
+			if (it-extension() == ext  it-name() != lyx)
+found_formats.push_back((*it));
 
 		FuncRequest cmd;
 		if (found_formats.size() = 1) {
@@ -2087,6 +2085,19 @@
 	if (filename.empty())
 		return;
 
+	FileName fname(filename);
+	if (formats.getFormatFromFile(fname) != lyx) {
+		if (!currentBufferView()) {
+			Alert::warning(_(Error), _(Need an open document where to insert));
+			return;
+		}
+		string args = string(graphics filename ) + filename;
+		FuncRequest cmd(LFUN_INSET_INSERT, args);
+		LYXERR(Debug::DEBUG, Dispatching:   cmd);
+		lyx::dispatch(cmd);
+		return;
+	}
+
 	// get absolute path of file
 	FileName const fullname(support::makeAbsPath(filename));
 


Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Il 29/07/2011 01:19, Tommaso Cucinotta ha scritto:

Il 28/07/2011 17:29, Edwin Leuven ha scritto:

Tommaso Cucinottatomm...@lyx.org  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop


Please, try the attached (preliminary) patch.


btw, there was also another patch by vfr on the Trac for this:

   http://www.lyx.org/trac/ticket/4017

Bye,

T.


Re: #3205: Cannot create external file from within LyX.

2011-07-28 Thread John McCabe-Dansted
Looks handy to me. A couple of minor comments:
  1) Why do you show a dialog informing the user that the file will be
created from the template? This information could be moved to the
previous dialog saving one click.
  2) From my distant memories of MacOS 8, file extensions are not
encouraged on MacOS. Perhaps someone who still uses MacOS could
comment on whether this seems sane on MacOS.

-- 
John C. McCabe-Dansted


Re: r39372 - in lyx-devel/trunk/development/Win32/packaging/installer: . include setup

2011-07-28 Thread Uwe Stöhr

Am 27.07.2011 01:59, schrieb Julien Rioux:


Is it intentional to move the trailing  on a new line?


Thanks for the hint. There are no quotes necessary. I removed them now.


Also, could you add the line Format 1 to the lyxrc.dist file?


Done.

Btw. please only cite the parts in your replies that are you referring to. This reduces the mail 
size and improved the overview about a topic


regards Uwe


Re: SV: Towards RC4/final release

2011-07-28 Thread Helge Hafting

On 19. juli 2011 08:44, Jürgen Spitzmüller wrote:

Uwe Stöhr wrote:

There is the ideal, and there is what we have. The "ideal" way would be
to ensure that the extra paragraph types for running headers appear if
and only if page layout "fancy" is checked. Currently, that can't be
done with modules.  But at least we have the running headers now, which
is nice.


Well spoken. We were aware of that issue but what we have now is much better
than before and the  header/footer issue came up very often in the user
mailing list.


The problem is that we begin to weaken the module concept. I fear we end up
with modules being a "wastebin" category, where we put everything we are to
lazy to develop a decent GUI for.

That would be a pity, since the module concept is very valuable in itself.


In this particular case, it looks like no extra GUI is needed at all, 
only programming. The GUI is present already:


Currently, the running header paragraph types becomes available when the 
user selects the module. All we need then, is to remove the module

from the module list, and tie it to  "headings style == fancy" instead.

Consider that a whishlist item, that would remove one way of getting
compile errors. :-)



For other cases, it seems that LyX is moving tovards modules so powerful 
that a lot of things might not need any other GUI. I.e. if we get styles 
with optional arguments, and also flex insets that cannot be typed in 
(similar to TOC).


Helge Hafting


Re: SV: Towards RC4/final release

2011-07-28 Thread Jürgen Spitzmüller
Helge Hafting wrote:
> In this particular case, it looks like no extra GUI is needed at all, 
> only programming. The GUI is present already:
> 
> Currently, the running header paragraph types becomes available when the 
> user selects the module. All we need then, is to remove the module
> from the module list, and tie it to  "headings style == fancy" instead.

IMHO, the header definition should not be done with paragraph styles (as the 
module does), but rather in the document dialog. Many people want automatic 
headers (running headers), not some hardcoded strings. I do not think this can 
be achieved elegantly with the paragraph style based approach. Furthermore, we 
should provide some customization possibilites. Also something we need the 
dialog for.
Then, we should consider class specific issues (classes such as KOMA and 
memoir ship their own header interfaces that should be used instead of 
fancyhdr).

> For other cases, it seems that LyX is moving tovards modules so powerful
> that a lot of things might not need any other GUI. 

I really hope you're wrong.

Jürgen


Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Hi all,

in order to raise your attention to the "Image/External-Material 
Lifecycle" patches I've been working to in the last few days, I just 
built up a video:


  http://www.youtube.com/watch?v=eJUj70islB4

so that you can conveniently see how it works and comment on it, even if 
you don't have the time to try the patch yourself.


I'd like to gather comments on this, whether it may be acceptable for 
the next LyX release, how it can be finalized, etc. Needless to say, I'd 
personally love to have this in. This is a quick description of what I'm 
talking about, in case you didn't follow the previous threads on lyx-devel:


  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.
  The key point is that a [Create/Edit] button allows one to
  create a new, non-existing file copying it from a sample
  file that is shipped together with LyX. Then, the user can
  conveniently edit the new file to suit his/her own needs.

Thanks, bye.

T.


Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Edwin Leuven
Tommaso Cucinotta  wrote:
>  This patch allows one to quickly insert new images
>  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop

ed.


Re: LyX construct for LaTeX commands having no arguments

2011-07-28 Thread Jacob Barandes
So it presumably wouldn't work so well as a paragraph style. But what about
a modified flex inset, by having a new binary option in the InsetLayout
block that simply deactivates opening the box in LyX?

Jacob


On Wed, Jul 27, 2011 at 9:53 PM, Richard Heck  wrote:

> On 07/27/2011 06:04 PM, Jacob Barandes wrote:
> > It could be as rudimentary as just including an additional binary
> > option UserInput [0/1] in the Style and FlexInset blocks that
> > deactivates text input in LyX for the given construct.
> >
> This is more difficult than it seems, due to what happens, e.g., if you
> hit the delete key when you are at the end of such a paragraph. Better
> to have a custom inset similar to the command insets we already have.
>
> rh
>
>


Re: LyX construct for LaTeX commands having no arguments

2011-07-28 Thread Richard Heck
On 07/28/2011 11:44 AM, Jacob Barandes wrote:
> So it presumably wouldn't work so well as a paragraph style. But what
> about a modified flex inset, by having a new binary option in the
> InsetLayout block that simply deactivates opening the box in LyX?
>
Interesting idea. But if I get to the more general approach, which would
allow for arguments (e.g., like the hyperlink inset), then it would
absorb this one, too.

rh
>
>
>
> On Wed, Jul 27, 2011 at 9:53 PM, Richard Heck  > wrote:
>
> On 07/27/2011 06:04 PM, Jacob Barandes wrote:
> > It could be as rudimentary as just including an additional binary
> > option UserInput [0/1] in the Style and FlexInset blocks that
> > deactivates text input in LyX for the given construct.
> >
> This is more difficult than it seems, due to what happens, e.g.,
> if you
> hit the delete key when you are at the end of such a paragraph. Better
> to have a custom inset similar to the command insets we already have.
>
> rh
>
>



Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Il 28/07/2011 17:29, Edwin Leuven ha scritto:

Tommaso Cucinotta  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop


they are compatible: one way doesn't preclude that the other can be 
realised as well.


T.



Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Xu Wang
Tomasso,

This looks great! Also, sending an email is a great way to show what your
new feature does. I think more bug reports and/or fixes should have videos
attached.

Thanks, Xu

On Thu, Jul 28, 2011 at 2:29 PM, Tommaso Cucinotta  wrote:

> Il 28/07/2011 17:29, Edwin Leuven ha scritto:
>
>  Tommaso Cucinotta  wrote:
>>
>>>  This patch allows one to quickly insert new images
>>>  and other type of external material into a LyX document.
>>>
>> fwiw, i'd rather be able to drag-n-drop
>>
>
> they are compatible: one way doesn't preclude that the other can be
> realised as well.
>
>T.
>
>


Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Il 28/07/2011 17:29, Edwin Leuven ha scritto:

Tommaso Cucinotta  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop


Please, try the attached (preliminary) patch.

If you drag'n'drop at least .eps, .fig, .dia, .png files, then they get 
automatically inserted as InsetGraphics, and immediately previewed in 
LyX. If you drag'n'drop a .lyx file, then it is regularly opened.


Is this that you meant ?

And, the funny part, is that the patch was *mainly a removal of code*. 
Comments ?


T.

Index: src/frontends/qt4/GuiView.cpp
===
--- src/frontends/qt4/GuiView.cpp	(revisione 39381)
+++ src/frontends/qt4/GuiView.cpp	(copia locale)
@@ -893,12 +893,10 @@
 		vector found_formats;
 
 		// Find all formats that have the correct extension.
-		vector const & import_formats
-			= theConverters().importableFormats();
-		vector::const_iterator it = import_formats.begin();
-		for (; it != import_formats.end(); ++it)
-			if ((*it)->extension() == ext)
-found_formats.push_back(*it);
+		Formats::const_iterator it = formats.begin();
+		for (; it != formats.end(); ++it)
+			if (it->extension() == ext && it->name() != "lyx")
+found_formats.push_back(&(*it));
 
 		FuncRequest cmd;
 		if (found_formats.size() >= 1) {
@@ -2087,6 +2085,19 @@
 	if (filename.empty())
 		return;
 
+	FileName fname(filename);
+	if (formats.getFormatFromFile(fname) != "lyx") {
+		if (!currentBufferView()) {
+			Alert::warning(_("Error"), _("Need an open document where to insert"));
+			return;
+		}
+		string args = string("graphics filename ") + filename;
+		FuncRequest cmd(LFUN_INSET_INSERT, args);
+		LYXERR(Debug::DEBUG, "Dispatching: " << cmd);
+		lyx::dispatch(cmd);
+		return;
+	}
+
 	// get absolute path of file
 	FileName const fullname(support::makeAbsPath(filename));
 


Re: Image Lifecycle (Create) Patch - Video

2011-07-28 Thread Tommaso Cucinotta

Il 29/07/2011 01:19, Tommaso Cucinotta ha scritto:

Il 28/07/2011 17:29, Edwin Leuven ha scritto:

Tommaso Cucinotta  wrote:

  This patch allows one to quickly insert new images
  and other type of external material into a LyX document.

fwiw, i'd rather be able to drag-n-drop


Please, try the attached (preliminary) patch.


btw, there was also another patch by vfr on the Trac for this:

   http://www.lyx.org/trac/ticket/4017

Bye,

T.


Re: #3205: Cannot create external file from within LyX.

2011-07-28 Thread John McCabe-Dansted
Looks handy to me. A couple of minor comments:
  1) Why do you show a dialog informing the user that the file will be
created from the template? This information could be moved to the
previous dialog saving one click.
  2) From my distant memories of MacOS 8, file extensions are not
encouraged on MacOS. Perhaps someone who still uses MacOS could
comment on whether this seems sane on MacOS.

-- 
John C. McCabe-Dansted


Re: r39372 - in lyx-devel/trunk/development/Win32/packaging/installer: . include setup

2011-07-28 Thread Uwe Stöhr

Am 27.07.2011 01:59, schrieb Julien Rioux:


Is it intentional to move the trailing " on a new line?


Thanks for the hint. There are no quotes necessary. I removed them now.


Also, could you add the line "Format 1" to the lyxrc.dist file?


Done.

Btw. please only cite the parts in your replies that are you referring to. This reduces the mail 
size and improved the overview about a topic


regards Uwe