Re: gnome-bug front end?



On Thu, Apr 15, 1999 at 10:50:22PM +0200, Matthias Warkus was heard to say:
> Hasn't someone written a graphical front-end to gnome-bug?
> Wasn't it in Python?
> 
> Perhaps it should go into the source tree, we could then make a
> desktop entry - "Report bug..." as a menu entry, wouldn't that be
> cool? Feedback at your mouse-clickin' fingertips.
> 
> Anyway, whoever wrote it, care to mail it to me or point out where I
> can find it?
> 
> TIA
> 
> mawa

  Yeah, I put together a quick little program matching that description. :-)
  It could probably be extended indefinitely..starting with the input
mechanism..it uses a straight GTK text widget..anyway, here it is..

  One addition that would be really nice is a list of the currently installed
packages for which bugs can be reported. Is there any canonical way to find
this out?

  Daniel

-- 
  He had a terrible memory.  He remembered everything.
#!/usr/bin/python

# Simple bug-reporting script

from gtk import *
from gnome.ui import *
import os

def option_menu_activate(item,self,num):
  self.current=num

def my_label(text):
  label=GtkLabel(text)
  label.set_alignment(1.0,0.5)
  return label

def attach_label(label,x1,y1,x2,y2):
  table.attach(label,x1,y1,x2,y2,FILL,0,0,0)

def attach_entry(entry,x1,x2,y1,y2):
  table.attach(entry,x1,x2,y1,y2)

severities=["Wishlist","Normal","Grave","Critical"]
severity_default=1

dialog=GnomeDialog("Gnome Bug Reporter",STOCK_BUTTON_OK,STOCK_BUTTON_CANCEL,None)

table=GtkTable(6,2,FALSE)
table.set_row_spacings(PAD_SMALL)
table.set_col_spacings(PAD_SMALL)

package=GtkEntry()
version=GtkEntry()
subject=GtkEntry()
email=GtkEntry()
severity=GtkOptionMenu()
frame=GtkFrame("Enter a longer description of the problem")
body=GtkText()

subject.set_text("Describe the problem briefly")

body.set_editable(TRUE)
body.set_word_wrap(TRUE)

#ok=GnomeStockButton(STOCK_BUTTON_OK)
#cancel=GnomeStockButton(STOCK_BUTTON_CANCEL)

attach_label(my_label("The package that this\nreport applies to:"),0,1,0,1)
attach_entry(package,1,2,0,1)

attach_label(my_label("The package version:"),0,1,1,2)
attach_entry(version,1,2,1,2)

attach_label(my_label("Subject:"),0,1,2,3)
attach_entry(subject,1,2,2,3)

attach_label(my_label("Your email address:"),0,1,3,4)
attach_entry(email,1,2,3,4)

menu=GtkMenu()
for i in range(len(severities)):
  item=GtkMenuItem(severities[i])
  menu.append(item)
  item.connect("activate",option_menu_activate,severity,i)

severity.current=severity_default
menu.set_active(severity_default)

severity.set_menu(menu)

attach_label(my_label("Severity:"),0,1,4,5)
attach_entry(severity,1,2,4,5)

frame.add(body)
table.attach(frame,0,2,5,6)

dialog.vbox.add(table)

#ok.connect("clicked",mainquit)
#cancel.connect("clicked",mainquit)

#dialog.action_area.add(ok)
#dialog.action_area.add(cancel)

dialog.vbox.show_all()

if dialog.run()==0:
  pipe=os.popen("/usr/sbin/sendmail submit@bugs.gnome.org","w")
  if email.get_text()!='':
    pipe.write("From: %s\n"%email.get_text())
  pipe.write("Subject: %s\n"%subject.get_text())
  pipe.write("\n")
  pipe.write("Package: %s\n"%package.get_text())
  pipe.write("Version: %s\n"%version.get_text())
  pipe.write("Severity: %s\n"%severities[severity.current])
  pipe.write("\n")
  pipe.write(body.get_chars(0,-1))
  pipe.close()
  GnomeMessageBox("Bug report submitted!",MESSAGE_BOX_INFO,STOCK_BUTTON_OK,None).run()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]