Turn auto-share mode on or off
496980
def notify_preference=(value)
      if value
        translated_value = "1"
      else
        translated_value = "0"
      end
      xml = Builder::XmlMarkup.new
      xml.instruct!
      xml.Request(:xmlns => "urn:sbx:apis:SbxBaseComponents") do |xml|
        connection.requester_credentials_block(xml)
        xml.SetBusinessCardNotifyPreferenceCall do |xml|
          xml.BusinessCardNotifyPreference(translated_value)
        end
      end
      response = connection.post_xml(xml)
      # TODO: Retrieve the new value to make sure it worked?
      value
    end
363687
def OnTogglePlay(self, event):
        """"""

        if self.player.get_state() == vlc.State.Playing:
            self.player.pause()
        else:
            self.player.play()

        event.Skip()
423949
function setRecorderWork(enable){
    isWorking = enable;
    if(isWorking){
        chrome.browserAction.setTitle({title: __('icon_record_tip')});
        chrome.browserAction.setIcon({path: workIcon===1?ENABLE_ICON1:ENABLE_ICON2});
        workIcon *= -1;
        workIconTimer = setTimeout(function(){
            setRecorderWork(true);
        }, 1000);
    }
    else{
        clearTimeout(workIconTimer);
        chrome.browserAction.setTitle({title: __('icon_end_tip')});
        chrome.browserAction.setIcon({path: DISABLE_ICON});
    }
}
419982
def OnLinkVLCVideo(self, event):
        """"""

        key = self.grid.actions.cursor

        if event.videofile:
            try:
                video_volume = \
                    self.grid.code_array.cell_attributes[key]["video_volume"]
            except KeyError:
                video_volume = None

            self.grid.actions.set_attr("panel_cell", True)

            if video_volume is not None:
                code = 'vlcpanel_factory("{}", {})'.format(
                    event.videofile, video_volume)
            else:
                code = 'vlcpanel_factory("{}")'.format(event.videofile)

            self.grid.actions.set_code(key, code)

        else:
            try:
                video_panel = self.grid.grid_renderer.video_cells.pop(key)
                video_panel.player.stop()
                video_panel.player.release()
                video_panel.Destroy()
            except KeyError:
                pass

            self.grid.actions.set_code(key, u"")
1227070
def enable_disable(self):
        
        if self.enabled:
            self.update(enabled=False)
        else:
            self.update(enabled=True)
1247885
function togglePlay(originalEvent) {
    const { state: { config, paused } } = this;
    config.preserveItems = true;
    this.setState('paused', !paused);
    if (paused && !this.isMoving) {
        this.move(RIGHT);
    }
    emitAndFire(this, `carousel-${paused ? 'play' : 'pause'}`, { originalEvent });
}
2915
def set_relay_off(self):
        """"""
        if self.get_relay_state():
            try:
                request = requests.get(
                    '{}/relay'.format(self.resource), params={'state': '0'},
                    timeout=self.timeout)
                if request.status_code == 200:
                    self.data['relay'] = False
            except requests.exceptions.ConnectionError:
                raise exceptions.MyStromConnectionError()
43273
def save_and_close_enable(self, top_left, bottom_right):
        """"""
        self.btn_save_and_close.setEnabled(True)
        self.btn_save_and_close.setAutoDefault(True)
        self.btn_save_and_close.setDefault(True)
1211160
def setup_common_actions(self):
        """"""
        actions = super(ExplorerTreeWidget, self).setup_common_actions()
        if self.show_cd_only is None:
            # Enabling the 'show current directory only' option but do not
            # allow the user to disable it
            self.show_cd_only = True
        else:
            # Show current directory only
            cd_only_action = create_action(self,
                                           _("Show current directory only"),
                                           toggled=self.toggle_show_cd_only)
            cd_only_action.setChecked(self.show_cd_only)
            self.toggle_show_cd_only(self.show_cd_only)
            actions.append(cd_only_action)
        return actions
317053
def on_save(self, event):
        ''''''
        dlg = wx.FileDialog(None, self.settings.get_title(), '', "", '*.*',
                            wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
        if dlg.ShowModal() == wx.ID_OK:
            self.settings.save(dlg.GetPath())
495014
def setAutoRangeOff(self):
        
        # TODO: catch exceptions. How?
        # /argos/hdf-eos/DeepBlue-SeaWiFS-1.0_L3_20100101_v002-20110527T191319Z.h5/aerosol_optical_thickness_stddev_ocean
        if self.getRefreshBlocked():
            logger.debug("setAutoRangeOff blocked for {}".format(self.nodeName))
            return

        if self.autoRangeCti:
            self.autoRangeCti.data = False

        self._forceRefreshAutoRange()
68891
def shareable(self, boolean):
        """"""
        if(boolean):
            r = self.flag({
                "flag": "make_shareable"
            })
        else:
            r = self.flag({
                "flag": "make_not_shareable"
            })

        return r
953658
def pauseMovie(self):
    """"""
    if self.state == self.PLAYING:
      self.sendRtspRequest(self.PAUSE)
24093
public static void enableAutoRead(Channel channel) {
    if (!channel.config().isAutoRead()) {
      channel.config().setAutoRead(true);
      channel.read();
    }
  }
430078
private void togglePause() {
        OffsetItem pauseOffsetItem = fsuipcInterface.read(new OffsetIdent(0x0262, 2));
        int pauseOffsetValue = pauseOffsetItem.getValue().toShort();
        switch(pauseOffsetValue) {
            case 0:
                fsuipcInterface.write(new OffsetItem(0x0262, 2, ByteArray.create("1", 2)));
                break;
            case 1:
                fsuipcInterface.write(new OffsetItem(0x0262, 2, ByteArray.create("0", 2)));
                break;
            default:
                throw new IllegalStateException("invalid value - " + pauseOffsetValue);
        }
    }
404875
function() {

            // Only do this if we have sharing set up correctly
            if (app.config.sharing.codeDir && app.config.sharing.share) {

              // Share dir
              var share = app.config.sharing.share.split(':') || ['', '/code'];

              return {
                service: 'cli',
                description: 'Run a system command like sudo, ls, rm, chown...',
                mapping: '<config.sharing.codeDir>:' + share[1],
                stripfirst: true
              };

            }
          }
1233877
def on_scenario_directory_radio_toggled(self, flag):
        
        if flag:
            self.output_directory.setText(self.source_directory.text())
        self.output_directory_chooser.setEnabled(not flag)