Hand-apply a2f776bd239ef1a744c1a9fea841ac0a51c4f33b from master; more deflickering.
authorCarl Hetherington <cth@carlh.net>
Wed, 29 Apr 2015 21:14:46 +0000 (22:14 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 29 Apr 2015 21:14:46 +0000 (22:14 +0100)
ChangeLog
TO_PORT
src/wx/content_panel.cc

index 84deaaffe745962c350f1b80f019e31104ba59d2..d9375527ccf8274c296d2dc61d13df273e4f45ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 2015-04-29  c.hetherington  <cth@carlh.net>
 
-       * Hand-apply 291179175729b62e17a9c322cd27ae134d1310d9 and
-       8d92cce7d2885afa13ee4cb6f546dbf43942124b from master;
+       * Hand-apply 291179175729b62e17a9c322cd27ae134d1310d9,
+       8d92cce7d2885afa13ee4cb6f546dbf43942124b and
+       c994839239e84a1f62865ed82fdc090900a66b03 from master;
        stop flickering when dragging in the timeline on OS X.
 
 2015-04-22  c.hetherington  <cth@carlh.net>
diff --git a/TO_PORT b/TO_PORT
index a318eefce06866da38a2681e09e46a3fdc520829..0449d9157ee7709a7baf0ea7f4c4f7e5fe5edabc 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1,4 +1,3 @@
-c994839239e84a1f62865ed82fdc090900a66b03
 1114df4c0d2167f6b7b394bfbf85890cd0a4a3e3
 03bee41ebb15a9ddd61af1607426d22d906ad226
 6cb9a4fd6b8ec1141bffa9294347e80baa3445dd
index aed208ad66da1a4e328a48089fe5ae0d1ad6c92f..33308b1126dc70f6ce698d3ab0a15d07c96c02e0 100644 (file)
@@ -43,6 +43,7 @@
 using std::list;
 using std::string;
 using std::cout;
+using std::vector;
 using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::dynamic_pointer_cast;
@@ -440,6 +441,36 @@ ContentPanel::film_content_changed (int property)
 void
 ContentPanel::setup ()
 {
+       ContentList content = _film->content ();
+       sort (content.begin(), content.end(), ContentSorter ());
+       
+       /* First, check to see if anything has changed and bail if not; this avoids
+          flickering on OS X.
+       */
+
+       vector<string> existing;
+       for (int i = 0; i < _content->GetItemCount(); ++i) {
+               existing.push_back (wx_to_std (_content->GetItemText (i)));
+       }
+
+       vector<string> proposed;
+       for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
+               bool const valid = (*i)->paths_valid ();
+
+               string s = (*i)->summary ();
+               if (!valid) {
+                       s = _("MISSING: ") + s;
+               }
+              
+               proposed.push_back (s);
+       }
+       
+       if (existing == proposed) {
+               return;
+       }
+      
+       /* Something has changed: set up the control */
+       
        string selected_summary;
        int const s = _content->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if (s != -1) {
@@ -448,9 +479,6 @@ ContentPanel::setup ()
        
        _content->DeleteAllItems ();
 
-       ContentList content = _film->content ();
-       sort (content.begin(), content.end(), ContentSorter ());
-
        for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
                int const t = _content->GetItemCount ();
                bool const valid = (*i)->paths_valid ();
@@ -487,8 +515,6 @@ ContentPanel::setup ()
 void
 ContentPanel::files_dropped (wxDropFilesEvent& event)
 {
-       cout << "SHIT!\n";
-       
        if (!_film) {
                return;
        }