Пример #1
0
void dialogWPAEnterprise::setVariables( int type, QString EAPIdent, QString AnonIdent, QString CACert, QString ClientCert, QString PrivKeyFile, QString Password, int keyMgmt, int EAPPhase2 )
{
    // Load the existing settings for this configuration
    
    if ( type == 1)
    {
	radioEAPTLS->setChecked(true);
    } else if (type == 2) {
	radioEAPTTLS->setChecked(true);
    } else if (type == 3) {
	radioEAPPEAP->setChecked(true);
    }

    comboKeyMgmt->setCurrentIndex(keyMgmt);
    comboPhase2->setCurrentIndex(EAPPhase2);

    lineEAPIdentity->setText(EAPIdent);
    lineAnonIdentity->setText(AnonIdent);
    lineCACert->setText(CACert);
    lineClientCert->setText(ClientCert);
    linePrivateKeyFile->setText(PrivKeyFile);
    linePrivateKeyPassword->setText(Password);
    linePrivateKeyPassword2->setText(Password);
    
    slotTypeChanged();
    
}
Пример #2
0
BrowseDialog::BrowseDialog(QWidget *parent, const char *name)
	: KDialogBase(parent, name, true, QString::null, Ok|Cancel, Ok, true)
{
	QWidget	*dummy = new QWidget(this);
	setMainWidget(dummy);
	type_ = new QComboBox(dummy);
	from_ = new QLineEdit(dummy);
	to_ = new QLineEdit(dummy);
	type_->insertItem(i18n("Send"));
	type_->insertItem(i18n("Allow"));
	type_->insertItem(i18n("Deny"));
	type_->insertItem(i18n("Relay"));
	type_->insertItem(i18n("Poll"));

	QLabel	*l1 = new QLabel(i18n("Type:"), dummy);
	QLabel	*l2 = new QLabel(i18n("From:"), dummy);
	QLabel	*l3 = new QLabel(i18n("To:"), dummy);

	QGridLayout	*m1 = new QGridLayout(dummy, 3, 2, 0, 5);
	m1->addWidget(l1, 0, 0, Qt::AlignRight);
	m1->addWidget(l2, 1, 0, Qt::AlignRight);
	m1->addWidget(l3, 2, 0, Qt::AlignRight);
	m1->addWidget(type_, 0, 1);
	m1->addWidget(from_, 1, 1);
	m1->addWidget(to_, 2, 1);

	connect(type_, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));
	slotTypeChanged(type_->currentItem());

	setCaption(i18n("Browse Address"));
	resize(250, 100);
}
Пример #3
0
/*!
    Load any saved values to the screen
 */
