void run() { running_ = true; if (sessionId_.empty()) startSharedProcess(); else runSession(); }
void TEDemo::newSession(int i) { char* shell = getenv("SHELL"); if (shell == NULL || *shell == '\0') shell = "/bin/sh"; KSimpleConfig* co = no2command.find(i); if (!co) return; // oops assert( se ); //FIXME: careful here. QString cmd = co->readEntry("Exec"); // not null QString nam = co->readEntry("Name"); // not null QString emu = co->readEntry("Term"); QString sch = co->readEntry("Schema"); QString txt = co->readEntry("Comment"); // not null int fno = QMIN(co->readUnsignedNumEntry("Font",se->fontNo()),7); ColorSchema* schema = sch.isEmpty() ? (ColorSchema*)NULL : ColorSchema::find(sch); //FIXME: schema names here are absolut. Wrt. loadAllSchemas, // relative pathes should be allowed, too. int schmno = schema?schema->numb:se->schemaNo(); if (emu.isEmpty()) emu = se->emuName(); QStrList args; args.append(shell); args.append("-c"); args.append(cmd); TESession* s = new TESession(this,te,args,emu.data(),0); s->setFontNo(fno); s->setSchemaNo(schmno); s->setTitle(txt.data()); addSession(s); runSession(s); // activate and run }
TEDemo::TEDemo(char* name, QStrList & _args, int login_shell) : KTMainWindow(name), args(_args) { se = 0L; menubar = menuBar(); setMinimumSize(200,100); // session management setUnsavedData( true ); // terminals cannot store their contents // create terminal emulation framework //////////////////////////////////// te = new TEWidget(this); te->setMinimumSize(150,70); // allow resizing, cause resize in TEWidget // create applications ///////////////////////////////////////////////////// setView(te,FALSE); makeMenu(); makeStatusbar(); // Init DnD: Set up drop zone and drop handler ///////////////////////////// dropZone = new KDNDDropZone( this, DndURL ); connect( dropZone, SIGNAL( dropAction( KDNDDropZone* )), SLOT( onDrop( KDNDDropZone*))); // load session commands /////////////////////////////////////////////////// loadSessionCommands(); m_file->insertSeparator(); m_file->insertItem( i18n("E&xit"), kapp, SLOT(quit())); // load schema ///////////////////////////////////////////////////////////// curr_schema = 0; ColorSchema::loadAllSchemas(); for (int i = 0; i < ColorSchema::count(); i++) { ColorSchema* s = ColorSchema::find(i); assert( s ); m_schema->insertItem(s->title.data(),s->numb); } //FIXME: we should build a complete session before running it. // construct initial session /////////////////////////////////////////////// TESession* initial = new TESession(this,te,args,"xterm",login_shell); title = (args.count() && !strcmp(kapp->getCaption(),PACKAGE)) ? args.at(0) // program executed in the title bar : kapp->getCaption(); // `konsole' or -caption initial->setTitle(title); addSession(initial); // read and apply default values /////////////////////////////////////////// readProperties(kapp->getConfig()); // activate and run first session ////////////////////////////////////////// runSession(initial); }
HRESULT CMFCamCapture::start() { runSession(); return S_OK; }