summaryrefslogtreecommitdiffhomepage
path: root/src/lingot-gui-mainframe.c
diff options
context:
space:
mode:
authorPiotr Pawlow <pp@siedziba.pl>2016-02-22 19:11:06 +0100
committerPiotr Pawlow <pp@siedziba.pl>2016-02-22 19:11:06 +0100
commitaa039598843f92c97f41a280943a6fb258121468 (patch)
tree537141bdc348114595de9b4c1cbb3bdb5598fa56 /src/lingot-gui-mainframe.c
parente1db307dbc243eff3e92a092fdd029357710de30 (diff)
Add banner for WIN32 build.HEADlingot-0.9.1
Diffstat (limited to 'src/lingot-gui-mainframe.c')
-rw-r--r--src/lingot-gui-mainframe.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lingot-gui-mainframe.c b/src/lingot-gui-mainframe.c
index 97d2893..0b5b1ef 100644
--- a/src/lingot-gui-mainframe.c
+++ b/src/lingot-gui-mainframe.c
@@ -40,6 +40,15 @@
#include "lingot-background.xpm"
#include "lingot-logo.xpm"
+#ifdef __WIN32__
+#include "windows.h"
+#include "shellapi.h"
+#define ADD_BANNER
+#endif
+#ifdef ADD_BANNER
+#include "lingot-banner.xpm"
+#endif
+
void lingot_gui_mainframe_redraw(LingotMainFrame*);
void lingot_mainframe_filter_frequency_value(LingotMainFrame*);
void lingot_gui_mainframe_draw_gauge(LingotMainFrame*);
@@ -338,6 +347,13 @@ void lingot_gui_mainframe_callback_save_config(gpointer data,
gtk_widget_destroy(dialog);
}
+gboolean lingot_mainframe_callback_open_url(gpointer data) {
+#ifdef __WIN32__
+ ShellExecute(NULL, "open", "https://lingot.gitara.org.pl", NULL, NULL, SW_SHOW);
+#endif
+ return 0;
+}
+
void lingot_gui_mainframe_color(GdkColor* color, int red, int green, int blue) {
color->red = red;
color->green = green;
@@ -390,6 +406,18 @@ void lingot_gui_mainframe_create(int argc, char *argv[]) {
}
# undef FILE_NAME
+#ifdef ADD_BANNER
+ GtkWidget* box = glade_xml_get_widget(_gladeXML, "vbox1");
+ GtkWidget* banner = gtk_button_new();
+ gtk_signal_connect(GTK_OBJECT(banner), "clicked",
+ GTK_SIGNAL_FUNC(lingot_mainframe_callback_open_url), NULL);
+ GtkWidget *banner_image = gtk_image_new_from_pixbuf(gdk_pixbuf_new_from_xpm_data(lingot_banner_xpm));
+ gtk_button_set_image(GTK_BUTTON(banner), banner_image);
+ gtk_box_pack_start(GTK_BOX(box), banner, TRUE, TRUE, 0);
+ gtk_box_reorder_child(GTK_BOX(box), banner, 1);
+ gtk_widget_show(banner);
+#endif
+
frame->win = glade_xml_get_widget(_gladeXML, "window1");
GdkPixbuf* logo = gdk_pixbuf_new_from_xpm_data(lingotlogo);