diff --git a/README b/README index 34981e2..1b6030e 100644 --- a/README +++ b/README @@ -21,7 +21,6 @@ pyGTKtalog is written in python with following dependencies: - pygtk - pysqlite2 (unnecessary, if python 2.5 is used) -# - mx.DateTime Optional modules: @@ -57,6 +56,11 @@ For version 1.0 following aims have to be done: - searching database - tagging files +- filetypes handling + - movies + - images + - archives + - documents - file details: - files properties x thumbnail diff --git a/pygtktalog.py b/pygtktalog.py index fdbe9bf..de08161 100644 --- a/pygtktalog.py +++ b/pygtktalog.py @@ -68,11 +68,6 @@ def check_requirements(): except: print "pyGTKtalog uses SQLite DB.\nYou'll need to get it and the python bindings as well.\nhttp://www.sqlite.org\nhttp://initd.org/tracker/pysqlite" sys.exit(1) - #try: - # import mx.DateTime - #except: - # print "pyGTKtalog uses Egenix mx.DateTime.\nYou can instal it from your distribution repositry,\nor get it at: http://www.egenix.com" - # sys.exit(1) if conf.confd['exportxls']: try: @@ -93,7 +88,7 @@ def get_parameters(): """Determine application command line options, return db full pathname""" import sys, os # if we've got two arguments, shell script passed through command line - # options: current path and probably filename of compressed db + # options: current path and probably filename of compressed collection if len(sys.argv) > 2: return os.path.join(sys.argv[1],sys.argv[2]) return False diff --git a/resources/glade/main.glade b/resources/glade/main.glade index dc0704e..274fec3 100644 --- a/resources/glade/main.glade +++ b/resources/glade/main.glade @@ -430,68 +430,79 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - False - True - - - - - - - - - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_POLICY_AUTOMATIC GTK_POLICY_AUTOMATIC - + True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True + False True + + + + + True + True + - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Keywords + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + GTK_WRAP_WORD + False + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Keywords + + + label_item + + - label_item + False + False - - False - False - 1 - - False + True True @@ -589,11 +600,8 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 False - GTK_WRAP_CHAR - 3 - 3 + GTK_WRAP_WORD False diff --git a/src/ctrls/c_main.py b/src/ctrls/c_main.py index 6a837eb..3756362 100644 --- a/src/ctrls/c_main.py +++ b/src/ctrls/c_main.py @@ -669,4 +669,30 @@ class MainController(Controller): else: self.view['thumb'].hide() return + + def __tag_cloud(self): + """generate tag cloud""" + # TODO: checkit! + def tag_cloud_click(tag, textview, event, iter, e): + """react on click on connected tag items""" + if event.type == gtk.gdk.BUTTON_RELEASE: + print tag.get_property('name') + + def insert_blank(b, iter): + if b.is_end() and b.is_start(): + iter = b.get_end_iter() + else: + b.insert(iter, " ") + iter = b.get_end_iter() + return iter + + if len(self.model.tag_cloud) > 0: + buff = self.view['keyword_textview'].get_buffer() + for cloud in self.model.tag_cloud: + iter = insert_blank(buff, buff.get_end_iter()) + tag = buff.create_tag(cloud['id']) + tag.set_property('size-points', cloud['size']) + tag.connect('event', foo, tag) + buff.insert_with_tags(iter, cloud['name'], tag) + self.view['keyword_textview'].set_buffer(buff) pass # end of class diff --git a/src/models/m_main.py b/src/models/m_main.py index a897cce..5876b80 100644 --- a/src/models/m_main.py +++ b/src/models/m_main.py @@ -259,10 +259,7 @@ class MainModel(ModelMT): gobject.TYPE_UINT64, gobject.TYPE_STRING, gobject.TYPE_INT, gobject.TYPE_STRING, str) - # Tag list: id, name, count - self.tags_list = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING, - gobject.TYPE_UINT64, str) - + self.tag_cloud = [] return def cleanup(self): @@ -475,15 +472,8 @@ class MainModel(ModelMT): # private class functions def __clear_trees(self): - self.__clear_tags_tree() self.__clear_files_tree() self.__clear_discs_tree() - - def __clear_tags_tree(self): - try: - self.tags_list.clear() - except: - pass def __clear_discs_tree(self): try: