Changeset 245

Show
Ignore:
Timestamp:
06/29/06 14:22:27 (2 years ago)
Author:
jordi
Message:

The link on the about box is now clickable and the command executed is the same as an external link has been activated (i.e., uses the web browser specified in the preferences dialog.)

This commit fixes bug #45.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/configure.ac

    r242 r245  
    11dnl Process this file with autoconf to produce a configure script. 
    2 AC_INIT([ePDFView], [0.1.5], [jordi@emma-soft.com]) 
     2AC_INIT([ePDFView], [0.1.6], [jordi@emma-soft.com]) 
    33AC_PREREQ([2.13]) 
    44AC_CONFIG_HEADER([config.h]) 
  • trunk/src/MainPter.cxx

    r227 r245  
    285285    m_PagePter = new PagePter (m_Document); 
    286286    m_PagePter->setView (*view); 
    287      
     287 
    288288    delete m_View; 
    289289    m_View = view; 
     
    291291    // state. 
    292292    setInitialState (); 
     293} 
     294 
     295/// 
     296/// @brief An URL link in the about box has been activated. 
     297/// 
     298/// @param link The URL of the link activated. 
     299/// 
     300void 
     301MainPter::aboutBoxLinkActivated (const gchar *link) 
     302{ 
     303    gchar *browserCommandLine = 
     304        Config::getConfig ().getExternalBrowserCommandLine (); 
     305    gchar *commandLine = g_strdup_printf (browserCommandLine, link); 
     306    g_free (browserCommandLine); 
     307 
     308    GError *error = NULL; 
     309    if ( !g_spawn_command_line_async (commandLine, &error) ) 
     310    { 
     311        g_error_free (error); 
     312    } 
     313    g_free (commandLine); 
    293314} 
    294315 
  • trunk/src/MainPter.h

    r213 r245  
    4646            void setView (IMainView *view); 
    4747 
     48            void aboutBoxLinkActivated (const gchar *link); 
    4849            void findActivated (void); 
    4950            void goToFirstPageActivated (void); 
  • trunk/src/gtk/MainView.cxx

    r227 r245  
    5050// Forward declarations. 
    5151static void main_window_about_box_cb (GtkWidget *, gpointer); 
     52static void main_window_about_box_url_hook (GtkAboutDialog *, const gchar *, 
     53                                            gpointer); 
    5254static void main_window_find_cb (GtkWidget *, gpointer); 
    5355static gboolean main_window_moved_or_resized_cb (GtkWidget *, 
     
    10131015    gchar *licenseTranslated = g_strconcat (_(license[0]), "\n", 
    10141016                                            _(license[1]), "\n", 
    1015                                             _(license[2]), "\n", NULL);     
     1017                                            _(license[2]), "\n", NULL); 
     1018    gtk_about_dialog_set_url_hook (main_window_about_box_url_hook, NULL, NULL); 
    10161019    gtk_show_about_dialog (NULL, 
    10171020            "name", _("ePDFView"), 
     
    10281031} 
    10291032 
     1033 
     1034void 
     1035main_window_about_box_url_hook (GtkAboutDialog *about, const gchar *link, 
     1036                                gpointer data) 
     1037{ 
     1038    g_assert ( NULL != data && "The data parameter is NULL."); 
     1039 
     1040    MainPter *pter = (MainPter *)data; 
     1041    pter->aboutBoxLinkActivated (link); 
     1042} 
     1043 
    10301044/// 
    10311045/// @brief The user tried to find a word in the document.