Esempio n. 1
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. 2
0
    def build(self):
        self.changes_flag = False
        self.styles = self._get_styles()
        self.styles_combo = wal.Combolist(self,
                                          items=self.styles,
                                          onchange=self.on_style_change)
        self.add(self.styles_combo, 0, wal.LEFT | wal.CENTER, 2)
        self.add((3, 3))

        self.families, self.faces_dict = libpango.get_fonts()

        self.families_combo = FontChoice(self, onchange=self.on_font_change)
        self.add(self.families_combo, 0, wal.LEFT | wal.CENTER, 2)
        self.add((3, 3))

        self.faces = self.faces_dict['Sans']
        self.faces_combo = wal.Combolist(self,
                                         items=self.faces,
                                         onchange=self.apply_changes)
        self.faces_combo.set_active(0)
        self.add(self.faces_combo, 0, wal.LEFT | wal.CENTER, 2)
        self.add((3, 3))

        self.size_combo = wal.FloatCombobox(self,
                                            12,
                                            width=5,
                                            digits=2,
                                            items=FONT_SIZES,
                                            onchange=self.apply_changes)
        self.add(self.size_combo, 0, wal.LEFT | wal.CENTER, 2)

        self.pack(wal.VLine(self), fill=True, padding_all=3)

        self.align = wal.HToggleKeeper(self,
                                       ALIGN_MODES,
                                       ALIGN_MODE_ICONS,
                                       ALIGN_MODE_NAMES,
                                       on_change=self.apply_changes,
                                       allow_none=False)
        self.align.set_mode(sk2_const.TEXT_ALIGN_LEFT)
        self.add(self.align, 0, wal.LEFT | wal.CENTER, 2)

        self.pack(wal.VLine(self), fill=True, padding_all=3)

        self.ligature = wal.ImageToggleButton(self,
                                              False,
                                              icons.PD_LIGATURE,
                                              tooltip=_('Use ligatures'),
                                              onchange=self.apply_changes)
        self.add(self.ligature, 0, wal.LEFT | wal.CENTER, 2)
Esempio n. 3
0
    def __init__(self, parent, app, cms_ref, onchange=None):
        self.cms = cms_ref
        self.app = app
        self.callback = onchange
        wal.HPanel.__init__(self, parent)

        current_palette = self.get_current_palette()
        self.palviewer = PaletteViewer(self, self.cms, current_palette,
                                       self.on_change)
        self.pack(self.palviewer, fill=True)
        self.pack((5, 5))

        view_panel = wal.VPanel(self)
        view_panel.pack(wal.Label(view_panel, _('Palette:')),
                        align_center=False)

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

        self.sticker = ColorSticker(view_panel, self.cms)
        view_panel.pack(self.sticker, padding=5)
        self.pack(view_panel, fill=True, expand=True)
        self.palviewer.set_active_color()
Esempio n. 4
0
    def build(self):

        self.pack((5, 5))

        hpanel = wal.HPanel(self)
        hpanel.pack(wal.Label(hpanel, _('Document units') + ':'))
        names = []
        for item in unit_names:
            names.append(unit_full_names[item])
        self.units_combo = wal.Combolist(hpanel, items=names)
        self.units = self.doc.methods.get_doc_units()
        self.units_combo.set_active(unit_names.index(self.units))
        hpanel.pack(self.units_combo, padding=5)
        self.pack(hpanel)

        data = [[_('Unit'), _('Value in points')]]
        for item in uc2const.unit_names:
            name = uc2const.unit_full_names[item]
            value = _('%s points') % str(uc2const.unit_dict[item])
            data.append([name, value])
        slist = wal.ReportList(self, data)
        self.pack(slist, expand=True, fill=True, padding_all=5)

        self.origin = self.doc.methods.get_doc_origin()
        self.pack(wal.Label(self, _('Document origin:')), padding_all=5)
        self.origin_keeper = wal.HToggleKeeper(self, ORIGINS, ORIGIN_ICONS,
                                               ORIGIN_NAMES)
        self.origin_keeper.set_mode(self.origin)
        self.pack(self.origin_keeper)
        self.pack((5, 5))
