summary refs log tree commit diff stats
path: root/win32
AgeCommit message (Expand)Author
2012-11-05Add build notes to 1st level depsBerke Viktor
2012-11-05win-iconv version bumpBerke Viktor
2012-11-04Move build files out of the source tree, make grep usage much easierBerke Viktor
2012-11-04Fix tabulationBerke Viktor
2012-11-03Installer migrator functions for xchat.conf -> hexchat.confBerke Viktor
2012-11-03Varname consolidation for the rest of pixmapsBerke Viktor
2012-11-03Relocate hexchat.png and hexchat.ico and some more varname cleanupBerke Viktor
2012-11-03Relocate version.txt, leave a copy in old place for a while for upgrades to workBerke Viktor
2012-11-03Rainbow user list colors and more senseful variable namesBerke Viktor
2012-11-02added support for op+3 iconsTingPing
2012-10-30Eliminate even more warnings and bump warning level to 3Berke Viktor
2012-10-30Revert "Proof-of-concept compat mode for XChat"Berke Viktor
2012-10-30Proof-of-concept compat mode for XChatBerke Viktor
2012-10-29Make HexTray filename consistent with the restBerke Viktor
2012-10-27Don't forget to build make-te before commonBerke Viktor
2012-10-26Fixes after file movesBerke Viktor
2012-10-26Fix doc URLs for Start Menu iconsBerke Viktor
2012-10-25Get rid of the SASL pluginBerke Viktor
2012-10-22Add Windows version check to installer against overly frustrated Win2000 usersBerke Viktor
2012-10-22Change readme icon and add changelog icon as wellBerke Viktor
2012-10-22Add README for people who still can't use GoogleBerke Viktor
2012-10-21Keep the installer component lists sortedBerke Viktor
2012-10-21Rename WinSys on the code levelBerke Viktor
2012-10-21Move warning level to property sheetBerke Viktor
2012-10-20Update bundled ISO 3166 codesBerke Viktor
2012-10-18Update win32 dirent.h implementation and use header instead of static libraryBerke Viktor
2012-10-13Accept license agreement by defaultBerke Viktor
2012-10-13Provide builtin defauls for treeview iconsBerke Viktor
2012-10-06Update NSS-WDK patch for NSS 3.13.6Berke Viktor
2012-10-05Install SASL plugin by defaultBerke Viktor
2012-10-04Add libwimp and libpixmap makefiles, don't work yet thoughBerke Viktor
2012-10-04Add project for generating text eventsBerke Viktor
2012-10-04Generate a new upgrade code for vs2012 platform toolset so that both can be i...Berke Viktor
2012-10-04No registry keys for WDKPTBerke Viktor
2012-10-04Provide sources for both platform toolsetBerke Viktor
2012-10-04Add scripts for building the spelling dictionaries SFXBerke Viktor
2012-10-03Use multiprocessor compilation for GTK+, otherwise it's waaay too slowBerke Viktor
2012-10-03Fix the remaining path breakages after the downgradeBerke Viktor
2012-10-03Now really finish the reversionBerke Viktor
2012-10-03Nuke the remnants of the nonbmp pluginBerke Viktor
2012-10-03Complete the VS2010 reversionBerke Viktor
2012-10-03Unified copy for xp solution tooBerke Viktor
2012-10-03Fix solution versionsBerke Viktor
2012-10-03Get rid of useless .exp filesBerke Viktor
2012-10-03Move license files to share\docBerke Viktor
2012-10-03Fix libxml2 path according to VS downgradeBerke Viktor
2012-10-03Revert to VS2010 part4Berke Viktor
2012-10-03Revert to VS2010 part3Berke Viktor
2012-10-03Revert to VS2010 part2Berke Viktor
2012-10-03Revert to VS2010 part1Berke Viktor
pan class="cm"> * 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 <stdio.h> #include <string.h> #include <stdlib.h> #include "fe-gtk.h" #include <gtk/gtkhbox.h> #include <gtk/gtkstock.h> #include <gtk/gtkhbbox.h> #include <gtk/gtkscrolledwindow.h> #include <gtk/gtkliststore.h> #include <gtk/gtktreeview.h> #include <gtk/gtktreeselection.h> #include <gtk/gtkcellrenderertext.h> #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/cfgfiles.h" #include "../common/fe.h" #include "../common/url.h" #include "../common/tree.h" #include "gtkutil.h" #include "menu.h" #include "maingui.h" #include "urlgrab.h" /* model for the URL treeview */ enum { URL_COLUMN, N_COLUMNS }; static GtkWidget *urlgrabberwindow = 0; static gboolean url_treeview_url_clicked_cb (GtkWidget *view, GdkEventButton *event, gpointer data) { GtkTreeIter iter; gchar *url; if (!event || !gtkutil_treeview_get_selected (GTK_TREE_VIEW (view), &iter, URL_COLUMN, &url, -1)) { return FALSE; } switch (event->button) { case 1: if (event->type == GDK_2BUTTON_PRESS) fe_open_url (url); break; case 3: menu_urlmenu (event, url); break; default: break; } g_free (url); return FALSE; } static GtkWidget * url_treeview_new (GtkWidget *box) { GtkListStore *store; GtkWidget *view; store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING); g_return_val_if_fail (store != NULL, NULL); view = gtkutil_treeview_new (box, GTK_TREE_MODEL (store), NULL, URL_COLUMN, _("URL"), -1); g_signal_connect (G_OBJECT (view), "button_press_event", G_CALLBACK (url_treeview_url_clicked_cb), NULL); /* don't want column headers */ gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE); gtk_widget_show (view); return view; } static void url_closegui (GtkWidget *wid, gpointer userdata) { urlgrabberwindow = 0; } static void url_button_clear (void) { GtkListStore *store; url_clear (); store = GTK_LIST_STORE (g_object_get_data (G_OBJECT (urlgrabberwindow), "model")); gtk_list_store_clear (store); } static void url_button_copy (GtkWidget *widget, gpointer data) { GtkTreeView *view = GTK_TREE_VIEW (data); GtkTreeIter iter; gchar *url = NULL; if (gtkutil_treeview_get_selected (view, &iter, URL_COLUMN, &url, -1)) { gtkutil_copy_to_clipboard (GTK_WIDGET (view), NULL, url); g_free (url); } } static void url_save_callback (void *arg1, char *file) { if (file) { url_save_tree (file, "w", TRUE); } } static void url_button_save (void) { gtkutil_file_req (_("Select an output filename"), url_save_callback, NULL, get_xdir (), NULL, FRF_WRITE|FRF_FILTERISINITIAL); } void fe_url_add (const char *urltext) { GtkListStore *store; GtkTreeIter iter; gboolean valid; if (urlgrabberwindow) { store = GTK_LIST_STORE (g_object_get_data (G_OBJECT (urlgrabberwindow), "model")); gtk_list_store_prepend (store, &iter); gtk_list_store_set (store, &iter, URL_COLUMN, urltext, -1); /* remove any overflow */ if (prefs.hex_url_grabber_limit > 0) { valid = gtk_tree_model_iter_nth_child ( GTK_TREE_MODEL (store), &iter, NULL, prefs.hex_url_grabber_limit); while (valid) valid = gtk_list_store_remove (store, &iter); } } } static int populate_cb (char *urltext, gpointer userdata) { fe_url_add (urltext); return TRUE; } void url_opengui () { GtkWidget *vbox, *hbox, *view; if (urlgrabberwindow) { mg_bring_tofront (urlgrabberwindow); return; } urlgrabberwindow = mg_create_generic_tab ("UrlGrabber", _(DISPLAY_NAME": URL Grabber"), FALSE, TRUE, url_closegui, NULL, 400, 256, &vbox, 0); view = url_treeview_new (vbox); g_object_set_data (G_OBJECT (urlgrabberwindow), "model", gtk_tree_view_get_model (GTK_TREE_VIEW (view))); hbox = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_SPREAD); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_box_pack_end (GTK_BOX (vbox), hbox, 0, 0, 0); gtk_widget_show (hbox); gtkutil_button (hbox, GTK_STOCK_CLEAR, _("Clear list"), url_button_clear, 0, _("Clear")); gtkutil_button (hbox, GTK_STOCK_COPY, _("Copy selected URL"), url_button_copy, view, _("Copy")); gtkutil_button (hbox, GTK_STOCK_SAVE_AS, _("Save list to a file"), url_button_save, 0, _("Save As...")); gtk_widget_show (urlgrabberwindow); if (prefs.hex_url_grabber) tree_foreach (url_tree, (tree_traverse_func *)populate_cb, NULL); else { gtk_list_store_clear (GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view)))); fe_url_add ("URL Grabber is disabled."); } }