~ubuntu-branches/ubuntu/precise/inkscape/precise-updates

« back to all changes in this revision

Viewing changes to src/ui/dialog/print-colors-preview-dialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alex Valavanis
  • Date: 2010-09-12 19:44:58 UTC
  • mfrom: (1.1.12 upstream) (45.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20100912194458-4sjwmbl7dlsrk5dc
Tags: 0.48.0-1ubuntu1
* Merge with Debian unstable (LP: #628048, LP: #401567, LP: #456248, 
  LP: #463602, LP: #591986)
* debian/control: 
  - Ubuntu maintainers
  - Promote python-lxml, python-numpy, python-uniconvertor to Recommends.
  - Demote pstoedit to Suggests (universe package).
  - Suggests ttf-dejavu instead of ttf-bitstream-vera (LP: #513319)
* debian/rules:
  - Run intltool-update on build (Ubuntu-specific).
  - Add translation domain to .desktop files (Ubuntu-specific).
* debian/dirs:
  - Add usr/share/pixmaps.  Allow inkscape.xpm installation
* drop 50-poppler-API.dpatch (now upstream)
* drop 51-paste-in-unwritable-directory.dpatch (now upstream) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 * @brief Print Colors Preview dialog - implementation
 
3
 */
 
4
/* Authors:
 
5
 *   Felipe C. da S. Sanches <juca@members.fsf.org>
 
6
 *
 
7
 * Copyright (C) 2009 Authors
 
8
 * Released under GNU GPLv2 (or later).  Read the file 'COPYING' for more information.
 
9
 */
 
10
/*
 
11
#include "desktop.h"
 
12
#include "print-colors-preview-dialog.h"
 
13
#include "preferences.h"
 
14
#include <glibmm/i18n.h>
 
15
 
 
16
namespace Inkscape {
 
17
namespace UI {
 
18
namespace Dialog {
 
19
 
 
20
//Yes, I know we shouldn't hardcode CMYK. This class needs to be refactored
 
21
// in order to accomodate spot colors and color components defined using 
 
22
// ICC colors. --Juca
 
23
 
 
24
void PrintColorsPreviewDialog::toggle_cyan(){
 
25
  Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
26
  prefs->setBool("/options/printcolorspreview/cyan", cyan->get_active());
 
27
 
 
28
  SPDesktop *desktop = getDesktop();
 
29
  desktop->setDisplayModePrintColorsPreview();
 
30
}
 
31
 
 
32
void PrintColorsPreviewDialog::toggle_magenta(){
 
33
  Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
34
  prefs->setBool("/options/printcolorspreview/magenta", magenta->get_active());
 
35
 
 
36
  SPDesktop *desktop = getDesktop();
 
37
  desktop->setDisplayModePrintColorsPreview();
 
38
}
 
39
 
 
40
void PrintColorsPreviewDialog::toggle_yellow(){
 
41
  Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
42
  prefs->setBool("/options/printcolorspreview/yellow", yellow->get_active());
 
43
 
 
44
  SPDesktop *desktop = getDesktop();
 
45
  desktop->setDisplayModePrintColorsPreview();
 
46
}
 
47
 
 
48
void PrintColorsPreviewDialog::toggle_black(){
 
49
  Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
50
  prefs->setBool("/options/printcolorspreview/black", black->get_active());
 
51
 
 
52
  SPDesktop *desktop = getDesktop();
 
53
  desktop->setDisplayModePrintColorsPreview();
 
54
}
 
55
 
 
56
PrintColorsPreviewDialog::PrintColorsPreviewDialog()
 
57
 : UI::Widget::Panel("", "/dialogs/printcolorspreview", SP_VERB_DIALOG_PRINT_COLORS_PREVIEW)
 
58
{
 
59
    Gtk::VBox* vbox = Gtk::manage(new Gtk::VBox());
 
60
 
 
61
    cyan = new Gtk::ToggleButton(_("Cyan"));
 
62
    vbox->pack_start( *cyan, false, false );
 
63
//    tips.set_tip((*cyan), _("Render cyan separation"));
 
64
    cyan->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_cyan) );
 
65
 
 
66
    magenta = new Gtk::ToggleButton(_("Magenta"));
 
67
    vbox->pack_start( *magenta, false, false );
 
68
//    tips.set_tip((*magenta), _("Render magenta separation"));
 
69
    magenta->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_magenta) );
 
70
 
 
71
    yellow = new Gtk::ToggleButton(_("Yellow"));
 
72
    vbox->pack_start( *yellow, false, false );
 
73
//    tips.set_tip((*yellow), _("Render yellow separation"));
 
74
    yellow->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_yellow) );
 
75
 
 
76
    black = new Gtk::ToggleButton(_("Black"));
 
77
    vbox->pack_start( *black, false, false );
 
78
//    tips.set_tip((*black), _("Render black separation"));
 
79
    black->signal_clicked().connect( sigc::mem_fun(*this, &PrintColorsPreviewDialog::toggle_black) );
 
80
 
 
81
    gint val;
 
82
    Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
83
    val = prefs->getBool("/options/printcolorspreview/cyan");
 
84
    cyan->set_active( val != 0 );
 
85
    val = prefs->getBool("/options/printcolorspreview/magenta");
 
86
    magenta->set_active( val != 0 );
 
87
    val = prefs->getBool("/options/printcolorspreview/yellow");
 
88
    yellow->set_active( val != 0 );
 
89
    val = prefs->getBool("/options/printcolorspreview/black");
 
90
    black->set_active( val != 0 );
 
91
 
 
92
    _getContents()->add(*vbox);
 
93
    _getContents()->show_all();
 
94
}
 
95
 
 
96
PrintColorsPreviewDialog::~PrintColorsPreviewDialog(){}
 
97
 
 
98
} // namespace Dialog
 
99
} // namespace UI
 
100
} // namespace Inkscape
 
101
*/