~teejee2008/timeshift/trunk

« back to all changes in this revision

Viewing changes to src/Main.vala

  • Committer: Tony George
  • Date: 2016-10-03 13:47:09 UTC
  • Revision ID: tony.george.kol@gmail.com-20161003134709-9iz9fm0b22585r1w
AppExclude: Save changes when moving to next page during restore;

Show diffs side-by-side

added added

removed removed

Lines of Context:
742
742
                string list_file = path_combine(output_path, "exclude-restore.list");
743
743
                return file_write(list_file, txt);
744
744
        }
745
 
        
 
745
 
 
746
        public void save_exclude_list_selections(){
 
747
                
 
748
                // add new selected items
 
749
                foreach(var entry in App.exclude_list_apps){
 
750
                        if (entry.enabled && !App.exclude_app_names.contains(entry.name)){
 
751
                                App.exclude_app_names.add(entry.name);
 
752
                                log_debug("add app name: %s".printf(entry.name));
 
753
                        }
 
754
                }
 
755
 
 
756
                // remove item only if present in current list and un-selected
 
757
                foreach(var entry in App.exclude_list_apps){
 
758
                        if (!entry.enabled && App.exclude_app_names.contains(entry.name)){
 
759
                                App.exclude_app_names.remove(entry.name);
 
760
                                log_debug("remove app name: %s".printf(entry.name));
 
761
                        }
 
762
                }
 
763
 
 
764
                App.exclude_app_names.sort((a,b) => {
 
765
                        return Posix.strcmp(a,b);
 
766
                });
 
767
        }
746
768
        //console functions
747
769
 
748
770
        public static string help_message (){