Subversion Repositories basico

Rev

Rev 126 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 126 Rev 130
Line 26... Line 26...
26
26
27
27
28
class SAPNoteViewVisor(Gtk.Box):
28
class SAPNoteViewVisor(Gtk.Box):
29
    def __init__(self, app):
29
    def __init__(self, app):
30
        self.app = app
30
        self.app = app
31
        #~ LOG_FILE = self.app.get_file('LOG')
-
 
32
        #~ LOG_NAME = self.__class__.__name__
-
 
33
        #~ self.log = get_logger(LOG_NAME, LOG_FILE)
-
 
-
 
31
        LOG_FILE = self.app.get_file('LOG')
-
 
32
        LOG_NAME = self.__class__.__name__
-
 
33
        self.log = get_logger(LOG_NAME, LOG_FILE)
34
        self.get_services()
34
        self.get_services()
35
        self.toggled = 0
35
        self.toggled = 0
36
        self.selected = set()
36
        self.selected = set()
37
        self.count = 0
37
        self.count = 0
38
        Gtk.Box.__init__(self)
38
        Gtk.Box.__init__(self)
Line 169... Line 169...
169
        return container
169
        return container
170
170
171
171
172
    def get_toggled(self):
172
    def get_toggled(self):
173
        flowbox = self.gui.get_widget('flowbox')
173
        flowbox = self.gui.get_widget('flowbox')
-
 
174
        mnubtnactions = self.gui.get_widget('mnuBtnActions')
174
175
175
        toggled = set()
176
        toggled = set()
176
        def foreach_row(item):
177
        def foreach_row(item):
177
            row = item.get_children()[0]
178
            row = item.get_children()[0]
178
            active = row.get_checkbox_is_active()
179
            active = row.get_checkbox_is_active()
Line 180... Line 181...
180
                sid = row.get_sid()
181
                sid = row.get_sid()
181
                toggled.add(sid)
182
                toggled.add(sid)
182
                #~ self.log.debug("%s -> %s" % (row, active))
183
                #~ self.log.debug("%s -> %s" % (row, active))
183
184
184
        flowbox.foreach(foreach_row)
185
        flowbox.foreach(foreach_row)
-
 
186
185
        lsid = list(toggled)
187
        lsid = list(toggled)
186
        lsid.sort()
-
 
-
 
188
        if len(lsid) > 0:
-
 
189
            lsid.sort()
-
 
190
            mnubtnactions.set_no_show_all(False)
-
 
191
            mnubtnactions.show_all()
-
 
192
        else:
-
 
193
            mnubtnactions.set_no_show_all(True)
-
 
194
            mnubtnactions.hide()
187
195
188
        return lsid
196
        return lsid
189
197
190
198
191
    def get_bag(self):
199
    def get_bag(self):
Line 224... Line 232...
224
        for sid in lbag:
232
        for sid in lbag:
225
            row = SAPNoteViewRow(self.app, sid)
233
            row = SAPNoteViewRow(self.app, sid)
226
            flowbox.add(row)
234
            flowbox.add(row)
227
235
228
        lblcount = self.gui.get_widget("lblSAPNoteViewCount")
236
        lblcount = self.gui.get_widget("lblSAPNoteViewCount")
229
        lblcount.set_markup("<span size=\"30000\">%d</span>" % len(bag))
-
 
-
 
237
        self.log.debug("lblcount: %s (%s)"% (str(lblcount), str(type(lblcount))))
-
 
238
        #~ lblcount.set_markup("<span size=\"30000\">%d</span>" % len(bag))
230
        self.gui.swap_widget(self, flowbox)
239
        self.gui.swap_widget(self, flowbox)
231
240
232
        toggled = self.get_toggled()
-
 
233
        lblSelectedNotes.set_markup('<b><small>%d</small>/%d of <big>%d</big></b>' % (len(toggled), len(bag), self.db.get_total()))
-
 
-
 
241
        #~ toggled = self.get_toggled()
-
 
242
        #~ lblSelectedNotes.set_markup('<b><small>%d</small>/%d of <big>%d</big></b>' % (len(toggled), len(bag), self.db.get_total()))
234
243
235
        self.show_all()
244
        self.show_all()
236
245
237
246
238
247