void CQModelValue::load()
{
  if (mpModelValue == NULL) return;

  // Unit expression
  mpEditUnits->setText(FROM_UTF8(mpModelValue->getUnitExpression()));

  // Update the unit labels
  slotUnitChanged();

  // Type
  mpComboBoxType->setCurrentIndex(mpComboBoxType->findText(FROM_UTF8(CModelEntity::StatusName[mpModelValue->getStatus()])));

  // Initial Value
  mpEditInitialValue->setText(convertToQString(mpModelValue->getInitialValue()));

  // Current Value
  mpEditCurrentValue->setText(convertToQString(mpModelValue->getValue()));

  // Rate
  mpEditRate->setText(convertToQString(mpModelValue->getRate()));

  // Expression
  mpExpressionEMW->mpExpressionWidget->setExpression(mpModelValue->getExpression());

  // Update Expression Widget
  mpExpressionEMW->updateWidget();

  // Initial Expression
  mpInitialExpressionEMW->mpExpressionWidget->setExpression(mpModelValue->getInitialExpression());

  // Update Initial Expression Widget
  mpInitialExpressionEMW->updateWidget();

  // Noise Expression
  mpNoiseExpressionWidget->mpExpressionWidget->setExpression(mpModelValue->getNoiseExpression());
  mpNoiseExpressionWidget->updateWidget();
  mpBoxAddNoise->setChecked(mpModelValue->hasNoise());

  // Type dependent display of values
  slotTypeChanged(mpComboBoxType->currentText());

  // Use Initial Expression
  if (mpModelValue->getStatus() == CModelEntity::Status::ASSIGNMENT ||
      mpModelValue->getInitialExpression() == "")
    {
      mpBoxUseInitialExpression->setChecked(false);
      //      slotInitialTypeChanged(false);
    }
  else
    {
      mpBoxUseInitialExpression->setChecked(true);
      //      slotInitialTypeChanged(true);
    }

  mpDependencies->loadFrom(mpObject);

  mChanged = false;
}
Пример #4
0
void CQCompartment::load()
{
  if (mpCompartment == NULL) return;

  //Dimensionality
  mpComboBoxDim->setCurrentIndex(mpCompartment->getDimensionality());
  // slotDimesionalityChanged(mpCompartment->getDimensionality());

  // Simulation Type
  mpComboBoxType->setCurrentIndex(mpComboBoxType->findText(FROM_UTF8(CModelEntity::StatusName[mpCompartment->getStatus()])));

  // Initial Volume
  mpEditInitialVolume->setText(convertToQString(mpCompartment->getInitialValue()));

  // Transient Volume
  mpEditCurrentVolume->setText(convertToQString(mpCompartment->getValue()));

  // Concentration Rate
  mpEditRate->setText(convertToQString(mpCompartment->getRate()));

  // Expression
  mpExpressionEMW->mpExpressionWidget->setExpression(mpCompartment->getExpression());
  mpExpressionEMW->updateWidget();

  // Initial Expression
  mpInitialExpressionEMW->mpExpressionWidget->setExpression(mpCompartment->getInitialExpression());
  mpInitialExpressionEMW->updateWidget();

  // Noise Expression
  mpNoiseExpressionWidget->mpExpressionWidget->setExpression(mpCompartment->getNoiseExpression());
  mpNoiseExpressionWidget->updateWidget();
  mpBoxAddNoise->setChecked(mpCompartment->hasNoise());

  // Type dependent display of values
  slotTypeChanged(mpComboBoxType->currentText());

  // Use Initial Expression
  if (mpCompartment->getStatus() == CModelEntity::Status::ASSIGNMENT ||
      mpCompartment->getInitialExpression() == "")
    {
      mpBoxUseInitialExpression->setChecked(false);
    }
  else
    {
      mpBoxUseInitialExpression->setChecked(true);
    }

  loadMetaboliteTable();

  mChanged = false;
  return;
}
Пример #5
0
aboutDialog::aboutDialog(QWidget *parent, QString version) :
    QDialog(parent),
    ui(new Ui::aboutDialog)
{
	
       //Setup Initial state of GUI objects and connect signal/slots
       ui->setupUi(this);  //load the main UI from designer


	//Set the dialog summary information
	QString summary;
	summary = QString(tr("EasyPBI version %1")).arg(version);
	summary.append("\n"+tr("Create PBI's quickly and easily."));
	summary.append("\n"+QString("Wiki Page: http://wiki.pcbsd.org/index.php/EasyPBI2/10.0"));
	summary.append("\n"+QString("Current Developer: Ken Moore <*****@*****.**>"));
	ui->text_summary->setText(summary);
	//Connect up the type changed slot
       connect(ui->radio_history, SIGNAL(clicked()), this, SLOT(slotTypeChanged()) );
       connect(ui->radio_license, SIGNAL(clicked()), this, SLOT(slotTypeChanged()) );
	//now run the slot to properly setup the UI elements
	slotTypeChanged();
}
Пример #6
0
void LocationDialog::setLocation(CupsLocation *loc)
{
	int	index = conf_->resources_.findRef(loc->resource_);
	resource_->setCurrentItem(index);
	authtype_->setCurrentItem(loc->authtype_);
	authclass_->setCurrentItem(loc->authclass_);
	authname_->setText(loc->authname_);
	encryption_->setCurrentItem(loc->encryption_);
	satisfy_->setCurrentItem(loc->satisfy_);
	order_->setCurrentItem(loc->order_);
	addresses_->insertItems(loc->addresses_);

	slotTypeChanged(loc->authtype_);
	slotClassChanged(loc->authclass_);
}
void BatchProcessImagesDialog::endPreview()
{
    enableWidgets(true);
    showButton(KDialog::Cancel, true);

    // Default status if 'slotTypeChanged' isn't re-implemented.
    m_ui->m_optionsButton->setEnabled(true);
    slotTypeChanged(m_Type->currentIndex());

    setButtonText(User1, i18nc("start batch process images", "&Start"));

    disconnect(this, SIGNAL(user1Clicked()),
               this, SLOT(slotPreviewStop()));

    connect(this, SIGNAL(user1Clicked()),
            this, SLOT(slotProcessStart()));
}
Пример #8
0
FilterImagesDialog::FilterImagesDialog(const KUrl::List& urlList, QWidget *parent)
        : BatchProcessImagesDialog(urlList, i18n("Batch Image Filtering"), parent)
{
    m_nbItem = m_selectedImageFiles.count();

    //---------------------------------------------

    setOptionBoxTitle(i18n("Image Filtering Options"));

    m_labelType->setText(i18n("Filter:"));

    m_Type->addItem(i18nc("image filter", "Add Noise"));       // 0
    m_Type->addItem(i18nc("image filter", "Antialias"));
    m_Type->addItem(i18nc("image filter", "Blur"));
    m_Type->addItem(i18nc("image filter", "Despeckle"));
    m_Type->addItem(i18nc("image filter", "Enhance"));         // 4
    m_Type->addItem(i18nc("image filter", "Median"));
    m_Type->addItem(i18nc("image filter", "Noise Reduction"));
    m_Type->addItem(i18nc("image filter", "Sharpen"));
    m_Type->addItem(i18nc("image filter", "Unsharp"));         // 8
    m_Type->setCurrentItem(i18nc("image filter", "Sharpen"));
    QString whatsThis = i18n(
                            "<p>Select here the filter type for your images:</p>"
                            "<p>"
                            "<b>Add noise</b>: add artificial noise to an image.<br/>"
                            "<b>Antialias</b>: remove pixel aliasing.<br/>"
                            "<b>Blur</b>: blur the image with a Gaussian operator.<br/>"
                            "<b>Despeckle</b>: reduces the speckle noise in an image while preserving the "
                            "edges of the original image.<br/>"
                            "<b>Enhance</b>: apply a digital filter to enhance a noisy image.<br/>"
                            "<b>Median</b>: apply a median filter to an image.<br/>"
                            "<b>Noise reduction</b>: reduce noise in an image. <br/>"
                            "<b>Sharpen</b>: sharpen the image with a Gaussian operator.<br/>"
                            "<b>Unsharp</b>: sharpen the image with an unsharp mask operator."
                            "</p>");

    m_Type->setWhatsThis(whatsThis);

    //---------------------------------------------

    readSettings();
    listImageFiles();
    slotTypeChanged(m_Type->currentIndex());
}
Пример #9
0
bool KnowitLinkDialog::modifyLink(TNoteLink& link)
{
   linkDescription->setText(link.description);
   linkType->setCurrentItem(link.isLocalReference());
   if (link.isLocalReference())
      linkValue->setText(link.link.remove(0, 9));
   else
      linkValue->setText(link.link);
   slotTypeChanged(linkType->currentItem());
   if (exec() == QDialog::Accepted) {
      link.description = linkDescription->text();
      if (linkType->currentItem())
         link.link = "knowit://" + linkValue->text();
      else
         link.link = linkValue->text();
      return true;
   }
   else
      return false;
}
Пример #10
0
void KPrBrushProperty::slotReset()
{
    if ( m_brush.gType == BCT_PLAIN )
        m_brush.gType = BCT_GHORZ;
    setQBrush( m_brush.brush );
    setGradient( m_brush.gColor1,
                 m_brush.gColor2,
                 m_brush.gType,
                 m_brush.unbalanced,
                 m_brush.xfactor,
                 m_brush.yfactor );

    int panelIndex;
    if( m_brush.fillType == FT_BRUSH && m_brush.brush.style() == QBrush::NoBrush )
        panelIndex = 2;
    else
        panelIndex = (int)m_brush.fillType;

    m_typeCombo->setCurrentItem( panelIndex );
    slotTypeChanged( panelIndex );
}
Пример #11
0
ConvertImagesDialog::ConvertImagesDialog( KUrl::List urlList, KIPI::Interface* interface, QWidget *parent )
                   : BatchProcessImagesDialog( urlList, interface, i18n("Batch Convert Images"), parent )
{
    // About data and help button.

    m_about = new KIPIPlugins::KPAboutData(ki18n("Batch convert images"),
                                           QByteArray(),
                                           KAboutData::License_GPL,
                                           ki18n("A Kipi plugin for batch converting images\n"
                                                     "This plugin uses the \"convert\" program from \"ImageMagick\" package."),
                                           ki18n("(c) 2003-2007, Gilles Caulier"));

    m_about->addAuthor(ki18n("Gilles Caulier"), ki18n("Author and maintainer"),
                       "caulier dot gilles at gmail dot com");

    DialogUtils::setupHelpButton(this, m_about);
    //---------------------------------------------

    groupBox1->setTitle( i18n("Image Conversion Options") );

    m_labelType->setText( i18n("Format:") );

    m_Type->insertItem("JPEG");
    m_Type->insertItem("PNG");
    m_Type->insertItem("TIFF");
    m_Type->insertItem("PPM");
    m_Type->insertItem("BMP");
    m_Type->insertItem("TGA");
    m_Type->insertItem("EPS");
    m_Type->setCurrentText("JPEG");
    whatsThis = i18n("<p>Select here the target image file format.<p>");
    whatsThis = whatsThis + i18n("<b>JPEG</b>: The Joint Photographic Experts Group's file format is a "
                                 "good Web file format but it uses lossy data compression.<p>"
                                 "<b>PNG</b>: the Portable Network Graphics format is an extensible file "
                                 "format for the lossless, portable, well-compressed storage of raster images. "
                                 "PNG provides a patent-free replacement for GIF and can also replace many common "
                                 "uses of TIFF. PNG is designed to work well in online viewing applications, such "
                                 "as the World Wide Web, so it is fully streamable with a progressive display "
                                 "option. Also, PNG can store gamma and chromaticity data for improved color "
                                 "matching on heterogeneous platforms.");
    whatsThis = whatsThis + i18n("<p><b>TIFF</b>: the Tag Image File Format is a rather old standard that is "
                                 "still very popular today. It is a highly flexible and platform-independent "
                                 "format which is supported by numerous image processing applications and "
                                 "virtually all prepress software on the market.");
    whatsThis = whatsThis + i18n("<p><b>PPM</b>: the Portable Pixel Map file format is used as an "
                                 "intermediate format for storing color bitmap information. PPM files "
                                 "may be either binary or ASCII and store pixel values up to 24 bits in size. "
                                 "This format generate the largest-sized text files to encode images without "
                                 "losing quality");
    whatsThis = whatsThis + i18n("<p><b>BMP</b>: the BitMaP file format is a popular image format from Win32 "
                                 "environment. It efficiently stores mapped or unmapped RGB graphics data with "
                                 "pixels 1-, 4-, 8-, or 24-bits in size. Data may be stored raw or compressed "
                                 "using a 4-bit or 8-bit RLE data compression algorithm. BMP is an excellent "
                                 "choice for a simple bitmap format which supports a wide range of RGB image "
                                 "data.");
    whatsThis = whatsThis + i18n("<p><b>TGA</b>: the TarGA image file format is one of the most widely used "
                                 "bitmap file formats for storage of 24 and 32 bits truecolor images.  "
                                 "TGA supports colormaps, alpha channel, gamma value, postage stamp image, "
                                 "textual information, and developer-definable data.");
    whatsThis = whatsThis + i18n("<p><b>EPS</b>: the  Adobe Encapsulated PostScript image file format "
                                 "is a PostScript language program describing the appearance of a single page. "
                                 "Usually, the purpose of the EPS file is to be embedded inside another PostScript "
                                 "language page description.");

    m_Type->setWhatsThis(whatsThis );

    m_previewButton->hide();
    m_smallPreview->hide();

    //---------------------------------------------

    readSettings();
    slotTypeChanged(m_Type->currentItem());
}
Пример #12
0
QucsFilter::QucsFilter()
{
  QWidget *centralWidget = new QWidget(this);  
  setCentralWidget(centralWidget);
  
  // set application icon
  setWindowIcon(QPixmap(":/bitmaps/big.qucs.xpm"));
  setWindowTitle("Qucs Filter " PACKAGE_VERSION);

  // --------  create menubar  -------------------
  QMenu *fileMenu = new QMenu(tr("&File"));

  QAction * fileQuit = new QAction(tr("E&xit"), this);
  fileQuit->setShortcut(Qt::CTRL+Qt::Key_Q);
  connect(fileQuit, SIGNAL(activated()), SLOT(slotQuit()));

  fileMenu->addAction(fileQuit);

  QMenu *helpMenu = new QMenu(tr("&Help"), this);
  QAction * helpHelp = new QAction(tr("Help..."), this);
  helpHelp->setShortcut(Qt::Key_F1);
  connect(helpHelp, SIGNAL(activated()), SLOT(slotHelpIntro()));

  QAction * helpAbout = new QAction(tr("&About QucsFilter..."), this);
  helpMenu->addAction(helpAbout);
  connect(helpAbout, SIGNAL(activated()), SLOT(slotHelpAbout()));

  QAction * helpAboutQt = new QAction(tr("About Qt..."), this);
  helpMenu->addAction(helpAboutQt);
  connect(helpAboutQt, SIGNAL(activated()), SLOT(slotHelpAboutQt()));

  helpMenu->addAction(helpHelp);
  helpMenu->addSeparator();
  helpMenu->addAction(helpAbout);
  helpMenu->addAction(helpAboutQt);

  menuBar()->addMenu(fileMenu);
  menuBar()->addSeparator();
  menuBar()->addMenu(helpMenu);

  // -------  create main windows widgets --------
  all  = new QGridLayout();
  all->setSpacing(3);

  // ...........................................................
  box1 = new QGroupBox(tr("Filter"), this);
  QHBoxLayout *hbox = new QHBoxLayout();

  gbox1 = new QGridLayout();
  gbox1->setSpacing(3);

  box1->setLayout(gbox1);

  QLabel *Label0 = new QLabel(tr("Realization:"), this);
  gbox1->addWidget(Label0, 0,0);
  ComboRealize = new QComboBox(this);
  ComboRealize->addItem("LC ladder (pi type)");
  ComboRealize->addItem("LC ladder (tee type)");
  ComboRealize->addItem("End coupled transmission lines");
  ComboRealize->addItem("Parallel coupled transmission lines");
  ComboRealize->addItem("Stepped-impedance");
  ComboRealize->addItem("Quarter wave resonators");
  ComboRealize->addItem("Quarter wave side coupled ring resonator");
  ComboRealize->addItem("Capacitively coupled shunt resonators");
  ComboRealize->addItem("Equation-defined");

  gbox1->addWidget(ComboRealize, 0,1);
  connect(ComboRealize, SIGNAL(activated(int)), SLOT(slotRealizationChanged(int)));

   //Synthesize Microstrip
  MicrostripcheckBox=new QCheckBox("Microstrip implementation");
  MicrostripcheckBox->setChecked(false);
  MicrostripcheckBox->setEnabled(false);
  gbox1->addWidget(MicrostripcheckBox, 1,0);
  connect(MicrostripcheckBox, SIGNAL(clicked()), SLOT(on_MicrostripcheckBox_clicked()));

  QLabel *Label1 = new QLabel(tr("Filter type:"), this);
  gbox1->addWidget(Label1, 2,0);
  ComboType = new QComboBox(this);
  ComboType->addItem("Bessel");
  ComboType->addItem("Butterworth");
  ComboType->addItem("Chebyshev");
  ComboType->addItem("Cauer");
  gbox1->addWidget(ComboType, 2,1);
  connect(ComboType, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));

  QLabel *Label2 = new QLabel(tr("Filter class:"), this);
  gbox1->addWidget(Label2, 3,0);
  ComboClass = new QComboBox(this);
  ComboClass->addItem(tr("Low pass"));
  ComboClass->addItem(tr("High pass"));
  ComboClass->addItem(tr("Band pass"));
  ComboClass->addItem(tr("Band stop"));
  gbox1->addWidget(ComboClass, 3,1);
  connect(ComboClass, SIGNAL(activated(int)), SLOT(slotClassChanged(int)));

  IntVal = new QIntValidator(1, 200, this);
  DoubleVal = new QDoubleValidator(this);

  LabelOrder = new QLabel(tr("Order:"), this);
  gbox1->addWidget(LabelOrder, 4,0);
  EditOrder = new QLineEdit("3", this);
  EditOrder->setValidator(IntVal);
  gbox1->addWidget(EditOrder, 4,1);

  LabelStart = new QLabel(tr("Corner frequency:"), this);
  gbox1->addWidget(LabelStart, 5,0);
  EditCorner = new QLineEdit("1", this);
  EditCorner->setValidator(DoubleVal);
  gbox1->addWidget(EditCorner, 5,1);
  ComboCorner = new QComboBox(this);
  ComboCorner->addItem("Hz");
  ComboCorner->addItem("kHz");
  ComboCorner->addItem("MHz");
  ComboCorner->addItem("GHz");
  ComboCorner->setCurrentIndex(3);
  gbox1->addWidget(ComboCorner, 5,2);

  LabelStop = new QLabel(tr("Stop frequency:"), this);
  gbox1->addWidget(LabelStop, 6,0);
  EditStop = new QLineEdit("2", this);
  EditStop->setValidator(DoubleVal);
  gbox1->addWidget(EditStop, 6,1);
  ComboStop = new QComboBox(this);
  ComboStop->addItem("Hz");
  ComboStop->addItem("kHz");
  ComboStop->addItem("MHz");
  ComboStop->addItem("GHz");
  ComboStop->setCurrentIndex(3);
  gbox1->addWidget(ComboStop, 6,2);

  LabelBandStop = new QLabel(tr("Stop band frequency:"), this);
  gbox1->addWidget(LabelBandStop, 7,0);
  EditBandStop = new QLineEdit("3", this);
  EditBandStop->setValidator(DoubleVal);
  gbox1->addWidget(EditBandStop, 7,1);
  ComboBandStop = new QComboBox(this);
  ComboBandStop->addItem("Hz");
  ComboBandStop->addItem("kHz");
  ComboBandStop->addItem("MHz");
  ComboBandStop->addItem("GHz");
  ComboBandStop->setCurrentIndex(3);
  gbox1->addWidget(ComboBandStop, 7,2);

  LabelRipple = new QLabel(tr("Pass band ripple:"), this);
  gbox1->addWidget(LabelRipple, 8,0);
  EditRipple = new QLineEdit("1", this);
  EditRipple->setValidator(DoubleVal);
  gbox1->addWidget(EditRipple, 8,1);
  LabelRipple_dB = new QLabel("dB", this);
  gbox1->addWidget(LabelRipple_dB, 8,2);

  LabelAtten = new QLabel(tr("Stop band attenuation:"), this);
  gbox1->addWidget(LabelAtten, 9,0);
  EditAtten = new QLineEdit("20", this);
  EditAtten->setValidator(DoubleVal);
  gbox1->addWidget(EditAtten, 9,1);
  LabelAtten_dB = new QLabel("dB", this);
  gbox1->addWidget(LabelAtten_dB, 9,2);

  LabelImpedance = new QLabel(tr("Impedance:"), this);
  gbox1->addWidget(LabelImpedance, 10,0);
  EditImpedance = new QLineEdit("50", this);
  EditImpedance->setValidator(DoubleVal);
  gbox1->addWidget(EditImpedance, 10,1);
  LabelOhm = new QLabel("Ohm", this);
  gbox1->addWidget(LabelOhm, 10,2);

  // ...........................................................

  box2 = new QGroupBox(tr("Microstrip Substrate"), this);
  box2->setEnabled(false);

  gbox2 = new QGridLayout();
  gbox2->setSpacing(3);

  box2->setLayout(gbox2);

  QLabel *Label3 = new QLabel(tr("Relative permittivity:"), this);
  gbox2->addWidget(Label3, 0,0);
  ComboEr = new QComboBox(this);
  ComboEr->setEditable(true);
  ComboEr->lineEdit()->setValidator(DoubleVal);
  connect(ComboEr, SIGNAL(activated(const QString&)), SLOT(slotTakeEr(const QString&)));
  gbox2->addWidget(ComboEr, 0,1);

  const char **p = List_er;
  while(*(++p))
    ComboEr->addItem(*p);  // put material properties into combobox
  ComboEr->lineEdit()->setText("9.8");

  QLabel *Label4 = new QLabel(tr("Substrate height:"), this);
  gbox2->addWidget(Label4, 1,0);
  EditHeight = new QLineEdit("1.0", this);
  EditHeight->setValidator(DoubleVal);
  gbox2->addWidget(EditHeight, 1,1);
  QLabel *Label5 = new QLabel("mm", this);
  gbox2->addWidget(Label5, 1,2);

  QLabel *Label6 = new QLabel(tr("metal thickness:"), this);
  gbox2->addWidget(Label6, 2,0);
  EditThickness = new QLineEdit("12.5", this);
  EditThickness->setValidator(DoubleVal);
  gbox2->addWidget(EditThickness, 2,1);
  QLabel *Label7 = new QLabel("um", this);
  gbox2->addWidget(Label7, 2,2);

  QLabel *Label8 = new QLabel(tr("minimum width:"), this);
  gbox2->addWidget(Label8, 3,0);
  EditMinWidth = new QLineEdit("0.4", this);
  EditMinWidth->setValidator(DoubleVal);
  gbox2->addWidget(EditMinWidth, 3,1);
  QLabel *Label9 = new QLabel("mm", this);
  gbox2->addWidget(Label9, 3,2);

  QLabel *Label10 = new QLabel(tr("maximum width:"), this);
  gbox2->addWidget(Label10, 4,0);
  EditMaxWidth = new QLineEdit("5.0", this);
  EditMaxWidth->setValidator(DoubleVal);
  gbox2->addWidget(EditMaxWidth, 4,1);
  QLabel *Label11 = new QLabel("mm", this);
  gbox2->addWidget(Label11, 4,2);

  QSpacerItem *mySpacer=new QSpacerItem(1,1, QSizePolicy::Minimum, QSizePolicy::Expanding);
  gbox2->addItem(mySpacer, 5, 0, 1, -1);

   QSize sz;
   boxImage = new QGroupBox(tr("Preview"), this);
   gboxImage = new QGridLayout();
   boxImage->setLayout(gboxImage);
   QString s1 = ":/bitmaps/LC_Ladder_Pi_LPF.svg";
   imgLayout = new QSvgWidget(s1);
   sz = imgLayout->size();
   imgLayout->setFixedSize(.5*sz);
   gboxImage->addWidget(imgLayout);
    
 

  // ...........................................................
  QVBoxLayout *vboxButtons = new QVBoxLayout();
  QPushButton *ButtonGo = new QPushButton(tr("Calculate and put into Clipboard"), this);
  connect(ButtonGo, SIGNAL(clicked()), SLOT(slotCalculate()));
  vboxButtons->addWidget(ButtonGo);

  LabelResult = new QLabel(this);
  ResultState = 100;
  slotShowResult();
  LabelResult->setAlignment(Qt::AlignHCenter);
  vboxButtons->addWidget(LabelResult);

  QVBoxLayout *vbox_all = new QVBoxLayout();
  QVBoxLayout *vboxRealisation = new QVBoxLayout();
  QVBoxLayout *vboxMicrostrip = new QVBoxLayout();

  vboxRealisation->addWidget(box1);
  hbox->addLayout(vboxRealisation);
  vboxMicrostrip->addWidget(box2);
  vboxMicrostrip->addWidget(boxImage);
  hbox->addLayout(vboxMicrostrip);
  vbox_all->addLayout(hbox);
  vbox_all->addLayout(vboxButtons);
  centralWidget->setLayout(vbox_all);

  // -------  finally set initial state  --------
  slotTypeChanged(0);
  slotClassChanged(0);
}
Пример #13
0
void CQCompartment::load()
{
  if (mpCompartment == NULL) return;

  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);

  const CModel * pModel = NULL;

  if (mpCompartment != NULL)
    pModel = dynamic_cast<const CModel *>(mpCompartment->getObjectAncestor("Model"));

  // Update the labels to reflect the model units
  QString ValueUnits;

  if (pModel)
    ValueUnits = FROM_UTF8(pModel->getVolumeUnitsDisplayString());

  if (!ValueUnits.isEmpty())
    ValueUnits = " (" + ValueUnits + ")";

  QString RateUnits;

  if (pModel)
    RateUnits = FROM_UTF8(pModel->getVolumeRateUnitsDisplayString());

  if (!RateUnits.isEmpty())
    RateUnits = " (" + RateUnits + ")";

  mpLblInitialValue->setText("Initial Volume" + ValueUnits);
  mpLblInitialExpression->setText("Initial Expression" + ValueUnits);
  mpLblVolume->setText("Volume" + ValueUnits);
  mpLblRate->setText("Rate" + RateUnits);

  // Name
  mpEditName->setText(FROM_UTF8(mpCompartment->getObjectName()));

  //Dimensionality
  mpComboBoxDim->setCurrentIndex(mpCompartment->getDimensionality());
  //this assumes the indices of the entries in the combobox correspond 1to1 to the values of dimensionality

  // Simulation Type
  mpComboBoxType->setCurrentText(FROM_UTF8(CModelEntity::StatusName[mpCompartment->getStatus()]));

  // Initial Volume
  mpEditInitialVolume->setText(QString::number(mpCompartment->getInitialValue(), 'g', 10));

  // Transient Volume
  mpEditCurrentVolume->setText(QString::number(mpCompartment->getValue()));

  // Concentration Rate
  mpEditRate->setText(QString::number(mpCompartment->getRate()));

  // Expression
  mpExpressionEMW->mpExpressionWidget->setExpression(mpCompartment->getExpression());
  mpExpressionEMW->updateWidget();

  // Initial Expression
  mpInitialExpressionEMW->mpExpressionWidget->setExpression(mpCompartment->getInitialExpression());
  mpInitialExpressionEMW->updateWidget();

  // Type dependent display of values
  slotTypeChanged(mpComboBoxType->currentItem());

  // Use Initial Expression
  if (mpCompartment->getStatus() == CModelEntity::ASSIGNMENT ||
      mpCompartment->getInitialExpression() == "")
    {
      mpBoxUseInitialExpression->setChecked(false);
    }
  else
    {
      mpBoxUseInitialExpression->setChecked(true);
    }

  loadMetaboliteTable();

  mChanged = false;
  return;
}
Пример #14
0
void KXmlCommandAdvancedDlg::viewItem(TQListViewItem *item)
{
	m_dummy->setEnabled((item != 0));
	m_name->setText("");
	m_desc->setText("");
	m_format->setText("");
	m_default->setText("");
	m_values->clear();
	m_edit1->setText("");
	m_edit2->setText("");
	m_persistent->setChecked( false );
	int	typeId(-1);
	if (item)
	{
		m_name->setText(item->text(1));
		m_desc->setText(item->text(0));

		DrBase	*opt = (m_opts.contains(item->text(1)) ? m_opts[item->text(1)] : 0);
		if (opt)
		{
			bool	isgroup = (opt->type() < DrBase::String);
			if (!isgroup)
			{
				m_type->setCurrentItem(opt->type() - DrBase::String);
				typeId = m_type->currentItem();
				m_format->setText(opt->get("format"));
				m_default->setText(opt->get("default"));
			}
			m_type->setEnabled(!isgroup);
			m_default->setEnabled(!isgroup);
			m_format->setEnabled(!isgroup);
			m_stack->setEnabled(!isgroup);

			switch (opt->type())
			{
				case DrBase::Float:
				case DrBase::Integer:
					m_edit1->setText(opt->get("minval"));
					m_edit2->setText(opt->get("maxval"));
					break;
				case DrBase::Boolean:
				case DrBase::List:
					{
						TQPtrListIterator<DrBase>	it(*(static_cast<DrListOption*>(opt)->choices()));
						TQListViewItem	*item(0);
						for (; it.current(); ++it)
						{
							item = new TQListViewItem(m_values, item, it.current()->name(), it.current()->get("text"));
							item->setRenameEnabled(0, true);
							item->setRenameEnabled(1, true);
						}
						break;
					}
				default:
					break;
			}

			m_addgrp->setEnabled(isgroup);
			m_addopt->setEnabled(isgroup);

			TQListViewItem	*prevItem = findPrev(item), *nextItem = findNext(item);
			DrBase	*prevOpt = (prevItem && m_opts.contains(prevItem->text(1)) ? m_opts[prevItem->text(1)] : 0);
			DrBase	*nextOpt = (nextItem && m_opts.contains(nextItem->text(1)) ? m_opts[nextItem->text(1)] : 0);
			m_up->setEnabled(prevOpt && !(prevOpt->type() < DrBase::String && opt->type() >= DrBase::String));
			m_down->setEnabled(nextOpt && !(isgroup && nextOpt->type() >= DrBase::String));

			m_persistent->setChecked( opt->get( "persistent" ) == "1" );
		}

		m_delopt->setEnabled(true);
		m_dummy->setEnabled(opt);
	}
	else
	{
		m_delopt->setEnabled(false);
		m_addopt->setEnabled(m_view->currentItem() && m_view->isEnabled());
		m_addgrp->setEnabled(m_view->currentItem() && m_view->isEnabled());
		m_up->setEnabled(false);
		m_down->setEnabled(false);
	}
	slotTypeChanged(typeId);
	m_apply->setEnabled(false);
}
Пример #15
0
QucsFilter::QucsFilter()
{
    // set application icon
    setIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
    setCaption("Qucs Filter " PACKAGE_VERSION);


    // --------  create menubar  -------------------
    QPopupMenu *fileMenu = new QPopupMenu();
    fileMenu->insertItem(tr("E&xit"), this, SLOT(slotQuit()), CTRL+Key_Q);

    QPopupMenu *helpMenu = new QPopupMenu();
    helpMenu->insertItem(tr("Help..."), this, SLOT(slotHelpIntro()), Key_F1);
    helpMenu->insertSeparator();
    helpMenu->insertItem(
        tr("&About QucsFilter..."), this, SLOT(slotHelpAbout()), 0);
    helpMenu->insertItem(tr("About Qt..."), this, SLOT(slotHelpAboutQt()), 0);

    QMenuBar *bar = new QMenuBar(this);
    bar->insertItem(tr("&File"), fileMenu);
    bar->insertSeparator ();
    bar->insertItem(tr("&Help"), helpMenu);


    // -------  create main windows widgets --------
    gbox = new QGridLayout(this, 10,3,5,5);

    QWidget *Space = new QWidget(this);   // reserve space for menubar
    Space->setFixedSize(5, bar->height());
    gbox->addWidget(Space, 0,0);

    QLabel *Label1 = new QLabel(tr("Filter type:"), this);
    gbox->addWidget(Label1, 1,0);
    ComboType = new QComboBox(this);
    ComboType->insertItem("Bessel");
    ComboType->insertItem("Butterworth");
    ComboType->insertItem("Chebyshev");
    ComboType->insertItem("Cauer");
    gbox->addWidget(ComboType, 1,1);
    connect(ComboType, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));

    QLabel *Label2 = new QLabel(tr("Filter class:"), this);
    gbox->addWidget(Label2, 2,0);
    ComboClass = new QComboBox(this);
    ComboClass->insertItem(tr("Low pass"));
    ComboClass->insertItem(tr("High pass"));
    ComboClass->insertItem(tr("Band pass"));
    ComboClass->insertItem(tr("Band stop"));
    gbox->addWidget(ComboClass, 2,1);
    connect(ComboClass, SIGNAL(activated(int)), SLOT(slotClassChanged(int)));

    IntVal = new QIntValidator(1, 200, this);
    DoubleVal = new QDoubleValidator(this);

    LabelOrder = new QLabel(tr("Order:"), this);
    gbox->addWidget(LabelOrder, 3,0);
    EditOrder = new QLineEdit("3", this);
    EditOrder->setValidator(IntVal);
    gbox->addWidget(EditOrder, 3,1);

    LabelStart = new QLabel(tr("Corner frequency:"), this);
    gbox->addWidget(LabelStart, 4,0);
    EditCorner = new QLineEdit("1", this);
    EditCorner->setValidator(DoubleVal);
    gbox->addWidget(EditCorner, 4,1);
    ComboCorner = new QComboBox(this);
    ComboCorner->insertItem("Hz");
    ComboCorner->insertItem("kHz");
    ComboCorner->insertItem("MHz");
    ComboCorner->insertItem("GHz");
    ComboCorner->setCurrentItem(3);
    gbox->addWidget(ComboCorner, 4,2);

    LabelStop = new QLabel(tr("Stop frequency:"), this);
    gbox->addWidget(LabelStop, 5,0);
    EditStop = new QLineEdit("2", this);
    EditStop->setValidator(DoubleVal);
    gbox->addWidget(EditStop, 5,1);
    ComboStop = new QComboBox(this);
    ComboStop->insertItem("Hz");
    ComboStop->insertItem("kHz");
    ComboStop->insertItem("MHz");
    ComboStop->insertItem("GHz");
    ComboStop->setCurrentItem(3);
    gbox->addWidget(ComboStop, 5,2);

    LabelBandStop = new QLabel(tr("Stop band frequency:"), this);
    gbox->addWidget(LabelBandStop, 6,0);
    EditBandStop = new QLineEdit("3", this);
    EditBandStop->setValidator(DoubleVal);
    gbox->addWidget(EditBandStop, 6,1);
    ComboBandStop = new QComboBox(this);
    ComboBandStop->insertItem("Hz");
    ComboBandStop->insertItem("kHz");
    ComboBandStop->insertItem("MHz");
    ComboBandStop->insertItem("GHz");
    ComboBandStop->setCurrentItem(3);
    gbox->addWidget(ComboBandStop, 6,2);

    LabelRipple = new QLabel(tr("Pass band ripple:"), this);
    gbox->addWidget(LabelRipple, 7,0);
    EditRipple = new QLineEdit("1", this);
    EditRipple->setValidator(DoubleVal);
    gbox->addWidget(EditRipple, 7,1);
    LabelRipple_dB = new QLabel("dB", this);
    gbox->addWidget(LabelRipple_dB, 7,2);

    LabelAtten = new QLabel(tr("Stop band attenuation:"), this);
    gbox->addWidget(LabelAtten, 8,0);
    EditAtten = new QLineEdit("20", this);
    EditAtten->setValidator(DoubleVal);
    gbox->addWidget(EditAtten, 8,1);
    LabelAtten_dB = new QLabel("dB", this);
    gbox->addWidget(LabelAtten_dB, 8,2);

    QLabel *Label9 = new QLabel(tr("Impedance:"), this);
    gbox->addWidget(Label9, 9,0);
    EditImpedance = new QLineEdit("50", this);
    EditImpedance->setValidator(DoubleVal);
    gbox->addWidget(EditImpedance, 9,1);
    QLabel *Label10 = new QLabel("Ohm", this);
    gbox->addWidget(Label10, 9,2);


    QPushButton *ButtonGo =
        new QPushButton(tr("Calculate and put into Clipboard"), this);
    connect(ButtonGo, SIGNAL(clicked()), SLOT(slotCalculate()));
    gbox->addMultiCellWidget(ButtonGo, 10,10,0,2);

    LabelResult = new QLabel(this);
    ResultState = 100;
    slotShowResult();
    LabelResult->setAlignment(Qt::AlignHCenter);
    gbox->addMultiCellWidget(LabelResult, 11,11,0,2);


    // -------  finally set initial state  --------
    slotTypeChanged(0);
    slotClassChanged(0);
}
Пример #16
0
void CQSpeciesDetail::load()
{
  if (mpMetab == NULL) return;

  const CModel * pModel = NULL;

  if (mpMetab)
    pModel = mpMetab->getModel();

  QString TimeUnits;

  if (pModel)
    TimeUnits = FROM_UTF8(pModel->getTimeUnitsDisplayString());

  if (!TimeUnits.isEmpty())
    TimeUnits = " (" + TimeUnits + ")";

  // Update the labels to reflect the model units
  mpLblTransitionTime->setText("Transition Time " + TimeUnits);

  // Name
  mpEditName->setText(FROM_UTF8(mpMetab->getObjectName()));

  // Compartment
  const CCopasiVectorNS< CCompartment > & Compartments = pModel->getCompartments();
  const CCompartment * pCompartment;
  mpComboBoxCompartment->clear();

  mpComboBoxCompartment->setDuplicatesEnabled(false);
  unsigned C_INT32 m;

  for (m = 0; m < Compartments.size(); m++)
    {
      pCompartment = Compartments[m];
      mpComboBoxCompartment->insertItem(FROM_UTF8(pCompartment->getObjectName()));
    }

  mpCurrentCompartment = mpMetab->getCompartment();
  mpComboBoxCompartment->setCurrentText(FROM_UTF8(mpCurrentCompartment->getObjectName()));

  // Simulation Type
  mpComboBoxType->setCurrentText(FROM_UTF8(CModelEntity::StatusName[mpMetab->getStatus()]));

  // Initial Concentration handled in slotTypeChanged
  mInitialConcentration = mpMetab->getInitialConcentration();

  // Initial Number handled in slotTypeChanged
  mInitialNumber = mpMetab->getInitialValue();

  mInitialNumberLastChanged = true;

  // Transistion Time
  mpEditTransitionTime->setText(QString::number(mpMetab->getTransitionTime()));

  // Expression
  mpExpressionEMW->mpExpressionWidget->setExpression(mpMetab->getExpression());
  mpExpressionEMW->updateWidget();

  // Initial Expression
  mpInitialExpressionEMW->mpExpressionWidget->setExpression(mpMetab->getInitialExpression());
  mpInitialExpressionEMW->updateWidget();

  // Type dependent display of values
  slotTypeChanged(mpComboBoxType->currentItem());

  // Use Initial Expression
  if (mpMetab->getStatus() == CModelEntity::ASSIGNMENT ||
      mpMetab->getInitialExpression() == "")
    {
      mpBoxUseInitialExpression->setChecked(false);
      // slotInitialTypeChanged(false);
    }
  else
    {
      mpBoxUseInitialExpression->setChecked(true);
      // slotInitialTypeChanged(true);
    }

  loadReactionTable();

  // Update the units and values accordingly
  setFramework(mFramework);

  mChanged = false;
  return;
}
Пример #17
0
LocationDialog::LocationDialog(QWidget *parent, const char *name)
	: KDialogBase(parent, name, true, QString::null, Ok|Cancel, Ok, true)
{
	QWidget	*dummy = new QWidget(this);
	setMainWidget(dummy);
	resource_ = new QComboBox(dummy);
	authtype_ = new QComboBox(dummy);
	authclass_ = new QComboBox(dummy);
	authname_ = new QLineEdit(dummy);
	encryption_ = new QComboBox(dummy);
	satisfy_ = new QComboBox(dummy);
	order_ = new QComboBox(dummy);
	addresses_ = new EditList(dummy);

	authtype_->insertItem(i18n("None"));
	authtype_->insertItem(i18n("Basic"));
	authtype_->insertItem(i18n("Digest"));

	authclass_->insertItem(i18n("None"));
	authclass_->insertItem(i18n("User"));
	authclass_->insertItem(i18n("System"));
	authclass_->insertItem(i18n("Group"));

	encryption_->insertItem(i18n("Always"));
	encryption_->insertItem(i18n("Never"));
	encryption_->insertItem(i18n("Required"));
	encryption_->insertItem(i18n("If Requested"));

	satisfy_->insertItem(i18n("All"));
	satisfy_->insertItem(i18n("Any"));

	order_->insertItem(i18n("Allow, Deny"));
	order_->insertItem(i18n("Deny, Allow"));

	connect(authclass_, SIGNAL(activated(int)), SLOT(slotClassChanged(int)));
	connect(authtype_, SIGNAL(activated(int)), SLOT(slotTypeChanged(int)));

	QLabel	*l1 = new QLabel(i18n("Resource:"), dummy);
	QLabel	*l2 = new QLabel(i18n("Authentication:"), dummy);
	QLabel	*l3 = new QLabel(i18n("Class:"), dummy);
	QLabel	*l4 = new QLabel(i18n("Names:"), dummy);
	QLabel	*l5 = new QLabel(i18n("Encryption:"), dummy);
	QLabel	*l6 = new QLabel(i18n("Satisfy:"), dummy);
	QLabel	*l7 = new QLabel(i18n("ACL order:"), dummy);
	QLabel	*l8 = new QLabel(i18n("ACL addresses:"),dummy);

	QGridLayout	*m1 = new QGridLayout(dummy, 8, 2, 0, 5);
	m1->setColStretch(1, 1);
	m1->addWidget(l1, 0, 0, Qt::AlignRight);
	m1->addWidget(l2, 1, 0, Qt::AlignRight);
	m1->addWidget(l3, 2, 0, Qt::AlignRight);
	m1->addWidget(l4, 3, 0, Qt::AlignRight);
	m1->addWidget(l5, 4, 0, Qt::AlignRight);
	m1->addWidget(l6, 5, 0, Qt::AlignRight);
	m1->addWidget(l7, 6, 0, Qt::AlignRight);
	m1->addWidget(l8, 7, 0, Qt::AlignRight|Qt::AlignTop);
	m1->addWidget(resource_, 0, 1);
	m1->addWidget(authtype_, 1, 1);
	m1->addWidget(authclass_, 2, 1);
	m1->addWidget(authname_, 3, 1);
	m1->addWidget(encryption_, 4, 1);
	m1->addWidget(satisfy_, 5, 1);
	m1->addWidget(order_, 6, 1);
	m1->addWidget(addresses_, 7, 1);

	setCaption(i18n("Location"));
	resize(400, 100);

	slotTypeChanged(AUTHTYPE_NONE);
	slotClassChanged(AUTHCLASS_ANONYMOUS);
	encryption_->setCurrentItem(ENCRYPT_IFREQUESTED);

	connect(addresses_, SIGNAL(add()), SLOT(slotAdd()));
	connect(addresses_, SIGNAL(edit(int)), SLOT(slotEdit(int)));
	connect(addresses_, SIGNAL(defaultList()), SLOT(slotDefaultList()));
}
FilterImagesDialog::FilterImagesDialog(const KUrl::List& urlList, KIPI::Interface* interface, QWidget *parent)
        : BatchProcessImagesDialog(urlList, interface, i18n("Batch Image Filtering"), parent)
{
    // About data and help button.

    m_about = new KIPIPlugins::KPAboutData(ki18n("Batch image filtering"),
                                           QByteArray(),
                                           KAboutData::License_GPL,
                                           ki18n("A Kipi plugin to batch filter images.\n"
                                                 "This plugin uses the \"convert\" program from the \"ImageMagick\" package."),
                                           ki18n("(c) 2003-2009, Gilles Caulier\n"
                                                 "(c) 2007-2009, Aurélien Gateau"));

    m_about->addAuthor(ki18n("Gilles Caulier"), ki18n("Author"),
                       "caulier dot gilles at gmail dot com");

    m_about->addAuthor(ki18n("Aurelien Gateau"), ki18n("Maintainer"),
                       "aurelien dot gateau at free dot fr");

    DialogUtils::setupHelpButton(this, m_about);
    //---------------------------------------------

    m_nbItem = m_selectedImageFiles.count();

    //---------------------------------------------

    setOptionBoxTitle(i18n("Image Filtering Options"));

    m_labelType->setText(i18n("Filter:"));

    m_Type->addItem(i18nc("image filter", "Add Noise"));       // 0
    m_Type->addItem(i18nc("image filter", "Antialias"));
    m_Type->addItem(i18nc("image filter", "Blur"));
    m_Type->addItem(i18nc("image filter", "Despeckle"));
    m_Type->addItem(i18nc("image filter", "Enhance"));         // 4
    m_Type->addItem(i18nc("image filter", "Median"));
    m_Type->addItem(i18nc("image filter", "Noise Reduction"));
    m_Type->addItem(i18nc("image filter", "Sharpen"));
    m_Type->addItem(i18nc("image filter", "Unsharp"));         // 8
    m_Type->setCurrentItem(i18nc("image filter", "Sharpen"));
    QString whatsThis = i18n(
                            "<p>Select here the filter type for your images:</p>"
                            "<p>"
                            "<b>Add noise</b>: add artificial noise to an image.<br/>"
                            "<b>Antialias</b>: remove pixel aliasing.<br/>"
                            "<b>Blur</b>: blur the image with a Gaussian operator.<br/>"
                            "<b>Despeckle</b>: reduces the speckle noise in an image while preserving the "
                            "edges of the original image.<br/>"
                            "<b>Enhance</b>: apply a digital filter to enhance a noisy image.<br/>"
                            "<b>Median</b>: apply a median filter to an image.<br/>"
                            "<b>Noise reduction</b>: reduce noise in an image. <br/>"
                            "<b>Sharpen</b>: sharpen the image with a Gaussian operator.<br/>"
                            "<b>Unsharp</b>: sharpen the image with an unsharp mask operator."
                            "</p>");

    m_Type->setWhatsThis(whatsThis);

    //---------------------------------------------

    readSettings();
    listImageFiles();
    slotTypeChanged(m_Type->currentIndex());
}