当前位置: 首页>>代码示例>>Python>>正文


Python ChildTopWindow.__init__方法代码示例

本文整理汇总了Python中foobnix.helpers.window.ChildTopWindow.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ChildTopWindow.__init__方法的具体用法?Python ChildTopWindow.__init__怎么用?Python ChildTopWindow.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在foobnix.helpers.window.ChildTopWindow的用法示例。


在下文中一共展示了ChildTopWindow.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self):
        Gtk.Dialog.__init__(self, _("vk.com authorization"), None, Gtk.DialogFlags.MODAL, ())
        ChildTopWindow.__init__(self)
        self.set_size_request(550, -1)
        self.auth_url = "http://oauth.vk.com/oauth/authorize?" + \
                        "redirect_uri=http://oauth.vk.com/blank.html&response_type=token&" + \
                        "client_id=%s&scope=%s" % (self.CLIENT_ID, ",".join(self.SCOPE))
        self.web_view = WebKit.WebView()

        self.vbox.pack_start(self.web_view, False, False, 0)

        self.web_view.connect('resource-load-finished', self.on_load)
        session = WebKit.get_default_session()
        if FC().proxy_enable and FC().proxy_url:
            if FC().proxy_user and FC().proxy_password:
                proxy_url = "http://%s:%[email protected]%s" % (FC().proxy_user, FC().proxy_password, FC().proxy_url)
            else:
                proxy_url = "http://%s" % FC().proxy_url
            soup_url = Soup.URI.new(proxy_url)
            session.set_property("proxy-uri", soup_url)
        else:
            session.set_property("proxy-uri", None)

        cookiejar = Soup.CookieJarText.new(cookiefile, False)
        session.add_feature(cookiejar)

        self.access_token = None
        self.user_id = None
        self.on_load_method_finished = False
开发者ID:Cgruppo,项目名称:foobnix,代码行数:31,代码来源:vk_service.py

示例2: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
 def __init__(self, controls, collback):
     self.collback = collback 
     FControl.__init__(self, controls)        
     ChildTopWindow.__init__(self, _("Equalizer"))
     
     
     self.eq_lines = []
     for label in EQUALIZER_LABLES:
         self.eq_lines.append(EqLine(label, self.on_collback))
         
         
    
     lbox = gtk.VBox(False, 0)
     lbox.show()
     
     self.combo = gtk.combo_box_entry_new_text()
     self.combo.connect("changed", self.on_combo_chage)
     
     lbox.pack_start(self.top_row(), False, False, 0)
     lbox.pack_start(self.middle_lines_box(), False, False, 0)
     
     
     self.add(lbox)
     
     self.models = []
     self.default_models = []
开发者ID:Pythoning,项目名称:foobnix,代码行数:28,代码来源:eq_gui.py

示例3: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self, controls):
        self.controls = controls
        ChildTopWindow.__init__(self, _("Download Manager"))
        self.set_resizable(True)
        self.set_default_size(900, 700)

        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        #paned = Gtk.HPaned()
        #paned.set_position(200)

        self.navigation = DMNavigationTreeControl()

        self.navigation.append(FDModel(_("All")).add_artist(_("All")).add_status(DOWNLOAD_STATUS_ALL))
        self.navigation.append(FDModel(_("Downloading")).add_artist(_("Downloading")).add_status(DOWNLOAD_STATUS_DOWNLOADING))
        self.navigation.append(FDModel(_("Completed")).add_artist(_("Completed")).add_status(DOWNLOAD_STATUS_COMPLETED))
        self.navigation.append(FDModel(_("Active")).add_artist(_("Active")).add_status(DOWNLOAD_STATUS_ACTIVE))
        self.navigation.append(FDModel(_("Inactive")).add_artist(_("Inactive")).add_status(DOWNLOAD_STATUS_INACTIVE))

        self.dm_list = DownloadManagerTreeControl(self.navigation)
        self.navigation.dm_list = self.dm_list
        #paned.pack1(self.navigation.scroll)
        #paned.pack2(self.dm_list.scroll)
        playback = DMControls(self.controls, self.dm_list)

        vbox.pack_start(playback, False, True, 0)
        #vbox.pack_start(paned, True, True)
        vbox.pack_start(self.dm_list.scroll, True, True, 0)

        self.add(vbox)
        thread.start_new_thread(self.dowloader, (self.dm_list,))
开发者ID:zavlab1,项目名称:foobnix,代码行数:32,代码来源:dm.py

