Some changes to addsetid code in preferences
This commit is contained in:
parent
3f2e580bd7
commit
31af0935d8
@ -420,22 +420,21 @@ void Preferences::appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustri
|
|||||||
ci->set_value (behavColumns.addsetid, id);
|
ci->set_value (behavColumns.addsetid, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preferences::behAddSetRadioToggled (const Glib::ustring& path, bool add)
|
||||||
|
{
|
||||||
|
Gtk::TreeModel::iterator iter = behModel->get_iter (path);
|
||||||
|
iter->set_value(behavColumns.badd, add);
|
||||||
|
iter->set_value(behavColumns.bset, !add);
|
||||||
|
}
|
||||||
|
|
||||||
void Preferences::behAddRadioToggled (const Glib::ustring& path)
|
void Preferences::behAddRadioToggled (const Glib::ustring& path)
|
||||||
{
|
{
|
||||||
|
behAddSetRadioToggled(path, true);
|
||||||
Gtk::TreeModel::iterator iter = behModel->get_iter (path);
|
|
||||||
//bool set = iter->get_value (behavColumns.bset);
|
|
||||||
iter->set_value (behavColumns.bset, false);
|
|
||||||
iter->set_value (behavColumns.badd, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::behSetRadioToggled (const Glib::ustring& path)
|
void Preferences::behSetRadioToggled (const Glib::ustring& path)
|
||||||
{
|
{
|
||||||
|
behAddSetRadioToggled(path, false);
|
||||||
Gtk::TreeModel::iterator iter = behModel->get_iter (path);
|
|
||||||
//bool add = iter->get_value (behavColumns.badd);
|
|
||||||
iter->set_value (behavColumns.bset, true);
|
|
||||||
iter->set_value (behavColumns.badd, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2051,14 +2050,13 @@ void Preferences::fillPreferences ()
|
|||||||
|
|
||||||
moptions.baBehav.resize (ADDSET_PARAM_NUM);
|
moptions.baBehav.resize (ADDSET_PARAM_NUM);
|
||||||
|
|
||||||
for (size_t i = 0; i < moptions.baBehav.size(); i++)
|
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); ++sections) {
|
||||||
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++)
|
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); ++adjs) {
|
||||||
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++)
|
const bool add = moptions.baBehav[adjs->get_value(behavColumns.addsetid)];
|
||||||
if (adjs->get_value (behavColumns.addsetid) == (int)i) {
|
adjs->set_value (behavColumns.badd, add);
|
||||||
adjs->set_value (behavColumns.badd, moptions.baBehav[i] == 1);
|
adjs->set_value (behavColumns.bset, !add);
|
||||||
adjs->set_value (behavColumns.bset, moptions.baBehav[i] != 1);
|
}
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
addc.block (false);
|
addc.block (false);
|
||||||
setc.block (false);
|
setc.block (false);
|
||||||
@ -2563,32 +2561,24 @@ bool Preferences::splashClosed (GdkEventAny* event)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preferences::behAddSetAllPressed (bool add)
|
||||||
|
{
|
||||||
|
moptions.baBehav.clear();
|
||||||
|
moptions.baBehav.resize(ADDSET_PARAM_NUM, add);
|
||||||
|
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); ++sections) {
|
||||||
|
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); ++adjs) {
|
||||||
|
adjs->set_value(behavColumns.badd, add);
|
||||||
|
adjs->set_value(behavColumns.bset, !add);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Preferences::behAddAllPressed ()
|
void Preferences::behAddAllPressed ()
|
||||||
{
|
{
|
||||||
|
behAddSetAllPressed(true);
|
||||||
if (moptions.baBehav.size() == ADDSET_PARAM_NUM) {
|
|
||||||
for (size_t i = 0; i < moptions.baBehav.size(); i++)
|
|
||||||
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++)
|
|
||||||
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++)
|
|
||||||
if (adjs->get_value (behavColumns.addsetid) == (int)i) {
|
|
||||||
adjs->set_value (behavColumns.badd, true);
|
|
||||||
adjs->set_value (behavColumns.bset, false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::behSetAllPressed ()
|
void Preferences::behSetAllPressed ()
|
||||||
{
|
{
|
||||||
|
behAddSetAllPressed(false);
|
||||||
if (moptions.baBehav.size() == ADDSET_PARAM_NUM) {
|
|
||||||
for (size_t i = 0; i < moptions.baBehav.size(); i++)
|
|
||||||
for (Gtk::TreeIter sections = behModel->children().begin(); sections != behModel->children().end(); sections++)
|
|
||||||
for (Gtk::TreeIter adjs = sections->children().begin(); adjs != sections->children().end(); adjs++)
|
|
||||||
if (adjs->get_value (behavColumns.addsetid) == (int)i) {
|
|
||||||
adjs->set_value (behavColumns.badd, false);
|
|
||||||
adjs->set_value (behavColumns.bset, true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -275,8 +275,10 @@ public:
|
|||||||
void clearThumbImagesPressed ();
|
void clearThumbImagesPressed ();
|
||||||
void clearAllPressed ();
|
void clearAllPressed ();
|
||||||
|
|
||||||
|
void behAddSetRadioToggled (const Glib::ustring& path, bool add);
|
||||||
void behAddRadioToggled (const Glib::ustring& path);
|
void behAddRadioToggled (const Glib::ustring& path);
|
||||||
void behSetRadioToggled (const Glib::ustring& path);
|
void behSetRadioToggled (const Glib::ustring& path);
|
||||||
|
void behAddSetAllPressed (bool add);
|
||||||
void behAddAllPressed ();
|
void behAddAllPressed ();
|
||||||
void behSetAllPressed ();
|
void behSetAllPressed ();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user