mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 11:30:19 +01:00
* Code refactoring.
* Small changes in assumptions. * TODO supplement. * Moved minor features into future versions. * Added extensions configuration editor.
This commit is contained in:
36
README
36
README
@@ -56,28 +56,14 @@ For version 1.0 following aims have to be done:
|
|||||||
|
|
||||||
- searching database
|
- searching database
|
||||||
- tagging files
|
- tagging files
|
||||||
- filetypes handling
|
- user definied group of tags (represented by color in cloud tag)
|
||||||
- movies
|
|
||||||
- images
|
|
||||||
- archives
|
|
||||||
- documents
|
|
||||||
- file details:
|
- file details:
|
||||||
- files properties
|
- files properties
|
||||||
x thumbnail
|
x thumbnail
|
||||||
- description
|
- description
|
||||||
- file information (date, size, etc) (50%)
|
- file information (date, size, etc) (50%)
|
||||||
- exif information
|
- exif information
|
||||||
- keywords
|
- keywords (tags)
|
||||||
- anime/movie
|
|
||||||
- title
|
|
||||||
- alt title
|
|
||||||
- type (anime movie, movie, anime oav, anime tv series, tv series, etc)
|
|
||||||
- cover/images
|
|
||||||
- genre
|
|
||||||
- lang
|
|
||||||
- sub lang
|
|
||||||
- release date (from - to)
|
|
||||||
- anidb link/imdb link
|
|
||||||
- adding images (60% done)
|
- adding images (60% done)
|
||||||
x generating/saving thumbnails
|
x generating/saving thumbnails
|
||||||
x moving hardcoded files extensions into config
|
x moving hardcoded files extensions into config
|
||||||
@@ -90,6 +76,24 @@ For version 2.0:
|
|||||||
- internationalization support
|
- internationalization support
|
||||||
- statistics
|
- statistics
|
||||||
|
|
||||||
|
Removed:
|
||||||
|
- filetypes handling (movies, images, archives, documents etc). Now it have
|
||||||
|
common, unified external "plugin" system - simple output from command line
|
||||||
|
programs.
|
||||||
|
- anime/movie
|
||||||
|
- title
|
||||||
|
- alt title
|
||||||
|
- type (anime movie, movie, anime oav, anime tv series, tv series, etc)
|
||||||
|
- cover/images
|
||||||
|
- genre
|
||||||
|
- lang
|
||||||
|
- sub lang
|
||||||
|
- release date (from - to)
|
||||||
|
- anidb link/imdb link
|
||||||
|
Maybe in future versions. Now text file descriptions and tags have to be
|
||||||
|
enough for good and fast information search.
|
||||||
|
|
||||||
|
|
||||||
NOTES
|
NOTES
|
||||||
=====
|
=====
|
||||||
|
|
||||||
|
|||||||
@@ -89,16 +89,57 @@
|
|||||||
<property name="column_spacing">3</property>
|
<property name="column_spacing">3</property>
|
||||||
<property name="row_spacing">3</property>
|
<property name="row_spacing">3</property>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label5">
|
<widget class="GtkLabel" id="label4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Eject program:</property>
|
<property name="label" translatable="yes">Mount point:</property>
|
||||||
<property name="mnemonic_widget">ejt_entry</property>
|
<property name="mnemonic_widget">mnt_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="x_options"></property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkEntry" id="mnt_entry">
|
||||||
|
<property name="width_request">100</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkButton" id="button_mnt">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="label" translatable="yes">Browse...</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="response_id">0</property>
|
||||||
|
<signal name="clicked" handler="on_button_mnt_clicked"/>
|
||||||
|
<signal name="activate" handler="on_button_mnt_activate"/>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="right_attach">3</property>
|
||||||
|
<property name="x_options"></property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkEntry" id="ejt_entry">
|
||||||
|
<property name="width_request">100</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options"></property>
|
|
||||||
<property name="y_options"></property>
|
<property name="y_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
@@ -122,56 +163,15 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="ejt_entry">
|
<widget class="GtkLabel" id="label5">
|
||||||
<property name="width_request">100</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="button_mnt">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="label" translatable="yes">Browse...</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
<signal name="clicked" handler="on_button_mnt_clicked"/>
|
|
||||||
<signal name="activate" handler="on_button_mnt_activate"/>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="x_options"></property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkEntry" id="mnt_entry">
|
|
||||||
<property name="width_request">100</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label4">
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="label" translatable="yes">Mount point:</property>
|
<property name="label" translatable="yes">Eject program:</property>
|
||||||
<property name="mnemonic_widget">mnt_entry</property>
|
<property name="mnemonic_widget">ejt_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options"></property>
|
<property name="x_options"></property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
@@ -532,25 +532,11 @@
|
|||||||
<widget class="GtkVBox" id="ext_ed">
|
<widget class="GtkVBox" id="ext_ed">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="border_width">5</property>
|
<property name="border_width">5</property>
|
||||||
<child>
|
|
||||||
<widget class="GtkComboBox" id="ext_choose">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="items" translatable="yes">Images extensions
|
|
||||||
Movies extesions</property>
|
|
||||||
<signal name="changed" handler="on_ext_choose_changed"/>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="padding">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkTable" id="table3">
|
<widget class="GtkTable" id="table3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="n_rows">1</property>
|
<property name="n_rows">2</property>
|
||||||
<property name="n_columns">2</property>
|
<property name="n_columns">2</property>
|
||||||
<property name="row_spacing">3</property>
|
<property name="row_spacing">3</property>
|
||||||
<child>
|
<child>
|
||||||
@@ -576,10 +562,33 @@ Movies extesions</property>
|
|||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="label6">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
|
<property name="label" translatable="yes">Command:</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkEntry" id="com_entry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -594,7 +603,7 @@ Movies extesions</property>
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="label" translatable="yes">Add</property>
|
<property name="label" translatable="yes">Add/Change</property>
|
||||||
<property name="response_id">0</property>
|
<property name="response_id">0</property>
|
||||||
<signal name="clicked" handler="on_ext_add_clicked"/>
|
<signal name="clicked" handler="on_ext_add_clicked"/>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -616,7 +625,7 @@ Movies extesions</property>
|
|||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="position">2</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -633,11 +642,12 @@ Movies extesions</property>
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="rules_hint">True</property>
|
<property name="rules_hint">True</property>
|
||||||
|
<signal name="cursor_changed" handler="on_extension_tree_cursor_changed"/>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">3</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -661,300 +671,6 @@ Movies extesions</property>
|
|||||||
<property name="position">3</property>
|
<property name="position">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<widget class="GtkVBox" id="commands_group">
|
|
||||||
<property name="border_width">1</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkFrame" id="frame9">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkAlignment" id="alignment9">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="has_focus">True</property>
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="left_padding">12</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkVBox" id="ext_ed3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkTable" id="table6">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="n_rows">1</property>
|
|
||||||
<property name="n_columns">2</property>
|
|
||||||
<property name="row_spacing">3</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label14">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">Command:</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_RIGHT</property>
|
|
||||||
<property name="mnemonic_widget">ext_entry</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="x_options">GTK_FILL</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkEntry" id="ext_entry4">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkHButtonBox" id="hbuttonbox4">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="border_width">3</property>
|
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="ext_add3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">Add</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="ext_del3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">Delete</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkHBox" id="hbox1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkScrolledWindow" id="scrolledwindow6">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
|
||||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
|
||||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkTreeView" id="extension_tree3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="rules_hint">True</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkFrame" id="frame10">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="border_width">3</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkAlignment" id="alignment10">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="left_padding">12</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkTable" id="table7">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="n_rows">2</property>
|
|
||||||
<property name="n_columns">3</property>
|
|
||||||
<property name="column_spacing">2</property>
|
|
||||||
<property name="row_spacing">2</property>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkVBox" id="vbox2">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="button1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">gtk-go-forward</property>
|
|
||||||
<property name="use_stock">True</property>
|
|
||||||
<property name="image_position">GTK_POS_TOP</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="button2">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">gtk-go-back</property>
|
|
||||||
<property name="use_stock">True</property>
|
|
||||||
<property name="response_id">0</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">GTK_SHRINK</property>
|
|
||||||
<property name="y_options">GTK_SHRINK</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label15">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">Command extensions</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="x_options">GTK_SHRINK</property>
|
|
||||||
<property name="y_options">GTK_SHRINK</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label16">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes">Available extensions</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="x_options">GTK_SHRINK</property>
|
|
||||||
<property name="y_options">GTK_SHRINK</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkScrolledWindow" id="scrolledwindow7">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
|
||||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
|
||||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkTreeView" id="treeview1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="headers_clickable">True</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkScrolledWindow" id="scrolledwindow8">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
|
||||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
|
||||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkTreeView" id="treeview2">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="headers_clickable">True</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="right_attach">3</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
|
||||||
<property name="label" translatable="yes"><b>Extension assignment</b></property>
|
|
||||||
<property name="use_markup">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="type">label_item</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label15">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes"><b>Comands</b></property>
|
|
||||||
<property name="use_markup">True</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="type">label_item</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="position">4</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
@@ -652,6 +652,8 @@
|
|||||||
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
<property name="editable">False</property>
|
<property name="editable">False</property>
|
||||||
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
<property name="wrap_mode">GTK_WRAP_WORD</property>
|
||||||
|
<property name="left_margin">2</property>
|
||||||
|
<property name="right_margin">2</property>
|
||||||
<property name="cursor_visible">False</property>
|
<property name="cursor_visible">False</property>
|
||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
@@ -866,4 +868,24 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</child>
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="GtkMenu" id="files_popup">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkMenuItem" id="add_tag1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
|
<property name="label" translatable="yes">_Add tag</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="GtkMenuItem" id="add_thumbnail1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
|
||||||
|
<property name="label" translatable="yes">Add _thumbnail</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
</glade-interface>
|
</glade-interface>
|
||||||
|
|||||||
@@ -32,10 +32,9 @@ class ConfigController(Controller):
|
|||||||
'General':'general_group',
|
'General':'general_group',
|
||||||
'Scan options':'scan_group',
|
'Scan options':'scan_group',
|
||||||
'Files extensions':'ft_group',
|
'Files extensions':'ft_group',
|
||||||
'Commands':'commands_group',
|
|
||||||
}
|
}
|
||||||
category_order = ['General', 'Disk options', 'Scan options',
|
category_order = ['General', 'Disk options', 'Scan options',
|
||||||
'Files extensions', 'Commands']
|
'Files extensions',]
|
||||||
|
|
||||||
def __init__(self, model):
|
def __init__(self, model):
|
||||||
Controller.__init__(self, model)
|
Controller.__init__(self, model)
|
||||||
@@ -67,15 +66,23 @@ class ConfigController(Controller):
|
|||||||
self.__setup_category_tree()
|
self.__setup_category_tree()
|
||||||
|
|
||||||
# initialize models for files extensions
|
# initialize models for files extensions
|
||||||
self.view['ext_choose'].set_model(self.model.ext_list)
|
|
||||||
self.view['ext_choose'].set_active(0)
|
|
||||||
self.view['extension_tree'].get_selection().set_mode(gtk.SELECTION_MULTIPLE)
|
self.view['extension_tree'].get_selection().set_mode(gtk.SELECTION_MULTIPLE)
|
||||||
|
#self.view['extension_tree'].set_model(self.model.ext_tree)
|
||||||
|
self.__setup_extension_tree()
|
||||||
|
|
||||||
self.view['config'].show();
|
self.view['config'].show();
|
||||||
return
|
return
|
||||||
# Podłącz sygnały:
|
# Podłącz sygnały:
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# connect signals
|
# connect signals
|
||||||
|
def on_extension_tree_cursor_changed(self, tree):
|
||||||
|
model = tree.get_model()
|
||||||
|
selected = model.get_value(model.get_iter(tree.get_cursor()[0]), 0)
|
||||||
|
ext = self.model.confd['extensions']
|
||||||
|
self.view['ext_entry'].set_text(selected)
|
||||||
|
self.view['com_entry'].set_text(ext[selected])
|
||||||
|
|
||||||
def on_category_tree_cursor_changed(self, tree):
|
def on_category_tree_cursor_changed(self, tree):
|
||||||
"""change view to selected row corresponding to group of properties"""
|
"""change view to selected row corresponding to group of properties"""
|
||||||
model = tree.get_model()
|
model = tree.get_model()
|
||||||
@@ -127,22 +134,28 @@ class ConfigController(Controller):
|
|||||||
self.__toggle_scan_group()
|
self.__toggle_scan_group()
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_ext_choose_changed(self, widget):
|
|
||||||
self.__setup_extension_tree()
|
|
||||||
self.view['ext_entry'].set_text('')
|
|
||||||
return
|
|
||||||
|
|
||||||
def on_ext_add_clicked(self, widget):
|
def on_ext_add_clicked(self, widget):
|
||||||
ext = self.view['ext_entry'].get_text().lower()
|
ext = self.view['ext_entry'].get_text().lower()
|
||||||
|
com = self.view['com_entry'].get_text()
|
||||||
|
if len(ext) == 0 and len(com) == 0:
|
||||||
|
Dialogs.Err("Config - pyGTKtalog", "Error", "Extension and command required")
|
||||||
|
return
|
||||||
|
|
||||||
|
if len(com) == 0:
|
||||||
|
Dialogs.Err("Config - pyGTKtalog", "Error", "Command is empty")
|
||||||
|
return
|
||||||
|
|
||||||
if len(ext) == 0:
|
if len(ext) == 0:
|
||||||
Dialogs.Err("Config - pyGTKtalog", "Error", "Extension is empty")
|
Dialogs.Err("Config - pyGTKtalog", "Error", "Extension is empty")
|
||||||
return
|
return
|
||||||
if self.view['ext_choose'].get_active() == 0:
|
|
||||||
if ext not in self.model.confd['img_ext']:
|
if ext in self.model.confd['extensions'].keys():
|
||||||
self.model.confd['img_ext'].append(ext)
|
obj = Dialogs.Qst('Alter extension',
|
||||||
self.model.refresh_ext('img_ext')
|
'Alter extension?',
|
||||||
else:
|
'Extension "%s" will be altered.' % ext)
|
||||||
self.model.confd['mov_ext'].append(ext)
|
if not obj.run():
|
||||||
|
return
|
||||||
|
self.model.confd['extensions'][ext] = com
|
||||||
|
|
||||||
self.__setup_extension_tree()
|
self.__setup_extension_tree()
|
||||||
return
|
return
|
||||||
@@ -164,13 +177,8 @@ class ConfigController(Controller):
|
|||||||
if not obj.run():
|
if not obj.run():
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.view['ext_choose'].get_active() == 0:
|
|
||||||
n = 'img_ext'
|
|
||||||
else:
|
|
||||||
n = 'mov_ext'
|
|
||||||
|
|
||||||
for i in selection:
|
for i in selection:
|
||||||
self.model.confd[n].remove(model.get_value(model.get_iter(i), 0))
|
self.model.confd['extensions'].pop(model.get_value(model.get_iter(i), 0))
|
||||||
|
|
||||||
self.__setup_extension_tree()
|
self.__setup_extension_tree()
|
||||||
return
|
return
|
||||||
@@ -178,17 +186,18 @@ class ConfigController(Controller):
|
|||||||
############################
|
############################
|
||||||
# private controller methods
|
# private controller methods
|
||||||
def __setup_extension_tree(self):
|
def __setup_extension_tree(self):
|
||||||
if self.view['ext_choose'].get_active() == 0:
|
self.model.refresh_ext()
|
||||||
self.model.refresh_ext('img_ext')
|
|
||||||
else:
|
|
||||||
self.model.refresh_ext('mov_ext')
|
|
||||||
|
|
||||||
self.view['extension_tree'].set_model(self.model.ext_tree)
|
self.view['extension_tree'].set_model(self.model.ext_tree)
|
||||||
|
|
||||||
for i in self.view['extension_tree'].get_columns():
|
for i in self.view['extension_tree'].get_columns():
|
||||||
self.view['extension_tree'].remove_column(i)
|
self.view['extension_tree'].remove_column(i)
|
||||||
cell = gtk.CellRendererText()
|
cell = gtk.CellRendererText()
|
||||||
column = gtk.TreeViewColumn("Extensions", cell, text=0)
|
column = gtk.TreeViewColumn("Extension", cell, text=0)
|
||||||
|
column.set_resizable(True)
|
||||||
|
self.view['extension_tree'].append_column(column)
|
||||||
|
|
||||||
|
column = gtk.TreeViewColumn("Command", cell, text=1)
|
||||||
column.set_resizable(True)
|
column.set_resizable(True)
|
||||||
self.view['extension_tree'].append_column(column)
|
self.view['extension_tree'].append_column(column)
|
||||||
|
|
||||||
@@ -196,6 +205,7 @@ class ConfigController(Controller):
|
|||||||
for i in ('ch_thumb','ch_exif','ch_gthumb'):
|
for i in ('ch_thumb','ch_exif','ch_gthumb'):
|
||||||
self.view[i].set_sensitive(self.view['ch_retrive'].get_active())
|
self.view[i].set_sensitive(self.view['ch_retrive'].get_active())
|
||||||
return
|
return
|
||||||
|
|
||||||
def __setup_category_tree(self):
|
def __setup_category_tree(self):
|
||||||
category_tree = self.view['category_tree']
|
category_tree = self.view['category_tree']
|
||||||
category_tree.set_model(self.model.category_tree)
|
category_tree.set_model(self.model.category_tree)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ from models.m_config import ConfigModel
|
|||||||
import views.v_dialogs as Dialogs
|
import views.v_dialogs as Dialogs
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
import pango
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
@@ -288,24 +289,23 @@ class MainController(Controller):
|
|||||||
def on_files_cursor_changed(self,treeview):
|
def on_files_cursor_changed(self,treeview):
|
||||||
"""Show details of selected file"""
|
"""Show details of selected file"""
|
||||||
model, paths = treeview.get_selection().get_selected_rows()
|
model, paths = treeview.get_selection().get_selected_rows()
|
||||||
try:
|
#try:
|
||||||
itera = model.get_iter(paths[0])
|
itera = model.get_iter(paths[0])
|
||||||
if model.get_value(itera,4) == 1:
|
if model.get_value(itera,4) == 1:
|
||||||
#directory, do nothin', just turn off view
|
#directory, do nothin', just turn off view
|
||||||
'''self.view['details'].hide()
|
'''self.view['details'].hide()
|
||||||
buf = self.view['details'].get_buffer()
|
buf = self.view['details'].get_buffer()
|
||||||
buf.set_text('')
|
buf.set_text('')
|
||||||
self.view['details'].set_buffer(buf)'''
|
self.view['details'].set_buffer(buf)'''
|
||||||
else:
|
else:
|
||||||
#file, show what you got.
|
#file, show what you got.
|
||||||
#self.details.get_top_widget()
|
#self.details.get_top_widget()
|
||||||
iter = model.get_iter(treeview.get_cursor()[0])
|
iter = model.get_iter(treeview.get_cursor()[0])
|
||||||
selected_item = self.model.files_list.get_value(iter, 0)
|
selected_item = self.model.files_list.get_value(iter, 0)
|
||||||
self.__get_item_info(selected_item)
|
self.__get_item_info(selected_item)
|
||||||
except:
|
#except:
|
||||||
if __debug__:
|
# if __debug__:
|
||||||
print "c_main.py: on_files_cursor_changed() insufficient \
|
# print "c_main.py: on_files_cursor_changed() insufficient iterator"
|
||||||
iterator"
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_files_key_release_event(self, a, event):
|
def on_files_key_release_event(self, a, event):
|
||||||
@@ -554,8 +554,7 @@ class MainController(Controller):
|
|||||||
self.model.config.confd['confirmquit']:
|
self.model.config.confd['confirmquit']:
|
||||||
if not Dialogs.Qst('Quit application - pyGTKtalog',
|
if not Dialogs.Qst('Quit application - pyGTKtalog',
|
||||||
'Do you really want to quit?',
|
'Do you really want to quit?',
|
||||||
"Current database is not saved, any changes \
|
"Current database is not saved, any changes will be lost.").run():
|
||||||
will be lost.").run():
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self.__store_settings()
|
self.__store_settings()
|
||||||
@@ -571,16 +570,15 @@ class MainController(Controller):
|
|||||||
if self.model.unsaved_project:
|
if self.model.unsaved_project:
|
||||||
if not Dialogs.Qst('Unsaved data - pyGTKtalog',
|
if not Dialogs.Qst('Unsaved data - pyGTKtalog',
|
||||||
"Current database isn't saved",
|
"Current database isn't saved",
|
||||||
'All changes will be lost. \
|
'All changes will be lost. Do you really want to abandon it?').run():
|
||||||
Do you really want to abandon it?').run():
|
|
||||||
return
|
return
|
||||||
self.model.new()
|
self.model.new()
|
||||||
|
|
||||||
# clear "details" buffer
|
# clear "details" buffer
|
||||||
'''txt = ""
|
buf = self.view['description'].get_buffer()
|
||||||
buf = self.view['details'].get_buffer()
|
buf.set_text("")
|
||||||
buf.set_text(txt)
|
self.view['description'].set_buffer(buf)
|
||||||
self.view['details'].set_buffer(buf)'''
|
self.view['thumb'].hide()
|
||||||
|
|
||||||
self.__activate_ui()
|
self.__activate_ui()
|
||||||
|
|
||||||
@@ -729,10 +727,16 @@ class MainController(Controller):
|
|||||||
def __get_item_info(self, item):
|
def __get_item_info(self, item):
|
||||||
self.view['description'].show()
|
self.view['description'].show()
|
||||||
set = self.model.get_file_info(item)
|
set = self.model.get_file_info(item)
|
||||||
|
|
||||||
buf = self.view['description'].get_buffer()
|
buf = self.view['description'].get_buffer()
|
||||||
if set.has_key('description'):
|
|
||||||
buf.set_text(set['description'])
|
if set.has_key('file_info'):
|
||||||
|
buf.set_text(set['file_info'])
|
||||||
|
if set.has_key('description'):
|
||||||
|
tag = buf.create_tag()
|
||||||
|
tag.set_property('weight', pango.WEIGHT_BOLD)
|
||||||
|
buf.insert_with_tags(buf.get_end_iter(), "\nDetails:\n", tag)
|
||||||
|
buf.insert(buf.get_end_iter(), set['description'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
buf.set_text('')
|
buf.set_text('')
|
||||||
self.view['description'].set_buffer(buf)
|
self.view['description'].set_buffer(buf)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class ConfigModel(Model):
|
|||||||
'mntwarn': True,
|
'mntwarn': True,
|
||||||
'delwarn': True,
|
'delwarn': True,
|
||||||
|
|
||||||
'cd': '/cdrom',
|
'cd': '/mnt/cdrom',
|
||||||
'ejectapp': 'eject -r',
|
'ejectapp': 'eject -r',
|
||||||
|
|
||||||
'retrive': False,
|
'retrive': False,
|
||||||
@@ -84,8 +84,17 @@ class ConfigModel(Model):
|
|||||||
'exif': True,
|
'exif': True,
|
||||||
'gthumb': False,
|
'gthumb': False,
|
||||||
|
|
||||||
'mov_ext': ['avi', 'mkv', 'mpg', 'mpeg', 'wmv'],
|
'extensions': {'bmp':'identify %s',
|
||||||
'img_ext': ['bmp', 'gif', 'jpg', 'jpeg', 'png'],
|
'gif':'identify "%s"',
|
||||||
|
'jpg':'identify "%s"',
|
||||||
|
'jpeg':'identify "%s"',
|
||||||
|
'png':'identify "%s"',
|
||||||
|
'avi':'midentify "%s"',
|
||||||
|
'mkv':'midentify "%s"',
|
||||||
|
'mpg':'midentify "%s"',
|
||||||
|
'mpeg':'midentify "%s"',
|
||||||
|
'wmv':'midentify "%s"',
|
||||||
|
},
|
||||||
|
|
||||||
'showtoolbar':True,
|
'showtoolbar':True,
|
||||||
'showstatusbar':True,
|
'showstatusbar':True,
|
||||||
@@ -147,21 +156,19 @@ class ConfigModel(Model):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
Model.__init__(self)
|
Model.__init__(self)
|
||||||
self.category_tree = gtk.ListStore(gobject.TYPE_STRING)
|
self.category_tree = gtk.ListStore(gobject.TYPE_STRING)
|
||||||
self.ext_list = gtk.ListStore(gobject.TYPE_STRING)
|
|
||||||
for i in self.filetype_list:
|
|
||||||
myiter = self.ext_list.insert_before(None,None)
|
|
||||||
self.ext_list.set_value(myiter,0,i)
|
|
||||||
|
|
||||||
self.refresh_ext('img_ext')
|
self.refresh_ext()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def refresh_ext(self, key):
|
def refresh_ext(self):
|
||||||
self.ext_tree = gtk.ListStore(gobject.TYPE_STRING)
|
self.ext_tree = gtk.ListStore(gobject.TYPE_STRING,
|
||||||
self.confd[key].sort()
|
gobject.TYPE_STRING)
|
||||||
for i in self.confd[key]:
|
keys = sorted(self.confd['extensions'].keys())
|
||||||
|
for i in keys:
|
||||||
myiter = self.ext_tree.insert_before(None,None)
|
myiter = self.ext_tree.insert_before(None,None)
|
||||||
self.ext_tree.set_value(myiter,0,i)
|
self.ext_tree.set_value(myiter, 0, i)
|
||||||
|
self.ext_tree.set_value(myiter, 1, self.confd['extensions'][i])
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
try:
|
try:
|
||||||
@@ -190,16 +197,10 @@ class ConfigModel(Model):
|
|||||||
count+=1
|
count+=1
|
||||||
|
|
||||||
# extensions sections
|
# extensions sections
|
||||||
newIni.add_section("images extensions")
|
newIni.add_section("extensions")
|
||||||
count = 1
|
count = 1
|
||||||
for i in self.confd['img_ext']:
|
for i in self.confd['extensions']:
|
||||||
newIni.add_key(count, i)
|
newIni.add_key(i, self.confd['extensions'][i])
|
||||||
count+=1
|
|
||||||
|
|
||||||
newIni.add_section("movies extensions")
|
|
||||||
count = 1
|
|
||||||
for i in self.confd['mov_ext']:
|
|
||||||
newIni.add_key(count, i)
|
|
||||||
count+=1
|
count+=1
|
||||||
|
|
||||||
# write config
|
# write config
|
||||||
@@ -243,21 +244,11 @@ class ConfigModel(Model):
|
|||||||
if __debug__:
|
if __debug__:
|
||||||
print "m_config.py: load() failed to parse option:", opt
|
print "m_config.py: load() failed to parse option:", opt
|
||||||
pass
|
pass
|
||||||
elif sec == 'images extensions':
|
elif sec == 'extensions':
|
||||||
self.confd['img_ext'] = []
|
self.confd['extensions'] = {}
|
||||||
for opt in parser.options(sec):
|
for opt in parser.options(sec):
|
||||||
try:
|
try:
|
||||||
self.confd['img_ext'].append(parser.get(sec,opt))
|
self.confd['extensions'][opt] = parser.get(sec, opt)
|
||||||
except:
|
|
||||||
if __debug__:
|
|
||||||
print "m_config.py: load() failed to parse option:", opt
|
|
||||||
pass
|
|
||||||
|
|
||||||
elif sec == 'movies extensions':
|
|
||||||
self.confd['mov_ext'] = []
|
|
||||||
for opt in parser.options(sec):
|
|
||||||
try:
|
|
||||||
self.confd['mov_ext'].append(parser.get(sec,opt))
|
|
||||||
except:
|
except:
|
||||||
if __debug__:
|
if __debug__:
|
||||||
print "m_config.py: load() failed to parse option:", opt
|
print "m_config.py: load() failed to parse option:", opt
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import base64
|
|||||||
import shutil
|
import shutil
|
||||||
import tarfile
|
import tarfile
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import string
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import gobject
|
import gobject
|
||||||
@@ -58,17 +59,13 @@ class MainModel(ModelMT):
|
|||||||
FIL = 2 # file
|
FIL = 2 # file
|
||||||
LIN = 3 # symbolic link
|
LIN = 3 # symbolic link
|
||||||
|
|
||||||
# filetype kind of
|
|
||||||
F_UNK = 0 # unknown - default
|
|
||||||
F_IMG = 1 # images - jpg, gif, tiff itd
|
|
||||||
F_MOV = 2 # movies and clips - mpg, ogm, mkv, avi, asf, wmv itd
|
|
||||||
F_MUS = 4 # music - flac, mp3, mpc, ogg itd
|
|
||||||
F_APP = 5 # applications
|
|
||||||
F_DOC = 6 # all kind of documents txt/pdf/doc/odf itd
|
|
||||||
|
|
||||||
CD = 1 # sorce: cd/dvd
|
CD = 1 # sorce: cd/dvd
|
||||||
DR = 2 # source: filesystem
|
DR = 2 # source: filesystem
|
||||||
|
|
||||||
|
# images extensions - only for PIL and EXIF
|
||||||
|
IMG = ['jpg', 'jpeg', 'gif', 'png', 'tif', 'tiff', 'tga', 'pcx', 'bmp',
|
||||||
|
'xbm', 'xpm', 'jp2', 'jpx', 'pnm']
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
ModelMT.__init__(self)
|
ModelMT.__init__(self)
|
||||||
self.config = ConfigModel()
|
self.config = ConfigModel()
|
||||||
@@ -255,9 +252,7 @@ class MainModel(ModelMT):
|
|||||||
|
|
||||||
# all the rest
|
# all the rest
|
||||||
self.db_cursor.execute("SELECT f.id, f.filename, f.size, f.date, \
|
self.db_cursor.execute("SELECT f.id, f.filename, f.size, f.date, \
|
||||||
f.type, f.filetype, t.filename \
|
f.type FROM files f \
|
||||||
FROM files f \
|
|
||||||
LEFT JOIN thumbnails t ON f.id = t.file_id \
|
|
||||||
WHERE f.parent_id=? AND f.type!=1 \
|
WHERE f.parent_id=? AND f.type!=1 \
|
||||||
ORDER BY f.filename", (id,))
|
ORDER BY f.filename", (id,))
|
||||||
data = self.db_cursor.fetchall()
|
data = self.db_cursor.fetchall()
|
||||||
@@ -270,14 +265,11 @@ class MainModel(ModelMT):
|
|||||||
self.files_list.set_value(myiter, 4, ch[4])
|
self.files_list.set_value(myiter, 4, ch[4])
|
||||||
self.files_list.set_value(myiter, 5, 'kategoria srategoria')
|
self.files_list.set_value(myiter, 5, 'kategoria srategoria')
|
||||||
if ch[4] == self.FIL:
|
if ch[4] == self.FIL:
|
||||||
if ch[6] != None:
|
self.files_list.set_value(myiter, 6, gtk.STOCK_FILE)
|
||||||
# TODO: change icon to thumbnail
|
|
||||||
self.files_list.set_value(myiter, 6, gtk.STOCK_FILE)
|
|
||||||
else:
|
|
||||||
self.files_list.set_value(myiter, 6, gtk.STOCK_FILE)
|
|
||||||
elif ch[4] == self.LIN:
|
elif ch[4] == self.LIN:
|
||||||
self.files_list.set_value(myiter, 6, gtk.STOCK_INDEX)
|
self.files_list.set_value(myiter, 6, gtk.STOCK_INDEX)
|
||||||
return
|
return
|
||||||
|
|
||||||
def get_parent_discs_value(self, child_id):
|
def get_parent_discs_value(self, child_id):
|
||||||
if child_id:
|
if child_id:
|
||||||
self.db_cursor.execute("SELECT parent_id FROM files where id=?", (child_id,))
|
self.db_cursor.execute("SELECT parent_id FROM files where id=?", (child_id,))
|
||||||
@@ -290,7 +282,7 @@ class MainModel(ModelMT):
|
|||||||
"""get file info from database"""
|
"""get file info from database"""
|
||||||
retval = {}
|
retval = {}
|
||||||
self.db_cursor.execute("SELECT f.filename, f.date, f.size, f.type, \
|
self.db_cursor.execute("SELECT f.filename, f.date, f.size, f.type, \
|
||||||
t.filename \
|
t.filename, f.description \
|
||||||
FROM files f \
|
FROM files f \
|
||||||
LEFT JOIN thumbnails t ON t.file_id = f.id \
|
LEFT JOIN thumbnails t ON t.file_id = f.id \
|
||||||
WHERE f.id = ?", (id,))
|
WHERE f.id = ?", (id,))
|
||||||
@@ -298,7 +290,9 @@ class MainModel(ModelMT):
|
|||||||
if set:
|
if set:
|
||||||
string = "ID: %d\nFilename: %s\nDate: %s\nSize: %s\ntype: %s" % \
|
string = "ID: %d\nFilename: %s\nDate: %s\nSize: %s\ntype: %s" % \
|
||||||
(id, set[0], datetime.fromtimestamp(set[1]), set[2], set[3])
|
(id, set[0], datetime.fromtimestamp(set[1]), set[2], set[3])
|
||||||
retval['description'] = string
|
retval['file_info'] = string
|
||||||
|
if set[5]:
|
||||||
|
retval['description'] = set[5]
|
||||||
|
|
||||||
if set[4]:
|
if set[4]:
|
||||||
retval['thumbnail'] = os.path.join(self.internal_dirname, set[4])
|
retval['thumbnail'] = os.path.join(self.internal_dirname, set[4])
|
||||||
@@ -408,22 +402,11 @@ class MainModel(ModelMT):
|
|||||||
size_x integer,
|
size_x integer,
|
||||||
size_y integer,
|
size_y integer,
|
||||||
filetype integer,
|
filetype integer,
|
||||||
note TEXT);""")
|
description TEXT);""")
|
||||||
self.db_cursor.execute("""create table
|
self.db_cursor.execute("""create table
|
||||||
tags(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
tags(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
file_id INTEGER,
|
file_id INTEGER,
|
||||||
tag TEXT);""")
|
tag TEXT);""")
|
||||||
self.db_cursor.execute("""create table
|
|
||||||
descriptions(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
||||||
file_id INTEGER,
|
|
||||||
desc TEXT,
|
|
||||||
image TEXT,
|
|
||||||
image_x INTEGER,
|
|
||||||
image_y INTEGER,
|
|
||||||
thumb TEXT,
|
|
||||||
thumb_x INTEGER,
|
|
||||||
thumb_y INTEGER,
|
|
||||||
thumb_mode TEXT);""")
|
|
||||||
self.db_cursor.execute("""create table
|
self.db_cursor.execute("""create table
|
||||||
thumbnails(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
thumbnails(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
file_id INTEGER,
|
file_id INTEGER,
|
||||||
@@ -586,15 +569,33 @@ class MainModel(ModelMT):
|
|||||||
update = True
|
update = True
|
||||||
sql = """select seq FROM sqlite_sequence WHERE name='files'"""
|
sql = """select seq FROM sqlite_sequence WHERE name='files'"""
|
||||||
db_cursor.execute(sql)
|
db_cursor.execute(sql)
|
||||||
fileid=db_cursor.fetchone()[0]
|
fileid = db_cursor.fetchone()[0]
|
||||||
if i.split('.')[-1].lower() in self.config.confd['img_ext']:
|
|
||||||
sql = """UPDATE files set filetype = ? where id = ?"""
|
ext = i.split('.')[-1].lower()
|
||||||
db_cursor.execute(sql, (self.F_IMG, fileid))
|
|
||||||
if self.config.confd['thumbs']:
|
# Images - thumbnails and exif data
|
||||||
path, exif, ret_code = Thumbnail(current_path, base=self.internal_dirname).save(fileid)
|
if self.config.confd['thumbs'] and ext in self.IMG:
|
||||||
if ret_code != -1:
|
path, exif, ret_code = Thumbnail(current_path, base=self.internal_dirname).save(fileid)
|
||||||
sql = """insert into thumbnails(file_id, filename) values (?, ?)"""
|
if ret_code != -1:
|
||||||
db_cursor.execute(sql, (fileid, path.split(self.internal_dirname)[1][1:]))
|
sql = """insert into thumbnails(file_id, filename) values (?, ?)"""
|
||||||
|
db_cursor.execute(sql, (fileid,
|
||||||
|
path.split(self.internal_dirname)[1][1:]))
|
||||||
|
|
||||||
|
if self.config.confd['exif']:
|
||||||
|
# TODO: exif implementation
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Extensions - user defined actions
|
||||||
|
if ext in self.config.confd['extensions'].keys():
|
||||||
|
cmd = self.config.confd['extensions'][ext]
|
||||||
|
arg = string.replace(current_path, '"', '\\"')
|
||||||
|
output = os.popen(cmd % arg).readlines()
|
||||||
|
desc = ''
|
||||||
|
for line in output:
|
||||||
|
desc += line
|
||||||
|
#desc = string.replace(desc, "\n", "\\n")
|
||||||
|
sql = """update files set description=? where id=?"""
|
||||||
|
db_cursor.execute(sql, (desc, fileid))
|
||||||
|
|
||||||
#if i.split('.').[-1].lower() in mov_ext:
|
#if i.split('.').[-1].lower() in mov_ext:
|
||||||
# # video only
|
# # video only
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ class Thumbnail(object):
|
|||||||
if exif.has_key('Image Orientation'):
|
if exif.has_key('Image Orientation'):
|
||||||
orientation = exif['Image Orientation'].values[0]
|
orientation = exif['Image Orientation'].values[0]
|
||||||
if orientation > 1:
|
if orientation > 1:
|
||||||
|
# TODO: replace silly datetime function with tempfile
|
||||||
t = path.join(gettempdir(), "thumb%d.jpg" % datetime.now().microsecond)
|
t = path.join(gettempdir(), "thumb%d.jpg" % datetime.now().microsecond)
|
||||||
im_in = Image.open(filepath)
|
im_in = Image.open(filepath)
|
||||||
im_out = None
|
im_out = None
|
||||||
|
|||||||
Reference in New Issue
Block a user