Releasing translations at compile time (and Make system)

5 views
Skip to first unread message

Dario

unread,
Feb 27, 2008, 4:36:23 PM2/27/08
to HaiQ Development
I've been thinking about a method to release translations (create .qm
files) at compile time (automatically without using Trasto).

In linux we can use some bash scripting:

releaseTranslations.sh (in /haiq):

#!/bin/bash
for f in $(find $1 -iname "*.ts")
do
lrelease -silent $f
done

And in haiq.pro we could add this at the end:

message("Compilating Translations")
win32 {
#system(releaseTranslations.bat)
} else:unix {
system(./releaseTranslations.sh)
}

In windows we could use a .bat file to search all .ts file and execute
lrelease on them (that is basically what Trasto (and the little bash
script above) does when releasing translations)

So, when qmake is executed, all the binary translations files are
created

Any other idea?

(( Offtopic: i've been wondering about if it would be better to HaiQ
to change to another make system (like cmake) , because of this
translations problem (qmake doesn't recursively execute "lrelease" in
the .pro files because the SUBDIRS config and haiq dir structure), and
to define a better basic install paths for all the operating systems.
I'm going to investigate ))

Jose Maria Garcia-Valdecasas Bernal

unread,
Feb 27, 2008, 5:21:37 PM2/27/08
to Dario
Hi Dario,

Our first approach was a .bat file ( i think that i still have it
somewhere) for lupdate (change that word with lrelease and you have it
working).

In fact, Trasto is a developer tool, but can be considered an external
tool too. That is, if you have another project, you should be able to
run Trasto on it to check the status of your translations and export
the result to HTML (right now) or other formats (in the future).

IMHO, a normal user under windows (and probably under linux too) will
grab the binary package and install it, including the binary
translation files (.qm). They will not need to run any script to have
HaiQ in their language. What happens with developers or people who
want to build their own HaiQ and have it in their own language? Well,
probably a script will be useful :)

Trasto is intended to be used by translators or people who want to
check the status of translations. Ok, it also allows you to run
lrelease or lupdate, but not as primary functionality.

So, what do everyone think about this?

Christian Dähn

unread,
Feb 28, 2008, 4:24:19 AM2/28/08
to ha...@googlegroups.com
Hi,

in my eyes Trasto is meant for developers to update and check
translations. But an automatism or way to create the .qm files
during build/compile is missing currently.

As a first proposal I added two new Makefile targets to haiq.pro:

"make translations" runs lrelease on all ./translations/*.ts
"make clean_translations" removes all .qm files in ./translations/

(under Windows with VS200x of course: "nmake translations")

If this proposal is ok, you can leave it in haiq.pro - otherwise just
remove it. These targets aren't run on each build/compile - so the
current haiq.pro acts as usual - except the point that you can
use the new make targets, if you want.

I hope this proposal could be interesting - for more infos about
how it's implemented you can look here:
http://doc.trolltech.com/4.3/qmake-environment-reference.html#customizing-makefile-output

ciao,
Chris

Christian Dähn

unread,
Feb 28, 2008, 4:40:01 AM2/28/08
to ha...@googlegroups.com
Hi,

currently I'm missing these features in HaiQ, which sometimes prevent
the usage of HaiQ - thus I sometimes must switch to my old IDE (FTE)  :-(

- there's no status bar with infos to current column and line number
- the (for refactoring absolutely essential) removed horizontal/vertical
  splitted editor windows
- highlighting of functions/methods ( all strings ending with a bracket "(" )
  isn't available - provides a better readability

Some not sooo important features but missing for the daily work:

- colors of windows (especially the output window) aren't adjustable
  (I didn't found the source for the output window - if you tell me how
   to find it, I'll try to add settings for it)

Current problems under Linux:

- HaiQ reacts very slow for nearly all actions (opening menus,
  word completion, the whole gui is very slow) - it's probably not an
  issue of my machine: I have a Core 2 Duo 2.4 GHz
  and all my other Qt apps behave very different to HaiQ
- the mainwindow sometimes doesn't restore its size and position
  correctly - in these cases it starts with a size of 200x20 pixels
- the startup splash screen doesn't work under Linux
- the source editor color setting for "operators" has no effect


I'm trying to help fixing the issues and just need some help -
for the moment I don't know soo much of the HaiQ framework,
but I'm adaptive ;-)

ciao,
Chris

Jose Maria Garcia-Valdecasas Bernal

unread,
Feb 28, 2008, 5:13:03 AM2/28/08
to Christian Dähn
Chris,

Are you also experiencing problems with F4 (to go to next
error/warning after compiling)?

At least, i can't make that work under linux. I'm right now focused in
other stuff... but i will try to help you ASAP :)

Cheers,

Jose

> Hi,

> currently I'm missing these features in HaiQ, which sometimes prevent
> the usage of HaiQ - thus I sometimes must switch to my old IDE (FTE)

> - there's no status bar with infos to current column and line number


> - the (for refactoring absolutely essential) removed horizontal/vertical
> splitted editor windows
> - highlighting of functions/methods ( all strings ending with a bracket "(" )
> isn't available - provides a better readability

> Some not sooo important features but missing for the daily work:

> - colors of windows (especially the output window) aren't adjustable
> (I didn't found the source for the output window - if you tell me how
> to find it, I'll try to add settings for it)

> Current problems under Linux:

> - HaiQ reacts very slow for nearly all actions (opening menus,
> word completion, the whole gui is very slow) - it's probably not an
> issue of my machine: I have a Core 2 Duo 2.4 GHz
> and all my other Qt apps behave very different to HaiQ
> - the mainwindow sometimes doesn't restore its size and position
> correctly - in these cases it starts with a size of 200x20 pixels
> - the startup splash screen doesn't work under Linux
> - the source editor color setting for "operators" has no effect


> I'm trying to help fixing the issues and just need some help -
> for the moment I don't know soo much of the HaiQ framework,
> but I'm adaptive

> ciao,
> Chris

Christian Dähn

unread,
Feb 28, 2008, 5:35:27 AM2/28/08
to ha...@googlegroups.com
Hi Jose,

the F4 key works for me under Linux - I tested it with warnings and errors.

I appreciate any help :-)  But I have not soo much spare time, too ;-)

ciao,
Chris

jeremy....@gmail.com

unread,
Feb 28, 2008, 7:22:03 AM2/28/08
to ha...@googlegroups.com
Hi Chris, thanks for the info...
 
>> there's no status bar with infos to current column and line number
This should not be difficult, and I will add this to my list of things to do when I get back into development
 
>> the (for refactoring absolutely essential) removed horizontal/vertical splitted editor windows
Same, I will do this as well
 
>> highlighting of functions/methods ( all strings ending with a bracket "(" ) isn't available - provides a better readability
I think you could do this in system/editor/sourceedit/cpphighlighter.cpp. In fact I borrowed this file from QDevelop, and at some point I took out that feature. You can perhaps figure out how to get it back in.
>> colors of windows (especially the output window) aren't adjustable (I didn't found the source for the output window - if you tell me how to find it, I'll try to add settings for it)
It's system/shared/haiqlogwindow.cpp

I will also look into the linux-specific issues when I have a chance.
 
Regards,
Jeremy

Christian Dähn

unread,
Feb 28, 2008, 10:12:38 AM2/28/08
to ha...@googlegroups.com
Hi Jeremy,


>> there's no status bar with infos to current column and line number
This should not be difficult, and I will add this to my list of things to do when I get back into development
 
>> the (for refactoring absolutely essential) removed horizontal/vertical splitted editor windows
Same, I will do this as well
That would be great. 
>> highlighting of functions/methods ( all strings ending with a bracket "(" ) isn't available - provides a better readability
I think you could do this in system/editor/sourceedit/cpphighlighter.cpp. In fact I borrowed this file from QDevelop, and at some point I took out that feature. You can perhaps figure out how to get it back in.
>> colors of windows (especially the output window) aren't adjustable (I didn't found the source for the output window - if you tell me how to find it, I'll try to add settings for it)
It's system/shared/haiqlogwindow.cpp
Thanks for the hint - I implemented the function name highlighting and added it
together with a setting for the editor background color to the settings dialog.

I tried to add a setting for the output window - but failed - the settings and their
handling are quite hard to understand - or I even didn't had the time to get used to it.


Bes Regards,
Chris

jeremy....@gmail.com

unread,
Feb 28, 2008, 10:35:33 AM2/28/08
to ha...@googlegroups.com
>> I tried to add a setting for the output window - but failed - the settings and their
>> handling are quite hard to understand - or I even didn't had the time to get used to it.
 
Take a look at line 55 in system/menus/searchmenu/searchmenu.cpp...
 
"core->settingsManager->addObjectProperty("Fonts","Search output",find_window,"font");"
 
This is where the "font" property of the find_window (HaiQLogWindow) is added to settings.
 
So, in order to set the color of the find_window, you would follow these steps:
1. Add a Q_PROPERTY to HaiQLogWindow called windowColor, or something like that
2. Add a line in searchmenu.cpp:
      core->settingsManager->addObjectProperty(Category_name,"Output color",find_window,"windowColor");
 
Then this property will automatically appear in the settings dialog.
 
You can do a similar thing for the build output, in buildmenu.cpp
 
I hope this helps, and thanks for asking about it!
 
Jeremy

 

Christian Dähn

unread,
Feb 28, 2008, 2:22:59 PM2/28/08
to ha...@googlegroups.com
Hi Jeremy,

thanks for the advice - I was just irritated by the a little bit more complex
settings of the source editor (with the special settings dialog).

I implemented the settings for all colors of the build output window -
so I now understand how it works ;-)

Thanks again!

ciao,
Chris

jeremy....@gmail.com

unread,
Feb 28, 2008, 2:51:04 PM2/28/08
to ha...@googlegroups.com
Excellent! I'm glad you got that working, and more important, I'm glad that you see how the settings system works. If you have further questions about haiq framework, just ask.
Cheers,
Jeremy

Christian Dähn

unread,
Mar 1, 2008, 3:19:18 PM3/1/08
to ha...@googlegroups.com
Hi,

I want to re-add the feature of saving the open files on program exit and load
these on startup - and maybe the savinf of bookmarks, too.

What I need to get started are just some hints for:
a) how to save/load ini-settings
b) where is the best place to add the loading of the recent sources on startup
c) where is the best place to add the loading of the saved bookmarks

@Jose: Thanks for the search-bugfix ;-)  Exactly in the moment you checked
in the fix I told a collegue that this fix will be just a matter of a few hours :-)
...I had to correct myself: it took only minutes ;-)

ciao,
Chris

Jose Maria Garcia-Valdecasas

unread,
Mar 2, 2008, 12:43:22 PM3/2/08
to ha...@googlegroups.com


2008/3/2, Christian Dähn <da...@asinteg.de>:


@Jose: Thanks for the search-bugfix ;-)  Exactly in the moment you checked
in the fix I told a collegue that this fix will be just a matter of a few hours :-)
...I had to correct myself: it took only minutes ;-)

You are welcome Chris :)


magland

unread,
Mar 3, 2008, 6:36:24 AM3/3/08
to HaiQ Development
Hi Chris,

>> I want to re-add the feature of saving the open files on program exit and load
>> these on startup - and maybe the savinf of bookmarks, too.

>> What I need to get started are just some hints for:
>> a) how to save/load ini-settings
>> b) where is the best place to add the loading of the recent sources on startup
>> c) where is the best place to add the loading of the saved bookmarks

See https://haiq.svn.sourceforge.net/svnroot/haiq/src/plugins/system/startup/startup_openprojects/startup_openprojects.cpp

In saveSettings(), I save a list of open project paths using:
QStringList open_projects;
for (int j=0; j<core->projectManager->topLevelProjectCount(); j++)
open_projects << core->projectManager->topLevelProject(j)->path();
core->settingsManager-
>setProperty("general","open_projects",open_projects);

You can do a similar thing for files using core->workspaceManager-
>openFilePaths()

In slot_process_command_line_arguments(), I reopen those projects
using:
QStringList open_projects=core->settingsManager-
>property("general","open_projects").toStringList();
for (int j=0; j<open_projects.count(); j++)
core->projectManager->openProject(open_projects[j]);

You can do a similar thing using core->workspaceManager->openFile()

I would prefer if you made a setting to enable/disable loading of
files on startup.

Regarding bookmarks, those are only saved if you name them. You can
find the code for saving/restoring bookmarks in:
https://haiq.svn.sourceforge.net/svnroot/haiq/src/plugins/system/bookmarks/bookmarks.cpp
(see restoreSettings() and saveSettings())


Christian Dähn

unread,
Mar 3, 2008, 9:16:34 AM3/3/08
to ha...@googlegroups.com
Hi Jeremy,

thanks for your very detailed hints - I implemented the saving and restoring
of open files and added a setting for it unter "Settings -> MainWindow".

It is disabled by default, but I would propose to set it to enabled by default.

What do you think?

ciao,
Chris

jeremy....@gmail.com

unread,
Mar 3, 2008, 9:46:11 AM3/3/08
to ha...@googlegroups.com
Thanks, that was quick :)
Enabling by default is fine with me... I will just disable it on my system. :)

Reply all
Reply to author
Forward
0 new messages