def _build_interface(self): self.widgets = {} self.vbox = gtk.VBox() self.vbox.set_spacing(3) self.list = common.list_view_new_icon_and_text(headers=None, ignore_first_column=True, one_header=True, select_multiple=False) self.vbox.pack_start(self.list) self.widgets['table'] = gtk.Table(rows=2, columns=2) self.widgets['table'].set_col_spacings(3) self.widgets['table'].set_row_spacings(3) self.vbox.pack_start(self.widgets['table'], expand=False, fill=True) self.widgets['button_run'] = common.button_new_with_image('gtk-execute', _("_Run")) self.widgets['table'].attach(self.widgets['button_run'], 0,1, 0,1, xoptions=gtk.EXPAND|gtk.FILL, yoptions=gtk.EXPAND|gtk.FILL) self.widgets['button_uninstall'] = common.button_new_with_image('gtk-remove', _("_Uninstall")) self.widgets['table'].attach(self.widgets['button_uninstall'], 1,2, 0,1, xoptions=gtk.EXPAND|gtk.FILL, yoptions=gtk.EXPAND|gtk.FILL) self.widgets['button_add'] = common.button_new_with_image('gtk-add', _("A_dd unlisted program")) self.widgets['table'].attach(self.widgets['button_add'], 0,2, 1,2, xoptions=gtk.EXPAND|gtk.FILL, yoptions=gtk.EXPAND|gtk.FILL) self.widgets['menu_programs'] = gtk.Menu() self.widgets['menu_programs_edit'] = gtk.MenuItem(_("_Edit program"), True) self.widgets['menu_programs'].append(self.widgets['menu_programs_edit']) self.widgets['menu_programs_separator'] = gtk.SeparatorMenuItem() self.widgets['menu_programs'].append(self.widgets['menu_programs_separator']) self.widgets['menu_programs_refresh'] = gtk.MenuItem(_("_Refresh program list"), True) self.widgets['menu_programs'].append(self.widgets['menu_programs_refresh']) self.widgets['menu_programs'].show_all() self.list.connect('changed', self.list_changed) self.list.connect('double-click', self.list_double_clicked) self.list.connect('right-click', self.list_right_clicked) self.widgets['button_run'].connect('clicked', self.button_run_clicked) self.widgets['button_uninstall'].connect('clicked', self.button_uninstall_clicked) self.widgets['button_add'].connect('clicked', self.button_add_clicked) self.widgets['menu_programs_edit'].connect("activate", self.menu_edit_clicked) self.widgets['menu_programs_refresh'].connect("activate", self.menu_refresh_clicked) self.list.set_drag_test_start_function(self._test_drag_start) self.list.set_drag_creation_function(self._drag_creation) self.frame = common.frame_wrap(self.vbox, self.title) self.pack_start(self.frame, True, True) self.dialog_edit_program = DialogEditProgram() self.dialog_edit_program.connect('response', self._on_edit_program_response) self.sizable = [] self.show_all()
def _build_interface(self): self.vbox = gtk.VBox() self.installers = [] installers = [] for n, (title, section) in enumerate(( (_('Programs'), self.installers_programs), (_('Extras'), self.installers_extras) )): if n == 0: installers.append([None, None, '<header first>%s</header>' % title]) else: installers.append([None, None, '<header>%s</header>' % title]) self.installers.append(('', '', '')) for i in section: try: if len(i) > 1: icon = common.pixbuf_new_from_string(i[1]) if icon == None: icon = common.pixbuf_new_from_string('package-x-generic') installers.append( (i[0], icon, '%s\n<small>%s</small>' % (i[2], i[3])) ) else: installers.append( i[0] ) self.installers.append(i) except IndexError: print i self.list = common.list_view_new_icon_and_text(headers=None, ignore_first_column=True, number_of_text_columns=1, text_column=2, use_markup=True, select_multiple=True, items=installers) self.vbox.pack_start(self.list) self.license_notice_label = gtk.Label(_('* Legally requires that you own a Windows license')) self.license_notice_label.set_alignment(1.0, 0.5) self.vbox.pack_start(self.license_notice_label, False, True) self.hbox_buttons = gtk.HBox() self.hbox_buttons.set_spacing(6) self.button_install = common.button_new_with_image('gtk-add', label=_("_Install"), use_underline=True) self.button_install.set_sensitive(False) self.hbox_buttons.pack_start(self.button_install, True, True) self.vbox.pack_start(self.hbox_buttons, False, True) self.list.connect('changed', self.list_changed) self.button_install.connect('clicked', self.button_install_clicked) self.frame = common.frame_wrap(self.vbox, self.title) self.pack_start(self.frame, True, True) self.sizable = [] self.show_all() self.license_notice_label.hide()
def _build_interface(self): self.vbox_top = gtk.VBox() self.vbox_top.set_spacing(3) self.list = common.list_view_new_text( headers = [_("DLL"), _("Order")], columns = 2, select_multiple = True ) self.vbox_top.pack_start(self.list, expand=True, fill=True) self.button_remove = gtk.Button(stock=gtk.STOCK_REMOVE) self.button_remove.set_sensitive(False) self.vbox_top.pack_start(self.button_remove, expand=False, fill=True) self.frame1 = common.frame_wrap(self.vbox_top, _('Existing DLL overrides')) self.pack_start(self.frame1, expand=True, fill=True) self.vbox_bottom = gtk.VBox() self.vbox_bottom.set_spacing(3) self.hbox1 = gtk.HBox() self.hbox1.set_spacing(6) self.comboboxentry = gtk.combo_box_entry_new_text() self.comboboxentry.set_wrap_width(5) self.hbox1.pack_start(self.comboboxentry, expand=True, fill=True) self.button_add = gtk.Button(_('A_dd')) self.button_add.set_sensitive(False) self.button_add.set_use_underline(True) self.hbox1.pack_start(self.button_add, expand=False, fill=True) self.vbox_bottom.pack_start(self.hbox1, expand=False, fill=True) self.hbox2 = gtk.HBox() self.hbox2.set_spacing(6) #self.label_override_type = gtk.Label('%s: ' % _('Type')) #self.label_override_type.set_alignment(0.0, 0.5) #self.hbox2.pack_start(self.label_override_type, expand=True, fill=True) self.combobox_type = gtk.combo_box_new_text() self.combobox_type.set_sensitive(False) for text in [ _("First try built-in Wine library, then native DLL file"), _("First try native DLL file, then built-in Wine library"), _("Only use built-in Wine library"), _("Only use native Windows DLL file"), _("Disable. Don't load this library") ]: self.combobox_type.append_text(text) self.combobox_type.set_active(0) self.hbox2.pack_start(self.combobox_type, expand=True, fill=True) self.vbox_bottom.pack_start(self.hbox2, expand=False, fill=True) self.frame2 = common.frame_wrap(self.vbox_bottom, _('Add new override')) self.pack_start(self.frame2, expand=False, fill=False) self.list.treeview.add_events( gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.KEY_PRESS_MASK ) self.list.connect('changed', self.list_changed) self.list.treeview.connect('button-press-event', self._list_button_pressed) self.list.treeview.connect('key-press-event', self._list_key_pressed) self.comboboxentry.connect('changed', self.entry_changed) self.button_remove.connect('clicked', self.button_remove_clicked) self.button_add.connect('clicked', self.button_add_clicked) self.show_all()
def _build_interface(self): self.widgets = {} self.vbox = gtk.VBox() self.vbox.set_spacing(3) self.list = common.list_view_new_icon_and_text( headers=None, ignore_first_column=True, one_header=True, select_multiple=False) self.vbox.pack_start(self.list) self.widgets['table'] = gtk.Table(rows=2, columns=2) self.widgets['table'].set_col_spacings(3) self.widgets['table'].set_row_spacings(3) self.vbox.pack_start(self.widgets['table'], expand=False, fill=True) self.widgets['button_run'] = common.button_new_with_image( 'gtk-execute', _("_Run")) self.widgets['table'].attach(self.widgets['button_run'], 0, 1, 0, 1, xoptions=gtk.EXPAND | gtk.FILL, yoptions=gtk.EXPAND | gtk.FILL) self.widgets['button_uninstall'] = common.button_new_with_image( 'gtk-remove', _("_Uninstall")) self.widgets['table'].attach(self.widgets['button_uninstall'], 1, 2, 0, 1, xoptions=gtk.EXPAND | gtk.FILL, yoptions=gtk.EXPAND | gtk.FILL) self.widgets['button_add'] = common.button_new_with_image( 'gtk-add', _("A_dd unlisted program")) self.widgets['table'].attach(self.widgets['button_add'], 0, 2, 1, 2, xoptions=gtk.EXPAND | gtk.FILL, yoptions=gtk.EXPAND | gtk.FILL) self.widgets['menu_programs'] = gtk.Menu() self.widgets['menu_programs_edit'] = gtk.MenuItem( _("_Edit program"), True) self.widgets['menu_programs'].append( self.widgets['menu_programs_edit']) self.widgets['menu_programs_separator'] = gtk.SeparatorMenuItem() self.widgets['menu_programs'].append( self.widgets['menu_programs_separator']) self.widgets['menu_programs_refresh'] = gtk.MenuItem( _("_Refresh program list"), True) self.widgets['menu_programs'].append( self.widgets['menu_programs_refresh']) self.widgets['menu_programs'].show_all() self.list.connect('changed', self.list_changed) self.list.connect('double-click', self.list_double_clicked) self.list.connect('right-click', self.list_right_clicked) self.widgets['button_run'].connect('clicked', self.button_run_clicked) self.widgets['button_uninstall'].connect('clicked', self.button_uninstall_clicked) self.widgets['button_add'].connect('clicked', self.button_add_clicked) self.widgets['menu_programs_edit'].connect("activate", self.menu_edit_clicked) self.widgets['menu_programs_refresh'].connect( "activate", self.menu_refresh_clicked) self.list.set_drag_test_start_function(self._test_drag_start) self.list.set_drag_creation_function(self._drag_creation) self.frame = common.frame_wrap(self.vbox, self.title) self.pack_start(self.frame, True, True) self.dialog_edit_program = DialogEditProgram() self.dialog_edit_program.connect('response', self._on_edit_program_response) self.sizable = [] self.show_all()
def _build_interface(self): self.vbox = gtk.VBox() self.vbox.set_spacing(6) self.vbox_top = gtk.VBox() self.vbox_top.set_spacing(0) self.list = common.list_view_new_icon_and_text(headers=['', _('Drive'), _('Mapping')], number_of_text_columns=2, select_multiple=False) self.vbox_top.pack_start(self.list, True, True) self.hbox_buttons = gtk.HBox() self.hbox_buttons.set_spacing(6) self.button_add = gtk.Button(stock=gtk.STOCK_ADD) self.button_add.set_sensitive(True) self.hbox_buttons.pack_start(self.button_add, False, False) self.button_remove = gtk.Button(stock=gtk.STOCK_REMOVE) self.button_remove.set_sensitive(False) self.hbox_buttons.pack_start(self.button_remove, False, False) self.button_auto = common.button_new_with_image('gtk-refresh', label=_("Autodetect"), use_underline=False) self.hbox_buttons.pack_end(self.button_auto, False, False) self.vbox_top.pack_start(self.hbox_buttons, False, False) self.vbox.pack_start(self.vbox_top, True, True) self.vbox_bottom = gtk.VBox() self.vbox_bottom.set_spacing(6) self.path_entry = gtk.Entry() self.path_button = gtk.Button(_('Browse...')) self.path_box = common.new_label_with_widget('%s: ' % _('Path'), [ self.path_entry, self.path_button ]) self.vbox_bottom.pack_start(self.path_box, False, True) #self.expander = gtk.Expander(_('Advanced')) #self.vbox_bottom.pack_start(self.expander, False, True) self.vbox_expander = gtk.VBox() self.vbox_expander.set_spacing(6) #self.expander.add(self.vbox_expander) self.vbox_bottom.pack_start(self.vbox_expander, False, True) self.device_entry = gtk.Entry() self.device_button = gtk.Button(_('Browse...')) self.device_box = common.new_label_with_widget('%s: ' % _('Device'), [ self.device_entry, self.device_button ]) self.vbox_expander.pack_start(self.device_box, False, True) self.hbox_toggle = gtk.HBox() self.device_toggle = gtk.CheckButton(_('Use device file for path')) self.hbox_toggle.pack_end(self.device_toggle, False, True) self.vbox_expander.pack_start(self.hbox_toggle, False, True) self.type = gtk.combo_box_new_text() for d_type,d_name in self.DRIVE_TYPES: self.type.append_text(d_name) self.type_box = common.new_label_with_widget('%s: ' % _('Type'), self.type) self.vbox_bottom.pack_start(self.type_box, False, True) self.vbox.pack_start(self.vbox_bottom, False, True) self.list.connect('changed', self.list_changed) self.button_add.connect('clicked', self.button_add_clicked) self.button_remove.connect('clicked', self.button_remove_clicked) self.button_auto.connect('clicked', self.button_auto_clicked) self.path_entry.connect('changed', self.path_changed) self.path_button.connect('clicked', self.button_path_clicked) self.type.connect('changed', self.type_changed) self.device_entry.connect('changed', self.device_changed) self.device_button.connect('clicked', self.button_device_clicked) self.device_toggle.connect_after('toggled', self.device_toggled) self.list.renderers[1].connect('edited', self.drive_letter_edit) self.list.renderers[1].set_property('editable', True) self.list.renderers[2].connect('edited', self.drive_mapping_edit) self.list.renderers[2].set_property('editable', True) self.frame = common.frame_wrap(self.vbox, self.title) self.pack_start(self.frame, True, True) self.sizable = [self.path_box.widget, self.type] self.show_all() self.hbox_toggle.hide() self.filechooserdialog_path = common.filechooserdialog_new_with_filters( title = _('Select which folder the drive should be mapped to'), parent = common.widget_get_top_parent(self), action = gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, on_response_func = self.path_dialog_response) self.filechooserdialog_device = common.filechooserdialog_new_with_filters( title = _('Select which device file the drive use'), parent = common.widget_get_top_parent(self), action = gtk.FILE_CHOOSER_ACTION_OPEN, on_response_func = self.device_dialog_response)
def _build_interface(self): self.vbox = gtk.VBox() self.vbox.set_spacing(6) self.vbox_top = gtk.VBox() self.vbox_top.set_spacing(0) self.list = common.list_view_new_icon_and_text( headers=['', _('Drive'), _('Mapping')], number_of_text_columns=2, select_multiple=False) self.vbox_top.pack_start(self.list, True, True) self.hbox_buttons = gtk.HBox() self.hbox_buttons.set_spacing(6) self.button_add = gtk.Button(stock=gtk.STOCK_ADD) self.button_add.set_sensitive(True) self.hbox_buttons.pack_start(self.button_add, False, False) self.button_remove = gtk.Button(stock=gtk.STOCK_REMOVE) self.button_remove.set_sensitive(False) self.hbox_buttons.pack_start(self.button_remove, False, False) self.button_auto = common.button_new_with_image('gtk-refresh', label=_("Autodetect"), use_underline=False) self.hbox_buttons.pack_end(self.button_auto, False, False) self.vbox_top.pack_start(self.hbox_buttons, False, False) self.vbox.pack_start(self.vbox_top, True, True) self.vbox_bottom = gtk.VBox() self.vbox_bottom.set_spacing(6) self.path_entry = gtk.Entry() self.path_button = gtk.Button(_('Browse...')) self.path_box = common.new_label_with_widget( '%s: ' % _('Path'), [self.path_entry, self.path_button]) self.vbox_bottom.pack_start(self.path_box, False, True) #self.expander = gtk.Expander(_('Advanced')) #self.vbox_bottom.pack_start(self.expander, False, True) self.vbox_expander = gtk.VBox() self.vbox_expander.set_spacing(6) #self.expander.add(self.vbox_expander) self.vbox_bottom.pack_start(self.vbox_expander, False, True) self.device_entry = gtk.Entry() self.device_button = gtk.Button(_('Browse...')) self.device_box = common.new_label_with_widget( '%s: ' % _('Device'), [self.device_entry, self.device_button]) self.vbox_expander.pack_start(self.device_box, False, True) self.hbox_toggle = gtk.HBox() self.device_toggle = gtk.CheckButton(_('Use device file for path')) self.hbox_toggle.pack_end(self.device_toggle, False, True) self.vbox_expander.pack_start(self.hbox_toggle, False, True) self.type = gtk.combo_box_new_text() for d_type, d_name in self.DRIVE_TYPES: self.type.append_text(d_name) self.type_box = common.new_label_with_widget('%s: ' % _('Type'), self.type) self.vbox_bottom.pack_start(self.type_box, False, True) self.vbox.pack_start(self.vbox_bottom, False, True) self.list.connect('changed', self.list_changed) self.button_add.connect('clicked', self.button_add_clicked) self.button_remove.connect('clicked', self.button_remove_clicked) self.button_auto.connect('clicked', self.button_auto_clicked) self.path_entry.connect('changed', self.path_changed) self.path_button.connect('clicked', self.button_path_clicked) self.type.connect('changed', self.type_changed) self.device_entry.connect('changed', self.device_changed) self.device_button.connect('clicked', self.button_device_clicked) self.device_toggle.connect_after('toggled', self.device_toggled) self.list.renderers[1].connect('edited', self.drive_letter_edit) self.list.renderers[1].set_property('editable', True) self.list.renderers[2].connect('edited', self.drive_mapping_edit) self.list.renderers[2].set_property('editable', True) self.frame = common.frame_wrap(self.vbox, self.title) self.pack_start(self.frame, True, True) self.sizable = [self.path_box.widget, self.type] self.show_all() self.hbox_toggle.hide() self.filechooserdialog_path = common.filechooserdialog_new_with_filters( title=_('Select which folder the drive should be mapped to'), parent=common.widget_get_top_parent(self), action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, on_response_func=self.path_dialog_response) self.filechooserdialog_device = common.filechooserdialog_new_with_filters( title=_('Select which device file the drive use'), parent=common.widget_get_top_parent(self), action=gtk.FILE_CHOOSER_ACTION_OPEN, on_response_func=self.device_dialog_response)