Re: Feature Request: toolbar for phonetic symbols (IPA)

2012-03-12 Thread Jürgen Spitzmüller
Carlos Fiyero wrote:
 1. But the phonetic symbols doesn't have names like the greek
 characters. They only belong to categories. And some of them even
 don't belong to a single category but are between them (e.g. at the
 vowels). What name should be used?

Use the names given in the TIPA manual (see appendix A of that manual).

 2. How do I knoy these cryptic number-codes?

Look either in LyX's unicodesymbols list
http://www.lyx.org/trac/browser/lyxgit/lib/unicodesymbols

or directly in the unicode charts
http://www.decodeunicode.org/
http://unicode.org/charts/

Jürgen


Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

lar...@gullik.org (Lars Gullik Bjønnes) writes:

| lar...@gullik.org (Lars Gullik Bjønnes) writes:
| | -  write access for developers  (this might be moved up in the queue)
| I'll enable write access now, but with some limitations: you are not
| allowed to create new branches nor delete them. Also history rewind is
| not allowed.
| Also: try to avoid pointless merge commits.
| - multi commit features/work should be done on a separate branch (in
|   your local repo) and merged into the master branch when finished.
| - single commit work can with benefit be rebased on top of master
| A nice way to look at what the branch looks like (parallel-)history wise
| is to use gitk.

Also if you are bit unsure how to do all this, please do not just muddle
along and create a mess. What you should do is get some guidance:
(substitue larsbj with your own username)

   - fork the lyx repo:
  $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx
   - clone this repo:
  $ git clone g...@git.lyx.org:developers/larsbj/lyx lyx-larsbj
   - try to do all the changes to the best of you abilities,
 ask if you have any questions.
   - instead of doing a push to the real upstream repo, ask some of
 the other developers to have a look at your repo.
 (you have to anable read access for others to your repo: read
  ssh g...@git.lyx.org help)
   - this other developer can possibly help, or even to the upstream
  push for you (after he pulls your changed branch into his own
  repo)

If we play around a bit with this instead of just hitting the main repo
hard I really think we will end up in a lot better state, both process
wise and repo wise.

If we want to introduce a staging repo and can also be done, but we
shouldn't change to much at the same time.


Usually it is quite problematic to have a fellow developer to look at 
your proposed changes. Especially if the developers should look at ten 
different repositories.


That's why I would like a staging branch/repo. To have a single place 
where all the finished but not yet pushed work can be found.


Also, I would say it would be ok to rewrite the history in your personal 
branch. People should not base work on your personal branch. It's one of 
the advantages of git, that you can publish the work, that people can 
comment on it, and you reshape it before pushing it to the main repo/branch.


Vincent

Vincent




Re: #7760: Windows: lyx-bundle fails; babel missing

2012-03-12 Thread Paul Johnson
How many of you have tried the Windows installer bundle on a clean
Windows 7 system?

I can't figure out why the LyX bundle installer only fails for me--on
lots of different systems where I try it.  I had forgotten that I
submitted this bug report for LyX 2.0.0, (see below).  But the same
thing happens when I try the LyX 2.0.3 bundle installer.  LyX
installs, then tries to install MikTeX, that fails and a very quick
message appears and disappears from the screen before I can read it
entirely.  I believe it is the same message I saw when the LyX 2.0.0
install bailed, about the API 2 error.  Then LyX reports install
failed and uninstalls itself.

I used 7zip to open the LyX installer bundle.  Here's the good news:
I can get MikTeX installed from the MikTeX installer executable that
is in that bundle.   It appears to be the same MikTeX executable as on
the MikTeX site.  Why would that installer work when I take it out of
the installer bundle, but not when initiated by the bundle?  That's
interesting.


On Sat, Mar 10, 2012 at 5:00 AM, LyX Ticket Tracker t...@lyx.org wrote:
 #7760: Windows: lyx-bundle fails; babel missing
 ---+-
  Reporter:  pauljohn32         |       Owner:  uwestoehr
     Type:  defect             |      Status:  closed
  Priority:  normal             |   Milestone:
 Component:  windows-installer  |     Version:  2.0.0
  Severity:  normal             |  Resolution:  worksforme
  Keywords:                     |
 ---+-
 Changes (by uwestoehr):

  * status:  new = closed
  * resolution:   = worksforme


 Comment:

  Please checkout this installer (which will become LyX's new one for the
  next release):
  https://sourceforge.net/projects/lyxwininstaller/
  If you encounter problems, please reopen this bug report.

 --
 Ticket URL: http://www.lyx.org/trac/ticket/7760#comment:2
 The LyX Project http://www.lyx.org/
 LyX -- The Document Processor



-- 
Paul E. Johnson
Professor, Political Science    Assoc. Director
1541 Lilac Lane, Room 504     Center for Research Methods
University of Kansas               University of Kansas
http://pj.freefaculty.org            http://quant.ku.edu


Bug 4796

2012-03-12 Thread Richard Heck

On 03/12/2012 03:46 AM, Guenter Milde wrote:

On 2012-03-11, Richard Heck wrote:


[-- Type: text/plain, Encoding: 7bit --]
On 03/11/2012 04:46 AM, Zohair ABU SHABAN wrote:

Sure ... here's an example. Please see the attachment. Cheers.

This is the normal way lists are styled in most document classes. If you
want to change it, then you need to redefine the enumerate environment
(in this case). Probably the easiest way to do this is to use the
enumitem package, which has commands to do almost everything list
related. That said, there is a good reason lists are styled that way:
It's good typography.

However, with
   DocumentSettingsText Layoutseparate paragraphs by [*] indentation,
LyX puts too much space around lists because it
increases \parskip without correcting dependend values.

This is a known bug: http://www.lyx.org/trac/ticket/4796

This looks like it ought to be easy to fix, yes? Does anyone know of 
reason not to do as Guenter there suggests? Presumably, this should be 
for trunk only, as we don't want to change this aspect of output at a 
maintenance release.


Richard



Re: Updates to gitolite progress

2012-03-12 Thread Abdelrazak Younes
On Mon, Mar 12, 2012 at 1:03 PM, Vincent van Ravesteijn v...@lyx.org wrote:
 Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

First of all, thank you for this work Lars, this is a truly great
achievement :-)

 If we want to introduce a staging repo and can also be done, but we
 shouldn't change to much at the same time.

I strongly think that one repo per developper is way too complicated.

 Usually it is quite problematic to have a fellow developer to look at your
 proposed changes. Especially if the developers should look at ten different
 repositories.

 That's why I would like a staging branch/repo. To have a single place where
 all the finished but not yet pushed work can be found.

Fully agreed. I've tried both methods withing my team at work (using
mercurial not git but the idea is the same). Initially, one branch per
developper is really the way to go: It's easy to understand and to
follow:

You just do like you did with svn but committing only to your personal
branch. The only 2 additional steps is to merge from lyx-devel from
time to time. The lyx-devel maintainer will actually take care of
merging your personal branch to lyx-devel.

 Also, I would say it would be ok to rewrite the history in your personal
 branch. People should not base work on your personal branch. It's one of the
 advantages of git, that you can publish the work, that people can comment
 on it, and you reshape it before pushing it to the main repo/branch.

Agreed. But I actually think that the main repo should be pushed only
by the current maintainers: Richard and Vincent.
I would go even further:

The main repo would be automatically synchronized (only the 2.0 and
2.1 branches); either via a git hook or a cron script at server side.
The cron idea is better if only we had some automatic regression
testing in place. Then only those commits that passes regression on
the cooking repo would be pushed to the main repo.

Cheer,
Abdel.


Re: Updates to gitolite progress

2012-03-12 Thread Rob Oakes

On Mar 12, 2012, at 10:59 AM, Abdelrazak Younes wrote:

 The main repo would be automatically synchronized (only the 2.0 and
 2.1 branches); either via a git hook or a cron script at server side.
 The cron idea is better if only we had some automatic regression
 testing in place. Then only those commits that passes regression on
 the cooking repo would be pushed to the main repo.

Would it be possible to have the main repo also synchronized with the existing 
SVN? git-svn can transparently push right to an SVN repository. That would 
prevent a lot of things from breaking. For example, I've been keeping a mirror 
of SVN on Launchpad that I use for development, testing, and (hopefully) daily 
builds. Retooling this mirror to pull from git would require re-importing the 
whole thing (a multi-day affair).

If there is any way to keep our current SVN branch active with the canonical 
developer sources, that would be a wonderful thing. (Even if most of the 
development is happening in git.)

Cheers,

Rob

Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 11-3-2012 22:43, Richard Heck schreef:

On 03/11/2012 05:37 PM, Richard Heck wrote:

On 03/11/2012 12:59 PM, Lars Gullik Bjønnes wrote:

lar...@gullik.org (Lars Gullik Bjønnes) writes:

| | 5. Enable the new lyx-devel git repo at git.lyx.org.

The new repo has been made available to developers, and the git
installation has opend up for developers to create their own repos and
forks.

Developers that have registered their public keys can clone the repo 
by:


git clone g...@git.lyx.org:lyx

Just so I understand where we are: This is just devel, or are the 
branches also supposed to be in here? If so, where are they?



Ahh, I see it now: git co 2.0.x will do what I wanted.



If you want a tree for both 2.0.x and 2.1.0svn, you can do the following:

Assume you have a git clone in home/lyx, you can clone this with

git clone -s -b 2.0.x home/lyx home/lyx20x

This will clone your repo, but it will reuse the objects. This means 
that the second repo is much smaller than the first one.


Vincent


Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 18:15, Rob Oakes schreef:

On Mar 12, 2012, at 10:59 AM, Abdelrazak Younes wrote:


The main repo would be automatically synchronized (only the 2.0 and
2.1 branches); either via a git hook or a cron script at server side.
The cron idea is better if only we had some automatic regression
testing in place. Then only those commits that passes regression on
the cooking repo would be pushed to the main repo.

Would it be possible to have the main repo also synchronized with the existing 
SVN? git-svn can transparently push right to an SVN repository.


Not anymore, the HEAD of the git repo has a different sha1 as the svn 
repo imported by git-svn. This because some tags and strange commits 
have been corrected in the git repo.



That would prevent a lot of things from breaking. For example, I've been 
keeping a mirror of SVN on Launchpad that I use for development, testing, and 
(hopefully) daily builds. Retooling this mirror to pull from git would require 
re-importing the whole thing (a multi-day affair).


Would it be really a multi-day affair ? Cloning the git repo is done 
within a minute, and you have the whole history with it.


Vincent


Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

   - fork the lyx repo:
  $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx


