Issue 641 - replacing DPI to PPI

This commit is contained in:
michael 2011-04-19 15:58:15 -04:00
parent 52c3e66208
commit 866f82b4ad
8 changed files with 33 additions and 30 deletions

View File

@ -692,7 +692,7 @@ TP_COLORDENOISE_RADIUS;Radius
TP_COLORSHIFT_BLUEYELLOW;Blue-Yellow
TP_COLORSHIFT_GREENMAGENTA;Green-Magenta
TP_COLORSHIFT_LABEL;Color Shift
TP_CROP_DPI;DPI=
TP_CROP_PPI;PPI=
TP_CROP_FIXRATIO;Fix Ratio:
TP_CROP_GTDIAGONALS;Rule of diagonals
TP_CROP_GTGRID;Grid

View File

@ -104,6 +104,7 @@ ColorCorrection=1
Ratio=3:2
FixRatio=true
DPI=600
PPI=300
[Color Management]
ICCDirectory=

View File

@ -104,6 +104,7 @@ ColorCorrection=1
Ratio=3:2
FixRatio=true
DPI=600
PPI=300
[Color Management]
ICCDirectory=

View File

@ -105,6 +105,7 @@ ColorCorrection=1
Ratio=3:2
FixRatio=true
DPI=600
PPI=300
[Color Management]
# Auto-determined by RT on first start

View File

