google-code-export / qdevelop

Automatically exported from code.google.com/p/qdevelop
GNU General Public License v2.0
2 stars 1 forks source link

Mac OS X: QtLinguist will not called from files dock widget's context menu #349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using the context menu on a translation at the files dock widget does 
not open QtLinguist on Mac OS X.

What is the expected output? What do you see instead?
expected: QtLinguist should be called
instead: nothing happen

What version of the product are you using? On what operating system?
QDevelop 0.26-1
Mac OS 10.5.6

Please provide any additional information below.
If you do the same thing as for QAssistant it should be done.

Original issue reported on code.google.com by m...@plcedit.org on 17 Feb 2009 at 5:49

GoogleCodeExporter commented 9 years ago
Do you get an "Unable to start designer" message?
Have you checked that path to designer in "Tools" dialog is correct?
Can you start designer from console by typing "/path/to/designer -server". What 
is
the output?

Original comment by Lord.Div...@gmail.com on 17 Feb 2009 at 12:20

GoogleCodeExporter commented 9 years ago
I get now "Unable to start designer" message.
My path in tools is correct.
This: "/path/to/designer -server" was not tested yet. I can try it later the 
day.

Original comment by m...@plcedit.org on 17 Feb 2009 at 12:49

GoogleCodeExporter commented 9 years ago
Stop I'm mistaken. With what utilities do you have this problem?

Original comment by Lord.Div...@gmail.com on 17 Feb 2009 at 3:04

GoogleCodeExporter commented 9 years ago
Utilities, what do you mean?
The problem is that QLinguist will not called if I use the context menu item 
'Open 
with Linguist' on a translation file in the dockwidget 'Files'.

brgds,
Martin

Original comment by m...@plcedit.org on 17 Feb 2009 at 3:21

GoogleCodeExporter commented 9 years ago
Please try to run linguist from console exactly as its path is written in 
"Tools"
dialog. What's the output?

Original comment by Lord.Div...@gmail.com on 17 Feb 2009 at 4:38

GoogleCodeExporter commented 9 years ago
Ok, now I've tested some things. I think we had the sam guess.
If I use the following path in QDevelop or terminal nothing will happen:
'/Developer/qt443/bin/Linguist.app'.

If I set the path to the next one QDevelop and the terminal open Linguist:
'/Developer/qt443/bin/Linguist.app/Contents/MacOS/Linguist'.

So I think the handling of open Linguist.app must be changed for the Mac OS 
platform, to append the extra path: 'Contents/MacOS/Linguist'.

Original comment by m...@plcedit.org on 17 Feb 2009 at 5:03

GoogleCodeExporter commented 9 years ago
Ok, and what about other qt tools? Can designer be called? What about assistant?

Original comment by Lord.Div...@gmail.com on 17 Feb 2009 at 5:40

GoogleCodeExporter commented 9 years ago
Calling Designer, Assistant, lupdate and lrelease and qmake works without any 
problems.

Original comment by m...@plcedit.org on 17 Feb 2009 at 5:54

GoogleCodeExporter commented 9 years ago
Please provide paths to these tools. Do they contain "Contents/MacOS/"?

Original comment by Lord.Div...@gmail.com on 17 Feb 2009 at 6:04

GoogleCodeExporter commented 9 years ago
I've attached a screenshot from my Tools setup. Path with Qt 4.4.3 works too.

brgds,
Martin

Original comment by m...@plcedit.org on 17 Feb 2009 at 6:36

Attachments:

GoogleCodeExporter commented 9 years ago
There must be an error in the way Qt handles QProcess::startDetached() on Mac. I
don't see any other reason. What version of Qt is your QDevelop built with? 
Will the
problem persist if you build it with Qt 4.4.3?

Original comment by Lord.Div...@gmail.com on 18 Feb 2009 at 5:48

GoogleCodeExporter commented 9 years ago
Hello Divius,

my original QDevelop was build with Qt4.4.3. The tests were made with Qt 4.3.4 
and 
the problem persist.

Maybe you are right and startDetached() doesn't work correctly. So, maybe 
process-
>start(m_linguistName, QStringList(s)); could solve it, but I can try it only 
at 
home this evening.

Original comment by m...@plcedit.org on 18 Feb 2009 at 6:38

GoogleCodeExporter commented 9 years ago
Please try this patch. It doesn't solve the problem (because 
QProcess::execute() will
freeze QDevelop main window) but I want to know whether it works or not.

Original comment by Lord.Div...@gmail.com on 18 Feb 2009 at 3:20

Attachments:

GoogleCodeExporter commented 9 years ago
But if you cant even run /Developer/qt443/bin/Linguist.app from console it can 
be
incorrect function of Linguist. Anyway I'm not sure at all that we can do 
something
with it.
Does this occur with other versions of Mac OS X, I wonder...

Original comment by Lord.Div...@gmail.com on 18 Feb 2009 at 3:28

GoogleCodeExporter commented 9 years ago
Regarding comment 11:
I've compiled QDevelop again with Qt4.4.3 -> problem persits.

Regarding comment 12:
QProcess::start() is not possible.

Regarding comment 13:
The line 'QProcess::execute (m_linguistName, QStringList(s));' works. Liguist 
will 
start with the selected file and yes it freezes QDevelop until Linguist will be 
closed.

Regarding comment 14: 
It is the same with Desgienr and Assistant.
Type in '/Developer/qt443/bin/Assistant.app' an 
'/Developer/qt443/bin/Designer.app' 
gives the feedback in terminal '... : is a directory'. Only with an added 
'Contents/
MacOS/Assistant' or 'Contents/MacOS/Designer' they start up. I only use Mac OS 
10.5.6, so I cannot answer it.

brgds,
Martin

Original comment by m...@plcedit.org on 18 Feb 2009 at 4:11

GoogleCodeExporter commented 9 years ago
A small issue:
In toolscontrolimpl.cpp, from line 61 'linguist' must get a upper case for the 
'L', 
I think (has not effect to the named bug).
--> should be changed to:
#ifdef Q_OS_MACX
    linguist->setText( settings.value("m_linguistName", bindir
+"Linguist.app").toString() );
    designer->setText( settings.value("m_designerName", bindir
+"Designer.app").toString() );
    assistant->setText( settings.value("m_assistantName", bindir
+"Assistant.app").toString() );
#else
    linguist->setText( settings.value("m_linguistName", bindir
+"Linguist"+suffix).toString() );
    designer->setText( settings.value("m_designerName", bindir
+"designer"+suffix).toString() );
    assistant->setText( settings.value("m_assistantName", bindir
+"assistant"+suffix).toString() );
#endif

Original comment by m...@plcedit.org on 18 Feb 2009 at 4:18

GoogleCodeExporter commented 9 years ago
This patch should provide correct tools autodetection.
Please remove/rename qdevelop.ini and try it (with all tools not only Linguist).

Original comment by Lord.Div...@gmail.com on 18 Feb 2009 at 4:24

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, but I'm not able to locate the .ini file. :( It's not in te preferences 
folder of my Mac OS account and not included in the application folder, but 
settings 
are still there - mysterious...

But I think your way is not really good, because you tried to use the preset 
value 
of a settings.value() call. I would suggest to include a check on an exclusive 
position, maybe in toolscontrolimpl.cpp or in mainimpl.cpp, direct at the SLOT 
slotToolsControl(), eg:
void MainImpl::slotToolsControl(bool show)
{
    ToolsControlImpl *toolsControlImpl = new ToolsControlImpl( this );
    if ( (!toolsControlImpl->toolsControl() && m_checkEnvironmentOnStartup ) || 
show )
            // toolsControlImpl->toolsControl() is always called so that there 
was a check done - if it isn't called, all tools will appear valid if 
m_checkEnvironmentOnStartup is disabled
        toolsControlImpl->exec();

    m_qmakeName = toolsControlImpl->qmakeName();
    m_makeName = toolsControlImpl->makeName();
    m_gdbName = toolsControlImpl->gdbName();
    m_ctagsName = toolsControlImpl->ctagsName();
    m_linguistName = toolsControlImpl->linguistName();
   // Divius: there is a strange misdetection of Linguist in Mac OS X
   //  which required adding /Contents/MacOS/Linguist to the app name
    #ifdef Q_WS_MAC
      if (!m_linguistName.contains("/Contents/MacOS/Linguist")) //check if path 
contains executable
        m_linguistName.append("/Contents/MacOS/Linguist");
    #endif
    m_lupdateName = toolsControlImpl->lupdateName();
    m_lreleaseName = toolsControlImpl->lreleaseName();
    m_designerName = toolsControlImpl->designerName();
    //
  ...

brgds,
Martin

Original comment by m...@plcedit.org on 18 Feb 2009 at 6:45

GoogleCodeExporter commented 9 years ago
We can't do it because it may be wrong for some Mac OS platform.
Path to the ini file:
QDir::homePath()+"/.qdevelop/qdevelop.ini"

Original comment by Lord.Div...@gmail.com on 18 Feb 2009 at 8:37

GoogleCodeExporter commented 9 years ago
Thx for the path information. I've found the ini and your code works, as 
expected. 

Ok, I've asked the Mac community. The answer is: GUI applications can called 
with '-
a AppName' or '/Path/AppName.app/Contents/MacOS/AppName' in the terminal.
This morning I remind that I have maybe a Mac OS 10.4.11 on a external HDD, so 
later 
the day I can check this behavior and the workaround, too.

Original comment by m...@plcedit.org on 19 Feb 2009 at 7:09

GoogleCodeExporter commented 9 years ago
I've an idea! Please try this patch. It will fallback to
/Path/AppName.app/Contents/MacOS/AppName if /Path/AppName.app does not work.

Original comment by Lord.Div...@gmail.com on 19 Feb 2009 at 11:27

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by Lord.Div...@gmail.com on 19 Feb 2009 at 11:34

GoogleCodeExporter commented 9 years ago
Hello Divius,

I've tried the patch fixlingmac3.diff and it works on Mac OS 10.4.11 as well as 
on 
Mac OS 10.5.6!

I've also tried the terminal on 10.4.11 with: '/Path/AppName.app' without 
success, 
but '/Path/AppName.app/Contents/MacOS/AppName' with success. So I guess it's on 
all 
Mac OS X versions the same.

brgds,
Martin

Original comment by m...@plcedit.org on 19 Feb 2009 at 6:31

GoogleCodeExporter commented 9 years ago
Applied in r410

Original comment by Lord.Div...@gmail.com on 19 Feb 2009 at 7:11