run through astyle

This commit is contained in:
Alberto Griggio 2017-08-22 08:53:17 +02:00
parent 511f6c2a7b
commit b39f072baf
7 changed files with 1911 additions and 1817 deletions

View File

@ -32,193 +32,193 @@ ExportPanel::ExportPanel () : listener (nullptr)
pack_start(*enabled, Gtk::PACK_SHRINK, 4); pack_start(*enabled, Gtk::PACK_SHRINK, 4);
pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2);*/ pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2);*/
Gtk::Label* labExportTitle = Gtk::manage ( new Gtk::Label (M("EXPORT_FASTEXPORTOPTIONS")) ); Gtk::Label* labExportTitle = Gtk::manage ( new Gtk::Label (M ("EXPORT_FASTEXPORTOPTIONS")) );
labExportTitle->set_use_markup (true); labExportTitle->set_use_markup (true);
labExportTitle->set_tooltip_text (M("EXPORT_INSTRUCTIONS")); labExportTitle->set_tooltip_text (M ("EXPORT_INSTRUCTIONS"));
labExportTitle->set_alignment(Gtk::ALIGN_START); labExportTitle->set_alignment (Gtk::ALIGN_START);
pack_start(*labExportTitle, Gtk::PACK_SHRINK, 4); pack_start (*labExportTitle, Gtk::PACK_SHRINK, 4);
Gtk::RadioButton::Group pipeline_group; Gtk::RadioButton::Group pipeline_group;
use_fast_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M("EXPORT_USE_FAST_PIPELINE"))); use_fast_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M ("EXPORT_USE_FAST_PIPELINE")));
use_normal_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M("EXPORT_USE_NORMAL_PIPELINE"))); use_normal_pipeline = Gtk::manage ( new Gtk::RadioButton (pipeline_group, M ("EXPORT_USE_NORMAL_PIPELINE")));
bypass_box = Gtk::manage(new Gtk::VBox()); bypass_box = Gtk::manage (new Gtk::VBox());
bypass_ALL = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_ALL"))); bypass_ALL = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_ALL")));
use_fast_pipeline->set_tooltip_text(M("EXPORT_USE_FAST_PIPELINE_TIP")); use_fast_pipeline->set_tooltip_text (M ("EXPORT_USE_FAST_PIPELINE_TIP"));
bypass_sharpening = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENING"))); bypass_sharpening = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_SHARPENING")));
bypass_sharpenEdge = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENEDGE"))); bypass_sharpenEdge = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_SHARPENEDGE")));
bypass_sharpenMicro = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SHARPENMICRO"))); bypass_sharpenMicro = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_SHARPENMICRO")));
//bypass_lumaDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_LUMADENOISE"))); //bypass_lumaDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_LUMADENOISE")));
//bypass_colorDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_COLORDENOISE"))); //bypass_colorDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_COLORDENOISE")));
bypass_defringe = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_DEFRINGE"))); bypass_defringe = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_DEFRINGE")));
bypass_dirpyrDenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_DIRPYRDENOISE"))); bypass_dirpyrDenoise = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_DIRPYRDENOISE")));
bypass_sh_hq = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_SH_HQ"))); bypass_sh_hq = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_SH_HQ")));
bypass_dirpyrequalizer = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_DIRPYREQUALIZER"))); bypass_dirpyrequalizer = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_DIRPYREQUALIZER")));
bypass_wavelet = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_EQUALIZER"))); bypass_wavelet = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_EQUALIZER")));
bypass_raw_ccSteps = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_CCSTEPS"))); bypass_raw_ccSteps = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_CCSTEPS")));
bypass_raw_ca = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_CA"))); bypass_raw_ca = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_CA")));
bypass_raw_df = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_DF"))); bypass_raw_df = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_DF")));
bypass_raw_ff = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_FF"))); bypass_raw_ff = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_FF")));
// ---------------------- Bayer sensor frame ----------------------- // ---------------------- Bayer sensor frame -----------------------
Gtk::Frame *bayerFrame = Gtk::manage( new Gtk::Frame(M("TP_RAW_SENSOR_BAYER"))); Gtk::Frame *bayerFrame = Gtk::manage ( new Gtk::Frame (M ("TP_RAW_SENSOR_BAYER")));
Gtk::VBox* bayerFrameVBox = Gtk::manage (new Gtk::VBox ()); Gtk::VBox* bayerFrameVBox = Gtk::manage (new Gtk::VBox ());
Gtk::HBox* hb_raw_bayer_method = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* hb_raw_bayer_method = Gtk::manage (new Gtk::HBox ());
hb_raw_bayer_method->pack_start (*Gtk::manage (new Gtk::Label ( M("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); hb_raw_bayer_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
raw_bayer_method = Gtk::manage (new MyComboBoxText ()); raw_bayer_method = Gtk::manage (new MyComboBoxText ());
for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) { for ( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) {
raw_bayer_method->append(procparams::RAWParams::BayerSensor::methodstring[i]); raw_bayer_method->append (procparams::RAWParams::BayerSensor::methodstring[i]);
} }
raw_bayer_method->set_active(0); raw_bayer_method->set_active (0);
hb_raw_bayer_method->pack_end (*raw_bayer_method, Gtk::PACK_EXPAND_WIDGET, 4); hb_raw_bayer_method->pack_end (*raw_bayer_method, Gtk::PACK_EXPAND_WIDGET, 4);
//bypass_raw_all_enhance = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_ALL_ENHANCE"))); //bypass_raw_all_enhance = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_ALL_ENHANCE")));
bypass_raw_bayer_linenoise = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_LINENOISE"))); bypass_raw_bayer_linenoise = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_LINENOISE")));
bypass_raw_bayer_greenthresh = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_GREENTHRESH"))); bypass_raw_bayer_greenthresh = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_GREENTHRESH")));
bypass_raw_bayer_dcb_iterations = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_DCB_ITERATIONS"))); bypass_raw_bayer_dcb_iterations = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_DCB_ITERATIONS")));
bypass_raw_bayer_dcb_enhance = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_DCB_ENHANCE"))); bypass_raw_bayer_dcb_enhance = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_DCB_ENHANCE")));
bypass_raw_bayer_lmmse_iterations = Gtk::manage ( new Gtk::CheckButton (M("EXPORT_BYPASS_RAW_LMMSE_ITERATIONS"))); bypass_raw_bayer_lmmse_iterations = Gtk::manage ( new Gtk::CheckButton (M ("EXPORT_BYPASS_RAW_LMMSE_ITERATIONS")));
// ---------------------- Bayer sensor frame ----------------------- // ---------------------- Bayer sensor frame -----------------------
Gtk::Frame *xtransFrame = Gtk::manage( new Gtk::Frame(M("TP_RAW_SENSOR_XTRANS"))); Gtk::Frame *xtransFrame = Gtk::manage ( new Gtk::Frame (M ("TP_RAW_SENSOR_XTRANS")));
Gtk::VBox* xtransFrameVBox = Gtk::manage (new Gtk::VBox ()); Gtk::VBox* xtransFrameVBox = Gtk::manage (new Gtk::VBox ());
Gtk::HBox* hb_raw_xtrans_method = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* hb_raw_xtrans_method = Gtk::manage (new Gtk::HBox ());
hb_raw_xtrans_method->pack_start (*Gtk::manage (new Gtk::Label ( M("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4); hb_raw_xtrans_method->pack_start (*Gtk::manage (new Gtk::Label ( M ("EXPORT_RAW_DMETHOD") + ": ")), Gtk::PACK_SHRINK, 4);
raw_xtrans_method = Gtk::manage (new MyComboBoxText ()); raw_xtrans_method = Gtk::manage (new MyComboBoxText ());
for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) { for ( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) {
raw_xtrans_method->append(procparams::RAWParams::XTransSensor::methodstring[i]); raw_xtrans_method->append (procparams::RAWParams::XTransSensor::methodstring[i]);
} }
raw_xtrans_method->set_active(0); raw_xtrans_method->set_active (0);
hb_raw_xtrans_method->pack_end (*raw_xtrans_method, Gtk::PACK_EXPAND_WIDGET, 4); hb_raw_xtrans_method->pack_end (*raw_xtrans_method, Gtk::PACK_EXPAND_WIDGET, 4);
// ---------------------------------------------------------------- // ----------------------------------------------------------------
// start global packing // start global packing
Gtk::HBox* lblbox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* lblbox = Gtk::manage (new Gtk::HBox ());
lblbox->pack_start (*Gtk::manage (new Gtk::Label (M("EXPORT_PIPELINE"))), Gtk::PACK_SHRINK, 4); lblbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_PIPELINE"))), Gtk::PACK_SHRINK, 4);
pack_start (*lblbox, Gtk::PACK_SHRINK, 4); pack_start (*lblbox, Gtk::PACK_SHRINK, 4);
pack_start(*use_fast_pipeline , Gtk::PACK_SHRINK, 4); pack_start (*use_fast_pipeline, Gtk::PACK_SHRINK, 4);
pack_start(*use_normal_pipeline , Gtk::PACK_SHRINK, 4); pack_start (*use_normal_pipeline, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4);
lblbox = Gtk::manage (new Gtk::HBox ()); lblbox = Gtk::manage (new Gtk::HBox ());
lblbox->pack_start (*Gtk::manage (new Gtk::Label (M("EXPORT_BYPASS"))), Gtk::PACK_SHRINK, 4); lblbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_BYPASS"))), Gtk::PACK_SHRINK, 4);
bypass_box->pack_start (*lblbox, Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*lblbox, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_ALL , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_ALL, Gtk::PACK_SHRINK, 4);
// bypass_box->pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4); // bypass_box->pack_start(*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_sharpening , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sharpening, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_sharpenEdge , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sharpenEdge, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_sharpenMicro , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sharpenMicro, Gtk::PACK_SHRINK, 4);
//pack_start(*bypass_lumaDenoise , Gtk::PACK_SHRINK, 4); //pack_start(*bypass_lumaDenoise , Gtk::PACK_SHRINK, 4);
//pack_start(*bypass_colorDenoise , Gtk::PACK_SHRINK, 4); //pack_start(*bypass_colorDenoise , Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_defringe , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_defringe, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_dirpyrDenoise, Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_dirpyrDenoise, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_sh_hq , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_sh_hq, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_dirpyrequalizer , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_dirpyrequalizer, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_wavelet , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_wavelet, Gtk::PACK_SHRINK, 4);
bayerFrameVBox->pack_start(*hb_raw_bayer_method, Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start (*hb_raw_bayer_method, Gtk::PACK_SHRINK, 4);
//bayerFrameVBox->pack_start(*bypass_raw_all_enhance , Gtk::PACK_SHRINK, 4); //bayerFrameVBox->pack_start(*bypass_raw_all_enhance , Gtk::PACK_SHRINK, 4);
bayerFrameVBox->pack_start(*bypass_raw_bayer_dcb_iterations, Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start (*bypass_raw_bayer_dcb_iterations, Gtk::PACK_SHRINK, 4);
bayerFrameVBox->pack_start(*bypass_raw_bayer_dcb_enhance , Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start (*bypass_raw_bayer_dcb_enhance, Gtk::PACK_SHRINK, 4);
bayerFrameVBox->pack_start(*bypass_raw_bayer_lmmse_iterations, Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start (*bypass_raw_bayer_lmmse_iterations, Gtk::PACK_SHRINK, 4);
bayerFrameVBox->pack_start(*bypass_raw_bayer_linenoise , Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start (*bypass_raw_bayer_linenoise, Gtk::PACK_SHRINK, 4);
bayerFrameVBox->pack_start(*bypass_raw_bayer_greenthresh , Gtk::PACK_SHRINK, 4); bayerFrameVBox->pack_start (*bypass_raw_bayer_greenthresh, Gtk::PACK_SHRINK, 4);
bayerFrame->add(*bayerFrameVBox); bayerFrame->add (*bayerFrameVBox);
xtransFrameVBox->pack_start(*hb_raw_xtrans_method, Gtk::PACK_SHRINK, 4); xtransFrameVBox->pack_start (*hb_raw_xtrans_method, Gtk::PACK_SHRINK, 4);
xtransFrame->add(*xtransFrameVBox); xtransFrame->add (*xtransFrameVBox);
bypass_box->pack_start(*bypass_raw_ccSteps , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_raw_ccSteps, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_raw_ca , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_raw_ca, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_raw_df , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_raw_df, Gtk::PACK_SHRINK, 4);
bypass_box->pack_start(*bypass_raw_ff , Gtk::PACK_SHRINK, 4); bypass_box->pack_start (*bypass_raw_ff, Gtk::PACK_SHRINK, 4);
pack_start(*bypass_box, Gtk::PACK_SHRINK); pack_start (*bypass_box, Gtk::PACK_SHRINK);
pack_start (*Gtk::manage(new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2); pack_start (*Gtk::manage (new Gtk::HSeparator ()), Gtk::PACK_SHRINK, 2);
// Resize options // Resize options
Gtk::HBox* rmbox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* rmbox = Gtk::manage (new Gtk::HBox ());
rmbox->pack_start (*Gtk::manage (new Gtk::Label (M("TP_RESIZE_LABEL"))), Gtk::PACK_SHRINK, 4); rmbox->pack_start (*Gtk::manage (new Gtk::Label (M ("TP_RESIZE_LABEL"))), Gtk::PACK_SHRINK, 4);
pack_start (*rmbox, Gtk::PACK_SHRINK, 4); pack_start (*rmbox, Gtk::PACK_SHRINK, 4);
Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* wbox = Gtk::manage (new Gtk::HBox ());
Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ()); Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox ());
MaxWidth = Gtk::manage (new MySpinButton ()); MaxWidth = Gtk::manage (new MySpinButton ());
MaxHeight = Gtk::manage (new MySpinButton ()); MaxHeight = Gtk::manage (new MySpinButton ());
wbox->pack_start (*Gtk::manage (new Gtk::Label (M("EXPORT_MAXWIDTH"))), Gtk::PACK_SHRINK, 4); wbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_MAXWIDTH"))), Gtk::PACK_SHRINK, 4);
wbox->pack_start (*MaxWidth); wbox->pack_start (*MaxWidth);
hbox->pack_start (*Gtk::manage (new Gtk::Label (M("EXPORT_MAXHEIGHT"))), Gtk::PACK_SHRINK, 4); hbox->pack_start (*Gtk::manage (new Gtk::Label (M ("EXPORT_MAXHEIGHT"))), Gtk::PACK_SHRINK, 4);
hbox->pack_start (*MaxHeight); hbox->pack_start (*MaxHeight);
pack_start (*wbox, Gtk::PACK_SHRINK, 4); pack_start (*wbox, Gtk::PACK_SHRINK, 4);
pack_start (*hbox, Gtk::PACK_SHRINK, 4); pack_start (*hbox, Gtk::PACK_SHRINK, 4);
MaxWidth->set_digits (0); MaxWidth->set_digits (0);
MaxWidth->set_width_chars(5); MaxWidth->set_width_chars (5);
MaxWidth->set_max_width_chars(5); MaxWidth->set_max_width_chars (5);
MaxWidth->set_increments (1, 100); MaxWidth->set_increments (1, 100);
MaxWidth->set_value (options.fastexport_resize_width); MaxWidth->set_value (options.fastexport_resize_width);
MaxWidth->set_range (32, 10000); MaxWidth->set_range (32, 10000);
MaxHeight->set_digits (0); MaxHeight->set_digits (0);
MaxHeight->set_width_chars(5); MaxHeight->set_width_chars (5);
MaxHeight->set_max_width_chars(5); MaxHeight->set_max_width_chars (5);
MaxHeight->set_increments (1, 100); MaxHeight->set_increments (1, 100);
MaxHeight->set_value (options.fastexport_resize_height); MaxHeight->set_value (options.fastexport_resize_height);
MaxHeight->set_range (32, 10000); MaxHeight->set_range (32, 10000);
// Buttons // Buttons
btnFastExport = Gtk::manage ( new Gtk::Button () ); btnFastExport = Gtk::manage ( new Gtk::Button () );
btnFastExport->set_tooltip_text(M("EXPORT_PUTTOQUEUEFAST")); btnFastExport->set_tooltip_text (M ("EXPORT_PUTTOQUEUEFAST"));
btnFastExport->set_image (*Gtk::manage (new RTImage ("processing.png"))); btnFastExport->set_image (*Gtk::manage (new RTImage ("processing.png")));
pack_start(*btnFastExport, Gtk::PACK_SHRINK, 4); pack_start (*btnFastExport, Gtk::PACK_SHRINK, 4);
// add panel ending // add panel ending
Gtk::VBox* vboxpe = Gtk::manage (new Gtk::VBox ()); Gtk::VBox* vboxpe = Gtk::manage (new Gtk::VBox ());
Gtk::HSeparator* hseptpe = Gtk::manage (new Gtk::HSeparator ()); Gtk::HSeparator* hseptpe = Gtk::manage (new Gtk::HSeparator ());
Gtk::Image* peImg = Gtk::manage (new RTImage("PanelEnding.png")); Gtk::Image* peImg = Gtk::manage (new RTImage ("PanelEnding.png"));
vboxpe->pack_start(*hseptpe, Gtk::PACK_SHRINK, 4); vboxpe->pack_start (*hseptpe, Gtk::PACK_SHRINK, 4);
vboxpe->pack_start(*peImg); vboxpe->pack_start (*peImg);
pack_start(*vboxpe, Gtk::PACK_SHRINK, 0); pack_start (*vboxpe, Gtk::PACK_SHRINK, 0);
use_fast_pipeline->signal_toggled().connect(sigc::mem_fun(*this, &ExportPanel::use_fast_pipeline_toggled)); use_fast_pipeline->signal_toggled().connect (sigc::mem_fun (*this, &ExportPanel::use_fast_pipeline_toggled));
btnFastExport->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::FastExportPressed) ); btnFastExport->signal_clicked().connect ( sigc::mem_fun (*this, &ExportPanel::FastExportPressed) );
//btnExportLoadSettings->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::LoadSettings) ); //btnExportLoadSettings->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::LoadSettings) );
//btnExportSaveSettings->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::SaveSettings) ); //btnExportSaveSettings->signal_clicked().connect( sigc::mem_fun(*this, &ExportPanel::SaveSettings) );
bypass_ALLconn = bypass_ALL->signal_toggled().connect (sigc::mem_fun(*this, &ExportPanel::bypassALL_Toggled)); bypass_ALLconn = bypass_ALL->signal_toggled().connect (sigc::mem_fun (*this, &ExportPanel::bypassALL_Toggled));
bypass_sharpeningConn = bypass_sharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sharpeningConn = bypass_sharpening->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_sharpenEdgeConn = bypass_sharpenEdge->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sharpenEdgeConn = bypass_sharpenEdge->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_sharpenMicroConn = bypass_sharpenMicro->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sharpenMicroConn = bypass_sharpenMicro->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
//bypass_lumaDenoiseConn = bypass_lumaDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); //bypass_lumaDenoiseConn = bypass_lumaDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
//bypass_colorDenoiseConn = bypass_colorDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); //bypass_colorDenoiseConn = bypass_colorDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_defringeConn = bypass_defringe->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_defringeConn = bypass_defringe->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_dirpyrDenoiseConn = bypass_dirpyrDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_dirpyrDenoiseConn = bypass_dirpyrDenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_sh_hqConn = bypass_sh_hq->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_sh_hqConn = bypass_sh_hq->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_dirpyrequalizerConn = bypass_dirpyrequalizer->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_dirpyrequalizerConn = bypass_dirpyrequalizer->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_waveletConn = bypass_wavelet->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_waveletConn = bypass_wavelet->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
//bypass_raw_all_enhanceConn = bypass_raw_bayer_all_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); //bypass_raw_all_enhanceConn = bypass_raw_bayer_all_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_bayer_dcb_iterationsConn = bypass_raw_bayer_dcb_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_bayer_dcb_iterationsConn = bypass_raw_bayer_dcb_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_bayer_dcb_enhanceConn = bypass_raw_bayer_dcb_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_bayer_dcb_enhanceConn = bypass_raw_bayer_dcb_enhance->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_bayer_lmmse_iterationsConn = bypass_raw_bayer_lmmse_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_bayer_lmmse_iterationsConn = bypass_raw_bayer_lmmse_iterations->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_bayer_linenoiseConn = bypass_raw_bayer_linenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_bayer_linenoiseConn = bypass_raw_bayer_linenoise->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_bayer_greenthreshConn = bypass_raw_bayer_greenthresh->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_bayer_greenthreshConn = bypass_raw_bayer_greenthresh->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_ccStepsConn = bypass_raw_ccSteps->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_ccStepsConn = bypass_raw_ccSteps->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_caConn = bypass_raw_ca->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_caConn = bypass_raw_ca->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_dfConn = bypass_raw_df->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_dfConn = bypass_raw_df->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
bypass_raw_ffConn = bypass_raw_ff->signal_toggled().connect (sigc::bind (sigc::mem_fun(*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true)); bypass_raw_ffConn = bypass_raw_ff->signal_toggled().connect (sigc::bind (sigc::mem_fun (*bypass_ALL, &Gtk::CheckButton::set_inconsistent), true));
LoadDefaultSettings(); LoadDefaultSettings();
} }
@ -251,39 +251,39 @@ void ExportPanel::SaveSettingsAsDefault()
} \ } \
} while (false) } while (false)
// Save fast export settings to options // Save fast export settings to options
FE_OPT_STORE_(options.fastexport_bypass_sharpening, bypass_sharpening->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_sharpening, bypass_sharpening->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_sharpenEdge, bypass_sharpenEdge->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_sharpenEdge, bypass_sharpenEdge->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_sharpenMicro, bypass_sharpenMicro->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_sharpenMicro, bypass_sharpenMicro->get_active ());
//options.fastexport_bypass_lumaDenoise = bypass_lumaDenoise->get_active (); //options.fastexport_bypass_lumaDenoise = bypass_lumaDenoise->get_active ();
//options.fastexport_bypass_colorDenoise = bypass_colorDenoise->get_active (); //options.fastexport_bypass_colorDenoise = bypass_colorDenoise->get_active ();
FE_OPT_STORE_(options.fastexport_bypass_defringe, bypass_defringe->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_defringe, bypass_defringe->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_dirpyrDenoise, bypass_dirpyrDenoise->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_dirpyrDenoise, bypass_dirpyrDenoise->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_sh_hq, bypass_sh_hq->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_sh_hq, bypass_sh_hq->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_dirpyrequalizer, bypass_dirpyrequalizer->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_dirpyrequalizer, bypass_dirpyrequalizer->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_wavelet, bypass_wavelet->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_wavelet, bypass_wavelet->get_active ());
//options.fastexport_bypass_raw_bayer_all_enhance = bypass_raw_all_enhance->get_active (); //options.fastexport_bypass_raw_bayer_all_enhance = bypass_raw_all_enhance->get_active ();
FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_dcb_iterations, bypass_raw_bayer_dcb_iterations->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_bayer_dcb_iterations, bypass_raw_bayer_dcb_iterations->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_dcb_enhance, bypass_raw_bayer_dcb_enhance->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_bayer_dcb_enhance, bypass_raw_bayer_dcb_enhance->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_lmmse_iterations, bypass_raw_bayer_lmmse_iterations->get_active()); FE_OPT_STORE_ (options.fastexport_bypass_raw_bayer_lmmse_iterations, bypass_raw_bayer_lmmse_iterations->get_active());
FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_linenoise, bypass_raw_bayer_linenoise->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_bayer_linenoise, bypass_raw_bayer_linenoise->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_bayer_greenthresh, bypass_raw_bayer_greenthresh->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_bayer_greenthresh, bypass_raw_bayer_greenthresh->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_ccSteps, bypass_raw_ccSteps->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_ccSteps, bypass_raw_ccSteps->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_ca, bypass_raw_ca->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_ca, bypass_raw_ca->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_df, bypass_raw_df->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_df, bypass_raw_df->get_active ());
FE_OPT_STORE_(options.fastexport_bypass_raw_ff, bypass_raw_ff->get_active ()); FE_OPT_STORE_ (options.fastexport_bypass_raw_ff, bypass_raw_ff->get_active ());
//saving Bayer demosaic_method //saving Bayer demosaic_method
int currentRow = raw_bayer_method->get_active_row_number(); int currentRow = raw_bayer_method->get_active_row_number();
if( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) { if ( currentRow >= 0 && currentRow < procparams::RAWParams::BayerSensor::numMethods) {
FE_OPT_STORE_(options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::methodstring[currentRow]); FE_OPT_STORE_ (options.fastexport_raw_bayer_method, procparams::RAWParams::BayerSensor::methodstring[currentRow]);
} }
//saving X-Trans demosaic_method //saving X-Trans demosaic_method
currentRow = raw_xtrans_method->get_active_row_number(); currentRow = raw_xtrans_method->get_active_row_number();
if( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) { if ( currentRow >= 0 && currentRow < procparams::RAWParams::XTransSensor::numMethods) {
FE_OPT_STORE_(options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::methodstring[currentRow]); FE_OPT_STORE_ (options.fastexport_raw_xtrans_method, procparams::RAWParams::XTransSensor::methodstring[currentRow]);
} }
// options.fastexport_icm_input = icm_input ; // options.fastexport_icm_input = icm_input ;
@ -295,18 +295,18 @@ void ExportPanel::SaveSettingsAsDefault()
// options.fastexport_resize_appliesTo = resize_appliesTo; // options.fastexport_resize_appliesTo = resize_appliesTo;
// options.fastexport_resize_dataspec = resize_dataspec ; // options.fastexport_resize_dataspec = resize_dataspec ;
FE_OPT_STORE_(options.fastexport_resize_method, "Lanczos"); FE_OPT_STORE_ (options.fastexport_resize_method, "Lanczos");
FE_OPT_STORE_(options.fastexport_resize_width, MaxWidth->get_value_as_int ()); FE_OPT_STORE_ (options.fastexport_resize_width, MaxWidth->get_value_as_int ());
FE_OPT_STORE_(options.fastexport_resize_height, MaxHeight->get_value_as_int ()); FE_OPT_STORE_ (options.fastexport_resize_height, MaxHeight->get_value_as_int ());
FE_OPT_STORE_(options.fastexport_use_fast_pipeline, use_fast_pipeline->get_active()); FE_OPT_STORE_ (options.fastexport_use_fast_pipeline, use_fast_pipeline->get_active());
#undef FE_OPT_STORE_ #undef FE_OPT_STORE_
if (changed) { if (changed) {
try { try {
Options::save(); Options::save();
} catch (Options::Error &e) { } catch (Options::Error &e) {
Gtk::MessageDialog msgd(getToplevelWindow(this), e.get_msg(), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true); Gtk::MessageDialog msgd (getToplevelWindow (this), e.get_msg(), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true);
msgd.run(); msgd.run();
} }
} }
@ -328,7 +328,7 @@ void ExportPanel::LoadDefaultSettings()
//bypass_raw_bayer_all_enhance->set_active (options.fastexport_bypass_raw_bayer_all_enhance ); //bypass_raw_bayer_all_enhance->set_active (options.fastexport_bypass_raw_bayer_all_enhance );
bypass_raw_bayer_dcb_iterations->set_active (options.fastexport_bypass_raw_bayer_dcb_iterations ); bypass_raw_bayer_dcb_iterations->set_active (options.fastexport_bypass_raw_bayer_dcb_iterations );
bypass_raw_bayer_dcb_enhance->set_active (options.fastexport_bypass_raw_bayer_dcb_enhance ); bypass_raw_bayer_dcb_enhance->set_active (options.fastexport_bypass_raw_bayer_dcb_enhance );
bypass_raw_bayer_lmmse_iterations->set_active(options.fastexport_bypass_raw_bayer_lmmse_iterations); bypass_raw_bayer_lmmse_iterations->set_active (options.fastexport_bypass_raw_bayer_lmmse_iterations);
bypass_raw_bayer_linenoise->set_active (options.fastexport_bypass_raw_bayer_linenoise ); bypass_raw_bayer_linenoise->set_active (options.fastexport_bypass_raw_bayer_linenoise );
bypass_raw_bayer_greenthresh->set_active (options.fastexport_bypass_raw_bayer_greenthresh ); bypass_raw_bayer_greenthresh->set_active (options.fastexport_bypass_raw_bayer_greenthresh );
bypass_raw_ccSteps->set_active (options.fastexport_bypass_raw_ccSteps ); bypass_raw_ccSteps->set_active (options.fastexport_bypass_raw_ccSteps );
@ -337,20 +337,20 @@ void ExportPanel::LoadDefaultSettings()
bypass_raw_ff->set_active (options.fastexport_bypass_raw_ff ); bypass_raw_ff->set_active (options.fastexport_bypass_raw_ff );
// Bayer demosaic method // Bayer demosaic method
raw_bayer_method->set_active(procparams::RAWParams::BayerSensor::numMethods); raw_bayer_method->set_active (procparams::RAWParams::BayerSensor::numMethods);
for( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++) for ( size_t i = 0; i < procparams::RAWParams::BayerSensor::numMethods; i++)
if( options.fastexport_raw_bayer_method == procparams::RAWParams::BayerSensor::methodstring[i]) { if ( options.fastexport_raw_bayer_method == procparams::RAWParams::BayerSensor::methodstring[i]) {
raw_bayer_method->set_active(i); raw_bayer_method->set_active (i);
break; break;
} }
// X-Trans demosaic method // X-Trans demosaic method
raw_xtrans_method->set_active(procparams::RAWParams::XTransSensor::numMethods); raw_xtrans_method->set_active (procparams::RAWParams::XTransSensor::numMethods);
for( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++) for ( size_t i = 0; i < procparams::RAWParams::XTransSensor::numMethods; i++)
if( options.fastexport_raw_xtrans_method == procparams::RAWParams::XTransSensor::methodstring[i]) { if ( options.fastexport_raw_xtrans_method == procparams::RAWParams::XTransSensor::methodstring[i]) {
raw_xtrans_method->set_active(i); raw_xtrans_method->set_active (i);
break; break;
} }
@ -363,14 +363,14 @@ void ExportPanel::LoadDefaultSettings()
// resize_appliesTo = options.fastexport_resize_appliesTo; // resize_appliesTo = options.fastexport_resize_appliesTo;
// resize_dataspec = options.fastexport_resize_dataspec ; // resize_dataspec = options.fastexport_resize_dataspec ;
MaxWidth->set_value(options.fastexport_resize_width); MaxWidth->set_value (options.fastexport_resize_width);
MaxHeight->set_value(options.fastexport_resize_height); MaxHeight->set_value (options.fastexport_resize_height);
if (options.fastexport_use_fast_pipeline) { if (options.fastexport_use_fast_pipeline) {
use_fast_pipeline->set_active(true); use_fast_pipeline->set_active (true);
bypass_box->set_sensitive(false); bypass_box->set_sensitive (false);
} else { } else {
use_normal_pipeline->set_active(true); use_normal_pipeline->set_active (true);
} }
} }
@ -410,26 +410,26 @@ void ExportPanel::bypassALL_Toggled()
bypass_ALL->set_inconsistent (false); bypass_ALL->set_inconsistent (false);
bypass_sharpening->set_active(bypass_ALL->get_active()); bypass_sharpening->set_active (bypass_ALL->get_active());
bypass_sharpenEdge->set_active(bypass_ALL->get_active()); bypass_sharpenEdge->set_active (bypass_ALL->get_active());
bypass_sharpenMicro->set_active(bypass_ALL->get_active()); bypass_sharpenMicro->set_active (bypass_ALL->get_active());
//bypass_lumaDenoise->set_active(bypass_ALL->get_active()); //bypass_lumaDenoise->set_active(bypass_ALL->get_active());
//bypass_colorDenoise->set_active(bypass_ALL->get_active()); //bypass_colorDenoise->set_active(bypass_ALL->get_active());
bypass_defringe->set_active(bypass_ALL->get_active()); bypass_defringe->set_active (bypass_ALL->get_active());
bypass_dirpyrDenoise->set_active(bypass_ALL->get_active()); bypass_dirpyrDenoise->set_active (bypass_ALL->get_active());
bypass_sh_hq->set_active(bypass_ALL->get_active()); bypass_sh_hq->set_active (bypass_ALL->get_active());
bypass_dirpyrequalizer->set_active(bypass_ALL->get_active()); bypass_dirpyrequalizer->set_active (bypass_ALL->get_active());
bypass_wavelet->set_active(bypass_ALL->get_active()); bypass_wavelet->set_active (bypass_ALL->get_active());
//bypass_raw_bayer_all_enhance->set_active(bypass_ALL->get_active()); //bypass_raw_bayer_all_enhance->set_active(bypass_ALL->get_active());
bypass_raw_bayer_dcb_iterations->set_active(bypass_ALL->get_active()); bypass_raw_bayer_dcb_iterations->set_active (bypass_ALL->get_active());
bypass_raw_bayer_dcb_enhance->set_active(bypass_ALL->get_active()); bypass_raw_bayer_dcb_enhance->set_active (bypass_ALL->get_active());
bypass_raw_bayer_lmmse_iterations->set_active(bypass_ALL->get_active()); bypass_raw_bayer_lmmse_iterations->set_active (bypass_ALL->get_active());
bypass_raw_bayer_linenoise->set_active(bypass_ALL->get_active()); bypass_raw_bayer_linenoise->set_active (bypass_ALL->get_active());
bypass_raw_bayer_greenthresh->set_active(bypass_ALL->get_active()); bypass_raw_bayer_greenthresh->set_active (bypass_ALL->get_active());
bypass_raw_ccSteps->set_active(bypass_ALL->get_active()); bypass_raw_ccSteps->set_active (bypass_ALL->get_active());
bypass_raw_ca->set_active(bypass_ALL->get_active()); bypass_raw_ca->set_active (bypass_ALL->get_active());
bypass_raw_df->set_active(bypass_ALL->get_active()); bypass_raw_df->set_active (bypass_ALL->get_active());
bypass_raw_ff->set_active(bypass_ALL->get_active()); bypass_raw_ff->set_active (bypass_ALL->get_active());
bypass_sharpeningConn.block (false); bypass_sharpeningConn.block (false);
bypass_sharpenEdgeConn.block (false); bypass_sharpenEdgeConn.block (false);
@ -455,7 +455,7 @@ void ExportPanel::bypassALL_Toggled()
void ExportPanel::use_fast_pipeline_toggled() void ExportPanel::use_fast_pipeline_toggled()
{ {
bypass_box->set_sensitive(!use_fast_pipeline->get_active()); bypass_box->set_sensitive (!use_fast_pipeline->get_active());
} }
/* /*

File diff suppressed because it is too large Load Diff

View File

@ -118,83 +118,89 @@ static void myGdkLockLeave()
* -1 if there is an error in parameters * -1 if there is an error in parameters
* -2 if an error occurred during processing * -2 if an error occurred during processing
* -3 if at least one required procparam file was not found */ * -3 if at least one required procparam file was not found */
int processLineParams( int argc, char **argv ) int processLineParams ( int argc, char **argv )
{ {
for( int iArg = 1; iArg < argc; iArg++) { for ( int iArg = 1; iArg < argc; iArg++) {
Glib::ustring currParam(argv[iArg]); Glib::ustring currParam (argv[iArg]);
#if ECLIPSE_ARGS #if ECLIPSE_ARGS
currParam = currParam.substr(1, currParam.length()-2); currParam = currParam.substr (1, currParam.length() - 2);
#endif #endif
if( currParam.at(0) == '-' ) {
switch( currParam.at(1) ) { if ( currParam.at (0) == '-' ) {
switch ( currParam.at (1) ) {
#ifdef WIN32 #ifdef WIN32
case 'w': // This case is handled outside this function case 'w': // This case is handled outside this function
break; break;
#endif #endif
case 'v':
return 0; case 'v':
return 0;
#ifndef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two #ifndef __APPLE__ // TODO agriggio - there seems to be already some "single instance app" support for OSX in rtwindow. Disabling it here until I understand how to merge the two
case 'R':
if (!gimpPlugin) { case 'R':
remote = true; if (!gimpPlugin) {
} remote = true;
break; }
#endif
case 'g':
if (currParam == "-gimp") {
gimpPlugin = true;
simpleEditor = true;
remote = false;
break; break;
} #endif
case 'g':
if (currParam == "-gimp") {
gimpPlugin = true;
simpleEditor = true;
remote = false;
break;
}
// no break here on purpose // no break here on purpose
case 'h': case 'h':
case '?': case '?':
default: { default: {
Glib::ustring pparamsExt = paramFileExtension.substr(1); Glib::ustring pparamsExt = paramFileExtension.substr (1);
std::cout << " An advanced, cross-platform program for developing raw photos." << std::endl; std::cout << " An advanced, cross-platform program for developing raw photos." << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << " Website: http://www.rawtherapee.com/" << std::endl; std::cout << " Website: http://www.rawtherapee.com/" << std::endl;
std::cout << " Documentation: http://rawpedia.rawtherapee.com/" << std::endl; std::cout << " Documentation: http://rawpedia.rawtherapee.com/" << std::endl;
std::cout << " Forum: https://discuss.pixls.us/c/software/rawtherapee" << std::endl; std::cout << " Forum: https://discuss.pixls.us/c/software/rawtherapee" << std::endl;
std::cout << " Code and bug reports: https://github.com/Beep6581/RawTherapee" << std::endl; std::cout << " Code and bug reports: https://github.com/Beep6581/RawTherapee" << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << "Symbols:" << std::endl; std::cout << "Symbols:" << std::endl;
std::cout << " <Chevrons> indicate parameters you can change." << std::endl; std::cout << " <Chevrons> indicate parameters you can change." << std::endl;
//std::cout << " [Square brackets] mean the parameter is optional." << std::endl; //std::cout << " [Square brackets] mean the parameter is optional." << std::endl;
//std::cout << " The pipe symbol | indicates a choice of one or the other." << std::endl; //std::cout << " The pipe symbol | indicates a choice of one or the other." << std::endl;
//std::cout << " The dash symbol - denotes a range of possible values from one to the other." << std::endl; //std::cout << " The dash symbol - denotes a range of possible values from one to the other." << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << "Usage:" << std::endl; std::cout << "Usage:" << std::endl;
std::cout << " " << Glib::path_get_basename(argv[0]) << " <folder> Start File Browser inside folder." << std::endl; std::cout << " " << Glib::path_get_basename (argv[0]) << " <folder> Start File Browser inside folder." << std::endl;
std::cout << " " << Glib::path_get_basename(argv[0]) << " <file> Start Image Editor with file." << std::endl; std::cout << " " << Glib::path_get_basename (argv[0]) << " <file> Start Image Editor with file." << std::endl;
std::cout << std::endl; std::cout << std::endl;
std::cout << "Options:" << std::endl; std::cout << "Options:" << std::endl;
#ifdef WIN32 #ifdef WIN32
std::cout << " -w Do not open the Windows console" << std::endl; std::cout << " -w Do not open the Windows console" << std::endl;
#endif #endif
std::cout << " -v Print RawTherapee version number and exit" << std::endl; std::cout << " -v Print RawTherapee version number and exit" << std::endl;
#ifndef __APPLE__ #ifndef __APPLE__
std::cout << " -R Raise an already running RawTherapee instance (if available)" << std::endl; std::cout << " -R Raise an already running RawTherapee instance (if available)" << std::endl;
#endif #endif
std::cout << " -h -? Display this help message" << std::endl; std::cout << " -h -? Display this help message" << std::endl;
return -1; return -1;
} }
} }
} else { } else {
if (argv1.empty()) { if (argv1.empty()) {
argv1 = Glib::ustring(fname_to_utf8(argv[iArg])); argv1 = Glib::ustring (fname_to_utf8 (argv[iArg]));
#if ECLIPSE_ARGS #if ECLIPSE_ARGS
argv1 = argv1.substr(1, argv1.length()-2); argv1 = argv1.substr (1, argv1.length() - 2);
#endif #endif
} else if (gimpPlugin) { } else if (gimpPlugin) {
argv2 = Glib::ustring(fname_to_utf8(argv[iArg])); argv2 = Glib::ustring (fname_to_utf8 (argv[iArg]));
break; break;
} }
if (!gimpPlugin) { if (!gimpPlugin) {
break; break;
} }
@ -217,15 +223,15 @@ bool init_rt()
extProgStore->init(); extProgStore->init();
SoundManager::init(); SoundManager::init();
if( !options.rtSettings.verbose ) { if ( !options.rtSettings.verbose ) {
TIFFSetWarningHandler(nullptr); // avoid annoying message boxes TIFFSetWarningHandler (nullptr); // avoid annoying message boxes
} }
#ifndef WIN32 #ifndef WIN32
// Move the old path to the new one if the new does not exist // Move the old path to the new one if the new does not exist
if (Glib::file_test(Glib::build_filename(options.rtdir, "cache"), Glib::FILE_TEST_IS_DIR) && !Glib::file_test(options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) { if (Glib::file_test (Glib::build_filename (options.rtdir, "cache"), Glib::FILE_TEST_IS_DIR) && !Glib::file_test (options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) {
g_rename(Glib::build_filename (options.rtdir, "cache").c_str (), options.cacheBaseDir.c_str ()); g_rename (Glib::build_filename (options.rtdir, "cache").c_str (), options.cacheBaseDir.c_str ());
} }
#endif #endif
@ -242,11 +248,11 @@ void cleanup_rt()
RTWindow *create_rt_window() RTWindow *create_rt_window()
{ {
Glib::ustring icon_path = Glib::build_filename(argv0, "images"); Glib::ustring icon_path = Glib::build_filename (argv0, "images");
Glib::RefPtr<Gtk::IconTheme> defaultIconTheme = Gtk::IconTheme::get_default(); Glib::RefPtr<Gtk::IconTheme> defaultIconTheme = Gtk::IconTheme::get_default();
defaultIconTheme->append_search_path(icon_path); defaultIconTheme->append_search_path (icon_path);
rtengine::setPaths(options); rtengine::setPaths (options);
MyExpander::init(); // has to stay AFTER rtengine::setPaths MyExpander::init(); // has to stay AFTER rtengine::setPaths
// ------- loading theme files // ------- loading theme files
@ -254,30 +260,34 @@ RTWindow *create_rt_window()
Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default(); Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default();
if (screen) { if (screen) {
Gtk::Settings::get_for_screen(screen)->property_gtk_theme_name() = "Adwaita"; Gtk::Settings::get_for_screen (screen)->property_gtk_theme_name() = "Adwaita";
Gtk::Settings::get_for_screen(screen)->property_gtk_application_prefer_dark_theme() = true; Gtk::Settings::get_for_screen (screen)->property_gtk_application_prefer_dark_theme() = true;
Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS); Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create (THEMEREGEXSTR, Glib::RegexCompileFlags::REGEX_CASELESS);
Glib::ustring filename = Glib::build_filename(argv0, "themes", options.theme + ".css"); Glib::ustring filename = Glib::build_filename (argv0, "themes", options.theme + ".css");
if (!regex->match(options.theme + ".css") || !Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
if (!regex->match (options.theme + ".css") || !Glib::file_test (filename, Glib::FILE_TEST_EXISTS)) {
options.theme = "RawTherapee-GTK"; options.theme = "RawTherapee-GTK";
// We're not testing GTK_MAJOR_VERSION == 3 here, since this branch requires Gtk3 only // We're not testing GTK_MAJOR_VERSION == 3 here, since this branch requires Gtk3 only
if (GTK_MINOR_VERSION < 20) { if (GTK_MINOR_VERSION < 20) {
options.theme = options.theme + "3-_19"; options.theme = options.theme + "3-_19";
} else { } else {
options.theme = options.theme + "3-20_"; options.theme = options.theme + "3-20_";
} }
filename = Glib::build_filename(argv0, "themes", options.theme + ".css");
filename = Glib::build_filename (argv0, "themes", options.theme + ".css");
} }
cssRT = Gtk::CssProvider::create(); cssRT = Gtk::CssProvider::create();
try { try {
cssRT->load_from_path (filename); cssRT->load_from_path (filename);
Gtk::StyleContext::add_provider_for_screen(screen, cssRT, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); Gtk::StyleContext::add_provider_for_screen (screen, cssRT, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
} catch (Glib::Error &err) { } catch (Glib::Error &err) {
printf("Error: Can't load css file \"%s\"\nMessage: %s\n", filename.c_str(), err.what().c_str()); printf ("Error: Can't load css file \"%s\"\nMessage: %s\n", filename.c_str(), err.what().c_str());
} catch (...) { } catch (...) {
printf("Error: Can't load css file \"%s\"\n", filename.c_str()); printf ("Error: Can't load css file \"%s\"\n", filename.c_str());
} }
// Set the font face and size // Set the font face and size
@ -286,23 +296,23 @@ RTWindow *create_rt_window()
cssForced = Gtk::CssProvider::create(); cssForced = Gtk::CssProvider::create();
//GTK318 //GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
cssForced->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2px }", options.fontFamily, options.fontSize)); cssForced->load_from_data (Glib::ustring::compose ("* { font-family: %1; font-size: %2px }", options.fontFamily, options.fontSize));
#else #else
cssForced->load_from_data (Glib::ustring::compose("* { font-family: %1; font-size: %2pt }", options.fontFamily, options.fontSize)); cssForced->load_from_data (Glib::ustring::compose ("* { font-family: %1; font-size: %2pt }", options.fontFamily, options.fontSize));
#endif #endif
//GTK318 //GTK318
Gtk::StyleContext::add_provider_for_screen(screen, cssForced, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); Gtk::StyleContext::add_provider_for_screen (screen, cssForced, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
} catch (Glib::Error &err) { } catch (Glib::Error &err) {
printf("Error: \"%s\"\n", err.what().c_str()); printf ("Error: \"%s\"\n", err.what().c_str());
} catch (...) { } catch (...) {
printf("Error: Can't find the font named \"%s\"\n", options.fontFamily.c_str()); printf ("Error: Can't find the font named \"%s\"\n", options.fontFamily.c_str());
} }
} }
} }
#ifndef NDEBUG #ifndef NDEBUG
else if (!screen) { else if (!screen) {
printf("ERROR: Can't get default screen!\n"); printf ("ERROR: Can't get default screen!\n");
} }
#endif #endif
@ -314,12 +324,12 @@ RTWindow *create_rt_window()
// alerting users if the default raw and image profiles are missing // alerting users if the default raw and image profiles are missing
if (options.is_defProfRawMissing()) { if (options.is_defProfRawMissing()) {
Gtk::MessageDialog msgd (Glib::ustring::compose(M("OPTIONS_DEFRAW_MISSING"), options.defProfRaw), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); Gtk::MessageDialog msgd (Glib::ustring::compose (M ("OPTIONS_DEFRAW_MISSING"), options.defProfRaw), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run (); msgd.run ();
} }
if (options.is_defProfImgMissing()) { if (options.is_defProfImgMissing()) {
Gtk::MessageDialog msgd (Glib::ustring::compose(M("OPTIONS_DEFIMG_MISSING"), options.defProfImg), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); Gtk::MessageDialog msgd (Glib::ustring::compose (M ("OPTIONS_DEFIMG_MISSING"), options.defProfImg), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run (); msgd.run ();
} }
@ -327,12 +337,13 @@ RTWindow *create_rt_window()
} }
class RTApplication: public Gtk::Application { class RTApplication: public Gtk::Application
{
public: public:
RTApplication(): RTApplication():
Gtk::Application("com.rawtherapee.application", Gtk::Application ("com.rawtherapee.application",
Gio::APPLICATION_HANDLES_OPEN), Gio::APPLICATION_HANDLES_OPEN),
rtWindow(nullptr) rtWindow (nullptr)
{ {
} }
@ -341,6 +352,7 @@ public:
if (rtWindow) { if (rtWindow) {
delete rtWindow; delete rtWindow;
} }
cleanup_rt(); cleanup_rt();
} }
@ -350,19 +362,19 @@ private:
if (rtWindow) { if (rtWindow) {
return true; return true;
} }
if (!init_rt()) { if (!init_rt()) {
Gtk::MessageDialog msgd ("Fatal error!\nThe RT_SETTINGS and/or RT_PATH environment variables are set, but use a relative path. The path must be absolute!", true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); Gtk::MessageDialog msgd ("Fatal error!\nThe RT_SETTINGS and/or RT_PATH environment variables are set, but use a relative path. The path must be absolute!", true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
add_window(msgd); add_window (msgd);
msgd.run (); msgd.run ();
return false; return false;
} else { } else {
rtWindow = create_rt_window(); rtWindow = create_rt_window();
add_window(*rtWindow); add_window (*rtWindow);
return true; return true;
} }
} }
// Override default signal handlers: // Override default signal handlers:
void on_activate() override void on_activate() override
{ {
@ -370,9 +382,9 @@ private:
rtWindow->present(); rtWindow->present();
} }
} }
void on_open(const Gio::Application::type_vec_files& files, void on_open (const Gio::Application::type_vec_files& files,
const Glib::ustring& hint) override const Glib::ustring& hint) override
{ {
if (create_window()) { if (create_window()) {
struct Data { struct Data {
@ -382,29 +394,30 @@ private:
}; };
Data *d = new Data; Data *d = new Data;
d->filecatalog = rtWindow->fpanel->fileCatalog; d->filecatalog = rtWindow->fpanel->fileCatalog;
for (const auto &f : files) { for (const auto &f : files) {
Thumbnail *thm = cacheMgr->getEntry(f->get_path()); Thumbnail *thm = cacheMgr->getEntry (f->get_path());
if (thm) { if (thm) {
d->entries.push_back(thm); d->entries.push_back (thm);
d->lastfilename = f->get_path(); d->lastfilename = f->get_path();
} }
} }
if (!d->entries.empty()) { if (!d->entries.empty()) {
const auto doit = const auto doit =
[](gpointer data) -> gboolean [] (gpointer data) -> gboolean {
{ Data *d = static_cast<Data *> (data);
Data *d = static_cast<Data *>(data); d->filecatalog->openRequested (d->entries);
d->filecatalog->openRequested(d->entries); d->filecatalog->selectImage (d->lastfilename, true);
d->filecatalog->selectImage(d->lastfilename, true); delete d;
delete d; return FALSE;
return FALSE; };
}; gdk_threads_add_idle (doit, d);
gdk_threads_add_idle(doit, d);
} else { } else {
delete d; delete d;
} }
rtWindow->present(); rtWindow->present();
} }
} }
@ -416,10 +429,10 @@ private:
} // namespace } // namespace
int main(int argc, char **argv) int main (int argc, char **argv)
{ {
setlocale(LC_ALL, ""); setlocale (LC_ALL, "");
setlocale(LC_NUMERIC, "C"); // to set decimal point to "." setlocale (LC_NUMERIC, "C"); // to set decimal point to "."
simpleEditor = false; simpleEditor = false;
gimpPlugin = false; gimpPlugin = false;
@ -429,7 +442,7 @@ int main(int argc, char **argv)
argv2 = ""; argv2 = "";
Glib::init(); // called by Gtk::Main, but this may be important for thread handling, so we call it ourselves now Glib::init(); // called by Gtk::Main, but this may be important for thread handling, so we call it ourselves now
gdk_threads_set_lock_functions(G_CALLBACK(myGdkLockEnter), (G_CALLBACK(myGdkLockLeave))); gdk_threads_set_lock_functions (G_CALLBACK (myGdkLockEnter), (G_CALLBACK (myGdkLockLeave)));
gdk_threads_init(); gdk_threads_init();
gtk_init (&argc, &argv); // use the "--g-fatal-warnings" command line flag to make warnings fatal gtk_init (&argc, &argv); // use the "--g-fatal-warnings" command line flag to make warnings fatal
Gio::init (); Gio::init ();
@ -442,33 +455,33 @@ int main(int argc, char **argv)
#ifdef WIN32 #ifdef WIN32
WCHAR exnameU[512] = {0}; WCHAR exnameU[512] = {0};
GetModuleFileNameW (NULL, exnameU, 511); GetModuleFileNameW (NULL, exnameU, 511);
WideCharToMultiByte(CP_UTF8, 0, exnameU, -1, exname, 511, 0, 0 ); WideCharToMultiByte (CP_UTF8, 0, exnameU, -1, exname, 511, 0, 0 );
#else #else
if (readlink("/proc/self/exe", exname, 511) < 0) { if (readlink ("/proc/self/exe", exname, 511) < 0) {
strncpy(exname, argv[0], 511); strncpy (exname, argv[0], 511);
} }
#endif #endif
exePath = Glib::path_get_dirname(exname); exePath = Glib::path_get_dirname (exname);
// set paths // set paths
if (Glib::path_is_absolute(DATA_SEARCH_PATH)) { if (Glib::path_is_absolute (DATA_SEARCH_PATH)) {
argv0 = DATA_SEARCH_PATH; argv0 = DATA_SEARCH_PATH;
} else { } else {
argv0 = Glib::build_filename(exePath, DATA_SEARCH_PATH); argv0 = Glib::build_filename (exePath, DATA_SEARCH_PATH);
} }
if (Glib::path_is_absolute(CREDITS_SEARCH_PATH)) { if (Glib::path_is_absolute (CREDITS_SEARCH_PATH)) {
creditsPath = CREDITS_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH;
} else { } else {
creditsPath = Glib::build_filename(exePath, CREDITS_SEARCH_PATH); creditsPath = Glib::build_filename (exePath, CREDITS_SEARCH_PATH);
} }
if (Glib::path_is_absolute(LICENCE_SEARCH_PATH)) { if (Glib::path_is_absolute (LICENCE_SEARCH_PATH)) {
licensePath = LICENCE_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH;
} else { } else {
licensePath = Glib::build_filename(exePath, LICENCE_SEARCH_PATH); licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH);
} }
#else #else
@ -476,60 +489,61 @@ int main(int argc, char **argv)
creditsPath = CREDITS_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH;
licensePath = LICENCE_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH;
#endif #endif
#ifdef WIN32 #ifdef WIN32
bool consoleOpened = false; bool consoleOpened = false;
// suppression of annoying error boxes // suppression of annoying error boxes
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
if (argc > 1) {
int ret = processLineParams ( argc, argv);
if(argc > 1) {
int ret = processLineParams( argc, argv);
if (options.rtSettings.verbose || (!remote && !Glib::file_test (argv1, Glib::FILE_TEST_EXISTS ) && !Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR))) { if (options.rtSettings.verbose || (!remote && !Glib::file_test (argv1, Glib::FILE_TEST_EXISTS ) && !Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR))) {
bool stdoutRedirectedtoFile = (GetFileType(GetStdHandle(STD_OUTPUT_HANDLE)) == 0x0001); bool stdoutRedirectedtoFile = (GetFileType (GetStdHandle (STD_OUTPUT_HANDLE)) == 0x0001);
bool stderrRedirectedtoFile = (GetFileType(GetStdHandle(STD_ERROR_HANDLE)) == 0x0001); bool stderrRedirectedtoFile = (GetFileType (GetStdHandle (STD_ERROR_HANDLE)) == 0x0001);
// no console, if stdout and stderr both are redirected to file // no console, if stdout and stderr both are redirected to file
if( !(stdoutRedirectedtoFile && stderrRedirectedtoFile)) { if ( ! (stdoutRedirectedtoFile && stderrRedirectedtoFile)) {
// check if parameter -w was passed. // check if parameter -w was passed.
// We have to do that in this step, because it controls whether to open a console to show the output of following steps // We have to do that in this step, because it controls whether to open a console to show the output of following steps
bool Console = true; bool Console = true;
for(int i = 1; i < argc; i++) for (int i = 1; i < argc; i++)
if(!strcmp(argv[i], "-w")) { if (!strcmp (argv[i], "-w")) {
Console = false; Console = false;
break; break;
} }
if(Console && AllocConsole()) { if (Console && AllocConsole()) {
AttachConsole( GetCurrentProcessId() ) ; AttachConsole ( GetCurrentProcessId() ) ;
// Don't allow CTRL-C in console to terminate RT // Don't allow CTRL-C in console to terminate RT
SetConsoleCtrlHandler( NULL, true ); SetConsoleCtrlHandler ( NULL, true );
// Set title of console // Set title of console
char consoletitle[128]; char consoletitle[128];
sprintf(consoletitle, "RawTherapee %s Console", RTVERSION); sprintf (consoletitle, "RawTherapee %s Console", RTVERSION);
SetConsoleTitle(consoletitle); SetConsoleTitle (consoletitle);
// increase size of screen buffer // increase size of screen buffer
COORD c; COORD c;
c.X = 200; c.X = 200;
c.Y = 1000; c.Y = 1000;
SetConsoleScreenBufferSize( GetStdHandle( STD_OUTPUT_HANDLE ), c ); SetConsoleScreenBufferSize ( GetStdHandle ( STD_OUTPUT_HANDLE ), c );
// Disable console-Cursor // Disable console-Cursor
CONSOLE_CURSOR_INFO cursorInfo; CONSOLE_CURSOR_INFO cursorInfo;
cursorInfo.dwSize = 100; cursorInfo.dwSize = 100;
cursorInfo.bVisible = false; cursorInfo.bVisible = false;
SetConsoleCursorInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &cursorInfo ); SetConsoleCursorInfo ( GetStdHandle ( STD_OUTPUT_HANDLE ), &cursorInfo );
if(!stdoutRedirectedtoFile) { if (!stdoutRedirectedtoFile) {
freopen( "CON", "w", stdout ) ; freopen ( "CON", "w", stdout ) ;
} }
if(!stderrRedirectedtoFile) { if (!stderrRedirectedtoFile) {
freopen( "CON", "w", stderr ) ; freopen ( "CON", "w", stderr ) ;
} }
freopen( "CON", "r", stdin ) ; freopen ( "CON", "r", stdin ) ;
consoleOpened = true; consoleOpened = true;
@ -540,10 +554,10 @@ int main(int argc, char **argv)
} }
} }
if( ret <= 0 ) { if ( ret <= 0 ) {
if(consoleOpened) { if (consoleOpened) {
printf("Press any key to exit RawTherapee\n"); printf ("Press any key to exit RawTherapee\n");
FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE));
getch(); getch();
} }
@ -561,9 +575,9 @@ int main(int argc, char **argv)
#endif #endif
if (argc > 1) { if (argc > 1) {
int ret = processLineParams( argc, argv); int ret = processLineParams ( argc, argv);
if( ret <= 0 ) { if ( ret <= 0 ) {
return ret; return ret;
} }
} }
@ -572,51 +586,56 @@ int main(int argc, char **argv)
#endif #endif
if (gimpPlugin) { if (gimpPlugin) {
if (!Glib::file_test(argv1, Glib::FILE_TEST_EXISTS) || Glib::file_test(argv1, Glib::FILE_TEST_IS_DIR)) { if (!Glib::file_test (argv1, Glib::FILE_TEST_EXISTS) || Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR)) {
printf("Error: argv1 doesn't exist\n"); printf ("Error: argv1 doesn't exist\n");
return 1; return 1;
} }
if (argv2.empty()) { if (argv2.empty()) {
printf("Error: -gimp requires two arguments\n"); printf ("Error: -gimp requires two arguments\n");
return 1; return 1;
} }
} else if (!remote && Glib::file_test(argv1, Glib::FILE_TEST_EXISTS)) { } else if (!remote && Glib::file_test (argv1, Glib::FILE_TEST_EXISTS)) {
simpleEditor = true; simpleEditor = true;
} }
int ret = 0; int ret = 0;
if (remote) { if (remote) {
char *app_argv[2] = { const_cast<char *>(argv0.c_str()) }; char *app_argv[2] = { const_cast<char *> (argv0.c_str()) };
int app_argc = 1; int app_argc = 1;
if (!argv1.empty()) { if (!argv1.empty()) {
app_argc = 2; app_argc = 2;
app_argv[1] = const_cast<char *>(argv1.c_str()); app_argv[1] = const_cast<char *> (argv1.c_str());
} }
RTApplication app; RTApplication app;
ret = app.run(app_argc, app_argv); ret = app.run (app_argc, app_argv);
} else { } else {
if (init_rt()) { if (init_rt()) {
Gtk::Main m(&argc, &argv); Gtk::Main m (&argc, &argv);
gdk_threads_enter(); gdk_threads_enter();
const std::unique_ptr<RTWindow> rtWindow(create_rt_window()); const std::unique_ptr<RTWindow> rtWindow (create_rt_window());
m.run(*rtWindow); m.run (*rtWindow);
gdk_threads_leave(); gdk_threads_leave();
if (gimpPlugin && if (gimpPlugin &&
rtWindow->epanel && rtWindow->epanel->isRealized()) { rtWindow->epanel && rtWindow->epanel->isRealized()) {
SaveFormat sf; SaveFormat sf;
sf.format = "tif"; sf.format = "tif";
sf.tiffBits = 16; sf.tiffBits = 16;
sf.tiffUncompressed = true; sf.tiffUncompressed = true;
sf.saveParams = true; sf.saveParams = true;
if (!rtWindow->epanel->saveImmediately(argv2, sf)) { if (!rtWindow->epanel->saveImmediately (argv2, sf)) {
ret = -2; ret = -2;
} }
} }
cleanup_rt(); cleanup_rt();
} else { } else {
Gtk::Main m(&argc, &argv); Gtk::Main m (&argc, &argv);
Gtk::MessageDialog msgd ("Fatal error!\nThe RT_SETTINGS and/or RT_PATH environment variables are set, but use a relative path. The path must be absolute!", true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); Gtk::MessageDialog msgd ("Fatal error!\nThe RT_SETTINGS and/or RT_PATH environment variables are set, but use a relative path. The path must be absolute!", true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run (); msgd.run ();
ret = -2; ret = -2;
@ -626,8 +645,8 @@ int main(int argc, char **argv)
#ifdef WIN32 #ifdef WIN32
if (consoleOpened) { if (consoleOpened) {
printf("Press any key to exit RawTherapee\n"); printf ("Press any key to exit RawTherapee\n");
FlushConsoleInputBuffer(GetStdHandle(STD_INPUT_HANDLE)); FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE));
getch(); getch();
} }

View File

@ -750,8 +750,8 @@ void Options::readFromFile (Glib::ustring fname)
Glib::KeyFile keyFile; Glib::KeyFile keyFile;
if ( !Glib::file_test (fname, Glib::FILE_TEST_EXISTS)) { if ( !Glib::file_test (fname, Glib::FILE_TEST_EXISTS)) {
Glib::ustring msg = Glib::ustring::compose("Options file %1 does not exist", fname); Glib::ustring msg = Glib::ustring::compose ("Options file %1 does not exist", fname);
throw Error(msg); throw Error (msg);
} }
try { try {
@ -1831,6 +1831,7 @@ void Options::readFromFile (Glib::ustring fname)
if (keyFile.has_key ("Fast Export", "fastexport_resize_height" )) { if (keyFile.has_key ("Fast Export", "fastexport_resize_height" )) {
fastexport_resize_height = keyFile.get_integer ("Fast Export", "fastexport_resize_height" ); fastexport_resize_height = keyFile.get_integer ("Fast Export", "fastexport_resize_height" );
} }
if (keyFile.has_key ("Fast Export", "fastexport_use_fast_pipeline" )) { if (keyFile.has_key ("Fast Export", "fastexport_use_fast_pipeline" )) {
fastexport_use_fast_pipeline = keyFile.get_integer ("Fast Export", "fastexport_use_fast_pipeline" ); fastexport_use_fast_pipeline = keyFile.get_integer ("Fast Export", "fastexport_use_fast_pipeline" );
} }
@ -1863,17 +1864,21 @@ void Options::readFromFile (Glib::ustring fname)
} }
} catch (Glib::Error &err) { } catch (Glib::Error &err) {
Glib::ustring msg = Glib::ustring::compose("Options::readFromFile / Error code %1 while reading values from \"%2\":\n%3", err.code(), fname, err.what()); Glib::ustring msg = Glib::ustring::compose ("Options::readFromFile / Error code %1 while reading values from \"%2\":\n%3", err.code(), fname, err.what());
if (options.rtSettings.verbose) {
printf("%s\n", msg.c_str());
}
throw Error(msg);
} catch (...) {
Glib::ustring msg = Glib::ustring::compose("Options::readFromFile / Unknown exception while trying to load \"%1\"!", fname);
if (options.rtSettings.verbose) { if (options.rtSettings.verbose) {
printf ("%s\n", msg.c_str()); printf ("%s\n", msg.c_str());
} }
throw Error(msg);
throw Error (msg);
} catch (...) {
Glib::ustring msg = Glib::ustring::compose ("Options::readFromFile / Unknown exception while trying to load \"%1\"!", fname);
if (options.rtSettings.verbose) {
printf ("%s\n", msg.c_str());
}
throw Error (msg);
} }
} }
@ -2223,15 +2228,15 @@ void Options::saveToFile (Glib::ustring fname)
keyData = keyFile.to_data (); keyData = keyFile.to_data ();
} catch (Glib::KeyFileError &e) { } catch (Glib::KeyFileError &e) {
throw Error(e.what()); throw Error (e.what());
} }
FILE *f = g_fopen (fname.c_str (), "wt"); FILE *f = g_fopen (fname.c_str (), "wt");
if (f == nullptr) { if (f == nullptr) {
std::cout << "Warning! Unable to save your preferences to: " << fname << std::endl; std::cout << "Warning! Unable to save your preferences to: " << fname << std::endl;
Glib::ustring msg_ = Glib::ustring::compose(M("MAIN_MSG_WRITEFAILED"), fname.c_str()); Glib::ustring msg_ = Glib::ustring::compose (M ("MAIN_MSG_WRITEFAILED"), fname.c_str());
throw Error(msg_); throw Error (msg_);
} else { } else {
fprintf (f, "%s", keyData.c_str ()); fprintf (f, "%s", keyData.c_str ());
fclose (f); fclose (f);
@ -2252,8 +2257,8 @@ void Options::load (bool lightweight)
rtdir = Glib::ustring (path); rtdir = Glib::ustring (path);
if (!Glib::path_is_absolute (rtdir)) { if (!Glib::path_is_absolute (rtdir)) {
Glib::ustring msg = Glib::ustring::compose("Settings path %1 is not absolute", rtdir); Glib::ustring msg = Glib::ustring::compose ("Settings path %1 is not absolute", rtdir);
throw Error(msg); throw Error (msg);
} }
} else { } else {
#ifdef WIN32 #ifdef WIN32
@ -2291,8 +2296,8 @@ void Options::load (bool lightweight)
cacheBaseDir = Glib::ustring (path); cacheBaseDir = Glib::ustring (path);
if (!Glib::path_is_absolute (cacheBaseDir)) { if (!Glib::path_is_absolute (cacheBaseDir)) {
Glib::ustring msg = Glib::ustring::compose("Cache base dir %1 is not absolute", cacheBaseDir); Glib::ustring msg = Glib::ustring::compose ("Cache base dir %1 is not absolute", cacheBaseDir);
throw Error(msg); throw Error (msg);
} }
} }
// No environment variable provided, so falling back to the multi user mode, is enabled // No environment variable provided, so falling back to the multi user mode, is enabled

