~thelinuxguy/openlp/bible-improvements

« back to all changes in this revision

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

  • Committer: Tim Bentley
  • Author(s): Raoul Snyman
  • Date: 2018-01-13 08:17:04 UTC
  • mfrom: (2807.1.5 bug-1742910)
  • Revision ID: tim.bentley@gmail.com-20180113081704-jao5jtaa33qsrizu
Fix bug #1742910 by moving the threads to the application object instead of the main window object.

Add this to your merge proposal:
--------------------------------------------------------------------------------
lp:~raoul-snyman/openlp/bug-1742910 (revision 2810)
https://ci.openlp.io/job/Branch-01-Pull/2418/                          [SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2319/                  [SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/114/                ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
        """
478
478
        super(MainWindow, self).__init__()
479
479
        Registry().register('main_window', self)
480
 
        self.threads = {}
481
480
        self.clipboard = self.application.clipboard()
482
481
        self.arguments = ''.join(self.application.args)
483
482
        # Set up settings sections for the main application (not for use by plugins).
557
556
        wait_dialog.setAutoClose(False)
558
557
        wait_dialog.setCancelButton(None)
559
558
        wait_dialog.show()
560
 
        for thread_name in self.threads.keys():
 
559
        for thread_name in self.application.worker_threads.keys():
561
560
            log.debug('Waiting for thread %s', thread_name)
562
561
            self.application.processEvents()
563
 
            thread = self.threads[thread_name]['thread']
564
 
            worker = self.threads[thread_name]['worker']
 
562
            thread = self.application.worker_threads[thread_name]['thread']
 
563
            worker = self.application.worker_threads[thread_name]['worker']
565
564
            try:
566
565
                if worker and hasattr(worker, 'stop'):
567
566
                    # If the worker has a stop method, run it