[Xfce4-commits] [apps/xfce4-taskmanager] 13/21: show info dialog on error. Icon for dialog missing

noreply at xfce.org noreply at xfce.org
Thu Jan 26 22:59:17 CET 2017


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/xfce4-taskmanager.

commit 8c15f28beb4cfb50366ec46bbf8595d109572a1d
Author: Florian Schüller <florian.schueller at gmail.com>
Date:   Tue Jan 24 23:52:37 2017 +0100

    show info dialog on error. Icon for dialog missing
---
 src/process-window.c | 11 +++++++----
 src/process-window.h |  8 ++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/process-window.c b/src/process-window.c
index fe31518..a6b08d9 100644
--- a/src/process-window.c
+++ b/src/process-window.c
@@ -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
diff --git a/src/process-window.h b/src/process-window.h
index 6b19c0e..617b84c 100644
--- a/src/process-window.h
+++ b/src/process-window.h
@@ -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;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list