1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 19:40:21 +01:00

* Added statisics.

* Bug fix on files disapear in file view.
 * Code clean up.
This commit is contained in:
2008-04-08 13:25:13 +00:00
parent 344f4be232
commit a36ca62b73
7 changed files with 758 additions and 498 deletions

8
README
View File

@@ -60,13 +60,14 @@ For version 1.0 following aims have to be done:
- file details: - file details:
- files properties - files properties
x thumbnail x thumbnail
- description x description
- file information (date, size, etc) (50%)
- exif information - exif information
- keywords (tags) - keywords (tags)
- gthumb integration
- 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
x statistics
Legend: [-] not done, [x] done. Legend: [-] not done, [x] done.
@@ -74,7 +75,6 @@ For version 2.0:
- Icon grid in files view - Icon grid in files view
- command line support: query, adding media to collection etc - command line support: query, adding media to collection etc
- internationalization support - internationalization support
- statistics
Removed: Removed:
- filetypes handling (movies, images, archives, documents etc). Now it have - filetypes handling (movies, images, archives, documents etc). Now it have
@@ -92,7 +92,7 @@ Removed:
- anidb link/imdb link - anidb link/imdb link
Maybe in future versions. Now text file descriptions and tags have to be Maybe in future versions. Now text file descriptions and tags have to be
enough for good and fast information search. enough for good and fast information search.
- file information (date, size, etc) (50%) (no need for?)
NOTES NOTES
===== =====

View File

@@ -259,12 +259,14 @@
<widget class="GtkCheckButton" id="ch_compress"> <widget class="GtkCheckButton" id="ch_compress">
<property name="visible">True</property> <property name="visible">True</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="label" translatable="yes">Compress collection</property> <property name="label" translatable="yes">Compress collection</property>
<property name="use_underline">True</property>
<property name="response_id">0</property> <property name="response_id">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </widget>
<packing> <packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>

View File

