Esempio n. 1
0
File: main.C Progetto: xwizard/kde1
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);

}
Esempio n. 2
0
void HexWidget::unsaved(bool flag)
{
    setUnsavedData(flag);
}