File: use_help_in_usr_share_doc.diff

package info (click to toggle)
solfege 3.23.4-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 29,492 kB
  • sloc: python: 26,937; xml: 4,380; ansic: 1,544; sh: 807; makefile: 656; perl: 8; exp: 7
file content (43 lines) | stat: -rw-r--r-- 2,532 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Description: Use html help files installed in /usr/share/doc/solfege folder.
Author: Francois Mazen <francois@mzf.fr>
Forwarded: not-needed

--- a/solfege/mainwin.py
+++ b/solfege/mainwin.py
@@ -117,6 +117,7 @@
 class MainWin(Gtk.ApplicationWindow, cfg.ConfigUtils):
     default_front_page = os.path.join(lessonfile.exercises_dir, 'learningtree.txt')
     debug_front_page = os.path.join(lessonfile.exercises_dir, 'debugtree.txt')
+    doc_folder = '/usr/share/doc/solfege'
 
     def __init__(self, options, datadir):
         Gtk.ApplicationWindow.__init__(self)#, Gtk.WindowType.TOPLEVEL)
@@ -404,7 +405,7 @@
             box2.pack_start(gu.hig_label_widget(_("Solfege user data:"), Gtk.Label(label=filesystem.user_data()), sizegroup), False, False, 0)
             box2.pack_start(gu.hig_label_widget(_("Solfege config file:"), Gtk.Label(label=filesystem.rcfile()), sizegroup), False, False, 0)
             box2.pack_start(gu.hig_label_widget(_("Solfege installation directory:"), Gtk.Label(label=os.getcwd()), sizegroup), False, False, 0)
-            box2.pack_start(gu.hig_label_widget(_("User manual in HTML format:"), Gtk.Label(label=os.path.join(os.getcwd(), "help")), sizegroup), False, False, 0)
+            box2.pack_start(gu.hig_label_widget(_("User manual in HTML format:"), Gtk.Label(label=os.path.join(self.doc_folder, "help")), sizegroup), False, False, 0)
             box2.pack_start(gu.hig_label_widget("gtk:", Gtk.Label(label=str(Gtk)), sizegroup), False, False, 0)
             box2.pack_start(gu.hig_label_widget("pyalsa:", Gtk.Label(label=str(alsaseq)), sizegroup), False, False, 0)
             box2.pack_start(gu.hig_label_widget("PYTHONHOME", Gtk.Label(os.environ.get('PYTHONHOME', 'Not defined')), sizegroup), False, False, 0)
@@ -500,7 +501,7 @@
         Display the HTML file named by fn in the help browser window.
         """
         for lang in solfege.app.m_userman_language, "C":
-            filename = os.path.join(os.getcwd(), "help", lang, fn)
+            filename = os.path.join(self.doc_folder, "help", lang, fn)
             if os.path.isfile(filename):
                 break
         cache = apt.Cache()
--- a/solfege/application.py
+++ b/solfege/application.py
@@ -193,7 +193,7 @@
         #
         self.m_userman_language = "C"
         for lang in i18n.langs():
-            if os.path.isdir(os.path.join('help', lang)):
+            if os.path.isdir(os.path.join('/usr/share/doc/solfege/help', lang)):
                 self.m_userman_language = lang
                 break