예제 #1
0
  private void doEmailTranscript() {
    TermSession session = getCurrentTermSession();
    if (session != null) {
      // Don't really want to supply an address, but
      // currently it's required, otherwise nobody
      // wants to handle the intent.
      String addr = "*****@*****.**";
      Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + addr));

      String subject = getString(R.string.email_transcript_subject);
      String title = session.getTitle();
      if (title != null) {
        subject = subject + " - " + title;
      }
      intent.putExtra(Intent.EXTRA_SUBJECT, subject);
      intent.putExtra(Intent.EXTRA_TEXT, session.getTranscriptText().trim());
      try {
        startActivity(
            Intent.createChooser(intent, getString(R.string.email_transcript_chooser_title)));
      } catch (ActivityNotFoundException e) {
        Toast.makeText(this, R.string.email_transcript_no_email_activity_found, Toast.LENGTH_LONG)
            .show();
      }
    }
  }
예제 #2
0
  private void doCloseWindow() {
    if (mTermSessions == null) {
      return;
    }

    EmulatorView view = getCurrentEmulatorView();
    if (view == null) {
      return;
    }
    TermSession session = mTermSessions.remove(mViewFlipper.getDisplayedChild());
    view.onPause();
    session.finish();
    mViewFlipper.removeView(view);
    if (mTermSessions.size() == 0) {
      mStopServiceOnFinish = true;
      finish();
    } else {
      mViewFlipper.showNext();
    }
  }
예제 #3
0
 private void doResetTerminal() {
   TermSession session = getCurrentTermSession();
   if (session != null) {
     session.reset();
   }
 }
예제 #4
0
 private TermSession createTermSession() {
   TermSettings settings = mSettings;
   TermSession session = createTermSession(this, settings, settings.getInitialCommand());
   session.setFinishCallback(mTermService);
   return session;
 }