From ebd0025f033ecf8f21d42e6a2c80ac312ec8116f Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 27 Feb 2009 16:01:57 +0100 Subject: - fixed few gcc warnings - added scrolled window for long reports - fixes for all issues identified in review (awilliam@redhat.com) --- src/Daemon/CrashWatcher.cpp | 6 +- src/Daemon/Makefile.am | 2 +- src/Gui/CCDBusBackend.py | 2 - src/Gui/CCMainWindow.py | 6 +- src/Gui/CCReporterDialog.py | 13 ++- src/Gui/cc-gui | 1 + src/Gui/ccgui.glade | 245 +++++++++++++++++++++++++++++++++++++++++++- 7 files changed, 260 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index d524e99..c06ad01 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -44,7 +44,7 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition, //char *buf = malloc(INOTIFY_BUFF_SIZE; char *buf = new char[INOTIFY_BUFF_SIZE]; gsize len; - int i = 0; + gsize i = 0; err = g_io_channel_read (gio, buf, INOTIFY_BUFF_SIZE, &len); if (err != G_IO_ERROR_NONE) { g_warning ("Error reading inotify fd: %d\n", err); @@ -52,7 +52,7 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition, } /* reconstruct each event and send message to the dbus */ while (i < len) { - const char *name; + const char *name = NULL; struct inotify_event *event; event = (struct inotify_event *) &buf[i]; @@ -220,8 +220,6 @@ void CCrashWatcher::StartWatch() /* daemon loop with glib */ void CCrashWatcher::GStartWatch() { - char action[FILENAME_MAX]; - struct inotify_event *pevent; g_io_add_watch (m_nGio, G_IO_IN, handle_event_cb, this); //enter the event loop g_main_run (m_nMainloop); diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am index a9486bc..8a88fbc 100644 --- a/src/Daemon/Makefile.am +++ b/src/Daemon/Makefile.am @@ -1,7 +1,7 @@ sbin_PROGRAMS = crash-catcher crash_catcher_SOURCES = CrashWatcher.cpp CrashWatcher.h Daemon.cpp DBusServerProxy.h \ DBusCommon.h -crash_catcher_CPPFLAGS = -I../../lib/MiddleWare\ +crash_catcher_CPPFLAGS = -Wall -Werror -I../../lib/MiddleWare\ -I../../lib/DBus \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(DBUS_GLIB_CFLAGS) $(DBUSCPP_CFLAGS) \ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index 2235e78..f1d6ed1 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import dbus import gobject from dbus.mainloop.glib import DBusGMainLoop diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index ab2e171..0c589f6 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - import sys import pygtk pygtk.require("2.0") @@ -14,7 +12,6 @@ from CCReport import Report def cb(self, *args): pass - class MainWindow(): def __init__(self): try: @@ -146,8 +143,7 @@ class MainWindow(): def on_bQuit_clicked(self, button): gtk.main_quit() - - + if __name__ == "__main__": cc = MainWindow() cc.hydrate() diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 26a6b09..4119d11 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -1,6 +1,6 @@ import pygtk pygtk.require("2.0") -import gtk +import gtk #, pango import gtk.glade import sys from CC_gui_functions import * @@ -35,6 +35,8 @@ class ReporterDialog(): self.tvReport.append_column(column) renderer = gtk.CellRendererText() + #renderer.props.wrap_mode = pango.WRAP_WORD + #renderer.props.wrap_width = 600 column = gtk.TreeViewColumn('Value', renderer, text=1, editable=2) self.tvReport.append_column(column) renderer.connect('edited',self.column_edited,self.reportListStore) @@ -43,8 +45,15 @@ class ReporterDialog(): #self.wTree.get_widget("bApply").connect("clicked", self.on_apply_clicked, self.tvReport) #self.wTree.get_widget("bCancel").connect("clicked", self.on_cancel_clicked, self.tvReport) + self.tvReport.connect_after("size-allocate", self.on_window_resize) + self.hydrate() - + + def on_window_resize(self, treeview, allocation): + # multine support + pass + #print allocation + def column_edited(self, cell, path, new_text, model): # 1 means the second cell model[path][1] = new_text diff --git a/src/Gui/cc-gui b/src/Gui/cc-gui index f11d434..cd6339f 100644 --- a/src/Gui/cc-gui +++ b/src/Gui/cc-gui @@ -1,3 +1,4 @@ +#! /bin/sh export PYTHONPATH=/usr/share/crash-catcher export XLOGNAME=$LOGNAME exec /usr/bin/python /usr/share/crash-catcher/CCMainWindow.py "$@" diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 71bad72..8fbd946 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -1,6 +1,6 @@ - + 640 @@ -708,4 +708,247 @@ + + Crash-catcher + GTK_WIN_POS_CENTER + + + True + + + True + + + True + _File + True + + + True + + + True + gtk-new + True + True + + + + + True + gtk-open + True + True + + + + + True + gtk-save + True + True + + + + + True + gtk-save-as + True + True + + + + + True + + + + + True + gtk-quit + True + True + + + + + + + + + True + _Edit + True + + + True + + + True + gtk-cut + True + True + + + + + True + gtk-copy + True + True + + + + + True + gtk-paste + True + True + + + + + True + gtk-delete + True + True + + + + + + + + + True + _View + True + + + + + True + _Help + True + + + True + + + True + gtk-about + True + True + + + + + + + + + False + + + + + True + + + True + 10 + True + + + True + True + True + gtk-delete + True + 0 + + + + + True + True + True + button + 0 + + + 1 + + + + + True + + + + + + 2 + + + + + + + True + True + + + True + + + + + + + + True + True + True + gtk-quit + True + 0 + + + 1 + + + + + 1 + + + + + False + 1 + + + + + True + True + + + 2 + + + + + True + 2 + + + False + 3 + + + + + -- cgit