~teejee2008/timeshift/trunk

« back to all changes in this revision

Viewing changes to src/Core/SnapshotRepo.vala

  • Committer: Tony George
  • Date: 2016-10-29 11:17:41 UTC
  • Revision ID: tony.george.kol@gmail.com-20161029111741-u2kir9dawb1pz176
Moved console and Gtk code to separate utilities: timeshift and timeshift-gtk

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
                snapshots = new Gee.ArrayList<Snapshot>();
38
38
                invalid_snapshots = new Gee.ArrayList<Snapshot>();
39
39
 
40
 
                log_msg(_("Selected snapshot path") + ": %s".printf(path));
 
40
                log_debug(_("Selected snapshot path") + ": %s".printf(path));
41
41
                
42
42
                var list = Device.get_disk_space_using_df(path);
43
43
                if (list.size > 0){
44
44
                        device = list[0];
45
45
                        
46
 
                        log_msg(_("Device") + ": %s".printf(device.device));
47
 
                        log_msg(_("Free space") + ": %s".printf(format_file_size(device.free_bytes)));
 
46
                        log_debug(_("Device") + ": %s".printf(device.device));
 
47
                        log_debug(_("Free space") + ": %s".printf(format_file_size(device.free_bytes)));
48
48
                }
49
49
                
50
50
                check_status();
104
104
                log_debug("SnapshotRepo: init_from_device()");
105
105
                
106
106
                if ((device != null) && (device.uuid.length > 0)){
107
 
                        log_msg("");
 
107
                        log_debug("");
108
108
                        unlock_and_mount_device();
109
109
 
110
110
                        if ((device != null) && (device.device.length > 0)){
111
 
                                log_msg(_("Selected snapshot device") + ": %s".printf(device.device));
112
 
                                log_msg(_("Free space") + ": %s".printf(format_file_size(device.free_bytes)));
 
111
                                log_debug(_("Selected snapshot device") + ": %s".printf(device.device));
 
112
                                log_debug(_("Free space") + ": %s".printf(format_file_size(device.free_bytes)));
113
113
                        }
114
114
                }
115
115
 
215
215
                // check if already unlocked
216
216
                foreach(var part in partitions){
217
217
                        if (part.pkname == luks_device.kname){
218
 
                                log_msg(_("Unlocked device is mapped to '%s'").printf(part.device));
219
 
                                log_msg("");
 
218
                                log_debug(_("Unlocked device is mapped to '%s'").printf(part.device));
 
219
                                log_debug("");
220
220
                                return part;
221
221
                        }
222
222
                }
331
331
                status_message = "";
332
332
                status_details = "";
333
333
 
334
 
                log_msg("");
 
334
                //log_msg("");
335
335
                //log_msg("Config: Free space limit is %s".printf(
336
336
                //      format_file_size(Main.MIN_FREE_SPACE)));
337
337
 
342
342
 
343
343
                if ((App != null) && (App.app_mode.length == 0)){
344
344
                        
345
 
                        log_msg("%s: '%s'".printf(
 
345
                        log_debug("%s: '%s'".printf(
346
346
                                _("Snapshot device"),
347
347
                                (device == null) ? " UNKNOWN" : device.device));
348
348
                                
349
 
                        log_msg("%s: %s".printf(
 
349
                        log_debug("%s: %s".printf(
350
350
                                _("Snapshot location"), snapshot_location));
351
351
 
352
 
                        log_msg(status_message);
353
 
                        log_msg(status_details);
 
352
                        log_debug(status_message);
 
353
                        log_debug(status_details);
354
354
                        
355
 
                        log_msg("%s: %s".printf(
 
355
                        log_debug("%s: %s".printf(
356
356
                                _("Status"),
357
357
                                status_code.to_string().replace("SNAPSHOT_LOCATION_STATUS_","")));
358
358
 
359
 
                        log_msg("");
 
359
                        log_debug("");
360
360
                }
361
361
 
362
362
                log_debug("SnapshotRepo: check_status(): exit");
517
517
                }
518
518
        }
519
519
 
 
520
        public void print_status(){
 
521
                log_msg("");
 
522
                log_msg("%-6s : %s".printf(_("Device"), (device == null) ? " UNKNOWN" : device.device_name_with_parent));
 
523
                log_msg("%-6s : %s".printf("UUID", (device == null) ? " UNKNOWN" : device.uuid));
 
524
                log_msg("%-6s : %s".printf(_("Path"), snapshot_location));
 
525
                log_msg(status_message);
 
526
                log_msg(status_details);
 
527
                log_msg("");
 
528
        }
 
529
        
520
530
        // actions
521
531
 
522
532
        public void auto_remove(){