Commit cc61618f authored by Daniel Elstner's avatar Daniel Elstner
Browse files

New string constant which defines the package title string plus

* src/aboutdialog.cc (package_title): New string constant which
defines the package title string plus surrounding markup.
(AboutDialog::create): Use the separated package_title constant.

* src/aboutdialog.{cc,h} (AboutDialog::create): Change the return
type to std::auto_ptr<Gtk::Dialog> because copying-destroys-source
is just what we want.   Calling release() to achieve exactly that
was a silly idea to begin with.
parent 08996088
2004-05-20 Daniel Elstner <daniel.elstner@gmx.net>
* src/aboutdialog.cc (package_title): New string constant which
defines the package title string plus surrounding markup.
(AboutDialog::create): Use the separated package_title constant.
* src/aboutdialog.{cc,h} (AboutDialog::create): Change the return
type to std::auto_ptr<Gtk::Dialog> because copying-destroys-source
is just what we want. Calling release() to achieve exactly that
was a silly idea to begin with.
2004-05-19 Daniel Elstner <daniel.elstner@gmx.net>
* ui/aboutdialog.glade (label_debian_*): Remove. The Debian
......
......@@ -26,7 +26,6 @@
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <libglademm.h>
#include <memory>
#include <config.h>
......@@ -34,6 +33,9 @@
namespace
{
const char *const package_title = "<span size=\"xx-large\" weight=\"heavy\">"
PACKAGE_STRING "</span>";
void apply_label_markup(Gtk::Label& label)
{
label.set_markup("<span size=\"small\">" + Glib::Markup::escape_text(label.get_text()) + "</span>");
......@@ -45,7 +47,7 @@ void apply_label_markup(Gtk::Label& label)
namespace Regexxer
{
Gtk::Dialog* AboutDialog::create(Gtk::Window& parent)
std::auto_ptr<Gtk::Dialog> AboutDialog::create(Gtk::Window& parent)
{
using Gnome::Glade::Xml;
......@@ -53,20 +55,19 @@ Gtk::Dialog* AboutDialog::create(Gtk::Window& parent)
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(application_icon_filename);
Gtk::Label* label = 0;
xml->get_widget("label_title", label)->set_markup(
"<span size=\"xx-large\" weight=\"heavy\">" PACKAGE_STRING "</span>");
xml->get_widget("label_title", label)->set_markup(package_title);
apply_label_markup(*xml->get_widget("label_author_what", label));
apply_label_markup(*xml->get_widget("label_translator_what", label));
dialog->signal_response().connect(sigc::hide(sigc::mem_fun(*dialog, &Gtk::Widget::hide)));
return dialog.release();
return dialog;
}
} // namespace Regexxer
......
......@@ -21,6 +21,8 @@
#ifndef REGEXXER_ABOUTDIALOG_H_INCLUDED
#define REGEXXER_ABOUTDIALOG_H_INCLUDED
#include <memory>
namespace Gtk
{
class Dialog;
......@@ -31,7 +33,10 @@ class Window;
namespace Regexxer
{
namespace AboutDialog { Gtk::Dialog* create(Gtk::Window& parent); }
namespace AboutDialog
{
std::auto_ptr<Gtk::Dialog> create(Gtk::Window& parent);
}
} // namespace Regexxer
......
......@@ -774,7 +774,7 @@ void MainWindow::on_about()
}
else
{
std::auto_ptr<Gtk::Dialog> dialog (AboutDialog::create(*window_));
std::auto_ptr<Gtk::Dialog> dialog = AboutDialog::create(*window_);
dialog->signal_hide().connect(sigc::mem_fun(*this, &MainWindow::on_about_dialog_hide));
dialog->show();
......
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