Beispiel #1
0
void Qt_pointset_summary::init( const Geostat_grid* grid ) {
  const Point_set* pset = dynamic_cast<const Point_set*>( grid );
  if( !pset ) return;

  geostat_grid_ = pset;
  int points_count = pset->size();
  QString count;
  count.setNum( points_count );
 
  desc_widget_ = new QGroupBox( 1, Qt::Horizontal );
  QGroupBox* groupbox = (QGroupBox*) desc_widget_;
  groupbox->setInsideSpacing( 4 );

  new QLabel( QString("# of points: ")+count, groupbox );


  GsTLPoint min, max;
  bounding_box( min, max, pset );

  QFont font;
  font.setBold(true);

  groupbox->addSpace( 8 );
  QLabel* bboxlabel = new QLabel( "Bounding Box", groupbox );
  bboxlabel->setFont( font );
  std::ostringstream minlabel;

  minlabel << "Min: ( " << min.x() << " , " << min.y() << " , " << min.z() << " )";
  new QLabel( QString( minlabel.str() ), groupbox );

  std::ostringstream maxlabel;
  maxlabel << "Max: ( " << max.x() << " , " << max.y() << " , " << max.z() << " )";
  new QLabel( QString( maxlabel.str() ), groupbox );

}
Beispiel #2
0
void Qt_cartesian_grid_summary::init( const Geostat_grid* grid ) {
  //TL modified
  const Cartesian_grid* cgrid = dynamic_cast<const Cartesian_grid*>( grid );
  if( !cgrid ) return;

  geostat_grid_ = cgrid;
  GsTLCoordVector cell_dims = cgrid->cell_dimensions();
  GsTLPoint origin = cgrid->origin();

  desc_widget_ = new QGroupBox( 1, Qt::Horizontal );
  QGroupBox* groupbox = (QGroupBox*) desc_widget_;
  groupbox->setInsideSpacing( 4 );

  QString count;
  QFont font;
  font.setBold(true);

  // number of cells
  QLabel* dimslabel;
  dimslabel = new QLabel( "Number of cells", groupbox );
  dimslabel->setFont( font );
  count.setNum( cgrid->nx() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( cgrid->ny() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( cgrid->nz() );
  new QLabel( QString("Z: ")+count, groupbox );

  QLabel * num;
  

  // cell dimensions
  groupbox->addSpace( 8 );
  QLabel* sizelabel = new QLabel( "Cells dimensions", groupbox );
  sizelabel->setFont( font );
  count.setNum( cell_dims.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( cell_dims.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( cell_dims.z() );
  new QLabel( QString("Z: ")+count, groupbox );

  // Origin
  groupbox->addSpace( 8 );
  QLabel* originlabel = new QLabel( "Origin (center of origin cell)", groupbox );
  originlabel->setFont( font );
  count.setNum( origin.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( origin.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( origin.z() );
  new QLabel( QString("Z: ")+count, groupbox );

}; 
Beispiel #3
0
void K3bIsoImageWritingDialog::setupGui()
{
  QWidget* frame = mainWidget();

  // image
  // -----------------------------------------------------------------------
  QGroupBox* groupImageUrl = new QGroupBox( 1, Qt::Horizontal, i18n("Image to Burn"), frame );
  m_editImagePath = new KURLRequester( groupImageUrl );
  m_editImagePath->setMode( KFile::File|KFile::ExistingOnly );
  m_editImagePath->setCaption( i18n("Choose Image File") );
  m_editImagePath->setFilter( i18n("*.iso *.ISO|ISO9660 Image Files") + "\n"
			      + i18n("*|All Files") );

  connect( m_editImagePath->lineEdit(), SIGNAL( textChanged ( const QString & ) ), this,  SLOT( slotWriterChanged() ) );

  // image info
  // -----------------------------------------------------------------------
  m_infoView = new K3bListView( frame );
  m_infoView->addColumn( "key" );
  m_infoView->addColumn( "value" );
  m_infoView->header()->hide();
  m_infoView->setNoItemText( i18n("No image file selected") );
  m_infoView->setSorting( -1 );
  m_infoView->setAlternateBackground( QColor() );
  m_infoView->setFullWidth(true);
  m_infoView->setSelectionMode( QListView::NoSelection );

  connect( m_infoView, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
	   this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );

  m_writerSelectionWidget = new K3bWriterSelectionWidget( frame );

  // options
  // -----------------------------------------------------------------------
  QTabWidget* optionTabbed = new QTabWidget( frame );

  QWidget* optionTab = new QWidget( optionTabbed );
  QGridLayout* optionTabLayout = new QGridLayout( optionTab );
  optionTabLayout->setAlignment( Qt::AlignTop );
  optionTabLayout->setSpacing( spacingHint() );
  optionTabLayout->setMargin( marginHint() );

  QGroupBox* writingModeGroup = new QGroupBox( 1, Vertical, i18n("Writing Mode"), optionTab );
  writingModeGroup->setInsideMargin( marginHint() );
  m_writingModeWidget = new K3bWritingModeWidget( writingModeGroup );


  // copies --------
  QGroupBox* groupCopies = new QGroupBox( 2, Qt::Horizontal, i18n("Copies"), optionTab );
  groupCopies->setInsideSpacing( spacingHint() );
  groupCopies->setInsideMargin( marginHint() );
  QLabel* pixLabel = new QLabel( groupCopies );
  pixLabel->setPixmap( SmallIcon( "cdcopy", KIcon::SizeMedium ) );
  pixLabel->setScaledContents( false );
  m_spinCopies = new QSpinBox( groupCopies );
  m_spinCopies->setMinValue( 1 );
  m_spinCopies->setMaxValue( 999 );
  // -------- copies

  QGroupBox* optionGroup = new QGroupBox( 3, Vertical, i18n("Settings"), optionTab );
  optionGroup->setInsideMargin( marginHint() );
  optionGroup->setInsideSpacing( spacingHint() );
  m_checkDummy = K3bStdGuiItems::simulateCheckbox( optionGroup );
  m_checkVerify = K3bStdGuiItems::verifyCheckBox( optionGroup );


  optionTabLayout->addWidget( writingModeGroup, 0, 0 );
  optionTabLayout->addWidget( groupCopies, 1, 0 );
  optionTabLayout->addMultiCellWidget( optionGroup, 0, 1, 1, 1 );
  optionTabLayout->setRowStretch( 1, 1 );
  optionTabLayout->setColStretch( 1, 1 );

  optionTabbed->addTab( optionTab, i18n("Settings") );


  QGridLayout* grid = new QGridLayout( frame );
  grid->setSpacing( spacingHint() );
  grid->setMargin( 0 );

  grid->addWidget( groupImageUrl, 0, 0 );
  grid->addWidget( m_infoView, 1, 0 );
  grid->addWidget( m_writerSelectionWidget, 2, 0 );
  grid->addWidget( optionTabbed, 3, 0 );

  grid->setRowStretch( 1, 1 );
}
Beispiel #4
0
void Qt_masked_grid_summary::init( const Geostat_grid* grid ) {
  //TL modified
  const Reduced_grid * rgrid = dynamic_cast<const Reduced_grid*>(grid);
  if( !rgrid ) return;

  //geostat_grid_ = cgrid;
  GsTLCoordVector cell_dims = rgrid->cell_dimensions();
  GsTLPoint origin = rgrid->origin();

  desc_widget_ = new QGroupBox( 1, Qt::Horizontal );
  QGroupBox* groupbox = (QGroupBox*) desc_widget_;
  groupbox->setInsideSpacing( 4 );

  QString count;
  QFont font;
  font.setBold(true);


  QLabel * title;
  title = new QLabel(QString("Grid with inactive cells"),groupbox);
  title->setFont(font);


  // number of cells
  QLabel* dimslabel;
  dimslabel = new QLabel ("Bounding box", groupbox);
  dimslabel->setFont( font );
  count.setNum( rgrid->nx() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( rgrid->ny() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( rgrid->nz() );
  new QLabel( QString("Z: ")+count, groupbox );

  //TL modified
  QLabel * num;
  num = new QLabel(QString("# of active cells: ")+count.setNum(rgrid->numActive()), groupbox);
  num->setFont(font);


  // cell dimensions
  groupbox->addSpace( 8 );
  QLabel* sizelabel = new QLabel( "Cells dimensions", groupbox );
  sizelabel->setFont( font );
  count.setNum( cell_dims.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( cell_dims.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( cell_dims.z() );
  new QLabel( QString("Z: ")+count, groupbox );

  // Origin
  groupbox->addSpace( 8 );
  QLabel* originlabel = new QLabel( "Origin (center of origin cell)", groupbox );
  originlabel->setFont( font );
  count.setNum( origin.x() );
  new QLabel( QString("X: ")+count, groupbox );
  count.setNum( origin.y() );
  new QLabel( QString("Y: ")+count, groupbox );
  count.setNum( origin.z() );
  new QLabel( QString("Z: ")+count, groupbox );

}
Beispiel #5
0
SecurityDlg::SecurityDlg(CICQDaemon *s, CSignalManager *_sigman,
                         QWidget *parent)
   : LicqDialog(parent, "SecurityDialog", false, WStyle_ContextHelp | WDestructiveClose )
{
  server = s;
  sigman = _sigman;
  eSecurityInfo   = 0;
  ePasswordChange = 0;

  unsigned long nUin = gUserManager.OwnerUin();
  QString strUin;
  if (nUin)
    strUin.setNum(nUin);

  QVBoxLayout *lay = new QVBoxLayout(this, 8);
  QGroupBox *box = new QGroupBox(1, QGroupBox::Horizontal, tr("Options"), this);
  lay->addWidget(box);

  QGroupBox *passwordBox = new QGroupBox(2, QGroupBox::Horizontal,
    tr("Password/UIN settings"), this);
#if QT_VERSION > 300
  box->setInsideSpacing(1);
  passwordBox->setInsideSpacing(1);
#endif
  lay->addWidget(passwordBox);

  // Password boxes
  lblUin = new QLabel(tr("&Uin:"), passwordBox);
  edtUin = new QLineEdit(passwordBox);
  QWhatsThis::add(edtUin, tr("Enter the UIN which you want to use.  "
                             "Only available if \"Local changes only\" is "
                             "checked."));
  lblPassword = new QLabel(tr("&Password:"******"Enter your ICQ password here."));
  lblVerify = new QLabel(tr("&Verify:"), passwordBox);
  edtSecond = new QLineEdit(passwordBox);
  QWhatsThis::add(edtSecond, tr("Verify your ICQ password here."));
  chkOnlyLocal = new QCheckBox(tr("&Local changes only"), passwordBox);
  QWhatsThis::add(chkOnlyLocal, tr("If checked, password/UIN changes will apply"
                                   " only on your local computer.  Useful if "
                                   "your password is incorrectly saved in Licq."));

  edtUin->setEnabled(false);
  edtFirst->setEchoMode(QLineEdit::Password);
  edtSecond->setEchoMode(QLineEdit::Password);
  lblUin->setBuddy(edtUin);
  lblPassword->setBuddy(edtFirst);
  lblVerify->setBuddy(edtSecond);

  // UIN
  edtUin->setValidator(new QIntValidator(10000, 2147483647, edtUin));
  if (nUin) 
    edtUin->setText(strUin);

  // Owner password
  ICQOwner *o = gUserManager.FetchOwner(LOCK_R);
  if (o != NULL)
  {
    edtFirst->setText(o->Password());
    edtSecond->setText(o->Password());
  }
  else
  {
    edtFirst->setEnabled(false);
    edtSecond->setEnabled(false);
  }

  QVBoxLayout *blay = new QVBoxLayout;
  chkAuthorization = new QCheckBox(tr("Authorization Required"), box);
  QWhatsThis::add(chkAuthorization, tr("Determines whether regular ICQ clients "
                                       "require your authorization to add you to "
                                       "their contact list."));
  chkWebAware = new QCheckBox(tr("Web Presence"), box);
  QWhatsThis::add(chkWebAware, tr("Web Presence allows users to see if you are online "
                                  "through your web indicator."));
  chkHideIp = new QCheckBox(tr("Hide IP"), box);
  QWhatsThis::add(chkHideIp, tr("Hide IP stops users from seeing your IP address. It doesn't guarantee it will be hidden though."));
  blay->addWidget(chkAuthorization);
  blay->addWidget(chkWebAware);
  blay->addWidget(chkHideIp);

  btnUpdate = new QPushButton(tr("&Update"), this);
  btnUpdate->setDefault(true);
  btnUpdate->setMinimumWidth(75);
  btnCancel = new QPushButton(tr("&Cancel"), this);
  btnCancel->setMinimumWidth(75);
  QHBoxLayout *hlay = new QHBoxLayout;
  hlay->addWidget(QWhatsThis::whatsThisButton(this), 0, AlignLeft);
  hlay->addSpacing(20);
  hlay->addStretch(1);
  hlay->addWidget(btnUpdate, 0, AlignRight);
  hlay->addSpacing(20);
  hlay->addWidget(btnCancel, 0, AlignLeft);
  lay->addLayout(hlay);

  connect (btnUpdate, SIGNAL(clicked()), SLOT(ok()) );
  connect (btnCancel, SIGNAL(clicked()), SLOT(close()) );
  connect (chkOnlyLocal, SIGNAL(toggled(bool)), SLOT(slot_chkOnlyLocalToggled(bool)));

  // do some magic ;)
  // if we are offline, we enable the checkbox "Only local changes"
  // this saves one click :)
  if (o != NULL)  // Make sure we exist
  {
    slot_chkOnlyLocalToggled( (o->Status() == ICQ_STATUS_OFFLINE) );
    chkAuthorization->setChecked(o->GetAuthorization());
    chkWebAware->setChecked(o->WebAware());
    chkHideIp->setChecked(o->HideIp());
    gUserManager.DropOwner();
  }
  else
  {
    slot_chkOnlyLocalToggled(true);
    chkOnlyLocal->setEnabled(false);
    chkAuthorization->setChecked(false);
    chkWebAware->setChecked(false);
    chkHideIp->setChecked(false);
  }


  setCaption(tr("ICQ Security Options"));

  // remember the initial values
  // later we use these to apply only what has been changed by the user
  initAuthorization = chkAuthorization->isChecked();
  initWebAware      = chkWebAware->isChecked();
  initHideIp        = chkHideIp->isChecked();
  initEdtUin        = edtUin->text();
  initEdtFirst      = edtFirst->text();
  initEdtSecond     = edtSecond->text();

	// Set Tab Order
	setTabOrder(chkAuthorization, chkWebAware);
	setTabOrder(chkWebAware, chkHideIp);
	setTabOrder(chkHideIp, edtUin);
	setTabOrder(edtUin, edtFirst);
	setTabOrder(edtFirst, edtSecond);
	setTabOrder(edtSecond, chkOnlyLocal);
	setTabOrder(chkOnlyLocal, btnUpdate);
	setTabOrder(btnUpdate, btnCancel);

  show();
}