GtkEntry *entry;
gchar *destname;
gchar *basename;
+ GtkWindow *hb_window;
g_debug("destination_browse_clicked_cb ()");
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
destname = ghb_settings_get_string(ud->settings, "destination");
- dialog = gtk_file_chooser_dialog_new ("Choose Destination",
- NULL,
+ dialog = gtk_file_chooser_dialog_new("Choose Destination",
+ hb_window,
GTK_FILE_CHOOSER_ACTION_SAVE,
GHB_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GHB_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
signal_user_data_t *ud,
gint timeout)
{
+ GtkWindow *hb_window;
GtkWidget *dialog;
GtkResponseType response;
guint timeout_id;
cd.ud = ud;
// Toss up a warning dialog
- dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
+ dialog = gtk_message_dialog_new(hb_window, GTK_DIALOG_MODAL,
type, GTK_BUTTONS_NONE,
_("%s\n\n%s in %d seconds ..."),
message, action, timeout);
}
gboolean
-ghb_message_dialog(GtkMessageType type, const gchar *message, const gchar *no, const gchar *yes)
+ghb_message_dialog(GtkWindow *parent, GtkMessageType type, const gchar *message, const gchar *no, const gchar *yes)
{
GtkWidget *dialog;
GtkResponseType response;
// Toss up a warning dialog
- dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL,
type, GTK_BUTTONS_NONE,
"%s", message);
gtk_dialog_add_buttons( GTK_DIALOG(dialog),
}
void
-ghb_error_dialog(GtkMessageType type, const gchar *message, const gchar *cancel)
+ghb_error_dialog(GtkWindow *parent, GtkMessageType type, const gchar *message, const gchar *cancel)
{
GtkWidget *dialog;
// Toss up a warning dialog
- dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL,
type, GTK_BUTTONS_NONE,
"%s", message);
gtk_dialog_add_buttons( GTK_DIALOG(dialog),
void
ghb_cancel_encode(signal_user_data_t *ud, const gchar *extra_msg)
{
+ GtkWindow *hb_window;
GtkWidget *dialog;
GtkResponseType response;
if (extra_msg == NULL) extra_msg = "";
// Toss up a warning dialog
- dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
+ dialog = gtk_message_dialog_new(hb_window, GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
_("%sYour movie will be lost if you don't continue encoding."),
extra_msg);
gboolean
ghb_cancel_encode2(signal_user_data_t *ud, const gchar *extra_msg)
{
+ GtkWindow *hb_window;
GtkWidget *dialog;
GtkResponseType response;
if (extra_msg == NULL) extra_msg = "";
// Toss up a warning dialog
- dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
+ dialog = gtk_message_dialog_new(hb_window, GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
_("%sYour movie will be lost if you don't continue encoding."),
extra_msg);
ghb_settings_set_string(ud->settings, tweak_name, tweak);
else
{
+ GtkWindow *hb_window;
gchar *message;
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
message = g_strdup_printf(
_("Invalid Settings:\n%s"),
tweak);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(hb_window, GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
g_free(message);
}
}
gboolean ghb_file_menu_add_dvd(signal_user_data_t *ud);
void ghb_udev_init(void);
gboolean ghb_message_dialog(
- GtkMessageType type, const gchar *message,
+ GtkWindow *parent, GtkMessageType type, const gchar *message,
const gchar *no, const gchar *yes);
void ghb_error_dialog(
- GtkMessageType type, const gchar *message, const gchar *cancel);
+ GtkWindow *parent, GtkMessageType type,
+ const gchar *message, const gchar *cancel);
void ghb_init_dep_map(void);
void ghb_cancel_encode(signal_user_data_t *ud, const gchar *extra_msg);
gboolean ghb_cancel_encode2(signal_user_data_t *ud, const gchar *extra_msg);
<property name="page_increment">1</property>
</object>
<object class="GtkAboutDialog" id="hb_about">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">About HandBrake</property>
<property name="page_increment">10</property>
</object>
<object class="GtkDialog" id="titla_add_multiple_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox">
</action-widgets>
</object>
<object class="GtkDialog" id="prefs_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">Preferences</property>
</action-widgets>
</object>
<object class="GtkDialog" id="preset_new_folder_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
</action-widgets>
</object>
<object class="GtkDialog" id="preset_save_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
</action-widgets>
</object>
<object class="GtkDialog" id="subtitle_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="modal">True</property>
</action-widgets>
</object>
<object class="GtkDialog" id="audio_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="modal">True</property>
</action-widgets>
</object>
<object class="GtkDialog" id="update_dialog">
+ <property name="transient_for">hb_window</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="modal">True</property>
}
gboolean
-ghb_validate_filters(GValue *settings)
+ghb_validate_filters(GValue *settings, GtkWindow *parent)
{
gchar *str;
gint index;
message = g_strdup_printf(
_("Invalid Deinterlace Settings:\n\n%s\n"),
str);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(parent, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
g_free(str);
return FALSE;
message = g_strdup_printf(
_("Invalid Detelecine Settings:\n\n%s\n"),
str);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(parent, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
g_free(str);
return FALSE;
message = g_strdup_printf(
_("Invalid Decomb Settings:\n\n%s\n"),
str);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(parent, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
g_free(str);
return FALSE;
}
gboolean
-ghb_validate_video(GValue *settings)
+ghb_validate_video(GValue *settings, GtkWindow *parent)
{
gint vcodec;
gchar *message;
_("Theora is not supported in the MP4 container.\n\n"
"You should choose a different video codec or container.\n"
"If you continue, FFMPEG will be chosen for you."));
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue")))
+ if (!ghb_message_dialog(parent, GTK_MESSAGE_WARNING,
+ message, _("Cancel"), _("Continue")))
{
g_free(message);
return FALSE;
}
gboolean
-ghb_validate_subtitles(GValue *settings)
+ghb_validate_subtitles(GValue *settings, GtkWindow *parent)
{
gint title_id, titleindex;
const hb_title_t * title;
_("Only one subtitle may be burned into the video.\n\n"
"You should change your subtitle selections.\n"
"If you continue, some subtitles will be lost."));
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue")))
+ if (!ghb_message_dialog(parent, GTK_MESSAGE_WARNING,
+ message, _("Cancel"), _("Continue")))
{
g_free(message);
return FALSE;
_("Srt file does not exist or not a regular file.\n\n"
"You should choose a valid file.\n"
"If you continue, this subtitle will be ignored."));
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message,
+ if (!ghb_message_dialog(parent, GTK_MESSAGE_WARNING, message,
_("Cancel"), _("Continue")))
{
g_free(message);
}
gboolean
-ghb_validate_audio(GValue *settings)
+ghb_validate_audio(GValue *settings, GtkWindow *parent)
{
gint title_id, titleindex;
const hb_title_t * title;
_("The source does not support Pass-Thru.\n\n"
"You should choose a different audio codec.\n"
"If you continue, one will be chosen for you."));
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue")))
+ if (!ghb_message_dialog(parent, GTK_MESSAGE_WARNING,
+ message, _("Cancel"), _("Continue")))
{
g_free(message);
return FALSE;
_("%s is not supported in the %s container.\n\n"
"You should choose a different audio codec.\n"
"If you continue, one will be chosen for you."), a_unsup, mux_s);
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue")))
+ if (!ghb_message_dialog(parent, GTK_MESSAGE_WARNING,
+ message, _("Cancel"), _("Continue")))
{
g_free(message);
return FALSE;
_("The source audio does not support %s mixdown.\n\n"
"You should choose a different mixdown.\n"
"If you continue, one will be chosen for you."), mix_unsup);
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message, _("Cancel"), _("Continue")))
+ if (!ghb_message_dialog(parent, GTK_MESSAGE_WARNING,
+ message, _("Cancel"), _("Continue")))
{
g_free(message);
return FALSE;
const gchar* ghb_subtitle_track_lang(GValue *settings, gint track);
gboolean ghb_validate_vquality(GValue *settings);
-gboolean ghb_validate_audio(GValue *settings);
-gboolean ghb_validate_subtitles(GValue *settings);
-gboolean ghb_validate_video(GValue *settings);
-gboolean ghb_validate_filters(GValue *settings);
+gboolean ghb_validate_audio(GValue *settings, GtkWindow *parent);
+gboolean ghb_validate_subtitles(GValue *settings, GtkWindow *parent);
+gboolean ghb_validate_video(GValue *settings, GtkWindow *parent);
+gboolean ghb_validate_filters(GValue *settings, GtkWindow *parent);
gboolean ghb_validate_filter_string(const gchar *str, gint max_fields);
void ghb_hb_cleanup(gboolean partial);
gint ghb_lookup_combo_int(const gchar *name, const GValue *gval);
{
if (ghb_presets_get_folder(presetsPlist, indices, len))
{
+ GtkWindow *hb_window;
gchar *message;
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
message = g_strdup_printf(
_("%s: Folder already exists.\n"
"You can not replace it with a preset."),
name);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(hb_window, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
return;
}
{
if (!ghb_presets_get_folder(presetsPlist, indices, len))
{
+ GtkWindow *hb_window;
gchar *message;
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
message = g_strdup_printf(
_("%s: Preset already exists.\n"
"You can not replace it with a folder."),
name);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(hb_window, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
g_free(indices);
return;
//printf("element\n");
if (gst_is_missing_plugin_message(msg))
{
+ GtkWindow *hb_window;
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
gst_element_set_state(ud->preview->play, GST_STATE_PAUSED);
gchar *message, *desc;
desc = gst_missing_plugin_message_get_description(msg);
_("Missing GStreamer plugin\n"
"Audio or Video may not play as expected\n\n%s"),
desc);
- ghb_message_dialog(GTK_MESSAGE_WARNING, message, "Ok", NULL);
+ ghb_message_dialog(hb_window, GTK_MESSAGE_WARNING,
+ message, "Ok", NULL);
g_free(message);
gst_element_set_state(ud->preview->play, GST_STATE_PLAYING);
}
gint count, ii;
gint title_id, titleindex;
const hb_title_t *title;
+ GtkWindow *hb_window;
+
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
title_id = ghb_settings_get_int(settings, "title");
title = ghb_lookup_title(title_id, &titleindex);
"Another queued job has specified the same destination.\n"
"Do you want to overwrite?"),
dest);
- if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("Cancel"), _("Overwrite")))
+ if (!ghb_message_dialog(hb_window, GTK_MESSAGE_QUESTION,
+ message, _("Cancel"), _("Overwrite")))
{
g_free(message);
return FALSE;
_("Destination: %s\n\n"
"This is not a valid directory."),
destdir);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(hb_window, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
g_free(destdir);
return FALSE;
_("Destination: %s\n\n"
"Can not read or write the directory."),
destdir);
- ghb_message_dialog(GTK_MESSAGE_ERROR, message, _("Cancel"), NULL);
+ ghb_message_dialog(hb_window, GTK_MESSAGE_ERROR,
+ message, _("Cancel"), NULL);
g_free(message);
g_free(destdir);
return FALSE;
_("Destination filesystem is almost full: %uM free\n\n"
"Encode may be incomplete if you proceed.\n"),
(guint)(size / (1024L*1024L)));
- if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("Cancel"), _("Proceed")))
+ if (!ghb_message_dialog(hb_window, GTK_MESSAGE_QUESTION,
+ message, _("Cancel"), _("Proceed")))
{
g_free(message);
g_free(destdir);
"File already exists.\n"
"Do you want to overwrite?"),
dest);
- if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("Cancel"), _("Overwrite")))
+ if (!ghb_message_dialog(hb_window, GTK_MESSAGE_QUESTION,
+ message, _("Cancel"), _("Overwrite")))
{
g_free(message);
return FALSE;
g_unlink(dest);
}
// Validate audio settings
- if (!ghb_validate_audio(settings))
+ if (!ghb_validate_audio(settings, hb_window))
{
return FALSE;
}
// Validate audio settings
- if (!ghb_validate_subtitles(settings))
+ if (!ghb_validate_subtitles(settings, hb_window))
{
return FALSE;
}
// Validate video settings
- if (!ghb_validate_video(settings))
+ if (!ghb_validate_video(settings, hb_window))
{
return FALSE;
}
// Validate filter settings
- if (!ghb_validate_filters(settings))
+ if (!ghb_validate_filters(settings, hb_window))
{
return FALSE;
}
if (unfinished)
{
+ GtkWindow *hb_window;
+ hb_window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
message = g_strdup_printf(
_("You have %d unfinished job(s) in a saved queue.\n\n"
"Would you like to reload them?"), unfinished);
- if (ghb_message_dialog(GTK_MESSAGE_QUESTION, message, _("No"), _("Yes")))
+ if (ghb_message_dialog(hb_window, GTK_MESSAGE_QUESTION,
+ message, _("No"), _("Yes")))
{
GtkWidget *widget = GHB_WIDGET(ud->builder, "show_queue");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), TRUE);