carp: Check-in [175db05de6]

A python graphical and terminal EncFS front-end

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Do not activate activity submenu if there is nothing to show
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:175db05de6e1bb96de1605b82d393152867344637ddab050db375df8827bc292
User & Date: milouse 2017-09-06 19:42:34
Context
2017-09-06
19:42
Better rsync quiet management check-in: 0d3f0e2062 user: milouse tags: trunk
19:42
Do not activate activity submenu if there is nothing to show check-in: 175db05de6 user: milouse tags: trunk
19:42
Fix broken activity.log file due to early translation check-in: f41596c5b0 user: milouse tags: trunk
Changes

Changes to carp/carpgui.py.

87
88
89
90
91
92
93



94
95
96
97
98
99
100
...
121
122
123
124
125
126
127

128
129


130
131
132

133
134
135
136
137
138
139
            if match is None:
                continue
            new_line = "{}{}".format(match[2], match[3])
            if new_line == last_line:
                continue
            last_line = new_line
            modified_files.append((match[1], match[2], match[3]))




        modified_files = modified_files[-10:]
        lfmenu = Gtk.Menu()
        for line in modified_files:
            istatus = CARP_POSSIBLE_INOTIFY_STATUS[line[2]]
            lb = Gtk.MenuItem.new_with_label(
                _("{0} ({1} at {2})").format(line[1], istatus, line[0]))
................................................................................
            mount_label = _("Mount {0}").format(stash_name)
            mount_action = "mount"
        else:
            config_dir = os.path.join(xdg_config_home, ".carp", stash_name)
            log_file = os.path.join(config_dir, "activity.log")

            lfmb = Gtk.MenuItem.new_with_label(_("Last changes"))

            if os.path.exists(log_file):
                lfmenu = self.build_activity_submenu(log_file)


                lfmb.set_submenu(lfmenu)
            else:
                lfmb.set_sensitive(False)

            mm.append(lfmb)

        mi_button = Gtk.MenuItem.new_with_label(mount_label)
        mi_button.connect("activate", self.encfs_action,
                          mount_action, stash_name)
        mm.append(mi_button)








>
>
>







 







>


>
>
|
<
<
>







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
124
125
126
127
128
129
130
131
132
133
134
135
136


137
138
139
140
141
142
143
144
            if match is None:
                continue
            new_line = "{}{}".format(match[2], match[3])
            if new_line == last_line:
                continue
            last_line = new_line
            modified_files.append((match[1], match[2], match[3]))

        if len(modified_files) == 0:
            return None

        modified_files = modified_files[-10:]
        lfmenu = Gtk.Menu()
        for line in modified_files:
            istatus = CARP_POSSIBLE_INOTIFY_STATUS[line[2]]
            lb = Gtk.MenuItem.new_with_label(
                _("{0} ({1} at {2})").format(line[1], istatus, line[0]))
................................................................................
            mount_label = _("Mount {0}").format(stash_name)
            mount_action = "mount"
        else:
            config_dir = os.path.join(xdg_config_home, ".carp", stash_name)
            log_file = os.path.join(config_dir, "activity.log")

            lfmb = Gtk.MenuItem.new_with_label(_("Last changes"))
            lfmb.set_sensitive(False)
            if os.path.exists(log_file):
                lfmenu = self.build_activity_submenu(log_file)
                if lfmenu is not None:
                    lfmb.set_sensitive(True)
                    lfmb.set_submenu(lfmenu)



            mm.append(lfmb)

        mi_button = Gtk.MenuItem.new_with_label(mount_label)
        mi_button.connect("activate", self.encfs_action,
                          mount_action, stash_name)
        mm.append(mi_button)