From ad0b52c35138be606b2fa1bb92c4c8d54a7b4cd3 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 22 Jan 2010 10:29:25 +0100 Subject: GUI: don't send comment and how_to if user didn't change it - otherwise we send the useles default texts to bugzilla --- src/Gui/CCReporterDialog.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 023cc6e..3884106 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -20,6 +20,10 @@ from abrt_utils import _, log, log1, log2 REFRESH = -50 SHOW_LOG = -60 +# default texts +COMMENT_HINT_TEXT = _("Brief description how to reproduce this or what you did...") +HOW_TO_HINT_TEXT = "1.\n2.\n3.\n" + class ReporterDialog(): """Reporter window""" def __init__(self, report, daemon, log=None, parent=None): @@ -202,8 +206,8 @@ class ReporterDialog(): def hydrate(self): self.editable = [] - self.old_comment = "" - self.old_how_to_reproduce = "" + self.old_comment = COMMENT_HINT_TEXT + self.old_how_to_reproduce = HOW_TO_HINT_TEXT for item in self.report: try: log2("report[%s]:%s/%s/%s", item, self.report[item][0], self.report[item][1], self.report[item][2][0:20]) @@ -261,16 +265,16 @@ class ReporterDialog(): #end for buff = gtk.TextBuffer() - self.show_hint_comment = (self.old_comment == "") + self.show_hint_comment = (self.old_comment == COMMENT_HINT_TEXT) if self.show_hint_comment: - buff.set_text(_("Brief description how to reproduce this or what you did...")) + buff.set_text(COMMENT_HINT_TEXT) else: buff.set_text(self.old_comment) self.tvComment.set_buffer(buff) buff = gtk.TextBuffer() if self.old_how_to_reproduce == "": - buff.set_text("1.\n2.\n3.\n") + buff.set_text(HOW_TO_HINT_TEXT) else: buff.set_text(self.old_how_to_reproduce) self.tevHowToReproduce.set_buffer(buff) -- cgit From eec9317720482bd5a12b3fdcbb64ace9eb73afb5 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 22 Jan 2010 14:05:53 +0100 Subject: GUI: small reorganization in report message dialog --- src/Gui/CC_gui_functions.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index e226021..708a151 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -43,18 +43,18 @@ def gui_report_dialog ( report_status_dict, parent_dialog, message = "" status_vbox = gtk.VBox() for plugin, res in report_status_dict.iteritems(): - status_hbox = gtk.HBox() - plugin_label = Label() + plugin_status_vbox = gtk.VBox() + plugin_label = gtk.Label() plugin_label.set_markup("%s: " % plugin) plugin_label.set_justify(gtk.JUSTIFY_RIGHT) plugin_label.set_alignment(0, 0) - status_label = Label() + status_label = gtk.Label() status_label.set_max_width_chars(MAX_WIDTH) status_label.set_selectable(True) status_label.set_line_wrap(True) status_label.set_alignment(0, 0) - status_hbox.pack_start(plugin_label, expand=False) - status_hbox.pack_start(status_label, expand=False) + plugin_status_vbox.pack_start(plugin_label, expand=False) + plugin_status_vbox.pack_start(status_label, expand=False) # 0 means not succesfull #if report_status_dict[plugin][0] == '0': # this first one is actually a fallback to set at least @@ -73,7 +73,7 @@ def gui_report_dialog ( report_status_dict, parent_dialog, status_label.set_text("%s" % report_status_dict[plugin][1]) if len(report_status_dict[plugin][1]) > MAX_WIDTH: status_label.set_tooltip_text(report_status_dict[plugin][1]) - status_vbox.pack_start(status_hbox, expand=False) + status_vbox.pack_start(plugin_status_vbox, expand=False) main_hbox.pack_start(status_vbox) if widget != None: -- cgit From 5011d6c48f59a451b6141f8cabdb8fe842556ff1 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 22 Jan 2010 14:51:55 +0100 Subject: GUI: hide the attachment checkboxes - we don't use the YET anymore --- src/Gui/CCReporterDialog.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 3884106..74cf37e 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -249,7 +249,10 @@ class ReporterDialog(): vbAttachments.pack_start(toggle) # bind item to checkbox toggle.item = item - toggle.show() + #FIXME: temporary workaround, in 1.0.4 reporters don't care + # about this, they just send what they want to + # TicketUploader even sends coredump!! + #toggle.show() continue # It must be CD_TXT field -- cgit From 97a21512ea34a2cc2931516033681e3d75436349 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 22 Jan 2010 15:44:24 +0100 Subject: remove unused getuidbyname Signed-off-by: Denys Vlasenko --- src/Daemon/MiddleWare.cpp | 12 +++++------- src/Daemon/MiddleWare.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 9abb737..40bee1a 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -696,7 +696,7 @@ bool analyzer_has_InformAllUsers(const char *analyzer_name) return string_to_bool(it->second.c_str()); } -bool analyzer_has_AutoReportUIDs(const char *analyzer_name, const char* uid) +bool analyzer_has_AutoReportUIDs(const char *analyzer_name, const char *uid_str) { CAnalyzer* analyzer = g_pPluginManager->GetAnalyzer(analyzer_name); if (!analyzer) @@ -715,16 +715,14 @@ bool analyzer_has_AutoReportUIDs(const char *analyzer_name, const char* uid) vector_string_t logins; parse_args(it->second.c_str(), logins); + uid_t uid = xatoi_u(uid_str); unsigned size = logins.size(); - if (size == 0) - return false; - for (unsigned ii = 0; ii < size; ii++) { - uid_t id = getuidbyname(logins[ii].c_str()) - if (id == (uid_t)-1) + struct passwd* pw = getpwnam(logins[ii].c_str()); + if (!pw) continue; - if (strcmp(uid, to_string(id).c_str()) == 0) + if (pw->pw_uid == uid) return true; } */ diff --git a/src/Daemon/MiddleWare.h b/src/Daemon/MiddleWare.h index 5fab84d..71d17f3 100644 --- a/src/Daemon/MiddleWare.h +++ b/src/Daemon/MiddleWare.h @@ -152,7 +152,7 @@ void AddActionOrReporter(const char *pActionOrReporter, bool analyzer_has_InformAllUsers(const char *analyzer_name); -bool analyzer_has_AutoReportUIDs(const char *analyzer_name, const char* uid); +bool analyzer_has_AutoReportUIDs(const char *analyzer_name, const char *uid_str); void autoreport(const pair_string_string_t& reporter_options, const map_crash_data_t& crash_report); #endif /*MIDDLEWARE_H_*/ -- cgit