From d03d6e606b40157d910ddf99ab018156abeb8ef0 Mon Sep 17 00:00:00 2001 From: "berkeviktor@aol.com" Date: Mon, 28 Feb 2011 18:59:32 +0100 Subject: add wdk changes to named branch --- src/fe-gtk/maingui.c | 67 +++------------------------------------------------- 1 file changed, 3 insertions(+), 64 deletions(-) (limited to 'src/fe-gtk/maingui.c') diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index ef269f95..27d47731 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -53,6 +53,7 @@ #include "../common/plugin.h" #include "../common/modes.h" #include "../common/url.h" +#include "../common/wdkutil.h" #include "fe-gtk.h" #include "banlist.h" #include "gtkutil.h" @@ -214,60 +215,10 @@ mg_create_tab_colors (void) away_list = mg_attr_list_create (&colors[COL_AWAY], FALSE); } -#ifdef WIN32 -#define WINVER 0x0501 /* needed for vc6? */ -#include -#include - -/* Flash the taskbar button on Windows when there's a highlight event. */ - -static void -flash_window (GtkWidget *win) -{ - FLASHWINFO fi; - static HMODULE user = NULL; - static BOOL (*flash) (PFLASHWINFO) = NULL; - - if (!user) - { - user = GetModuleHandleA ("USER32"); - if (!user) - return; /* this should never fail */ - } - - if (!flash) - { - flash = (void *)GetProcAddress (user, "FlashWindowEx"); - if (!flash) - return; /* this fails on NT4.0 and Win95 */ - } - - fi.cbSize = sizeof (fi); - fi.hwnd = GDK_WINDOW_HWND (win->window); - fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; - fi.uCount = 0; - fi.dwTimeout = 500; - flash (&fi); - /*FlashWindowEx (&fi);*/ -} -#else - -#ifdef USE_XLIB -#include - static void set_window_urgency (GtkWidget *win, gboolean set) { - XWMHints *hints; - - hints = XGetWMHints(GDK_WINDOW_XDISPLAY(win->window), GDK_WINDOW_XWINDOW(win->window)); - if (set) - hints->flags |= XUrgencyHint; - else - hints->flags &= ~XUrgencyHint; - XSetWMHints(GDK_WINDOW_XDISPLAY(win->window), - GDK_WINDOW_XWINDOW(win->window), hints); - XFree(hints); + gtk_window_set_urgency_hint (GTK_WINDOW (win), set); } static void @@ -281,18 +232,14 @@ unflash_window (GtkWidget *win) { set_window_urgency (win, FALSE); } -#endif -#endif /* flash the taskbar button */ void fe_flash_window (session *sess) { -#if defined(WIN32) || defined(USE_XLIB) if (fe_gui_info (sess, 0) != 1) /* only do it if not focused */ flash_window (sess->gui->window); -#endif } /* set a tab plain, red, light-red, or blue */ @@ -1334,7 +1281,7 @@ mg_open_quit_dialog (gboolean minimize_button) gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - if (minimize_button) + if (minimize_button && !xtray_mode ()) { button = gtk_button_new_with_mnemonic (_("_Minimize to Tray")); gtk_widget_show (button); @@ -2972,11 +2919,7 @@ mg_tabwin_focus_cb (GtkWindow * win, GdkEventFocus *event, gpointer userdata) gtk_xtext_check_marker_visibility (GTK_XTEXT (current_sess->gui->xtext)); plugin_emit_dummy_print (current_sess, "Focus Window"); } -#ifndef WIN32 -#ifdef USE_XLIB unflash_window (GTK_WIDGET (win)); -#endif -#endif return FALSE; } @@ -2987,11 +2930,7 @@ mg_topwin_focus_cb (GtkWindow * win, GdkEventFocus *event, session *sess) if (!sess->server->server_session) sess->server->server_session = sess; gtk_xtext_check_marker_visibility(GTK_XTEXT (current_sess->gui->xtext)); -#ifndef WIN32 -#ifdef USE_XLIB unflash_window (GTK_WIDGET (win)); -#endif -#endif plugin_emit_dummy_print (sess, "Focus Window"); return FALSE; } -- cgit 1.4.1 From 5e4a60debe1c3643bcc455778e2ef7f6238c71c2 Mon Sep 17 00:00:00 2001 From: "berkeviktor@aol.com" Date: Tue, 31 May 2011 00:40:13 +0200 Subject: support for own license text --- src/common/cfgfiles.c | 2 ++ src/common/xchat.h | 1 + src/fe-gtk/about.c | 5 ++++- src/fe-gtk/maingui.c | 14 +++++++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src/fe-gtk/maingui.c') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index d26198ed..a6a75aed 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -421,6 +421,7 @@ const struct prefs vars[] = { {"flood_msg_num", P_OFFINT (msg_number_limit), TYPE_INT}, {"flood_msg_time", P_OFFINT (msg_time_limit), TYPE_INT}, + {"gui_license", P_OFFSET (gui_license), TYPE_STR}, {"gui_auto_open_chat", P_OFFINT (autoopendccchatwindow), TYPE_BOOL}, {"gui_auto_open_dialog", P_OFFINT (autodialog), TYPE_BOOL}, {"gui_auto_open_recv", P_OFFINT (autoopendccrecvwindow), TYPE_BOOL}, @@ -696,6 +697,7 @@ load_config (void) #ifdef WIN32 prefs.identd = 1; #endif + strcpy (prefs.gui_license, ""); strcpy (prefs.stamp_format, "[%H:%M] "); strcpy (prefs.timestamp_log_format, "%b %d %H:%M:%S "); strcpy (prefs.logmask, "%n-%c.log"); diff --git a/src/common/xchat.h b/src/common/xchat.h index 2f695599..718e0e91 100644 --- a/src/common/xchat.h +++ b/src/common/xchat.h @@ -121,6 +121,7 @@ struct xchatprefs char partreason[256]; char font_normal[FONTNAMELEN + 1]; char doubleclickuser[256]; + char gui_license[64]; char sounddir[PATHLEN + 1]; char soundcmd[PATHLEN + 1]; char background[PATHLEN + 1]; diff --git a/src/fe-gtk/about.c b/src/fe-gtk/about.c index 6e69b646..e1e5149c 100644 --- a/src/fe-gtk/about.c +++ b/src/fe-gtk/about.c @@ -40,6 +40,7 @@ #include "../common/xchat.h" #include "../common/util.h" #include "../common/wdkutil.h" +#include "../common/xchatc.h" #include "palette.h" #include "pixmaps.h" #include "gtkutil.h" @@ -114,7 +115,8 @@ menu_about (GtkWidget * wid, gpointer sess) gtk_container_add (GTK_CONTAINER (vbox), label); g_get_charset (&locale); (snprintf) (buf, sizeof (buf), - ""DISPLAY_NAME" "PACKAGE_VERSION"\n\n" + ""DISPLAY_NAME" "PACKAGE_VERSION"\n" + "%s\n\n" #ifdef WIN32 "XChat Release: "XCHAT_RELEASE"\n\n" "OS: %s\n" @@ -127,6 +129,7 @@ menu_about (GtkWidget * wid, gpointer sess) "\302\251 1998-2010 Peter \305\275elezn\303\275 <zed@xchat.org>" /* "\nhttp://code.google.com/p/xchat-wdk/" this is broken in gtk ATM */ "", + prefs.gui_license, get_cpu_str (), locale, gtk_major_version, diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 27d47731..feea6549 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -476,10 +476,22 @@ fe_set_title (session *sess) break; default: def: - gtk_window_set_title (GTK_WINDOW (sess->gui->window), DISPLAY_NAME); + snprintf (tbuf, sizeof (tbuf), DISPLAY_NAME); + if (strcmp (prefs.gui_license, "")) /* zero means gui_license is empty */ + { + strcat (tbuf, " - "); + strcat (tbuf, prefs.gui_license); + } + gtk_window_set_title (GTK_WINDOW (sess->gui->window), tbuf); return; } + if (strcmp (prefs.gui_license, "")) /* zero means gui_license is empty */ + { + strcat (tbuf, " - "); + strcat (tbuf, prefs.gui_license); + } + gtk_window_set_title (GTK_WINDOW (sess->gui->window), tbuf); } -- cgit 1.4.1