Esempio n. 1
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)

        self.config = IconizerConfig()
        config_dir = self.app.appdata.app_config_dir
        config_file = os.path.join(config_dir, 'iconizer_config.xml')
        self.config.load(config_file)

        self.panel.pack((5, 5))
        hpanel = wal.HPanel(self.panel)
        hpanel.pack(wal.Label(hpanel, _('Background:')))
        self.bg_color_btn = wal.ColorButton(hpanel,
                                            self.config.bg_color,
                                            onchange=self.update,
                                            silent=False)
        hpanel.pack((5, 5))
        hpanel.pack(self.bg_color_btn)
        self.panel.pack(hpanel, padding=5)

        self.pallete = CBMiniPalette(self.panel,
                                     COLORS,
                                     onclick=self.bg_color_btn.set_value)
        self.panel.pack(self.pallete)

        self.panel.pack((10, 10))

        self.viewer = ImageViewer(self.panel, self.config.bg_color)
        self.panel.pack(self.viewer)

        self.panel.pack((10, 10))

        check_panel = wal.VPanel(self.panel)

        self.border_check = wal.Checkbox(check_panel,
                                         _('Show image border'),
                                         value=self.config.draw_border,
                                         onclick=self.update)
        check_panel.pack(self.border_check, align_center=False)

        self.sel_check = wal.Checkbox(check_panel,
                                      _('Draw selected only'),
                                      value=self.config.draw_selected,
                                      onclick=self.update)
        check_panel.pack(self.sel_check, align_center=False)

        self.panel.pack(check_panel)

        self.apply_btn = wal.Button(self.panel,
                                    _('Save image'),
                                    onclick=self.apply_action)
        self.panel.pack(self.apply_btn, fill=True, padding_all=5)

        self.panel.pack((5, 5))

        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)
Esempio n. 2
0
    def __init__(self):
        wal.MainWindow.__init__(self)
        self.set_size(SIZE)

        self.check1 = wal.Checkbox(self, 'Regular checkbox', 
            onclick=self.on_click)
        self.pack(self.check1)

        self.check2 = wal.Checkbox(self, 'Right checkbox', 
            right=True)
        self.pack(self.check2)

        self.check3 = wal.NumCheckbox(self, 'Numeric checkbox', 
            onclick=self.on_click3)
        self.pack(self.check3)
Esempio n. 3
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        panel = wal.VPanel(self.panel)

        panel.pack(wal.Label(panel, _('Text position on circle')),
                   padding_all=5)

        self.bmp = PositionSwitch(panel)
        panel.pack(self.bmp, padding_all=5)

        self.other_side = wal.Checkbox(panel, _('Place on other side'),
                                       onclick=self.update_bmp)
        panel.pack(self.other_side, padding=5)

        self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action)
        panel.pack(self.apply_btn, padding=5, fill=True)

        self.panel.pack(panel, fill=True, padding_all=5)
        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)

        self.update()
Esempio n. 4
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)

        txt = _('Colorspace profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, rows=10, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        self.cs_widgets = {}
        self.cs_profiles = {}
        self.cs_config_profiles = {}

        self.cs_config = {COLOR_RGB: config.cms_rgb_profile,
                          COLOR_CMYK: config.cms_cmyk_profile,
                          COLOR_LAB: config.cms_lab_profile,
                          COLOR_GRAY: config.cms_gray_profile,
                          COLOR_DISPLAY: config.cms_display_profile}

        for colorspace in COLORSPACES[:-1]:
            txt = _('%s profile:') % colorspace
            grid.pack(wal.Label(grid, txt))
            combo = wal.Combolist(grid, items=[])
            self.cs_widgets[colorspace] = combo
            grid.pack(combo, fill=True)
            self.update_combo(colorspace)
            grid.pack(ManageButton(grid, self, colorspace))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Hardware profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Display profile:')
        grid.pack(wal.Label(grid, txt))
        combo = wal.Combolist(grid, items=[])
        self.cs_widgets[COLOR_DISPLAY] = combo
        grid.pack(combo, fill=True)
        self.update_combo(COLOR_DISPLAY)
        grid.pack(ManageButton(grid, self, COLOR_DISPLAY))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Use display profile')
        self.display_check = wal.Checkbox(self, txt,
                                          config.cms_use_display_profile,
                                          onclick=self.activate_display)
        self.pack(self.display_check, align_center=False)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        txt = _('Note: Display profile for your hardware you could fetch here:')
        label = wal.Label(self, txt, fontsize=-1)
        self.pack(label, fill=True, padding_all=5)
        self.pack(wal.HtmlLabel(self, 'http://icc.opensuse.org/'))
        self.activate_display()
Esempio n. 5
0
	def __init__(self, parent, app):
		self.app = app
		wal.LabeledPanel.__init__(self, parent, _('Align'))

		self.pack((5, 5))
		self.pack(wal.Label(self, _('Relative to:')))
		self.source = wal.Combolist(self, items=SOURCE_NAMES,
								onchange=self.update)
		self.pack(self.source, padding_all=5, fill=True)
		self.pack((5, 5))

		self.halign = wal.HToggleKeeper(self, H_ALIGN_MODES,
								H_ALIGN_MODE_ICONS, H_ALIGN_MODE_NAMES,
								on_change=self.update, allow_none=True)
		self.pack(self.halign)
		self.halign.set_mode(ALIGN_CENTER)

		self.valign = wal.HToggleKeeper(self, V_ALIGN_MODES,
								V_ALIGN_MODE_ICONS, V_ALIGN_MODE_NAMES,
								on_change=self.update, allow_none=True)
		self.pack(self.valign, padding_all=5)
		self.valign.set_mode(ALIGN_CENTER)

		self.group = wal.Checkbox(self, _('Selection as group'), True,
								onclick=self.update)
		self.pack(self.group, padding_all=5)

		self.apply_btn = wal.Button(self, _('Apply'), onclick=self.action)
		self.pack(self.apply_btn, padding_all=5, fill=True)
Esempio n. 6
0
    def build(self):
        grid = wal.GridPanel(self, 2, 3, 2, 2)

        grid.pack(get_bmp(grid, make_artid('h-sign')))
        self.h_spin = UnitSpin(self.app,
                               grid,
                               can_be_negative=True,
                               onchange=self.on_reset)
        grid.pack(self.h_spin)
        grid.pack(UnitLabel(self.app, grid))

        grid.pack(get_bmp(grid, make_artid('v-sign')))
        self.v_spin = UnitSpin(self.app,
                               grid,
                               can_be_negative=True,
                               onchange=self.on_reset)
        grid.pack(self.v_spin)
        grid.pack(UnitLabel(self.app, grid))

        self.pack(grid, align_center=False, padding=5)
        self.abs_pos = wal.Checkbox(self,
                                    _('Absolute position'),
                                    onclick=self.update)
        self.pack(self.abs_pos, align_center=False, padding=5)

        self.active_widgets = [self.h_spin, self.v_spin, self.abs_pos]
Esempio n. 7
0
    def build(self):
        grid = wal.GridPanel(self, 1, 3, 2, 2)

        grid.pack(wal.Label(grid, _('Angle:')))
        self.angle = AngleSpin(grid,
                               val_range=(-360.0, 360.0),
                               check_focus=True)
        grid.pack(self.angle)
        grid.pack(wal.Label(grid, u'°'))

        self.pack(grid, align_center=False, padding=5)
        self.pack(wal.Label(grid, _('Center:')), align_center=False, padding=5)

        grid = wal.GridPanel(self, 2, 3, 2, 2)

        grid.pack(get_bmp(grid, make_artid('h-sign')))
        self.h_spin = UnitSpin(self.app, grid, can_be_negative=True)
        grid.pack(self.h_spin)
        grid.pack(UnitLabel(self.app, grid))

        grid.pack(get_bmp(grid, make_artid('v-sign')))
        self.v_spin = UnitSpin(self.app, grid, can_be_negative=True)
        grid.pack(self.v_spin)
        grid.pack(UnitLabel(self.app, grid))

        self.pack(grid, align_center=False, padding_all=5)
        self.center = wal.Checkbox(self,
                                   _('Relative center'),
                                   onclick=self.on_click)
        self.pack(self.center, align_center=False, padding=5)

        self.active_widgets = [self.angle, self.center]
        self.on_click()
Esempio n. 8
0
	def build(self):
		grid = wal.GridPanel(self, 2, 5, 2, 2)

		grid.pack(get_bmp(grid, make_artid('h-sign')))
		self.h_spin = wal.FloatSpin(grid, 100.0, (0.01, 10000.0), 1.0,
								 onchange=self.on_reset)
		grid.pack(self.h_spin)
		grid.pack(wal.Label(grid, '%'))
		grid.pack((5, 5))
		self.h_mirror = wal.ImageToggleButton(grid, False,
					make_artid('h-mirror'), tooltip=_('Horizontal mirror'),
					flat=False)
		grid.pack(self.h_mirror)

		grid.pack(get_bmp(grid, make_artid('v-sign')))
		self.v_spin = wal.FloatSpin(grid, 100.0, (0.01, 10000.0), 1.0,
								 onchange=self.height_changed)
		grid.pack(self.v_spin)
		grid.pack(wal.Label(grid, '%'))
		grid.pack((5, 5))
		self.v_mirror = wal.ImageToggleButton(grid, False,
					make_artid('v-mirror'), tooltip=_('Vertical mirror'),
					flat=False)
		grid.pack(self.v_mirror)

		self.pack(grid, align_center=False, padding=5)
		self.proportion = wal.Checkbox(self, _('Keep ratio'), True)
		self.pack(self.proportion, align_center=False, padding=5)

		self.active_widgets = [self.h_spin, self.h_mirror, self.v_spin,
							self.v_mirror, self.proportion]
Esempio n. 9
0
    def __init__(self, parent, prefpanel):
        CMS_Tab.__init__(self, parent, prefpanel)
        txt = _('Activate Color Management')
        panel = wal.VPanel(self)
        hp = wal.HPanel(panel)
        self.cms_check = wal.Checkbox(hp,
                                      txt,
                                      config.cms_use,
                                      onclick=self.activate_cms)

        hp.pack(self.cms_check)
        panel.pack(hp, fill=True, padding_all=3)

        self.banner = wal.VPanel(panel)
        self.banner.set_bg(wal.DARK_GRAY)
        bmp = get_bmp(self.banner, icons.PD_PREFS_CMS_BANNER)
        self.banner.pack(bmp, padding=2)
        panel.pack(self.banner, expand=True, fill=True)
        txt = _(
            'Note: If Color Management is not activated all colors '
            'will be processed using simple calculation procedures. Therefore '
            'resulted color values will be not accurate.')
        fontsize = -3
        if wal.is_msw(): fontsize = -1
        label = wal.Label(self, txt, fontsize=fontsize)
        label.set_enable(False)
        if wal.is_msw(): label.wrap(430)
        panel.pack(label, fill=True, padding_all=5)
        self.pack(panel, fill=True, expand=True)
Esempio n. 10
0
    def build(self):

        self.pack((5, 5))

        vpanel = wal.VPanel(self)

        hpanel = wal.HPanel(vpanel)
        hpanel.pack(wal.Label(hpanel, _('Guide color:')))
        hpanel.pack((10, 5))
        self.color = self.doc.methods.get_guide_rgb_color()
        self.guide_color_btn = wal.ColorButton(hpanel,
                                               self.color[:3],
                                               onchange=self.on_change)
        hpanel.pack(self.guide_color_btn)
        hpanel.pack((10, 5))
        hpanel.pack(
            CBMiniPalette(hpanel,
                          colors=GUIDE_COLORS,
                          onclick=self.change_color))
        vpanel.pack(hpanel, fill=True, align_center=False)

        val = self.doc.methods.is_guide_visible()
        self.show_guide_check = wal.Checkbox(vpanel,
                                             _('Show guides on canvas'), val)
        vpanel.pack(self.show_guide_check, align_center=False, padding=5)

        self.pack((10, 10))

        self.preview = GuidePreview(vpanel, deepcopy(self.color))
        vpanel.pack(self.preview, fill=True, expand=True)

        self.pack(vpanel, fill=True, expand=True, padding_all=5)
Esempio n. 11
0
    def build(self):
        txt = _('Create new document on start')
        self.newdoc = wal.Checkbox(self, txt, config.new_doc_on_start)
        self.pack(self.newdoc, align_center=False, start_padding=5)

        txt = _('Make backup on document save')
        self.backup = wal.Checkbox(self, txt, config.make_backup)
        self.pack(self.backup, align_center=False)

        txt = _('Make backup on export')
        self.expbackup = wal.Checkbox(self, txt, config.make_export_backup)
        self.pack(self.expbackup, align_center=False)

        grid = wal.GridPanel(self, rows=2, cols=3, hgap=5, vgap=3)
        grid.pack(wal.Label(grid, _('History log size:')))
        self.hist_size = wal.IntSpin(grid,
                                     config.history_size, (10, 1000),
                                     spin_overlay=config.spin_overlay)
        grid.pack(self.hist_size)
        grid.pack(wal.Label(grid, _('records')))
        grid.pack(wal.Label(grid, _('History menu size:')))
        self.hist_menu_size = wal.IntSpin(grid,
                                          config.history_list_size, (5, 20),
                                          spin_overlay=config.spin_overlay)
        grid.pack(self.hist_menu_size)
        grid.pack(wal.Label(grid, _('records')))
        self.pack(grid, align_center=False, padding=5)

        txt = _('Show quick access buttons')
        self.stub_buttons = wal.Checkbox(self, txt, config.show_stub_buttons)
        self.pack(self.stub_buttons, align_center=False)

        if not config.is_mac():
            txt = _('Use overlay for spinbox widgets (*)')
            self.spin_overlay = wal.Checkbox(self, txt, config.spin_overlay)
            self.pack(self.spin_overlay, align_center=False)

        if config.is_ubuntu():
            txt = _('Ubuntu related features')
            self.pack(wal.Label(grid, txt, fontsize=2, fontbold=True),
                      start_padding=10)
            self.pack(wal.HLine(self), fill=True, padding=2)

            txt = _('Use Unity Global Menu (*)')
            self.ubuntu_gm = wal.Checkbox(self, txt, config.ubuntu_global_menu)
            self.pack(self.ubuntu_gm, align_center=False)

            txt = _('Allow overlay for scrollbars (*)')
            self.ubuntu_overlay = wal.Checkbox(self, txt,
                                               config.ubuntu_scrollbar_overlay)
            self.pack(self.ubuntu_overlay, align_center=False)

        if not config.is_mac():
            self.pack(wal.HPanel(self), expand=True, fill=True)
            txt = _('(*) - These options require application restart')
            self.pack(wal.Label(grid, txt, fontsize=-1), align_center=False)

        self.built = True
Esempio n. 12
0
    def build(self):
        hpanel = wal.HPanel(self)
        title = _('Number of copies:')
        hpanel.pack(wal.Label(hpanel, title), padding=5)
        self.num_copies = wal.IntSpin(hpanel, 1, (1, 9999),
                                      onchange=self.copies_changed)
        hpanel.pack(self.num_copies)
        self.cont.pack(hpanel)

        self.indicator = wal.Bitmap(hpanel, self.icons['00'])
        self.cont.pack(self.indicator, padding=5)

        hpanel = wal.HPanel(self)
        self.collate = wal.Checkbox(hpanel, _('Collate'),
                                    onclick=self.flag_changed)
        hpanel.pack(self.collate)
        hpanel.pack(SPACER)
        self.reverse = wal.Checkbox(hpanel, _('Reverse'),
                                    onclick=self.flag_changed)
        hpanel.pack(self.reverse)
        self.cont.pack(hpanel)
Esempio n. 13
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        panel = wal.VPanel(self.panel)

        panel.pack(wal.Label(panel, _('Text position on path')), padding_all=5)

        hp = wal.HPanel(panel)
        hp.pack(wal.Label(hp, _('Base point:')))
        self.base_point = wal.FloatSpin(hp,
                                        value=50.0,
                                        range_val=(0.0, 100.0),
                                        step=1.0)
        hp.pack(self.base_point, padding=5)
        hp.pack(wal.Label(hp, _('%')))

        panel.pack(hp, padding=5)

        self.align_keeper = wal.HToggleKeeper(panel,
                                              TEXT_ALIGNS,
                                              TEXT_ALIGN_ICONS,
                                              TEXT_ALIGN_TEXTS,
                                              on_change=self.update_bmp)
        panel.pack(self.align_keeper)
        self.align_keeper.set_mode(TEXT_ALIGNS[1])

        border = wal.VPanel(panel)
        color = wal.GRAY
        if wal.is_gtk(): color = wal.UI_COLORS['pressed_border']
        border.set_bg(color)
        self.pic_panel = wal.VPanel(border)
        self.pic_panel.set_bg(wal.WHITE)
        self.bmp = get_bmp(self.pic_panel, TEXT_ALIGN_PICS[TEXT_ALIGNS[1]])
        self.pic_panel.pack(self.bmp, padding_all=5)
        border.pack(self.pic_panel, padding_all=1)
        panel.pack(border, padding=10)

        self.other_side = wal.Checkbox(panel,
                                       _('Place on other side'),
                                       onclick=self.update_bmp)
        panel.pack(self.other_side, padding=5)

        self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action)
        panel.pack(self.apply_btn, padding=5, fill=True)

        self.panel.pack(panel, fill=True, padding_all=5)
        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)

        self.update()
