Commit 0ec5e36d authored by Daniel Elstner's avatar Daniel Elstner
Browse files

:on_about): Replace custom about dialog with stock GTK+ one.

* src/mainwindow.{cc,h} (MainWindow::on_about): Replace custom
about dialog with stock GTK+ one.
(on_about_dialog_response): Rename from on_about_dialog_hide().
Add unused function parameter for the response ID.
* src/aboutdialog.{cc,h}: Remove now superfluous files.
* ui/aboutdialog.glade: Likewise.

* Makefile.am (src_regexxer_SOURCES): Remove src/aboutdialog.{cc,h}
from the list of source files.
(dist_pkgdata_DATA): Remove ui/aboutdialog.glade from list.
* configure.ac (REGEXXER_MODULES): Require gtkmm 2.6, in which the
stock about dialog first appeared.

* POTFILES.in: Remove ui/aboutdialog.glade.

svn path=/trunk/; revision=594
parent 84648b52
2007-01-06 Daniel Elstner <daniel.kitta@gmail.com>
* src/mainwindow.{cc,h} (MainWindow::on_about): Replace custom
about dialog with stock GTK+ one.
(on_about_dialog_response): Rename from on_about_dialog_hide().
Add unused function parameter for the response ID.
* src/aboutdialog.{cc,h}: Remove now superfluous files.
* ui/aboutdialog.glade: Likewise.
* Makefile.am (src_regexxer_SOURCES): Remove src/aboutdialog.{cc,h}
from the list of source files.
(dist_pkgdata_DATA): Remove ui/aboutdialog.glade from list.
* configure.ac (REGEXXER_MODULES): Require gtkmm 2.6, in which the
stock about dialog first appeared.
2007-01-06 Daniel Elstner <daniel.kitta@gmail.com>
* NEWS: Update.
......
......@@ -30,8 +30,6 @@ SUBDIRS = po
bin_PROGRAMS = src/regexxer
src_regexxer_SOURCES = \
src/aboutdialog.cc \
src/aboutdialog.h \
src/controller.cc \
src/controller.h \
src/filebuffer.cc \
......@@ -83,7 +81,7 @@ src_regexxer_DEPENDENCIES = src/exported-symbols
src_regexxer_LDFLAGS = $(REGEXXER_EXPORT_DYNAMIC) $(REGEXXER_VERSION_SCRIPT)
src_regexxer_LDADD = $(REGEXXER_MODULES_LIBS) $(POPT_LIBS) $(INTLLIBS)
dist_pkgdata_DATA = ui/aboutdialog.glade ui/mainwindow.glade ui/prefdialog.glade
dist_pkgdata_DATA = ui/mainwindow.glade ui/prefdialog.glade
iconthemedir = $(datadir)/icons/hicolor
appicondir = $(iconthemedir)/48x48/apps
......
......@@ -34,7 +34,7 @@ AC_SUBST([GETTEXT_PACKAGE], [regexxer])
AM_GLIB_GNU_GETTEXT()
PKG_CHECK_MODULES([REGEXXER_MODULES],
[gtkmm-2.4 >= 2.4.0 libglademm-2.4 >= 2.4.0 gconfmm-2.6 >= 2.6.1 libpcre >= 5.0])
[gtkmm-2.4 >= 2.6.0 libglademm-2.4 >= 2.4.0 gconfmm-2.6 >= 2.6.1 libpcre >= 5.0])
DK_PKG_PATH_PROG([GDK_PIXBUF_CSOURCE], [gdk-pixbuf-2.0], [gdk-pixbuf-csource])
DK_PKG_PATH_PROG([GTK_UPDATE_ICON_CACHE], [gtk+-2.0], [gtk-update-icon-cache])
......
2007-01-06 Daniel Elstner <daniel.kitta@gmail.com>
* POTFILES.in: Remove ui/aboutdialog.glade.
2007-01-06 Daniel Elstner <daniel.kitta@gmail.com>
* it.po: Replace my old email address with the one of the
......
......@@ -7,6 +7,5 @@ src/mainwindow.cc
src/pcreshell.cc
src/prefdialog.cc
src/statusline.cc
ui/aboutdialog.glade
ui/mainwindow.glade
ui/prefdialog.glade
/*
* Copyright (c) 2002-2007 Daniel Elstner <daniel.kitta@gmail.com>
*
* This file is part of regexxer.
*
* regexxer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* regexxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with regexxer; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "aboutdialog.h"
#include "globalstrings.h"
#include <glibmm/markup.h>
#include <gtkmm/dialog.h>
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <libglademm/xml.h>
#include <config.h>
namespace
{
const char *const package_title = "<span size=\"xx-large\" weight=\"heavy\">"
PACKAGE_STRING "</span>";
void apply_label_what_markup(Gtk::Label& label)
{
label.set_markup("<small>" + Glib::Markup::escape_text(label.get_text()) + "</small>");
}
} // anonymous namespace
namespace Regexxer
{
std::auto_ptr<Gtk::Dialog> AboutDialog::create(Gtk::Window& parent)
{
using Gnome::Glade::Xml;
const Glib::RefPtr<Xml> xml = Xml::create(glade_aboutdialog_filename);
Gtk::Dialog* aboutdialog = 0;
std::auto_ptr<Gtk::Dialog> dialog (xml->get_widget("aboutdialog", aboutdialog));
dialog->set_transient_for(parent);
dialog->signal_response().connect(sigc::hide(sigc::mem_fun(*dialog, &Gtk::Widget::hide)));
Gtk::Image* image = 0;
xml->get_widget("image", image)->set_from_icon_name("regexxer", Gtk::ICON_SIZE_DIALOG);
Gtk::Label* label = 0;
xml->get_widget("label_title", label)->set_markup(package_title);
apply_label_what_markup(*xml->get_widget("label_author_what", label));
apply_label_what_markup(*xml->get_widget("label_translator_what", label));
if (xml->get_widget("label_translator_who", label)->get_text().raw() == "translator-credits")
label->set_markup("<i>(no translation available)</i>");
return dialog;
}
} // namespace Regexxer
/*
* Copyright (c) 2002-2007 Daniel Elstner <daniel.kitta@gmail.com>
*
* This file is part of regexxer.
*
* regexxer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* regexxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with regexxer; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef REGEXXER_ABOUTDIALOG_H_INCLUDED
#define REGEXXER_ABOUTDIALOG_H_INCLUDED
#include <memory>
namespace Gtk
{
class Dialog;
class Window;
}
namespace Regexxer
{
namespace AboutDialog
{
std::auto_ptr<Gtk::Dialog> create(Gtk::Window& parent);
}
} // namespace Regexxer
#endif /* REGEXXER_ABOUTDIALOG_H_INCLUDED */
......@@ -19,7 +19,6 @@
*/
#include "mainwindow.h"
#include "aboutdialog.h"
#include "filetree.h"
#include "globalstrings.h"
#include "pcreshell.h"
......@@ -50,6 +49,15 @@ typedef Glib::RefPtr<Regexxer::FileBuffer> FileBufferPtr;
const char *const selection_clipboard = "CLIPBOARD";
/*
* List of authors to be displayed in the about dialog.
*/
const char *const program_authors[] =
{
"Daniel Elstner <daniel.kitta@gmail.com>",
"Murray Cumming <murrayc@murrayc.com>",
0
};
class FileErrorDialog : public Gtk::MessageDialog
{
......@@ -885,16 +893,25 @@ void MainWindow::on_about()
}
else
{
std::auto_ptr<Gtk::Dialog> dialog = AboutDialog::create(*window_);
std::auto_ptr<Gtk::AboutDialog> dialog (new Gtk::AboutDialog());
dialog->set_version(PACKAGE_VERSION);
dialog->set_authors(program_authors);
dialog->set_website("http://regexxer.sourceforge.net/");
dialog->set_copyright("Copyright \302\251 2002-2007 Daniel Elstner");
dialog->set_comments(_("Search and replace using regular expressions"));
dialog->set_translator_credits(_("translator-credits"));
dialog->set_logo_icon_name(PACKAGE_TARNAME);
dialog->signal_hide().connect(sigc::mem_fun(*this, &MainWindow::on_about_dialog_hide));
dialog->set_transient_for(*window_);
dialog->show();
dialog->signal_response().connect(sigc::mem_fun(*this, &MainWindow::on_about_dialog_response));
about_dialog_ = dialog;
}
}
void MainWindow::on_about_dialog_hide()
void MainWindow::on_about_dialog_response(int)
{
// Play safe and transfer ownership, and let the dtor do the delete.
const std::auto_ptr<Gtk::Dialog> temp (about_dialog_);
......
......@@ -167,7 +167,7 @@ private:
void on_busy_action_cancel();
void on_about();
void on_about_dialog_hide();
void on_about_dialog_response(int);
void on_preferences();
void on_pref_dialog_hide();
......
<?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="aboutdialog">
<property name="title" translatable="yes">About regexxer</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">False</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">True</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="okbutton">
<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="has_focus">True</property>
<property name="label">gtk-ok</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">-5</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="GtkAlignment" id="alignment">
<property name="border_width">20</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.33</property>
<property name="xscale">0.5</property>
<property name="yscale">0.5</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="GtkVBox" id="box">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">20</property>
<child>
<widget class="GtkHBox" id="box_title">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">10</property>
<child>
<widget class="GtkImage" id="image">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<accessibility>
<atkproperty name="AtkObject::accessible_name" translatable="yes">regexxer icon</atkproperty>
<atkproperty name="AtkObject::accessible_description" translatable="yes">The application icon of regexxer</atkproperty>
</accessibility>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_title">
<property name="visible">True</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</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">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="box_text">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">10</property>
<child>
<widget class="GtkLabel" id="label_url">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">http://regexxer.sourceforge.net/</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">True</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">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="box_author">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkLabel" id="label_author_what">
<property name="visible">True</property>
<property name="label" translatable="yes">written by</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="GtkLabel" id="label_author_who">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">Daniel Elstner &lt;daniel.kitta@gmail.com&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">True</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>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="box_translator">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkLabel" id="label_translator_what">
<property name="visible">True</property>
<property name="label" translatable="yes">translated by</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="GtkLabel" id="label_translator_who">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">translator-credits</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">True</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>
<packing>
<property name="padding">0</property>
<property name="expand">True</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>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment