~supagu/openlp/planningcenter-branch

« back to all changes in this revision

Viewing changes to openlp/core/ui/mainwindow.py

  • Committer: Raoul Snyman
  • Author(s): Jonathan Springer
  • Date: 2015-08-28 19:28:35 UTC
  • mfrom: (2549.1.1 apple-help)
  • Revision ID: raoul@snyman.info-20150828192835-4g08hx3hmwbtqbvi
Add ability to open Apple help file from app bundle. Only show offline help if we are running frozen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
312
312
                                                   icon=':/system/system_help_contents.png',
313
313
                                                   can_shortcuts=True,
314
314
                                                   category=UiStrings().Help, triggers=self.on_offline_help_clicked)
 
315
        elif is_macosx():
 
316
            self.local_help_file = os.path.join(AppLocation.get_directory(AppLocation.AppDir),
 
317
                                                '..', 'Resources', 'OpenLP.help')
 
318
            self.offline_help_item = create_action(main_window, 'offlineHelpItem',
 
319
                                                   icon=':/system/system_help_contents.png',
 
320
                                                   can_shortcuts=True,
 
321
                                                   category=UiStrings().Help, triggers=self.on_offline_help_clicked)
315
322
        self.on_line_help_item = create_action(main_window, 'onlineHelpItem',
316
323
                                               icon=':/system/system_online_help.png',
317
324
                                               can_shortcuts=True,
354
361
        add_actions(self.tools_menu, (self.tools_open_data_folder, None))
355
362
        add_actions(self.tools_menu, (self.tools_first_time_wizard, None))
356
363
        add_actions(self.tools_menu, [self.update_theme_images])
357
 
        if is_win():
 
364
        if (is_win() or is_macosx()) and (hasattr(sys, 'frozen') and sys.frozen == 1):
358
365
            add_actions(self.help_menu, (self.offline_help_item, self.on_line_help_item, None, self.web_site_item,
359
366
                        self.about_item))
360
367
        else:
453
460
        self.settings_plugin_list_item.setStatusTip(translate('OpenLP.MainWindow', 'List the Plugins'))
454
461
        self.about_item.setText(translate('OpenLP.MainWindow', '&About'))
455
462
        self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP'))
456
 
        if is_win():
 
463
        if is_win() or is_macosx():
457
464
            self.offline_help_item.setText(translate('OpenLP.MainWindow', '&User Guide'))
458
465
        self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help'))
459
466
        self.search_shortcut_action.setText(UiStrings().Search)
762
769
        """
763
770
        Load the local OpenLP help file
764
771
        """
765
 
        os.startfile(self.local_help_file)
 
772
        QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + self.local_help_file))
766
773
 
767
774
    def on_online_help_clicked(self):
768
775
        """