Пример #1
0
    def testNumeric(self):
        PreferencesDialog.addNumericPreference('numericPreference1',
            label="Open Range",
            section="Test",
            description="This option has no upper bound",
            lower=-10)
        self.assertTrue('numericPreference1' in PreferencesDialog.prefs['Test'])

        PreferencesDialog.addNumericPreference('numericPreference2',
            label="Closed Range",
            section="Test",
            description="This option has both upper and lower bounds",
            lower=-10,
            upper=10000)
Пример #2
0
    def testNumeric(self):
        PreferencesDialog.addNumericPreference('numericPreference1',
                                               label="Open Range",
                                               section="timeline",
                                               description="This option has no upper bound",
                                               lower=-10)
        self.assertTrue(
            'numericPreference1' in PreferencesDialog.prefs["timeline"])

        PreferencesDialog.addNumericPreference('numericPreference2',
                                               label="Closed Range",
                                               section="timeline",
                                               description="This option has both upper and lower bounds",
                                               lower=-10,
                                               upper=10000)
Пример #3
0
    def testNumeric(self):
        section = list(PreferencesDialog.section_names.keys())[0]
        PreferencesDialog.addNumericPreference('numericPreference1',
                                               label="Open Range",
                                               section=section,
                                               description="This option has no upper bound",
                                               lower=-10)
        self.assertTrue(
            'numericPreference1' in PreferencesDialog.prefs[section])

        PreferencesDialog.addNumericPreference('numericPreference2',
                                               label="Closed Range",
                                               section=section,
                                               description="This option has both upper and lower bounds",
                                               lower=-10,
                                               upper=10000)
Пример #4
0
GlobalSettings.addConfigSection("thumbnailing")
GlobalSettings.addConfigOption("thumbnailSpacingHint",
    section="thumbnailing",
    key="spacing-hint",
    default=5,
    notify=True)

GlobalSettings.addConfigOption("thumbnailPeriod",
    section="thumbnailing",
    key="thumbnail-period",
    default=gst.SECOND,
    notify=True)

PreferencesDialog.addNumericPreference("thumbnailSpacingHint",
    section=_("Appearance"),
    label=_("Thumbnail gap"),
    lower=0,
    description=_("The spacing between thumbnails, in pixels"))

PreferencesDialog.addChoicePreference("thumbnailPeriod",
    section=_("Performance"),
    label=_("Thumbnail every"),
    choices=(
        # Note that we cannot use "%s second" or ngettext, because fractions
        # are not supported by ngettext and their plurality is ambiguous
        # in many languages.
        # See http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
        (_("1/100 second"), gst.SECOND / 100),
        (_("1/10 second"), gst.SECOND / 10),
        (_("1/4 second"), gst.SECOND / 4),
        (_("1/2 second"), gst.SECOND / 2),
Пример #5
0
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.timeline import SELECT
from pitivi.utils.ui import argb_to_gdk_rgba
from pitivi.utils.ui import fix_infobar
from pitivi.utils.ui import gdk_rgba_to_argb

GlobalSettings.addConfigOption('titleClipLength',
                               section="user-interface",
                               key="title-clip-length",
                               default=5000,
                               notify=True)

PreferencesDialog.addNumericPreference('titleClipLength',
                                       section="timeline",
                                       label=_("Title clip duration"),
                                       description=_(
                                           "Default clip length (in milliseconds) of titles when inserting on the timeline."),
                                       lower=1)

FOREGROUND_DEFAULT_COLOR = 0xFFFFFFFF  # White
BACKGROUND_DEFAULT_COLOR = 0x00000000  # Transparent
DEFAULT_FONT_DESCRIPTION = "Sans 36"
DEFAULT_VALIGNMENT = GES.TextVAlign.ABSOLUTE
DEFAULT_HALIGNMENT = GES.TextHAlign.ABSOLUTE


class TitleEditor(Loggable):
    """Widget for configuring a title.

    Attributes:
        app (Pitivi): The app.
Пример #6
0
from pitivi.settings import GlobalSettings
from pitivi.utils.loggable import Loggable
from pitivi.utils.timeline import SELECT
from pitivi.utils.ui import argb_to_gdk_rgba
from pitivi.utils.ui import fix_infobar
from pitivi.utils.ui import gdk_rgba_to_argb

GlobalSettings.addConfigOption('titleClipLength',
                               section="user-interface",
                               key="title-clip-length",
                               default=5000,
                               notify=True)

PreferencesDialog.addNumericPreference('titleClipLength',
                                       section="timeline",
                                       label=_("Title clip duration"),
                                       description=_(
                                           "Default clip length (in milliseconds) of titles when inserting on the timeline."),
                                       lower=1)

FOREGROUND_DEFAULT_COLOR = 0xFFFFFFFF  # White
BACKGROUND_DEFAULT_COLOR = 0x00000000  # Transparent
DEFAULT_FONT_DESCRIPTION = "Sans 36"
DEFAULT_VALIGNMENT = GES.TextVAlign.ABSOLUTE
DEFAULT_HALIGNMENT = GES.TextHAlign.ABSOLUTE


class TitleEditor(Loggable):
    """Widget for configuring a title.

    Attributes:
        app (Pitivi): The app.
Пример #7
0
from ruler import ScaleRuler
from gettext import gettext as _
from pitivi.utils.pipeline import Pipeline, PipelineError
from elements import URISourceElement, TransitionElement, Ghostclip
from controls import ControlContainer

GlobalSettings.addConfigOption('edgeSnapDeadband',
    section="user-interface",
    key="edge-snap-deadband",
    default=5,
    notify=True)

PreferencesDialog.addNumericPreference('edgeSnapDeadband',
    section=_("Behavior"),
    label=_("Snap distance"),
    description=_("Threshold (in pixels) at which two clips will snap together "
        "when dragging or trimming."),
    lower=0)

GlobalSettings.addConfigOption('imageClipLength',
    section="user-interface",
    key="image-clip-length",
    default=1000,
    notify=True)

PreferencesDialog.addNumericPreference('imageClipLength',
    section=_("Behavior"),
    label=_("Image clip duration"),
    description=_("Default clip length (in miliseconds) of images when inserting on the timeline."),
    lower=1)