Commit d6130d1e authored by Claes Sjofors's avatar Claes Sjofors

Xtt error message dialog parent fix

parent 86ff568a
...@@ -325,11 +325,11 @@ static gboolean displayerror_remove_cb( void *data) ...@@ -325,11 +325,11 @@ static gboolean displayerror_remove_cb( void *data)
void CoWowGtk::DisplayError( const char *title, const char *text, lng_eCoding coding) void CoWowGtk::DisplayError( const char *title, const char *text, lng_eCoding coding)
{ {
GtkWidget *parent = m_parent; GtkWindow *parent;
if ( parent) { if ( m_parent)
while( !GTK_IS_WINDOW(parent)) parent = GTK_WINDOW(gtk_widget_get_toplevel( m_parent));
parent = gtk_widget_get_parent( parent); else
} parent = 0;
char *ctext; char *ctext;
if ( coding != lng_eCoding_UTF_8) { if ( coding != lng_eCoding_UTF_8) {
...@@ -340,7 +340,7 @@ void CoWowGtk::DisplayError( const char *title, const char *text, lng_eCoding co ...@@ -340,7 +340,7 @@ void CoWowGtk::DisplayError( const char *title, const char *text, lng_eCoding co
else else
ctext = (char *)text; ctext = (char *)text;
GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(parent), GtkWidget *dialog = gtk_message_dialog_new( parent,
GTK_DIALOG_MODAL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR, GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK, ctext); GTK_BUTTONS_OK, ctext);
...@@ -1872,4 +1872,4 @@ void CoWowGtk::update_title( GtkWidget *w, int editmode) ...@@ -1872,4 +1872,4 @@ void CoWowGtk::update_title( GtkWidget *w, int editmode)
g_object_set( w, "title", new_title, NULL); g_object_set( w, "title", new_title, NULL);
} }
} }
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment