--- /dev/null
+/**
+ * \file GErrorList.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author John Spray
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "GErrorList.h"
+#include "ControlErrorList.h"
+
+#include "ghelpers.h"
+
+using std::string;
+
+namespace lyx {
+namespace frontend {
+
+GErrorList::GErrorList(Dialog & parent)
+ : GViewCB<ControlErrorList, GViewGladeB>(parent, _("Errors"), false)
+{}
+
+
+void GErrorList::doBuild()
+{
+ string const gladeName = findGladeFile("errors");
+ xml_ = Gnome::Glade::Xml::create(gladeName);
+
+ Gtk::Button * closebutton;
+ xml_->get_widget("Close", closebutton);
+ setCancel(closebutton);
+
+ xml_->get_widget("ErrorList", errlistview_);
+ listCols_.add(listCol_);
+ listCols_.add(listColIndex_);
+ errliststore_ = Gtk::ListStore::create(listCols_);
+ errlistview_->set_model(errliststore_);
+ errlistview_->append_column("Error", listCol_);
+ errlistsel_ = errlistview_->get_selection();
+
+ xml_->get_widget("ErrorDescription", errdescview_);
+
+ errlistsel_->signal_changed().connect(
+ sigc::mem_fun(*this, &GErrorList::onErrListSelection));
+}
+
+
+void GErrorList::update()
+{
+ setTitle(controller().name());
+ updateContents();
+}
+
+
+void GErrorList::onErrListSelection()
+{
+ int const choice =
+ (*errlistsel_->get_selected())[listColIndex_];
+
+ ErrorList const & errors = controller().errorList();
+ errdescview_->get_buffer()->set_text(errors[choice].description);
+}
+
+
+void GErrorList::updateContents()
+{
+ errliststore_->clear();
+ ErrorList const & errors = controller().errorList();
+ if (errors.empty()) {
+ (*errliststore_->append())[listCol_] = _("*** No Errors ***");
+ errlistview_->set_sensitive(false);
+ return;
+ }
+
+ errlistview_->set_sensitive(true);
+
+ ErrorList::const_iterator cit = errors.begin();
+ ErrorList::const_iterator end = errors.end();
+ for (int rowindex = 0; cit != end; ++cit, ++rowindex) {
+ Gtk::ListStore::Row row = *errliststore_->append();
+ if (rowindex == 0)
+ errlistsel_->select(*row);
+
+ (*row)[listCol_] = cit->error;
+ (*row)[listColIndex_] = rowindex;
+ }
+}
+
+} // namespace frontend
+} // namespace lyx
--- /dev/null
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkDialog" id="dialog">
+ <property name="border_width">6</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="default_width">400</property>
+ <property name="default_height">300</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">False</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <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="Close">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</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">-7</property>
+ <accelerator key="Escape" modifiers="0" signal="clicked"/>
+ </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>
+ <widget class="GtkVPaned" id="vpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <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="ErrorList">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="shrink">True</property>
+ <property name="resize">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</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="GtkTextView" id="ErrorDescription">
+ <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>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>