Added FormCredits dialog (MVC version) by Michael Koziarski.

Fixed some minor bugs in the MVC support in gnome.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1852 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Baruch Even 2001-03-29 14:47:17 +00:00
parent 86de16951b
commit a266390f64
8 changed files with 320 additions and 4 deletions

View File

@ -1,3 +1,22 @@
2001-03-29 Baruch Even <baruch@lyx.org>
* FormUrl.C (d-tor):
* FormCredits.C (d-tor): Removed the dialog_->destroy(), it was causing
crashes on exit.
* GnomeBase.C (d-tor): Added a check for times when the xml wasn't loaded.
2001-03-29 Michael Koziarski <michael@koziarski.org>
* Dialogs.C: Uncommented FormCredits in the #include and instantiate it.
* Makefile.am: Added FormCredits.[Ch]
* FormCredits.[Ch]: Created FormCredits dialog using libglade
approach. Text needs to be formatted still.
* dialogs/diahelpcredits.glade: Created file.
2001-03-26 Baruch Even <baruch@lyx.org>
* Various files: Fixes to get the gnome frontend to compile again.

View File

@ -32,13 +32,14 @@
#include "GUI.h"
#include "FormUrl.h"
#include "FormCredits.h"
/*
#include "FormBibitem.h"
#include "FormBibtex.h"
#include "FormCharacter.h"
#include "FormCitation.h"
#include "FormCopyright.h"
#include "FormCredits.h"
#include "FormLog.h"
#include "FormVCLog.h"
@ -70,6 +71,8 @@ SigC::Signal0<void> Dialogs::redrawGUI;
Dialogs::Dialogs(LyXView * lv)
{
add(new GUIUrl<FormUrl, gnomeBC>(*lv, *this));
add(new GUICredits<FormCredits, gnomeBC>(*lv, *this));
/*
splash_.reset(new FormSplash(lv, this));
@ -78,7 +81,6 @@ Dialogs::Dialogs(LyXView * lv)
add(new GUICharacter<FormCharacter, xformsBC>(*lv, *this));
//add(new GUICitation<FormCitation, xformsBC>(*lv, *this));
//add(new GUICopyright<FormCopyright, xformsBC>(*lv, *this));
add(new GUICredits<FormCredits, xformsBC>(*lv, *this));
add(new GUILog<FormLog, xformsBC>(*lv, *this));
add(new GUIVCLog<FormVCLog, xformsBC>(*lv, *this));

View File

@ -0,0 +1,92 @@
// -*- C++ -*-
/* This file is part of
* =================================================
*
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
* =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
*/
#ifdef __GNUG__
#pragma implementation
#endif
#include <config.h>
#include "gnomeBC.h"
#include "FormCredits.h"
#include <gnome--/dialog.h>
#include <gtk--/button.h>
#include <gtk--/text.h>
FormCredits::FormCredits(ControlCredits & c)
: FormCB<ControlCredits>(c, "diahelpcredits.glade", "DiaHelpCredits")
, dialog_(0)
{
}
FormCredits::~FormCredits()
{
//dialog_->destroy();
}
void FormCredits::build()
{
dialog_ = dialog();
// It is better to show an OK button, but the policy require that we
// got a click on "Cancel"
ok()->clicked.connect(SigC::slot(this, &FormCredits::CancelClicked));
std::stringstream ss;
text()->insert(controller().getCredits(ss).str());
}
void FormCredits::show()
{
if (!dialog_)
build();
update();
dialog_->show();
}
void FormCredits::hide()
{
dialog_->hide();
}
void FormCredits::apply()
{
}
void FormCredits::update()
{
}
Gnome::Dialog * FormCredits::dialog()
{
return getWidget<Gnome::Dialog>("DiaHelpCredits");
}
Gtk::Text * FormCredits::text()
{
return getWidget<Gtk::Text>("credits_text");
}
Gtk::Button * FormCredits::ok()
{
return getWidget<Gtk::Button>("credits_button_ok");
}

View File

@ -0,0 +1,68 @@
// -*- C++ -*-
/* This file is part of
* =================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
* =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
* */
#ifndef FORMCREDITS_H
#define FORMCREDITS_H
#ifdef __GNUG__
#pragma interface
#endif
#include "ControlCredits.h"
#include "GnomeBase.h"
namespace Gnome {
class Dialog;
}
namespace Gtk {
class Button;
class Text;
}
/**
* This class implements the dialog to show the credits.
*/
class FormCredits : public FormCB<ControlCredits> {
public:
///
FormCredits(ControlCredits & c);
///
~FormCredits();
void apply();
void hide();
void show();
void update();
private:
/// Build the dialog
void build();
/// get the dialog
Gnome::Dialog * dialog();
void CancelClicked() { CancelButton(); }
/// The ok button
Gtk::Button * ok();
Gtk::Text * text();
// Hold the dialog.
Gnome::Dialog * dialog_;
};
#endif

View File

@ -34,7 +34,7 @@ FormUrl::~FormUrl()
// Note that there is no need to destroy the class itself, it seems
// like everything is managed inside it. Deleting the class itself will
// a crash at the end of the program.
dialog_->destroy();
//dialog_->destroy();
}

View File

@ -25,7 +25,8 @@ GnomeBase::GnomeBase(ControlBase & c, string const & glade_file, string const &
GnomeBase::~GnomeBase()
{
gtk_object_unref(GTK_OBJECT(xml_));
if (xml_)
gtk_object_unref(GTK_OBJECT(xml_));
}

View File

@ -81,6 +81,8 @@ libgnome_la_SOURCES = \
pixbutton.h \
GnomeBase.C \
GnomeBase.h \
FormCredits.C \
FormCredits.h \
FormUrl.C \
FormUrl.h

View File

@ -0,0 +1,132 @@
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>diahelpcredits</name>
<program_name>diahelpcredits</program_name>
<directory></directory>
<source_directory></source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>True</use_widget_names>
<output_main_file>False</output_main_file>
<output_build_files>False</output_build_files>
<gnome_help_support>True</gnome_help_support>
<main_source_file>diahelpcredits_interface.c</main_source_file>
<main_header_file>diahelpcredits_interface.h</main_header_file>
<handler_source_file>diahelpcredits_callbacks.c</handler_source_file>
<handler_header_file>diahelpcredits_callbacks.h</handler_header_file>
</project>
<widget>
<class>GnomeDialog</class>
<name>DiaHelpCredits</name>
<type>GTK_WINDOW_DIALOG</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<default_height>300</default_height>
<allow_shrink>True</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>False</auto_close>
<hide_on_close>True</hide_on_close>
<widget>
<class>GtkVBox</class>
<child_name>GnomeDialog:vbox</child_name>
<name>dialog-vbox3</name>
<homogeneous>False</homogeneous>
<spacing>8</spacing>
<child>
<padding>4</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
<name>dialog-action_area3</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<pack>GTK_PACK_END</pack>
</child>
<widget>
<class>GtkButton</class>
<name>credits_button_ok</name>
<can_default>True</can_default>
<has_default>True</has_default>
<can_focus>True</can_focus>
<has_focus>True</has_focus>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
</widget>
<widget>
<class>GtkVBox</class>
<name>vbox4</name>
<homogeneous>False</homogeneous>
<spacing>0</spacing>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkLabel</class>
<name>label8</name>
<label>All these people have contributed to the LyX project, Thanks,
Matthias</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkScrolledWindow</class>
<name>scrolledwindow1</name>
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
<widget>
<class>GtkText</class>
<name>credits_text</name>
<can_focus>True</can_focus>
<editable>False</editable>
<text>
</text>
</widget>
</widget>
</widget>
</widget>
</widget>
</GTK-Interface>