/******************************************************************************* * PROJECT: GNOME Colorscheme * * AUTHOR: Jonathon Jongsma * * Copyright (c) 2005 Jonathon Jongsma * * License: * This program 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. * * This program 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 this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA * *******************************************************************************/ #include // for strlen() #include #ifdef HAVE_GNOME #include #endif // HAVE_GNOME #include #include "core/log-stream.h" #include "gcs-about-window.h" #include "gcs-i18n.h" namespace gcs { namespace Dialogs { const int AboutWindow::m_logoSize = 150; AboutWindow::AboutWindow(void) { set_name(PACKAGE_NAME); #ifdef HAVE_GNOME set_url_hook(sigc::mem_fun(*this, &AboutWindow::on_link_clicked)); set_website(PACKAGE_WEBSITE); set_website_label(_("Project Website")); #endif // HAVE_GNOME Glib::ustring version(PACKAGE_VERSION); set_version(version); set_copyright("\xC2\xA9 2005-2006 Jonathon Jongsma"); Glib::ustring comments( _("A colorscheme designer for the GNOME desktop")); if (strlen(GIT_REVISION)) { comments.append("\n\n[ " GIT_REVISION " ]"); } set_comments(comments); Glib::ustring license = "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2 of the License, or\n" "(at your option) any later version.\n\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n\n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the \n" "Free Software Foundation, Inc., 59 Temple Place, Suite 330, \n" "Boston, MA 02111-1307 USA\n"; set_license(license); m_authors.push_back("Jonathon Jongsma "); set_authors(m_authors); // Translators: change this to your name, separate multiple names with \n Glib::ustring translation_credits = _("translator-credits"); set_translator_credits(translation_credits); const Glib::ustring icon_name = "agave-icon"; Glib::RefPtr theme = Gtk::IconTheme::get_default(); if (theme->has_icon(icon_name)) { try { m_logo = theme->load_icon(icon_name, m_logoSize, Gtk::ICON_LOOKUP_USE_BUILTIN); set_logo(m_logo); } catch (const Glib::Error& e) { Glib::ustring message = "Couldn't load Agave logo image from theme. " + e.what(); g_warning(message.c_str()); } } } void AboutWindow::on_link_clicked(Gtk::AboutDialog& dialog, const Glib::ustring& link) { #ifdef HAVE_GNOME gnome_url_show(link.c_str(), 0); #endif // HAVE_GNOME } void AboutWindow::on_response(int response_id) { if (response_id == Gtk::RESPONSE_DELETE_EVENT || response_id == Gtk::RESPONSE_CANCEL || response_id == Gtk::RESPONSE_CLOSE) { hide(); } } } // namespace Dialogs } // namespace gcs