diff options
author | jstebbins <[email protected]> | 2009-10-04 18:00:57 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-10-04 18:00:57 +0000 |
commit | 61ee5dd5277eedea8328666bba251ecd0d3af0dd (patch) | |
tree | 85af80075d3ae2215ee6b5199f07654cb60c2ccf /gtk/src/main.c | |
parent | f8e172dedf803e358ea05bbd5fbe0e3498cbf9ae (diff) |
LinGui: create a queue lock file to prevent simultaneous access to the queue
from 2 running instances of ghb
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2869 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/main.c')
-rw-r--r-- | gtk/src/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk/src/main.c b/gtk/src/main.c index efc2fbc99..2c732079e 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -697,6 +697,21 @@ main (int argc, char *argv[]) ghb_hal_init(); #endif + if (!ghb_lock_file("queue_lock")) + { + const gchar *markup = + N_("<b><big>Another instance of HandBrake is already running.</big></b>\n" + "\n" + "Only one instance of HandBrake may run.\n"); + GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL, + GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _(markup)); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); + exit(EXIT_FAILURE); + } ud = g_malloc0(sizeof(signal_user_data_t)); ud->debug = ghb_debug; g_log_set_handler (NULL, G_LOG_LEVEL_DEBUG, debug_log_handler, ud); |