initial commit for new history window

This commit is contained in:
Nikos Kouremenos 2005-11-20 18:38:34 +00:00
parent c430eb9098
commit c21690e05b
2 changed files with 160 additions and 177 deletions

View file

@ -9052,12 +9052,11 @@ Custom</property>
</widget>
<widget class="GtkWindow" id="history_window">
<property name="border_width">6</property>
<property name="title" translatable="yes">Conversation History</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">560</property>
<property name="default_width">600</property>
<property name="default_height">350</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
@ -9070,13 +9069,91 @@ Custom</property>
<signal name="destroy" handler="on_history_window_destroy" last_modification_time="Tue, 01 Mar 2005 16:30:31 GMT"/>
<child>
<widget class="GtkVBox" id="vbox24">
<widget class="GtkVBox" id="vbox">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox11">
<widget class="GtkHPaned" id="hpaned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="position">150</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow44">
<property name="visible">True</property>
<property name="can_focus">True</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>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="shrink">True</property>
<property name="resize">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow16">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="history_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="shrink">True</property>
<property name="resize">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">6</property>
@ -9091,7 +9168,7 @@ Custom</property>
<signal name="clicked" handler="on_earliest_button_clicked" last_modification_time="Tue, 01 Mar 2005 16:20:43 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment23">
<widget class="GtkAlignment" id="alignment98">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@ -9103,13 +9180,13 @@ Custom</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox33">
<widget class="GtkHBox" id="hbox3000">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image146">
<widget class="GtkImage" id="image1272">
<property name="visible">True</property>
<property name="stock">gtk-goto-first</property>
<property name="icon_size">4</property>
@ -9126,9 +9203,9 @@ Custom</property>
</child>
<child>
<widget class="GtkLabel" id="label132">
<widget class="GtkLabel" id="label368">
<property name="visible">True</property>
<property name="label" translatable="yes">_Earliest</property>
<property name="label">REMOVEME</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -9166,7 +9243,7 @@ Custom</property>
<signal name="clicked" handler="on_previous_button_clicked" last_modification_time="Tue, 01 Mar 2005 16:20:53 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment22">
<widget class="GtkAlignment" id="alignment99">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@ -9178,13 +9255,13 @@ Custom</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox32">
<widget class="GtkHBox" id="hbox3001">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image145">
<widget class="GtkImage" id="image1273">
<property name="visible">True</property>
<property name="stock">gtk-go-back</property>
<property name="icon_size">4</property>
@ -9201,9 +9278,9 @@ Custom</property>
</child>
<child>
<widget class="GtkLabel" id="label131">
<widget class="GtkLabel" id="label369">
<property name="visible">True</property>
<property name="label" translatable="yes">_Previous</property>
<property name="label">REMOVEME</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -9236,11 +9313,73 @@ Custom</property>
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-go-forward</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_forward_button_clicked" last_modification_time="Tue, 01 Mar 2005 16:21:00 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment101">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox3003">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1275">
<property name="visible">True</property>
<property name="stock">gtk-media-forward</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label371">
<property name="visible">True</property>
<property name="label">REMOVEME</property>
<property name="use_underline">True</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">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
@ -9254,7 +9393,7 @@ Custom</property>
<signal name="clicked" handler="on_latest_button_clicked" last_modification_time="Tue, 01 Mar 2005 16:21:09 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment24">
<widget class="GtkAlignment" id="alignment100">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
@ -9266,13 +9405,13 @@ Custom</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox34">
<widget class="GtkHBox" id="hbox3002">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image147">
<widget class="GtkImage" id="image1274">
<property name="visible">True</property>
<property name="stock">gtk-goto-last</property>
<property name="icon_size">4</property>
@ -9289,9 +9428,9 @@ Custom</property>
</child>
<child>
<widget class="GtkLabel" id="label133">
<widget class="GtkLabel" id="label370">
<property name="visible">True</property>
<property name="label" translatable="yes">_Latest</property>
<property name="label">REMOVEME</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -9332,136 +9471,6 @@ Custom</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow16">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="history_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_WORD</property>
<property name="cursor_visible">False</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes"></property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="filter_hbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label363">
<property name="visible">True</property>
<property name="label" translatable="yes">Filter:</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">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="filter_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_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">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="apply_filter_button">
<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="label">gtk-apply</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_apply_filter_button_clicked" last_modification_time="Mon, 31 Oct 2005 20:52:08 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="clear_filter_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-clear</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_clear_filter_button_clicked" last_modification_time="Mon, 31 Oct 2005 20:52:32 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>

View file

@ -55,12 +55,6 @@ class HistoryWindow:
self.previous_button = xml.get_widget('previous_button')
self.forward_button = xml.get_widget('forward_button')
self.latest_button = xml.get_widget('latest_button')
self.filter_entry = xml.get_widget('filter_entry')
# FIXME: someday..
filter_hbox = xml.get_widget('filter_hbox')
filter_hbox.hide()
filter_hbox.set_no_show_all(True)
xml.signal_autoconnect(self)
@ -95,26 +89,6 @@ class HistoryWindow:
def on_close_button_clicked(self, widget):
self.window.destroy()
def on_apply_filter_button_clicked(self, widget):
filter = self.filter_entry.get_text()
if len(filter) < 3:
dialogs.ErrorDialog(_('Filter query too short'),
_('Query must be at least 3 characters long.')).get_response()
return
# FIXME: what if jid is fake (pm)?
path_to_file = os.path.join(gajim.LOGPATH, self.jid)
# FIXME: ship grep.exe for windoz?
command = 'grep %s %s' % (filter, path_to_file)
stdout = helpers.get_output_of_command(command)
if stdout is not None:
text = ' '.join(stdout)
self.history_buffer.set_text(text)
def on_clear_filter_button_clicked(self, widget):
pass
# FIXME: reread from scratch (if it's possible to save current page it's even better)
def on_earliest_button_clicked(self, widget):
start, end = self.history_buffer.get_bounds()
self.history_buffer.delete(start, end)