Example #1
0
    def build_tray_bwsetsubmenu(self):
        # Create the Download speed list sub-menu
        submenu_bwdownset = common.build_menu_radio_list(
                self.config["tray_download_speed_list"], self.tray_setbwdown,
                self.max_download_speed,
                     _("KiB/s"), show_notset=True, show_other=True)

        # Create the Upload speed list sub-menu
        submenu_bwupset = common.build_menu_radio_list(
                self.config["tray_upload_speed_list"], self.tray_setbwup,
                self.max_upload_speed,
                _("KiB/s"), show_notset=True, show_other=True)

        # Add the sub-menus to the tray menu
        self.builder.get_object("menuitem_download_limit").set_submenu(
            submenu_bwdownset)
        self.builder.get_object("menuitem_upload_limit").set_submenu(
            submenu_bwupset)

        # Show the sub-menus for all to see
        submenu_bwdownset.show_all()
        submenu_bwupset.show_all()

        # Re-set the menu to partly work around Launchpad bug #608219
        if appindicator and self.config["enable_appindicator"]:
            self.indicator.set_menu(self.tray_menu)
Example #2
0
    def build_tray_bwsetsubmenu(self):
        # Create the Download speed list sub-menu
        submenu_bwdownset = common.build_menu_radio_list(
            self.config["tray_download_speed_list"],
            self.on_tray_setbwdown,
            self.max_download_speed,
            _("KiB/s"),
            show_notset=True,
            show_other=True)

        # Create the Upload speed list sub-menu
        submenu_bwupset = common.build_menu_radio_list(
            self.config["tray_upload_speed_list"],
            self.on_tray_setbwup,
            self.max_upload_speed,
            _("KiB/s"),
            show_notset=True,
            show_other=True)
        # Add the sub-menus to the tray menu
        self.builder.get_object("menuitem_download_limit").set_submenu(
            submenu_bwdownset)
        self.builder.get_object("menuitem_upload_limit").set_submenu(
            submenu_bwupset)

        # Show the sub-menus for all to see
        submenu_bwdownset.show_all()
        submenu_bwupset.show_all()
Example #3
0
    def build_tray_bwsetsubmenu(self):
        # Create the Download speed list sub-menu
        submenu_bwdownset = common.build_menu_radio_list(
            self.config["tray_download_speed_list"],
            self.on_tray_setbwdown,
            self.max_download_speed,
            _("KiB/s"),
            show_notset=True,
            show_other=True,
        )

        # Create the Upload speed list sub-menu
        submenu_bwupset = common.build_menu_radio_list(
            self.config["tray_upload_speed_list"],
            self.on_tray_setbwup,
            self.max_upload_speed,
            _("KiB/s"),
            show_notset=True,
            show_other=True,
        )
        # Add the sub-menus to the tray menu
        self.builder.get_object("menuitem_download_limit").set_submenu(submenu_bwdownset)
        self.builder.get_object("menuitem_upload_limit").set_submenu(submenu_bwupset)

        # Show the sub-menus for all to see
        submenu_bwdownset.show_all()
        submenu_bwupset.show_all()
Example #4
0
    def build_tray_bwsetsubmenu(self):
        # Create the Download speed list sub-menu
        submenu_bwdownset = common.build_menu_radio_list(
            self.config["tray_download_speed_list"],
            self.tray_setbwdown,
            self.max_download_speed,
            _("KiB/s"),
            show_notset=True,
            show_other=True)

        # Create the Upload speed list sub-menu
        submenu_bwupset = common.build_menu_radio_list(
            self.config["tray_upload_speed_list"],
            self.tray_setbwup,
            self.max_upload_speed,
            _("KiB/s"),
            show_notset=True,
            show_other=True)

        # Add the sub-menus to the tray menu
        self.tray_glade.get_widget("menuitem_download_limit").set_submenu(
            submenu_bwdownset)
        self.tray_glade.get_widget("menuitem_upload_limit").set_submenu(
            submenu_bwupset)

        # Show the sub-menus for all to see
        submenu_bwdownset.show_all()
        submenu_bwupset.show_all()

        # Re-set the menu to partly work around Launchpad bug #608219
        if appindicator and self.config["enable_appindicator"]:
            self.indicator.set_menu(self.tray_menu)
Example #5
0
 def _on_connection_item_clicked(self, widget, event):
     menu = common.build_menu_radio_list(
         self.config["connection_limit_list"],
         self._on_set_connection_limit,
         self.max_connections, show_notset=True, show_other=True)
     menu.show_all()
     menu.popup(None, None, None, event.button, event.time)
Example #6
0
 def _on_connection_item_clicked(self, widget, event):
     menu = common.build_menu_radio_list(
         self.config["connection_limit_list"],
         self._on_set_connection_limit,
         self.max_connections, show_notset=True, show_other=True)
     menu.show_all()
     menu.popup(None, None, None, event.button, event.time)
Example #7
0
 def _on_upload_item_clicked(self, widget, event):
     menu = common.build_menu_radio_list(
         self.config["tray_upload_speed_list"],
         self._on_set_upload_speed,
         self.max_upload_speed,
         _("KiB/s"), show_notset=True, show_other=True)
     menu.show_all()
     menu.popup(None, None, None, event.button, event.time)
Example #8
0
 def _on_upload_item_clicked(self, widget, event):
     menu = common.build_menu_radio_list(
         self.config["tray_upload_speed_list"],
         self._on_set_upload_speed,
         self.max_upload_speed,
         _("KiB/s"), show_notset=True, show_other=True)
     menu.show_all()
     menu.popup(None, None, None, event.button, event.time)