示例4: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self, title):
        ChildTopWindow.__init__(self, title)

        """ get foobnix icon path"""
        try:
            self.set_icon_from_file(self.get_fobnix_logo())
            gtk.window_set_default_icon_from_file(self.get_fobnix_logo())
        except TypeError:
            pass
开发者ID:fain182,项目名称:foobnix,代码行数:11,代码来源:about.py

示例5: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
 def __init__(self, controls, on_hide_callback):
     ChildTopWindow.__init__(self, "movie")
     self.set_hide_on_escape(False)
     self.on_hide_callback = on_hide_callback
     
     self.drow = AdvancedDrawingArea(controls)
     self.drow.action_function = on_hide_callback 
     self.set_resizable(True)
     self.set_border_width(0)
     
     self.add(self.drow)
开发者ID:Lomir,项目名称:foobnix,代码行数:13,代码来源:movie_area.py

示例6: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self):
        ChildTopWindow.__init__(self, _("Tag Editor"))
        self.set_resizable(True)
        self.set_default_size(400, 150)
        
        artist_label = gtk.Label(_("Artist"))
        title_label = gtk.Label(_("Title"))
        album_label = gtk.Label(_("Album"))
        date_label = gtk.Label(_("Year"))
        tracknumber_label = gtk.Label(_("Track number"))
        genre_label = gtk.Label(_("Genre"))
        author_label = gtk.Label(_("Author text"))
        composer_label = gtk.Label(_("Composer"))

        self.tag_names = ["artist", "title", "album", "date", "tracknumber", "genre", "author", "composer"]

        self.tag_entries = []
        
        self.labels = []

        for tag_name in self.tag_names:
    
            vars()[tag_name + "_entry"] = gtk.Entry()
            self.tag_entries.append(vars()[tag_name + "_entry"])
    
            self.labels.append(vars()[tag_name + "_label"])
    
        lvbox = gtk.VBox(True, 7)
        rvbox = gtk.VBox(True, 7)
        hpan = gtk.HPaned()
        
        for label, tag_entry in zip(self.labels, self.tag_entries):
            lvbox.pack_start(label)
            rvbox.pack_start(tag_entry)
    
        hpan.pack1(lvbox)
        hpan.pack2(rvbox)

        save_button = gtk.Button(_("Save"))
        cancel_button = gtk.Button(_("Cancel"))

        buttons_hbox = gtk.HBox(True, 10)
        buttons_hbox.pack_start(save_button)
        buttons_hbox.pack_start(cancel_button)
        
        vbox = gtk.VBox(False, 15)
        vbox.pack_start(hpan)
        vbox.pack_start(buttons_hbox, True, True, 10)
        
        save_button.connect("clicked", self.save_audio_tags)
        cancel_button.connect_object("clicked", gtk.Widget.destroy, self)
        
        self.add(vbox)
        self.show_all()
开发者ID:Lomir,项目名称:foobnix,代码行数:56,代码来源:tag_util.py

示例7: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
        def __init__(self, controls, on_hide_callback):
            self.controls = controls
            ChildTopWindow.__init__(self, "movie")
            self.set_hide_on_escape(False)
            self.on_hide_callback = on_hide_callback
            ## TODO: check it
            ##self.set_flags(Gtk.CAN_FOCUS)
            self.layout = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
            self.set_property("skip-taskbar-hint", True)
            self.set_keep_above(True)
            self.draw = AdvancedDrawingArea(controls)
            self.draw.action_function = on_hide_callback
            self.set_resizable(True)
            self.set_border_width(0)

            self.layout.pack_start(self.draw, True, False, 0)

            self.text_label = Gtk.Label.new("foobnix")
            self.volume_button = Gtk.VolumeButton.new()
            self.volume_button.connect("value-changed", self.volume_changed)

            line = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
            line.pack_start(ImageButton("view-fullscreen", on_hide_callback, _("Exit Fullscrean")), False, False, 0)
            line.pack_start(PlaybackControls(controls), False, False, 0)
            line.pack_start(controls.seek_bar_movie, True, False, 0)
            line.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
            line.pack_start(self.text_label, False, False, 0)
            line.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
            line.pack_start(self.volume_button, False, False, 0)
            line.show_all()

            control_panel = Gtk.Window(Gtk.WindowType.POPUP)
            control_panel.set_size_request(800, -1)
            control_panel.add(line)

            self.add(self.layout)

            self.draw.connect("enter-notify-event", lambda *a: GLib.idle_add(control_panel.hide))

            def my_event(w, e):
                if e.y > Gdk.screen_height() - 5: #@UndefinedVariable
                    def safe_task():
                        control_panel.show()
                        control_panel.set_size_request(Gdk.screen_width(), -1)#@UndefinedVariable
                        control_panel.move(0, Gdk.screen_height() - control_panel.get_allocation().height)#@UndefinedVariable
                    GLib.idle_add(safe_task)

            self.connect("motion-notify-event", my_event)
