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

Preview in 6.070 GUI issues #498

Open
timmbo9 opened this issue Dec 26, 2024 · 18 comments
Open

Preview in 6.070 GUI issues #498

timmbo9 opened this issue Dec 26, 2024 · 18 comments

Comments

@timmbo9
Copy link

timmbo9 commented Dec 26, 2024

Os Ubuntu 24.04
With chordpro file loaded pressing preview opens firefox but firefox complains it cannot find the file
/tmp/filename. It even displays the filename in error message. If I go to tmp the file is there and able to be
opened and read in a pdf viewer.

If I remove firefox from the system then preview opens in default pdf viewer program.

I would think that chordpro would check the environment and use the default browser. In my case BROWSER=vivaldi.
That is an environment variable set for use in abc2svg.

@sciurius
Copy link
Collaborator

In Settings > Preview, please uncheck [x]PDF Viewer

ChordPro should now use its built-in PDF viewer.

@timmbo9
Copy link
Author

timmbo9 commented Dec 27, 2024

I'm using dev 6.070 and don't see this. No Settings > Preview.

@sciurius
Copy link
Collaborator

(The smell increases. Not that it matters for this case, but can you upgrade to the release version?)

Try this:

  • start wxchordpro
  • click create new song
  • click messages

It should say something similar to

07:45:33: Using styled text editor
07:45:33: Using embedded PDF viewer
07:45:33: New song: New Song

@timmbo9
Copy link
Author

timmbo9 commented Dec 27, 2024

it says Using external PDF viewer.
Which github branch should I be using ? currently on dev but I did try R6.070_maint since it had more recent activity.

@sciurius
Copy link
Collaborator

This is what I was afraid of... I fear that Ubuntu does not provide a complete wxWidgets build.

Can you find out what wxWidgets packages are installed, and what wx libraries there are in lib?

@timmbo9
Copy link
Author

timmbo9 commented Dec 27, 2024

ldconfig -p -v |grep wx > wxliblist.txt
wxliblist.txt

installed wx packages
installed-wx

And list of available ubuntu wx apts:
aptlist.txt

@sciurius
Copy link
Collaborator

Can you add libwxgtk-webview3.2, does it make a difference?

@timmbo9
Copy link
Author

timmbo9 commented Dec 27, 2024

Added. reinstalled chordpro; no difference.

screen stdout:
wxchordpro
09:21:12 PM: Using light theme
09:21:28 PM: Debug: window wxMenuBar@0x643764f338e0 ("menubar") lost focus even though it didn't have it
09:21:43 PM: Debug: window wxMenuBar@0x643764f338e0 ("menubar") lost focus even though it didn't have it
09:22:33 PM: Debug: window wxMenuBar@0x643764f338e0 ("menubar") lost focus even though it didn't have it

@sciurius
Copy link
Collaborator

Does wx-config --libs all now report a.o. the webview libraries? You may need to install the dev version of the wx libraries as well.

If so, can you, try to rebuild libwx-perl from source?
Alternatively, you can try to build this enhanced version instead.

@sciurius
Copy link
Collaborator

I've set up an Unbuntu 24.04.1 LTS and I can reproduce the problem. I'll see what I can do.

@sciurius
Copy link
Collaborator

Okay, the problem: Ubuntu 24.04.1 LTS ships with wxWidgets but does not install the WebView component. As a result, the system provided Alien::wxWidgets and wxPerl do not have DocView.

I think this will work:

  • # apt-get install libwxgtk-webview3.2-dev
  • # apt-get remove libalien-wxwidgets-perl
  • make sure that /usr/lib/x86_64-linux-gnu/perl5/5.38/Alien/wxWidgets/Config/gtk_3_2_4_uni_gcc_3_4.pm is no longer there (remove explicitly if needed).
  • # apt-get install cpanminus
  • # cpanm Alien::wxWidgets

Download Wx-3.004.tar.gz from https://github.com/sciurius/wxPerl/releases/tag/R3.004

  • $ tar xvf Wx-3.004.tar.gz
  • $ cd Wx-3.004
  • $ perl Makefile.PL
  • $ make
  • $ sudo make install

Now wxChordPro should be fully functional (using the embedded PDF viewer).

@sciurius
Copy link
Collaborator

This may be easier:

  • # apt-get install libwxgtk-webview3.2-dev
  • # cd /usr/lib/x86_64-linux-gnu/perl5/5.38/Alien/wxWidgets
  • # patch -N < alien-wxwidgets-webview.patch.txt

Now proceed with downloading, building and installing Wx-3.004.tar.gz.

alien-wxwidgets-webview.patch.txt

@sciurius
Copy link
Collaborator

sciurius commented Dec 29, 2024

And this may be best:

  • # apt-get install libwxgtk-webview3.2-dev
  • # apt-get remove libalien-wxwidgets-perl
  • # apt-get purge libalien-wxwidgets-perl
  • # apt-get install cpanminus (if you don't have cpanm installed already)
  • # cpanm Alien::wxWidgets
  • # cpanm --notest https://github.com/chordpro/chordpro/releases/download/R6.070/Wx-3.004.tar.gz
  • # cpanm https://github.com/chordpro/chordpro/releases/download/R6.070/App-Music-ChordPro-6.070.tar.gz

@om1cmd
Copy link

om1cmd commented Jan 9, 2025

I had an issue that seems related to this. I am on Pop OS 22.04 LTS.

If I tried to run chordpro with libalien packages installed through apt it would run, but it would open pdfs in firefox (even though my default browser is brave). So I followed the instructions on chordpro's website. I installed Alien::wxWidgets with no issues. Then, installing Wx from this repository failed. When digging through the build.log I found that it failed some tests because it couldn't find Wx::Media. So I tried installing Wx::Media, but this failed right away and in build.log was an error: No such 'link' library: 'adv'.

What finally fixed the issue was running the sudo cpanm https://github.com/chordpro/chordpro/releases/download/R6.070/Wx-3.005.tar.gz WITH --notest flag. Originally I forced the installation with --force after which it installed, but running 'wxchordpro' would fail with Wx::Media was not found. After uninstalling Wx and reinstalling with --notest it for some reason works as expected. I have no idea why that fixed it, but I thought it is worth sharing.

I will test this again on a different machine to make sure that this is reproducable. I will let you know how that went in a few days.

@sciurius
Copy link
Collaborator

sciurius commented Jan 9, 2025

Thanks for the headsup. Do you have information on what wx packages and libraries are installed on Pop OS when you install libwx-perl ?

@om1cmd
Copy link

om1cmd commented Jan 9, 2025

Here are outputs of running apt install libwx-perl and also apt install libalien-wxwidgets-perl. Neither of those was installed by default. I only tried installing to see what would happen as part of troubleshooting.
packages.txt

@sciurius
Copy link
Collaborator

sciurius commented Jan 10, 2025

Perfect. So installing libwx-perl adds libalien-wxwidgets-perl (as it should) and the required wx libraries except for webview.

So I tried installing Wx::Media, but this failed right away and in build.log was an error: No such 'link' library: 'adv'

Wx::Media is provided by Wx, and the default version of Wx gives this (and some other) errors when building against wxWidgets later than 3.0.

@om1cmd
Copy link

om1cmd commented Jan 12, 2025

I installed chordpro today on another system with Pop OS 22.04 LTS. I ran into all the same issues as the first time. Installing Wx-3.005 with --notest makes sure it gets installed, but does not resolve the underlying problem. So I made sure I had all the libwxgtk3.2 packages*. That includes libwxgtk-media3.2-1 libwxgtk-media3.2-dev libwxgtk-webview3.2-1 libwxgtk-webview3.2-dev libwxgtk3.2-1 libwxgtk3.2-dev. I am not sure if all of these are actually required. I also removed all libwxgtk3.0 packages. Then I followed these instructions.

  • # apt-get remove libalien-wxwidgets-perl
  • make sure that /usr/lib/x86_64-linux-gnu/perl5/5.38/Alien/wxWidgets/Config/gtk_3_2_4_uni_gcc_3_4.pm is no longer there (remove explicitly if needed).
  • # apt-get install cpanminus
  • # cpanm Alien::wxWidgets

For Pop OS the file gtk_3_2_1_uni_gcc_3_4.pm is in /usr/local/lib/x86_64-linux-gnu/perl/5.34.0/Alien/wxWidgets/Config.

That got Chordpro installed and running with build in pdf viewer on Pop OS.

*As of now, these are not available in default repositories, but I got them from Kicad repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants