summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@localhost.localdomain>2009-11-18 23:37:16 +0100
committerJiri Moskovcak <jmoskovc@localhost.localdomain>2009-11-18 23:37:16 +0100
commit3eab7d8376f269d480a6e12ef2d97b421993e7d7 (patch)
tree1bf4cd6243ee5ce2694801a6f474c7b47df14487
parente8a1a7159416e7a7a343666baae8668f4eeb5209 (diff)
downloadabrt-3eab7d8376f269d480a6e12ef2d97b421993e7d7.tar.gz
abrt-3eab7d8376f269d480a6e12ef2d97b421993e7d7.tar.xz
abrt-3eab7d8376f269d480a6e12ef2d97b421993e7d7.zip
GUI: added cancel to send dialog rhbz#537238
-rw-r--r--src/Gui/CCReporterDialog.py16
-rw-r--r--src/Gui/CC_gui_functions.py2
-rw-r--r--src/Gui/report.glade2
3 files changed, 12 insertions, 8 deletions
diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py
index 83d1c777..078fdd09 100644
--- a/src/Gui/CCReporterDialog.py
+++ b/src/Gui/CCReporterDialog.py
@@ -79,7 +79,6 @@ class ReporterDialog():
self.tvReport.insert_column(column,0)
# connect the signals
self.tvReport.connect_after("size-allocate", self.on_window_resize)
- self.wTree.get_widget("bSend").connect("clicked", self.on_send_clicked)
# start with the warning hidden, so it's not visible when there is no rating
self.wTree.get_widget("ebErrors").hide()
self.hydrate()
@@ -88,10 +87,10 @@ class ReporterDialog():
def on_response(self, dialog, response_id, daemon ):
# thu button has been pressed (probably)
if response_id == gtk.RESPONSE_APPLY:
- if not self.check_settings(daemon):
+ if not (self.check_settings(daemon) and self.check_report()):
dialog.stop_emission("response")
self.wTree.get_widget("bSend").stop_emission("clicked")
-
+
def on_send_toggled(self, cell, path, model):
model[path][3] = not model[path][3]
@@ -263,8 +262,11 @@ class ReporterDialog():
else:
del self.report["How to reproduce"]
- def on_send_clicked(self, button):
- #def on_apply_clicked(self, button, treeview):
+ def check_report(self):
+ # FIXME: what to do if user press "Not to send BT and then press cancel"
+ # it uncheck the backtrace and let him to edit it, and then user might
+ # not noticed, that he is not sending the BT, so should we warn user about this
+ # or check the BT automatically?
attributes = ["item", "content", "editable", "send", "attachment"]
for row in self.reportListStore:
rowe = dict(zip(attributes, row))
@@ -273,8 +275,10 @@ class ReporterDialog():
"Do you really want to send <b>%s</b>?\n" % rowe["item"]), self.window)
if result == gtk.RESPONSE_NO:
row[attributes.index("send")] = False
+ if result == (gtk.RESPONSE_CANCEL or gtk.RESPONSE_DELETE_EVENT):
+ return False
self.dehydrate()
- self.window.response(gtk.RESPONSE_APPLY)
+ return True
def run(self):
result = self.window.run()
diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py
index a2ad70f6..bfc13188 100644
--- a/src/Gui/CC_gui_functions.py
+++ b/src/Gui/CC_gui_functions.py
@@ -143,7 +143,7 @@ def gui_question_dialog ( message, parent_dialog=None,
gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
message_type, gtk.BUTTONS_YES_NO,
message )
-
+ dialog.add_button("gtk-cancel", gtk.RESPONSE_CANCEL)
dialog.set_markup(message)
if parent_dialog:
dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT)
diff --git a/src/Gui/report.glade b/src/Gui/report.glade
index ce21acb1..428c4ec7 100644
--- a/src/Gui/report.glade
+++ b/src/Gui/report.glade
@@ -197,7 +197,7 @@
<child>
<widget class="GtkButton" id="bSend">
<property name="label" translatable="yes">Send</property>
- <property name="response_id">-5</property>
+ <property name="response_id">-10</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>