Пример #1
0
    def add_icon_button(self, label, icon_name, response_id):
        """Like add_button() but allows to pass an icon name"""

        button = Button(label, icon_name)
        # file chooser uses grab_default() on this
        button.set_can_default(True)
        button.show()
        self.add_action_widget(button, response_id)
        return button
Пример #2
0
    def add_icon_button(self, label, icon_name, response_id):
        """Like add_button() but allows to pass an icon name"""

        button = Button(label, icon_name)
        # file chooser uses grab_default() on this
        button.set_can_default(True)
        button.show()
        self.add_action_widget(button, response_id)
        return button
Пример #3
0
    def __init__(self, parent):
        title = _("Uninitialized iPod")
        description = _("Do you want to create an empty database on this iPod?")

        super(ConfirmDBCreate, self).__init__(parent, title, description, buttons=Gtk.ButtonsType.NONE)

        self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
        save_button = Button(_("_Create Database"), "system-run")
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_CREATE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #4
0
    def __init__(self, parent, path):
        title = _("File exists")
        fn_format = "<b>%s</b>" % util.escape(fsdecode(path))
        description = _("Replace %(file-name)s?") % {"file-name": fn_format}

        super(ConfirmFileReplace, self).__init__(
            parent, title, description, buttons=Gtk.ButtonsType.NONE)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        save_button = Button(_("_Replace File"), "document-save")
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_REPLACE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #5
0
    def __init__(self, parent, path):
        title = _("File exists")
        fn_format = "<b>%s</b>" % util.escape(fsdecode(path))
        description = _("Replace %(file-name)s?") % {"file-name": fn_format}

        super(ConfirmFileReplace, self).__init__(parent,
                                                 title,
                                                 description,
                                                 buttons=Gtk.ButtonsType.NONE)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        save_button = Button(_("_Replace File"), "document-save")
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_REPLACE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #6
0
    def __init__(self, parent):
        title = _("Set up library directories?")
        description = _("You don't have any music library set up. "
                        "Would you like to do that now?")

        super(ConfirmLibDirSetup, self).__init__(
            parent, title, description, buttons=Gtk.ButtonsType.NONE)

        cancel_button = Button(_("_Not Now"), Gtk.STOCK_CANCEL)
        cancel_button.show()
        self.add_action_widget(cancel_button, Gtk.ResponseType.CANCEL)
        save_button = Gtk.Button(label=_("_Set Up"), use_underline=True)
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_SETUP)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #7
0
    def __init__(self, parent, plugin_name, count):
        title = ngettext("Run the plugin \"%(name)s\" on %(count)d album?",
                         "Run the plugin \"%(name)s\" on %(count)d albums?",
                         count) % (plugin_name, count)

        super(ConfirmMultiAlbumInvoke, self).__init__(
            get_top_parent(parent),
            title, "",
            buttons=Gtk.ButtonsType.NONE)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        delete_button = Button(_("_Run Plugin"), Gtk.STOCK_EXECUTE)
        delete_button.show()
        self.add_action_widget(delete_button, self.RESPONSE_INVOKE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #8
0
    def __init__(self, parent):
        title = _("Set up library directories?")
        description = _("You don't have any music library set up. "
                        "Would you like to do that now?")

        super(ConfirmLibDirSetup, self).__init__(
            parent, title, description, buttons=Gtk.ButtonsType.NONE)

        cancel_button = Button(_("_Not Now"), Gtk.STOCK_CANCEL)
        cancel_button.show()
        self.add_action_widget(cancel_button, Gtk.ResponseType.CANCEL)
        save_button = Gtk.Button(label=_("_Set Up"), use_underline=True)
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_SETUP)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #9
0
    def __init__(self, parent):
        title = _("Uninitialized iPod")
        description = _(
            "Do you want to create an empty database on this iPod?")

        super(ConfirmDBCreate, self).__init__(parent,
                                              title,
                                              description,
                                              buttons=Gtk.ButtonsType.NONE)

        self.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL)
        save_button = Button(_("_Create Database"), "system-run")
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_CREATE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #10
0
    def __init__(self, parent, song):
        title = _("Tag may not be accurate")

        fn_format = "<b>%s</b>" % util.escape(fsdecode(song("~basename")))
        description = _("%(file-name)s changed while the program was running. "
            "Saving without refreshing your library may "
            "overwrite other changes to the song.") % {"file-name": fn_format}

        super(OverwriteWarning, self).__init__(
            parent, title, description, buttons=Gtk.ButtonsType.NONE)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        save_button = Button(_("_Save"), "document-save")
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_SAVE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #11
0
    def __init__(self, parent, plugin_name, count):
        title = ngettext("Run the plugin \"%(name)s\" on %(count)d album?",
                         "Run the plugin \"%(name)s\" on %(count)d albums?",
                         count) % (plugin_name, count)

        super(ConfirmMultiAlbumInvoke,
              self).__init__(get_top_parent(parent),
                             title,
                             "",
                             buttons=Gtk.ButtonsType.NONE)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        delete_button = Button(_("_Run Plugin"), Gtk.STOCK_EXECUTE)
        delete_button.show()
        self.add_action_widget(delete_button, self.RESPONSE_INVOKE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #12
0
    def __init__(self, parent, song):
        title = _("Tag may not be accurate")

        fn_format = "<b>%s</b>" % util.escape(fsdecode(song("~basename")))
        description = _("%(file-name)s changed while the program was running. "
                        "Saving without refreshing your library may "
                        "overwrite other changes to the song.") % {
                            "file-name": fn_format
                        }

        super(OverwriteWarning, self).__init__(parent,
                                               title,
                                               description,
                                               buttons=Gtk.ButtonsType.NONE)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        save_button = Button(_("_Save"), "document-save")
        save_button.show()
        self.add_action_widget(save_button, self.RESPONSE_SAVE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #13
0
    def __init__(self, parent, paths, description):
        title = ngettext("Delete %(file_count)d file permanently?",
                         "Delete %(file_count)d files permanently?",
                         len(paths)) % {
                             "file_count": len(paths),
                         }

        super(DeleteDialog, self).__init__(get_top_parent(parent),
                                           title,
                                           description,
                                           buttons=Gtk.ButtonsType.NONE)

        area = self.get_message_area()
        exp = FileListExpander(paths)
        exp.show()
        area.pack_start(exp, False, True, 0)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        delete_button = Button(_("_Delete Files"), Gtk.STOCK_DELETE)
        delete_button.show()
        self.add_action_widget(delete_button, self.RESPONSE_DELETE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #14
0
    def __init__(self, parent, paths, description):
        title = ngettext(
            "Delete %(file_count)d file permanently?",
            "Delete %(file_count)d files permanently?",
            len(paths)) % {
                "file_count": len(paths),
            }

        super(DeleteDialog, self).__init__(
            get_top_parent(parent),
            title, description,
            buttons=Gtk.ButtonsType.NONE)

        area = self.get_message_area()
        exp = FileListExpander(paths)
        exp.show()
        area.pack_start(exp, False, True, 0)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        delete_button = Button(_("_Delete Files"), Gtk.STOCK_DELETE)
        delete_button.show()
        self.add_action_widget(delete_button, self.RESPONSE_DELETE)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #15
0
    def __init__(self, parent, paths, description):

        title = ngettext("Move %(file_count)d file to the trash?",
                         "Move %(file_count)d files to the trash?",
                         len(paths)) % {
                             "file_count": len(paths),
                         }

        super(TrashDialog, self).__init__(get_top_parent(parent),
                                          title,
                                          description,
                                          buttons=Gtk.ButtonsType.NONE)

        area = self.get_message_area()
        exp = FileListExpander(paths)
        exp.show()
        area.pack_start(exp, False, True, 0)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        trash_button = Button(_("_Move to Trash"), "user-trash")
        trash_button.show()
        self.add_action_widget(trash_button, self.RESPONSE_TRASH)
        self.set_default_response(Gtk.ResponseType.CANCEL)
Пример #16
0
    def __init__(self, parent, paths, description):

        title = ngettext(
            "Move %(file_count)d file to the trash?",
            "Move %(file_count)d files to the trash?",
            len(paths)) % {
                "file_count": len(paths),
            }

        super(TrashDialog, self).__init__(
            get_top_parent(parent),
            title, description,
            buttons=Gtk.ButtonsType.NONE)

        area = self.get_message_area()
        exp = FileListExpander(paths)
        exp.show()
        area.pack_start(exp, False, True, 0)

        self.add_button(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
        trash_button = Button(_("_Move to Trash"), "user-trash")
        trash_button.show()
        self.add_action_widget(trash_button, self.RESPONSE_TRASH)
        self.set_default_response(Gtk.ResponseType.CANCEL)