@@ -1,331 +1,178 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--*- mode: xml -*-->
<glade-interface> <glade-interface>
<widget class="GtkDialog" id="inputDialog"> <widget class="GtkDialog" id="inputDialog">
<property name="visible">True</property> <property name="visible">True</property>
<property name="title" translatable="yes">Disk label - pyGTKtalog</property> <property name="title" translatable="yes">Disk label - pyGTKtalog</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1"> <widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child> <child>
<widget class="GtkHBox" id="hbox1"> <widget class="GtkHBox" id="hbox1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child> <child>
<widget class="GtkLabel" id="label1"> <widget class="GtkLabel" id="label1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Disk label</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">3</property> <property name="xpad">3</property>
<property name="ypad">0</property> <property name="label" translatable="yes">Disk label</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkEntry" id="volname"> <widget class="GtkEntry" id="volname">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property> <property name="can_default">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<signal name="activate" handler="on_volname_activate" last_modification_time="Sun, 26 Nov 2006 17:34:10 GMT"/> <signal name="activate" handler="on_volname_activate"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="position">1</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="position">2</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="addDirDialog">
<property name="visible">True</property>
<property name="title" translatable="yes">dialog1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2"> <widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property> <property name="layout_style">GTK_BUTTONBOX_END</property>
<child> <child>
<widget class="GtkButton" id="cancelbutton2"> <widget class="GtkButton" id="cancelbutton1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property> <property name="response_id">-6</property>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="okbutton2"> <widget class="GtkButton" id="okbutton1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property> <property name="response_id">-5</property>
</widget> </widget>
<packing>
<property name="position">1</property>
</packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property> <property name="pack_type">GTK_PACK_END</property>
</packing> </packing>
</child> </child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="addDirDialog">
<property name="visible">True</property>
<property name="title" translatable="yes">dialog1</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<child> <child>
<widget class="GtkVBox" id="vbox1"> <widget class="GtkVBox" id="vbox1">
<property name="border_width">3</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="border_width">3</property>
<property name="spacing">0</property>
<child> <child>
<widget class="GtkFrame" id="frame2"> <widget class="GtkFrame" id="frame2">
<property name="border_width">3</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="border_width">3</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child> <child>
<widget class="GtkAlignment" id="alignment2"> <widget class="GtkAlignment" id="alignment2">
<property name="border_width">3</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0.5</property> <property name="border_width">3</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<property name="right_padding">0</property>
<child> <child>
<widget class="GtkTable" id="table1"> <widget class="GtkTable" id="table1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">2</property> <property name="n_rows">2</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
<property name="column_spacing">3</property> <property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child> <child>
<widget class="GtkEntry" id="dirvolname"> <placeholder/>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes">New</property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child> </child>
<child>
<widget class="GtkEntry" id="directory">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</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="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="label" translatable="yes">Disk Label:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="label" translatable="yes">Select directory:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child> <child>
<widget class="GtkButton" id="browse"> <widget class="GtkButton" id="browse">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Browse...</property> <property name="label" translatable="yes">Browse...</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <property name="response_id">0</property>
<property name="focus_on_click">True</property> <signal name="clicked" handler="on_browse_clicked"/>
<signal name="clicked" handler="on_browse_clicked" last_modification_time="Sun, 03 Dec 2006 17:04:04 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="left_attach">2</property> <property name="left_attach">2</property>
<property name="right_attach">3</property> <property name="right_attach">3</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">fill</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Select directory:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Disk Label:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="directory">
<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="GtkEntry" id="dirvolname">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="text" translatable="yes">New</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
@@ -333,41 +180,219 @@
</child> </child>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label4"> <widget class="GtkLabel" id="label4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Select directory and enter label&lt;/b&gt;</property> <property name="label" translatable="yes">&lt;b&gt;Select directory and enter label&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property> <property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget> </widget>
<packing> <packing>
<property name="type">label_item</property> <property name="type">label_item</property>
</packing> </packing>
</child> </child>
</widget> </widget>
</child>
</widget>
<packing> <packing>
<property name="padding">0</property> <property name="position">2</property>
<property name="expand">True</property> </packing>
<property name="fill">True</property> </child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="cancelbutton2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="okbutton2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="response_id">-5</property>
</widget>
<packing>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="expand">False</property>
<property name="expand">True</property> <property name="pack_type">GTK_PACK_END</property>
<property name="fill">True</property> </packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="statDialog">
<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">5</property>
<property name="title" translatable="yes">pyGTKtalog - stats</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox3">
<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="spacing">2</property>
<child>
<widget class="GtkTable" id="table2">
<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">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">2</property>
<child>
<widget class="GtkLabel" id="size_label">
<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">Total size:</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="files_label">
<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">Number of files:</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="dirs_label">
<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">Number of directories:</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="discs_label">
<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">Number of discs:</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
</widget>
<packing>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="size_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>
<property name="editable">False</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="files_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>
<property name="editable">False</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="dirs_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>
<property name="editable">False</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</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">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="discs_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>
<property name="editable">False</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area3">
<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="layout_style">GTK_BUTTONBOX_END</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-close</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing> </packing>
</child> </child>
</widget> </widget>
</child> </child>
</widget> </widget>
</glade-interface> </glade-interface>

View File

