Add improved copy/paste or save/load for Locallab spots

Preliminary work: "nbspot" and "id" spot parameters have been removed to
simplify Locallab spots management.
This commit is contained in:
Pandagrapher
2020-02-20 20:35:29 +01:00
parent f51f2f44ec
commit 209eccba8a
17 changed files with 499 additions and 564 deletions

View File

@@ -24,7 +24,81 @@
struct ParamsEdited;
class PartialPasteDlg : public Gtk::Dialog
/* ==== PartialSpotWidgetListener ==== */
class PartialSpotWidget;
class PartialSpotWidgetListener
{
public:
enum UpdateStatus {
AllSelection = 1,
NoSelection = 2,
PartialSelection = 3
};
public:
PartialSpotWidgetListener() {};
virtual ~PartialSpotWidgetListener() {};
virtual void partialSpotUpdated(const UpdateStatus status) = 0;
};
/* ==== PartialSpotWidget ==== */
class PartialSpotWidget:
public Gtk::VBox
{
private:
// Tree model to manage spot selection widget
class SpotRow:
public Gtk::TreeModel::ColumnRecord
{
public:
Gtk::TreeModelColumn<bool> keep;
Gtk::TreeModelColumn<Glib::ustring> spotname;
SpotRow()
{
add(keep);
add(spotname);
}
};
// Spot selection widgets
Gtk::TreeView* const treeview;
sigc::connection treeviewconn;
SpotRow spotRow;
Glib::RefPtr<Gtk::ListStore> treemodel;
// Spot selection listener
PartialSpotWidgetListener* selListener;
public:
PartialSpotWidget();
// Setter for spot selection listener
void setPartialSpotWidgetListener(PartialSpotWidgetListener* pswl)
{
selListener = pswl;
}
// Spot selection widget management functions
void updateSpotWidget(const rtengine::procparams::ProcParams* pp, const bool defValue);
void enableAll();
void disableAll();
std::vector<bool> getSelectionStatus();
private:
// GUI aspect management functions
void render_keep(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
void render_spotname(Gtk::CellRenderer* cell, const Gtk::TreeModel::iterator& iter);
// Event management function
void keepToggled(const Glib::ustring &path);
};
/* ==== PartialPasteDlg ==== */
class PartialPasteDlg:
public Gtk::Dialog,
public PartialSpotWidgetListener
{
public:
@@ -102,6 +176,8 @@ public:
Gtk::CheckButton* exifch;
Gtk::CheckButton* iptc;
// options in locallab:
PartialSpotWidget* spots;
// options in raw:
Gtk::CheckButton* raw_expos;
@@ -160,6 +236,9 @@ public:
void rawToggled ();
void advancedToggled ();
void locallabToggled ();
void updateSpotWidget(const rtengine::procparams::ProcParams* pp);
void partialSpotUpdated(const UpdateStatus status);
};
#endif