summaryrefslogtreecommitdiff
path: root/gtk/gtk_scaffolding.c
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2008-07-16 10:19:30 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2008-07-16 10:19:30 +0000
commite7850d9762528507a96ed45f1868400ea88166dd (patch)
tree4ae7223573a267a6ca665e8613909daca88eb4fc /gtk/gtk_scaffolding.c
parentcda086882a7e6cb1eb752106ecce8c15105d1985 (diff)
downloadnetsurf-e7850d9762528507a96ed45f1868400ea88166dd.tar.gz
netsurf-e7850d9762528507a96ed45f1868400ea88166dd.tar.bz2
Merged revisions 4282-4285,4288-4293,4297-4298,4307,4309-4313,4322,4324-4680 via svnmerge from
svn://svn.netsurf-browser.org/branches/mikeL/netsurf ........ r4432 | mikeL | 2008-06-24 04:00:36 +0100 (Tue, 24 Jun 2008) | 1 line Drag events are now emited from where the press originated, instead of from where they became a drag ........ r4433 | mikeL | 2008-06-24 04:25:33 +0100 (Tue, 24 Jun 2008) | 1 line Added accelerator to 'Select All' ........ r4495 | mikeL | 2008-07-02 21:36:32 +0100 (Wed, 02 Jul 2008) | 1 line Selections are now deleted and replaced when a key is typed in a text area or text box. All input box behavior while a selection is active is now implemented (ex: pressing the right arrow key moves the caret to the end of the selection). Cut now works properly in both versions. Fixed discrepancy between where the caret was placed and selection began when starting a drag-select. Fixed bug with calculation of a selections end box. ........ r4496 | mikeL | 2008-07-02 22:11:24 +0100 (Wed, 02 Jul 2008) | 1 line Added support for cut in input boxes ........ r4497 | mikeL | 2008-07-02 22:21:35 +0100 (Wed, 02 Jul 2008) | 1 line Removed unused variables (Thanks tlsa) ........ r4498 | mikeL | 2008-07-02 23:30:30 +0100 (Wed, 02 Jul 2008) | 1 line Modified selection clearing behavior to allow for drag-saves ........ r4499 | mikeL | 2008-07-03 00:51:50 +0100 (Thu, 03 Jul 2008) | 1 line Fixed regression where it would take two clicks to place caret in an input (Thanks tlsa) ........ r4509 | mikeL | 2008-07-06 07:55:09 +0100 (Sun, 06 Jul 2008) | 1 line Basic download support implemented. Only downloading of text files works ........ r4510 | mikeL | 2008-07-06 18:55:31 +0100 (Sun, 06 Jul 2008) | 1 line Downloading of non-text files is now possible. Progress bar and size downloaded are now updated ........ r4511 | mikeL | 2008-07-06 20:46:00 +0100 (Sun, 06 Jul 2008) | 1 line Added downloads glade file ........ r4512 | mikeL | 2008-07-06 20:47:39 +0100 (Sun, 06 Jul 2008) | 1 line Downloads window now spawns in the center of the parent browser window ........ r4513 | mikeL | 2008-07-06 20:56:12 +0100 (Sun, 06 Jul 2008) | 1 line Fixed bug where backspace would be ignored if the selection began at the beginning on an input ........ r4514 | mikeL | 2008-07-06 21:26:45 +0100 (Sun, 06 Jul 2008) | 1 line Fixed compiler warnings by adding casts ........ r4516 | mikeL | 2008-07-06 21:32:41 +0100 (Sun, 06 Jul 2008) | 1 line Fixed initialization of size string, added initialization of progress ........ r4518 | mikeL | 2008-07-06 21:51:08 +0100 (Sun, 06 Jul 2008) | 1 line Added an option for short units (with space) to human_friendly_bytesize ........ r4519 | mikeL | 2008-07-06 21:52:05 +0100 (Sun, 06 Jul 2008) | 1 line Removed function size_to_string ........ r4520 | mikeL | 2008-07-06 22:03:11 +0100 (Sun, 06 Jul 2008) | 1 line Fixed pedantic error (kB instead of KB). Added missing necessary parameters to human_friendly_bytesize. Fixed incorrect bool types ........ r4521 | mikeL | 2008-07-06 22:08:15 +0100 (Sun, 06 Jul 2008) | 1 line Removed unnecessary parameter and units list from human_friendly_bytesize ........ r4522 | mikeL | 2008-07-06 22:57:03 +0100 (Sun, 06 Jul 2008) | 1 line Removed unnused variable ........ r4523 | mikeL | 2008-07-06 23:03:46 +0100 (Sun, 06 Jul 2008) | 1 line Fixed url parsing by replacing url_parse_filename with url_nice. Total size and size downloaded are now in human readable form. Speed is now calculated (roughly) ........ r4524 | mikeL | 2008-07-07 01:19:01 +0100 (Mon, 07 Jul 2008) | 1 line Added file overwrite confirmation. Changed speed to a double ........ r4546 | mikeL | 2008-07-09 17:21:43 +0100 (Wed, 09 Jul 2008) | 1 line Changed parameter of selection_get_end/start to a size_t instead of int and changed all offset variables to size_t as well ........ r4547 | mikeL | 2008-07-09 17:30:47 +0100 (Wed, 09 Jul 2008) | 1 line Added action buttons to the bottom toolbar. Added ability to clear selected (and completed) downloads with a framework for other actions. ........ r4556 | jmb | 2008-07-10 00:17:24 +0100 (Thu, 10 Jul 2008) | 3 lines A large bunch of tidying and general fixes to text input handling. Make selection code treat password fields as inputs, too. ........ r4557 | mikeL | 2008-07-10 00:24:46 +0100 (Thu, 10 Jul 2008) | 1 line Added functionality to gui_empty_clipboard and gui_start_selection (Thanks jmb) ........ r4573 | mikeL | 2008-07-10 16:33:27 +0100 (Thu, 10 Jul 2008) | 1 line Removed example download. Made the list store row aware of its download and vise versa. Added new way of handling actions from the dialog (e.g. buttons) which handles all rows in the selection. Added a few memory management function calls to clean up better ........ r4577 | mikeL | 2008-07-10 21:11:51 +0100 (Thu, 10 Jul 2008) | 1 line Download write channels now close properly. Added status column to the tree store which will change the progress bar text if a download is canceled or completed. Implemented cancel button functionality. ........ r4578 | mikeL | 2008-07-10 21:17:51 +0100 (Thu, 10 Jul 2008) | 1 line Speed is now displayed as '-' when 0 or download has stopped ........ r4580 | mikeL | 2008-07-11 02:10:57 +0100 (Fri, 11 Jul 2008) | 1 line Added two download related options (Download directory & Clear completed downloads) and a Downloads tab to the preferences dialog. Also moved the option to ask when overwriting files to Downloads tab. Added another option to the pre-download dialog, Save, which downloads the file immediately to your 'Download directory' ........ r4581 | mikeL | 2008-07-11 02:26:00 +0100 (Fri, 11 Jul 2008) | 1 line Rearranged pre-download dialog buttons to conform to the HIG ........ r4616 | mikeL | 2008-07-11 19:54:12 +0100 (Fri, 11 Jul 2008) | 1 line Limited download window updates to a user-defined variable that can be set in options (default is .5). Updates are now only done if the download window is visible. This greatly reduces the cpu usage. ........ r4617 | mikeL | 2008-07-11 20:07:48 +0100 (Fri, 11 Jul 2008) | 1 line Removed unnecessary update limit option (it is now fixed at .5) ........ r4629 | mikeL | 2008-07-13 04:21:07 +0100 (Sun, 13 Jul 2008) | 1 line Reorganized button sensitivity functions. Sensitivities are now updated when the selection changes as well as when a selected download's state changes. ........ r4635 | mikeL | 2008-07-13 17:00:05 +0100 (Sun, 13 Jul 2008) | 1 line Added error handling. Added word-wrap to the "info" cell renderer so that to keep everything under control. Fixed bug where downloads would always go to you default folder (missing breaks). ........ r4642 | mikeL | 2008-07-13 21:46:09 +0100 (Sun, 13 Jul 2008) | 1 line Added time remaining column. Fixed regression where the download info would be erased upon completion/cancelation. ........ r4655 | mikeL | 2008-07-14 23:20:33 +0100 (Mon, 14 Jul 2008) | 1 line Downloads dialog is now initialized in gtk_gui.c with no parent window. The parent windows are now set when a download is created (through an extra parameter in gui_download_window_create) and when nsgtk_download_show is called. When it is closed (when NS shuts down) all incomplete downloads are canceled (and the files deleted). Added a warning dialog when netsurf tries to close with incomplete downloads. Fixed bug where default save directory would initialize to NULL. ........ r4676 | mikeL | 2008-07-15 21:01:17 +0100 (Tue, 15 Jul 2008) | 1 line Downloads dialog is now initialized in gtk_gui.c with no parent window. The parent windows are now set when a download is created (through an extra parameter in gui_download_window_create) and when nsgtk_download_show is called. (This is the second half of the patch, last commit was only partial for some reason) ........ r4678 | mikeL | 2008-07-16 01:18:52 +0100 (Wed, 16 Jul 2008) | 1 line Addresses almost all of rjek and jmb's concerns, fixes most of the sloppiness that was present earlier. Downloads without a total_size are now handled correctly (thanks tlsa). Changes to the default download directly are now saved correctly. Billions of other small bugs fixed ........ svn path=/trunk/netsurf/; revision=4681
Diffstat (limited to 'gtk/gtk_scaffolding.c')
-rw-r--r--gtk/gtk_scaffolding.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c
index 66eefc837..c13acbad5 100644
--- a/gtk/gtk_scaffolding.c
+++ b/gtk/gtk_scaffolding.c
@@ -102,6 +102,7 @@ struct menu_events {
static int open_windows = 0; /**< current number of open browsers */
static struct gtk_scaffolding *current_model; /**< current window for model dialogue use */
+static gboolean nsgtk_window_delete_event(GtkWidget *, gpointer);
static void nsgtk_window_destroy_event(GtkWidget *, gpointer);
static void nsgtk_window_update_back_forward(struct gtk_scaffolding *);
@@ -233,6 +234,14 @@ void nsgtk_attach_menu_handlers(GladeXML *xml, gpointer g)
/* event handlers and support functions for them */
+gboolean nsgtk_window_delete_event(GtkWidget *widget, gpointer data)
+{
+ if (open_windows == 1 && nsgtk_check_for_downloads(GTK_WINDOW(widget)))
+ return TRUE;
+ else
+ return FALSE;
+}
+
void nsgtk_window_destroy_event(GtkWidget *widget, gpointer data)
{
struct gtk_scaffolding *g = data;
@@ -469,20 +478,24 @@ MENUHANDLER(close_window)
MENUHANDLER(quit)
{
- netsurf_quit = true;
+ struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
+
+ if (!nsgtk_check_for_downloads(gw->window))
+ netsurf_quit = true;
return TRUE;
}
MENUHANDLER(cut)
{
struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
+ struct browser_window *bw = nsgtk_get_browser_for_gui(gw->top_level);
GtkWidget *focused = gtk_window_get_focus(gw->window);
/* If the url bar has focus, let gtk handle it */
if (GTK_IS_EDITABLE (focused))
gtk_editable_cut_clipboard (GTK_EDITABLE(gw->url_bar));
else
- /* TODO: Implement Cut functionality */;
+ browser_window_key_press(bw, 24);
}
MENUHANDLER(copy)
@@ -630,7 +643,8 @@ MENUHANDLER(status_bar)
MENUHANDLER(downloads)
{
- nsgtk_download_show();
+ struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
+ nsgtk_download_show(gw->window);
return TRUE;
}
@@ -876,7 +890,7 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
g->status_pane = GTK_PANED(GET_WIDGET("hpaned1"));
g->preferences_dialog = NULL;
-
+
/* set this window's size and position to what's in the options, or
* or some sensible default if they're not set yet.
*/
@@ -964,6 +978,7 @@ nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
gtk_widget_hide_on_delete, NULL);
/* connect signals to handlers. */
+ CONNECT(g->window, "delete-event", nsgtk_window_delete_event, NULL);
CONNECT(g->window, "destroy", nsgtk_window_destroy_event, g);
/* toolbar, URL bar, and menu bar signal handlers */
@@ -1101,6 +1116,11 @@ gboolean nsgtk_scaffolding_is_busy(struct gtk_scaffolding *scaffold)
return GTK_WIDGET_SENSITIVE((GTK_WIDGET(scaffold->stop_button)));
}
+GtkWindow* nsgtk_scaffolding_get_window (struct gui_window *g)
+{
+ return g->scaffold->window;
+}
+
void nsgtk_scaffolding_popup_menu(struct gtk_scaffolding *g, guint button)
{
nsgtk_scaffolding_update_edit_actions_sensitivity(g, g->popup_xml, TRUE);