show info dialog on error. Icon for dialog missing
This commit is contained in:
committed by
Simon Steinbeiss
parent
0cdda50a28
commit
8c15f28beb
@@ -167,19 +167,22 @@ xwininfo_clicked_cb (GtkButton *button, gpointer user_data) {
|
||||
&actual_format, &_nitems, &bytes_after,
|
||||
&prop);
|
||||
if (status == BadWindow) {
|
||||
g_warning("window id # 0x%lx does not exists!", selected_window);
|
||||
XTM_SHOW_MESSAGE(GTK_MESSAGE_INFO,
|
||||
_("Bad Window"), _("Window id 0x%lx does not exist!"), selected_window);
|
||||
} if (status != Success) {
|
||||
g_warning("XGetWindowProperty failed!");
|
||||
XTM_SHOW_MESSAGE(GTK_MESSAGE_ERROR,
|
||||
_("XGetWindowProperty failed"), _("XGetWindowProperty failed!"));
|
||||
} else {
|
||||
if (_nitems > 0) {
|
||||
pid = (guint) *((unsigned long*)prop);
|
||||
g_warning("PID: %d", pid);
|
||||
xtm_process_tree_view_highlight_pid(XTM_PROCESS_TREE_VIEW (window->treeview), pid);
|
||||
} else {
|
||||
g_warning("No Pid found");
|
||||
XTM_SHOW_MESSAGE(GTK_MESSAGE_INFO,
|
||||
_("No PID found"), _("No PID found for window 0x%lx."), selected_window);
|
||||
}
|
||||
g_free(prop);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
#define XTM_IS_PROCESS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XTM_TYPE_PROCESS_WINDOW))
|
||||
#define XTM_IS_PROCESS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XTM_TYPE_PROCESS_WINDOW))
|
||||
#define XTM_PROCESS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XTM_TYPE_PROCESS_WINDOW, XtmProcessWindowClass))
|
||||
#define XTM_SHOW_MESSAGE(type, title, message, ...) { \
|
||||
GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, type, GTK_BUTTONS_OK, title); \
|
||||
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), message , ## __VA_ARGS__ ); \
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), _("Task Manager")); \
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); \
|
||||
gtk_dialog_run (GTK_DIALOG (dialog)); \
|
||||
gtk_widget_destroy (dialog); \
|
||||
}
|
||||
|
||||
typedef struct _XtmProcessWindow XtmProcessWindow;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user