@ -103,26 +103,26 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) {
pack_start (*hb31, Gtk::PACK_SHRINK, 4);
dpibox = Gtk::manage (new Gtk::VBox());
dpibox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_SHRINK, 2);
ppibox = Gtk::manage (new Gtk::VBox());
ppibox->pack_start (*Gtk::manage (new Gtk::HSeparator()), Gtk::PACK_SHRINK, 2);
Gtk::HBox* hb4 = Gtk::manage (new Gtk::HBox ());
hb4->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_DPI"))));
dpi = Gtk::manage (new Gtk::SpinButton ());
dpi->set_size_request (60, -1);
hb4->pack_start (*dpi);
hb4->pack_start (*Gtk::manage (new Gtk::Label (M("TP_CROP_PPI"))));
ppi = Gtk::manage (new Gtk::SpinButton ());
ppi->set_size_request (60, -1);
hb4->pack_start (*ppi);
dpibox->pack_start (*hb4, Gtk::PACK_SHRINK, 2);
ppibox->pack_start (*hb4, Gtk::PACK_SHRINK, 2);
sizecm = Gtk::manage (new Gtk::Label (M("GENERAL_NA") + " cm x " + M("GENERAL_NA") + " cm"));
sizein = Gtk::manage (new Gtk::Label (M("GENERAL_NA") + " in x " + M("GENERAL_NA") + " in"));
dpibox->pack_start (*sizecm, Gtk::PACK_SHRINK, 1);
dpibox->pack_start (*sizein, Gtk::PACK_SHRINK, 1);
ppibox->pack_start (*sizecm, Gtk::PACK_SHRINK, 1);
ppibox->pack_start (*sizein, Gtk::PACK_SHRINK, 1);
pack_start (*dpibox, Gtk::PACK_SHRINK, 0);
pack_start (*ppibox, Gtk::PACK_SHRINK, 0);
dpi->set_value (300);
ppi->set_value (300);
ratio->append_text ("3:2");
ratio->append_text ("4:3");
@ -169,10 +169,10 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) {
h->set_increments (1,100);
h->set_value (200);
dpi->set_digits (0);
dpi->set_increments (1,100);
dpi->set_range (50, 12000);
dpi->set_value (300);
ppi->set_digits (0);
ppi->set_increments (1,100);
ppi->set_range (50, 12000);
ppi->set_value (300);
xconn = x->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::positionChanged), true);
yconn = y->signal_value_changed().connect ( sigc::mem_fun(*this, &Crop::positionChanged), true);
@ -184,7 +184,7 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) {
oconn = orientation->signal_changed().connect( sigc::mem_fun(*this, &Crop::ratioChanged) );
gconn = guide->signal_changed().connect( sigc::mem_fun(*this, &Crop::notifyListener) );
selectCrop->signal_pressed().connect( sigc::mem_fun(*this, &Crop::selectPressed) );
dpi->signal_value_changed().connect( sigc::mem_fun(*this, &Crop::refreshSize) );
ppi->signal_value_changed().connect( sigc::mem_fun(*this, &Crop::refreshSize) );
nx = ny = nw = nh = 0;
lastRotationDeg = 0;
@ -193,14 +193,14 @@ Crop::Crop (): Gtk::VBox(), FoldableToolPanel(this) {
void Crop::writeOptions () {
options.cropDPI = (int)dpi->get_value ();
options.cropPPI = (int)ppi->get_value ();
}
void Crop::readOptions () {
disableListener ();
dpi->set_value (options.cropDPI);
ppi->set_value (options.cropPPI);
enableListener ();
}
@ -554,15 +554,15 @@ void Crop::refreshSize () {
std::ostringstream ostrin;
ostrin.precision (3);
// ostrin << h->get_value()/dpi->get_value() << " in x " << w->get_value()/dpi->get_value() << " in";;
ostrin << nh/dpi->get_value() << " in x " << nw/dpi->get_value() << " in";;
// ostrin << h->get_value()/ppi->get_value() << " in x " << w->get_value()/ppi->get_value() << " in";;
ostrin << nh/ppi->get_value() << " in x " << nw/ppi->get_value() << " in";;
sizein->set_text (ostrin.str ());
std::ostringstream ostrcm;
ostrcm.precision (3);
// ostrcm << h->get_value()/dpi->get_value()*2.54 << " cm x " << w->get_value()/dpi->get_value()*2.54 << " cm";;
ostrcm << nh/dpi->get_value()*2.54 << " cm x " << nw/dpi->get_value()*2.54 << " cm";;
// ostrcm << h->get_value()/ppi->get_value()*2.54 << " cm x " << w->get_value()/ppi->get_value()*2.54 << " cm";;
ostrcm << nh/ppi->get_value()*2.54 << " cm x " << nw/ppi->get_value()*2.54 << " cm";;
sizecm->set_text (ostrcm.str ());
}
@ -946,5 +946,5 @@ void Crop::setBatchMode (bool batchMode) {
ratio->append_text ("(Unchanged)");
orientation->append_text ("(Unchanged)");
guide->append_text ("(Unchanged)");
removeIfThere (this, dpibox);
removeIfThere (this, ppibox);
}

View File

@ -45,10 +45,10 @@ class Crop : public Gtk::VBox, public CropGUIListener, public FoldableToolPanel,
Gtk::SpinButton* y;
Gtk::SpinButton* w;
Gtk::SpinButton* h;
Gtk::SpinButton* dpi;
Gtk::SpinButton* ppi;
Gtk::Label* sizecm;
Gtk::Label* sizein;
Gtk::VBox* dpibox;
Gtk::VBox* ppibox;
int maxw, maxh;
int nx, ny, nw, nh;
int lastRotationDeg;

View File

@ -84,7 +84,7 @@ void Options::setDefaults () {
showHistory = true;
showFilePanelState = 0;
showInfo = false;
cropDPI = 300;
cropPPI = 300;
showClippedHighlights = false;
showClippedShadows = false;
highlightThreshold = 254;
@ -304,7 +304,7 @@ if (keyFile.has_group ("GUI")) {
if (keyFile.has_group ("Crop Settings")) {
if (keyFile.has_key ("Crop Settings", "DPI")) cropDPI = keyFile.get_integer ("Crop Settings", "DPI");
if (keyFile.has_key ("Crop Settings", "PPI")) cropPPI = keyFile.get_integer ("Crop Settings", "PPI");
}
if (keyFile.has_group ("Color Management")) {
@ -451,7 +451,7 @@ int Options::saveToFile (Glib::ustring fname) {
//Glib::ArrayHandle<int> crvopen = crvOpen;
//keyFile.set_integer_list ("GUI", "CurvePanelsExpanded", crvopen);
keyFile.set_integer ("Crop Settings", "DPI", cropDPI);
keyFile.set_integer ("Crop Settings", "PPI", cropPPI);
keyFile.set_string ("Color Management", "ICCDirectory", rtSettings.iccDirectory);
keyFile.set_string ("Color Management", "MonitorProfile", rtSettings.monitorProfile);

View File

@ -92,7 +92,7 @@ class Options {
int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden
bool showInfo;
bool mainNBVertical; // main notebook vertical tabs?
int cropDPI;
int cropPPI;
bool showClippedHighlights;
bool showClippedShadows;
int highlightThreshold;