Esempio n. 14
0
    def __init__(self, parent, printer):
        self.printer = printer
        wal.LabeledPanel.__init__(self, parent, _('Generation options'))

        vpanel = wal.VPanel(self)

        grid = wal.GridPanel(vpanel, 2, 2, 2, 3)
        grid.add_growable_col(1)

        grid.pack(wal.Label(grid, _('PDF version:')))

        self.ver_combo = wal.Combolist(grid, items=pdfconst.PDF_VER_NAMES)
        grid.pack(self.ver_combo, fill=True)

        grid.pack(wal.Label(grid, _('Color space:')))

        self.cs_combo = wal.Combolist(grid, items=CS)
        grid.pack(self.cs_combo, fill=True)

        vpanel.pack(grid, fill=True)

        vpanel.pack((3, 3))

        self.use_spot = wal.Checkbox(vpanel, _('Use SPOT colors'))
        vpanel.pack(self.use_spot, align_center=False)

        self.compressed = wal.Checkbox(vpanel, _('Use compression'))
        vpanel.pack(self.compressed, align_center=False)

        self.pack(vpanel, fill=True, expand=True, padding_all=5)

        index = pdfconst.PDF_VERSIONS.index(self.printer.pdf_version)
        self.ver_combo.set_active(index)
        self.cs_combo.set_active(CS.index(self.printer.colorspace))
        self.use_spot.set_value(self.printer.use_spot)
        self.compressed.set_value(self.printer.compressed)