@@ -141,6 +141,7 @@
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<signal name="activate" handler="on_find1_activate"/> <signal name="activate" handler="on_find1_activate"/>
<accelerator key="f" modifiers="GDK_CONTROL_MASK" signal="activate"/>
</widget> </widget>
</child> </child>
<child> <child>
@@ -171,7 +172,7 @@
<child> <child>
<widget class="GtkMenuItem" id="add_cd"> <widget class="GtkMenuItem" id="add_cd">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Add CD/DVD</property> <property name="label" translatable="yes">Add _CD/DVD</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<signal name="activate" handler="on_add_cd_activate"/> <signal name="activate" handler="on_add_cd_activate"/>
<accelerator key="a" modifiers="GDK_CONTROL_MASK" signal="activate"/> <accelerator key="a" modifiers="GDK_CONTROL_MASK" signal="activate"/>
@@ -180,9 +181,10 @@
<child> <child>
<widget class="GtkMenuItem" id="add_directory1"> <widget class="GtkMenuItem" id="add_directory1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Add Directory</property> <property name="label" translatable="yes">Add _Directory</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<signal name="activate" handler="on_add_directory1_activate"/> <signal name="activate" handler="on_add_directory1_activate"/>
<accelerator key="d" modifiers="GDK_CONTROL_MASK" signal="activate"/>
</widget> </widget>
</child> </child>
<child> <child>
@@ -190,6 +192,20 @@
<property name="visible">True</property> <property name="visible">True</property>
</widget> </widget>
</child> </child>
<child>
<widget class="GtkMenuItem" id="stat1">
<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">Catalog _statistics</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_stat1_activate"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator6">
<property name="visible">True</property>
</widget>
</child>
<child> <child>
<widget class="GtkImageMenuItem" id="cancel1"> <widget class="GtkImageMenuItem" id="cancel1">
<property name="visible">True</property> <property name="visible">True</property>
@@ -566,6 +582,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="rules_hint">True</property> <property name="rules_hint">True</property>
<signal name="button_press_event" handler="on_files_button_press_event"/>
<signal name="row_activated" handler="on_files_row_activated"/> <signal name="row_activated" handler="on_files_row_activated"/>
<signal name="cursor_changed" handler="on_files_cursor_changed"/> <signal name="cursor_changed" handler="on_files_cursor_changed"/>
<signal name="key_release_event" handler="on_files_key_release_event"/> <signal name="key_release_event" handler="on_files_key_release_event"/>
@@ -877,6 +894,7 @@
<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 tag</property> <property name="label" translatable="yes">_Add tag</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<signal name="activate" handler="on_add_tag1_activate"/>
</widget> </widget>
</child> </child>
<child> <child>

View File

