Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language dropdown is blank #2577

Closed
tresf opened this issue Feb 17, 2016 · 22 comments
Closed

Language dropdown is blank #2577

tresf opened this issue Feb 17, 2016 · 22 comments
Assignees
Labels
Milestone

Comments

@tresf
Copy link
Member

tresf commented Feb 17, 2016

The language drop-down in the settings area is broken, at least on Windows.

  • Tested using the 32-bit installer on Windows 10 x64.
  • A clean removal of ~/.lmmsrc.xml was not preformed prior to installation.

image

@DanWin FYI. Related #1497.

@tresf tresf added the bug label Feb 17, 2016
@tresf tresf added this to the 1.2.0 milestone Feb 17, 2016
@michaelgregorius
Copy link
Contributor

I cannot reproduce the problem on Linux in master but that's no surprise as it was already stated that it's a problem on Windows.

The language drop-down is filled by this code block in SetupDialog.cpp:

QDir dir( ConfigManager::inst()->localeDir() );
QStringList fileNames = dir.entryList( QStringList( "*.qm" ) );
for( int i = 0; i < fileNames.size(); ++i )
{
    // get locale extracted by filename
    fileNames[i].truncate( fileNames[i].lastIndexOf( '.' ) );
    m_languages.append( fileNames[i] );
    QString lang = QLocale( m_languages.last() ).nativeLanguageName();
    changeLang->addItem( lang );
}

My first guess is that it's one of these two:

  • ConfigManager::inst()->localeDir() points somewhere with no qm files.
  • The qm files are not copied into the locale dir during the installation (this should be quick to check).

@tresf Can you please check for the existence of qm files in your installation directory?

@tresf
Copy link
Member Author

tresf commented Feb 17, 2016

C:\Users\tfinocchia>dir "C:\Program Files\LMMS\data\locale"
 Volume in drive C is Windows
 Volume Serial Number is 0AE0-C2BA

 Directory of C:\Program Files\LMMS\data\locale

02/17/2016  03:27 PM    <DIR>          .
02/17/2016  03:27 PM    <DIR>          ..
03/07/2015  09:55 PM           118,806 ca.qm
03/07/2015  09:55 PM           110,029 cs.qm
03/07/2015  09:55 PM           302,180 de.qm
03/07/2015  09:55 PM                16 en.qm
03/07/2015  09:55 PM            38,461 es.qm
03/07/2015  09:55 PM            37,233 fa.qm
03/07/2015  09:55 PM           231,627 fr.qm
03/07/2015  09:55 PM           197,454 gl.qm
03/07/2015  09:55 PM           293,007 it.qm
03/07/2015  09:55 PM            81,993 ja.qm
03/07/2015  09:55 PM            74,791 ko.qm
03/07/2015  09:55 PM            77,251 nl.qm
03/07/2015  09:55 PM           192,788 pl.qm
03/07/2015  09:55 PM           225,556 pt.qm
05/02/2015  05:16 AM             5,167 qtscript_eu.qm
05/02/2015  05:16 AM            55,319 qt_ar.qm
05/02/2015  05:16 AM           319,892 qt_cs.qm
05/02/2015  05:16 AM           119,822 qt_da.qm
05/02/2015  05:16 AM           325,046 qt_de.qm
05/02/2015  05:16 AM            82,411 qt_es.qm
05/02/2015  05:16 AM           236,038 qt_eu.qm
05/02/2015  05:16 AM           293,097 qt_fa.qm
05/02/2015  05:16 AM           255,103 qt_fr.qm
05/02/2015  05:16 AM           323,547 qt_gl.qm
05/02/2015  05:16 AM           215,294 qt_he.qm
05/02/2015  05:16 AM           272,162 qt_hu.qm
05/02/2015  05:16 AM           247,849 qt_ja.qm
05/02/2015  05:16 AM           241,938 qt_ko.qm
05/02/2015  05:16 AM           165,343 qt_lt.qm
05/02/2015  05:16 AM           316,133 qt_pl.qm
05/02/2015  05:16 AM            70,321 qt_pt.qm
05/02/2015  05:16 AM           288,364 qt_ru.qm
05/02/2015  05:16 AM           238,734 qt_sk.qm
05/02/2015  05:16 AM           228,388 qt_sl.qm
05/02/2015  05:16 AM            65,848 qt_sv.qm
05/02/2015  05:16 AM           215,985 qt_uk.qm
05/02/2015  05:16 AM           117,335 qt_zh_CN.qm
05/02/2015  05:16 AM           117,253 qt_zh_TW.qm
03/07/2015  09:55 PM           209,794 ru.qm
03/07/2015  09:55 PM            23,220 sv.qm
03/07/2015  09:55 PM            71,398 zh.qm
              41 File(s)      7,101,993 bytes
               2 Dir(s)  169,620,291,584 bytes free