Esempio n. 5
0
    def __init__(self, parent, printer):
        self.printer = printer
        wal.LabeledPanel.__init__(self, parent, _('Print mode'))

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

        self.mono_opt = wal.Radiobutton(grid, _('Monochrome'), group=True,
            onclick=self.update)
        icon = get_icon(icons.PD_PRINTMODE_MONO, size=wal.DEF_SIZE)
        self.mono_bmp = wal.Bitmap(grid, icon)
        grid.pack(self.mono_bmp)
        grid.pack(self.mono_opt)

        self.color_opt = wal.Radiobutton(grid, _('Color'), onclick=self.update)
        icon = get_icon(icons.PD_PRINTMODE_COLOR, size=wal.DEF_SIZE)
        self.color_bmp = wal.Bitmap(grid, icon)
        grid.pack(self.color_bmp)
        grid.pack(self.color_opt)
        self.color_opt.set_value(True)

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

        hpanel = wal.HPanel(self)

        self.cs_lbl = wal.Label(hpanel, _('Color space:'))
        hpanel.pack(self.cs_lbl, padding=5)

        self.cs_combo = wal.Combolist(hpanel, items=CS)
        hpanel.pack(self.cs_combo)

        self.pack(hpanel)

        self.pack((5, 5))

        self.set_data()
Esempio n. 6
0
    def __init__(self, parent, printer, app):
        self.app = app
        self.printer = printer
        wal.LabeledPanel.__init__(self, parent, _('Paper'))

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

        grid.pack(wal.Label(grid, _('Page size:')))

        self.size_combo = wal.Combolist(grid, onchange=self.on_change)
        grid.pack(self.size_combo, fill=True)

        grid.pack(wal.Label(grid, _('Width:')))

        hpanel = wal.HPanel(grid)

        self.wspin = StaticUnitSpin(self.app, hpanel)
        hpanel.pack(self.wspin)
        hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5)

        hpanel.pack((5, 5))

        hpanel.pack(wal.Label(grid, _('Height:')), padding=5)

        self.hspin = StaticUnitSpin(self.app, hpanel)
        hpanel.pack(self.hspin)
        hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5)

        grid.pack(hpanel)

        self.pack(grid, fill=True, expand=True, padding_all=10)

        self.set_data()
Esempio n. 7
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. 8
0
    def __init__(self):
        wal.MainWindow.__init__(self)
        self.set_size(SIZE)

        items = ['One', 'Two', 'Three']
        self.clist = wal.Combolist(self, items=items, onchange=self.on_change)
        self.clist.set_active(0)
        self.pack(self.clist)
Esempio n. 9
0
    def build(self):

        table = wal.GridPanel(self, rows=8, cols=2, hgap=25, vgap=7)

        txt = _('New document on start')
        table.pack(wal.Label(table, txt))
        self.newdoc = wal.Switch(table, config.new_doc_on_start)
        table.pack(self.newdoc)

        txt = _('Backup on document save')
        table.pack(wal.Label(table, txt))
        self.backup = wal.Switch(table, config.make_backup)
        table.pack(self.backup)

        txt = _('Backup on export')
        table.pack(wal.Label(table, txt))
        self.expbackup = wal.Switch(table, config.make_export_backup)
        table.pack(self.expbackup)

        txt = _('Make font cache on start')
        table.pack(wal.Label(table, txt))
        self.fcache = wal.Switch(table, config.make_font_cache_on_start)
        table.pack(self.fcache)

        txt = _('Run as server')
        table.pack(wal.Label(table, txt))
        self.server = wal.Switch(table, config.app_server)
        table.pack(self.server)

        txt = _('History log size:')
        table.pack(wal.Label(table, txt))
        self.hist_size = wal.IntSpin(table, config.history_size, (10, 1000))
        table.pack(self.hist_size)

        txt = _('History menu size:')
        table.pack(wal.Label(table, txt))
        self.hist_menu_size = wal.IntSpin(
            table, config.history_list_size, (5, 20))
        table.pack(self.hist_menu_size)

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

        self.pack(table)
        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. 10
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. 11
0
    def __init__(self, parent, printer, app):
        self.app = app
        self.printer = printer
        wal.LabeledPanel.__init__(self, parent, _('Document page'))

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

        grid.pack(wal.Label(grid, _('Page size:')))

        self.size_combo = wal.Combolist(grid, onchange=self.on_change)
        grid.pack(self.size_combo, fill=True)

        grid.pack(wal.Label(grid, _('Width:')))

        hpanel = wal.HPanel(grid)

        self.wspin = StaticUnitSpin(self.app, hpanel)
        hpanel.pack(self.wspin)

        hpanel.pack((5, 5))

        hpanel.pack(wal.Label(grid, _('Height:')), padding=5)

        self.hspin = StaticUnitSpin(self.app, hpanel)
        hpanel.pack(self.hspin)
        hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5)

        grid.pack(hpanel)

        grid.pack(wal.Label(grid, _('Orientation:')))

        hpanel = wal.HPanel(grid)

        self.port_opt = wal.Radiobutton(hpanel,
                                        uc2const.ORIENTS_NAMES[0],
                                        group=True)
        self.land_opt = wal.Radiobutton(hpanel, uc2const.ORIENTS_NAMES[1])

        hpanel.pack(self.port_opt)
        hpanel.pack((15, 5))
        hpanel.pack(self.land_opt)

        grid.pack(hpanel)

        self.pack(grid, fill=True, expand=True, padding_all=7)

        self.set_data()
Esempio n. 12
0
    def build(self):
        plist = self.printsys.get_printer_names()
        self.prn_list = wal.Combolist(self.cont, items=plist,
                                      onchange=self.on_printer_change)
        self.prn_list.set_active(plist.index(self.printer.get_name()))
        self.cont.pack(self.prn_list, fill=True, expand=True)

        self.cont.pack(SPACER)

        hpanel = wal.HPanel(self.cont)
        hpanel.pack((1, 1), fill=True, expand=True)
        self.print_btn = wal.Button(hpanel, _('Print'),
                                    onclick=self.dlg.on_print)
        hpanel.pack(self.print_btn)

        self.cont.pack(hpanel, fill=True)
        self.ready_flag = True
Esempio n. 13
0
    def build(self):

        self.families, self.faces_dict = libpango.get_fonts()

        self.families_combo = FontChoice(self, onchange=self.on_font_change)
        self.add(self.families_combo, 0, LEFT | CENTER, 2)
        self.add((3, 3))
        self.families_combo.set_font_family('Sans')

        self.faces = self.faces_dict['Sans']
        self.faces_combo = wal.Combolist(self, items=self.faces,
                                         onchange=self.apply_changes)
        self.faces_combo.set_active(0)
        self.add(self.faces_combo, 0, wal.LEFT | wal.CENTER, 2)
        self.add((3, 3))

        self.size_combo = wal.FloatCombobox(self, 12,
                                            digits=2, items=FONT_SIZES,
                                            onchange=self.apply_changes)
        self.add(self.size_combo, 0, wal.LEFT | wal.CENTER, 2)
