+2016-01-08 c.hetherington <cth@carlh.net>
+
+ * Don't expand all cinemas on opening KDM dialogs (#779).
+
2016-01-07 Carl Hetherington <cth@carlh.net>
* Version 2.6.14 released.
/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
using std::string;
using std::make_pair;
using boost::shared_ptr;
+using boost::optional;
ScreensPanel::ScreensPanel (wxWindow* parent)
: wxPanel (parent, wxID_ANY)
add_cinemas ();
- _targets->ExpandAll ();
-
wxBoxSizer* target_buttons = new wxBoxSizer (wxVERTICAL);
_add_cinema = new wxButton (this, wxID_ANY, _("Add Cinema..."));
_targets->SortChildren (_root);
}
-void
+optional<wxTreeItemId>
ScreensPanel::add_screen (shared_ptr<Cinema> c, shared_ptr<Screen> s)
{
CinemaMap::const_iterator i = _cinemas.begin();
}
if (i == _cinemas.end()) {
- return;
+ return optional<wxTreeItemId> ();
}
_screens[_targets->AppendItem (i->first, std_to_wx (s->name))] = s;
- _targets->Expand (i->first);
+ return i->first;
}
void
shared_ptr<Screen> s (new Screen (d->name(), d->recipient(), d->trusted_devices()));
c->add_screen (s);
- add_screen (c, s);
+ optional<wxTreeItemId> id = add_screen (c, s);
+ if (id) {
+ _targets->Expand (id.get ());
+ }
Config::instance()->changed ();
/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
private:
void add_cinemas ();
void add_cinema (boost::shared_ptr<Cinema>);
- void add_screen (boost::shared_ptr<Cinema>, boost::shared_ptr<Screen>);
+ boost::optional<wxTreeItemId> add_screen (boost::shared_ptr<Cinema>, boost::shared_ptr<Screen>);
void add_cinema_clicked ();
void edit_cinema_clicked ();
void remove_cinema_clicked ();