@@ -50,13 +50,13 @@ class MainController(Controller):
widgets = ( widgets = (
"discs","files", "discs","files",
'save1','save_as1','cut1','copy1','paste1','delete1','add_cd','add_directory1', 'save1','save_as1','cut1','copy1','paste1','delete1','add_cd','add_directory1',
'tb_save','tb_addcd','tb_find','nb_dirs','description', 'tb_save','tb_addcd','tb_find','nb_dirs','description','stat1',
) )
widgets_all = ( widgets_all = (
"discs","files", "discs","files",
'file1','edit1','add_cd','add_directory1','help1', 'file1','edit1','add_cd','add_directory1','help1',
'tb_save','tb_addcd','tb_find','tb_new','tb_open','tb_quit', 'tb_save','tb_addcd','tb_find','tb_new','tb_open','tb_quit',
'nb_dirs','description', 'nb_dirs','description','stat1',
) )
widgets_cancel = ('cancel','cancel1') widgets_cancel = ('cancel','cancel1')
@@ -207,6 +207,20 @@ class MainController(Controller):
def on_save_as1_activate(self, widget): def on_save_as1_activate(self, widget):
self.__save_as() self.__save_as()
def on_stat1_activate(self, menu_item):
self.__show_stats()
def on_statistics1_activate(self, menu_item):
model = self.view['discs'].get_model()
try:
path, column = self.view['discs'].get_cursor()
selected_iter = self.model.discs_tree.get_iter(path)
except:
return
selected_id = self.model.discs_tree.get_value(selected_iter, 0)
self.__show_stats(selected_id)
def on_tb_open_clicked(self, widget): def on_tb_open_clicked(self, widget):
self.__open() self.__open()
@@ -242,7 +256,7 @@ class MainController(Controller):
return False return False
if event.button == 3: if event.button == 3:
"""show context menu""" """Right mouse button. Show context menu."""
try: try:
selection = treeview.get_selection() selection = treeview.get_selection()
model, list_of_paths = selection.get_selected_rows() model, list_of_paths = selection.get_selected_rows()
@@ -286,10 +300,28 @@ class MainController(Controller):
self.view['discs'].collapse_all() self.view['discs'].collapse_all()
return return
def on_files_button_press_event(self, tree, event):
try:
path, column, x, y = tree.get_path_at_pos(int(event.x),
int(event.y))
except TypeError:
tree.get_selection().unselect_all()
return False
if event.button == 3: # Right mouse button. Show context menu.
try:
selection = tree.get_selection()
model, list_of_paths = selection.get_selected_rows()
except TypeError:
list_of_paths = []
self.__popup_files_menu(event)
return True
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
@@ -303,9 +335,9 @@ class MainController(Controller):
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 iterator" print "c_main.py: on_files_cursor_changed() insufficient iterator"
return return
def on_files_key_release_event(self, a, event): def on_files_key_release_event(self, a, event):
@@ -376,6 +408,9 @@ class MainController(Controller):
self.__open(path) self.__open(path)
return return
def on_add_tag1_activate(self, menu_item):
print self.view['discs'].get_cursor()
def on_update1_activate(self, menu_item): def on_update1_activate(self, menu_item):
"""Update disc under cursor position""" """Update disc under cursor position"""
@@ -713,6 +748,12 @@ class MainController(Controller):
self.view['discs_popup'].show_all() self.view['discs_popup'].show_all()
return return
def __popup_files_menu(self, event):
self.view['files_popup'].popup(None, None, None, event.button,
event.time)
self.view['files_popup'].show_all()
return
def __generate_recent_menu(self): def __generate_recent_menu(self):
self.recent_menu = gtk.Menu() self.recent_menu = gtk.Menu()
for i in self.model.config.recent: for i in self.model.config.recent:
@@ -786,4 +827,8 @@ class MainController(Controller):
buff.insert_with_tags(iter, cloud['name'], tag) buff.insert_with_tags(iter, cloud['name'], tag)
self.view['tag_cloud_textview'].set_buffer(buff) self.view['tag_cloud_textview'].set_buffer(buff)
def __show_stats(self, selected_id=None):
data = self.model.get_stats(selected_id)
label = Dialogs.StatsDialog(data).run()
pass # end of class pass # end of class

View File