My personal repo does not appear in gitweb. Is it supposed to ?

Vincent


Re: Updates to gitolite progress

2012-03-12 Thread Lars Gullik Bjønnes
Vincent van Ravesteijn v...@lyx.org writes:

| Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:
- fork the lyx repo:
   $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx

| My personal repo does not appear in gitweb. Is it supposed to ?

It will only appear there if you give gitweb read access.

-- 
   Lgb



Re: Updates to gitolite progress

2012-03-12 Thread Lars Gullik Bjønnes
Vincent van Ravesteijn v...@lyx.org writes:

| Op 11-3-2012 22:43, Richard Heck schreef:
 On 03/11/2012 05:37 PM, Richard Heck wrote:
 On 03/11/2012 12:59 PM, Lars Gullik Bjønnes wrote:
 lar...@gullik.org (Lars Gullik Bjønnes) writes:

 | | 5. Enable the new lyx-devel git repo at git.lyx.org.

 The new repo has been made available to developers, and the git
 installation has opend up for developers to create their own repos and
 forks.

 Developers that have registered their public keys can clone the
 repo by:

 git clone g...@git.lyx.org:lyx

 Just so I understand where we are: This is just devel, or are the
 branches also supposed to be in here? If so, where are they?

 Ahh, I see it now: git co 2.0.x will do what I wanted.


| If you want a tree for both 2.0.x and 2.1.0svn, you can do the following:

| Assume you have a git clone in home/lyx, you can clone this with

| git clone -s -b 2.0.x home/lyx home/lyx20x

| This will clone your repo, but it will reuse the objects. This means
| that the second repo is much smaller than the first one.

Note that when using shared repos (-s), if you delete the first one the
second one dies as well.

If you just do a clone, you still get a massive (initial) space saving
sine git will just hardlinks to duplicate objects.

-- 
   Lgb



Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 20:17, Lars Gullik Bjønnes schreef:

Vincent van Ravesteijnv...@lyx.org  writes:

| Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

- fork the lyx repo:
   $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx

| My personal repo does not appear in gitweb. Is it supposed to ?

It will only appear there if you give gitweb read access.


Thank you.

Vincent


Re: citation bug?

2012-03-12 Thread Julien Rioux

On 10/03/2012 8:20 AM, Georg Baum wrote:

The roundtrip output of one of the tex2lyx tests has changed recently:

tex2lyx -roundtrip src/tex2lyx/test/test-insets.tex

will produce src/tex2lyx/test/test-insets.lyx.lyx and src/tex2lyx/test/test-
insets.lyx.tex. If you compare these files with the ones created about 3
weeks ago, you'll get identical .lyx.lyx files, but the attached differences
in the .lyx.tex files (ignoring the differences coming from the changed
src/tex2lyx/test/test-insets.tex file itself).



Interesting. Do we have some infrastructure in place to do such 
comparison tests, or is it just something that you run locally from time 
to time? Would be good to do such checks as part of testing features in 
a staging branch, if we end up using this workflow.



If this changed output is intended it would be a file format change, since
the same .lyx file produces now different .tex. Otherwise it is a bug. Maybe
special treatment of the citatiuon modules is needed in tex2lyx?


Georg



It's a bug in the old implementation: there are no [before] or [after] 
optional arguments to \citeauthor and \citeyear when using natbib 
numerical style. Natbib will gobble those for you, so it doesn't lead to 
latex compilation errors, but it was wrong of LyX to pretend that you 
can have them. This kind of customization at the \citecommand level was 
not possible before, but is now implemented in r40820. It is not a 
fileformat change, since generated dvi/pdf are the same. I also don't 
think that any changes to tex2lyx are necessary in this case, as it is 
doing the right thing in gobbling the options just like natbib does.


Regards,
Julien



Re: Windows Installer could use work: must set miktex packages on fly to NO, or else LyX won't run

2012-03-12 Thread Vincent van Ravesteijn




Especially in your installer, you change MikTeX's setting, which is 
just rude and forces me to wait.


I explained several times in detail why this is the best solution ...


Yes, but I find it unethical. I choose to set MikTeX to Ask me and you 
just override this. Tomorrow you decide to upgrade my Windows 98 to 
Windows 8 without asking me.


My goal is to have an installer that just does everything for you, so 
no need to know the internals of LaTeX. When I started with the 
Windows installer I said that my goal is to send my mother a link 
where she can click on. In the installer she can click Next several 
times and afterwards can start using LyX. She doesn't know any 
internals how programs and the PC works but she don't need to. 
Everything will be in shape and she can directly start writing. And 
this works with my installer!


So, why can't we have a checkbox: Don't check for installed MikTeX 
packages (don't change this if you don't know what a MikTeX package is 
and if you're not an expert) which is turned on by default but which 
allows me to skip this checking.


regards Uwe


Vincent


Re: #8006: LyX shows Error converting to loadable format on PDF figures

2012-03-12 Thread Vincent van Ravesteijn



You misunderstood. I just compiled the 'official' installer.


Does it come with GhostScript 9.05 and the latest ImageMagick? If yes, 
how did you manage that ImageMagick could be installer when the user 
decides to install LyX without admin privileges?


 just took an older ImageMagick version from Joost from a previous 
windows installer.


Vincent


Re: citation bug?

2012-03-12 Thread Julien Rioux

On 10/03/2012 10:47 AM, Richard Heck wrote:

On 03/10/2012 08:20 AM, Georg Baum wrote:

Maybe
special treatment of the citatiuon modules is needed in tex2lyx?


Probably so. This seems kind of familiar from our experience with the
theorem modules.

Richard




Down the road, it would be nice to detect the citation engine by using 
whatever trick is used right now to detect that a specific \usepackage 
line should add a specific module, instead of hardcoding a list of 
modules. I don't know enough about this to do it just yet, but it's 
definitely a wishlist item.


Regards,
Julien



Development of 2012

2012-03-12 Thread Vincent van Ravesteijn
The following branch merges all features that were introduced in 2012 on 
top of a trunk-stable set at 31-12-2011:


http://git.lyx.org/?p=developers/vfr/lyx.git;a=shortlog;h=refs/heads/trunk-devel

Vincent


Re: #7760: Windows: lyx-bundle fails; babel missing

2012-03-12 Thread Uwe Stöhr

Am 12.03.2012 15:50, schrieb Paul Johnson:


How many of you have tried the Windows installer bundle on a clean
Windows 7 system?


At least me.
Have you ever tested the new installer?:
http://sourceforge.net/projects/lyxwininstaller/files/LyXWinInstaller/2.0.3/


I used 7zip to open the LyX installer bundle.


How can you do that and why do you do this?
The bundle installer is an executable. Simply execute it and do nothing more.

regards Uwe


Re: [patch] fix #8066 for branch - tex2lyx support for listings

2012-03-12 Thread Uwe Stöhr

Am 10.03.2012 13:54, schrieb Georg Baum:


I would not put it in branch right now (see my other mail for details). I
would rather like to see a better aproach (reading with changed catcodes or
character by character) mature a bit in trunk before it is backported.


I'm fine with a better approach but the patch improves the import of listings already enormously. 
Currently listings are not imported and with my patch they are. OK, special cases like % might 
fail but better than nothing. The new approach can later be backported without problems.


I don't understand your concerns because the special cases already fail in tex2lyx in branch and my 
patch does not make this worse it even fixes bugs like bug #8065.


regards Uwe


Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr

Am 10.03.2012 13:53, schrieb Georg Baum:


Yes. Unfortunately this is not done, since special properties of characters
like % are already handled in the tokenize phase. For example,

\begin{verbatim}
x
%\end{verbatim}

is not handled correctly, since tex2lyx believes that %\end{verbatim} is a
comment.


OK, but these cases seem a bit constructed. Who will uses such things in practice? For example in a 
listings inset I bet nobody ever.
But sure, if we can handle such cases, we should do so. I'm technically too limited in respect to 
catcodes and would leave this to you. OK?


thanks and regards
Uwe


Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr

Am 10.03.2012 14:03, schrieb Georg Baum:


The special language option handling looks fragile. I believe it will work
without the special code if you use p.verbatimOption() instead of
p.getArg().


Thanks, this works. I will commit as soon as the git transformation is ready and committing is 
possible again.


regards Uwe


Re: [patch] fix #8066 for branch - tex2lyx support for listings

2012-03-12 Thread Uwe Stöhr

Attached is a better patch with the improvements proposed by Georg.

regards Uwe
Index: Parser.cpp
===
--- Parser.cpp	(revision 40911)
+++ Parser.cpp	(working copy)
@@ -481,6 +481,49 @@
 }
 
 
