Changes Dialog for gnome frontend.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6110 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Michael Gerz 2003-02-12 06:10:42 +00:00
parent e9cc35010f
commit c24e9194af
8 changed files with 549 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-02-12 Michael A. Koziarski <michael@koziarski.com>
* GChanges.C
* GChanges.h
* dialogs/GChanges.glade: implement the Changes dialog
2003-02-01 Michael A. Koziarski <michael@koziarski.org>
Major changes to make the gnome frontend compile and work again.

View File

@ -49,6 +49,7 @@ Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
bibitem(lv, d),
bibtex(lv, d),
character(lv, d),
changes(lv, d),
citation(lv, d),
document(lv, d),
error(lv, d),

View File

@ -144,6 +144,10 @@ void Dialogs::showMathPanel()
pimpl_->mathpanel.controller().show();
}
void Dialogs::showMergeChanges()
{
pimpl_->changes.controller().show();
}
void Dialogs::showMinipage(InsetMinipage * im)
{

View File

@ -45,6 +45,9 @@
#include "FormCitation.h"
#include "forms/form_citation.h"
#include "ControlChanges.h"
#include "GChanges.h"
#include "ControlDocument.h"
#include "FormDocument.h"
#include "forms/form_document.h"
@ -167,6 +170,9 @@ BibtexDialog;
typedef GUI<ControlCharacter, FormCharacter, OkApplyCancelReadOnlyPolicy, xformsBC>
CharacterDialog;
typedef GUI<ControlChanges, GChanges, NoRepeatedApplyReadOnlyPolicy, gnomeBC>
ChangesDialog;
typedef GUI<ControlCitation, FormCitation, NoRepeatedApplyReadOnlyPolicy, xformsBC>
CitationDialog;
@ -266,6 +272,7 @@ struct Dialogs::Impl {
BibitemDialog bibitem;
BibtexDialog bibtex;
CharacterDialog character;
ChangesDialog changes;
CitationDialog citation;
DocumentDialog document;
ErrorDialog error;

View File

@ -0,0 +1,118 @@
/**
* \file GChanges.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Michael Koziarski
*
* Full author contact details are available in file CREDITS
*/
#ifdef __GNUG__
#pragma implementation
#endif
#include <config.h>
#include "gnomeBC.h"
#include "GChanges.h"
#include <gtkmm/button.h>
#include <gtkmm/textview.h>
#include <string>
GChanges::GChanges()
: GnomeCB<ControlChanges>("GChanges")
{}
GChanges::~GChanges()
{}
void GChanges::build()
{
// Connect the buttons.
cancel_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::CancelClicked));
accept_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::accept));
reject_btn()->signal_clicked().connect(SigC::slot(*this, &GChanges::reject));
bc().setCancel(cancel_btn());
// Manage the read-only aware widgets.
bc().addReadOnly(accept_btn());
bc().addReadOnly(cancel_btn());
bc().addReadOnly(reject_btn());
// Make sure everything is in the correct state.
bc().refresh();
}
void GChanges::connect_signals()
{}
void GChanges::disconnect_signals()
{}
void GChanges::accept()
{
controller().accept();
}
void GChanges::reject()
{
controller().reject();
}
void GChanges::apply()
{}
void GChanges::update()
{
using std::string;
disconnect_signals();
controller().find();
string text;
string author(controller().getChangeAuthor());
string date(controller().getChangeDate());
if (!author.empty())
text += "Change by " + author + "\n\n";
if (!date.empty())
text += "Change made at " + date + "\n";
changes()->get_buffer()->set_text(Glib::locale_to_utf8(text));
connect_signals();
}
bool GChanges::validate() const
{
return true;
}
Gtk::Button * GChanges::next_btn() const
{
return getWidget<Gtk::Button>("r_next_btn");
}
Gtk::Button * GChanges::cancel_btn() const
{
return getWidget<Gtk::Button>("r_cancel_btn");
}
Gtk::TextView * GChanges::changes() const
{
return getWidget<Gtk::TextView>("r_changes");
}
Gtk::Button * GChanges::accept_btn() const
{
return getWidget<Gtk::Button>("r_accept_btn");
}
Gtk::Button * GChanges::reject_btn() const
{
return getWidget<Gtk::Button>("r_reject_btn");
}

View File

@ -0,0 +1,69 @@
// -*- C++ -*-
/**
* \file GChanges.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Michael Koziarski
*
* Full author contact details are available in file CREDITS
*/
#ifndef GCHANGES_H
#define GCHANGES_H
#ifdef __GNUG__
#pragma interface
#endif
#include "ControlChanges.h"
#include "GnomeBase.h"
namespace Gtk {
class Button;
class TextView;
}
/**
* This class implements the dialog to Track changes
*/
class GChanges : public GnomeCB<ControlChanges> {
public:
///
GChanges();
///
~GChanges();
void apply();
void update();
private:
/// Build the dialog
void build();
/// Returns true if the dialog input is in a valid state.
bool validate() const;
/// Do the connection of signals
void connect_signals();
/// Disconnect the signals.
void disconnect_signals();
void reject();
void accept();
/// generated by accessors.py
Gtk::Button * next_btn() const;
/// generated by accessors.py
Gtk::Button * cancel_btn() const;
/// generated by accessors.py
Gtk::TextView * changes() const;
/// generated by accessors.py
Gtk::Button * accept_btn() const;
/// generated by accessors.py
Gtk::Button * reject_btn() const;
};
#endif

View File

@ -129,6 +129,8 @@ libgnome_la_SOURCES = \
FileDialog.C \
GAbout.C \
GAbout.h \
GChanges.C \
GChanges.h \
GError.C \
GError.h \
GERT.C \

View File

@ -0,0 +1,342 @@
<?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="GChanges">
<property name="title" translatable="yes">Changes</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="border_width">2</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="border_width">5</property>
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">10</property>
<child>
<widget class="GtkButton" id="r_next_btn">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-6</property>
<child>
<widget class="GtkAlignment" id="alignment3">
<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>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-go-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="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">_Next change</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>
</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>
<child>
<widget class="GtkButton" id="r_cancel_btn">
<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="response_id">-6</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>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">4</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">4</property>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">Change:</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>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<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_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTextView" id="r_changes">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</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>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_START</property>
<property name="spacing">12</property>
<child>
<widget class="GtkButton" id="r_accept_btn">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<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>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-yes</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="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Accept</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>
</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>
<child>
<widget class="GtkButton" id="r_reject_btn">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<child>
<widget class="GtkAlignment" id="alignment2">
<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>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-no</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="label2">
<property name="visible">True</property>
<property name="label" translatable="yes">_Reject</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>
</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>
</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">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>