Bernhard Reiter
2005-10-04 22:07:12 UTC
being one of those apparently sometimes popping-by gtk afficionado lyx
users and trying to get myself in touch with the gtk part of the lyx
sources, i spent sunday evening putting together the thesaurus dialog
for gtk. this is my first contact with both the lyx sources and gtk
programming (and in fact my first [wannabe] contribution to an open
source project), so please spare me if my work isn't flawless... the
thesaurus dialog seemed kinda ok for the beginning as it wasn't horribly
complex and hasn't yet been checked off on your guii page...
screenshot: Loading Image...
i had some trouble using cvs diff (another first-time experience) -- i
don't know how to deal with newly generated local files that aren't in
cvs yet, so there are three of them in the attached archive (.C and .h
go to src/frontends/gtk/, .glade to src/frontends/gtk/glade/) plus one
patch adding them to Dialogs.C, Makefile.am and Changelog. i hope i
didn't miss anything...
there is some change in the ui i'd like to point out compared to the
xforms and qt equivalent: i chose a cancel/apply/ok kind of dialog over
the replace/close approach (with the buttons on top of each other which
i really found a little strange); i also removed the lower 'Selection'
textbox (left to the replace button) as it only seemed to be helpful
with xforms where the current item in the listbox is not highlighted
(with gtk, it seemed just confusing). i hope there wasn't any
sophisticated detail about that approach that i overlooked... in case
you're missing the word "replace", i'd suggest changing the apply button
caption, but still leaving it in the lower row...
out of a first try, synonym lists are also altered while typing. this
works without any latency on my machine (1.4 ghz), but if that's causing
anybody's worries, changing the signal handler shouldn't be too
difficult...
i hope this implementation makes the dialog a bit more intuitive,
consistent and comfortable to use (e.g.: if no synonym in the list is
selected, e.g., but there is some text in the upper textbox ('entry' in
gtk jargon), 'apply' can be clicked and will use that text)
working on this, i'm afraid i stumbled over a bug in the thesaurus
controller (but didn't do enough research to be able to cure it):
1. highlight some word in the main window
2. open the thesaurus dialog, choose a synonym and click replace
3. choose another synonym, click replace again - it won't work
i checked this with the qt frontend. same thing, so it's apparently in
the controller's replace function... (didn't look any further into that,
admittedly...)
i like lyx (i've been using it 'in the field' last semester for
live-typing a math lecture for my physics studies and parts of a
theoretical physics one, see http://www.unet.univie.ac.at/~a0057324/ --
german only, sorry), but xforms really suck, so i'd love to see a gtk
version of lyx: is gtk support planned for 1.4.0? i could probably
convince some of my mates to use it for more collective forms of
lecture-typing if it had an interface blending in with a decent DE (no
flamewar intended:)... i'd also contribute some more code if i find some
time...
and, one more question: is there a way to enable compilation for all
three frontends? i used the qt ui/sources as a template, but seeing it
in live action would have been quite useful in parallel.
i also have to say that i'm not really aware of what bc().valid(bool)
(as opposed to set_sensitive(false)), applylock = false etc do. (some
hints/pointers?) thus, the 'readonly'/valid thing is probably the
ugliest aspect of my code (taking care of all the cases when greying out
the apply button is appropriate and when not...)
regards
bernie
sorry, that was lengthy...
users and trying to get myself in touch with the gtk part of the lyx
sources, i spent sunday evening putting together the thesaurus dialog
for gtk. this is my first contact with both the lyx sources and gtk
programming (and in fact my first [wannabe] contribution to an open
source project), so please spare me if my work isn't flawless... the
thesaurus dialog seemed kinda ok for the beginning as it wasn't horribly
complex and hasn't yet been checked off on your guii page...
screenshot: Loading Image...
i had some trouble using cvs diff (another first-time experience) -- i
don't know how to deal with newly generated local files that aren't in
cvs yet, so there are three of them in the attached archive (.C and .h
go to src/frontends/gtk/, .glade to src/frontends/gtk/glade/) plus one
patch adding them to Dialogs.C, Makefile.am and Changelog. i hope i
didn't miss anything...
there is some change in the ui i'd like to point out compared to the
xforms and qt equivalent: i chose a cancel/apply/ok kind of dialog over
the replace/close approach (with the buttons on top of each other which
i really found a little strange); i also removed the lower 'Selection'
textbox (left to the replace button) as it only seemed to be helpful
with xforms where the current item in the listbox is not highlighted
(with gtk, it seemed just confusing). i hope there wasn't any
sophisticated detail about that approach that i overlooked... in case
you're missing the word "replace", i'd suggest changing the apply button
caption, but still leaving it in the lower row...
out of a first try, synonym lists are also altered while typing. this
works without any latency on my machine (1.4 ghz), but if that's causing
anybody's worries, changing the signal handler shouldn't be too
difficult...
i hope this implementation makes the dialog a bit more intuitive,
consistent and comfortable to use (e.g.: if no synonym in the list is
selected, e.g., but there is some text in the upper textbox ('entry' in
gtk jargon), 'apply' can be clicked and will use that text)
working on this, i'm afraid i stumbled over a bug in the thesaurus
controller (but didn't do enough research to be able to cure it):
1. highlight some word in the main window
2. open the thesaurus dialog, choose a synonym and click replace
3. choose another synonym, click replace again - it won't work
i checked this with the qt frontend. same thing, so it's apparently in
the controller's replace function... (didn't look any further into that,
admittedly...)
i like lyx (i've been using it 'in the field' last semester for
live-typing a math lecture for my physics studies and parts of a
theoretical physics one, see http://www.unet.univie.ac.at/~a0057324/ --
german only, sorry), but xforms really suck, so i'd love to see a gtk
version of lyx: is gtk support planned for 1.4.0? i could probably
convince some of my mates to use it for more collective forms of
lecture-typing if it had an interface blending in with a decent DE (no
flamewar intended:)... i'd also contribute some more code if i find some
time...
and, one more question: is there a way to enable compilation for all
three frontends? i used the qt ui/sources as a template, but seeing it
in live action would have been quite useful in parallel.
i also have to say that i'm not really aware of what bc().valid(bool)
(as opposed to set_sensitive(false)), applylock = false etc do. (some
hints/pointers?) thus, the 'readonly'/valid thing is probably the
ugliest aspect of my code (taking care of all the cases when greying out
the apply button is appropriate and when not...)
regards
bernie
sorry, that was lengthy...