@@ -327,7 +327,97 @@ class MainModel(ModelMT):
self.discs_tree.remove(branch_iter) self.discs_tree.remove(branch_iter)
return return
def get_stats(self, selected_id):
"""get statistic information"""
retval = {}
if selected_id:
sql = """select id, type, parent_id from files where id=?"""
self.db_cursor.execute(sql, (selected_id,))
res = self.db_cursor.fetchone()
if not res:
return retval
selected_item = {'id':res[0], 'type':res[1], 'parent': res[2]}
# collect all parent_id's
parents = []
def _recurse(fid):
parents.append(fid)
sql = """select id from files where type=? and parent_id=? and parent_id!=1"""
self.db_cursor.execute(sql, (self.DIR, fid))
res = self.db_cursor.fetchall()
if res:
for row in res:
_recurse(row[0])
_recurse(selected_id)
if selected_item['parent'] == 1:
parents.pop(0)
retval['discs'] = 1
retval['dirs'] = len(parents)
parents.append(selected_id)
files_count = 0
for p in parents:
sql = """select count(id) from files where type!=0 and type!=1 and parent_id=?"""
self.db_cursor.execute(sql, (p,))
res = self.db_cursor.fetchone()
if res:
files_count+=res[0]
retval['files'] = files_count
sql = """select size from files where id=?"""
self.db_cursor.execute(sql, (selected_id,))
res = self.db_cursor.fetchone()
if res:
retval['size'] = self.__bytes_to_human(res[0])
else:
sql = """select count(id) from files where parent_id=1 and type=1"""
self.db_cursor.execute(sql)
res = self.db_cursor.fetchone()
if res:
retval['discs'] = res[0]
sql = """select count(id) from files where parent_id!=1 and type=1"""
self.db_cursor.execute(sql)
res = self.db_cursor.fetchone()
if res:
retval['dirs'] = res[0]
sql = """select count(id) from files where parent_id!=1 and type!=1"""
self.db_cursor.execute(sql)
res = self.db_cursor.fetchone()
if res:
retval['files'] = res[0]
sql = """select sum(size) from files where parent_id=1 and type=1"""
self.db_cursor.execute(sql)
res = self.db_cursor.fetchone()
if res:
retval['size'] = self.__bytes_to_human(res[0])
return retval
# private class functions # private class functions
def __bytes_to_human(self, integer):
if integer <= 0 or integer < 1024:
return "%d bytes" % integer
t = integer /1024.0
if t < 1 or t < 1024:
return "%d bytes (%d kB)" % (integer, t)
t = t /1024.0
if t < 1 or t < 1024:
return "%d bytes (%d MB)" % (integer, t)
t = t /1024.0
if t < 1 or t < 1024:
return "%d bytes (%d GB)" % (integer, t)
t = t /1024.0
return "%d bytes (%d TB)" % (integer, t)
def __clear_trees(self): def __clear_trees(self):
self.__clear_files_tree() self.__clear_files_tree()
self.__clear_discs_tree() self.__clear_discs_tree()
@@ -396,23 +486,28 @@ class MainModel(ModelMT):
filename TEXT, filename TEXT,
filepath TEXT, filepath TEXT,
date datetime, date datetime,
size integer, size INTEGER,
type integer, type INTEGER,
source integer, source INTEGER,
size_x integer, note TEXT,
size_y integer,
filetype integer,
description 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, group_id INTEGER,
tag TEXT);""") tag TEXT);""")
self.db_cursor.execute("""create table
tags_files(file_id INTEGER,
tag_id INTEGER);""")
self.db_cursor.execute("""create table
groups(id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
color 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,
filename TEXT);""") filename TEXT);""")
self.db_cursor.execute("insert into files values(1, 1, 'root', null, \ self.db_cursor.execute("insert into files values(1, 1, 'root', null, 0, 0, 0, 0, null, null, null, null);")
0, 0, 0, 0, null, null, null, null);") self.db_cursor.execute("insert into groups values(1, 'default', 'black');")
def __scan(self): def __scan(self):
"""scan content of the given path""" """scan content of the given path"""
@@ -496,36 +591,32 @@ class MainModel(ModelMT):
#return -1 #return -1
return 0 return 0
#############
# directories
for i in dirs: for i in dirs:
if self.fsenc: j = self.__decode_filename(i)
j = i.decode(self.fsenc) current_dir = os.path.join(root, i)
else:
j = i
try: try:
st = os.stat(os.path.join(root,i)) st = os.stat(current_dir)
st_mtime = st.st_mtime st_mtime = st.st_mtime
except OSError: except OSError:
st_mtime = 0 st_mtime = 0
# do NOT follow symbolic links # do NOT follow symbolic links
if os.path.islink(os.path.join(root,i)): if os.path.islink(current_dir):
l = os.readlink(os.path.join(root,i)) l = self.__decode_filename(os.readlink(current_dir))
if self.fsenc:
l = l.decode(self.fsenc)
else:
l = l
sql = """ sql = """
insert into files(parent_id, filename, filepath, date, size, type) insert into files(parent_id, filename, filepath, date, size, type)
values(?,?,?,?,?,?) values(?,?,?,?,?,?)
""" """
db_cursor.execute(sql, (currentid, j + " -> " + l, db_cursor.execute(sql, (currentid, j + " -> " + l,
os.path.join(path,i), st_mtime, 0, ocurrent_dir, st_mtime, 0,
self.LIN)) self.LIN))
dirsize = 0 dirsize = 0
else: else:
dirsize = __recurse(currentid, j, os.path.join(path,i), dirsize = __recurse(currentid, j, current_dir,
st_mtime, 0, self.DIR, myit) st_mtime, 0, self.DIR, myit)
if dirsize == -1: if dirsize == -1:
@@ -533,13 +624,17 @@ class MainModel(ModelMT):
else: else:
_size = _size + dirsize _size = _size + dirsize
########
# files:
for i in files: for i in files:
if self.abort: if self.abort:
break break
self.count = self.count + 1 self.count = self.count + 1
current_path = os.path.join(root,i) current_file = os.path.join(root, i)
try: try:
st = os.stat(current_path) st = os.stat(current_file)
st_mtime = st.st_mtime st_mtime = st.st_mtime
st_size = st.st_size st_size = st.st_size
except OSError: except OSError:
@@ -547,15 +642,23 @@ class MainModel(ModelMT):
st_size = 0 st_size = 0
_size = _size + st_size _size = _size + st_size
j = i j = self.__decode_filename(i)
if self.fsenc:
j = i.decode(self.fsenc)
# do NOT follow symbolic links
if os.path.islink(current_file):
l = self.__decode_filename(os.readlink(current_file))
sql = """insert into files(parent_id, filename, filepath,
date, size, type)
values(?,?,?,?,?,?)"""
db_cursor.execute(sql, (currentid, j + " -> " + l,
current_file, st_mtime, 0,
self.LIN))
else:
sql = """ sql = """
insert into files(parent_id, filename, filepath, date, size, type) insert into files(parent_id, filename, filepath, date, size, type)
values(?,?,?,?,?,?) values(?,?,?,?,?,?)
""" """
db_cursor.execute(sql, (currentid, j, os.path.join(path,i), db_cursor.execute(sql, (currentid, j, current_file,
st_mtime, st_size, self.FIL)) st_mtime, st_size, self.FIL))
if self.count % 32 == 0: if self.count % 32 == 0:
@@ -575,7 +678,7 @@ class MainModel(ModelMT):
# Images - thumbnails and exif data # Images - thumbnails and exif data
if self.config.confd['thumbs'] and ext in self.IMG: if self.config.confd['thumbs'] and ext in self.IMG:
path, exif, ret_code = Thumbnail(current_path, base=self.internal_dirname).save(fileid) path, exif, ret_code = Thumbnail(current_file, base=self.internal_dirname).save(fileid)
if ret_code != -1: if ret_code != -1:
sql = """insert into thumbnails(file_id, filename) values (?, ?)""" sql = """insert into thumbnails(file_id, filename) values (?, ?)"""
db_cursor.execute(sql, (fileid, db_cursor.execute(sql, (fileid,
@@ -588,7 +691,7 @@ class MainModel(ModelMT):
# Extensions - user defined actions # Extensions - user defined actions
if ext in self.config.confd['extensions'].keys(): if ext in self.config.confd['extensions'].keys():
cmd = self.config.confd['extensions'][ext] cmd = self.config.confd['extensions'][ext]
arg = string.replace(current_path, '"', '\\"') arg = string.replace(current_file, '"', '\\"')
output = os.popen(cmd % arg).readlines() output = os.popen(cmd % arg).readlines()
desc = '' desc = ''
for line in output: for line in output:
@@ -602,7 +705,7 @@ class MainModel(ModelMT):
# info = filetypeHelper.guess_video(os.path.join(root,i)) # info = filetypeHelper.guess_video(os.path.join(root,i))
### end of scan ### end of scan
if update: if update:
self.statusmsg = "Scannig: %s" % current_path self.statusmsg = "Scannig: %s" % current_file
self.progress = step * self.count self.progress = step * self.count
sql = """update files set size=? where id=?""" sql = """update files set size=? where id=?"""
@@ -695,34 +798,53 @@ class MainModel(ModelMT):
return return
def __remove_branch_form_db(self, root_id): def __remove_branch_form_db(self, root_id):
parent_ids = [root_id,] """Remove subtree from main tree, remove tags from database
sql = """select id from files where parent_id = ? and type = 1""" remove all possible data, like thumbnails"""
self.db_cursor.execute(sql, (root_id,)) fids = []
ids = self.db_cursor.fetchall()
def get_children(fid): def get_children(fid):
parent_ids.append(fid) fids.append(fid)
sql = """select id from files where parent_id = ? and type = 1""" sql = """select id from files where parent_id = ?"""
self.db_cursor.execute(sql, (fid,)) self.db_cursor.execute(sql, (fid,))
res = self.db_cursor.fetchall() res = self.db_cursor.fetchall()
if len(res)>0:
for i in res: for i in res:
get_children(i[0]) get_children(i[0])
for i in ids: get_children(root_id)
get_children(i[0])
def generator(): def generator():
for c in parent_ids: for c in fids:
yield (c,) yield (c,)
sql = """delete from files where type = 1 and parent_id = ?""" # remove files records
self.db_cursor.executemany(sql, generator())
sql = """delete from files where id = ?""" sql = """delete from files where id = ?"""
self.db_cursor.executemany(sql, generator()) self.db_cursor.executemany(sql, generator())
# remove tags records
sql = """delete from tags_files where file_id = ?"""
self.db_cursor.executemany(sql, generator())
# remove thumbnails
arg =''
for c in fids:
if len(arg) > 0:
arg+=", %d" % c
else:
arg = "%d" % c
sql = """select filename from thumbnails where file_id in (%s)""" % arg
self.db_cursor.execute(sql)
res = self.db_cursor.fetchall()
if len(res) > 0:
for fn in res:
os.unlink(os.path.join(self.internal_dirname, fn[0]))
# remove thumbs records
sql = """delete from thumbnails where file_id = ?"""
self.db_cursor.executemany(sql, generator())
self.db_connection.commit() self.db_connection.commit()
return return
def __append_added_volume(self): def __append_added_volume(self):
"""append branch from DB to existing tree model""" """append branch from DB to existing tree model"""
#connect #connect
@@ -762,4 +884,10 @@ class MainModel(ModelMT):
db_connection.close() db_connection.close()
return return
def __decode_filename(self, txt):
if self.fsenc:
return txt.decode(self.fsenc)
else:
return txt
pass # end of class pass # end of class

View File

@@ -276,3 +276,45 @@ class LoadDBFile(object):
a = Err("Error - pyGTKtalog","File doesn't exist.","The file that you choose does not exist. Choose another one, or cancel operation.") a = Err("Error - pyGTKtalog","File doesn't exist.","The file that you choose does not exist. Choose another one, or cancel operation.")
ch = True ch = True
res,filename = self.show_dialog() res,filename = self.show_dialog()
class StatsDialog(object):
"""Sepcific dialog for display stats"""
def __init__(self, values={}):
self.gladefile = os.path.join(utils.globals.GLADE_DIR, "dialogs.glade")
self.values = values
def run(self):
gladexml = gtk.glade.XML(self.gladefile, "statDialog")
dialog = gladexml.get_widget("statDialog")
if self.values.has_key('discs'):
entry = gladexml.get_widget("discs_entry")
entry.set_text(str(self.values['discs']))
else:
label = gladexml.get_widget("discs_label")
entry = gladexml.get_widget("discs_entry")
label.hide()
entry.hide()
if self.values.has_key('dirs'):
entry = gladexml.get_widget("dirs_entry")
entry.set_text(str(self.values['dirs']))
else:
label = gladexml.get_widget("dirs_label")
entry = gladexml.get_widget("dirs_entry")
label.hide()
entry.hide()
if self.values.has_key('files'):
entry = gladexml.get_widget("files_entry")
entry.set_text(str(self.values['files']))
if self.values.has_key('size'):
entry = gladexml.get_widget("size_entry")
entry.set_text(str(self.values['size']))
result = dialog.run()
dialog.destroy()
if result == gtk.RESPONSE_OK:
return entry.get_text()
return None