Esempio n. 15
0
    def build(self):
        grid = wal.GridPanel(self, 2, 3, 2, 2)

        grid.pack(get_bmp(grid, make_artid('h-sign')))
        self.h_spin = UnitSpin(self.app, grid, onchange=self.on_reset)
        grid.pack(self.h_spin)
        grid.pack(UnitLabel(self.app, grid))

        grid.pack(get_bmp(grid, make_artid('v-sign')))
        self.v_spin = UnitSpin(self.app, grid, onchange=self.height_changed)
        grid.pack(self.v_spin)
        grid.pack(UnitLabel(self.app, grid))

        self.pack(grid, align_center=False, padding=5)
        self.proportion = wal.Checkbox(self, _('Keep ratio'), True)
        self.pack(self.proportion, align_center=False, padding=5)

        self.active_widgets = [self.h_spin, self.v_spin, self.proportion]
Esempio n. 16
0
    def __init__(self, parent, app):
        wal.VPanel.__init__(self, parent)
        self.app = app

        self.pack(wal.Label(self, SHAPING_MODE_NAMES[self.pid], fontbold=True))

        self.pic_panel = wal.VPanel(self, border=True)
        self.pic_panel.set_bg(wal.WHITE)
        self.bmp = get_bmp(self.pic_panel, SHAPING_MODE_PICS[self.pid])
        self.pic_panel.pack(self.bmp, padding_all=5)
        self.pack(self.pic_panel, padding=10)

        self.del_check = wal.Checkbox(self, _('Delete originals'))
        self.pack(self.del_check)

        txt = _('Apply')
        if self.pid == TRIM_MODE: txt = _('Apply to...')
        self.apply_btn = wal.Button(self, txt, onclick=self.action)
        self.pack(self.apply_btn, fill=True, padding_all=5)
Esempio n. 17
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)
        txt = _('Activate Color Management')
        panel = wal.VPanel(self)
        hp = wal.HPanel(panel)
        self.cms_check = wal.Checkbox(hp, txt, config.cms_use,
                                      onclick=self.activate_cms)

        hp.pack(self.cms_check)
        panel.pack(hp, fill=True, padding_all=3)

        self.banner = wal.VPanel(panel)
        self.banner.set_bg(wal.DARK_GRAY)
        bmp = get_bmp(self.banner, icons.PD_PREFS_CMS_BANNER)
        self.banner.pack(bmp, padding=2)
        panel.pack(self.banner, expand=True, fill=True)
        txt = _('Note: If not activated the color values will be not accurate.')
        label = wal.Label(self, txt, fontsize=-1)
        panel.pack(label, fill=True, padding_all=5)
        self.pack(panel, fill=True, expand=True)
Esempio n. 18
0
	def __init__(self, parent, app):
		wal.VPanel.__init__(self, parent)
		self.app = app

		self.pack(wal.Label(self, SHAPING_MODE_NAMES[self.pid], fontbold=True))

		border = wal.VPanel(self)
		color = wal.GRAY
		if wal.is_gtk():color = wal.UI_COLORS['pressed_border']
		border.set_bg(color)
		self.pic_panel = wal.VPanel(border)
		self.pic_panel.set_bg(wal.WHITE)
		self.bmp = get_bmp(self.pic_panel, SHAPING_MODE_PICS[self.pid])
		self.pic_panel.pack(self.bmp, padding_all=5)
		border.pack(self.pic_panel, padding_all=1)
		self.pack(border, padding=10)

		self.del_check = wal.Checkbox(self, _('Delete originals'))
		self.pack(self.del_check)

		txt = _('Apply')
		if self.pid == TRIM_MODE: txt = _('Apply to...')
		self.apply_btn = wal.Button(self, txt, onclick=self.action)
		self.pack(self.apply_btn, fill=True, padding_all=5)
Esempio n. 19
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)

        self.intents = INTENTS.keys()
        self.intents.sort()
        self.intents_names = []
        for item in self.intents:
            self.intents_names.append(INTENTS[item])

        panel = wal.VPanel(self.panel)

        # Intents panel
        int_panel = wal.LabeledPanel(panel, _('Rendering intents'))
        grid = wal.GridPanel(int_panel, vgap=5, hgap=5)

        grid.pack(wal.Label(grid, _('Display/RGB intent:')))
        self.display = wal.Combolist(grid, items=self.intents_names)
        self.display.set_active(self.intents.index(config.cms_rgb_intent))
        grid.pack(self.display)

        grid.pack(wal.Label(grid, _('Printer/CMYK intent:')))
        self.printer = wal.Combolist(grid, items=self.intents_names)
        self.printer.set_active(self.intents.index(config.cms_cmyk_intent))
        grid.pack(self.printer)

        int_panel.pack(grid, align_center=False, padding_all=10)
        panel.pack(int_panel, fill=True)

        # Simulate printer panel
        txt = _('Simulate printer on the screen')
        self.simulate_check = wal.Checkbox(panel,
                                           txt,
                                           config.cms_proofing,
                                           onclick=self.activate_simulation)

        sm_panel = wal.LabeledPanel(panel, widget=self.simulate_check)

        txt = _("Highlight colors that are outside of the printer's gamut")
        self.outcolors_check = wal.Checkbox(sm_panel,
                                            txt,
                                            config.cms_gamutcheck,
                                            onclick=self.activate_outcolors)
        sm_panel.pack(self.outcolors_check, align_center=False, padding_all=5)

        clrpanel = wal.HPanel(sm_panel)
        clrpanel.pack((20, 1))
        self.alarm_label = wal.Label(clrpanel, _('Highlight color:'))
        clrpanel.pack(self.alarm_label, padding=5)
        self.color_btn = wal.ColorButton(clrpanel, config.cms_alarmcodes)
        clrpanel.pack(self.color_btn)
        sm_panel.pack(clrpanel, align_center=False, padding_all=2)

        txt = _('Separation for SPOT colors')
        self.separation_check = wal.Checkbox(sm_panel,
                                             txt,
                                             config.cms_proof_for_spot,
                                             onclick=self.activate_outcolors)
        sm_panel.pack(self.separation_check, align_center=False, padding_all=5)

        panel.pack(sm_panel, fill=True, padding=5)

        # Bottom checks
        txt = _('Use Blackpoint Compensation')
        self.bpc_check = wal.Checkbox(panel, txt, config.cms_bpc_flag)
        panel.pack(self.bpc_check, align_center=False)

        if wal.IS_MSW:
            panel.pack((5, 5))

        txt = _('Use Black preserving transforms')
        self.bpt_check = wal.Checkbox(panel, txt, config.cms_bpt_flag)
        panel.pack(self.bpt_check, align_center=False)

        self.panel.pack(panel, fill=True, padding_all=5)
        self.activate_simulation()