Esempio n. 14
0
    def build(self):

        self.pack((5, 5))

        hpanel = wal.HPanel(self)

        vp = wal.LabeledPanel(hpanel, text=_('Document units'))
        names = []
        for item in unit_names:
            names.append(unit_full_names[item])
        self.units_combo = wal.Combolist(vp, items=names)
        self.units = self.doc.methods.get_doc_units()
        self.units_combo.set_active(unit_names.index(self.units))
        vp.pack(self.units_combo, padding_all=15, fill=True)
        hpanel.pack(vp, expand=True, fill=True)

        hpanel.pack((10, 10))

        vp = wal.LabeledPanel(hpanel, text=_('Document origin'))
        self.origin = self.doc.methods.get_doc_origin()
        self.origin_keeper = wal.HToggleKeeper(vp, ORIGINS, ORIGIN_ICONS,
                                               ORIGIN_NAMES)
        self.origin_keeper.set_mode(self.origin)
        vp.pack(self.origin_keeper, padding_all=5)
        hpanel.pack(vp, fill=True)

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

        data = [[_('Unit'), _('Value in points')]]
        for item in uc2const.unit_names:
            name = uc2const.unit_full_names[item]
            value = _('%s points') % str(uc2const.unit_dict[item])
            data.append([name, value])

        vp = wal.VPanel(self)
        vp.set_bg(wal.UI_COLORS['border'])
        slist = wal.ReportList(vp, data)
        vp.pack(slist, expand=True, fill=True, padding_all=1)
        self.pack(vp, expand=True, fill=True, padding_all=5)
        self.pack((5, 5))
Esempio n. 15
0
    def __init__(self, parent):
        wal.VPanel.__init__(self, parent)

        #--- Printer list
        self.prn_dict, default = get_printers()
        self.prn_list = self.prn_dict.keys()
        self.prn_list.sort()

        hpanel = wal.HPanel(self)
        hpanel.pack((10, 1))
        hpanel.pack(wal.Label(hpanel, 'Device name:'))

        self.prn_combo = wal.Combolist(hpanel,
                                       items=self.prn_list,
                                       onchange=self.printer_changed)
        hpanel.pack(self.prn_combo, padding=10)
        if self.prn_list:
            self.prn_combo.set_active(self.prn_list.index(default))

        self.pack(hpanel, padding=10)

        #--- Printer tabs

        self.nb = wal.Notebook(self)

        details = self.prn_dict[default]
        self.details_panel = DetailsPanel(self.nb, details)
        self.nb.add_page(self.details_panel, 'Device details')

        attrs = get_printer_attrs(default)
        self.attrs_panel = AttrsPanel(self.nb, attrs)
        self.nb.add_page(self.attrs_panel, 'Device attributes')

        options = get_printer_options(default)
        self.options_panel = OptionPanel(self.nb, options)
        self.nb.add_page(self.options_panel, 'Device options')

        self.pack(self.nb, fill=True, expand=True, padding_all=10)
Esempio n. 16
0
    def build(self):

        self.pack((5, 5))

        hpanel = wal.HPanel(self)
        hpanel.pack(wal.Label(hpanel, _('Document units') + ':'))
        names = []
        for item in unit_names:
            names.append(unit_full_names[item])
        self.units_combo = wal.Combolist(hpanel, items=names)
        self.units = self.doc.methods.get_doc_units()
        self.units_combo.set_active(unit_names.index(self.units))
        hpanel.pack(self.units_combo, padding=5)
        self.pack(hpanel, padding_all=5)

        self.pack((5, 5))

        self.origin = self.doc.methods.get_doc_origin()
        self.pack(wal.Label(self, _('Document origin:')), padding_all=5)
        self.origin_keeper = wal.HToggleKeeper(self, ORIGINS, ORIGIN_ICONS,
                                               ORIGIN_NAMES)
        self.origin_keeper.set_mode(self.origin)
        self.pack(self.origin_keeper)
