summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wx/content_panel.cc10
-rw-r--r--src/wx/content_panel.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 41a18f4b4..a860b0079 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -89,6 +89,7 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmV
, _film_viewer (viewer)
, _generally_sensitive (true)
, _ignore_deselect (false)
+ , _no_check_selection (false)
{
for (int i = 0; i < TEXT_COUNT; ++i) {
_text_panel[i] = 0;
@@ -303,6 +304,10 @@ ContentPanel::check_selection ()
return;
}
+ if (_no_check_selection) {
+ return;
+ }
+
_last_selected = selected ();
setup_sensitivity ();
@@ -662,6 +667,8 @@ ContentPanel::set_selection (weak_ptr<Content> wc)
void
ContentPanel::set_selection (ContentList cl)
{
+ _no_check_selection = true;
+
ContentList content = _film->content ();
for (size_t i = 0; i < content.size(); ++i) {
if (find(cl.begin(), cl.end(), content[i]) != cl.end()) {
@@ -670,6 +677,9 @@ ContentPanel::set_selection (ContentList cl)
_content->SetItemState (i, 0, wxLIST_STATE_SELECTED);
}
}
+
+ _no_check_selection = false;
+ check_selection ();
}
void
diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h
index 8277b7c42..761b34a24 100644
--- a/src/wx/content_panel.h
+++ b/src/wx/content_panel.h
@@ -124,4 +124,5 @@ private:
boost::weak_ptr<FilmViewer> _film_viewer;
bool _generally_sensitive;
bool _ignore_deselect;
+ bool _no_check_selection;
};