~ubuntu-branches/ubuntu/maverick/xchat/maverick

« back to all changes in this revision

Viewing changes to src/fe-gtk/fe-gtk.c

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-06-21 22:47:10 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100621224710-9t1iyiglri330pss
Tags: 2.8.8-1ubuntu1
* Merge from debian unstable (LP: #597042), remaining changes:
  - debian/patches:
    + series: Refreshed.
    + 01_serverlist.patch: Numerous changes to default serverlist.
    + 02_ubuntu_default_server.patch: select "Ubuntu servers" by default.
    + 37_lpi.patch: Add launchpad integration.
    + 38_autoconf.patch: Autoconf modifications for launchpad integration.
    + 45_brand_ctcp_version.patch: Add Ubuntu brand to CTCP version response.
    + 70_notification_strings_shorten.patch: Shorten notification strings.
  - debian/control:
    + Build-depend on libgtk2.0-dev (>= 2.10.0).
    + Build-depend on liblaunchpad-integration-dev.
    + Remove conflict/replaces on xchat-gnome.
    + Updated Maintainer field to match Ubuntu Developers.
  - debian/rules:
    + Make build independent of the python version.
  - debian/patches/45_ctcp_version_less_information.dpatch: 
    + Renamed to debian/patches/45_brand_ctcp_version.patch
    + Added short description.
* Converted all patches to quilt, as in debian quilt has been
  adopted, all old dpatch patches have been renamed with the 
  *.patch extension.
* Dropped changes:
  - 71_notification_icon_change.patch: can't be applied

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
17
17
 */
18
18
 
19
 
#define GTK_DISABLE_DEPRECATED
20
 
 
21
19
#include <stdio.h>
22
20
#include <string.h>
23
21
#include <stdlib.h>
819
817
        switch (info_type)
820
818
        {
821
819
        case 0: /* window status */
 
820
#if GTK_CHECK_VERSION(2,20,0)
 
821
                if (!gtk_widget_get_visible (GTK_WINDOW (sess->gui->window)))
 
822
#else
822
823
                if (!GTK_WIDGET_VISIBLE (GTK_WINDOW (sess->gui->window)))
 
824
#endif
823
825
                        return 2;       /* hidden (iconified or systray) */
824
826
#if GTK_CHECK_VERSION(2,4,0)
825
827
                if (gtk_window_is_active (GTK_WINDOW (sess->gui->window)))
932
934
static void
933
935
fe_open_url_inner (const char *url)
934
936
{
 
937
        char buf[256];
 
938
 
935
939
#ifdef WIN32
936
940
        ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
937
941
#else
938
942
        /* universal desktop URL opener (from xdg-utils). Supports gnome,kde,xfce4. */
939
943
        if (try_browser ("xdg-open", NULL, url))
940
944
                return;
 
945
        fprintf( stderr, "fe_open_url_inner: failed to open %s with xdg-open\n", url );
941
946
 
942
947
        /* try to detect GNOME */
943
948
        if (g_getenv ("GNOME_DESKTOP_SESSION_ID"))
944
949
        {
945
950
                if (try_browser ("gnome-open", NULL, url)) /* Gnome 2.4+ has this */
946
951
                        return;
 
952
                fprintf( stderr, "fe_open_url_inner: failed to open %s with gnome-open\n", url );
947
953
        }
948
954
 
949
955
        /* try to detect KDE */
951
957
        {
952
958
                if (try_browser ("kfmclient", "exec", url))
953
959
                        return;
 
960
                fprintf( stderr, "fe_open_url_inner: failed to open %s with kfmclient\n", url );
954
961
        }
955
962
 
956
963
        /* everything failed, what now? just try firefox */
957
964
        if (try_browser ("firefox", NULL, url))
958
965
                return;
 
966
        fprintf( stderr, "fe_open_url_inner: failed to open %s with firefox\n", url );
 
967
 
 
968
        if (try_browser ("mozilla", NULL, url))
 
969
                return;
 
970
        fprintf( stderr, "fe_open_url_inner: failed to open %s with mozilla\n", url );
959
971
 
960
972
        /* fresh out of ideas... */
961
 
        try_browser ("mozilla", NULL, url);
 
973
        snprintf (buf, sizeof (buf), "Failed to open url:\n\n%s", url);
 
974
        fe_message (buf, FE_MSG_ERROR);
962
975
#endif
963
976
}
964
977