diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index d403d2edd..be6a03c35 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -50,6 +50,8 @@ class PdfController(PresentationController): def __init__(self, plugin): """ Initialise the class + + :param plugin: The plugin that creates the controller. """ log.debug('Initialising') self.process = None @@ -65,6 +67,9 @@ class PdfController(PresentationController): """ Function that checks whether a binary is either ghostscript or mudraw or neither. Is also used from presentationtab.py + + :param program_path:The full path to the binary to check. + :return: Type of the binary, 'gs' if ghostscript, 'mudraw' if mudraw, None if invalid. """ program_type = None runlog = '' @@ -92,6 +97,8 @@ class PdfController(PresentationController): def check_available(self): """ PdfController is able to run on this machine. + + :return: True if program to open PDF-files was found, otherwise False. """ log.debug('check_available Pdf') return self.check_installed() @@ -99,6 +106,8 @@ class PdfController(PresentationController): def check_installed(self): """ Check the viewer is installed. + + :return: True if program to open PDF-files was found, otherwise False. """ log.debug('check_installed Pdf') # Use the user defined program if given @@ -171,8 +180,11 @@ class PdfDocument(PresentationDocument): def gs_get_resolution(self, size): """ Only used when using ghostscript - Ghostscript can't scale automaticly while keeping aspect like mupdf, so we need - to get the ratio bewteen the screen size and the PDF to scale + Ghostscript can't scale automatically while keeping aspect like mupdf, so we need + to get the ratio between the screen size and the PDF to scale + + :param size: Size struct containing the screen size. + :return: The resolution dpi to be used. """ # Use a postscript script to get size of the pdf. It is assumed that all pages have same size postscript = '%!PS \n\ @@ -224,6 +236,8 @@ quit \n\ def load_presentation(self): """ Called when a presentation is added to the SlideController. It generates images from the PDF. + + :return: True is loading succeeded, otherwise False. """ log.debug('load_presentation pdf') # Check if the images has already been created, and if yes load them @@ -286,6 +300,8 @@ quit \n\ def is_loaded(self): """ Returns true if a presentation is loaded. + + :return: True if loaded, False if not. """ log.debug('is_loaded pdf') if self.num_pages < 0: @@ -295,6 +311,8 @@ quit \n\ def is_active(self): """ Returns true if a presentation is currently active. + + :return: True if active, False if not. """ log.debug('is_active pdf') return self.is_loaded() and not self.hidden @@ -302,5 +320,7 @@ quit \n\ def get_slide_count(self): """ Returns total number of slides + + :return: The number of pages in the presentation.. """ return self.num_pages diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 5b93c10a9..8c5997a61 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -225,6 +225,8 @@ class PresentationTab(SettingsTab): """ When checkbox for manual entering pdf-program is clicked, enable or disable the textbox for the programpath and the browse-button. + + :param checked: If the box is checked or not. """ self.pdf_program_path.setReadOnly(not checked) self.pdf_program_path.setPalette(self.get_grey_text_palette(not checked)) @@ -233,6 +235,9 @@ class PresentationTab(SettingsTab): def get_grey_text_palette(self, greyed): """ Returns a QPalette with greyed out text as used for placeholderText. + + :param greyed: Determines whether the palette should be grayed. + :return: The created palette. """ palette = QtGui.QPalette() color = self.palette().color(QtGui.QPalette.Active, QtGui.QPalette.Text)