Esempio n. 17
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
    def build(self):
        self.printsys = self.get_printsys()
        self.prn_list = self.printsys.get_printer_names()
        if self.prn_list:
            self.active_printer = self.printsys.get_default_printer()
            hpanel = wal.HPanel(self)
            hpanel.pack(wal.Label(hpanel, _('Printer:')))
            hpanel.pack((5, 5))
            self.prn_combo = wal.Combolist(hpanel,
                                           items=self.prn_list,
                                           onchange=self.set_data)
            hpanel.pack(self.prn_combo, fill=True, expand=True)
            index = self.prn_list.index(self.active_printer.get_name())
            self.prn_combo.set_active(index)
            self.pack(hpanel, fill=True, padding_all=5)

            self.pack((10, 10))

            # ---Panels
            self.insp = self.app.insp
            units = uc2const.UNIT_MM
            if self.insp.is_doc():
                units = self.app.current_doc.model.doc_units
            units_text = uc2const.unit_short_names[units]

            # ---Shift panel
            shifts = self.active_printer.shifts
            hpanel = wal.HPanel(self)
            txt = _('Printing shift') + ' (%s)' % units_text
            spanel = wal.LabeledPanel(hpanel, text=txt)
            spanel.pack((1, 1), expand=True)

            grid = wal.GridPanel(spanel, 2, 2, 5, 5)

            grid.pack(wal.Label(grid, _('Horizontal shift:')))
            self.hshift = StaticUnitSpin(self.app,
                                         grid,
                                         shifts[0],
                                         can_be_negative=True,
                                         onchange=self.save_data,
                                         onenter=self.save_data)
            grid.pack(self.hshift)

            grid.pack(wal.Label(grid, _('Vertical shift:')))
            self.vshift = StaticUnitSpin(self.app,
                                         grid,
                                         shifts[1],
                                         can_be_negative=True,
                                         onchange=self.save_data,
                                         onenter=self.save_data)
            grid.pack(self.vshift)

            spanel.pack(grid, padding_all=5)
            spanel.pack((1, 1), expand=True)

            hpanel.pack(spanel, fill=True, expand=True)

            hpanel.pack((5, 5))

            # ---Margin panel
            txt = _('Printing margins') + ' (%s)' % units_text
            mpanel = wal.LabeledPanel(hpanel, text=txt)
            mpanel.pack((5, 5))

            mrgs = self.active_printer.margins
            self.top_spin = StaticUnitSpin(self.app,
                                           mpanel,
                                           mrgs[0],
                                           onchange=self.save_data,
                                           onenter=self.save_data)
            mpanel.pack(self.top_spin)

            mpanel.pack((5, 5))

            hp = wal.HPanel(self)
            self.left_spin = StaticUnitSpin(self.app,
                                            hp,
                                            mrgs[3],
                                            onchange=self.save_data,
                                            onenter=self.save_data)
            hp.pack(self.left_spin)
            hp.pack((5, 5))
            self.right_spin = StaticUnitSpin(self.app,
                                             hp,
                                             mrgs[1],
                                             onchange=self.save_data,
                                             onenter=self.save_data)
            hp.pack(self.right_spin)

            mpanel.pack(hp)

            mpanel.pack((5, 5))

            self.bottom_spin = StaticUnitSpin(self.app,
                                              mpanel,
                                              mrgs[2],
                                              onchange=self.save_data,
                                              onenter=self.save_data)
            mpanel.pack(self.bottom_spin)

            mpanel.pack((10, 10))
            # ---

            hpanel.pack(mpanel, fill=True, expand=True)

            self.pack(hpanel, fill=True)

            self.pack((10, 10))

            # ---Calibration page
            text = _("To measure actual print area and vertical/horizontal "
                     "printing shift, just print the calibration page on "
                     "A4/Letter paper.")

            label = wal.Label(self, text)
            label.wrap(470)
            self.pack(label, fill=True, padding_all=5, align_center=False)

            self.a4_calibrate_btn = wal.Button(
                self,
                _('Print A4 calibration page'),
                onclick=self.print_calibration_a4)
            self.pack(self.a4_calibrate_btn)

            self.pack((5, 5))

            self.letter_calibrate_btn = wal.Button(
                self,
                _('Print Letter calibration page'),
                onclick=self.print_calibration_letter)
            self.pack(self.letter_calibrate_btn)

            self.pack((5, 5))

        else:
            self.pack((5, 5), expand=True)
            self.pack(get_bmp(self, icons.PD_NO_PRINTERS), padding=10)
            self.pack(wal.Label(self, _('No printers found')))
            self.pack((10, 10))
            self.pack((5, 5), expand=True)
        self.built = True
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 __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()
    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. 22
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. 23
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