Esempio n. 20
0
    def build(self):
        self.pack((5, 5))

        self.geom = self.doc.methods.get_grid_values()
        hpanel = wal.HPanel(self)

        txt = _('Grid origin')
        origin_panel = wal.LabeledPanel(hpanel, text=txt)
        grid = wal.GridPanel(origin_panel, 2, 3, 5, 5)

        grid.pack(wal.Label(grid, 'X:'))
        self.x_val = UnitSpin(self.app, grid, self.geom[0])
        grid.pack(self.x_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        grid.pack(wal.Label(grid, 'Y:'))
        self.y_val = UnitSpin(self.app, grid, self.geom[1])
        grid.pack(self.y_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        origin_panel.pack(grid, padding_all=5)
        hpanel.pack(origin_panel, padding_all=5, fill=True, expand=True)

        txt = _('Grid frequency')
        freq_panel = wal.LabeledPanel(hpanel, text=txt)
        grid = wal.GridPanel(origin_panel, 2, 3, 5, 5)

        grid.pack(wal.Label(grid, 'dX:'))
        self.dx_val = UnitSpin(self.app, grid, self.geom[2])
        grid.pack(self.dx_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        grid.pack(wal.Label(grid, 'dY:'))
        self.dy_val = UnitSpin(self.app, grid, self.geom[3])
        grid.pack(self.dy_val)
        grid.pack(StaticUnitLabel(self.app, grid))

        freq_panel.pack(grid, padding_all=5)
        hpanel.pack(freq_panel, padding_all=5, fill=True, expand=True)

        self.pack(hpanel, fill=True)

        self.pack((5, 5))

        color_panel = wal.HPanel(self)

        color_panel.pack((10, 10))

        vpanel = wal.VPanel(color_panel)

        hpanel = wal.HPanel(vpanel)
        hpanel.pack(wal.Label(hpanel, _('Grid color:')))
        hpanel.pack((10, 5))
        self.color = self.doc.methods.get_grid_rgba_color()
        self.grid_color_btn = wal.ColorButton(hpanel,
                                              self.color[:3],
                                              onchange=self.on_change)
        hpanel.pack(self.grid_color_btn)
        vpanel.pack(hpanel, fill=True)

        hpanel = wal.HPanel(vpanel)
        hpanel.pack(wal.Label(hpanel, _('Grid opacity:')))
        hpanel.pack((10, 5))
        self.alpha_spin = wal.FloatSpin(hpanel,
                                        self.color[3] * 100.0,
                                        range_val=(0.0, 100.0),
                                        onchange=self.on_spin_change,
                                        onenter=self.on_spin_change)
        hpanel.pack(self.alpha_spin)
        hpanel.pack(wal.Label(hpanel, '%'), padding=3)

        vpanel.pack(hpanel, fill=True, padding=5)

        self.alpha_slider = wal.Slider(vpanel,
                                       int(self.color[3] * 100.0),
                                       range_val=(0, 100),
                                       onchange=self.on_slider_change)
        vpanel.pack(self.alpha_slider, fill=True, padding=5)

        val = self.doc.methods.is_grid_visible()
        self.show_grid_check = wal.Checkbox(vpanel, _('Show grid on canvas'),
                                            val)
        vpanel.pack(self.show_grid_check, fill=True, padding=5)

        color_panel.pack(vpanel)

        color_panel.pack((10, 10))

        preview_panel = wal.VPanel(color_panel)
        preview_panel.pack(wal.Label(hpanel, _('Grid preview:')))
        preview_panel.pack((5, 5))
        self.grid_preview = GridPreview(preview_panel, self.color)
        preview_panel.pack(self.grid_preview, fill=True, expand=True)
        color_panel.pack(preview_panel, fill=True, expand=True)

        color_panel.pack((10, 10))

        self.pack(color_panel, fill=True)
Esempio n. 21
0
    def build(self):
        self.page_format = self.doc.methods.get_default_page_format()
        self.formats = [
            _('Custom'),
        ] + uc2const.PAGE_FORMAT_NAMES
        self.pack((5, 10))

        # ---
        hpanel = wal.HPanel(self)
        hpanel.pack((5, 5))
        label = wal.Label(hpanel, _('Default page:'))
        hpanel.pack(label)
        hpanel.pack((5, 5))
        self.page_combo = wal.Combolist(self,
                                        items=self.formats,
                                        onchange=self.page_combo_changed)
        index = 0
        state = True
        if self.page_format[0] in uc2const.PAGE_FORMAT_NAMES:
            index = self.formats.index(self.page_format[0])
            state = False
        self.page_combo.set_active(index)

        hpanel.pack(self.page_combo)

        hpanel.pack((15, 5))

        self.orient_keeper = wal.HToggleKeeper(self,
                                               ORIENTS,
                                               ORIENTS_ICONS,
                                               ORIENTS_NAMES,
                                               on_change=self.orient_changed)
        self.orient_keeper.set_mode(self.page_format[2])
        hpanel.pack(self.orient_keeper)

        self.pack(hpanel, fill=True)

        self.pack((5, 5))

        # ---
        w, h = self.page_format[1]
        hpanel = wal.HPanel(self)
        dx = label.get_size()[0] + 10
        hpanel.pack((dx, 5))

        self.page_width = UnitSpin(self.app,
                                   hpanel,
                                   w,
                                   onchange=self.page_spin_changed)
        hpanel.pack(self.page_width)
        hpanel.pack(get_bmp(self, icons.CTX_W_ON_H), padding=5)
        self.page_height = UnitSpin(self.app,
                                    hpanel,
                                    h,
                                    onchange=self.page_spin_changed)
        hpanel.pack(self.page_height)
        hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5)
        self.page_width.set_enable(state)
        self.page_height.set_enable(state)

        self.pack(hpanel, fill=True)
        self.pack(wal.HLine(self), padding_all=5, fill=True)

        # ---
        hpanel = wal.HPanel(self)
        hpanel.pack((5, 5))
        self.desktop_bg = self.doc.methods.get_desktop_bg()

        grid = wal.GridPanel(hpanel, 3, 3, 5, 5)
        grid.add_growable_col(2)

        grid.pack(wal.Label(hpanel, _('Desktop:')))
        self.desktop_color_btn = wal.ColorButton(hpanel, self.desktop_bg)
        grid.pack(self.desktop_color_btn)
        grid.pack(CBMiniPalette(grid,
                                onclick=self.desktop_color_btn.set_value))

        self.page_fill = self.doc.methods.get_page_fill()
        if self.page_fill[0] == FILL_SOLID:
            color1 = self.page_fill[1]
            color2 = [1.0, 1.0, 1.0]
        else:
            color1 = self.page_fill[1][0]
            color2 = self.page_fill[1][1]

        grid.pack(wal.Label(hpanel, _('Page:')))
        self.page_color1_btn = wal.ColorButton(hpanel, color1)
        grid.pack(self.page_color1_btn)
        grid.pack(CBMiniPalette(grid, onclick=self.page_color1_btn.set_value))

        grid.pack((5, 5))
        self.page_color2_btn = wal.ColorButton(hpanel, color2)
        grid.pack(self.page_color2_btn)
        self.colors2 = CBMiniPalette(grid,
                                     onclick=self.page_color2_btn.set_value)
        grid.pack(self.colors2)
        if not self.page_fill[0] == FILL_PATTERN:
            self.page_color2_btn.set_enable(False)
            self.colors2.set_enable(False)

        hpanel.pack(grid, fill=True)
        hpanel.pack((5, 5))
        self.pack(hpanel, fill=True)

        # ---
        vpanel = wal.VPanel(self)
        if wal.IS_MSW: vpanel.pack((5, 5))

        self.pattern_check = wal.Checkbox(vpanel,
                                          _('Use pattern for page fill'),
                                          self.page_fill[0] == FILL_PATTERN,
                                          onclick=self.pattern_check_changed)
        vpanel.pack(self.pattern_check, align_center=False)

        if wal.IS_MSW: vpanel.pack((5, 5))

        self.border_flag = self.doc.methods.get_page_border()
        self.border_check = wal.Checkbox(vpanel, _('Show page border'),
                                         self.border_flag)
        vpanel.pack(self.border_check, align_center=False)
        self.pack(vpanel, fill=True, padding_all=5)
Esempio n. 22
0
    def build(self):
        vpanel = wal.VPanel(self)
        grid = wal.GridPanel(vpanel, rows=4, cols=2, hgap=25, vgap=7)

        txt = _('Language (*):')
        grid.pack(wal.Label(grid, txt))
        self.lang = wal.Combolist(grid, items=LANGS)
        index = 0 if config.language == 'system' \
            else LANGS.index(config.language)
        self.lang.set_active(index)
        grid.pack(self.lang, fill=True)

        txt = _('UI style (*):')
        grid.pack(wal.Label(grid, txt))
        items = [_('Classic'), _('Tabbed')]
        self.ui_style = wal.Combolist(grid, items=items)
        self.ui_style.set_active(config.ui_style)
        grid.pack(self.ui_style, fill=True)

        txt = _('Tab style:')
        grid.pack(wal.Label(grid, txt))
        items = [
            _('Rectangular tabs'),
            _('Rounded tabs'),
            _('Flat tabs'),
            _('Trapezoidal tabs')
        ]
        self.tab_style = wal.Combolist(grid, items=items)
        index = config.tab_style if config.tab_style < len(items) else 0
        self.tab_style.set_active(index)
        grid.pack(self.tab_style, fill=True)

        txt = _('Show quick access buttons')
        grid.pack(wal.Label(grid, txt))
        self.stub_buttons = wal.Switch(grid, config.show_stub_buttons)
        grid.pack(self.stub_buttons)

        vpanel.pack(grid, align_center=False, padding_all=10)

        # ---------------------------------

        int_vp = wal.VPanel(vpanel)
        vpanel.pack(int_vp, fill=True, padding_all=5)

        if not wal.IS_MAC and wal.IS_WX2:
            txt = _('Use overlay for spinbox widgets (*)')
            self.spin_overlay = wal.Checkbox(int_vp, txt, config.spin_overlay)
            int_vp.pack(self.spin_overlay, align_center=False)

        if wal.IS_GTK and wal.IS_WX2:
            txt = _('Separate spin in spinbox widgets (*)')
            self.spin_sep = wal.Checkbox(int_vp, txt, config.spin_sep)
            int_vp.pack(self.spin_sep, align_center=False)

        if wal.IS_UNITY:
            txt = _('Unity related features')
            int_vp.pack(wal.Label(int_vp, txt, fontsize=2, fontbold=True),
                        start_padding=10)
            int_vp.pack(wal.HLine(int_vp), fill=True, padding=2)

            txt = _('Use Unity Global Menu (*)')
            self.ubuntu_gm = wal.Checkbox(int_vp, txt,
                                          config.ubuntu_global_menu)
            int_vp.pack(self.ubuntu_gm, align_center=False)

            txt = _('Allow overlay for scrollbars (*)')
            self.ubuntu_overlay = wal.Checkbox(int_vp, txt,
                                               config.ubuntu_scrollbar_overlay)
            int_vp.pack(self.ubuntu_overlay, align_center=False)

        self.pack(vpanel)
        self.pack((1, 1), expand=True)

        txt = _('(*) - Application restart is required to apply these options')
        self.pack(wal.Label(self, txt, fontsize=-1))

        self.built = True
Esempio n. 23
0
    def build(self):

        self.nb = wal.Notebook(self)

        # ========Palette options
        pal_opt = wal.VPanel(self.nb)
        pal_opt.pack((10, 10))

        grid = wal.GridPanel(self, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Current palette:')
        grid.pack(wal.Label(grid, txt))

        pal_list = self.get_palette_list()
        self.pal = wal.Combolist(grid,
                                 items=pal_list,
                                 onchange=self.change_palette)
        current_palette = self.get_current_palette()
        current_palette_name = current_palette.model.name
        self.pal.set_active(pal_list.index(current_palette_name))
        grid.pack(self.pal, fill=True)

        txt = _('Palette orientation:')
        grid.pack(wal.Label(grid, txt))
        self.pal_orient = wal.Combolist(grid, items=PAL_ORIENT)
        self.pal_orient.set_active(config.palette_orientation)
        grid.pack(self.pal_orient)

        pal_opt.pack(grid, fill=True, padding_all=5)

        btm_panel = wal.HPanel(pal_opt)
        pal_opt.pack(btm_panel, expand=True, fill=True)

        cell_panel = wal.VPanel(btm_panel)
        btm_panel.pack(cell_panel, expand=True, fill=True, padding_all=5)

        # ===
        txt = _('Vertical palette')
        vcell_panel = wal.LabeledPanel(cell_panel, text=txt)

        grid = wal.GridPanel(vcell_panel, cols=4, hgap=5, vgap=2)

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell width:')))
        self.vcell_width = wal.IntSpin(grid, config.palette_vcell_width,
                                       (10, 20))
        self.vcell_width.set_enable(False)
        grid.pack(self.vcell_width)
        grid.pack(wal.Label(grid, _('px')))

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell height:')))
        self.vcell_height = wal.IntSpin(grid, config.palette_vcell_height,
                                        (10, 100))
        grid.pack(self.vcell_height)
        grid.pack(wal.Label(grid, _('px')))

        vcell_panel.pack(grid, align_center=False, padding_all=5)
        cell_panel.pack(vcell_panel, fill=True)

        # ===
        txt = _('Horizontal palette')
        hcell_panel = wal.LabeledPanel(cell_panel, text=txt)

        grid = wal.GridPanel(hcell_panel, cols=4, hgap=5, vgap=2)

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell width:')))
        self.hcell_width = wal.IntSpin(grid, config.palette_hcell_width,
                                       (10, 100))
        grid.pack(self.hcell_width)
        grid.pack(wal.Label(grid, _('px')))

        grid.pack((15, 1))
        grid.pack(wal.Label(grid, _('Cell height:')))
        self.hcell_height = wal.IntSpin(grid, config.palette_hcell_height,
                                        (10, 20))
        self.hcell_height.set_enable(False)
        grid.pack(self.hcell_height)
        grid.pack(wal.Label(grid, _('px')))

        hcell_panel.pack(grid, align_center=False, padding_all=5)
        cell_panel.pack(hcell_panel, fill=True, padding=5)
        # ===

        txt = _('Expand short palettes')
        self.expand = wal.Checkbox(cell_panel, txt, config.palette_expand)
        cell_panel.pack(self.expand, align_center=False)

        self.palviewer = PaletteViewer(btm_panel, self.app.default_cms,
                                       current_palette)
        btm_panel.pack(self.palviewer, fill=True, padding_all=5)

        self.nb.add_page(pal_opt, _('Palette options'))

        # ========Palette management
        self.nb.add_page(PaletteManager(self.app, self, self.nb),
                         _('Palette management'))

        self.pack(self.nb, expand=True, fill=True)
        self.built = True
Esempio n. 24
0
    def __init__(self, parent, dlg, cms, stops, onchange=None):
        self.dlg = dlg
        self.cms = cms
        self.stops = deepcopy(stops)
        if onchange:
            self.callback = onchange
        wal.VPanel.__init__(self, parent)
        self.pack((5, 5))
        self.viewer = GradientViewer(self,
                                     self.cms,
                                     self.stops,
                                     onclick=self.insert_stop)
        self.pack(self.viewer)
        self.stop_editor = StopsEditor(self,
                                       self.stops,
                                       onchange=self.set_selected_stop,
                                       onmove=self.change_stop_position)
        self.pack(self.stop_editor)
        self.pack((5, 5))

        hpanel = wal.HPanel(self)
        self.stop_panel = StopPanel(hpanel,
                                    self.dlg,
                                    self.cms,
                                    self.stops,
                                    onposition=self.change_stop_position,
                                    oncolor=self.update_colors)
        hpanel.pack((5, 5))
        hpanel.pack(self.stop_panel)
        hpanel.pack((5, 5))

        vpanel = wal.VPanel(hpanel)
        selpanel = wal.HPanel(vpanel)

        txt = _('Select first stop')
        self.go_first = wal.ImageButton(selpanel,
                                        icons.PD_GOTO_FIRST,
                                        wal.SIZE_16,
                                        tooltip=txt,
                                        flat=False,
                                        onclick=self.select_first)
        selpanel.pack(self.go_first, padding=5)

        txt = _('Select previous stop')
        self.go_prev = wal.ImageButton(selpanel,
                                       icons.PD_GO_BACK,
                                       wal.SIZE_16,
                                       tooltip=txt,
                                       flat=False,
                                       onclick=self.select_prev)
        selpanel.pack(self.go_prev, padding=5)

        txt = _('Select next stop')
        self.go_next = wal.ImageButton(selpanel,
                                       icons.PD_GO_FORWARD,
                                       wal.SIZE_16,
                                       tooltip=txt,
                                       flat=False,
                                       onclick=self.select_next)
        selpanel.pack(self.go_next, padding=5)

        txt = _('Select last stop')
        self.go_last = wal.ImageButton(selpanel,
                                       icons.PD_GOTO_LAST,
                                       wal.SIZE_16,
                                       tooltip=txt,
                                       flat=False,
                                       onclick=self.select_last)
        selpanel.pack(self.go_last, padding=5)

        vpanel.pack(selpanel)

        bpanel = wal.HPanel(vpanel)

        txt = _('Add stop')
        self.add_button = wal.ImageButton(bpanel,
                                          icons.PD_ADD,
                                          wal.SIZE_16,
                                          tooltip=txt,
                                          flat=False,
                                          onclick=self.add_stop)
        bpanel.pack(self.add_button, padding=5)

        txt = _('Delete selected stop')
        self.del_button = wal.ImageButton(bpanel,
                                          icons.PD_REMOVE,
                                          wal.SIZE_16,
                                          tooltip=txt,
                                          flat=False,
                                          onclick=self.delete_selected)
        bpanel.pack(self.del_button)

        txt = _('Reverse gradient')
        bpanel.pack(wal.Button(vpanel,
                               _('Reverse'),
                               tooltip=txt,
                               onclick=self.reverse_gradient),
                    padding=15)

        vpanel.pack(bpanel, padding=5)

        txt = _('Keep gradient vector')
        self.keep_vector = wal.Checkbox(vpanel, txt, True)
        vpanel.pack(self.keep_vector)

        hpanel.pack(vpanel, fill=True, expand=True, padding=5)

        self.pack(hpanel, fill=True)

        self.update()
    def build(self):
        self.nb = wal.Notebook(self)

        # ----------------------

        vpanel = wal.VPanel(self.nb)
        grid = wal.GridPanel(vpanel, rows=3, cols=2, hgap=10, vgap=5)

        grid.pack(wal.Label(grid, _('UI style (*):')))
        items = [_('Classic'), _('Tabbed')]
        self.ui_style = wal.Combolist(grid, items=items)
        self.ui_style.set_active(config.ui_style)
        grid.pack(self.ui_style, fill=True)

        grid.pack(wal.Label(grid, _('Tab style:')))
        items = [
            _('Rectangle tabs'),
            _('Rounded tabs'),
            _('Flat tabs'),
            _('Trapezoidal tabs')
        ]
        self.tab_style = wal.Combolist(grid, items=items)
        index = config.tab_style if config.tab_style < len(items) else 0
        self.tab_style.set_active(index)
        grid.pack(self.tab_style, fill=True)

        grid.pack((1, 1))
        grid.pack((300, 1))

        vpanel.pack(grid, align_center=False, padding_all=10)

        txt = _('Show quick access buttons')
        self.stub_buttons = wal.Checkbox(grid, txt, config.show_stub_buttons)
        vpanel.pack(self.stub_buttons, align_center=False, padding_all=5)

        int_vp = wal.VPanel(vpanel)
        vpanel.pack(int_vp, fill=True, padding_all=5)

        if not wal.IS_MAC and wal.IS_WX2:
            txt = _('Use overlay for spinbox widgets (*)')
            self.spin_overlay = wal.Checkbox(int_vp, txt, config.spin_overlay)
            int_vp.pack(self.spin_overlay, align_center=False)

        if wal.IS_GTK and wal.IS_WX2:
            txt = _('Separate spin in spinbox widgets (*)')
            self.spin_sep = wal.Checkbox(int_vp, txt, config.spin_sep)
            int_vp.pack(self.spin_sep, align_center=False)

        if wal.IS_UNITY:
            txt = _('Unity related features')
            int_vp.pack(wal.Label(int_vp, txt, fontsize=2, fontbold=True),
                        start_padding=10)
            int_vp.pack(wal.HLine(int_vp), fill=True, padding=2)

            txt = _('Use Unity Global Menu (*)')
            self.ubuntu_gm = wal.Checkbox(int_vp, txt,
                                          config.ubuntu_global_menu)
            int_vp.pack(self.ubuntu_gm, align_center=False)

            txt = _('Allow overlay for scrollbars (*)')
            self.ubuntu_overlay = wal.Checkbox(int_vp, txt,
                                               config.ubuntu_scrollbar_overlay)
            int_vp.pack(self.ubuntu_overlay, align_center=False)

        self.nb.add_page(vpanel, _('UI style'))

        # ----------------------

        vpanel = wal.VPanel(self.nb)
        table = wal.GridPanel(vpanel, rows=1, cols=3, hgap=5, vgap=5)
        vpanel.pack(table, fill=True, padding_all=5)

        int_vp = wal.VPanel(table)

        txt = _('New document on start')
        self.newdoc = wal.Checkbox(int_vp, txt, config.new_doc_on_start)
        int_vp.pack(self.newdoc, align_center=False, padding=3)

        txt = _('Backup on document save')
        self.backup = wal.Checkbox(int_vp, txt, config.make_backup)
        int_vp.pack(self.backup, align_center=False, padding=3)

        txt = _('Make font cache on start')
        self.fcache = wal.Checkbox(int_vp, txt,
                                   config.make_font_cache_on_start)
        int_vp.pack(self.fcache, align_center=False, padding=3)

        txt = _('Backup on export')
        self.expbackup = wal.Checkbox(int_vp, txt, config.make_export_backup)
        int_vp.pack(self.expbackup, align_center=False, padding=3)

        table.pack(int_vp)
        table.pack((15, 5))

        grid = wal.GridPanel(self, rows=4, cols=2, hgap=5, vgap=3)
        grid.pack(wal.Label(grid, _('History log size:')))
        self.hist_size = wal.IntSpin(grid, config.history_size, (10, 1000))
        grid.pack(self.hist_size)
        grid.pack(wal.Label(grid, _('History menu size:')))
        self.hist_menu_size = wal.IntSpin(grid, config.history_list_size,
                                          (5, 20))
        grid.pack(self.hist_menu_size)

        grid.pack(wal.Label(grid, _('Logging level (*):')))
        self.log_level = wal.Combolist(grid, items=LEVELS)
        self.log_level.set_active(LEVELS.index(config.log_level))
        grid.pack(self.log_level)

        grid.pack(wal.Label(grid, _('Language (*):')))
        self.lang = wal.Combolist(grid, items=LANGS)
        index = 0 if config.language == 'system' \
            else LANGS.index(config.language)
        self.lang.set_active(index)
        grid.pack(self.lang)

        table.pack(grid)

        self.nb.add_page(vpanel, _('Generic features'))
        self.pack(self.nb, fill=True, expand=True, padding=5)

        txt = _('(*) - These options require application restart')
        self.pack(wal.Label(grid, txt, fontsize=-1), align_center=False)

        self.built = True
Esempio n. 26
0
    def __init__(self, parent, prefpanel):
        CMS_Tab.__init__(self, parent, prefpanel)

        txt = _('Colorspace profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, rows=10, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        self.cs_widgets = {}
        self.cs_profiles = {}
        self.cs_config_profiles = {}

        self.cs_config = {
            COLOR_RGB: config.cms_rgb_profile,
            COLOR_CMYK: config.cms_cmyk_profile,
            COLOR_LAB: config.cms_lab_profile,
            COLOR_GRAY: config.cms_gray_profile,
            COLOR_DISPLAY: config.cms_display_profile
        }

        for colorspace in COLORSPACES[:-1]:
            txt = _('%s profile:') % colorspace
            grid.pack(wal.Label(grid, txt))
            combo = wal.Combolist(grid, items=[])
            self.cs_widgets[colorspace] = combo
            grid.pack(combo, fill=True)
            self.update_combo(colorspace)
            grid.pack(ManageButton(grid, self, colorspace))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Hardware profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Display profile:')
        grid.pack(wal.Label(grid, txt))
        combo = wal.Combolist(grid, items=[])
        self.cs_widgets[COLOR_DISPLAY] = combo
        grid.pack(combo, fill=True)
        self.update_combo(COLOR_DISPLAY)
        grid.pack(ManageButton(grid, self, COLOR_DISPLAY))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Use display profile')
        self.display_check = wal.Checkbox(self,
                                          txt,
                                          config.cms_use_display_profile,
                                          onclick=self.activate_display)
        self.pack(self.display_check, align_center=False)

        txt = _('Note: Display profile affects on '
                'document screen representation only. The profile for your '
                'hardware you can get either from monitor manufacture or '
                'calibrating monitor (preferred option) or download '
                'from ICC Profile Taxi service: ')
        fontsize = -3
        if wal.is_msw(): fontsize = -1
        label = wal.Label(self, txt, fontsize=fontsize)
        label.set_enable(False)
        if wal.is_msw(): label.wrap(430)
        self.pack(label, fill=True, padding_all=5)
        self.pack(wal.HtmlLabel(self, 'http://icc.opensuse.org/'))
        self.activate_display()