[gedit-latex] Fix the bibliography preview feature rendering
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-latex] Fix the bibliography preview feature rendering
- Date: Fri, 24 Jun 2011 05:50:36 +0000 (UTC)
commit 11e529d006a081e77e4236e4aa6389d640643372
Author: John Stowers <john stowers gmail com>
Date: Fri Jun 24 17:07:23 2011 +1200
Fix the bibliography preview feature rendering
latex/latex/dialogs.py | 9 +--
latex/latex/preview.py | 6 +-
latex/ui/use_bibliography_dialog.ui | 150 +++++++++++++++++++++++------------
3 files changed, 103 insertions(+), 62 deletions(-)
---
diff --git a/latex/latex/dialogs.py b/latex/latex/dialogs.py
index 1d5977f..491e472 100644
--- a/latex/latex/dialogs.py
+++ b/latex/latex/dialogs.py
@@ -623,14 +623,9 @@ class UseBibliographyDialog(GladeInterface, PreviewRenderer):
recent = 0
self._comboStyle.set_active(recent)
-
- self._imagePreview = Gtk.Image()
+ self._imagePreview = self.find_widget("previewimage")
self._imagePreview.show()
-
- scrollPreview = self.find_widget("scrollPreview")
- scrollPreview.add_with_viewport(self._imagePreview)
-
-
+
self.connect_signals({ "on_buttonRefresh_clicked" : self._on_refresh_clicked })
return self.dialog
diff --git a/latex/latex/preview.py b/latex/latex/preview.py
index 73919f1..2f89813 100644
--- a/latex/latex/preview.py
+++ b/latex/latex/preview.py
@@ -28,6 +28,7 @@ from ..tools.postprocess import RubberPostProcessor, GenericPostProcessor
from ..issues import MockStructuredIssueHandler
from environment import Environment
+from gi.repository import Gdk, GdkPixbuf
class ImageToolGenerator(object):
"""
@@ -101,11 +102,8 @@ class ImageToolGenerator(object):
return tool
-from gi.repository import Gdk
-
from tempfile import NamedTemporaryFile
-
class PreviewRenderer(ToolRunner):
def render(self, source):
"""
@@ -164,4 +162,4 @@ class PreviewRenderer(ToolRunner):
The rendering process has failed
"""
-
\ No newline at end of file
+
diff --git a/latex/ui/use_bibliography_dialog.ui b/latex/ui/use_bibliography_dialog.ui
index 65cd9fb..88ba7df 100644
--- a/latex/ui/use_bibliography_dialog.ui
+++ b/latex/ui/use_bibliography_dialog.ui
@@ -1,51 +1,106 @@
-<?xml version="1.0"?>
-<!--Generated with glade3 3.4.5 on Sun Dec 28 22:24:49 2008 -->
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
+ <!-- interface-requires gtk+ 2.12 -->
<object class="GtkDialog" id="dialogUseBibliography">
+ <property name="can_focus">False</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">5</property>
<property name="title" translatable="yes">Use Bibliography</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="window_position">center-on-parent</property>
<property name="default_width">400</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
- <property name="has_separator">False</property>
+ <property name="type_hint">dialog</property>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox2">
+ <object class="GtkBox" id="dialog-vbox2">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</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">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button3">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_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="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</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">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel" id="label14">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Bibliography _File:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">TreeViewFiles</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkFileChooserButton" id="filechooserbutton">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="preview_widget_active">False</property>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label15">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Style:</property>
@@ -54,15 +109,17 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="comboboxStyle">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="has_entry">True</property>
<property name="entry_text_column">0</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child internal-child="entry">
<object class="GtkEntry" id="comboboxentry-entry1">
<property name="visible">True</property>
@@ -73,47 +130,61 @@
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
+ <property name="can_focus">False</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">5</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">1</property>
<property name="label" translatable="yes">Style Preview:</property>
</object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<object class="GtkButton" id="buttonRefresh">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip-text" translatable="yes">Refresh Style Preview</property>
- <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="tooltip_text" translatable="yes">Refresh Style Preview</property>
+ <property name="use_action_appearance">False</property>
+ <property name="relief">none</property>
<property name="focus_on_click">False</property>
- <signal handler="on_buttonRefresh_clicked" name="clicked"/>
+ <signal name="clicked" handler="on_buttonRefresh_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="stock">gtk-refresh</property>
- <property name="icon_size">2</property>
+ <property name="icon-size">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
+ <property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
@@ -121,60 +192,37 @@
<object class="GtkScrolledWindow" id="scrollPreview">
<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>
<child>
- <placeholder/>
+ <object class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkImage" id="previewimage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area2">
- <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>
- <object class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="label" translatable="yes">gtk-cancel</property>
- <property name="use_stock">True</property>
- </object>
- </child>
- <child>
- <object class="GtkButton" id="button3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_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="label" translatable="yes">gtk-ok</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
</child>
<action-widgets>
- <action-widget response="0">buttonRefresh</action-widget>
<action-widget response="0">button1</action-widget>
<action-widget response="1">button3</action-widget>
</action-widgets>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]