+string const Parser::plainEnvironment(string const  name)
+{
+	if (!good())
+		return string();
+
+	ostringstream os;
+	for (Token t = get_token(); good(); t = get_token()) {
+		if (t.asInput() == \\end) {
+			string const end = getArg('{', '}');
+			if (end == name)
+return os.str();
+			else
+os  \\end{  end  '}';
+		} else
+			os  t.asInput();
+	}
+	cerr  unexpected end of input  endl;
+	return os.str();
+}
+
+
+string const Parser::plainCommand(char left, char right, string const  name)
+{
+	if (!good())
+		return string();
+	// ceck if first token is really the start character
+	Token tok = get_token();
+	if (tok.character() != left) {
+		cerr  first character does not match start character of command \\  name  endl;
+		return string();
+	}
+	ostringstream os;
+	for (Token t = get_token(); good(); t = get_token()) {
+		if (t.character() == right) {
+			return os.str();
+		} else
+			os  t.asInput();
+	}
+	cerr  unexpected end of input  endl;
+	return os.str();
+}
+
+
 void Parser::tokenize_one()
 {
 	catInit();
Index: Parser.h
===
--- Parser.h	(revision 40911)
+++ Parser.h	(working copy)
@@ -196,6 +196,19 @@
 	 * is parsed but not returned.
 	 */
 	std::string const verbatimEnvironment(std::string const  name);
+	/*
+	 * The same as verbatimEnvironment(std::string const  name) but
+	 * \begin and \end commands inside the name environment are not parsed.
+	 * This function is designed to parse verbatim environments.
+	 */
+	std::string const plainEnvironment(std::string const  name);
+	/*
+	 * Basically the same as plainEnvironment(std::string const  name) but
+	 * instead of \begin and \end commands the parsing is started/stopped
+	 * at given characters.
+	 * This function is designed to parse verbatim commands.
+	 */
+	std::string const plainCommand(char left, char right, std::string const  name);
 	/*!
 	 * Returns the character of the current token and increments
 	 * the token position.
Index: test/test-insets.tex
===
--- test/test-insets.tex	(revision 40911)
+++ test/test-insets.tex	(working copy)
@@ -156,6 +156,42 @@
 \listoftables
 
 
+\section{Listings}
+
+Inline: \lstinline[language={C++}]!int a=5;!\\
+Float:
+
+\begin{lstlisting}[caption={Example Listing float},label={lst:Example-Listing},language=Python]
+# Example listing float
+def func(param):
+'this is a python function'
+pass
+\end{lstlisting}
+
+Here is an example listing with left line numbering, step ``3'',
+language ``Python'', options ``Extended character table'' and
+``Space~as~symbol'', range lines 3\,-\,8:
+
+\begin{lstlisting}[extendedchars=true,firstline=3,language=Python,lastline=8,numbers=left,showspaces=true,stepnumber=3]
+def func(param):
+'this is a python function'
+pass
+def func(param):
+'This is a German word: Tschüß'
+pass
+def func(param):
+'this is a python function'
+pass
+\end{lstlisting}
+
+Special cases:
+\begin{lstlisting}[abovecaptionskip=2em,basicstyle={\large\ttfamily},breaklines=true,extendedchars=true,firstline=2,float=h,language={[R/3 3.1]ABAP},lastline=5,numbers=left,numberstyle={\scriptsize},showspaces=true,showstringspaces=false,stepnumber=3,tabsize=4]
+hello
+\end{lstlisting}
+
+\lstinline[language=TeX]!\begin{centering} hello!
+
+
 \section{Graphics\index{Graphics}}
 
 There is also some basic support for graphics, in the form
Index: text.cpp
===
--- text.cpp	(revision 40911)
+++ text.cpp	(working copy)
@@ -1110,16 +1110,28 @@
 }
 
 
-void parse_listings(Parser  p, ostream  os, Context  parent_context)
+void parse_listings(Parser  p, ostream  os, Context  parent_context, bool in_line)
 {
 	parent_context.check_layout(os);
 	begin_inset(os, listings\n);
-	os  inline false\n
-	status collapsed\n;
+	if (p.hasOpt()) {
+		string arg = p.verbatimOption();
+		os  lstparams   ''  arg  ''  '\n';
+	}
+	if (in_line)
+		os  inline true\n;
+	else
+		os  inline false\n;
+	os  status collapsed\n;
 	Context context(true, parent_context.textclass);
 	context.layout = parent_context.textclass.plainLayout();
-	context.check_layout(os);
-	string const s = p.verbatimEnvironment(lstlisting);
+	string s;
+	if (in_line) {
+		s = p.plainCommand('!', '!', lstinline);
+		context.new_paragraph(os);
+		context.check_layout(os);
+	} else
+		s = p.plainEnvironment(lstlisting);
 	for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
 		if (*it == '\\')
 			os  \n\\backslash\n;
@@ -1352,14 +1364,9 @@
 
 	else if (name == lstlisting) {
 		eat_whitespace(p, os, parent_context, false);
-		// FIXME handle listings with parameters
-		//   

Qt::setWindowModified(), [*] title placeholder, and icon buttons reaction to modified buffer(s) (was: Re: #8054: Awkward to search backwards in text)

2012-03-12 Thread Tommaso Cucinotta

Il 10/03/2012 13:30, Stephan Witt ha scritto:

Am 09.03.2012 um 01:31 schrieb Jerry:


Another problem with the colored buttons. A black dot in the red button 
indicates that a document has been edited but not saved to disk. Here are the 
two versions for a focused and unfocused window:

PastedGraphic-14.pdfPastedGraphic-15.pdf

and after saving:

PastedGraphic-16.pdfPastedGraphic-17.pdf

LyX does not do this--the main document button are always

PastedGraphic-20.pdf

Attached is a patch to solve that problem.


This produces an ugly warning on the output because if you use the 
setWindowModified(), Qt complains about not finding in the windowTitle() 
the [*] sequence. The attached patch suppresses these warnings 
inserting always that [*] placeholder (docs say the * is not displayed 
if the setModified() is set to false so it seems safe to add it always).


However, I can spot similarities and/or duplication of functionality 
with GuiWorkArea.cpp, specifically where you see the calls to 
Buffer::isClean() and the addition of the  (changed) suffix to the 
file name in tab titles. Specifically, check whether the iteration you 
do in GuiView::isClean() is the same or different from the one made in 
GuiWorkArea::updateWindowTitle().
I'd say at a glance that LyX made the choice to not rely on the 
standard *-based indication of a modified buffer, but rather used its 
own custom  (changed) title suffix. However, I have no objections to 
using a more widely used and (Qt-level) standardized indication of the 
modified buffer.


I'm replying with a more insightful title, perhaps others will comment 
better on this point.


T.

Index: src/frontends/qt4/GuiView.cpp
===
--- src/frontends/qt4/GuiView.cpp	(revisione 40911)
+++ src/frontends/qt4/GuiView.cpp	(copia locale)
@@ -303,17 +303,17 @@
 		bg_widget_-setFocus();
 	}
 
-	int tabWorkAreaCount()
+	int tabWorkAreaCount() const
 	{
 		return splitter_-count();
 	}
 
-	TabWorkArea * tabWorkArea(int i)
+	TabWorkArea * tabWorkArea(int i) const
 	{
 		return dynamic_castTabWorkArea *(splitter_-widget(i));
 	}
 
-	TabWorkArea * currentTabWorkArea()
+	TabWorkArea * currentTabWorkArea() const
 	{
 		int areas = tabWorkAreaCount();
 		if (areas == 1)
@@ -342,6 +342,16 @@
 	}
 #endif
 
+	bool isClean() const
+	{
+		QVectorGuiWorkArea* areas = guiWorkAreas();
+		bool result = true;
+		for (int i = 0; i  areas.size(); ++i) {
+			result = areas[i]-bufferView().buffer().isClean();
+		}
+		return result;
+	}
+	
 public:
 	GuiView * gv_;
 	GuiWorkArea * current_work_area_;
@@ -408,7 +418,7 @@
    Buffer::ExportStatus (Buffer::*syncFunc)(string const , bool) const,
    Buffer::ExportStatus (Buffer::*previewFunc)(string const ) const);
 
-	QVectorGuiWorkArea* guiWorkAreas();
+	QVectorGuiWorkArea* guiWorkAreas() const;
 };
 
 QSetBuffer const * GuiView::GuiViewPrivate::busyBuffers;
@@ -523,7 +533,7 @@
 }
 
 
-QVectorGuiWorkArea* GuiView::GuiViewPrivate::guiWorkAreas()
+QVectorGuiWorkArea* GuiView::GuiViewPrivate::guiWorkAreas() const
 {
 	QVectorGuiWorkArea* areas;
 	for (int i = 0; i  tabWorkAreaCount(); i++) {
@@ -1015,8 +1025,9 @@
 	if (wa != d.current_work_area_
 		|| wa-bufferView().buffer().isInternal())
 		return;
-	setWindowTitle(qt_(LyX: ) + wa-windowTitle());
+	setWindowTitle(qt_(LyX: ) + wa-windowTitle() + qt_([*]));
 	setWindowIconText(wa-windowIconText());
+	setWindowModified(!d.isClean());
 }
 
 


[patch] full support for table cell rotation

2012-03-12 Thread Uwe Stöhr
Since ages LyX supports to rotate table cells, but for an unknown reason it only supports rotation 
by 90°. The LaTeX command LyX is using for this is rotating and this package already provides 
support to rotate by any angle thus LyX can easily offer that too.


The attached patch implements this. This would be a fileformat change. OK?
(the necessary tex2lyx change follows)

regards Uwe
Index: lib/lyx2lyx/lyx_2_1.py
===
--- lib/lyx2lyx/lyx_2_1.py	(revision 40911)
+++ lib/lyx2lyx/lyx_2_1.py	(working copy)
@@ -573,6 +573,66 @@
 i = j
 
 
+def revert_cell_rotation(document):
+  Revert cell rotations to TeX-code
+
+  load_rotating = False
+  i = 0
+  try:
+while True:
+  # first, let's find out if we need to do anything
+  # cell type 3 is multirow begin cell
+  i = find_token(document.body, 'cell ', i)
+  if i == -1:
+return
+  j = document.body[i].find('rotate=')
+  if j != -1:
+k = document.body[i].find('', j + 8)
+value = document.body[i][j + 8 : k]
+if value == 0:
+  rgx = re.compile(r'rotate=[^]+?')
+  # remove rotate option
+  document.body[i] = rgx.sub('', document.body[i])
+elif value == 90:
+  rgx = re.compile(r'rotate=[^]+?')
+  document.body[i] = rgx.sub('rotate=true', document.body[i])
+else:
+  rgx = re.compile(r'rotate=[^]+?')
+  load_rotating = True
+  # remove rotate option
+  document.body[i] = rgx.sub('', document.body[i])
+  # write ERT
+  document.body[i + 5 : i + 5] = \
+put_cmd_in_ert(\\end{turn})
+  document.body[i + 4 : i + 4] = \
+put_cmd_in_ert(\\begin{turn}{ + value + })
+
+  i += 1
+
+  finally:
+if load_rotating:
+  add_to_preamble(document, [\\@ifundefined{turnbox}{\usepackage{rotating}}{}])
+
+
+def convert_cell_rotation(document):
+'Convert cell rotation statements from true to 90'
+
+i = 0
+while True:
+  # first, let's find out if we need to do anything
+  # cell type 3 is multirow begin cell
+  i = find_token(document.body, 'cell ', i)
+  if i == -1:
+return
+  j = document.body[i].find('rotate=true')
+  if j != -1:
+rgx = re.compile(r'rotate=[^]+?')
+# convert true to 90
+document.body[i] = rgx.sub('rotate=90', document.body[i])
+
+  i += 1
+
+
 ##
 # Conversion hub
 #
@@ -592,10 +652,12 @@
[424, [convert_cite_engine_type]],
[425, []],
[426, []],
-   [427, []]
+   [427, []],
+   [428, [convert_cell_rotation]]
   ]
 
 revert =  [
+   [427, [revert_cell_rotation]],
[426, [revert_tipa]],
[425, [revert_verbatim]],
[424, [revert_cancel]],
Index: lib/ui/stdtoolbars.inc
===
--- lib/ui/stdtoolbars.inc	(revision 40911)
+++ lib/ui/stdtoolbars.inc	(working copy)
@@ -162,7 +162,7 @@
 		Item Align middle command-alternatives inset-modify tabular m-valign-middle;inset-modify tabular valign-middle
 		Item Align bottom command-alternatives inset-modify tabular m-valign-bottom;inset-modify tabular valign-bottom
 		Separator
-		Item Rotate cell inset-modify tabular toggle-rotate-cell
+		Item Rotate cell by 90° or unset rotation inset-modify tabular toggle-rotate-cell
 		Item Rotate table inset-modify tabular toggle-rotate-tabular
 		Item Set multi-column inset-modify tabular multicolumn
 		Item Set multi-row inset-modify tabular multirow
Index: src/frontends/qt4/GuiTabular.cpp
===
--- src/frontends/qt4/GuiTabular.cpp	(revision 40911)
+++ src/frontends/qt4/GuiTabular.cpp	(working copy)
@@ -31,6 +31,7 @@
 
 #include insets/InsetTabular.h
 
+#include support/convert.h
 #include support/debug.h
 
 #include QCheckBox
@@ -144,6 +145,8 @@
 		this, SLOT(checkEnabled()));
 	connect(rotateCellCB, SIGNAL(clicked()),
 		this, SLOT(checkEnabled()));
+	connect(rotateCellAngleSB, SIGNAL(valueChanged(int)),
+		this, SLOT(checkEnabled()));
 	connect(TableAlignCO, SIGNAL(activated(int)),
 		this, SLOT(checkEnabled()));
 	connect(longTabularCB, SIGNAL(clicked()),
@@ -218,6 +221,8 @@
 	bool const is_tabular_star = !tabularWidthED-text().isEmpty();
 	rotateTabularCB-setDisabled(is_tabular_star);
 
+	rotateCellAngleSB-setEnabled(rotateCellCB-isChecked());
+
 	bool const enable_valign =
 		!multirowCB-isChecked()
 		 !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
@@ -555,11 +560,12 @@
 		setParam(param_str, Tabular::SET_ROTATE_TABULAR);
 	else
 		setParam(param_str, Tabular::UNSET_ROTATE_TABULAR);
-	//
+	// store the cell rotation angle
+	string angle = convertstring(rotateCellAngleSB-value());
 	if (rotateCellCB-isChecked())
-		setParam(param_str, Tabular::SET_ROTATE_CELL);
+		

Re: Qt::setWindowModified(), [*] title placeholder, and icon buttons reaction to modified buffer(s)

2012-03-12 Thread Jean-Marc Lasgouttes

Le 12/03/2012 23:06, Tommaso Cucinotta a écrit :

Il 10/03/2012 13:30, Stephan Witt ha scritto:

Am 09.03.2012 um 01:31 schrieb Jerry:


Another problem with the colored buttons. A black dot in the red
button indicates that a document has been edited but not saved to
disk. Here are the two versions for a focused and unfocused window:


FWIW, I propose a similar patch in July, but it was put on hold because 
with display other pieces of information in the title.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg170106.html

JMarc



Re: [patch] full support for table cell rotation

2012-03-12 Thread Uwe Stöhr

Am 12.03.2012 23:07, schrieb Uwe Stöhr:


The attached patch implements this. This would be a fileformat change. OK?
(the necessary tex2lyx change follows)


Now the tex2lyx part is included.

tex2lyx btw. never supported rotated table cells and has a bug (#8081).

regards Uwe
Index: lib/lyx2lyx/lyx_2_1.py
===
--- lib/lyx2lyx/lyx_2_1.py	(revision 40911)
+++ lib/lyx2lyx/lyx_2_1.py	(working copy)
@@ -573,6 +573,66 @@
 i = j
 
 
+def revert_cell_rotation(document):
+  Revert cell rotations to TeX-code
+
+  load_rotating = False
+  i = 0
+  try:
+while True:
+  # first, let's find out if we need to do anything
+  # cell type 3 is multirow begin cell
+  i = find_token(document.body, 'cell ', i)
+  if i == -1:
+return
+  j = document.body[i].find('rotate=')
+  if j != -1:
+k = document.body[i].find('', j + 8)
+value = document.body[i][j + 8 : k]
+if value == 0:
+  rgx = re.compile(r'rotate=[^]+?')
+  # remove rotate option
+  document.body[i] = rgx.sub('', document.body[i])
+elif value == 90:
+  rgx = re.compile(r'rotate=[^]+?')
+  document.body[i] = rgx.sub('rotate=true', document.body[i])
+else:
+  rgx = re.compile(r'rotate=[^]+?')
+  load_rotating = True
+  # remove rotate option
+  document.body[i] = rgx.sub('', document.body[i])
+  # write ERT
+  document.body[i + 5 : i + 5] = \
+put_cmd_in_ert(\\end{turn})
+  document.body[i + 4 : i + 4] = \
+put_cmd_in_ert(\\begin{turn}{ + value + })
+
+  i += 1
+
+  finally:
+if load_rotating:
+  add_to_preamble(document, [\\@ifundefined{turnbox}{\usepackage{rotating}}{}])
+
+
+def convert_cell_rotation(document):
+'Convert cell rotation statements from true to 90'
+
+i = 0
+while True:
+  # first, let's find out if we need to do anything
+  # cell type 3 is multirow begin cell
+  i = find_token(document.body, 'cell ', i)
+  if i == -1:
+return
+  j = document.body[i].find('rotate=true')
+  if j != -1:
+rgx = re.compile(r'rotate=[^]+?')
+# convert true to 90
+document.body[i] = rgx.sub('rotate=90', document.body[i])
+
+  i += 1
+
+
 ##
 # Conversion hub
 #
@@ -592,10 +652,12 @@
[424, [convert_cite_engine_type]],
[425, []],
[426, []],
-   [427, []]
+   [427, []],
+   [428, [convert_cell_rotation]]
   ]
 
 revert =  [
+   [427, [revert_cell_rotation]],
[426, [revert_tipa]],
[425, [revert_verbatim]],
[424, [revert_cancel]],
Index: lib/ui/stdtoolbars.inc
===
--- lib/ui/stdtoolbars.inc	(revision 40911)
+++ lib/ui/stdtoolbars.inc	(working copy)
@@ -162,7 +162,7 @@
 		Item Align middle command-alternatives inset-modify tabular m-valign-middle;inset-modify tabular valign-middle
 		Item Align bottom command-alternatives inset-modify tabular m-valign-bottom;inset-modify tabular valign-bottom
 		Separator
-		Item Rotate cell inset-modify tabular toggle-rotate-cell
+		Item Rotate cell by 90° or unset rotation inset-modify tabular toggle-rotate-cell
 		Item Rotate table inset-modify tabular toggle-rotate-tabular
 		Item Set multi-column inset-modify tabular multicolumn
 		Item Set multi-row inset-modify tabular multirow
Index: src/frontends/qt4/GuiTabular.cpp
===
--- src/frontends/qt4/GuiTabular.cpp	(revision 40911)
+++ src/frontends/qt4/GuiTabular.cpp	(working copy)
@@ -31,6 +31,7 @@
 
 #include insets/InsetTabular.h
 
+#include support/convert.h
 #include support/debug.h
 
 #include QCheckBox
@@ -144,6 +145,8 @@
 		this, SLOT(checkEnabled()));
 	connect(rotateCellCB, SIGNAL(clicked()),
 		this, SLOT(checkEnabled()));
+	connect(rotateCellAngleSB, SIGNAL(valueChanged(int)),
+		this, SLOT(checkEnabled()));
 	connect(TableAlignCO, SIGNAL(activated(int)),
 		this, SLOT(checkEnabled()));
 	connect(longTabularCB, SIGNAL(clicked()),
@@ -218,6 +221,8 @@
 	bool const is_tabular_star = !tabularWidthED-text().isEmpty();
 	rotateTabularCB-setDisabled(is_tabular_star);
 
+	rotateCellAngleSB-setEnabled(rotateCellCB-isChecked());
+
 	bool const enable_valign =
 		!multirowCB-isChecked()
 		 !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
@@ -555,11 +560,12 @@
 		setParam(param_str, Tabular::SET_ROTATE_TABULAR);
 	else
 		setParam(param_str, Tabular::UNSET_ROTATE_TABULAR);
-	//
+	// store the cell rotation angle
+	string angle = convertstring(rotateCellAngleSB-value());
 	if (rotateCellCB-isChecked())
-		setParam(param_str, Tabular::SET_ROTATE_CELL);
+		setParam(param_str, Tabular::SET_ROTATE_CELL, angle);
 	else
-		setParam(param_str, Tabular::UNSET_ROTATE_CELL);
+		

Copy'n'Paste without modifying Clipboard

2012-03-12 Thread Tommaso Cucinotta

Hi,

does anyone have a hint on the code needed to copy the current selection 
from one buffer and paste it into another buffer, without affecting the 
user's clipboard ?


On a related note, what is the Cut stack ?

Also, is it true that all of these paste methods [1] (from 
CutAndPaste.h) work only in text mode ?


What is the simplest way to copy a segment of LyX text (inclusive of 
maths and whatever may be there), and paste it into another LyX buffer, 
just emulating C-c followed by C-v ?


Thanks,

T.

[1]
/// Paste the current selection at \p cur
/// Does handle undo. Does only work in text, not mathed.
void pasteSelection(Cursor  cur, ErrorList );
/// Replace the current selection with the clipboard contents as text
/// (internal or external: which is newer).
/// Does handle undo. Does only work in text, not mathed.
void pasteClipboardText(Cursor  cur, ErrorList  errorList,
bool asParagraphs = true);
/// Replace the current selection with the clipboard contents as graphic.
/// Does handle undo. Does only work in text, not mathed.
void pasteClipboardGraphics(Cursor  cur, ErrorList  errorList,
Clipboard::GraphicsType preferedType = Clipboard::AnyGraphicsType);
/// Replace the current selection with cut buffer \c sel_index
/// Does handle undo. Does only work in text, not mathed.
void pasteFromStack(Cursor  cur, ErrorList  errorList, size_t sel_index);
/// Paste the clipboard as simple text, removing any formatting
void pasteSimpleText(Cursor  cur, bool asParagraphs);

/// Paste the paragraph list \p parlist at the position given by \p cur.
/// Does not handle undo. Does only work in text, not mathed.
void pasteParagraphList(Cursor  cur, ParagraphList const  parlist,
DocumentClass const * const textclass, ErrorList  errorList);



Re: #8006: LyX shows Error converting to loadable format on PDF figures

2012-03-12 Thread Uwe Stöhr

Am 12.03.2012 20:43, schrieb Vincent van Ravesteijn:


just took an older ImageMagick version from Joost from a previous windows 
installer.


Joost recompiled ImageMagick specially to overcome the admin restriction. I tried to get him to 
share his workaround with the IM people but he did not reply :-(
The problem is that we cannot build our own versions with every IM release and compared to the 
version in your installer the latest IM contains many security fixes. So in my opinion providing on 
old IM is a security problem.


but perhaps this week I find time to check out if the new IM does now work 
without admin privileges.

regards Uwe


Re: Feature Request: toolbar for phonetic symbols (IPA)

2012-03-12 Thread Jürgen Spitzmüller
Carlos Fiyero wrote:
> 1. But the phonetic symbols doesn't have names like the greek
> characters. They only belong to categories. And some of them even
> don't belong to a single category but are between them (e.g. at the
> vowels). What name should be used?

Use the names given in the TIPA manual (see appendix A of that manual).

> 2. How do I knoy these cryptic number-codes?

Look either in LyX's unicodesymbols list
http://www.lyx.org/trac/browser/lyxgit/lib/unicodesymbols

or directly in the unicode charts
http://www.decodeunicode.org/
http://unicode.org/charts/

Jürgen


Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

lar...@gullik.org (Lars Gullik Bjønnes) writes:

| lar...@gullik.org (Lars Gullik Bjønnes) writes:
| | ->  write access for developers  (this might be moved up in the queue)
| I'll enable write access now, but with some limitations: you are not
| allowed to create new branches nor delete them. Also history rewind is
| not allowed.
| Also: try to avoid pointless merge commits.
| - multi commit features/work should be done on a separate branch (in
|   your local repo) and merged into the master branch when finished.
| - single commit work can with benefit be rebased on top of master
| A nice way to look at what the branch looks like (parallel-)history wise
| is to use gitk.

Also if you are bit unsure how to do all this, please do not just muddle
along and create a mess. What you should do is get some guidance:
(substitue "larsbj" with your own username)

   - fork the lyx repo:
  $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx
   - clone this repo:
  $ git clone g...@git.lyx.org:developers/larsbj/lyx lyx-larsbj
   - try to do all the changes to the best of you abilities,
 ask if you have any questions.
   - instead of doing a push to the real upstream repo, ask some of
 the other developers to have a look at your repo.
 (you have to anable read access for others to your repo: read
  ssh g...@git.lyx.org help)
   - this other developer can possibly help, or even to the upstream
  push for you (after he pulls your changed branch into his own
  repo)

If we play around a bit with this instead of just hitting the main repo
hard I really think we will end up in a lot better state, both process
wise and repo wise.

If we want to introduce a staging repo and can also be done, but we
shouldn't change to much at the same time.


Usually it is quite problematic to have a fellow developer to look at 
your proposed changes. Especially if the developers should look at ten 
different repositories.


That's why I would like a staging branch/repo. To have a single place 
where all the finished but not yet pushed work can be found.


Also, I would say it would be ok to rewrite the history in your personal 
branch. People should not base work on your personal branch. It's one of 
the advantages of git, that you can "publish" the work, that people can 
comment on it, and you reshape it before pushing it to the main repo/branch.


Vincent

Vincent




Re: #7760: Windows: lyx-bundle fails; babel missing

2012-03-12 Thread Paul Johnson
How many of you have tried the Windows installer bundle on a clean
Windows 7 system?

I can't figure out why the LyX bundle installer only fails for me--on
lots of different systems where I try it.  I had forgotten that I
submitted this bug report for LyX 2.0.0, (see below).  But the same
thing happens when I try the LyX 2.0.3 bundle installer.  LyX
installs, then tries to install MikTeX, that fails and a very quick
message appears and disappears from the screen before I can read it
entirely.  I believe it is the same message I saw when the LyX 2.0.0
install bailed, about the API 2 error.  Then LyX reports install
failed and uninstalls itself.

I used 7zip to open the LyX installer bundle.  Here's the good news:
I can get MikTeX installed from the MikTeX installer executable that
is in that bundle.   It appears to be the same MikTeX executable as on
the MikTeX site.  Why would that installer work when I take it out of
the installer bundle, but not when initiated by the bundle?  That's
interesting.


On Sat, Mar 10, 2012 at 5:00 AM, LyX Ticket Tracker  wrote:
> #7760: Windows: lyx-bundle fails; babel missing
> ---+-
>  Reporter:  pauljohn32         |       Owner:  uwestoehr
>     Type:  defect             |      Status:  closed
>  Priority:  normal             |   Milestone:
> Component:  windows-installer  |     Version:  2.0.0
>  Severity:  normal             |  Resolution:  worksforme
>  Keywords:                     |
> ---+-
> Changes (by uwestoehr):
>
>  * status:  new => closed
>  * resolution:   => worksforme
>
>
> Comment:
>
>  Please checkout this installer (which will become LyX's new one for the
>  next release):
>  https://sourceforge.net/projects/lyxwininstaller/
>  If you encounter problems, please reopen this bug report.
>
> --
> Ticket URL: 
> The LyX Project 
> LyX -- The Document Processor



-- 
Paul E. Johnson
Professor, Political Science    Assoc. Director
1541 Lilac Lane, Room 504     Center for Research Methods
University of Kansas               University of Kansas
http://pj.freefaculty.org            http://quant.ku.edu


Bug 4796

2012-03-12 Thread Richard Heck

On 03/12/2012 03:46 AM, Guenter Milde wrote:

On 2012-03-11, Richard Heck wrote:


[-- Type: text/plain, Encoding: 7bit --]
On 03/11/2012 04:46 AM, Zohair ABU SHABAN wrote:

Sure ... here's an example. Please see the attachment. Cheers.

This is the normal way lists are styled in most document classes. If you
want to change it, then you need to redefine the enumerate environment
(in this case). Probably the easiest way to do this is to use the
enumitem package, which has commands to do almost everything list
related. That said, there is a good reason lists are styled that way:
It's good typography.

However, with
   Document>Settings>Text Layout>separate paragraphs by [*] indentation,
LyX puts too much space around lists because it
increases \parskip without correcting dependend values.

This is a known bug: http://www.lyx.org/trac/ticket/4796

This looks like it ought to be easy to fix, yes? Does anyone know of 
reason not to do as Guenter there suggests? Presumably, this should be 
for trunk only, as we don't want to change this aspect of output at a 
maintenance release.


Richard



Re: Updates to gitolite progress

2012-03-12 Thread Abdelrazak Younes
On Mon, Mar 12, 2012 at 1:03 PM, Vincent van Ravesteijn  wrote:
> Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

First of all, thank you for this work Lars, this is a truly great
achievement :-)

>> If we want to introduce a staging repo and can also be done, but we
>> shouldn't change to much at the same time.

I strongly think that one repo per developper is way too complicated.

> Usually it is quite problematic to have a fellow developer to look at your
> proposed changes. Especially if the developers should look at ten different
> repositories.
>
> That's why I would like a staging branch/repo. To have a single place where
> all the finished but not yet pushed work can be found.

Fully agreed. I've tried both methods withing my team at work (using
mercurial not git but the idea is the same). Initially, one branch per
developper is really the way to go: It's easy to understand and to
follow:

You just do like you did with svn but committing only to your personal
branch. The only 2 additional steps is to merge from lyx-devel from
time to time. The lyx-devel maintainer will actually take care of
merging your personal branch to lyx-devel.

> Also, I would say it would be ok to rewrite the history in your personal
> branch. People should not base work on your personal branch. It's one of the
> advantages of git, that you can "publish" the work, that people can comment
> on it, and you reshape it before pushing it to the main repo/branch.

Agreed. But I actually think that the main repo should be pushed only
by the current maintainers: Richard and Vincent.
I would go even further:

The main repo would be automatically synchronized (only the 2.0 and
2.1 branches); either via a git hook or a cron script at server side.
The cron idea is better if only we had some automatic regression
testing in place. Then only those commits that passes regression on
the cooking repo would be pushed to the main repo.

Cheer,
Abdel.


Re: Updates to gitolite progress

2012-03-12 Thread Rob Oakes

On Mar 12, 2012, at 10:59 AM, Abdelrazak Younes wrote:

> The main repo would be automatically synchronized (only the 2.0 and
> 2.1 branches); either via a git hook or a cron script at server side.
> The cron idea is better if only we had some automatic regression
> testing in place. Then only those commits that passes regression on
> the cooking repo would be pushed to the main repo.

Would it be possible to have the main repo also synchronized with the existing 
SVN? git-svn can transparently push right to an SVN repository. That would 
prevent a lot of things from breaking. For example, I've been keeping a mirror 
of SVN on Launchpad that I use for development, testing, and (hopefully) daily 
builds. Retooling this mirror to pull from git would require re-importing the 
whole thing (a multi-day affair).

If there is any way to keep our current SVN branch active with the "canonical" 
developer sources, that would be a wonderful thing. (Even if most of the 
development is happening in git.)

Cheers,

Rob

Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 11-3-2012 22:43, Richard Heck schreef:

On 03/11/2012 05:37 PM, Richard Heck wrote:

On 03/11/2012 12:59 PM, Lars Gullik Bjønnes wrote:

lar...@gullik.org (Lars Gullik Bjønnes) writes:

| | 5. Enable the new lyx-devel git repo at git.lyx.org.

The new repo has been made available to developers, and the git
installation has opend up for developers to create their own repos and
forks.

Developers that have registered their public keys can clone the repo 
by:


git clone g...@git.lyx.org:lyx

Just so I understand where we are: This is just devel, or are the 
branches also supposed to be in here? If so, where are they?



Ahh, I see it now: git co 2.0.x will do what I wanted.



If you want a tree for both 2.0.x and 2.1.0svn, you can do the following:

Assume you have a git clone in /lyx, you can clone this with

git clone -s -b 2.0.x /lyx /lyx20x

This will clone your repo, but it will reuse the objects. This means 
that the second repo is much smaller than the first one.


Vincent


Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 18:15, Rob Oakes schreef:

On Mar 12, 2012, at 10:59 AM, Abdelrazak Younes wrote:


The main repo would be automatically synchronized (only the 2.0 and
2.1 branches); either via a git hook or a cron script at server side.
The cron idea is better if only we had some automatic regression
testing in place. Then only those commits that passes regression on
the cooking repo would be pushed to the main repo.

Would it be possible to have the main repo also synchronized with the existing 
SVN? git-svn can transparently push right to an SVN repository.


Not anymore, the HEAD of the git repo has a different sha1 as the svn 
repo imported by git-svn. This because some tags and strange commits 
have been corrected in the git repo.



That would prevent a lot of things from breaking. For example, I've been 
keeping a mirror of SVN on Launchpad that I use for development, testing, and 
(hopefully) daily builds. Retooling this mirror to pull from git would require 
re-importing the whole thing (a multi-day affair).


Would it be really a multi-day affair ? Cloning the git repo is done 
within a minute, and you have the whole history with it.


Vincent


Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

   - fork the lyx repo:
  $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx


My personal repo does not appear in gitweb. Is it supposed to ?

Vincent


Re: Updates to gitolite progress

2012-03-12 Thread Lars Gullik Bjønnes
Vincent van Ravesteijn  writes:

| Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:
>>- fork the lyx repo:
>>   $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx
>
| My personal repo does not appear in gitweb. Is it supposed to ?

It will only appear there if you give "gitweb" read access.

-- 
   Lgb



Re: Updates to gitolite progress

2012-03-12 Thread Lars Gullik Bjønnes
Vincent van Ravesteijn  writes:

| Op 11-3-2012 22:43, Richard Heck schreef:
>> On 03/11/2012 05:37 PM, Richard Heck wrote:
>>> On 03/11/2012 12:59 PM, Lars Gullik Bjønnes wrote:
 lar...@gullik.org (Lars Gullik Bjønnes) writes:

 | | 5. Enable the new lyx-devel git repo at git.lyx.org.

 The new repo has been made available to developers, and the git
 installation has opend up for developers to create their own repos and
 forks.

 Developers that have registered their public keys can clone the
 repo by:

 git clone g...@git.lyx.org:lyx

>>> Just so I understand where we are: This is just devel, or are the
>>> branches also supposed to be in here? If so, where are they?
>>>
>> Ahh, I see it now: git co 2.0.x will do what I wanted.
>>
>
| If you want a tree for both 2.0.x and 2.1.0svn, you can do the following:
>
| Assume you have a git clone in /lyx, you can clone this with
>
| git clone -s -b 2.0.x /lyx /lyx20x
>
| This will clone your repo, but it will reuse the objects. This means
| that the second repo is much smaller than the first one.

Note that when using shared repos (-s), if you delete the first one the
second one dies as well.

If you just do a clone, you still get a massive (initial) space saving
sine git will just hardlinks to duplicate objects.

-- 
   Lgb



Re: Updates to gitolite progress

2012-03-12 Thread Vincent van Ravesteijn

Op 12-3-2012 20:17, Lars Gullik Bjønnes schreef:

Vincent van Ravesteijn  writes:

| Op 12-3-2012 0:44, Lars Gullik Bjønnes schreef:

- fork the lyx repo:
   $ ssh g...@git.lyx.org fork lyx developers/larsbj/lyx

| My personal repo does not appear in gitweb. Is it supposed to ?

It will only appear there if you give "gitweb" read access.


Thank you.

Vincent


Re: citation bug?

2012-03-12 Thread Julien Rioux

On 10/03/2012 8:20 AM, Georg Baum wrote:

The roundtrip output of one of the tex2lyx tests has changed recently:

tex2lyx -roundtrip src/tex2lyx/test/test-insets.tex

will produce src/tex2lyx/test/test-insets.lyx.lyx and src/tex2lyx/test/test-
insets.lyx.tex. If you compare these files with the ones created about 3
weeks ago, you'll get identical .lyx.lyx files, but the attached differences
in the .lyx.tex files (ignoring the differences coming from the changed
src/tex2lyx/test/test-insets.tex file itself).



Interesting. Do we have some infrastructure in place to do such 
comparison tests, or is it just something that you run locally from time 
to time? Would be good to do such checks as part of testing features in 
a staging branch, if we end up using this workflow.



If this changed output is intended it would be a file format change, since
the same .lyx file produces now different .tex. Otherwise it is a bug. Maybe
special treatment of the citatiuon modules is needed in tex2lyx?


Georg



It's a bug in the old implementation: there are no [before] or [after] 
optional arguments to \citeauthor and \citeyear when using natbib 
numerical style. Natbib will gobble those for you, so it doesn't lead to 
latex compilation errors, but it was wrong of LyX to pretend that you 
can have them. This kind of customization at the \citecommand level was 
not possible before, but is now implemented in r40820. It is not a 
fileformat change, since generated dvi/pdf are the same. I also don't 
think that any changes to tex2lyx are necessary in this case, as it is 
doing the right thing in gobbling the options just like natbib does.


Regards,
Julien



Re: Windows Installer could use work: must set miktex packages "on fly" to NO, or else LyX won't run

2012-03-12 Thread Vincent van Ravesteijn




Especially in your installer, you change MikTeX's setting, which is 
just rude and forces me to wait.


I explained several times in detail why this is the best solution ...


Yes, but I find it unethical. I choose to set MikTeX to "Ask me" and you 
just override this. Tomorrow you decide to upgrade my Windows 98 to 
Windows 8 without asking me.


My goal is to have an installer that just does everything for you, so 
no need to know the internals of LaTeX. When I started with the 
Windows installer I said that my goal is to send my mother a link 
where she can click on. In the installer she can click Next several 
times and afterwards can start using LyX. She doesn't know any 
internals how programs and the PC works but she don't need to. 
Everything will be in shape and she can directly start writing. And 
this works with my installer!


So, why can't we have a checkbox: "Don't check for installed MikTeX 
packages (don't change this if you don't know what a MikTeX package is 
and if you're not an expert)" which is turned on by default but which 
allows me to skip this checking.


regards Uwe


Vincent


Re: #8006: LyX shows "Error converting to loadable format" on PDF figures

2012-03-12 Thread Vincent van Ravesteijn



You misunderstood. I just compiled the 'official' installer.


Does it come with GhostScript 9.05 and the latest ImageMagick? If yes, 
how did you manage that ImageMagick could be installer when the user 
decides to install LyX without admin privileges?


 just took an older ImageMagick version from Joost from a previous 
windows installer.


Vincent


Re: citation bug?

2012-03-12 Thread Julien Rioux

On 10/03/2012 10:47 AM, Richard Heck wrote:

On 03/10/2012 08:20 AM, Georg Baum wrote:

Maybe
special treatment of the citatiuon modules is needed in tex2lyx?


Probably so. This seems kind of familiar from our experience with the
theorem modules.

Richard




Down the road, it would be nice to detect the citation engine by using 
whatever trick is used right now to detect that a specific \usepackage 
line should add a specific module, instead of hardcoding a list of 
modules. I don't know enough about this to do it just yet, but it's 
definitely a wishlist item.


Regards,
Julien



Development of 2012

2012-03-12 Thread Vincent van Ravesteijn
The following branch merges all features that were introduced in 2012 on 
top of a trunk-stable set at 31-12-2011:


http://git.lyx.org/?p=developers/vfr/lyx.git;a=shortlog;h=refs/heads/trunk-devel

Vincent


Re: #7760: Windows: lyx-bundle fails; babel missing

2012-03-12 Thread Uwe Stöhr

Am 12.03.2012 15:50, schrieb Paul Johnson:


How many of you have tried the Windows installer bundle on a clean
Windows 7 system?


At least me.
Have you ever tested the new installer?:
http://sourceforge.net/projects/lyxwininstaller/files/LyXWinInstaller/2.0.3/


I used 7zip to open the LyX installer bundle.


How can you do that and why do you do this?
The bundle installer is an executable. Simply execute it and do nothing more.

regards Uwe


Re: [patch] fix #8066 for branch - tex2lyx support for listings

2012-03-12 Thread Uwe Stöhr

Am 10.03.2012 13:54, schrieb Georg Baum:


I would not put it in branch right now (see my other mail for details). I
would rather like to see a better aproach (reading with changed catcodes or
character by character) mature a bit in trunk before it is backported.


I'm fine with a better approach but the patch improves the import of listings already enormously. 
Currently listings are not imported and with my patch they are. OK, special cases like "%" might 
fail but better than nothing. The new approach can later be backported without problems.


I don't understand your concerns because the special cases already fail in tex2lyx in branch and my 
patch does not make this worse it even fixes bugs like bug #8065.


regards Uwe


Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr

Am 10.03.2012 13:53, schrieb Georg Baum:


Yes. Unfortunately this is not done, since special properties of characters
like % are already handled in the tokenize phase. For example,

\begin{verbatim}
x
%\end{verbatim}

is not handled correctly, since tex2lyx believes that %\end{verbatim} is a
comment.


OK, but these cases seem a bit constructed. Who will uses such things in practice? For example in a 
listings inset I bet nobody ever.
But sure, if we can handle such cases, we should do so. I'm technically too limited in respect to 
catcodes and would leave this to you. OK?


thanks and regards
Uwe


Re: r40785 - in lyx-devel/trunk/src: . tex2lyx

2012-03-12 Thread Uwe Stöhr

Am 10.03.2012 14:03, schrieb Georg Baum:


The special language option handling looks fragile. I believe it will work
without the special code if you use p.verbatimOption() instead of
p.getArg().


Thanks, this works. I will commit as soon as the git transformation is ready and committing is 
possible again.


regards Uwe


Re: [patch] fix #8066 for branch - tex2lyx support for listings

2012-03-12 Thread Uwe Stöhr

Attached is a better patch with the improvements proposed by Georg.

regards Uwe
Index: Parser.cpp
===
--- Parser.cpp	(revision 40911)
+++ Parser.cpp	(working copy)
@@ -481,6 +481,49 @@
 }
 
 
+string const Parser::plainEnvironment(string const & name)
+{
+	if (!good())
+		return string();
+
+	ostringstream os;
+	for (Token t = get_token(); good(); t = get_token()) {
+		if (t.asInput() == "\\end") {
+			string const end = getArg('{', '}');
+			if (end == name)
+return os.str();
+			else
+os << "\\end{" << end << '}';
+		} else
+			os << t.asInput();
+	}
+	cerr << "unexpected end of input" << endl;
+	return os.str();
+}
+
+
+string const Parser::plainCommand(char left, char right, string const & name)
+{
+	if (!good())
+		return string();
+	// ceck if first token is really the start character
+	Token tok = get_token();
+	if (tok.character() != left) {
+		cerr << "first character does not match start character of command \\" << name << endl;
+		return string();
+	}
+	ostringstream os;
+	for (Token t = get_token(); good(); t = get_token()) {
+		if (t.character() == right) {
+			return os.str();
+		} else
+			os << t.asInput();
+	}
+	cerr << "unexpected end of input" << endl;
+	return os.str();
+}
+
+
 void Parser::tokenize_one()
 {
 	catInit();
Index: Parser.h
===
--- Parser.h	(revision 40911)
+++ Parser.h	(working copy)
@@ -196,6 +196,19 @@
 	 * is parsed but not returned.
 	 */
 	std::string const verbatimEnvironment(std::string const & name);
+	/*
+	 * The same as verbatimEnvironment(std::string const & name) but
+	 * \begin and \end commands inside the name environment are not parsed.
+	 * This function is designed to parse verbatim environments.
+	 */
+	std::string const plainEnvironment(std::string const & name);
+	/*
+	 * Basically the same as plainEnvironment(std::string const & name) but
+	 * instead of \begin and \end commands the parsing is started/stopped
+	 * at given characters.
+	 * This function is designed to parse verbatim commands.
+	 */
+	std::string const plainCommand(char left, char right, std::string const & name);
 	/*!
 	 * Returns the character of the current token and increments
 	 * the token position.
Index: test/test-insets.tex
===
--- test/test-insets.tex	(revision 40911)
+++ test/test-insets.tex	(working copy)
@@ -156,6 +156,42 @@
 \listoftables
 
 
+\section{Listings}
+
+Inline: \lstinline[language={C++}]!int a=5;!\\
+Float:
+
+\begin{lstlisting}[caption={Example Listing float},label={lst:Example-Listing},language=Python]
+# Example listing float
+def func(param):
+'this is a python function'
+pass
+\end{lstlisting}
+
+Here is an example listing with left line numbering, step ``3'',
+language ``Python'', options ``Extended character table'' and
+``Space~as~symbol'', range lines 3\,-\,8:
+
+\begin{lstlisting}[extendedchars=true,firstline=3,language=Python,lastline=8,numbers=left,showspaces=true,stepnumber=3]
+def func(param):
+'this is a python function'
+pass
+def func(param):
+'This is a German word: Tschüß'
+pass
+def func(param):
+'this is a python function'
+pass
+\end{lstlisting}
+
+Special cases:
+\begin{lstlisting}[abovecaptionskip=2em,basicstyle={\large\ttfamily},breaklines=true,extendedchars=true,firstline=2,float=h,language={[R/3 3.1]ABAP},lastline=5,numbers=left,numberstyle={\scriptsize},showspaces=true,showstringspaces=false,stepnumber=3,tabsize=4]
+hello
+\end{lstlisting}
+
+\lstinline[language=TeX]!\begin{centering} hello!
+
+
 \section{Graphics\index{Graphics}}
 
 There is also some basic support for graphics, in the form
Index: text.cpp
===
--- text.cpp	(revision 40911)
+++ text.cpp	(working copy)
@@ -1110,16 +1110,28 @@
 }
 
 
-void parse_listings(Parser & p, ostream & os, Context & parent_context)
+void parse_listings(Parser & p, ostream & os, Context & parent_context, bool in_line)
 {
 	parent_context.check_layout(os);
 	begin_inset(os, "listings\n");
-	os << "inline false\n"
-	   << "status collapsed\n";
+	if (p.hasOpt()) {
+		string arg = p.verbatimOption();
+		os << "lstparams " << '"' << arg << '"' << '\n';
+	}
+	if (in_line)
+		os << "inline true\n";
+	else
+		os << "inline false\n";
+	os << "status collapsed\n";
 	Context context(true, parent_context.textclass);
 	context.layout = _context.textclass.plainLayout();
-	context.check_layout(os);
-	string const s = p.verbatimEnvironment("lstlisting");
+	string s;
+	if (in_line) {
+		s = p.plainCommand('!', '!', "lstinline");
+		context.new_paragraph(os);
+		context.check_layout(os);
+	} else
+		s = p.plainEnvironment("lstlisting");
 	for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
 		if (*it == '\\')
 			os << "\n\\backslash\n";
@@ -1352,14 +1364,9 @@
 
 	else if (name == "lstlisting") {
 		

Qt::setWindowModified(), "[*]" title placeholder, and icon buttons "reaction" to modified buffer(s) (was: Re: #8054: Awkward to search backwards in text)

2012-03-12 Thread Tommaso Cucinotta

Il 10/03/2012 13:30, Stephan Witt ha scritto:

Am 09.03.2012 um 01:31 schrieb Jerry:


Another problem with the colored buttons. A black dot in the red button 
indicates that a document has been edited but not saved to disk. Here are the 
two versions for a focused and unfocused window:



and after saving:



LyX does not do this--the main document button are always



Attached is a patch to solve that problem.


This produces an ugly warning on the output because if you use the 
setWindowModified(), Qt complains about not finding in the windowTitle() 
the "[*]" sequence. The attached patch suppresses these warnings 
inserting always that "[*]" placeholder (docs say the * is not displayed 
if the setModified() is set to false so it seems safe to add it always).


However, I can spot similarities and/or duplication of functionality 
with GuiWorkArea.cpp, specifically where you see the calls to 
Buffer::isClean() and the addition of the " (changed)" suffix to the 
file name in tab titles. Specifically, check whether the iteration you 
do in GuiView::isClean() is the same or different from the one made in 
GuiWorkArea::updateWindowTitle().
I'd say at a glance that LyX made the choice to not rely on the 
"standard" *-based indication of a modified buffer, but rather used its 
own custom " (changed)" title suffix. However, I have no objections to 
using a more widely used and (Qt-level) standardized indication of the 
modified buffer.


I'm replying with a more insightful title, perhaps others will comment 
better on this point.


T.

Index: src/frontends/qt4/GuiView.cpp
===
--- src/frontends/qt4/GuiView.cpp	(revisione 40911)
+++ src/frontends/qt4/GuiView.cpp	(copia locale)
@@ -303,17 +303,17 @@
 		bg_widget_->setFocus();
 	}
 
-	int tabWorkAreaCount()
+	int tabWorkAreaCount() const
 	{
 		return splitter_->count();
 	}
 
-	TabWorkArea * tabWorkArea(int i)
+	TabWorkArea * tabWorkArea(int i) const
 	{
 		return dynamic_cast(splitter_->widget(i));
 	}
 
-	TabWorkArea * currentTabWorkArea()
+	TabWorkArea * currentTabWorkArea() const
 	{
 		int areas = tabWorkAreaCount();
 		if (areas == 1)
@@ -342,6 +342,16 @@
 	}
 #endif
 
+	bool isClean() const
+	{
+		QVector areas = guiWorkAreas();
+		bool result = true;
+		for (int i = 0; i < areas.size(); ++i) {
+			result &= areas[i]->bufferView().buffer().isClean();
+		}
+		return result;
+	}
+	
 public:
 	GuiView * gv_;
 	GuiWorkArea * current_work_area_;
@@ -408,7 +418,7 @@
    Buffer::ExportStatus (Buffer::*syncFunc)(string const &, bool) const,
    Buffer::ExportStatus (Buffer::*previewFunc)(string const &) const);
 
-	QVector guiWorkAreas();
+	QVector guiWorkAreas() const;
 };
 
 QSet GuiView::GuiViewPrivate::busyBuffers;
@@ -523,7 +533,7 @@
 }
 
 
-QVector GuiView::GuiViewPrivate::guiWorkAreas()
+QVector GuiView::GuiViewPrivate::guiWorkAreas() const
 {
 	QVector areas;
 	for (int i = 0; i < tabWorkAreaCount(); i++) {
@@ -1015,8 +1025,9 @@
 	if (wa != d.current_work_area_
 		|| wa->bufferView().buffer().isInternal())
 		return;
-	setWindowTitle(qt_("LyX: ") + wa->windowTitle());
+	setWindowTitle(qt_("LyX: ") + wa->windowTitle() + qt_("[*]"));
 	setWindowIconText(wa->windowIconText());
+	setWindowModified(!d.isClean());
 }
 
 


[patch] full support for table cell rotation

2012-03-12 Thread Uwe Stöhr
Since ages LyX supports to rotate table cells, but for an unknown reason it only supports rotation 
by 90°. The LaTeX command LyX is using for this is "rotating" and this package already provides 
support to rotate by any angle thus LyX can easily offer that too.


The attached patch implements this. This would be a fileformat change. OK?
(the necessary tex2lyx change follows)

regards Uwe
Index: lib/lyx2lyx/lyx_2_1.py
===
--- lib/lyx2lyx/lyx_2_1.py	(revision 40911)
+++ lib/lyx2lyx/lyx_2_1.py	(working copy)
@@ -573,6 +573,66 @@
 i = j
 
 
+def revert_cell_rotation(document):
+  "Revert cell rotations to TeX-code"
+
+  load_rotating = False
+  i = 0
+  try:
+while True:
+  # first, let's find out if we need to do anything
+  # cell type 3 is multirow begin cell
+  i = find_token(document.body, '
@@ -144,6 +145,8 @@
 		this, SLOT(checkEnabled()));
 	connect(rotateCellCB, SIGNAL(clicked()),
 		this, SLOT(checkEnabled()));
+	connect(rotateCellAngleSB, SIGNAL(valueChanged(int)),
+		this, SLOT(checkEnabled()));
 	connect(TableAlignCO, SIGNAL(activated(int)),
 		this, SLOT(checkEnabled()));
 	connect(longTabularCB, SIGNAL(clicked()),
@@ -218,6 +221,8 @@
 	bool const is_tabular_star = !tabularWidthED->text().isEmpty();
 	rotateTabularCB->setDisabled(is_tabular_star);
 
+	rotateCellAngleSB->setEnabled(rotateCellCB->isChecked());
+
 	bool const enable_valign =
 		!multirowCB->isChecked()
 		&& !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
@@ -555,11 +560,12 @@
 		setParam(param_str, Tabular::SET_ROTATE_TABULAR);
 	else
 		setParam(param_str, Tabular::UNSET_ROTATE_TABULAR);
-	//
+	// store the cell rotation angle
+	string angle = convert(rotateCellAngleSB->value());
 	if (rotateCellCB->isChecked())
-		setParam(param_str, Tabular::SET_ROTATE_CELL);
+		setParam(param_str, Tabular::SET_ROTATE_CELL, angle);
 	else
-		setParam(param_str, Tabular::UNSET_ROTATE_CELL);
+		setParam(param_str, Tabular::UNSET_ROTATE_CELL, angle);
 	//
 	if (longTabularCB->isChecked())
 		setParam(param_str, Tabular::SET_LONGTABULAR);
@@ -695,7 +701,11 @@
 	bool const multirow = tabular.isMultiRow(cell);
 	multirowCB->setChecked(multirow);
 
-	rotateCellCB->setChecked(tabular.getRotateCell(cell));
+	rotateCellCB->setChecked(tabular.getRotateCell(cell) != 0);
+	if (tabular.getRotateCell(cell) != 0)
+		rotateCellAngleSB->setValue(tabular.getRotateCell(cell));
+	else
+		rotateCellAngleSB->setValue(90);
 	rotateTabularCB->setChecked(tabular.rotate);
 
 	longTabularCB->setChecked(tabular.is_long_tabular);
Index: src/frontends/qt4/ui/TabularUi.ui
===
--- src/frontends/qt4/ui/TabularUi.ui	(revision 40911)
+++ src/frontends/qt4/ui/TabularUi.ui	(working copy)
@@ -1,3 +1,4 @@
+
 
  TabularUi
  
@@ -5,7 +6,7 @@

 0
 0
-433
+497
 400

   
@@ -19,6 +20,77 @@

 0

+   
+
+ 
+  
+   
+Current cell:
+   
+  
+ 
+ 
+  
+   
+
+ 0
+ 0
+
+   
+   
+
+ 40
+ 32767
+
+   
+   
+Qt::NoFocus
+   
+   
+Current row position
+   
+  
+ 
+ 
+  
+   
+
+ 0
+ 0
+
+   
+   
+
+ 40
+ 32767
+
+   
+   
+Qt::NoFocus
+   
+   
+Current column position
+   
+  
+ 
+ 
+  
+   
+Qt::Horizontal
+   
+   
+QSizePolicy::Expanding
+   
+   
+
+ 20
+ 20
+
+   
+  
+ 
+
+   

 
  
@@ -235,77 +307,6 @@
  
 

-   
-
- 
-  Row setting
- 
- 
-  
-   
-
- Merge cells of different rows
-
-
- Multirow
-
-   
-  
-  
-   
-
- 
-  
-   
-  
-  
-   Vertical Offset:
-  
-  
-   multirowOffsetED
-  
- 
-
-
- 
-  
-   true
-  
-  
-   Optional vertical offset
-  
-  
-   
-  
- 
-
-
- 
-
-   
-  
- 
-
-   
-   
-
- 
-  Cell setting
- 
- 
-  
-   
-
- Rotate this cell by 90 degrees
-
-
- Rotate cell 90 degrees
-
-   
-  
- 
-
-   

 
  
@@ -415,6 +416,129 @@
   

Re: Qt::setWindowModified(), "[*]" title placeholder, and icon buttons "reaction" to modified buffer(s)

2012-03-12 Thread Jean-Marc Lasgouttes

Le 12/03/2012 23:06, Tommaso Cucinotta a écrit :

Il 10/03/2012 13:30, Stephan Witt ha scritto:

Am 09.03.2012 um 01:31 schrieb Jerry:


Another problem with the colored buttons. A black dot in the red
button indicates that a document has been edited but not saved to
disk. Here are the two versions for a focused and unfocused window:


FWIW, I propose a similar patch in July, but it was put on hold because 
with display other pieces of information in the title.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg170106.html

JMarc



Re: [patch] full support for table cell rotation

2012-03-12 Thread Uwe Stöhr

Am 12.03.2012 23:07, schrieb Uwe Stöhr:


The attached patch implements this. This would be a fileformat change. OK?
(the necessary tex2lyx change follows)


Now the tex2lyx part is included.

tex2lyx btw. never supported rotated table cells and has a bug (#8081).

regards Uwe
Index: lib/lyx2lyx/lyx_2_1.py
===
--- lib/lyx2lyx/lyx_2_1.py	(revision 40911)
+++ lib/lyx2lyx/lyx_2_1.py	(working copy)
@@ -573,6 +573,66 @@
 i = j
 
 
+def revert_cell_rotation(document):
+  "Revert cell rotations to TeX-code"
+
+  load_rotating = False
+  i = 0
+  try:
+while True:
+  # first, let's find out if we need to do anything
+  # cell type 3 is multirow begin cell
+  i = find_token(document.body, '
@@ -144,6 +145,8 @@
 		this, SLOT(checkEnabled()));
 	connect(rotateCellCB, SIGNAL(clicked()),
 		this, SLOT(checkEnabled()));
+	connect(rotateCellAngleSB, SIGNAL(valueChanged(int)),
+		this, SLOT(checkEnabled()));
 	connect(TableAlignCO, SIGNAL(activated(int)),
 		this, SLOT(checkEnabled()));
 	connect(longTabularCB, SIGNAL(clicked()),
@@ -218,6 +221,8 @@
 	bool const is_tabular_star = !tabularWidthED->text().isEmpty();
 	rotateTabularCB->setDisabled(is_tabular_star);
 
+	rotateCellAngleSB->setEnabled(rotateCellCB->isChecked());
+
 	bool const enable_valign =
 		!multirowCB->isChecked()
 		&& !widgetsToLength(columnWidthED, columnWidthUnitLC).empty()
@@ -555,11 +560,12 @@
 		setParam(param_str, Tabular::SET_ROTATE_TABULAR);
 	else
 		setParam(param_str, Tabular::UNSET_ROTATE_TABULAR);
-	//
+	// store the cell rotation angle
+	string angle = convert(rotateCellAngleSB->value());
 	if (rotateCellCB->isChecked())
-		setParam(param_str, Tabular::SET_ROTATE_CELL);
+		setParam(param_str, Tabular::SET_ROTATE_CELL, angle);
 	else
-		setParam(param_str, Tabular::UNSET_ROTATE_CELL);
+		setParam(param_str, Tabular::UNSET_ROTATE_CELL, angle);
 	//
 	if (longTabularCB->isChecked())
 		setParam(param_str, Tabular::SET_LONGTABULAR);
@@ -695,7 +701,11 @@
 	bool const multirow = tabular.isMultiRow(cell);
 	multirowCB->setChecked(multirow);
 
-	rotateCellCB->setChecked(tabular.getRotateCell(cell));
+	rotateCellCB->setChecked(tabular.getRotateCell(cell) != 0);
+	if (tabular.getRotateCell(cell) != 0)
+		rotateCellAngleSB->setValue(tabular.getRotateCell(cell));
+	else
+		rotateCellAngleSB->setValue(90);
 	rotateTabularCB->setChecked(tabular.rotate);
 
 	longTabularCB->setChecked(tabular.is_long_tabular);
Index: src/frontends/qt4/ui/TabularUi.ui
===
--- src/frontends/qt4/ui/TabularUi.ui	(revision 40911)
+++ src/frontends/qt4/ui/TabularUi.ui	(working copy)
@@ -1,3 +1,4 @@
+
 
  TabularUi
  
@@ -5,7 +6,7 @@

 0
 0
-433
+497
 400

   
@@ -19,6 +20,77 @@

 0

+   
+
+ 
+  
+   
+Current cell:
+   
+  
+ 
+ 
+  
+   
+
+ 0
+ 0
+
+   
+   
+
+ 40
+ 32767
+
+   
+   
+Qt::NoFocus
+   
+   
+Current row position
+   
+  
+ 
+ 
+  
+   
+
+ 0
+ 0
+
+   
+   
+
+ 40
+ 32767
+
+   
+   
+Qt::NoFocus
+   
+   
+Current column position
+   
+  
+ 
+ 
+  
+   
+Qt::Horizontal
+   
+   
+QSizePolicy::Expanding
+   
+   
+
+ 20
+ 20
+
+   
+  
+ 
+
+   

 
  
@@ -235,77 +307,6 @@
  
 

-   
-
- 
-  Row setting
- 
- 
-  
-   
-
- Merge cells of different rows
-
-
- Multirow
-
-   
-  
-  
-   
-
- 
-  
-   
-  
-  
-   Vertical Offset:
-  
-  
-   multirowOffsetED
-  
- 
-
-
- 
-  
-   true
-  
-  
-   Optional vertical offset
-  
-  
-   
-  
- 
-
-
- 
-
-   
-  
- 
-
-   
-   
-
- 
-  Cell setting
- 
- 
-  
-   
-
- Rotate this cell by 90 degrees
-
-
- Rotate cell 90 degrees
-
-   
-  
- 
-
-   

 
  
@@ -415,6 +416,129 @@
  
 

+   
+
+ 
+  Row setting
+ 
+ 
+  

Copy'n'Paste without modifying Clipboard

2012-03-12 Thread Tommaso Cucinotta

Hi,

does anyone have a hint on the code needed to copy the current selection 
from one buffer and paste it into another buffer, without affecting the 
user's clipboard ?


On a related note, what is the "Cut stack" ?

Also, is it true that all of these paste methods [1] (from 
CutAndPaste.h) work only in text mode ?


What is the simplest way to copy a segment of LyX text (inclusive of 
maths and whatever may be there), and paste it into another LyX buffer, 
just emulating C-c followed by C-v ?


Thanks,

T.

[1]
/// Paste the current selection at \p cur
/// Does handle undo. Does only work in text, not mathed.
void pasteSelection(Cursor & cur, ErrorList &);
/// Replace the current selection with the clipboard contents as text
/// (internal or external: which is newer).
/// Does handle undo. Does only work in text, not mathed.
void pasteClipboardText(Cursor & cur, ErrorList & errorList,
bool asParagraphs = true);
/// Replace the current selection with the clipboard contents as graphic.
/// Does handle undo. Does only work in text, not mathed.
void pasteClipboardGraphics(Cursor & cur, ErrorList & errorList,
Clipboard::GraphicsType preferedType = Clipboard::AnyGraphicsType);
/// Replace the current selection with cut buffer \c sel_index
/// Does handle undo. Does only work in text, not mathed.
void pasteFromStack(Cursor & cur, ErrorList & errorList, size_t sel_index);
/// Paste the clipboard as simple text, removing any formatting
void pasteSimpleText(Cursor & cur, bool asParagraphs);

/// Paste the paragraph list \p parlist at the position given by \p cur.
/// Does not handle undo. Does only work in text, not mathed.
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
DocumentClass const * const textclass, ErrorList & errorList);



Re: #8006: LyX shows "Error converting to loadable format" on PDF figures

2012-03-12 Thread Uwe Stöhr

Am 12.03.2012 20:43, schrieb Vincent van Ravesteijn:


just took an older ImageMagick version from Joost from a previous windows 
installer.


Joost recompiled ImageMagick specially to overcome the admin restriction. I tried to get him to 
share his workaround with the IM people but he did not reply :-(
The problem is that we cannot build our own versions with every IM release and compared to the 
version in your installer the latest IM contains many security fixes. So in my opinion providing on 
old IM is a security problem.


but perhaps this week I find time to check out if the new IM does now work 
without admin privileges.

regards Uwe