def __init__(self, jokebook, parent): Page.__init__(self) self.__parent = parent # list of jokes jokes_div = CanvasListBox() jokes_div.props.border=0 for joke in jokebook.jokes: button = gtk.Button(' ' + _('Delete') + ' ') button.connect('clicked', self.__do_clicked_delete, jokebook, joke) list_row = self.make_listrow(JokeEditor(joke), hippo.PACK_EXPAND) list_row.append(hippo.CanvasWidget(widget=theme.theme_widget(button), padding=5), hippo.PACK_END) jokes_div.append(list_row) self.append(jokes_div, hippo.PACK_EXPAND) # new joke button buttons = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL, xalign=hippo.ALIGNMENT_START) button = gtk.Button(_('Add New Joke')) button.connect('clicked', self.do_clicked_add_joke, jokebook) buttons.append(hippo.CanvasWidget(widget=theme.theme_widget(button))) jokes_div.append(buttons)
def __init__(self, jokebook): Page.__init__(self, xalign=hippo.ALIGNMENT_CENTER) preview_box = CanvasListBox() # cover cover = self.make_listrow() cover.props.orientation=hippo.ORIENTATION_VERTICAL cover.append(hippo.CanvasText(text='"' + (jokebook.title or '')+ '" ' + _('started by') + ' ' + (jokebook.owner or ''), xalign=hippo.ALIGNMENT_CENTER, padding_top=10)) cover.append(hippo.CanvasBox(box_height=theme.SPACER_VERTICAL)) cover_picture = self.make_imagebox(jokebook, 'image', 480, 360, False) cover.append(cover_picture) cover.append(hippo.CanvasBox(box_height=theme.SPACER_VERTICAL)) preview_box.append(cover) # jokes for joke in jokebook.jokes: list_row = self.make_listrow(JokeViewer(joke, jokebook.title)) preview_box.append(list_row) self.append(preview_box, hippo.PACK_EXPAND) self.append(hippo.CanvasBox(box_height=theme.SPACER_VERTICAL)) button = gtk.Button(_('Edit')) button.connect('clicked', self.__do_clicked_edit, jokebook) self.append(hippo.CanvasWidget(widget=theme.theme_widget(button)))
def __init__(self, jokebook, parent): Page.__init__(self) self.__parent = parent # list of jokes jokes_div = CanvasListBox() jokes_div.props.border = 0 for joke in jokebook.jokes: button = gtk.Button(' ' + _('Delete') + ' ') button.connect('clicked', self.__do_clicked_delete, jokebook, joke) list_row = self.make_listrow(JokeEditor(joke), hippo.PACK_EXPAND) list_row.append( hippo.CanvasWidget(widget=theme.theme_widget(button), padding=5), hippo.PACK_END) jokes_div.append(list_row) self.append(jokes_div, hippo.PACK_EXPAND) # new joke button buttons = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL, xalign=hippo.ALIGNMENT_START) button = gtk.Button(_('Add New Joke')) button.connect('clicked', self.do_clicked_add_joke, jokebook) buttons.append(hippo.CanvasWidget(widget=theme.theme_widget(button))) jokes_div.append(buttons)
def __init__(self, jokebook, parent): Page.__init__(self) self.__parent = parent jokes_div = CanvasListBox() jokes_div.props.border = 0 for joke in jokebook.submissions: list_row = self.make_listrow(JokeViewer(joke, jokebook.title)) list_row.props.orientation = hippo.ORIENTATION_VERTICAL buttons = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL, xalign=hippo.ALIGNMENT_END, spacing=10, padding=10) button = gtk.Button(' ' + _('Reject') + ' ') button.connect('clicked', self.__do_clicked_reject, jokebook, joke) buttons.append( hippo.CanvasWidget(widget=theme.theme_widget(button), border_color=theme.COLOR_RED.get_int(), border=0, xalign=hippo.ALIGNMENT_CENTER)) button = gtk.Button(' ' + _('Accept') + ' ') button.connect('clicked', self.__do_clicked_accept, jokebook, joke) buttons.append( hippo.CanvasWidget(widget=theme.theme_widget(button), border_color=theme.COLOR_RED.get_int(), border=0, xalign=hippo.ALIGNMENT_CENTER)) list_row.append(buttons) #list_row.props.orientation=hippo.ORIENTATION_VERTICAL #status_box = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL, #padding_top=4, #padding_left=4) #status_box.append(hippo.CanvasText(text=_('Status:'), #color=theme.COLOR_DARK_GREEN.get_int(), #box_width=100, #xalign=hippo.ALIGNMENT_START)) ##button = None #button = gtk.RadioButton() #button = gtk.RadioButton(button, _('Approved')) #button.set_size_request(200, -1) #status_box.append(hippo.CanvasWidget(widget = button)) #button = gtk.RadioButton(button, _('Rejected')) #button.set_size_request(200, -1) #status_box.append(hippo.CanvasWidget(widget = button)) #button = gtk.RadioButton(button, _('Not Reviewed')) #button.set_size_request(200, -1) #button.set_active(True) #status_box.append(hippo.CanvasWidget(widget = button)) #list_row.append(status_box) jokes_div.append(list_row) self.append(jokes_div)
def __init__(self, jokebook, parent): Page.__init__(self) self.__parent = parent jokes_div = CanvasListBox() jokes_div.props.border=0 for joke in jokebook.submissions: list_row = self.make_listrow(JokeViewer(joke, jokebook.title)) list_row.props.orientation=hippo.ORIENTATION_VERTICAL buttons = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL, xalign=hippo.ALIGNMENT_END, spacing=10, padding=10) button = gtk.Button(' ' + _('Reject') + ' ') button.connect('clicked', self.__do_clicked_reject, jokebook, joke) buttons.append(hippo.CanvasWidget(widget=theme.theme_widget(button), border_color=theme.COLOR_RED.get_int(), border=0, xalign=hippo.ALIGNMENT_CENTER)) button = gtk.Button(' ' + _('Accept') + ' ') button.connect('clicked', self.__do_clicked_accept, jokebook, joke) buttons.append(hippo.CanvasWidget(widget=theme.theme_widget(button), border_color=theme.COLOR_RED.get_int(), border=0, xalign=hippo.ALIGNMENT_CENTER)) list_row.append(buttons) #list_row.props.orientation=hippo.ORIENTATION_VERTICAL #status_box = hippo.CanvasBox(orientation=hippo.ORIENTATION_HORIZONTAL, #padding_top=4, #padding_left=4) #status_box.append(hippo.CanvasText(text=_('Status:'), #color=theme.COLOR_DARK_GREEN.get_int(), #box_width=100, #xalign=hippo.ALIGNMENT_START)) ##button = None #button = gtk.RadioButton() #button = gtk.RadioButton(button, _('Approved')) #button.set_size_request(200, -1) #status_box.append(hippo.CanvasWidget(widget = button)) #button = gtk.RadioButton(button, _('Rejected')) #button.set_size_request(200, -1) #status_box.append(hippo.CanvasWidget(widget = button)) #button = gtk.RadioButton(button, _('Not Reviewed')) #button.set_size_request(200, -1) #button.set_active(True) #status_box.append(hippo.CanvasWidget(widget = button)) #list_row.append(status_box) jokes_div.append(list_row) self.append(jokes_div)
def __init__(self): Page.__init__(self) # page title self.append(hippo.CanvasText(text= _('Choose a Jokebook to read:'), xalign=hippo.ALIGNMENT_START, padding=10)) # list of Jokebooks allow_edit = Globals.JokeMachineActivity.is_initiator jokebooks_div = CanvasListBox() for jokebook in Globals.JokeMachineState.jokebooks: jokebooks_div.append(self.__make_jokebook_div(jokebook, allow_edit)) self.append(jokebooks_div, hippo.PACK_EXPAND)
def __init__(self): Page.__init__(self) # page title self.append( hippo.CanvasText(text=_('Choose a Jokebook to read:'), xalign=hippo.ALIGNMENT_START, padding=10)) # list of Jokebooks allow_edit = Globals.JokeMachineActivity.is_initiator jokebooks_div = CanvasListBox() for jokebook in Globals.JokeMachineState.jokebooks: jokebooks_div.append(self.__make_jokebook_div( jokebook, allow_edit)) self.append(jokebooks_div, hippo.PACK_EXPAND)