From cba8edcbfddf9229a63de1a5561a91dd95d9ba6e Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 04 Aug 2010 20:00:01 +0000 Subject: added cancel button, alignment, and padding to web upload dialog --- (limited to 'turtleart.py') diff --git a/turtleart.py b/turtleart.py index 6b2dcb4..cc0f3c9 100755 --- a/turtleart.py +++ b/turtleart.py @@ -477,8 +477,9 @@ class TurtleMain(): self.pop_up = gtk.Window() self.pop_up.set_default_size(600, 400) self.pop_up.connect('delete_event', self._stop_uploading) - table = gtk.Table(1, 8, False) + table = gtk.Table(8, 1, False) self.pop_up.add(table) + login_label = gtk.Label(_('You must have an account at \ http://turtleartsite.sugarlabs.org to upload your project.')) table.attach(login_label, 0, 1, 0, 1) @@ -486,50 +487,61 @@ http://turtleartsite.sugarlabs.org to upload your project.')) table.attach(self.login_message, 0, 1, 1, 2) self.Hbox1 = gtk.HBox() - table.attach(self.Hbox1, 0, 1, 2, 3) + table.attach(self.Hbox1, 0, 1, 2, 3, xpadding=5, ypadding=3) self.username_entry = gtk.Entry() username_label = gtk.Label(_('Username:') + ' ') username_label.set_size_request(150, 25) + username_label.set_alignment(1.0, 0.5) self.username_entry.set_size_request(450, 25) self.Hbox1.add(username_label) self.Hbox1.add(self.username_entry) self.Hbox2 = gtk.HBox() - table.attach(self.Hbox2, 0, 1, 3, 4) + table.attach(self.Hbox2, 0, 1, 3, 4, xpadding=5, ypadding=3) self.password_entry = gtk.Entry() password_label = gtk.Label(_('Password:') + ' ') self.password_entry.set_visibility(False) password_label.set_size_request(150, 25) + password_label.set_alignment(1.0, 0.5) self.password_entry.set_size_request(450, 25) self.Hbox2.add(password_label) self.Hbox2.add(self.password_entry) self.Hbox3 = gtk.HBox() - table.attach(self.Hbox3, 0, 1, 4, 5) + table.attach(self.Hbox3, 0, 1, 4, 5, xpadding=5, ypadding=3) self.title_entry = gtk.Entry() title_label = gtk.Label(_('Title:') + ' ') title_label.set_size_request(150, 25) + title_label.set_alignment(1.0, 0.5) self.title_entry.set_size_request(450, 25) self.Hbox3.add(title_label) self.Hbox3.add(self.title_entry) self.Hbox4 = gtk.HBox() - table.attach(self.Hbox4, 0, 1, 5, 6) + table.attach(self.Hbox4, 0, 1, 5, 6, xpadding=5, ypadding=3) self.description_entry = gtk.TextView() description_label = gtk.Label(_('Description:') + ' ') description_label.set_size_request(150, 25) + description_label.set_alignment(1.0, 0.5) self.description_entry.set_wrap_mode(gtk.WRAP_WORD) - self.description_entry.set_size_request(450, 25) + self.description_entry.set_size_request(450, 50) self.Hbox4.add(description_label) self.Hbox4.add(self.description_entry) + self.Hbox5 = gtk.HBox() + table.attach(self.Hbox5, 0, 1, 6, 7, xpadding=5, ypadding=3) self.submit_button = gtk.Button(_('Submit to Web')) - self.submit_button.set_size_request(600, 25) + self.submit_button.set_size_request(300, 25) self.submit_button.connect('pressed', self._do_remote_logon) - table.attach(self.submit_button, 0, 1, 6, 7) + self.Hbox5.add(self.submit_button) + self.cancel_button = gtk.Button(_('Cancel')) + self.cancel_button.set_size_request(300, 25) + self.cancel_button.connect('pressed', self._stop_uploading) + self.Hbox5.add(self.cancel_button) + self.pop_up.show_all() - def _stop_uploading(self, widget, event): + def _stop_uploading(self, widget, event=None): """ Hide the popup when the upload is complte """ self.uploading = False self.pop_up.hide() -- cgit v0.9.1