@michaelgregorius
Copy link
Contributor

@tresf Ok, seems like everything is there. My next step would be to build a broken version and print out the value of ConfigManager::inst()->localeDir() and some of the other stuff at the time when the drop-down is populated. Can you do that?

@tresf
Copy link
Member Author

tresf commented Feb 17, 2016

@michaelgregorius I can confirm that it's working properly Windows, but seems to be suffering an upgrade problem. After deleting the ~/.lmmsrc.xml, it's populating.

@michaelgregorius
Copy link
Contributor

@tresf Does ~/.lmmsrc.xml also store the locale directory? If yes: has the directory structure changed so that the old entry points at the wrong directory?

@tresf
Copy link
Member Author

tresf commented Feb 18, 2016

I take that back... this isn't an upgrade issue... Here's a fresh install and some values that look fishy after letting lmms create a brand new ~/.lmmsrc.xml.

Note, Mallets crash on playback because the rawwaves can't be found. Windows 10 x64 + 1.1.90 x64.

Tagging @lukas-w as this is most likely related to the way config directories are stored in master.

artwork="data:\themes\default\"
stkdir="data:\stk\rawwaves\"

@lukas-w
Copy link
Member

lukas-w commented Feb 18, 2016

I don't have any Windows machine to test on, so can somebody check if branch iss-2577(eec6c5b) fixes anything? If not, printing out ConfigManager::inst()->localeDir() would be helpful, as @michaelgregorius suggested.
@tresf What exactly looks wrong to you in the config file? Just the path separators being \ instead of / or the fact that the search path prefix data: is stored instead of an absolßte file path?

@tresf
Copy link
Member Author

tresf commented Feb 19, 2016

@lukas-w the / tend to work just fine on Winßlows. IMO, I'd like to abolish the \ completely if we can (which eec6c5b seems to be addressing 😈 ). They just cause problems. </rant> I'm not sure what the paths should look like now (I didn't compare), but Mallets definitely crashes, which I assume is also related. I think something wrong is happening resolving the data directory on Windows. Wine should be exhibiting the same exact issues. I'll attempt to reproduce on Wine.

printing out ConfigManager::inst()->localeDir() would be helpful

Getting console messages from Windows is quite painful, I'd have to use a QMessgaeBox instead (I'll pass on that).

can somebody check if branch iss-2577(eec6c5b) fixes anything?

Yeah, I'll try that out

@DeRobyJ
Copy link
Contributor

DeRobyJ commented Feb 22, 2016

I have a question about this language selection system.
Are users able to create their language files, add them to the folder, and use them?

If yes, this can be used to freely create custom laguages for customization / theme / joke.

(oh, I'm on windows 7: public 1.1.90 has that dropdown broken too. I can test windows 7 and windows 8.1 64bit if necessary, however I can't build versions myself)

@tresf
Copy link
Member Author

tresf commented Feb 22, 2016

Well, no luck launching with Wine... I'm not sure what event is triggering the error, but this happens when the SettingDialog tries to show. The software launches ok if the ~.lmmsrc.xml exists, but crashes if it does not and subsequently crashes when trying to make the SettingDialog visible.

Couldn't initialize PortAudio: Internal PortAudio error
wine: Call from 0x7ff3f1e8ae6a to unimplemented function KERNEL32.dll.InitOnceBeginInitialize, aborting

@tresf
Copy link
Member Author

tresf commented Feb 22, 2016

can somebody check if branch iss-2577(eec6c5b) fixes anything?

Yes, it fixes it. 👍 Mallets/STK still crashes tho...

Edit: A clean removal of ~.lmmsrc.xml was done prior to first run. 👍

image

@tresf
Copy link
Member Author

tresf commented Feb 22, 2016

@DeRobyJ can you confirm the language issue is fixed here: tresf/lmms-1.1.90-geec6c5b-win64.exe