View File

@ -43,17 +43,16 @@
// Special name for the Dynamic profile // Special name for the Dynamic profile
#define DEFPROFILE_DYNAMIC "Dynamic" #define DEFPROFILE_DYNAMIC "Dynamic"
struct SaveFormat struct SaveFormat {
{
SaveFormat() : SaveFormat() :
format("jpg"), format ("jpg"),
pngBits(8), pngBits (8),
pngCompression(6), pngCompression (6),
jpegQuality(90), jpegQuality (90),
jpegSubSamp(2), jpegSubSamp (2),
tiffBits(8), tiffBits (8),
tiffUncompressed(true), tiffUncompressed (true),
saveParams(true) saveParams (true)
{ {
} }
@ -75,11 +74,18 @@ enum prevdemo_t {PD_Sidecar = 1, PD_Fast = 0};
class Options class Options
{ {
public: public:
class Error: public std::exception { class Error: public std::exception
{
public: public:
Error(const Glib::ustring &msg): msg_(msg) {} Error (const Glib::ustring &msg): msg_ (msg) {}
const char *what() const throw() { return msg_.c_str(); } const char *what() const throw()
const Glib::ustring &get_msg() const throw() { return msg_; } {
return msg_.c_str();
}
const Glib::ustring &get_msg() const throw()
{
return msg_;
}
private: private:
Glib::ustring msg_; Glib::ustring msg_;
@ -90,8 +96,8 @@ private:
bool defProfImgMissing; bool defProfImgMissing;
Glib::ustring userProfilePath; Glib::ustring userProfilePath;
Glib::ustring globalProfilePath; Glib::ustring globalProfilePath;
bool checkProfilePath(Glib::ustring &path); bool checkProfilePath (Glib::ustring &path);
bool checkDirPath(Glib::ustring &path, Glib::ustring errString); bool checkDirPath (Glib::ustring &path, Glib::ustring errString);
void updatePaths(); void updatePaths();
int getString (const char* src, char* dst); int getString (const char* src, char* dst);
void error (int line); void error (int line);
@ -106,8 +112,8 @@ private:
* @param destination destination variable to store to * @param destination destination variable to store to
* @return @c true if @p destination was changed * @return @c true if @p destination was changed
*/ */
bool safeDirGet(const Glib::KeyFile& keyFile, const Glib::ustring& section, bool safeDirGet (const Glib::KeyFile& keyFile, const Glib::ustring& section,
const Glib::ustring& entryName, Glib::ustring& destination); const Glib::ustring& entryName, Glib::ustring& destination);
public: public:
@ -336,9 +342,9 @@ public:
Options* copyFrom (Options* other); Options* copyFrom (Options* other);
void filterOutParsedExtensions (); void filterOutParsedExtensions ();
void setDefaults (); void setDefaults ();
void readFromFile(Glib::ustring fname); void readFromFile (Glib::ustring fname);
void saveToFile(Glib::ustring fname); void saveToFile (Glib::ustring fname);
static void load(bool lightweight = false); static void load (bool lightweight = false);
static void save(); static void save();
// if multiUser=false, send back the global profile path // if multiUser=false, send back the global profile path
@ -351,10 +357,10 @@ public:
{ {
return globalProfilePath; return globalProfilePath;
} }
Glib::ustring findProfilePath(Glib::ustring &profName); Glib::ustring findProfilePath (Glib::ustring &profName);
bool is_parse_extention (Glib::ustring fname); bool is_parse_extention (Glib::ustring fname);
bool has_retained_extention (Glib::ustring fname); bool has_retained_extention (Glib::ustring fname);
bool is_extention_enabled(Glib::ustring ext); bool is_extention_enabled (Glib::ustring ext);
bool is_defProfRawMissing() bool is_defProfRawMissing()
{ {
return defProfRawMissing; return defProfRawMissing;
@ -363,11 +369,11 @@ public:
{ {
return defProfImgMissing; return defProfImgMissing;
} }
void setDefProfRawMissing(bool value) void setDefProfRawMissing (bool value)
{ {
defProfRawMissing = value; defProfRawMissing = value;
} }
void setDefProfImgMissing(bool value) void setDefProfImgMissing (bool value)
{ {
defProfImgMissing = value; defProfImgMissing = value;
} }

File diff suppressed because it is too large Load Diff

View File

@ -32,27 +32,27 @@ static gboolean
osx_should_quit_cb (GtkosxApplication *app, gpointer data) osx_should_quit_cb (GtkosxApplication *app, gpointer data)
{ {
RTWindow *rtWin = (RTWindow *)data; RTWindow *rtWin = (RTWindow *)data;
return rtWin->on_delete_event(0); return rtWin->on_delete_event (0);
} }
static void static void
osx_will_quit_cb (GtkosxApplication *app, gpointer data) osx_will_quit_cb (GtkosxApplication *app, gpointer data)
{ {
RTWindow *rtWin = (RTWindow *)data; RTWindow *rtWin = (RTWindow *)data;
rtWin->on_delete_event(0); rtWin->on_delete_event (0);
gtk_main_quit (); gtk_main_quit ();
} }
bool RTWindow::osxFileOpenEvent(Glib::ustring path) bool RTWindow::osxFileOpenEvent (Glib::ustring path)
{ {
CacheManager* cm = CacheManager::getInstance(); CacheManager* cm = CacheManager::getInstance();
Thumbnail* thm = cm->getEntry( path ); Thumbnail* thm = cm->getEntry ( path );
if(thm && fpanel) { if (thm && fpanel) {
std::vector<Thumbnail*> entries; std::vector<Thumbnail*> entries;
entries.push_back(thm); entries.push_back (thm);
fpanel->fileCatalog->openRequested(entries); fpanel->fileCatalog->openRequested (entries);
return true; return true;
} }
@ -69,25 +69,25 @@ osx_open_file_cb (GtkosxApplication *app, gchar *path_, gpointer data)
return false; return false;
} }
Glib::ustring path = Glib::ustring(path_); Glib::ustring path = Glib::ustring (path_);
Glib::ustring suffix = path.length() > 4 ? path.substr(path.length() - 3) : ""; Glib::ustring suffix = path.length() > 4 ? path.substr (path.length() - 3) : "";
suffix = suffix.lowercase(); suffix = suffix.lowercase();
if (suffix == "pp3") { if (suffix == "pp3") {
path = path.substr(0, path.length() - 4); path = path.substr (0, path.length() - 4);
} }
return rtWin->osxFileOpenEvent(path); return rtWin->osxFileOpenEvent (path);
} }
#endif // __APPLE__ #endif // __APPLE__
RTWindow::RTWindow () RTWindow::RTWindow ()
: mainNB(nullptr) : mainNB (nullptr)
, bpanel(nullptr) , bpanel (nullptr)
, splash(nullptr) , splash (nullptr)
, btn_fullscreen(nullptr) , btn_fullscreen (nullptr)
, epanel(nullptr) , epanel (nullptr)
, fpanel(nullptr) , fpanel (nullptr)
{ {
cacheMgr->init (); cacheMgr->init ();
@ -95,11 +95,11 @@ RTWindow::RTWindow ()
ProfilePanel::init (this); ProfilePanel::init (this);
Glib::ustring fName = "rt-logo-small.png"; Glib::ustring fName = "rt-logo-small.png";
Glib::ustring fullPath = rtengine::findIconAbsolutePath(fName); Glib::ustring fullPath = rtengine::findIconAbsolutePath (fName);
try { try {
set_default_icon_from_file (fullPath); set_default_icon_from_file (fullPath);
} catch(Glib::Exception& ex) { } catch (Glib::Exception& ex) {
printf ("%s\n", ex.what().c_str()); printf ("%s\n", ex.what().c_str());
} }
@ -122,55 +122,57 @@ RTWindow::RTWindow ()
#endif #endif
versionStr = "RawTherapee " + versionString; versionStr = "RawTherapee " + versionString;
set_title_decorated(""); set_title_decorated ("");
set_resizable(true); set_resizable (true);
set_decorated(true); set_decorated (true);
set_default_size(options.windowWidth, options.windowHeight); set_default_size (options.windowWidth, options.windowHeight);
set_modal(false); set_modal (false);
Gdk::Rectangle lMonitorRect; Gdk::Rectangle lMonitorRect;
get_screen()->get_monitor_geometry(std::min(options.windowMonitor, Gdk::Screen::get_default()->get_n_monitors() - 1), lMonitorRect); get_screen()->get_monitor_geometry (std::min (options.windowMonitor, Gdk::Screen::get_default()->get_n_monitors() - 1), lMonitorRect);
if (options.windowMaximized) { if (options.windowMaximized) {
move(lMonitorRect.get_x(), lMonitorRect.get_y()); move (lMonitorRect.get_x(), lMonitorRect.get_y());
maximize(); maximize();
} else { } else {
unmaximize(); unmaximize();
resize(options.windowWidth, options.windowHeight); resize (options.windowWidth, options.windowHeight);
if(options.windowX <= lMonitorRect.get_x() + lMonitorRect.get_width() && options.windowY <= lMonitorRect.get_y() + lMonitorRect.get_height()) {
move(options.windowX, options.windowY); if (options.windowX <= lMonitorRect.get_x() + lMonitorRect.get_width() && options.windowY <= lMonitorRect.get_y() + lMonitorRect.get_height()) {
move (options.windowX, options.windowY);
} else { } else {
move(lMonitorRect.get_x(), lMonitorRect.get_y()); move (lMonitorRect.get_x(), lMonitorRect.get_y());
} }
} }
on_delete_has_run = false; on_delete_has_run = false;
is_fullscreen = false; is_fullscreen = false;
property_destroy_with_parent().set_value(false); property_destroy_with_parent().set_value (false);
signal_window_state_event().connect( sigc::mem_fun(*this, &RTWindow::on_window_state_event) ); signal_window_state_event().connect ( sigc::mem_fun (*this, &RTWindow::on_window_state_event) );
signal_key_press_event().connect( sigc::mem_fun(*this, &RTWindow::keyPressed) ); signal_key_press_event().connect ( sigc::mem_fun (*this, &RTWindow::keyPressed) );
if(simpleEditor) { if (simpleEditor) {
epanel = Gtk::manage( new EditorPanel (nullptr) ); epanel = Gtk::manage ( new EditorPanel (nullptr) );
epanel->setParent (this); epanel->setParent (this);
epanel->setParentWindow(this); epanel->setParentWindow (this);
add (*epanel); add (*epanel);
show_all (); show_all ();
pldBridge = nullptr; // No progress listener pldBridge = nullptr; // No progress listener
CacheManager* cm = CacheManager::getInstance(); CacheManager* cm = CacheManager::getInstance();
Thumbnail* thm = cm->getEntry( argv1 ); Thumbnail* thm = cm->getEntry ( argv1 );
if(thm) { if (thm) {
int error; int error;
rtengine::InitialImage *ii = rtengine::InitialImage::load(argv1, thm->getType() == FT_Raw, &error, nullptr); rtengine::InitialImage *ii = rtengine::InitialImage::load (argv1, thm->getType() == FT_Raw, &error, nullptr);
epanel->open( thm, ii ); epanel->open ( thm, ii );
} }
} else { } else {
mainNB = Gtk::manage (new Gtk::Notebook ()); mainNB = Gtk::manage (new Gtk::Notebook ());
mainNB->set_name ("MainNotebook"); mainNB->set_name ("MainNotebook");
mainNB->set_scrollable (true); mainNB->set_scrollable (true);
mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) ); mainNB->signal_switch_page().connect_notify ( sigc::mem_fun (*this, &RTWindow::on_mainNB_switch_page) );
// Editor panel // Editor panel
fpanel = new FilePanel () ; fpanel = new FilePanel () ;
@ -178,20 +180,20 @@ RTWindow::RTWindow ()
// decorate tab // decorate tab
Gtk::Grid* fpanelLabelGrid = Gtk::manage (new Gtk::Grid ()); Gtk::Grid* fpanelLabelGrid = Gtk::manage (new Gtk::Grid ());
setExpandAlignProperties(fpanelLabelGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); setExpandAlignProperties (fpanelLabelGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
Gtk::Label* fpl = Gtk::manage (new Gtk::Label( Glib::ustring(" ") + M("MAIN_FRAME_EDITOR") )); Gtk::Label* fpl = Gtk::manage (new Gtk::Label ( Glib::ustring (" ") + M ("MAIN_FRAME_EDITOR") ));
if (options.mainNBVertical) { if (options.mainNBVertical) {
mainNB->set_tab_pos (Gtk::POS_LEFT); mainNB->set_tab_pos (Gtk::POS_LEFT);
fpl->set_angle (90); fpl->set_angle (90);
fpanelLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_TOP, 1, 1); fpanelLabelGrid->attach_next_to (*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_TOP, 1, 1);
fpanelLabelGrid->attach_next_to(*fpl, Gtk::POS_TOP, 1, 1); fpanelLabelGrid->attach_next_to (*fpl, Gtk::POS_TOP, 1, 1);
} else { } else {
fpanelLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_RIGHT, 1, 1); fpanelLabelGrid->attach_next_to (*Gtk::manage (new RTImage ("gtk-directory.png")), Gtk::POS_RIGHT, 1, 1);
fpanelLabelGrid->attach_next_to(*fpl, Gtk::POS_RIGHT, 1, 1); fpanelLabelGrid->attach_next_to (*fpl, Gtk::POS_RIGHT, 1, 1);
} }
fpanelLabelGrid->set_tooltip_markup (M("MAIN_FRAME_FILEBROWSER_TOOLTIP")); fpanelLabelGrid->set_tooltip_markup (M ("MAIN_FRAME_FILEBROWSER_TOOLTIP"));
fpanelLabelGrid->show_all (); fpanelLabelGrid->show_all ();
mainNB->append_page (*fpanel, *fpanelLabelGrid); mainNB->append_page (*fpanel, *fpanelLabelGrid);
@ -200,16 +202,16 @@ RTWindow::RTWindow ()
bpanel = Gtk::manage ( new BatchQueuePanel (fpanel->fileCatalog) ); bpanel = Gtk::manage ( new BatchQueuePanel (fpanel->fileCatalog) );
// decorate tab, the label is unimportant since its updated in batchqueuepanel anyway // decorate tab, the label is unimportant since its updated in batchqueuepanel anyway
Gtk::Label* lbq = Gtk::manage ( new Gtk::Label (M("MAIN_FRAME_BATCHQUEUE")) ); Gtk::Label* lbq = Gtk::manage ( new Gtk::Label (M ("MAIN_FRAME_BATCHQUEUE")) );
if (options.mainNBVertical) { if (options.mainNBVertical) {
lbq->set_angle(90); lbq->set_angle (90);
} }
mainNB->append_page (*bpanel, *lbq); mainNB->append_page (*bpanel, *lbq);
if(isSingleTabMode()) { if (isSingleTabMode()) {
createSetmEditor(); createSetmEditor();
} }
@ -225,46 +227,46 @@ RTWindow::RTWindow ()
//Gtk::LinkButton* rtWeb = Gtk::manage (new Gtk::LinkButton ("http://rawtherapee.com")); // unused... but fail to be linked anyway !? //Gtk::LinkButton* rtWeb = Gtk::manage (new Gtk::LinkButton ("http://rawtherapee.com")); // unused... but fail to be linked anyway !?
//Gtk::Button* preferences = Gtk::manage (new Gtk::Button (M("MAIN_BUTTON_PREFERENCES")+"...")); //Gtk::Button* preferences = Gtk::manage (new Gtk::Button (M("MAIN_BUTTON_PREFERENCES")+"..."));
Gtk::Button* preferences = Gtk::manage (new Gtk::Button ()); Gtk::Button* preferences = Gtk::manage (new Gtk::Button ());
setExpandAlignProperties(preferences, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); setExpandAlignProperties (preferences, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
preferences->set_image (*Gtk::manage(new RTImage ("gtk-preferences.png"))); preferences->set_image (*Gtk::manage (new RTImage ("gtk-preferences.png")));
preferences->set_tooltip_markup (M("MAIN_BUTTON_PREFERENCES")); preferences->set_tooltip_markup (M ("MAIN_BUTTON_PREFERENCES"));
preferences->signal_clicked().connect( sigc::mem_fun(*this, &RTWindow::showPreferences) ); preferences->signal_clicked().connect ( sigc::mem_fun (*this, &RTWindow::showPreferences) );
//btn_fullscreen = Gtk::manage( new Gtk::Button(M("MAIN_BUTTON_FULLSCREEN"))); //btn_fullscreen = Gtk::manage( new Gtk::Button(M("MAIN_BUTTON_FULLSCREEN")));
btn_fullscreen = Gtk::manage( new Gtk::Button()); btn_fullscreen = Gtk::manage ( new Gtk::Button());
setExpandAlignProperties(btn_fullscreen, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); setExpandAlignProperties (btn_fullscreen, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
btn_fullscreen->set_tooltip_markup (M("MAIN_BUTTON_FULLSCREEN")); btn_fullscreen->set_tooltip_markup (M ("MAIN_BUTTON_FULLSCREEN"));
btn_fullscreen->set_image (*iFullscreen); btn_fullscreen->set_image (*iFullscreen);
btn_fullscreen->signal_clicked().connect( sigc::mem_fun(*this, &RTWindow::toggle_fullscreen) ); btn_fullscreen->signal_clicked().connect ( sigc::mem_fun (*this, &RTWindow::toggle_fullscreen) );
setExpandAlignProperties(&prProgBar, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); setExpandAlignProperties (&prProgBar, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
prProgBar.set_show_text(true); prProgBar.set_show_text (true);
Gtk::Grid* actionGrid = Gtk::manage (new Gtk::Grid ()); Gtk::Grid* actionGrid = Gtk::manage (new Gtk::Grid ());
actionGrid->set_row_spacing(2); actionGrid->set_row_spacing (2);
actionGrid->set_column_spacing(2); actionGrid->set_column_spacing (2);
setExpandAlignProperties(actionGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); setExpandAlignProperties (actionGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
if (options.mainNBVertical) { if (options.mainNBVertical) {
prProgBar.set_orientation(Gtk::ORIENTATION_VERTICAL); prProgBar.set_orientation (Gtk::ORIENTATION_VERTICAL);
prProgBar.set_inverted(true); prProgBar.set_inverted (true);
actionGrid->set_orientation(Gtk::ORIENTATION_VERTICAL); actionGrid->set_orientation (Gtk::ORIENTATION_VERTICAL);
actionGrid->attach_next_to(prProgBar, Gtk::POS_BOTTOM, 1, 1); actionGrid->attach_next_to (prProgBar, Gtk::POS_BOTTOM, 1, 1);
actionGrid->attach_next_to(*preferences, Gtk::POS_BOTTOM, 1, 1); actionGrid->attach_next_to (*preferences, Gtk::POS_BOTTOM, 1, 1);
actionGrid->attach_next_to(*btn_fullscreen, Gtk::POS_BOTTOM, 1, 1); actionGrid->attach_next_to (*btn_fullscreen, Gtk::POS_BOTTOM, 1, 1);
mainNB->set_action_widget(actionGrid, Gtk::PACK_END); mainNB->set_action_widget (actionGrid, Gtk::PACK_END);
} else { } else {
prProgBar.set_orientation(Gtk::ORIENTATION_HORIZONTAL); prProgBar.set_orientation (Gtk::ORIENTATION_HORIZONTAL);
actionGrid->set_orientation(Gtk::ORIENTATION_HORIZONTAL); actionGrid->set_orientation (Gtk::ORIENTATION_HORIZONTAL);
actionGrid->attach_next_to(prProgBar, Gtk::POS_RIGHT, 1, 1); actionGrid->attach_next_to (prProgBar, Gtk::POS_RIGHT, 1, 1);
actionGrid->attach_next_to(*preferences, Gtk::POS_RIGHT, 1, 1); actionGrid->attach_next_to (*preferences, Gtk::POS_RIGHT, 1, 1);
actionGrid->attach_next_to(*btn_fullscreen, Gtk::POS_RIGHT, 1, 1); actionGrid->attach_next_to (*btn_fullscreen, Gtk::POS_RIGHT, 1, 1);
mainNB->set_action_widget(actionGrid, Gtk::PACK_END); mainNB->set_action_widget (actionGrid, Gtk::PACK_END);
} }
actionGrid->show_all(); actionGrid->show_all();
pldBridge = new PLDBridge(static_cast<rtengine::ProgressListener*>(this)); pldBridge = new PLDBridge (static_cast<rtengine::ProgressListener*> (this));
add (*mainNB); add (*mainNB);
show_all (); show_all ();
@ -272,9 +274,10 @@ RTWindow::RTWindow ()
bpanel->init (this); bpanel->init (this);
if (!argv1.empty() && !remote) { if (!argv1.empty() && !remote) {
Thumbnail* thm = cacheMgr->getEntry(argv1); Thumbnail* thm = cacheMgr->getEntry (argv1);
if (thm) { if (thm) {
fpanel->fileCatalog->openRequested({thm}); fpanel->fileCatalog->openRequested ({thm});
} }
} }
} }
@ -282,7 +285,7 @@ RTWindow::RTWindow ()
RTWindow::~RTWindow() RTWindow::~RTWindow()
{ {
if(!simpleEditor) { if (!simpleEditor) {
delete pldBridge; delete pldBridge;
} }
@ -300,7 +303,7 @@ void RTWindow::on_realize ()
{ {
Gtk::Window::on_realize (); Gtk::Window::on_realize ();
if( fpanel ) { if ( fpanel ) {
fpanel->setAspect(); fpanel->setAspect();
} }
@ -308,19 +311,20 @@ void RTWindow::on_realize ()
epanel->setAspect(); epanel->setAspect();
} }
mainWindowCursorManager.init(get_window()); mainWindowCursorManager.init (get_window());
// Display release notes only if new major version. // Display release notes only if new major version.
// Pattern matches "5.1" from "5.1-23-g12345678" // Pattern matches "5.1" from "5.1-23-g12345678"
std::string vs[] = {versionString, options.version}; std::string vs[] = {versionString, options.version};
std::regex pat("(^[0-9.]+).*"); std::regex pat ("(^[0-9.]+).*");
std::smatch sm; std::smatch sm;
std::vector<std::string> vMajor; std::vector<std::string> vMajor;
for (const auto &v : vs) { for (const auto &v : vs) {
if (std::regex_match(v, sm, pat)) { if (std::regex_match (v, sm, pat)) {
if (sm.size() == 2) { if (sm.size() == 2) {
std::ssub_match smsub = sm[1]; std::ssub_match smsub = sm[1];
vMajor.push_back(smsub.str()); vMajor.push_back (smsub.str());
} }
} }
} }
@ -333,7 +337,7 @@ void RTWindow::on_realize ()
splash = new Splash (*this); splash = new Splash (*this);
splash->set_transient_for (*this); splash->set_transient_for (*this);
splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) ); splash->signal_delete_event().connect ( sigc::mem_fun (*this, &RTWindow::splashClosed) );
if (splash->hasReleaseNotes()) { if (splash->hasReleaseNotes()) {
splash->showReleaseNotes(); splash->showReleaseNotes();
@ -346,38 +350,39 @@ void RTWindow::on_realize ()
} }
} }
bool RTWindow::on_configure_event(GdkEventConfigure* event) bool RTWindow::on_configure_event (GdkEventConfigure* event)
{ {
if (!is_maximized() && is_visible()) { if (!is_maximized() && is_visible()) {
get_size(options.windowWidth, options.windowHeight); get_size (options.windowWidth, options.windowHeight);
get_position (options.windowX, options.windowY); get_position (options.windowX, options.windowY);
} }
return Gtk::Widget::on_configure_event(event); return Gtk::Widget::on_configure_event (event);
} }
bool RTWindow::on_window_state_event(GdkEventWindowState* event) bool RTWindow::on_window_state_event (GdkEventWindowState* event)
{ {
if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) { if (event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) {
options.windowMaximized = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED; options.windowMaximized = event->new_window_state & GDK_WINDOW_STATE_MAXIMIZED;
} }
return Gtk::Widget::on_window_state_event(event);
return Gtk::Widget::on_window_state_event (event);
} }
void RTWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num) void RTWindow::on_mainNB_switch_page (Gtk::Widget* widget, guint page_num)
{ {
if(!on_delete_has_run) { if (!on_delete_has_run) {
if(isEditorPanel(page_num)) { if (isEditorPanel (page_num)) {
if (isSingleTabMode() && epanel) { if (isSingleTabMode() && epanel) {
MoveFileBrowserToEditor(); MoveFileBrowserToEditor();
} }
EditorPanel *ep = static_cast<EditorPanel*>(mainNB->get_nth_page(page_num)); EditorPanel *ep = static_cast<EditorPanel*> (mainNB->get_nth_page (page_num));
ep->setAspect(); ep->setAspect();
if (!isSingleTabMode()) { if (!isSingleTabMode()) {
if (filesEdited.size() > 0) { if (filesEdited.size() > 0) {
set_title_decorated(ep->getFileName()); set_title_decorated (ep->getFileName());
} }
} }
} else { } else {
@ -387,7 +392,7 @@ void RTWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num)
epanel->saveProfile(); epanel->saveProfile();
// Moving the FileBrowser only if the user has switched to the FileBrowser tab // Moving the FileBrowser only if the user has switched to the FileBrowser tab
if (mainNB->get_nth_page(page_num) == fpanel) { if (mainNB->get_nth_page (page_num) == fpanel) {
MoveFileBrowserToMain(); MoveFileBrowserToMain();
} }
} }
@ -398,32 +403,32 @@ void RTWindow::on_mainNB_switch_page(Gtk::Widget* widget, guint page_num)
void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name)
{ {
if (options.multiDisplayMode > 0) { if (options.multiDisplayMode > 0) {
EditWindow * wndEdit = EditWindow::getInstance(this); EditWindow * wndEdit = EditWindow::getInstance (this);
wndEdit->show(); wndEdit->show();
wndEdit->addEditorPanel(ep, name); wndEdit->addEditorPanel (ep, name);
wndEdit->toFront(); wndEdit->toFront();
} else { } else {
ep->setParent (this); ep->setParent (this);
ep->setParentWindow(this); ep->setParentWindow (this);
// construct closeable tab for the image // construct closeable tab for the image
Gtk::Grid* titleGrid = Gtk::manage (new Gtk::Grid ()); Gtk::Grid* titleGrid = Gtk::manage (new Gtk::Grid ());
titleGrid->set_tooltip_markup (name); titleGrid->set_tooltip_markup (name);
RTImage *closebimg = Gtk::manage(new RTImage ("gtk-close.png")); RTImage *closebimg = Gtk::manage (new RTImage ("gtk-close.png"));
Gtk::Button* closeb = Gtk::manage (new Gtk::Button ()); Gtk::Button* closeb = Gtk::manage (new Gtk::Button ());
closeb->set_name ("CloseButton"); closeb->set_name ("CloseButton");
closeb->add (*closebimg); closeb->add (*closebimg);
closeb->set_relief (Gtk::RELIEF_NONE); closeb->set_relief (Gtk::RELIEF_NONE);
closeb->set_focus_on_click (false); closeb->set_focus_on_click (false);
closeb->signal_clicked().connect( sigc::bind (sigc::mem_fun(*this, &RTWindow::remEditorPanel) , ep)); closeb->signal_clicked().connect ( sigc::bind (sigc::mem_fun (*this, &RTWindow::remEditorPanel), ep));
titleGrid->attach_next_to(*Gtk::manage (new RTImage ("rtwindow.png")), Gtk::POS_RIGHT, 1, 1); titleGrid->attach_next_to (*Gtk::manage (new RTImage ("rtwindow.png")), Gtk::POS_RIGHT, 1, 1);
titleGrid->attach_next_to(*Gtk::manage (new Gtk::Label (Glib::path_get_basename (name))), Gtk::POS_RIGHT, 1, 1); titleGrid->attach_next_to (*Gtk::manage (new Gtk::Label (Glib::path_get_basename (name))), Gtk::POS_RIGHT, 1, 1);
titleGrid->attach_next_to(*closeb, Gtk::POS_RIGHT, 1, 1); titleGrid->attach_next_to (*closeb, Gtk::POS_RIGHT, 1, 1);
titleGrid->show_all (); titleGrid->show_all ();
//GTK318 //GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20 #if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
titleGrid->set_column_spacing(2); titleGrid->set_column_spacing (2);
#endif #endif
//GTK318 //GTK318
@ -432,11 +437,11 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name)
mainNB->set_current_page (mainNB->page_num (*ep)); mainNB->set_current_page (mainNB->page_num (*ep));
mainNB->set_tab_reorderable (*ep, true); mainNB->set_tab_reorderable (*ep, true);
set_title_decorated(name); set_title_decorated (name);
epanels[ name ] = ep; epanels[ name ] = ep;
filesEdited.insert ( name ); filesEdited.insert ( name );
fpanel->refreshEditedState (filesEdited); fpanel->refreshEditedState (filesEdited);
ep->tbTopPanel_1_visible(false); //hide the toggle Top Panel button ep->tbTopPanel_1_visible (false); //hide the toggle Top Panel button
} }
} }
@ -447,8 +452,8 @@ void RTWindow::remEditorPanel (EditorPanel* ep)
} }
if (options.multiDisplayMode > 0) { if (options.multiDisplayMode > 0) {
EditWindow * wndEdit = EditWindow::getInstance(this); EditWindow * wndEdit = EditWindow::getInstance (this);
wndEdit->remEditorPanel(ep); wndEdit->remEditorPanel (ep);
} else { } else {
bool queueHadFocus = (mainNB->get_current_page() == mainNB->page_num (*bpanel)); bool queueHadFocus = (mainNB->get_current_page() == mainNB->page_num (*bpanel));
epanels.erase (ep->getFileName()); epanels.erase (ep->getFileName());
@ -457,37 +462,37 @@ void RTWindow::remEditorPanel (EditorPanel* ep)
mainNB->remove_page (*ep); mainNB->remove_page (*ep);
if (!isEditorPanel(mainNB->get_current_page())) { if (!isEditorPanel (mainNB->get_current_page())) {
if(!queueHadFocus) { if (!queueHadFocus) {
mainNB->set_current_page (mainNB->page_num (*fpanel)); mainNB->set_current_page (mainNB->page_num (*fpanel));
} }
set_title_decorated(""); set_title_decorated ("");
} else { } else {
EditorPanel* ep = static_cast<EditorPanel*>(mainNB->get_nth_page (mainNB->get_current_page())); EditorPanel* ep = static_cast<EditorPanel*> (mainNB->get_nth_page (mainNB->get_current_page()));
set_title_decorated(ep->getFileName()); set_title_decorated (ep->getFileName());
} }
// TODO: ask what to do: close & apply, close & apply selection, close & revert, cancel // TODO: ask what to do: close & apply, close & apply selection, close & revert, cancel
} }
} }
bool RTWindow::selectEditorPanel(const std::string &name) bool RTWindow::selectEditorPanel (const std::string &name)
{ {
if (options.multiDisplayMode > 0) { if (options.multiDisplayMode > 0) {
EditWindow * wndEdit = EditWindow::getInstance(this); EditWindow * wndEdit = EditWindow::getInstance (this);
if (wndEdit->selectEditorPanel(name)) { if (wndEdit->selectEditorPanel (name)) {
set_title_decorated(name); set_title_decorated (name);
wndEdit->toFront(); wndEdit->toFront();
return true; return true;
} }
} else { } else {
std::map<Glib::ustring, EditorPanel*>::iterator iep = epanels.find(name); std::map<Glib::ustring, EditorPanel*>::iterator iep = epanels.find (name);
if (iep != epanels.end()) { if (iep != epanels.end()) {
mainNB->set_current_page (mainNB->page_num (*iep->second)); mainNB->set_current_page (mainNB->page_num (*iep->second));
set_title_decorated(name); set_title_decorated (name);
return true; return true;
} else { } else {
//set_title_decorated(name); //set_title_decorated(name);
@ -521,12 +526,12 @@ bool RTWindow::keyPressed (GdkEventKey* event)
#endif #endif
if (try_quit) { if (try_quit) {
if (!on_delete_event(nullptr)) { if (!on_delete_event (nullptr)) {
gtk_main_quit(); gtk_main_quit();
} }
} }
if(event->keyval == GDK_KEY_F11) { if (event->keyval == GDK_KEY_F11) {
toggle_fullscreen(); toggle_fullscreen();
} }
@ -537,40 +542,40 @@ bool RTWindow::keyPressed (GdkEventKey* event)
}; };
if (ctrl) { if (ctrl) {
switch(event->keyval) { switch (event->keyval) {
case GDK_KEY_F2: // file browser panel case GDK_KEY_F2: // file browser panel
mainNB->set_current_page (mainNB->page_num (*fpanel)); mainNB->set_current_page (mainNB->page_num (*fpanel));
return true;
case GDK_KEY_F3: // batch queue panel
mainNB->set_current_page (mainNB->page_num (*bpanel));
return true;
case GDK_KEY_F4: //single tab mode, editor panel
if (isSingleTabMode() && epanel) {
mainNB->set_current_page (mainNB->page_num (*epanel));
}
return true;
case GDK_KEY_w: //multi-tab mode, close editor panel
if (!isSingleTabMode() &&
mainNB->get_current_page() != mainNB->page_num(*fpanel) &&
mainNB->get_current_page() != mainNB->page_num(*bpanel)) {
EditorPanel* ep = static_cast<EditorPanel*>(mainNB->get_nth_page (mainNB->get_current_page()));
remEditorPanel (ep);
return true; return true;
}
case GDK_KEY_F3: // batch queue panel
mainNB->set_current_page (mainNB->page_num (*bpanel));
return true;
case GDK_KEY_F4: //single tab mode, editor panel
if (isSingleTabMode() && epanel) {
mainNB->set_current_page (mainNB->page_num (*epanel));
}
return true;
case GDK_KEY_w: //multi-tab mode, close editor panel
if (!isSingleTabMode() &&
mainNB->get_current_page() != mainNB->page_num (*fpanel) &&
mainNB->get_current_page() != mainNB->page_num (*bpanel)) {
EditorPanel* ep = static_cast<EditorPanel*> (mainNB->get_nth_page (mainNB->get_current_page()));
remEditorPanel (ep);
return true;
}
} }
} }
if (mainNB->get_current_page() == mainNB->page_num(*fpanel)) { if (mainNB->get_current_page() == mainNB->page_num (*fpanel)) {
return fpanel->handleShortcutKey (event); return fpanel->handleShortcutKey (event);
} else if (mainNB->get_current_page() == mainNB->page_num(*bpanel)) { } else if (mainNB->get_current_page() == mainNB->page_num (*bpanel)) {
return bpanel->handleShortcutKey (event); return bpanel->handleShortcutKey (event);
} else { } else {
EditorPanel* ep = static_cast<EditorPanel*>(mainNB->get_nth_page (mainNB->get_current_page())); EditorPanel* ep = static_cast<EditorPanel*> (mainNB->get_nth_page (mainNB->get_current_page()));
return ep->handleShortcutKey (event); return ep->handleShortcutKey (event);
} }
@ -581,7 +586,7 @@ void RTWindow::addBatchQueueJob (BatchQueueEntry* bqe, bool head)
{ {
std::vector<BatchQueueEntry*> entries; std::vector<BatchQueueEntry*> entries;
entries.push_back(bqe); entries.push_back (bqe);
bpanel->addBatchQueueJobs (entries, head); bpanel->addBatchQueueJobs (entries, head);
fpanel->queue_draw (); fpanel->queue_draw ();
} }
@ -593,7 +598,7 @@ void RTWindow::addBatchQueueJobs (std::vector<BatchQueueEntry*> &entries)
fpanel->queue_draw (); fpanel->queue_draw ();
} }
bool RTWindow::on_delete_event(GdkEventAny* event) bool RTWindow::on_delete_event (GdkEventAny* event)
{ {
if (on_delete_has_run) { if (on_delete_has_run) {
@ -608,14 +613,14 @@ bool RTWindow::on_delete_event(GdkEventAny* event)
if (isSingleTabMode() || simpleEditor) { if (isSingleTabMode() || simpleEditor) {
isProcessing = epanel->getIsProcessing(); isProcessing = epanel->getIsProcessing();
} else if (options.multiDisplayMode > 0) { } else if (options.multiDisplayMode > 0) {
editWindow = EditWindow::getInstance(this, false); editWindow = EditWindow::getInstance (this, false);
isProcessing = editWindow->isProcessing(); isProcessing = editWindow->isProcessing();
} else { } else {
int pageCount = mainNB->get_n_pages(); int pageCount = mainNB->get_n_pages();
for (int i = 0; i < pageCount && !isProcessing; i++) { for (int i = 0; i < pageCount && !isProcessing; i++) {
if(isEditorPanel(i)) { if (isEditorPanel (i)) {
isProcessing |= (static_cast<EditorPanel*>(mainNB->get_nth_page(i)))->getIsProcessing(); isProcessing |= (static_cast<EditorPanel*> (mainNB->get_nth_page (i)))->getIsProcessing();
} }
} }
} }
@ -624,11 +629,11 @@ bool RTWindow::on_delete_event(GdkEventAny* event)
return true; return true;
} }
if( fpanel ) { if ( fpanel ) {
fpanel->saveOptions (); fpanel->saveOptions ();
} }
if( bpanel ) { if ( bpanel ) {
bpanel->saveOptions (); bpanel->saveOptions ();
} }
@ -644,7 +649,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event)
// Look at the active panel first, if any, otherwise look at the first one (sorted on the filename) // Look at the active panel first, if any, otherwise look at the first one (sorted on the filename)
int page = mainNB->get_current_page(); int page = mainNB->get_current_page();
Gtk::Widget *w = mainNB->get_nth_page(page); Gtk::Widget *w = mainNB->get_nth_page (page);
bool optionsWritten = false; bool optionsWritten = false;
for (std::map<Glib::ustring, EditorPanel*>::iterator i = epanels.begin(); i != epanels.end(); ++i) { for (std::map<Glib::ustring, EditorPanel*>::iterator i = epanels.begin(); i != epanels.end(); ++i) {
@ -667,18 +672,19 @@ bool RTWindow::on_delete_event(GdkEventAny* event)
ProfilePanel::cleanup(); ProfilePanel::cleanup();
if (!options.windowMaximized) { if (!options.windowMaximized) {
get_size(options.windowWidth, options.windowHeight); get_size (options.windowWidth, options.windowHeight);
get_position (options.windowX, options.windowY); get_position (options.windowX, options.windowY);
} }
options.windowMonitor = get_screen()->get_monitor_at_window(get_window()); options.windowMonitor = get_screen()->get_monitor_at_window (get_window());
try { try {
Options::save (); Options::save ();
} catch (Options::Error &e) { } catch (Options::Error &e) {
Gtk::MessageDialog msgd(getToplevelWindow(this), e.get_msg(), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true); Gtk::MessageDialog msgd (getToplevelWindow (this), e.get_msg(), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true);
msgd.run(); msgd.run();
} }
hide(); hide();
on_delete_has_run = true; on_delete_has_run = true;
@ -692,11 +698,13 @@ void RTWindow::showPreferences ()
delete pref; delete pref;
fpanel->optionsChanged (); fpanel->optionsChanged ();
if (epanel) { if (epanel) {
epanel->defaultMonitorProfileChanged(options.rtSettings.monitorProfile, options.rtSettings.autoMonitorProfile); epanel->defaultMonitorProfileChanged (options.rtSettings.monitorProfile, options.rtSettings.autoMonitorProfile);
} }
for (const auto &p : epanels) { for (const auto &p : epanels) {
p.second->defaultMonitorProfileChanged(options.rtSettings.monitorProfile, options.rtSettings.autoMonitorProfile); p.second->defaultMonitorProfileChanged (options.rtSettings.monitorProfile, options.rtSettings.autoMonitorProfile);
} }
} }
@ -729,7 +737,7 @@ void RTWindow::toggle_fullscreen ()
if (btn_fullscreen) { if (btn_fullscreen) {
//btn_fullscreen->set_label(M("MAIN_BUTTON_FULLSCREEN")); //btn_fullscreen->set_label(M("MAIN_BUTTON_FULLSCREEN"));
btn_fullscreen->set_tooltip_markup(M("MAIN_BUTTON_FULLSCREEN")); btn_fullscreen->set_tooltip_markup (M ("MAIN_BUTTON_FULLSCREEN"));
btn_fullscreen->set_image (*iFullscreen); btn_fullscreen->set_image (*iFullscreen);
} }
} else { } else {
@ -738,7 +746,7 @@ void RTWindow::toggle_fullscreen ()
if (btn_fullscreen) { if (btn_fullscreen) {
//btn_fullscreen->set_label(M("MAIN_BUTTON_UNFULLSCREEN")); //btn_fullscreen->set_label(M("MAIN_BUTTON_UNFULLSCREEN"));
btn_fullscreen->set_tooltip_markup(M("MAIN_BUTTON_UNFULLSCREEN")); btn_fullscreen->set_tooltip_markup (M ("MAIN_BUTTON_UNFULLSCREEN"));
btn_fullscreen->set_image (*iFullscreen_exit); btn_fullscreen->set_image (*iFullscreen_exit);
} }
} }
@ -761,50 +769,51 @@ void RTWindow::SetMainCurrent()
void RTWindow::MoveFileBrowserToMain() void RTWindow::MoveFileBrowserToMain()
{ {
if( fpanel->ribbonPane->get_children().empty()) { if ( fpanel->ribbonPane->get_children().empty()) {
FileCatalog *fCatalog = fpanel->fileCatalog; FileCatalog *fCatalog = fpanel->fileCatalog;
epanel->catalogPane->remove(*fCatalog); epanel->catalogPane->remove (*fCatalog);
fpanel->ribbonPane->add(*fCatalog); fpanel->ribbonPane->add (*fCatalog);
fCatalog->enableTabMode(false); fCatalog->enableTabMode (false);
fCatalog->tbLeftPanel_1_visible(true); fCatalog->tbLeftPanel_1_visible (true);
fCatalog->tbRightPanel_1_visible(true); fCatalog->tbRightPanel_1_visible (true);
} }
} }
void RTWindow::MoveFileBrowserToEditor() void RTWindow::MoveFileBrowserToEditor()
{ {
if(epanel->catalogPane->get_children().empty() ) { if (epanel->catalogPane->get_children().empty() ) {
FileCatalog *fCatalog = fpanel->fileCatalog; FileCatalog *fCatalog = fpanel->fileCatalog;
fpanel->ribbonPane->remove(*fCatalog); fpanel->ribbonPane->remove (*fCatalog);
fCatalog->disableInspector(); fCatalog->disableInspector();
epanel->catalogPane->add(*fCatalog); epanel->catalogPane->add (*fCatalog);
epanel->showTopPanel(options.editorFilmStripOpened); epanel->showTopPanel (options.editorFilmStripOpened);
fCatalog->enableTabMode(true); fCatalog->enableTabMode (true);
fCatalog->refreshHeight(); fCatalog->refreshHeight();
fCatalog->tbLeftPanel_1_visible(false); fCatalog->tbLeftPanel_1_visible (false);
fCatalog->tbRightPanel_1_visible(false); fCatalog->tbRightPanel_1_visible (false);
} }
} }
void RTWindow::updateProfiles(const Glib::ustring &printerProfile, rtengine::RenderingIntent printerIntent, bool printerBPC) void RTWindow::updateProfiles (const Glib::ustring &printerProfile, rtengine::RenderingIntent printerIntent, bool printerBPC)
{ {
if(epanel) { if (epanel) {
epanel->updateProfiles(printerProfile, printerIntent, printerBPC); epanel->updateProfiles (printerProfile, printerIntent, printerBPC);
} }
for(auto panel : epanels) { for (auto panel : epanels) {
panel.second->updateProfiles(printerProfile, printerIntent, printerBPC); panel.second->updateProfiles (printerProfile, printerIntent, printerBPC);
} }
} }
void RTWindow::updateTPVScrollbar (bool hide) void RTWindow::updateTPVScrollbar (bool hide)
{ {
fpanel->updateTPVScrollbar (hide); fpanel->updateTPVScrollbar (hide);
if(epanel) {
if (epanel) {
epanel->updateTPVScrollbar (hide); epanel->updateTPVScrollbar (hide);
} }
for(auto panel : epanels) { for (auto panel : epanels) {
panel.second->updateTPVScrollbar (hide); panel.second->updateTPVScrollbar (hide);
} }
} }
@ -812,11 +821,12 @@ void RTWindow::updateTPVScrollbar (bool hide)
void RTWindow::updateTabsUsesIcons (bool useIcons) void RTWindow::updateTabsUsesIcons (bool useIcons)
{ {
fpanel->updateTabsUsesIcons (useIcons); fpanel->updateTabsUsesIcons (useIcons);
if(epanel) {
if (epanel) {
epanel->updateTabsUsesIcons (useIcons); epanel->updateTabsUsesIcons (useIcons);
} }
for(auto panel : epanels) { for (auto panel : epanels) {
panel.second->updateTabsUsesIcons (useIcons); panel.second->updateTabsUsesIcons (useIcons);
} }
} }
@ -833,22 +843,23 @@ void RTWindow::updateFBToolBarVisibility (bool showFilmStripToolBar)
void RTWindow::updateHistogramPosition (int oldPosition, int newPosition) void RTWindow::updateHistogramPosition (int oldPosition, int newPosition)
{ {
if(epanel) { if (epanel) {
epanel->updateHistogramPosition (oldPosition, newPosition); epanel->updateHistogramPosition (oldPosition, newPosition);
} }
for(auto panel : epanels) {
for (auto panel : epanels) {
panel.second->updateHistogramPosition (oldPosition, newPosition); panel.second->updateHistogramPosition (oldPosition, newPosition);
} }
} }
bool RTWindow::splashClosed(GdkEventAny* event) bool RTWindow::splashClosed (GdkEventAny* event)
{ {
delete splash; delete splash;
splash = nullptr; splash = nullptr;
return true; return true;
} }
void RTWindow::set_title_decorated(Glib::ustring fname) void RTWindow::set_title_decorated (Glib::ustring fname)
{ {
Glib::ustring subtitle; Glib::ustring subtitle;
@ -856,7 +867,7 @@ void RTWindow::set_title_decorated(Glib::ustring fname)
subtitle = " - " + fname; subtitle = " - " + fname;
} }
set_title(versionStr + subtitle); set_title (versionStr + subtitle);
} }
void RTWindow::closeOpenEditors() void RTWindow::closeOpenEditors()
@ -864,36 +875,36 @@ void RTWindow::closeOpenEditors()
std::map<Glib::ustring, EditorPanel*>::const_iterator itr; std::map<Glib::ustring, EditorPanel*>::const_iterator itr;
itr = epanels.begin(); itr = epanels.begin();
while(itr != epanels.end()) { while (itr != epanels.end()) {
remEditorPanel((*itr).second); remEditorPanel ((*itr).second);
itr = epanels.begin(); itr = epanels.begin();
} }
} }
bool RTWindow::isEditorPanel(Widget* panel) bool RTWindow::isEditorPanel (Widget* panel)
{ {
return (panel != bpanel) && (panel != fpanel); return (panel != bpanel) && (panel != fpanel);
} }
bool RTWindow::isEditorPanel(guint pageNum) bool RTWindow::isEditorPanel (guint pageNum)
{ {
return isEditorPanel(mainNB->get_nth_page(pageNum)); return isEditorPanel (mainNB->get_nth_page (pageNum));
} }
void RTWindow::setEditorMode(bool tabbedUI) void RTWindow::setEditorMode (bool tabbedUI)
{ {
MoveFileBrowserToMain(); MoveFileBrowserToMain();
closeOpenEditors(); closeOpenEditors();
SetMainCurrent(); SetMainCurrent();
if(tabbedUI) { if (tabbedUI) {
mainNB->remove_page(*epanel); mainNB->remove_page (*epanel);
epanel = nullptr; epanel = nullptr;
set_title_decorated(""); set_title_decorated ("");
} else { } else {
createSetmEditor(); createSetmEditor();
epanel->show_all(); epanel->show_all();
set_title_decorated(""); set_title_decorated ("");
} }
} }
@ -902,25 +913,25 @@ void RTWindow::createSetmEditor()
// Editor panel, single-tab mode only // Editor panel, single-tab mode only
epanel = Gtk::manage ( new EditorPanel (fpanel) ); epanel = Gtk::manage ( new EditorPanel (fpanel) );
epanel->setParent (this); epanel->setParent (this);
epanel->setParentWindow(this); epanel->setParentWindow (this);
// decorate tab // decorate tab
Gtk::Grid* const editorLabelGrid = Gtk::manage (new Gtk::Grid ()); Gtk::Grid* const editorLabelGrid = Gtk::manage (new Gtk::Grid ());
setExpandAlignProperties(editorLabelGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER); setExpandAlignProperties (editorLabelGrid, false, false, Gtk::ALIGN_CENTER, Gtk::ALIGN_CENTER);
Gtk::Label* const el = Gtk::manage (new Gtk::Label( Glib::ustring(" ") + M("MAIN_FRAME_EDITOR") )); Gtk::Label* const el = Gtk::manage (new Gtk::Label ( Glib::ustring (" ") + M ("MAIN_FRAME_EDITOR") ));
const auto pos = options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT; const auto pos = options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT;
if (options.mainNBVertical) { if (options.mainNBVertical) {
el->set_angle(90); el->set_angle (90);
} }
editorLabelGrid->attach_next_to(*Gtk::manage (new RTImage ("rt-logo-small.png")), pos, 1, 1); editorLabelGrid->attach_next_to (*Gtk::manage (new RTImage ("rt-logo-small.png")), pos, 1, 1);
editorLabelGrid->attach_next_to(*el, pos, 1, 1); editorLabelGrid->attach_next_to (*el, pos, 1, 1);
editorLabelGrid->set_tooltip_markup (M("MAIN_FRAME_EDITOR_TOOLTIP")); editorLabelGrid->set_tooltip_markup (M ("MAIN_FRAME_EDITOR_TOOLTIP"));
editorLabelGrid->show_all (); editorLabelGrid->show_all ();
epanel->tbTopPanel_1_visible(true); //show the toggle Top Panel button epanel->tbTopPanel_1_visible (true); //show the toggle Top Panel button
mainNB->append_page (*epanel, *editorLabelGrid); mainNB->append_page (*epanel, *editorLabelGrid);
} }