Changeset 200
- Timestamp:
- Thu Mar 27 11:36:09 2008
- Files:
-
- trunk/commongtk.py (modified) (diff)
- trunk/jbrout.py (modified) (diff)
- trunk/db.py (modified) (diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
trunk/commongtk.py
r197 r200 24 24 glade=os.path.join(os.path.dirname(__file__), 'jbrout.glade') 25 25 window="WinKeyTag" 26 26 26 26 def init(self,title,t,l): 27 27 self.liste = []+l 28 28 self.lblTitre.set_label(title) 29 29 29 29 l=gtk.ListStore( str,str ) 30 30 self.lTags.set_model(l) … … 34 34 self.feed(l,t) 35 35 self.text.set_text(t) 36 36 36 36 cell_renderer = gtk.CellRendererText() 37 37 column = gtk.TreeViewColumn("tags", cell_renderer,text=0) 38 38 self.lTags.append_column(column) 39 39 39 39 cell_renderer = gtk.CellRendererText() 40 40 column = gtk.TreeViewColumn("info", cell_renderer,text=1) # catg 41 41 self.lTags.append_column(column) 42 42 43 self.main_widget.show_all() 43 self.main_widget.show_all() 43 43 self.main_widget.set_focus(self.text) 44 44 self.text.set_position(len(t)) … … 59 59 l=self.lTags.get_model() 60 60 self.feed(l,t) 61 61 61 61 def on_text_key_press_event(self,w,b): 62 62 key= gtk.gdk.keyval_name(b.keyval).lower() … … 68 68 if len(l)==1: 69 69 self.quit(unicode(l[0][0],"utf_8")) 70 70 70 70 def on_lTags_row_activated(self,w,p,tvc): 71 71 l=w.get_model() … … 354 354 # Display everything 355 355 if (len(self.photo_list)>1): 356 self.slider.show() 356 self.slider.show() 356 356 self.text_display.show() 357 357 self.thumb_display.show() … … 374 374 def updateDisplay(self): 375 375 photo_num = self.getValue() 376 self.text_display.set_text("Photo %d/%d: %s" % (photo_num + 1, len(self.photo_list), self.photo_list[photo_num].name)) 377 self.thumb_display.set_from_pixbuf(self.photo_list[photo_num].getThumb()) 376 if photo_num<len(self.photo_list): 377 self.text_display.set_text("Photo %d/%d: %s" % (photo_num + 1, len(self.photo_list), self.photo_list[photo_num].name)) 378 self.thumb_display.set_from_pixbuf(self.photo_list[photo_num].getThumb()) 378 379 379 380 def set_sensitive(self, value): … … 410 411 #b.show() 411 412 #w.hbTags.pack_start(b, expand=False, fill=False, padding=0) 412 413 412 413 w.loop() 413 414 414 -
trunk/jbrout.py
r199 r200 116 116 class JStyle: 117 117 """ static class to handle jbrout colors """ 118 118 118 118 w = gtk.Window() # create a fake window 119 119 w.realize() # realize it ... 120 120 style=w.get_style() # ... to obtain the REAL theme style 121 121 del(w) # it's the only trick i've found 122 122 122 122 # Normal text 123 123 TEXT= colorToString(style.text[gtk.STATE_NORMAL]) 124 124 124 124 # grey text (folder without jpg, category, ...) 125 125 TEXT_LOLIGHT = colorToString(style.fg[gtk.STATE_INSENSITIVE]) 126 126 126 126 # colored text (basket color ...) 127 127 TEXT_HILIGHT = "#FF0000" #colorToString(style.bg[gtk.STATE_PRELIGHT]) 128 128 128 128 # input background 129 129 BACKGROUND = colorToString(style.base[gtk.STATE_NORMAL]) … … 241 241 except: 242 242 info_text="" 243 elif nbSelected>0: 244 info_text = _("%d/%d selected") % (nbSelected,len(self.items) ) 243 245 else: 244 if nbSelected>0: 245 info_text = _("%d/%d selected") % (nbSelected,len(self.items) ) 246 else: 247 info_text = "" 246 info_text = "" 248 247 249 248 try: … … 524 523 self.set_value(it,1,len(node.getPhotos())) 525 524 self.set_value(it,2,node) 526 525 526 525 color = len(node.getPhotos())>0 and JStyle.TEXT or JStyle.TEXT_LOLIGHT 527 526 self.set_value(it,3,color) … … 531 530 """ append the 'node' to the iter """ 532 531 color = len(node.getPhotos())>0 and JStyle.TEXT or JStyle.TEXT_LOLIGHT 533 532 533 532 return self.append(it,[node.name,len(node.getPhotos()),node,color]) 534 533 … … 996 995 self.main_widget.set_default_size(w,h) 997 996 self.main_widget.reshow_with_initial_size() 998 997 998 997 self.hpaned1.set_position( JBrout.conf["hpaned"] or 160 ) 999 998 self.frameFilter.hide() … … 1034 1033 # live change 1035 1034 self.tbl.init(self.tbl.items,JBrout.conf["orderAscending"]) 1036 1035 1036 1035 def on_affichage_select(self,widget,idx): 1037 1036 self.tbl.select=idx - 1 … … 1623 1622 def on_selecteur_menu_select_plugin(self,ib,listview,callback): 1624 1623 l = listview.getSelected() 1625 self.showProgress(True) 1626 try: 1627 #~ self.tbl.stop() 1628 ret=callback(l) 1629 #~ self.tbl.start() 1630 finally: 1631 self.showProgress() 1632 if ret: 1633 # perhaps a file was redated and renamed 1634 1635 # let's suppress thumbnails in cache 1636 for i in l: 1637 Buffer.remove(i.file) 1624 if l: 1625 self.showProgress(True) 1626 try: 1627 #~ self.tbl.stop() 1628 ret=callback(l) 1629 #~ self.tbl.start() 1630 finally: 1631 self.showProgress() 1632 if ret: 1633 # perhaps a file was redated and renamed 1638 1634 1639 self.treeviewdb.get_model().activeBasket() 1640 listview.refresh() 1641 listview.refresh() # on win, the first call do nothing 1635 # let's suppress thumbnails in cache 1636 for i in l: 1637 Buffer.remove(i.file) 1638 1639 self.treeviewdb.get_model().activeBasket() 1640 listview.refresh() 1641 listview.refresh() # on win, the first call do nothing 1642 1642 1643 1643 def on_selecteur_menu_select_external_tool(self,ib,listview,et): -
trunk/db.py
r187 r200 83 83 def setNormalizeName(self,v): 84 84 DBPhotos.normalizeName = v 85 85 85 85 def setNormalizeNameFormat(self,v): 86 86 PhotoCmd.setNormalizeNameFormat(v) … … 257 257 258 258 def getBasket(self,nodeFrom=None): 259 if nodeFrom: 259 if nodeFrom is not None: 259 259 return [PhotoNode(i) for i in nodeFrom.xpath("//photo[@basket='1']")] 260 260 else: … … 1280 1280 #====================================================================== 1281 1281 jbroutHomePath = JBrout.getHomeDir("jbrout") 1282 1282 1282 1282 JBrout.plugins = JPlugins(jbroutHomePath) 1283 1283