@DeRobyJ
Copy link
Contributor

DeRobyJ commented Feb 22, 2016

It works.
There is a big group of languages which are blank tho
screenshot_9

(also, Mallets doesn't crash to me, win7 64bit)

@tresf
Copy link
Member Author

tresf commented Feb 22, 2016

(also, Mallets doesn't crash to me, win7 64bit)

Please move your %USERPROFILE%\.lmmsrc.xml and try again. It will crash.

@tresf
Copy link
Member Author

tresf commented Feb 22, 2016

@lukas-w is is safe to say we need to QDir() these mallets.cpp#L536? Since Linux uses a hard-coded path, this problem wouldn't surface unless tested on Windows.

@DeRobyJ
Copy link
Contributor

DeRobyJ commented Feb 22, 2016

When .lmmsrc.xml is moved and the program is launched, it promptly asks for a working directory. Then it creates the file and the problem is fixed...
Well, at least it's like that on windows 7

@lukas-w
Copy link
Member

lukas-w commented Feb 22, 2016

is is safe to say we need to QDir() these

Yep, that should do. Just wrap a QDir(…).absoluteFilePath() around it.

tresf pushed a commit that referenced this issue Feb 23, 2016
@tresf
Copy link
Member Author

tresf commented Feb 23, 2016

When .lmmsrc.xml is moved and the program is launched, it promptly asks for a working directory. Then it creates the file and the problem is fixed...
Well, at least it's like that on windows 7

I should have been more specific... Mallets doesn't crash, playing a sound with mallets crashes (because the stk rawwaves directory is not a valid path, so once you try to play any note with any Mallet preset (including the Default preset) the plugin will crash and take LMMS down with it. The only way this would work on any Windows machine with a fresh config file is if someone had manually clicked the "Browse" folder icon and click "Use Folder" and then used Mallets, but of course, that's circumventing the problem. 🍺

Yep, that should do. Just wrap a QDir(…).absoluteFilePath() QDir(…).absolutePath() around it.

FTFY and done via d88902e, once the branch is merged. 🍻

@lukas-w
Copy link
Member

lukas-w commented Feb 23, 2016

done via d88902e

Does it fix the crash?

@tresf
Copy link
Member Author

tresf commented Feb 23, 2016

done via d88902e

Does it fix the crash?

Sorry forgot to mention that part... yes it does. 👍

@lukas-w
Copy link
Member

lukas-w commented Feb 23, 2016

👍

@tresf
Copy link
Member Author

tresf commented Mar 3, 2016

Partially fixed per #2611 (comment) via 85011cd.

This is still going to be a problem for Windows until this recommendation is done. #1498 (comment)

Reopening until we've shimmed our Windows packagers, documentation and Travis-CI scripts.

Test results (Apple):
screen shot 2016-03-03 at 12 37 08 am

@tresf tresf reopened this Mar 3, 2016
@tresf tresf mentioned this issue Mar 3, 2016
16 tasks
tresf added a commit to tresf/lmms that referenced this issue Mar 7, 2016
liushuyu pushed a commit to liushuyu/lmms that referenced this issue Mar 8, 2016
sambler added a commit to sambler/lmms that referenced this issue Sep 19, 2016
* master: (90 commits)
  Grey out muted patterns in the BB editor
  Crash at clearing path in settings manager
  Clear buffer of dummy instruments. Should fix LMMS#2682
  Get rid of another copy constructor call to prevent Qt5 crashes
  Enables style sheets for knob line colors for all knob types
  Kicker 'version' 0 on first save
  Add C++11 compile flag to the carla plugin as well
  Elide channel names to prevent text overflow in FxLine
  Replace every use of the foreach macro with a C++11 range-based for loop
  Compile several plugins with -std=c++0x to support range-based for loops
  Make lb302 include math.h so we can switch it to C++11
  File browser, factory files off by one
  Fix regression caused by fcec8dd
  Fix BBtrack updating; Fix the Pattern tooltip
  Rewrote ProjectVersionTest.cpp to use QVERIFY and indeed fail when it's supposed to fail, and added 2 tests in this test suite.
  data/locale: zh_CN.ts not zh.ts
  White-space formatting
  Add gig player to win32 builds
  Update Chinese translations
  Fix locale generation for win32 builds Closes LMMS#2577
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants