Exemplo n.º 1
0
ConfigForm::ConfigForm(int aCurrentIntervalValue, QWidget *parent,
		       const char *name,
		       bool modal, Qt::WFlags f)
  : QDialog( parent, name, modal, f ),
    mApplyButton(kNULL), mCancelButton(kNULL)
{
  mMinVal_Sec = float(kMIN_POLLING_INT) / 1000.f;
  mMaxVal_Sec = float(kMAX_POLLING_INT) / 1000.f;

  REG_DBGMSG1("ARPDBG: min val = ", mMinVal_Sec);
  REG_DBGMSG1("ARPDBG: max val = ", mMaxVal_Sec);

  REG_DBGCON("ConfigForm");

  // note aCurrentIntervalValue is in milliseconds - convert to
  // seconds for GUI entry

  this->setCaption( "Configure Polling" );
  resize( 150, 150 );

  // create the layouts for the form
  Q3VBoxLayout *lFormLayout = new Q3VBoxLayout(this, 10, 10, "configformlayout");
  Q3HBoxLayout *lButtonLayout = new Q3HBoxLayout(6, "configbuttonlayout");

  lFormLayout->addWidget(new QLabel("Enter interval value (seconds) \n"
				    "Valid range: "
				    +QString::number(mMinVal_Sec)
				    +" - "+QString::number(mMaxVal_Sec)
				    +" (2 d.p.)", this));

  mLineEdit = new QLineEdit( this );

  double lVal = (double) aCurrentIntervalValue/1000;

  mLineEdit->setText(QString::number(lVal, 'g', 3));
  mLineEdit->setValidator( new QDoubleValidator(mLineEdit, "dbleavlidator" ) );

  lFormLayout->addWidget( mLineEdit);

  mApplyButton = new QPushButton("Apply", this, "Applybutton"); \
  mApplyButton->setAutoDefault(FALSE);
  QToolTip::add(mApplyButton, "Apply to steerer");
  connect(mApplyButton, SIGNAL(clicked()), this, SLOT(applySlot()));

  mCancelButton = new QPushButton("Cancel", this, "cancelbutton");
  mCancelButton->setAutoDefault(FALSE);
  connect(mCancelButton,  SIGNAL(clicked()), this, SLOT( reject()));

  mCancelButton->setMinimumSize(mCancelButton->sizeHint());
  mCancelButton->setMaximumSize(mCancelButton->sizeHint());
  mApplyButton->setMinimumSize(mCancelButton->sizeHint());
  mApplyButton->setMaximumSize(mApplyButton->sizeHint());

  lButtonLayout->addWidget(mApplyButton);
  lButtonLayout->addWidget(mCancelButton);

  lFormLayout->addLayout(lButtonLayout);

}
Exemplo n.º 2
0
KexiCSVInfoLabel::KexiCSVInfoLabel(const QString& labelText, QWidget* parent)
        : QWidget(parent)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this, 0, KDialog::spacingHint());
    Q3HBoxLayout *hbox = new Q3HBoxLayout(this);
    vbox->addLayout(hbox);
    m_leftLabel = new QLabel(labelText, this);
    m_leftLabel->setMinimumWidth(130);
    m_leftLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    m_leftLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_leftLabel->setWordWrap(true);
    hbox->addWidget(m_leftLabel);
    m_iconLbl = new QLabel(this);
    m_iconLbl->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    m_iconLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_fnameLbl = new QLabel(this);
    m_fnameLbl->setOpenExternalLinks(true);
    m_fnameLbl->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
    m_fnameLbl->setFocusPolicy(Qt::NoFocus);
    m_fnameLbl->setTextFormat(Qt::PlainText);
    m_fnameLbl->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 1, 0));
    m_fnameLbl->setLineWidth(1);
    m_fnameLbl->setFrameStyle(Q3Frame::Box);
    m_fnameLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_fnameLbl->setWordWrap(true);
    hbox->addSpacing(5);
    hbox->addWidget(m_iconLbl);
    hbox->addWidget(m_fnameLbl, 1, Qt::AlignVCenter | Qt::AlignLeft
#ifdef __GNUC__
#warning TODO | Qt::TextWordWrap
#else
#pragma WARNING( TODO | Qt::TextWordWrap )
#endif
                   );
    hbox->addSpacing(10);
    m_commentLbl = new QLabel(this);
    m_commentLbl->setOpenExternalLinks(true);
    m_commentLbl->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
    m_commentLbl->setFocusPolicy(Qt::NoFocus);
    m_commentLbl->setTextFormat(Qt::PlainText);
    m_commentLbl->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    m_commentLbl->setLineWidth(1);
    m_commentLbl->setFrameStyle(QFrame::Box);
    m_commentLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_commentLbl->setWordWrap(true);
    hbox->addWidget(m_commentLbl, 0, Qt::AlignVCenter | Qt::AlignRight
#ifdef __GNUC__
#warning TODO | Qt::TextWordWrap
#else
#pragma WARNING( TODO | Qt::TextWordWrap )
#endif
                   );

    m_separator = new Q3Frame(this);
    m_separator->setFrameShape(Q3Frame::HLine);
    m_separator->setFrameShadow(Q3Frame::Sunken);
    vbox->addWidget(m_separator);
}
Exemplo n.º 3
0
TicTacToe::TicTacToe( bool meFirst, int boardSize, QWidget *parent, const char *name )
    : QWidget( parent, name )
{
    Q3VBoxLayout * l = new Q3VBoxLayout( this, 6 );

    // Create a message label

    message = new QLabel( this );
    message->setFrameStyle( Q3Frame::WinPanel | Q3Frame::Sunken );
    message->setAlignment( Qt::AlignCenter );
    l->addWidget( message );

    // Create the game board and connect the signal finished() to this
    // gameOver() slot

    board = new TicTacGameBoard( meFirst, boardSize, this );
    connect( board, SIGNAL(finished()), SLOT(gameOver()) );
    l->addWidget( board );

    // Create a horizontal frame line

    Q3Frame *line = new Q3Frame( this );
    line->setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken );
    l->addWidget( line );

    // Create the combo box for deciding who should start, and
    // connect its clicked() signals to the buttonClicked() slot

    whoStarts = new QComboBox( this );
    whoStarts->insertItem( "Opponent starts" );
    whoStarts->insertItem( "You start" );
    l->addWidget( whoStarts );

	whoStarts->setEnabled(false);
	whoStarts->setCurrentIndex(meFirst); 
    // Create the push buttons and connect their clicked() signals
    // to this right slots.

	connect( board, SIGNAL(myMove(int)), this, SIGNAL(myMove(int)));
	connect( board, SIGNAL(stateChanged()), this, SLOT(newState()));
    newGame = new QPushButton( "Play!", this );
    connect( newGame, SIGNAL(clicked()), SLOT(newGameClicked()) );
	newGame->setEnabled(false);
    quit = new QPushButton( "Quit", this );
    connect( quit, SIGNAL(clicked()), this, SIGNAL(closing()) );
    Q3HBoxLayout * b = new Q3HBoxLayout;
    l->addLayout( b );
    b->addWidget( newGame );
    b->addWidget( quit );

    newState();
	//board->newGame();
	newGameClicked();
}
Exemplo n.º 4
0
XListDialog::XListDialog( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) :
  QDialog( parent, name, modal, fl )
{
  if ( !name )
    setName( "XListDialog" );

  Q3VBoxLayout * XListDialogLayout = new Q3VBoxLayout( this, 11, 6, "XListDialogLayout"); 

  Q3HBoxLayout * layout13 = new Q3HBoxLayout( 0, 0, 6, "layout13"); 

  _altFrame = new Q3Frame( this, "_altFrame" );
  _altFrame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, _altFrame->sizePolicy().hasHeightForWidth() ) );
  _altFrame->setFrameShape( Q3Frame::NoFrame );
  _altFrame->setFrameShadow( Q3Frame::Raised );
  layout13->addWidget( _altFrame );

  Q3VBoxLayout * layout12 = new Q3VBoxLayout( 0, 0, 6, "layout12"); 

  _close = new QPushButton( tr( "&Close" ), this, "_close" );
  _close->setAccel( QKeySequence( tr( "Alt+C" ) ) );
  layout12->addWidget( _close );

  _select = new QPushButton( tr( "&Select" ), this, "_select" );
  _select->setAccel( QKeySequence( tr( "Alt+S" ) ) );
  _select->setEnabled(FALSE);
  layout12->addWidget( _select );
  QSpacerItem* spacer = new QSpacerItem( 20, 0, QSizePolicy::Minimum, QSizePolicy::Minimum );
  layout12->addItem( spacer );
  layout13->addLayout( layout12 );
  XListDialogLayout->addLayout( layout13 );

  _listLabel = new QLabel( tr( "List:" ), this, "_listLabel" );
  XListDialogLayout->addWidget( _listLabel );

  _list = new XListView( this, "_list" );
  XListDialogLayout->addWidget( _list );

  setCaption( tr( "XListDialog" ) );
  resize( QSize(420, 380).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

  setTabOrder(_list, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _list);
  _select->setFocus();

  // signals and slots connections
  connect( _close,  SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _list,   SIGNAL( itemSelected(int) ), _select, SLOT( animateClick() ) );
  connect( _list,   SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );
}
Exemplo n.º 5
0
woList::woList(QWidget * parent, const char * name, bool modal, Qt::WFlags fl) :
  QDialog( parent, name, modal, fl )
{
  setCaption(tr("Work Orders"));

  _woid = -1;
  _type = 0;

  if ( !name )
    setName( "woList" );

  Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this, 5, 5, "woListLayout"); 
  Q3HBoxLayout *topLayout = new Q3HBoxLayout( 0, 0, 7, "topLayout"); 
  Q3VBoxLayout *warehouseLayout = new Q3VBoxLayout( 0, 0, 0, "warehouseLayout"); 
  Q3VBoxLayout *buttonsLayout = new Q3VBoxLayout( 0, 0, 5, "buttonsLayout"); 
  Q3VBoxLayout *listLayout = new Q3VBoxLayout( 0, 0, 0, "listLayout"); 

  _warehouse = new WarehouseGroup(this, "_warehouse");
  warehouseLayout->addWidget(_warehouse);

  QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Preferred);
  warehouseLayout->addItem(spacer);

  topLayout->addLayout(warehouseLayout);

  QSpacerItem* spacer_2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
  topLayout->addItem(spacer_2);

  _close = new QPushButton(tr("&Cancel"), this, "_close");
  buttonsLayout->addWidget(_close);

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setAutoDefault(TRUE);
  _select->setDefault(TRUE);
  buttonsLayout->addWidget(_select);
  topLayout->addLayout(buttonsLayout);
  mainLayout->addLayout(topLayout);

  QLabel *_workOrdersLit = new QLabel(tr("Work Orders:"), this, "_workOrdersLit");
  listLayout->addWidget(_workOrdersLit);

  _wo = new XTreeWidget(this);
  _wo->setName("_wo");
  listLayout->addWidget( _wo );
  mainLayout->addLayout(listLayout);

  resize( QSize(484, 366).expandedTo(minimumSizeHint()) );

  connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _wo, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
  connect( _warehouse, SIGNAL(updated()), this, SLOT( sFillList() ) );

  setTabOrder(_warehouse, _wo);
  setTabOrder(_wo, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _warehouse);
  _wo->setFocus();

  _wo->addColumn(tr("W/O #"),       _orderColumn, Qt::AlignLeft   );
  _wo->addColumn(tr("Status"),      40,           Qt::AlignCenter );
  _wo->addColumn(tr("Whs."),        _whsColumn,   Qt::AlignCenter );
  _wo->addColumn(tr("Item Number"), _itemColumn,  Qt::AlignLeft   );
  _wo->addColumn(tr("Description"), -1,           Qt::AlignLeft   );
}
Exemplo n.º 6
0
itemSearch::itemSearch( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl )
{
    if ( !name )
      setName( "itemSearch" );

  _itemid = -1;
  _itemType = ItemLineEdit::cUndefined;
  _useQuery = FALSE;

    setCaption( tr( "Search for Item" ) );

    Q3VBoxLayout *itemSearchLayout = new Q3VBoxLayout( this, 5, 5, "itemSearchLayout"); 
    Q3HBoxLayout *Layout72 = new Q3HBoxLayout( 0, 0, 7, "Layout72"); 
    Q3VBoxLayout *Layout71 = new Q3VBoxLayout( 0, 0, 5, "Layout71"); 
    Q3HBoxLayout *Layout70 = new Q3HBoxLayout( 0, 0, 5, "Layout70"); 
    Q3HBoxLayout *Layout66 = new Q3HBoxLayout( 0, 0, 7, "Layout66"); 
    Q3VBoxLayout *Layout64 = new Q3VBoxLayout( 0, 0, 1, "Layout64"); 
    Q3VBoxLayout *Layout67 = new Q3VBoxLayout( 0, 0, 0, "Layout67"); 
    Q3VBoxLayout *Layout18 = new Q3VBoxLayout( 0, 0, 5, "Layout18"); 
    Q3VBoxLayout *Layout65 = new Q3VBoxLayout( 0, 0, 0, "Layout65"); 
    Q3VBoxLayout *Layout20 = new Q3VBoxLayout( 0, 0, 0, "Layout20"); 

    QLabel *_searchLit = new QLabel(tr("S&earch for:"), this, "_searchLit");
    _searchLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout70->addWidget( _searchLit );

    _search = new QLineEdit( this, "_search" );
    _searchLit->setBuddy( _search );
    Layout70->addWidget( _search );
    Layout71->addLayout( Layout70 );

    _searchNumber = new XCheckBox(tr("Search through Item Numbers"));
    _searchNumber->setChecked( TRUE );
    _searchNumber->setObjectName("_searchNumber");
    Layout64->addWidget( _searchNumber );

    _searchDescrip1 = new XCheckBox(tr("Search through Description 1"));
    _searchDescrip1->setChecked( TRUE );
    _searchDescrip1->setObjectName("searchDescrip1");
    Layout64->addWidget( _searchDescrip1 );

    _searchDescrip2 = new XCheckBox(tr("Search through Description 2"));
    _searchDescrip2->setChecked( TRUE );
    _searchDescrip2->setObjectName("_searchDescrip2");
    Layout64->addWidget( _searchDescrip2 );
    Layout66->addLayout( Layout64 );

    _showInactive = new XCheckBox(tr("Show &Inactive Items"));
    _showInactive->setObjectName("_showInactive");
    Layout65->addWidget( _showInactive );

    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
    Layout65->addItem( spacer );
    Layout66->addLayout( Layout65 );
    Layout71->addLayout( Layout66 );
    Layout72->addLayout( Layout71 );

    _close = new QPushButton(tr("&Cancel"), this, "_close");
    Layout18->addWidget( _close );

    _select = new QPushButton(tr("&Select"), this, "_select");
    _select->setEnabled( FALSE );
    _select->setAutoDefault( TRUE );
    _select->setDefault( TRUE );
    Layout18->addWidget( _select );

    Layout67->addLayout( Layout18 );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
    Layout67->addItem( spacer_2 );
    Layout72->addLayout( Layout67 );
    itemSearchLayout->addLayout( Layout72 );

    QLabel *_itemsLit = new QLabel(tr("&Items:"), this, "_itemsLit");
    Layout20->addWidget( _itemsLit );

    _item = new XTreeWidget(this);
    _item->setName("_item");
    _itemsLit->setBuddy( _item );
    Layout20->addWidget( _item );

    itemSearchLayout->addLayout( Layout20 );
    resize( QSize(462, 391).expandedTo(minimumSizeHint()) );
    //clearWState( WState_Polished );

    // signals and slots connections
    connect( _item, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
    connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
    connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
    connect( _showInactive, SIGNAL( clicked() ), this, SLOT( sFillList() ) );
    connect( _searchNumber, SIGNAL( toggled(bool) ), this, SLOT( sFillList() ) );
    connect( _searchDescrip1, SIGNAL( toggled(bool) ), this, SLOT( sFillList() ) );
    connect( _searchDescrip2, SIGNAL( toggled(bool) ), this, SLOT( sFillList() ) );
    connect( _search, SIGNAL( lostFocus() ), this, SLOT( sFillList() ) );
    connect( _item, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );

  _item->addColumn(tr("Item Number"), 100,  Qt::AlignLeft );
  _item->addColumn(tr("Description"), -1,   Qt::AlignLeft );
}
Exemplo n.º 7
0
shipToList::shipToList(QWidget * parent, const char *name, bool modal, Qt::WFlags fl) :
  QDialog( parent, name, modal, fl )
{
    setCaption(tr("Ship To's"));

  _shiptoid = -1;

  if (!name)
    setName("shipToList");

    Q3VBoxLayout *shipToListLayout = new Q3VBoxLayout( this, 5, 5, "shipToListLayout"); 
    Q3HBoxLayout *Layout54 = new Q3HBoxLayout( 0, 0, 7, "Layout54"); 
    Q3HBoxLayout *Layout53 = new Q3HBoxLayout( 0, 0, 5, "Layout53"); 
    Q3VBoxLayout *Layout51 = new Q3VBoxLayout( 0, 0, 5, "Layout51"); 
    Q3VBoxLayout *Layout49 = new Q3VBoxLayout( 0, 0, 0, "Layout49"); 
    Q3VBoxLayout *Layout52 = new Q3VBoxLayout( 0, 0, 5, "Layout52"); 
    Q3VBoxLayout *Layout50 = new Q3VBoxLayout( 0, 0, 0, "Layout50"); 
    Q3HBoxLayout *Layout6 = new Q3HBoxLayout( 0, 0, 0, "Layout6"); 
    Q3VBoxLayout *Layout2 = new Q3VBoxLayout( 0, 0, 5, "Layout2"); 
    Q3VBoxLayout *Layout55 = new Q3VBoxLayout( 0, 0, 0, "Layout55"); 

    QLabel *_custNumberLit = new QLabel(tr("Customer #:"), this, "_custNumberLit");
    _custNumberLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout49->addWidget( _custNumberLit );

    QLabel *_custNameLit = new QLabel(tr("Cust Name:"), this, "_custNameLit");
    _custNameLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout49->addWidget( _custNameLit );

    QLabel *_custAddressLit = new QLabel(tr("Cust Address:"), this, "_custAddressLit");
    _custAddressLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout49->addWidget( _custAddressLit );
    Layout51->addLayout( Layout49 );

    QLabel *_searchForLit = new QLabel(tr("Search For:"), this, "_searchForLit");
    _searchForLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout51->addWidget( _searchForLit );
    Layout53->addLayout( Layout51 );

    _custNumber = new QLabel( this, "_custNumber" );
    Layout6->addWidget( _custNumber );

    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout6->addItem( spacer );
    Layout50->addLayout( Layout6 );

    _custName = new QLabel( this, "_custName" );
    Layout50->addWidget( _custName );

    _custAddress = new QLabel( this, "_custAddress" );
    Layout50->addWidget( _custAddress );
    Layout52->addLayout( Layout50 );

    _searchFor = new QLineEdit( this, "_searchFor" );
    Layout52->addWidget( _searchFor );
    Layout53->addLayout( Layout52 );
    Layout54->addLayout( Layout53 );

    _close = new QPushButton(tr("&Cancel"), this, "_close");
    Layout2->addWidget( _close );

    _select = new QPushButton(tr("&Select"), this, "_select");
    _select->setDefault( TRUE );
    Layout2->addWidget( _select );
    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
    Layout2->addItem( spacer_2 );
    Layout54->addLayout( Layout2 );
    shipToListLayout->addLayout( Layout54 );

    _shipTosList = new QLabel(tr("Ship To's:"), this, "_shipTosList");
    Layout55->addWidget( _shipTosList );

    _shipto = new XTreeWidget(this);
    _shipto->setName("_shipto");
    Layout55->addWidget( _shipto );
    shipToListLayout->addLayout( Layout55 );

    resize( QSize(580, 365).expandedTo(minimumSizeHint()) );
    //clearWState( WState_Polished );

    // signals and slots connections
    connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
    connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
    connect( _searchFor, SIGNAL( textChanged(const QString&) ), this, SLOT( sSearch(const QString&) ) );
    connect( _shipto, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );

  _selected = NULL;

  _shipto->addColumn(tr("Number"),  70,           Qt::AlignLeft );
  _shipto->addColumn(tr("Name"),    150,          Qt::AlignLeft );
  _shipto->addColumn(tr("Address"), 150,          Qt::AlignLeft );
  _shipto->addColumn(tr("City, State, Zip"), -1,  Qt::AlignLeft );
  _shipto->sortByColumn(1, Qt::AscendingOrder);
}
Exemplo n.º 8
0
itemList::itemList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl )
{
    if ( !name )
      setName( "itemList" );

  _itemid = -1;
  _itemType = ItemLineEdit::cUndefined;
  _useQuery = FALSE;

    setCaption(tr("Item List"));

    Q3VBoxLayout *itemListLayout = new Q3VBoxLayout( this, 5, 5, "itemListLayout"); 
    Q3HBoxLayout *Layout69 = new Q3HBoxLayout( 0, 0, 0, "Layout69"); 
    Q3HBoxLayout *Layout72 = new Q3HBoxLayout( 0, 0, 7, "Layout72"); 
    Q3VBoxLayout *Layout71 = new Q3VBoxLayout( 0, 0, 0, "Layout71"); 
    Q3VBoxLayout *Layout70 = new Q3VBoxLayout( 0, 0, 5, "Layout70"); 
    Q3HBoxLayout *Layout5 = new Q3HBoxLayout( 0, 0, 5, "Layout5"); 
    Q3VBoxLayout *Layout18 = new Q3VBoxLayout( 0, 0, 5, "Layout18"); 
    Q3VBoxLayout *Layout20 = new Q3VBoxLayout( 0, 0, 0, "Layout20"); 

    QLabel *_searchForLit = new QLabel(tr("S&earch for:"), this, "_searchForLit");
    _searchForLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
    Layout5->addWidget( _searchForLit );

    _searchFor = new QLineEdit( this, "_searchFor" );
    _searchForLit->setBuddy(_searchFor);
    Layout5->addWidget( _searchFor );
    Layout70->addLayout( Layout5 );

    _showInactive = new QCheckBox(tr("Show &Inactive Items"), this, "_showInactive");
    Layout69->addWidget( _showInactive );

    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout69->addItem( spacer );
    _showMake = new QCheckBox(tr("Show &Make Items"), this, "_showMake");
    _showBuy = new QCheckBox(tr("Show &Buy Items"), this, "_showBuy");
    Layout70->addWidget( _showMake );
    Layout70->addWidget( _showBuy );
    Layout70->addLayout( Layout69 );
    Layout71->addLayout( Layout70 );

    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
    Layout71->addItem( spacer_2 );
    Layout72->addLayout( Layout71 );

    _close = new QPushButton(tr("&Cancel"), this, "_close");
    Layout18->addWidget( _close );

    _select = new QPushButton(tr("&Select"), this, "_select");
    _select->setEnabled( FALSE );
    _select->setAutoDefault( TRUE );
    _select->setDefault( TRUE );
    Layout18->addWidget( _select );
    Layout72->addLayout( Layout18 );
    itemListLayout->addLayout( Layout72 );

    QLabel *_itemsLit = new QLabel(tr("&Items:"), this, "_itemsLit");
    Layout20->addWidget( _itemsLit );

    _item = new XTreeWidget(this);
    _item->setName("_item");
    _itemsLit->setBuddy(_item );
    Layout20->addWidget( _item );
    itemListLayout->addLayout( Layout20 );

    resize( QSize(467, 393).expandedTo(minimumSizeHint()) );
    //clearWState( WState_Polished );

    connect( _item, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
    connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
    connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
    connect( _searchFor, SIGNAL( textChanged(const QString&) ), this, SLOT( sSearch(const QString&) ) );
    connect( _showInactive, SIGNAL( clicked() ), this, SLOT( sFillList() ) );
    connect( _showMake, SIGNAL( clicked() ), this, SLOT( sFillList() ) );
    connect( _showBuy, SIGNAL( clicked() ), this, SLOT( sFillList() ) );
    connect( _item, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );


  _item->addColumn(tr("Item Number"), 100,  Qt::AlignLeft );
  _item->addColumn(tr("Description"), -1,   Qt::AlignLeft );
}
Exemplo n.º 9
0
KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
    : Q3MainWindow( parent, name, 0 )
{
    QWidget *border = new QWidget( this );
    border->setBackgroundColor( Qt::black );
    setCentralWidget( border );

    Q3VBoxLayout *borderLayout = new Q3VBoxLayout( border );
    borderLayout->addStretch( 1 );

    QWidget *mainWin = new QWidget( border );
    mainWin->setFixedSize(640, 480);
    borderLayout->addWidget( mainWin, 0, Qt::AlignHCenter );

    borderLayout->addStretch( 1 );

    view = new KAsteroidsView( mainWin );
    view->setFocusPolicy( Qt::StrongFocus );
    connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) );
    connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) );
    connect( view, SIGNAL( rocksRemoved() ), SLOT( slotRocksRemoved() ) );
    connect( view, SIGNAL( updateVitals() ), SLOT( slotUpdateVitals() ) );

    Q3VBoxLayout *vb = new Q3VBoxLayout( mainWin );
    Q3HBoxLayout *hb = new Q3HBoxLayout;
    Q3HBoxLayout *hbd = new Q3HBoxLayout;
    vb->addLayout( hb );

    QFont labelFont( "helvetica", 24 );
    QColorGroup grp( Qt::darkGreen, Qt::black, QColor( 128, 128, 128 ),
	    QColor( 64, 64, 64 ), Qt::black, Qt::darkGreen, Qt::black );
    QPalette pal( grp, grp, grp );

    mainWin->setPalette( pal );

    hb->addSpacing( 10 );

    QLabel *label;
    label = new QLabel( tr("Score"), mainWin );
    label->setFont( labelFont );
    label->setPalette( pal );
    label->setFixedWidth( label->sizeHint().width() );
    hb->addWidget( label );

    scoreLCD = new QLCDNumber( 6, mainWin );
    scoreLCD->setFrameStyle( Q3Frame::NoFrame );
    scoreLCD->setSegmentStyle( QLCDNumber::Flat );
    scoreLCD->setFixedWidth( 150 );
    scoreLCD->setPalette( pal );
    hb->addWidget( scoreLCD );
    hb->addStretch( 10 );

    label = new QLabel( tr("Level"), mainWin );
    label->setFont( labelFont );
    label->setPalette( pal );
    label->setFixedWidth( label->sizeHint().width() );
    hb->addWidget( label );

    levelLCD = new QLCDNumber( 2, mainWin );
    levelLCD->setFrameStyle( Q3Frame::NoFrame );
    levelLCD->setSegmentStyle( QLCDNumber::Flat );
    levelLCD->setFixedWidth( 70 );
    levelLCD->setPalette( pal );
    hb->addWidget( levelLCD );
    hb->addStretch( 10 );

    label = new QLabel( tr("Ships"), mainWin );
    label->setFont( labelFont );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hb->addWidget( label );

    shipsLCD = new QLCDNumber( 1, mainWin );
    shipsLCD->setFrameStyle( Q3Frame::NoFrame );
    shipsLCD->setSegmentStyle( QLCDNumber::Flat );
    shipsLCD->setFixedWidth( 40 );
    shipsLCD->setPalette( pal );
    hb->addWidget( shipsLCD );

    hb->addStrut( 30 );

    vb->addWidget( view, 10 );

// -- bottom layout:
    vb->addLayout( hbd );

    QFont smallFont( "helvetica", 14 );
    hbd->addSpacing( 10 );

    QString sprites_prefix = ":/trolltech/examples/graphicsview/portedasteroids/sprites/";
/*
    label = new QLabel( tr( "T" ), mainWin );
    label->setFont( smallFont );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    teleportsLCD = new QLCDNumber( 1, mainWin );
    teleportsLCD->setFrameStyle( QFrame::NoFrame );
    teleportsLCD->setSegmentStyle( QLCDNumber::Flat );
    teleportsLCD->setPalette( pal );
    teleportsLCD->setFixedHeight( 20 );
    hbd->addWidget( teleportsLCD );

    hbd->addSpacing( 10 );
*/
    QPixmap pm( sprites_prefix + "powerups/brake.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    brakesLCD = new QLCDNumber( 1, mainWin );
    brakesLCD->setFrameStyle( Q3Frame::NoFrame );
    brakesLCD->setSegmentStyle( QLCDNumber::Flat );
    brakesLCD->setPalette( pal );
    brakesLCD->setFixedHeight( 20 );
    hbd->addWidget( brakesLCD );

    hbd->addSpacing( 10 );

    pm.load( sprites_prefix + "powerups/shield.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    shieldLCD = new QLCDNumber( 1, mainWin );
    shieldLCD->setFrameStyle( Q3Frame::NoFrame );
    shieldLCD->setSegmentStyle( QLCDNumber::Flat );
    shieldLCD->setPalette( pal );
    shieldLCD->setFixedHeight( 20 );
    hbd->addWidget( shieldLCD );

    hbd->addSpacing( 10 );

    pm.load( sprites_prefix + "powerups/shoot.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    shootLCD = new QLCDNumber( 1, mainWin );
    shootLCD->setFrameStyle( Q3Frame::NoFrame );
    shootLCD->setSegmentStyle( QLCDNumber::Flat );
    shootLCD->setPalette( pal );
    shootLCD->setFixedHeight( 20 );
    hbd->addWidget( shootLCD );

    hbd->addStretch( 1 );

    label = new QLabel( tr( "Fuel" ), mainWin );
    label->setFont( smallFont );
    label->setFixedWidth( label->sizeHint().width() + 10 );
    label->setPalette( pal );
    hbd->addWidget( label );

    powerMeter = new KALedMeter( mainWin );
    powerMeter->setFrameStyle( Q3Frame::Box | Q3Frame::Plain );
    powerMeter->setRange( MAX_POWER_LEVEL );
    powerMeter->addColorRange( 10, Qt::darkRed );
    powerMeter->addColorRange( 20, QColor(160, 96, 0) );
    powerMeter->addColorRange( 70, Qt::darkGreen );
    powerMeter->setCount( 40 );
    powerMeter->setPalette( pal );
    powerMeter->setFixedSize( 200, 12 );
    hbd->addWidget( powerMeter );

    shipsRemain = 3;
    showHiscores = FALSE;

    actions.insert( Qt::Key_Up, Thrust );
    actions.insert( Qt::Key_Left, RotateLeft );
    actions.insert( Qt::Key_Right, RotateRight );
    actions.insert( Qt::Key_Space, Shoot );
    actions.insert( Qt::Key_Z, Teleport );
    actions.insert( Qt::Key_X, Brake );
    actions.insert( Qt::Key_S, Shield );
    actions.insert( Qt::Key_P, Pause );
    actions.insert( Qt::Key_L, Launch );
    actions.insert( Qt::Key_N, NewGame );

    view->showText( tr( "Press N to start playing" ), Qt::yellow );
}
Exemplo n.º 10
0
salesOrderList::salesOrderList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl )
{
  if ( !name )
    setName( "salesOrderList" );

  _soheadid = -1;
  _type = (cSoOpen | cSoClosed | cSoReleased);

  setCaption(tr("Sales Orders"));

  Q3VBoxLayout *mainLayout = new Q3VBoxLayout(this, 5, 5, "mainLayout"); 
  Q3VBoxLayout *warehouseLayout = new Q3VBoxLayout(0, 0, 0, "warehouseLayout"); 
  Q3HBoxLayout *topLayout = new Q3HBoxLayout( 0, 0, 7, "topLayout"); 
  Q3VBoxLayout *buttonsLayout = new Q3VBoxLayout(0, 0, 5, "buttonsLayout");
  Q3VBoxLayout *listLayout = new Q3VBoxLayout( 0, 0, 0, "listLayout"); 

  _warehouse = new WarehouseGroup(this, "_warehouse");
  warehouseLayout->addWidget(_warehouse);

  QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Preferred);
  warehouseLayout->addItem(spacer);
  topLayout->addLayout(warehouseLayout);

  QSpacerItem* spacer_2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
  topLayout->addItem(spacer_2);

  _close = new QPushButton(tr("&Cancel"), this, "_close");
  buttonsLayout->addWidget(_close);

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setEnabled( FALSE );
  _select->setDefault( TRUE );
  buttonsLayout->addWidget(_select);
  topLayout->addLayout(buttonsLayout);
  mainLayout->addLayout(topLayout);

  QLabel *_salesOrdersLit = new QLabel(tr("Sales Orders:"), this, "_salesOrdersLit");
  listLayout->addWidget(_salesOrdersLit);

  _so = new XTreeWidget(this);
  _so->setName("_so");
  listLayout->addWidget(_so);
  mainLayout->addLayout(listLayout);

  resize( QSize(490, 390).expandedTo(minimumSizeHint()) );

  connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _so, SIGNAL( itemSelected(int) ), _select, SLOT( animateClick() ) );
  connect( _so, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );
  connect( _warehouse, SIGNAL(updated()), this, SLOT( sFillList() ) );

  _so->addColumn(tr("Order #"),   _orderColumn, Qt::AlignLeft   );
  _so->addColumn(tr("Customer"),  -1,           Qt::AlignLeft   );
  _so->addColumn(tr("P/O #"),     _orderColumn, Qt::AlignLeft   );
  _so->addColumn(tr("Ordered"),   _dateColumn,  Qt::AlignCenter );
  _so->addColumn(tr("Scheduled"), _dateColumn,  Qt::AlignCenter );

  setTabOrder(_warehouse, _so);
  setTabOrder(_so, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _warehouse);
  _warehouse->setFocus();
}
Exemplo n.º 11
0
workcenterList::workcenterList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl )
{
  if ( !name )
    setObjectName( "workcenterList" );

  _id = -1;

  setCaption(tr("Work Center List"));

  Q3VBoxLayout *workcenterListLayout = new Q3VBoxLayout( this, 5, 5, "workcenterListLayout"); 
  Q3HBoxLayout *Layout69 = new Q3HBoxLayout( 0, 0, 0, "Layout69"); 
  Q3HBoxLayout *Layout72 = new Q3HBoxLayout( 0, 0, 7, "Layout72"); 
  Q3VBoxLayout *Layout71 = new Q3VBoxLayout( 0, 0, 0, "Layout71"); 
  Q3VBoxLayout *Layout70 = new Q3VBoxLayout( 0, 0, 5, "Layout70"); 
  Q3HBoxLayout *Layout5 = new Q3HBoxLayout( 0, 0, 5, "Layout5"); 
  Q3VBoxLayout *Layout18 = new Q3VBoxLayout( 0, 0, 5, "Layout18"); 
  Q3VBoxLayout *Layout20 = new Q3VBoxLayout( 0, 0, 0, "Layout20"); 

  QLabel *_searchForLit = new QLabel(tr("S&earch for:"), this, "_searchForLit");
  _searchForLit->setAlignment( int( Qt::AlignVCenter | Qt::AlignRight ) );
  Layout5->addWidget( _searchForLit );

  _searchFor = new QLineEdit( this, "_searchFor" );
  _searchForLit->setBuddy(_searchFor);
  Layout5->addWidget( _searchFor );
  Layout70->addLayout( Layout5 );

  QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
  Layout69->addItem( spacer );
  Layout70->addLayout( Layout69 );
  Layout71->addLayout( Layout70 );

  QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
  Layout71->addItem( spacer_2 );
  Layout72->addLayout( Layout71 );

  _close = new QPushButton(tr("&Cancel"), this, "_close");
  Layout18->addWidget( _close );

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setEnabled( FALSE );
  _select->setAutoDefault( TRUE );
  _select->setDefault( TRUE );
  Layout18->addWidget( _select );
  Layout72->addLayout( Layout18 );
  workcenterListLayout->addLayout( Layout72 );

  QLabel *_workcentersLit = new QLabel(tr("&Work Centers:"), this, "_workcentersLit");
  Layout20->addWidget( _workcentersLit );

  _workcenter = new XListView( this, "_workcenter" );
  _workcentersLit->setBuddy(_workcenter);
  Layout20->addWidget(_workcenter);
  workcenterListLayout->addLayout( Layout20 );

  resize( QSize(467, 393).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

  connect( _workcenter, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _searchFor, SIGNAL( textChanged(const QString&) ), this, SLOT( sSearch(const QString&) ) );
  connect( _workcenter, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );

  _workcenter->addColumn(tr("Work Center"), 100,  Qt::AlignLeft );
  _workcenter->addColumn(tr("Description"), -1,   Qt::AlignLeft );
}
Exemplo n.º 12
0
AttachForm::AttachForm(QWidget *parent, const char *name,
		       bool modal, Qt::WFlags f)
  : QDialog( parent, name, modal, f ), mNumSims(0),
    mLibReturnStatus(REG_SUCCESS), mSimGSHSelected(kNULL),
    mSimName(kNULL), mSimGSH(kNULL), mTable(kNULL),
    mFilterLineEdit(kNULL), mAttachButton(kNULL), mCancelButton(kNULL)
{
  struct registry_contents content;
  int i, count;
  QString lString;
  bool ok;
  REG_DBGCON("AttachForm");

  // set up arrays for ReG lib call
  // max list can be is REG_MAX_NUM_STEERED_SIM
  mSimName = new char *[REG_MAX_NUM_STEERED_SIM];
  mSimGSH = new char *[REG_MAX_NUM_STEERED_SIM];

  for (i=0; i<REG_MAX_NUM_STEERED_SIM; i++){
    mSimName[i] = new char[REG_MAX_STRING_LENGTH + 1];
    mSimGSH[i] = new char[REG_MAX_STRING_LENGTH + 1];
  }

  SteererConfig *lConfig = ((SteererMainWindow *)parent)->getConfig();
// #ifdef REG_WSRF
  if( !(lConfig->mRegistrySecurity.passphrase[0]) ){

    // Get the passphrase for the user's key if registry is using
    // SSL
    if( lConfig->mRegistrySecurity.use_ssl == REG_TRUE){

      lString = QInputDialog::getText("RealityGrid Steerer",
				      "Enter passphrase for X.509 key:",
				      QLineEdit::Password,
				      QString::null, &ok, this );
      if ( !ok ) return; // Cancel if user didn't press OK
    }
    else{
      lString = QInputDialog::getText("RealityGrid Steerer",
				      "Enter passphrase for registry:",
				      QLineEdit::Password,
				      QString::null, &ok, this );
      if ( !ok ) return; // Cancel if user didn't press OK
    }
    strncpy(lConfig->mRegistrySecurity.passphrase,
	    lString.ascii(), REG_MAX_STRING_LENGTH);
  }
  // Now find out what's in the registry...
  //..._secure only available in steering library >= 2.0
  mLibReturnStatus = Get_registry_entries_secure(lConfig->mTopLevelRegistry,
						 &(lConfig->mRegistrySecurity),
						 &content);
// #else
//   mLibReturnStatus = Get_registry_entries((char *)(lConfig->mTopLevelRegistry.ascii()),
// 					  &content);
// #endif // defined REG_WSRF

  if(mLibReturnStatus != REG_SUCCESS) return;

  count = 0;
  for (i=0; i<content.numEntries; i++){
    if(!strcmp(content.entries[i].service_type, "SWS") ||
       !strcmp(content.entries[i].service_type, "SGS")){
      sprintf(mSimName[count], "%s %s %s", content.entries[i].application,
	      content.entries[i].user, content.entries[i].start_date_time);
      sprintf(mSimGSH[count], "%s", content.entries[i].gsh);
      count++;
    }
  }
  Delete_registry_table(&content);

  mNumSims = count;

  // only continue if there is some info to show
  if(mNumSims>0)
  {
    this->setCaption( "Grid Attach" );
    resize( 520, 350 );

    // create the layouts for the form
    Q3VBoxLayout *lFormLayout = new Q3VBoxLayout(this, 10, 10,
					       "attachformlayout");
    Q3HBoxLayout *lFilterLayout = new Q3HBoxLayout(6, "filterlayout");
    Q3VBoxLayout *lListLayout = new Q3VBoxLayout(6, "attachlistlayout");
    Q3HBoxLayout *lButtonLayout = new Q3HBoxLayout(6, "attachbuttonlayout");
    QSpacerItem* lSpacer = new QSpacerItem( 200, 0, QSizePolicy::Expanding,
					    QSizePolicy::Minimum );

    // create the list box for the applications on the grid
    lListLayout->addWidget(new TableLabel("Steerable Applications", this));
    mTable = new Q3Table(0, 2, this);
    mTable->setSelectionMode( Q3Table::Single );
    mTable->verticalHeader()->hide();
    mTable->setLeftMargin(0);

    mTable->horizontalHeader()->setLabel(0, "Application");
    mTable->horizontalHeader()->setLabel(1, "Handle");

    connect(mTable, SIGNAL(valueChanged(int, int)), this,
	    SLOT(editHandleSlot(int, int)));

    // populate the list box - each listboxitem holds array index
    // information - this is what is used by the calling code
    // (via  aSimIndexSelected) to identify the aSimGSH selected
    for (int i=0; i<mNumSims; i++)
    {
      REG_DBGMSG1("mSimName ", mSimName[i]);
      REG_DBGMSG1("mSimGSH ", mSimGSH[i]);

      mTable->insertRows(mTable->numRows(),1);
      mTable->setItem(mTable->numRows()-1, 0,
		      new Q3TableItem(mTable, Q3TableItem::Never,
				     QString(mSimName[i])));
      mTable->setItem(mTable->numRows()-1, 1,
		      new Q3TableItem(mTable, Q3TableItem::WhenCurrent,
				     QString(mSimGSH[i])));
    }
    mTable->adjustColumn(0);
    mTable->adjustColumn(1);
    // We checked that mNumSims was > 0 earlier...
    mTable->selectRow(0);

    mFilterLineEdit = new QLineEdit(this, "containsfilter");
    connect(mFilterLineEdit, SIGNAL(returnPressed()), this,
	    SLOT(filterSlot()));

    // Initialize the filter with the user's username - might be handy
    mFilterLineEdit->setText(QString(getenv("USER")));
    mFilterLineEdit->selectAll();

    lFilterLayout->addWidget(new QLabel("Contains", this));
    lFilterLayout->addWidget(mFilterLineEdit);


    lListLayout->addWidget(mTable);
    lListLayout->addLayout(lFilterLayout);

    mAttachButton = new QPushButton("Attach", this, "attachbutton");
    mAttachButton->setMinimumSize(mAttachButton->sizeHint());
    mAttachButton->setMaximumSize(mAttachButton->sizeHint());
    mAttachButton->setAutoDefault(FALSE);
    QToolTip::add(mAttachButton, "Attach to selected application");
    connect(mAttachButton, SIGNAL(clicked()), this, SLOT(attachSlot()));


    mCancelButton = new QPushButton("Cancel", this, "cancelbutton");
    mCancelButton->setMinimumSize(mCancelButton->sizeHint());
    mCancelButton->setMaximumSize(mCancelButton->sizeHint());
    mCancelButton->setAutoDefault(FALSE);
    connect(mCancelButton,  SIGNAL(clicked()), this, SLOT( reject()));


    lButtonLayout->addItem(lSpacer);
    lButtonLayout->addWidget(mCancelButton);
    lButtonLayout->addWidget(mAttachButton);

    lFormLayout->addLayout(lListLayout);
    lFormLayout->addLayout(lButtonLayout);
  }