summaryrefslogtreecommitdiffstats
path: root/src/application.c
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-22 19:09:22 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-22 19:09:22 (EDT)
commit8fc032f2f64f4b7eb022adb0b1255a5a68df109f (patch)
tree31094e678eba9fc4a828ddb8a2948d105ff898bc /src/application.c
parent927c4ea37ca967e61831164bb4b7ea33e28e0d9d (diff)
parenta0b9288a5e6fa943a6f2b7f418a12343649ed454 (diff)
downloadmarquee-8fc032f2f64f4b7eb022adb0b1255a5a68df109f.zip
marquee-8fc032f2f64f4b7eb022adb0b1255a5a68df109f.tar.gz
marquee-8fc032f2f64f4b7eb022adb0b1255a5a68df109f.tar.bz2
Merge branch 'gobjectification'
Diffstat (limited to 'src/application.c')
-rw-r--r--src/application.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/application.c b/src/application.c
index f5edc7f..0047b0c 100644
--- a/src/application.c
+++ b/src/application.c
@@ -19,17 +19,25 @@
* along with Marquee. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "application.h"
+
#include <stdlib.h>
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
-#include "application.h"
+#include "about.h"
#include "config.h"
#include "web-settings.h"
-#include "about.h"
#include "window.h"
+struct MqApplication {
+ GList *windows;
+ MqConfig *config;
+ WebKitSettings *settings;
+ gboolean marquee_mode;
+};
+
static void
set_webkit_settings(MqApplication *application)
{
@@ -122,9 +130,15 @@ mq_application_quit(MqApplication *application, GtkWindow *parent)
}
/* Message */
- message = g_strdup_printf("You are about to close %d tabs "
- "in %d windows. Are you sure you want to continue?",
- num_tabs, num_windows);
+ if (num_windows == 1) {
+ message = g_strdup_printf("You are about to close %d tabs "
+ "in %d window. Are you sure you want to continue?",
+ num_tabs, num_windows);
+ } else {
+ message = g_strdup_printf("You are about to close %d tabs "
+ "in %d windows. Are you sure you want to continue?",
+ num_tabs, num_windows);
+ }
message_label = gtk_label_new(message);
g_free(message);
@@ -163,6 +177,8 @@ mq_application_quit(MqApplication *application, GtkWindow *parent)
hbox);
g_signal_connect(dialog, "response",
G_CALLBACK(quit_confirm_response_cb), NULL);
+ gtk_widget_grab_focus(gtk_dialog_get_widget_for_response(
+ GTK_DIALOG(dialog), GTK_RESPONSE_OK));
gtk_widget_show_all(dialog);
return;