summaryrefslogtreecommitdiffstats
path: root/gtk/src/main.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-04-09 18:17:51 +0000
committerjstebbins <[email protected]>2010-04-09 18:17:51 +0000
commit31916b1e9e513a4791587fb133cb076d61559715 (patch)
tree1f31a34f7ba2df5f4e726240cecff0e8f77607d0 /gtk/src/main.c
parent50fe6dd131c74884207ed10e660de6351024ef56 (diff)
LinGui: allow multiple instances of the gui to run
Each instance has a queue named "queue.<pid>". On startup, the gui opens and locks with lockf a file "ghb.pid.<pid>". Then it searches for any other ghb.pid.<pid> files that exist that are not locked. If it finds one, then some instance of ghb exited and may have left behind a queue. Try to reload it. If there are no items in the queue, continue looking for unlocked ghb.pid.<pid> files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3212 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/main.c')
-rw-r--r--gtk/src/main.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/gtk/src/main.c b/gtk/src/main.c
index a6a12fc9d..aade07e06 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -698,21 +698,7 @@ 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);
- }
+ ghb_write_pid_file();
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);