Example #1
0
    def __init__ (self, controls):
        PopupTrayWindow.__init__(self, controls)
        #self.modify_bg(Gtk.StateType.NORMAL, self.get_colormap().alloc_color("gray23"))
        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)

        playcontrols = PlaybackControls(controls)
        playcontrols.pack_start(ImageButton("application-exit", controls.quit, _("Exit")), False, False, 0)
        playcontrols.pack_start(ImageButton("", self.hide, _("Close Popup")), False, False, 0)

        self.poopup_text = Gtk.Label()
        self.set_text("Foobnix")
        self.poopup_text.set_line_wrap(True)

        vbox.pack_start(playcontrols, False, False, 0)
        vbox.pack_start(self.poopup_text, False, False, 0)
        self.add(vbox)
        self.show_all()
        self.hide()
Example #2
0
    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.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, False, 0)

        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, 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)
Example #3
0
    def __init__ (self, controls):
        PopupTrayWindow.__init__(self, controls)
        #self.modify_bg(Gtk.StateType.NORMAL, self.get_colormap().alloc_color("gray23"))
        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)

        playcontrols = PlaybackControls(controls)
        playcontrols.pack_start(ImageButton("application-exit", controls.quit, _("Exit")), False, False, 0)
        playcontrols.pack_start(ImageButton("", self.hide, _("Close Popup")), False, False, 0)

        self.poopup_text = Gtk.Label.new(None)
        self.set_text("Foobnix")
        self.poopup_text.set_line_wrap(True)

        vbox.pack_start(playcontrols, False, False, 0)
        vbox.pack_start(self.poopup_text, False, False, 0)
        self.add(vbox)
        self.show_all()
        self.hide()
Example #4
0
    def __init__(self, controls):
        PopupTrayWindow.__init__(self, controls)
        #self.modify_bg(Gtk.StateType.NORMAL, self.get_colormap().alloc_color("gray23"))
        vbox = Gtk.VBox(False, 0)

        playcontrols = PlaybackControls(controls)
        playcontrols.pack_start(
            ImageButton(Gtk.STOCK_QUIT, controls.quit, _("Exit")), False,
            False, 0)
        playcontrols.pack_start(
            ImageButton(Gtk.STOCK_OK, self.hide, _("Close Popup")), False,
            False, 0)

        self.poopup_text = Gtk.Label()
        self.set_text("Foobnix")
        self.poopup_text.set_line_wrap(True)

        vbox.pack_start(playcontrols, False, False, 0)
        vbox.pack_start(self.poopup_text, False, False, 0)
        self.add(vbox)
        self.show_all()
        self.hide()
Example #5
0
    def __init__(self, with_dbus=True):
        BaseFoobnixControls.__init__(self)
        self.layout = None

        self.net_wrapper = NetWrapper(self, FC().net_ping)

        self.statusbar = StatusbarControls(self)

        self.lastfm_service = LastFmService(self)

        self.media_engine = GStreamerEngine(self)
        """elements"""

        self.volume = VolumeControls(self)

        self.record = RadioRecord(self)
        self.seek_bar_movie = SeekProgressBarControls(self)
        self.seek_bar = SeekProgressBarControls(self, self.seek_bar_movie)

        self.trayicon = TrayIconControls(self)
        self.main_window = MainWindow(self)

        self.notetabs = NoteTabControl(self)
        self.search_progress = SearchProgress(self)
        self.in_thread = SingleThread(self.search_progress)

        #self.movie_window = MovieDrawingArea(self)

        self.searchPanel = SearchControls(self)
        self.os = OrderShuffleControls(self)
        self.playback = PlaybackControls(self)

        self.perspectives = Controller(self)

        self.perspectives.attach_perspective(FSPerspective(self))
        self.perspectives.attach_perspective(VKPerspective(self))
        self.perspectives.attach_perspective(LastFMPerspective(self))
        self.perspectives.attach_perspective(RadioPerspective(self))
        self.perspectives.attach_perspective(StoragePerspective(self))
        self.perspectives.attach_perspective(InfoPerspective(self))

        self.coverlyrics = CoverLyricsPanel(self)
        """preferences"""
        self.preferences = PreferencesWindow(self)

        self.eq = EqController(self)
        self.dm = DM(self)
        """layout panels"""
        self.top_panel = TopWidgets(self)
        """layout"""
        self.layout = BaseFoobnixLayout(self)

        self.dbus = None
        if with_dbus:
            from foobnix.gui.controls.dbus_manager import DBusManager
            self.dbus = DBusManager(self)
        try:
            from foobnix.preferences.configs.hotkey_conf import load_foobnix_hotkeys
            load_foobnix_hotkeys()
        except:
            logging.warning("Can't to load keybinder library")