开发者ID:foobnix,项目名称:foobnix,代码行数:50,代码来源:movie_area.py

示例8: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
 def __init__(self, controls, on_hide_callback):
     self.controls = controls
     ChildTopWindow.__init__(self, "movie")
     self.set_hide_on_escape(False)
     self.on_hide_callback = on_hide_callback
     self.set_flags(gtk.CAN_FOCUS)
     self.layout = gtk.VBox(False)
     self.set_property("skip-taskbar-hint", True)
     self.set_keep_above(True)
     self.draw = AdvancedDrawingArea(controls)
     self.draw.action_function = on_hide_callback 
     self.set_resizable(True)
     self.set_border_width(0)
     
     self.layout.pack_start(self.draw, True)
                 
     self.text_label = gtk.Label("foobnix")
     self.volume_button= gtk.VolumeButton()
     self.volume_button.connect("value-changed", self.volume_changed)
     
     line = gtk.HBox(False)            
     line.pack_start(ImageButton(gtk.STOCK_FULLSCREEN, on_hide_callback, _("Exit Fullscrean")), False)
     line.pack_start(PlaybackControls(controls), False)
     line.pack_start(controls.seek_bar_movie, True)
     line.pack_start(gtk.SeparatorToolItem(),False)
     line.pack_start(self.text_label, False)
     line.pack_start(gtk.SeparatorToolItem(),False)
     line.pack_start(self.volume_button, False)
     line.show_all()
     
     control_panel = gtk.Window(gtk.WINDOW_POPUP)
     control_panel.set_size_request(800, -1)
     control_panel.add(line)
     
     self.add(self.layout)
                
     self.draw.connect("enter-notify-event", lambda *a: gobject.idle_add(control_panel.hide))
     
     def my_event(w, e):
         if e.y > gtk.gdk.screen_height() - 5: #@UndefinedVariable
             def safe_task():
                 control_panel.show()
                 control_panel.set_size_request(gtk.gdk.screen_width(), -1)#@UndefinedVariable
                 control_panel.move(0, gtk.gdk.screen_height() - control_panel.get_allocation().height)#@UndefinedVariable
             gobject.idle_add(safe_task)
             
     self.connect("motion-notify-event", my_event)
开发者ID:cyberbolt,项目名称:foobnix,代码行数:49,代码来源:movie_area.py

示例9: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
 def __init__(self, controls, on_hide_callback):
     self.controls = controls
     ChildTopWindow.__init__(self, "movie")
     self.set_hide_on_escape(False)
     self.on_hide_callback = on_hide_callback
     
     self.layout = gtk.VBox(False)
     
     self.drow = AdvancedDrawingArea(controls)
     self.drow.action_function = on_hide_callback 
     self.set_resizable(True)
     self.set_border_width(0)
     
     self.layout.pack_start(self.drow, True)
     
     
     self.text_label = gtk.Label("foobnix")
     self.volume_button= gtk.VolumeButton()
     self.volume_button.connect("value-changed", self.volume_changed)
     
     line = gtk.HBox(False)            
      
     line.pack_start(ImageButton(gtk.STOCK_FULLSCREEN, on_hide_callback, _("Exit Fullscrean")), False)
     line.pack_start(PlaybackControls(controls), False)
     line.pack_start(controls.seek_bar_movie, True)
     line.pack_start(gtk.SeparatorToolItem(),False)
     line.pack_start(self.text_label, False)
     line.pack_start(gtk.SeparatorToolItem(),False)
     line.pack_start(self.volume_button, False)
     
     self.layout.pack_start(line,False)
     
     self.add(self.layout)
     self.set_opacity(1)
     
     def my_event(w, e):
         if e.y > gtk.gdk.screen_height() - 50: #@UndefinedVariable
             line.show()
         else:
             line.hide()          
     
     self.connect("motion-notify-event", my_event)
开发者ID:matttbe,项目名称:foobnix,代码行数:44,代码来源:movie_area.py

示例10: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
 def __init__(self, controls):
     ChildTopWindow.__init__(self, "Progress", 500, 100)
     
     self.set_transient_for(controls.main_window)
     
     self.label = gtk.Label("Total analyzed folders: ")
     self.label1 = gtk.Label("Total analyzed files: ")
     self.label2 = gtk.Label("Folders with media files found: ")
     self.label3 = gtk.Label("Media files found: ")
     
     self.analyzed_files_label = gtk.Label("0")
     self.analyzed_folders_label = gtk.Label("0")
     self.media_files_label = gtk.Label("0")
     self.media_folders_label = gtk.Label("0")
     
     self.analyzed_files = 0
     self.analyzed_folders = 0
     self.media_files = 0
     self.media_folders = 0
     
     left_box = gtk.VBox()
     left_box.pack_start(self.label)
     left_box.pack_start(self.label1)
     left_box.pack_start(self.label2)
     left_box.pack_start(self.label3)
     
     right_box = gtk.VBox()
     right_box.pack_start(self.analyzed_folders_label)
     right_box.pack_start(self.analyzed_files_label)
     right_box.pack_start(self.media_folders_label)
     right_box.pack_start(self.media_files_label)
     
     box = gtk.HBox()
     box.pack_start(left_box)
     box.pack_start(right_box)
     
     self.add(box)
     
     gobject.idle_add(self.show_all)
开发者ID:atis,项目名称:foobnix,代码行数:41,代码来源:music_service.py

示例11: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self, controls, callback):
        self.callback = callback
        FControl.__init__(self, controls)
        ChildTopWindow.__init__(self, _("Equalizer"))

        self.combo = Gtk.ComboBoxText.new_with_entry()
        self.combo.connect("changed", self.on_combo_change)

        self.eq_lines = []
        for label in EQUALIZER_LABLES:
            self.eq_lines.append(EqLine(label, self.on_callback))

        lbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        lbox.show()

        lbox.pack_start(self.top_row(), False, False, 0)
        lbox.pack_start(self.middle_lines_box(), False, False, 0)

        self.add(lbox)

        self.models = []
        self.default_models = []
开发者ID:foobnix,项目名称:foobnix,代码行数:24,代码来源:eq_gui.py

示例12: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self, controls):
        ChildTopWindow.__init__(self, "Progress", 500, 100)

        self.set_transient_for(controls.main_window)

        self.label = Gtk.Label.new("Total analyzed folders: ")
        self.label1 = Gtk.Label.new("Total analyzed files: ")
        self.label2 = Gtk.Label.new("Folders with media files found: ")
        self.label3 = Gtk.Label.new("Media files found: ")

        self.analyzed_files_label = Gtk.Label.new("0")
        self.analyzed_folders_label = Gtk.Label.new("0")
        self.media_files_label = Gtk.Label.new("0")
        self.media_folders_label = Gtk.Label.new("0")

        self.analyzed_files = 0
        self.analyzed_folders = 0
        self.media_files = 0
        self.media_folders = 0

        left_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        left_box.pack_start(self.label, False, False, 0)
        left_box.pack_start(self.label1, False, False, 0)
        left_box.pack_start(self.label2, False, False, 0)
        left_box.pack_start(self.label3, False, False, 0)

        right_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        right_box.pack_start(self.analyzed_folders_label, False, False, 0)
        right_box.pack_start(self.analyzed_files_label, False, False, 0)
        right_box.pack_start(self.media_folders_label, False, False, 0)
        right_box.pack_start(self.media_files_label, False, False, 0)

        box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
        box.pack_start(left_box, False, False, 0)
        box.pack_start(right_box, False, False, 0)

        self.add(box)

        self.show_all()
开发者ID:zavlab1,项目名称:foobnix,代码行数:41,代码来源:music_service.py

示例13: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self):
        ChildTopWindow.__init__(self, title="Audio Converter", width=500, height=400)

        self.area = ScrolledText()
        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 10)
        vbox.pack_start(self.area.scroll, True, True, 0)
        vbox.show()
        format_label = Gtk.Label.new(_('Format'))
        bitrate_label = Gtk.Label.new(_('Bitrate'))
        channels_label = Gtk.Label.new(_('Channels'))
        hertz_label = Gtk.Label.new(_('Frequency'))

        format_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        bitrate_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        channels_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        hertz_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)

        self.format_list = ["Choose", "  mp3", "  ogg", "  mp2", "  ac3", "  m4a", "  wav"]
        self.bitrate_list = ["  64 kbps", "  96 kbps", "  128 kbps", "  160 kbps", "  192 kbps", "  224 kbps", "  256 kbps", "  320 kbps", "  384 kbps", "  448 kbps", "  640 kbps"]
        self.channels_list = ["  1", "  2", "  6"]
        self.hertz_list = ["  22050 Hz", "  44100 Hz", "  48000 Hz", "  96000 Hz"]

        self.format_combo = combobox_constr(self.format_list)
        self.format_combo.connect("changed", self.on_change_format)

        self.bitrate_combo = combobox_constr()
        self.channels_combo = combobox_constr()
        self.hertz_combo = combobox_constr()

        format_box.pack_start(format_label, False, False, 0)
        format_box.pack_start(self.format_combo, False, False, 0)
        bitrate_box.pack_start(bitrate_label, False, False, 0)
        bitrate_box.pack_start(self.bitrate_combo, False, False, 0)
        channels_box.pack_start(channels_label, False, False, 0)
        channels_box.pack_start(self.channels_combo, False, False, 0)
        hertz_box.pack_start(hertz_label, False, False, 0)
        hertz_box.pack_start(self.hertz_combo, False, False, 0)

        hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 30)
        hbox.pack_start(format_box, False, False, 0)
        hbox.pack_start(bitrate_box, False, False, 0)
        hbox.pack_start(channels_box, False, False, 0)
        hbox.pack_start(hertz_box, False, False, 0)
        hbox.set_border_width(10)
        hbox.show_all()

        vbox.pack_start(hbox, False, False, 0)

        self.button_box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10)
        close_button = Gtk.Button.new_with_label(_("Close"))
        close_button.set_size_request(150, 30)
        close_button.connect("clicked", lambda *a: self.hide())
        self.convert_button = Gtk.Button.new_with_label(_("Convert"))
        self.convert_button.set_size_request(150, 30)
        self.convert_button.connect("clicked", self.save)

        self.progressbar = Gtk.ProgressBar()

        self.stop_button = Gtk.Button.new_with_label(_("Stop"))
        self.stop_button.set_size_request(100, 30)
        self.stop_button.connect("clicked", self.on_stop)

        self.open_folder_button = Gtk.Button.new_with_label(_("Show files"))
        self.open_folder_button.connect('released', self.open_in_fm)

        self.progress_box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
        self.progress_box.pack_end(self.open_folder_button, False, False, 0)
        self.progress_box.pack_end(self.stop_button, False, False, 0)
        self.progress_box.pack_end(self.progressbar, True, True, 0)

        self.output = ScrolledText()
        self.output.text.set_size_request(-1, 150)
        self.output.scroll.set_size_request(-1, 150)
        self.output.scroll.set_placement(Gtk.CornerType.BOTTOM_LEFT)
        vbox.pack_start(self.progress_box, False, False, 0)

        self.button_box.pack_end(self.convert_button, False, False, 0)
        self.button_box.pack_end(close_button, False, False, 0)

        self.button_box.show_all()

        vbox.pack_start(self.button_box, False, False, 0)
        vbox.pack_start(self.output.scroll, False, False, 0)
        self.add(vbox)
开发者ID:zavlab1,项目名称:foobnix,代码行数:86,代码来源:converter.py

示例14: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self, controls):
        ChildTopWindow.__init__(self, _("Tag Editor"))
        self.controls = controls

        self.store = {}

        self.set_resizable(True)
        self.set_default_size(430, 150)

        """make tooltip more quick (useful for checkbuttons)"""
        Gtk.Settings().set_property('gtk-tooltip-timeout', 0)


        artist_label = Gtk.Label(_("Artist")) #@UnusedVariable
        title_label = Gtk.Label(_("Title")) #@UnusedVariable
        album_label = Gtk.Label(_("Album")) #@UnusedVariable
        date_label = Gtk.Label(_("Year")) #@UnusedVariable
        tracknumber_label = Gtk.Label(_("Track number")) #@UnusedVariable
        genre_label = Gtk.Label(_("Genre")) #@UnusedVariable
        author_label = Gtk.Label(_("Author text")) #@UnusedVariable
        composer_label = Gtk.Label(_("Composer")) #@UnusedVariable

        self.paths = []
        self.tag_names = ["artist", "title", "album", "date", "tracknumber", "genre", "author", "composer"]
        self.tag_mp4_names = ['\xa9ART', '\xa9nam', '\xa9alb', '\xa9day', 'trkn', '\xa9gen', '', '\xa9wrt']
        self.tag_entries = []
        self.labels = []
        self.check_buttons = []
        self.hboxes = []

        for tag_name in self.tag_names:

            vars()[tag_name + "_entry"] = Gtk.Entry()
            self.tag_entries.append(vars()[tag_name + "_entry"])

            self.labels.append(vars()[tag_name + "_label"])

            vars()[tag_name + "_chbutton"] = Gtk.CheckButton()
            self.check_buttons.append(vars()[tag_name + "_chbutton"])
#
            check_button = self.check_buttons[-1]

            check_button.set_focus_on_click(False)
            check_button.set_tooltip_text(_("Apply for all selected tracks\n(active on multi selection)"))

            vars()[tag_name + "_hbox"] = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 5)
            self.hboxes.append(vars()[tag_name + "_hbox"])

            self.hboxes[-1].pack_end(check_button, False, False)
            self.hboxes[-1].pack_end(self.tag_entries[-1], True, True)


        lvbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 7)
        lvbox.set_homogeneous(True)
        rvbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 7)
        rvbox.set_homogeneous(True)

        hpan = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)

        for label, hbox in zip(self.labels, self.hboxes):
            lvbox.pack_start(label)
            rvbox.pack_start(hbox)

        hpan.pack1(lvbox)
        hpan.pack2(rvbox)

        apply_button = Gtk.Button(_("Apply"))
        close_button = Gtk.Button(_("Close"))

        buttons_hbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 10)
        buttons_hbox.set_homogeneous(True)
        buttons_hbox.pack_start(apply_button)
        buttons_hbox.pack_start(close_button)

        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 15)
        vbox.pack_start(hpan)
        vbox.pack_start(buttons_hbox, True, True, 10)

        apply_button.connect("clicked", self.save_audio_tags, self.paths)
        close_button.connect("clicked", lambda * a: self.hide())

        self.add(vbox)
        self.show_all()
开发者ID:kagel,项目名称:foobnix,代码行数:85,代码来源:tag_util.py

示例15: __init__

# 需要导入模块: from foobnix.helpers.window import ChildTopWindow [as 别名]
# 或者: from foobnix.helpers.window.ChildTopWindow import __init__ [as 别名]
    def __init__(self, service):
        self.service = service
        ChildTopWindow.__init__(self, _("VKontakte Authorization (require for music search)"))
        self.set_resizable(True)
        vbox = gtk.VBox(False, 0)
        self.access_token = None
        
        default_button = gtk.Button(_("Get Login and Password"))
        default_button.connect("clicked", self.on_defaults)

        
        def web_kit_token():
            import webkit            
            self.web_view = webkit.WebView()
            self.web_view.set_size_request(640, -1) 
            
            self.web_view.load_uri(self.get_web_url())
            self.web_view.connect("navigation-policy-decision-requested", self._nav_request_policy_decision_cb)
               
            vbox.pack_start(self.web_view, True, True)
            vbox.pack_start(default_button, False, False)
        
       

        def dialog_token():
            self.set_keep_above(True)
            self.token = gtk.Entry() 
            self.set_size_request(550, -1)           
            self.user_id = gtk.Entry()
            if FC().user_id:
                self.user_id.set_text(FC().user_id) 
            
            
            edit = gtk.Entry()
            edit.set_text(self.API_URL)
            link = gtk.LinkButton(self.API_URL,_("Open"))
            
            line = gtk.HBox(False, 0)                    
            line.pack_start(edit, True, True)
            line.pack_start(link, False, False)
            
            apply = gtk.Button(_("2: Apply Token"))
            apply.connect("clicked", self.on_apply)
            
            self.info_line = gtk.Label(_("Please generate token..."))
            
            vbox.pack_start(ImageBase("vk.png"), False, False)
            vbox.pack_start(line, False, False)
            
            vbox.pack_start(HBoxLableEntry(gtk.Label(_("Token:")) , self.token))
            vbox.pack_start(HBoxLableEntry(gtk.Label(_("User ID:")) , self.user_id))
            
            vbox.pack_start(apply, False, False)
            vbox.pack_start(self.info_line, False, False)
        
        if os.name == 'nt':
            dialog_token()
        else:
            try:
                web_kit_token()
            except:
                dialog_token()
    
        self.add(vbox)
开发者ID:jose2190,项目名称:foobnix,代码行数:66,代码来源:vk_service.py


注:本文中的foobnix.helpers.window.ChildTopWindow.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。