void NucleiDetectionFilterPlugin::initializeSettingsPanel() {
  _mutex.lock();
  if (_settingsPanel) {
    _settingsPanel->deleteLater();
  }
  QUiLoader loader;
  QFile file(":/NucleiDetectionFilter_ui/NucleiDetectionFilter.ui");
  file.open(QFile::ReadOnly);
  _settingsPanel = loader.load(&file);
  file.close();
  QPushButton* revertStainButton = _settingsPanel->findChild<QPushButton*>("RevertStainsToDefaultButton");
  QDoubleSpinBox* stain1R = _settingsPanel->findChild<QDoubleSpinBox*>("Stain1RSpinBox");
  QDoubleSpinBox* stain1G = _settingsPanel->findChild<QDoubleSpinBox*>("Stain1GSpinBox");
  QDoubleSpinBox* stain1B = _settingsPanel->findChild<QDoubleSpinBox*>("Stain1BSpinBox");
  QDoubleSpinBox* stain2R = _settingsPanel->findChild<QDoubleSpinBox*>("Stain2RSpinBox");
  QDoubleSpinBox* stain2G = _settingsPanel->findChild<QDoubleSpinBox*>("Stain2GSpinBox");
  QDoubleSpinBox* stain2B = _settingsPanel->findChild<QDoubleSpinBox*>("Stain2BSpinBox");
  QDoubleSpinBox* stain3R = _settingsPanel->findChild<QDoubleSpinBox*>("Stain3RSpinBox");
  QDoubleSpinBox* stain3G = _settingsPanel->findChild<QDoubleSpinBox*>("Stain3GSpinBox");
  QDoubleSpinBox* stain3B = _settingsPanel->findChild<QDoubleSpinBox*>("Stain3BSpinBox");
  QDoubleSpinBox* rThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("RThreshold");
  QDoubleSpinBox* gThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("GThreshold");
  QDoubleSpinBox* bThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("BThreshold");
  QDoubleSpinBox* globalThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("GlobalThreshold");
  QDoubleSpinBox* maxRadius = _settingsPanel->findChild<QDoubleSpinBox*>("MaxRadiusSpinBox");
  QDoubleSpinBox* minRadius = _settingsPanel->findChild<QDoubleSpinBox*>("MinRadiusSpinBox");
  QDoubleSpinBox* stepRadius = _settingsPanel->findChild<QDoubleSpinBox*>("StepRadiusSpinBox");
  QDoubleSpinBox* alpha = _settingsPanel->findChild<QDoubleSpinBox*>("AlphaSpinBox");
  QDoubleSpinBox* beta = _settingsPanel->findChild<QDoubleSpinBox*>("BetaSpinBox");
  QDoubleSpinBox* hMaximaThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("HMaximaThresholdSpinBox");
  connect(stain1R, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain1G, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain1B, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain2R, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain2G, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain2B, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain3R, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain3G, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stain3B, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(rThreshold, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(gThreshold, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(bThreshold, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(globalThreshold, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(maxRadius, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(minRadius, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(stepRadius, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(alpha, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(beta, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(hMaximaThreshold, SIGNAL(valueChanged(double)), this, SLOT(updateFilterFromSettingsPanel()));
  connect(revertStainButton, SIGNAL(clicked()), this, SLOT(revertStainToDefault()));
  QGroupBox* colorDeconvBox = _settingsPanel->findChild<QGroupBox*>("ColorDeconvolutionBox");
  if (_monochromeInput) {
    colorDeconvBox->setEnabled(false);
  }
  else {
    colorDeconvBox->setEnabled(true);
  }
  _mutex.unlock();
}
Exemple #2
0
QGroupBox *ServerDialog::create3v3Box() {
    QGroupBox *box = new QGroupBox(tr("3v3 options"));
    box->setEnabled(Config.GameMode == "06_3v3");
    box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QVBoxLayout *vlayout = new QVBoxLayout;

    official_3v3_radiobutton = new QRadioButton(tr("Official mode"));

    QComboBox *officialComboBox = new QComboBox;
    officialComboBox->addItem(tr("Classical"), "Classical");
    officialComboBox->addItem("2012", "2012");
    officialComboBox->addItem("2013", "2013");

    official_3v3_ComboBox = officialComboBox;

    QString rule = Config.value("3v3/OfficialRule", "2012").toString();
    if (rule == "2012")
        officialComboBox->setCurrentIndex(1);
    else if (rule == "2013")
        officialComboBox->setCurrentIndex(2);

    QRadioButton *extend = new QRadioButton(tr("Extension mode"));
    QPushButton *extend_edit_button = new QPushButton(tr("General selection ..."));
    extend_edit_button->setEnabled(false);
    connect(extend, SIGNAL(toggled(bool)), extend_edit_button, SLOT(setEnabled(bool)));
    connect(extend_edit_button, SIGNAL(clicked()), this, SLOT(select3v3Generals()));

    exclude_disaster_checkbox = new QCheckBox(tr("Exclude disasters"));
    exclude_disaster_checkbox->setChecked(Config.value("3v3/ExcludeDisasters", true).toBool());

    QComboBox *roleChooseComboBox = new QComboBox;
    roleChooseComboBox->addItem(tr("Normal"), "Normal");
    roleChooseComboBox->addItem(tr("Random"), "Random");
    roleChooseComboBox->addItem(tr("All roles"), "AllRoles");

    role_choose_ComboBox = roleChooseComboBox;

    QString scheme = Config.value("3v3/RoleChoose", "Normal").toString();
    if (scheme == "Random")
        roleChooseComboBox->setCurrentIndex(1);
    else if (scheme == "AllRoles")
        roleChooseComboBox->setCurrentIndex(2);

    vlayout->addLayout(HLay(official_3v3_radiobutton, official_3v3_ComboBox));
    vlayout->addLayout(HLay(extend, extend_edit_button));
    vlayout->addWidget(exclude_disaster_checkbox);
    vlayout->addLayout(HLay(new QLabel(tr("Role choose")), role_choose_ComboBox));
    box->setLayout(vlayout);

    bool using_extension = Config.value("3v3/UsingExtension", false).toBool();
    if (using_extension)
        extend->setChecked(true);
    else
        official_3v3_radiobutton->setChecked(true);

    return box;
}
void VisualizationWorkstationExtensionPlugin::loadNewForegroundImage(const std::string& resultImagePth) {
  if (_foreground) {
    _foregroundScale = 1;
    emit changeForegroundImage(std::weak_ptr<MultiResolutionImage>(), _foregroundScale);
    _foreground.reset();
  }
  QGroupBox* segmentationGroupBox = _dockWidget->findChild<QGroupBox*>("SegmentationGroupBox");
  segmentationGroupBox->setEnabled(false);
  QGroupBox* visualizationGroupBox = _dockWidget->findChild<QGroupBox*>("VisualizationGroupBox");
  visualizationGroupBox->setEnabled(false);
  if (core::fileExists(resultImagePth)) {
    MultiResolutionImageReader reader;
    _foreground.reset(reader.open(resultImagePth));
    if (_foreground) {
      setDefaultVisualizationParameters(_foreground);
      std::vector<unsigned long long> dimsFG = _foreground->getDimensions();
      if (_backgroundDimensions[0] / dimsFG[0] == _backgroundDimensions[1] / dimsFG[1]) {
        _foregroundScale = _backgroundDimensions[0] / dimsFG[0];
        if (_likelihoodCheckBox) {
          if (_renderingEnabled) {
            if (_likelihoodCheckBox->isChecked()) {
              emit changeForegroundImage(_foreground, _foregroundScale);
            }
            else {
              _likelihoodCheckBox->setChecked(true);
            }
          }
          else {
            if (_likelihoodCheckBox->isChecked()) {
              _likelihoodCheckBox->setChecked(false);
            }
            else {
              emit changeForegroundImage(std::weak_ptr<MultiResolutionImage>(), _foregroundScale);
            }
          }
        }
      }
      QGroupBox* segmentationGroupBox = _dockWidget->findChild<QGroupBox*>("SegmentationGroupBox");
      segmentationGroupBox->setEnabled(true);
      QGroupBox* visualizationGroupBox = _dockWidget->findChild<QGroupBox*>("VisualizationGroupBox");
      visualizationGroupBox->setEnabled(true);
    }
  }
}
void VisualizationWorkstationExtensionPlugin::onImageClosed() {
  // Store current visualization settings based on ImageType (later replace this with Result specific settings)
  if (_settings && _foreground) {
    _settings->beginGroup("VisualizationWorkstationExtensionPlugin");
    pathology::DataType dtype = _foreground->getDataType();
    if (dtype == pathology::Float) {
      _settings->beginGroup("VisualizationSettingsForFloatType");
    }
    else if (dtype == pathology::UChar) {
      _settings->beginGroup("VisualizationSettingsForUCharType");
    }
    else if (dtype == pathology::UInt16) {
      _settings->beginGroup("VisualizationSettingsForUInt16Type");
    }
    else if (dtype == pathology::UInt32) {
      _settings->beginGroup("VisualizationSettingsForUInt32Type");
    }
    _settings->setValue("opacity", _opacity);
    _settings->setValue("foregroundchannel", _foregroundChannel);
    _settings->setValue("window", _window);
    _settings->setValue("level", _level);
    _settings->setValue("lut", _currentLUT);
    _settings->setValue("visible", _renderingEnabled);
    _settings->endGroup();
    _settings->endGroup();
  }
  if (!_polygons.empty()) {
    removeSegmentationsFromViewer();
  }
  if (_foreground) {
    _foregroundScale = 1;
    emit changeForegroundImage(std::weak_ptr<MultiResolutionImage>(), _foregroundScale);
    _foreground.reset();
  }
  if (_dockWidget) {
    _dockWidget->setEnabled(false);
    QGroupBox* segmentationGroupBox = _dockWidget->findChild<QGroupBox*>("SegmentationGroupBox");
    segmentationGroupBox->setEnabled(false);
    QGroupBox* visualizationGroupBox = _dockWidget->findChild<QGroupBox*>("VisualizationGroupBox");
    visualizationGroupBox->setEnabled(false);
  }
}
Exemple #5
0
// Create new group box
QtWidgetObject* AtenTreeGuiDialog::addGroup(TreeGuiWidget* widget, QString label)
{
	QtWidgetObject* qtwo = widgetObjects_.add();
	QGroupBox *group = new QGroupBox(label);

	QGridLayout *layout = addLayout(group);

	qtwo->set(widget, group, NULL, layout);
	group->setEnabled(widget->enabled());
	group->setVisible(widget->visible());
	group->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	return qtwo;
}
Exemple #6
0
QGroupBox *ServerDialog::createXModeBox() {
    QGroupBox *box = new QGroupBox(tr("XMode options"));
    box->setEnabled(Config.GameMode == "06_XMode");
    box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QComboBox *roleChooseComboBox = new QComboBox;
    roleChooseComboBox->addItem(tr("Normal"), "Normal");
    roleChooseComboBox->addItem(tr("Random"), "Random");
    roleChooseComboBox->addItem(tr("All roles"), "AllRoles");

    role_choose_xmode_ComboBox = roleChooseComboBox;

    QString scheme = Config.value("XMode/RoleChooseX", "Normal").toString();
    if (scheme == "Random")
        roleChooseComboBox->setCurrentIndex(1);
    else if (scheme == "AllRoles")
        roleChooseComboBox->setCurrentIndex(2);

    box->setLayout(HLay(new QLabel(tr("Role choose")), role_choose_xmode_ComboBox));
    return box;
}
Exemple #7
0
QGroupBox *ServerDialog::create1v1Box() {
    QGroupBox *box = new QGroupBox(tr("1v1 options"));
    box->setEnabled(Config.GameMode == "02_1v1");
    box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    QVBoxLayout *vlayout = new QVBoxLayout;

    QComboBox *officialComboBox = new QComboBox;
    officialComboBox->addItem(tr("Classical"), "Classical");
    officialComboBox->addItem("2013", "2013");
    officialComboBox->addItem("OL", "OL");

    official_1v1_ComboBox = officialComboBox;

    QString rule = Config.value("1v1/Rule", "Classical").toString();
    if (rule == "2013")
        officialComboBox->setCurrentIndex(1);
    else if (rule == "OL")
        officialComboBox->setCurrentIndex(2);

    kof_using_extension_checkbox = new QCheckBox(tr("General extensions"));
    kof_using_extension_checkbox->setChecked(Config.value("1v1/UsingExtension", false).toBool());

    kof_card_extension_checkbox = new QCheckBox(tr("Card extensions"));
    kof_card_extension_checkbox->setChecked(Config.value("1v1/UsingCardExtension", false).toBool());

    vlayout->addLayout(HLay(new QLabel(tr("Rule option")), official_1v1_ComboBox));

    QHBoxLayout *hlayout = new QHBoxLayout;
    hlayout->addWidget(new QLabel(tr("Extension setting")));
    hlayout->addStretch();
    hlayout->addWidget(kof_using_extension_checkbox);
    hlayout->addWidget(kof_card_extension_checkbox);

    vlayout->addLayout(hlayout);
    box->setLayout(vlayout);

    return box;
}
RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUser * r,bool bModal)
: KviTalTabDialog(p,"reguser_entry_editor",bModal)
{
	m_pUser = r;
	m_pCustomColor = new QColor();

	if(r)
	{
		QString col=r->getProperty("customColor");
		KviStringConversion::fromString(col,(*m_pCustomColor));
	}

	m_pPropertyDict = new KviPointerHashTable<QString,QString>(17,false);
	m_pPropertyDict->setAutoDelete(true);

	//setMinimumSize(400,450);

	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux)));
	setWindowTitle(__tr2qs_ctx("Registered User Entry","register"));

	QWidget * p1 = new QWidget(this);

	QGridLayout * g = new QGridLayout(p1);

	QLabel * l = new QLabel(__tr2qs_ctx("Name:","register"),p1);
	g->addWidget(l,0,0);

	m_pNameEdit = new QLineEdit(p1);
	g->addWidget(m_pNameEdit,0,1);

	l = new QLabel(__tr2qs_ctx("Comment:","register"),p1);
	g->addWidget(l,1,0);

	m_pCommentEdit = new QLineEdit(p1);
	g->addWidget(m_pCommentEdit,1,1);

	QFrame * f = new QFrame(p1);
	g->addWidget(f,2,0,1,2);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);

	l = new QLabel(__tr2qs_ctx("Masks:","register"),p1);
	g->addWidget(l,3,0,1,2);

	m_pMaskListBox = new QListWidget(p1);
	connect(m_pMaskListBox,SIGNAL(itemSelectionChanged()),this,SLOT(maskCurrentChanged()));
	m_pMaskListBox->setMinimumSize(300,200);

	g->addWidget(m_pMaskListBox,4,0,1,2);

	KviTalHBox * b = new KviTalHBox(p1);
	g->addWidget(b,5,0,1,2);
	b->setSpacing(4);

	m_pAddMaskButton = new QPushButton(__tr2qs_ctx("&Add...","register"),b);
	connect(m_pAddMaskButton,SIGNAL(clicked()),this,SLOT(addMaskClicked()));
	m_pAddMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem)));

	m_pDelMaskButton = new QPushButton(__tr2qs_ctx("Re&move","register"),b);
	m_pDelMaskButton->setEnabled(false);
	connect(m_pDelMaskButton,SIGNAL(clicked()),this,SLOT(delMaskClicked()));
	m_pDelMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem)));

	m_pEditMaskButton = new QPushButton(__tr2qs_ctx("&Edit","register"),b);
	m_pEditMaskButton->setEnabled(false);
	connect(m_pEditMaskButton,SIGNAL(clicked()),this,SLOT(editMaskClicked()));
	m_pEditMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem)));

	g->setRowStretch(4,1);
	g->setColumnStretch(1,1);

	addTab(p1,__tr2qs_ctx("Identity","register"));

	QWidget * p2 = new QWidget(this);

	g = new QGridLayout(p2);

	m_pNotifyCheck = new QCheckBox(__tr2qs_ctx("Notify when user is online","register"),p2);
	g->addWidget(m_pNotifyCheck,0,0,1,3);

	m_pNotifyLabel = new QLabel(__tr2qs_ctx("Notify nicknames:","register"),p2);
	m_pNotifyLabel->setEnabled(m_pNotifyCheck->isChecked());
	g->addWidget(m_pNotifyLabel,1,0);
	m_pNotifyCheck->setToolTip(__tr2qs_ctx("<center>You can enter a space separated list of nicknames.</center>","register"));


	m_pNotifyNick = new QLineEdit(p2);
	m_pNotifyNick->setEnabled(false);

	g->addWidget(m_pNotifyNick,1,1,1,2);
	connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckClicked(bool)));


	f = new QFrame(p2);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	g->addWidget(f,2,0,1,3);

	m_pAvatar = 0;
	if(r)
	{
		const QString av = r->getProperty("avatar");
		if(!av.isEmpty())
		{
			m_pAvatar = new KviPixmap(av.toUtf8().data());
		}
	}
	if(!m_pAvatar)m_pAvatar = new KviPixmap();

	m_pAvatarSelector = new KviPixmapSelector(p2,__tr2qs_ctx("Avatar","register"),m_pAvatar,true);
	g->addWidget(m_pAvatarSelector,3,0,1,3);

	f = new QFrame(p2);
	f->setFrameStyle(QFrame::HLine | QFrame::Sunken);
	g->addWidget(f,4,0,1,3);

	m_pCustomColorCheck = new QCheckBox(__tr2qs_ctx("Use custom color in userlist","register"),p2);
	if(r)
		m_pCustomColorCheck->setChecked(r->getBoolProperty("useCustomColor"));
	g->addWidget(m_pCustomColorCheck,5,0,1,2);

	m_pCustomColorSelector = new KviColorSelector(p2,QString(),m_pCustomColor,1);
	g->addWidget(m_pCustomColorSelector,5,2);

	QPushButton * pb = new QPushButton(__tr2qs_ctx("All Properties...","register"),p2);
	connect(pb,SIGNAL(clicked()),this,SLOT(editAllPropertiesClicked()));
	g->addWidget(pb,6,2);

	g->setColumnStretch(1,1);
	g->setRowStretch(3,1);

	addTab(p2,__tr2qs_ctx("Properties","register"));

	// Ignore TAB
	KviTalVBox * vb = new KviTalVBox(this);
	vb->setMargin(10);

	m_pIgnoreEnabled = new QCheckBox(__tr2qs_ctx("Enable ignore for this user","register"),vb);

	QGroupBox * gb = new QGroupBox(__tr2qs_ctx("Ignore features","register"),vb);
	connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),gb,SLOT(setEnabled(bool)));

	QVBoxLayout * layout = new QVBoxLayout(gb);
	layout->setMargin(20);
	layout->setSpacing(3);

	m_pIgnoreQuery = new QCheckBox(__tr2qs_ctx("Ignore query messages","register"),gb);
	layout->addWidget(m_pIgnoreQuery);

	m_pIgnoreChannel = new QCheckBox(__tr2qs_ctx("Ignore channel messages","register"),gb);
	layout->addWidget(m_pIgnoreChannel);

	m_pIgnoreNotice = new QCheckBox(__tr2qs_ctx("Ignore notice messages","register"),gb);
	layout->addWidget(m_pIgnoreNotice);

	m_pIgnoreCtcp = new QCheckBox(__tr2qs_ctx("Ignore CTCP messages","register"),gb);
	layout->addWidget(m_pIgnoreCtcp);

	m_pIgnoreInvite = new QCheckBox(__tr2qs_ctx("Ignore invites","register"),gb);
	layout->addWidget(m_pIgnoreInvite);

	m_pIgnoreDcc = new QCheckBox(__tr2qs_ctx("Ignore DCCs","register"),gb);
	layout->addWidget(m_pIgnoreDcc);

	QWidget *w = new QWidget(vb);
	w->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);

	addTab(vb,__tr2qs_ctx("Ignore","register"));

	setCancelButton(__tr2qs_ctx("Cancel","register"));
	setOkButton(__tr2qs_ctx("&OK","register"));
	connect(this,SIGNAL(applyButtonPressed()),this,SLOT(okClicked()));
	connect(this,SIGNAL(cancelButtonPressed()),this,SLOT(reject()));

	if(r)
	{
		m_pNameEdit->setText(r->name());
		m_pCommentEdit->setText(r->getProperty("comment"));
		for(KviIrcMask * m = r->maskList()->first();m;m = r->maskList()->next())
		{
			QString mk = m->nick();
			mk += QChar('!');
			mk += m->user();
			mk += QChar('@');
			mk += m->host();
			m_pMaskListBox->addItem(mk);
		}

		QString szNotifyNicks = r->getProperty("notify");
		if(!szNotifyNicks.isEmpty())
		{
			m_pNotifyCheck->setChecked(true);
			m_pNotifyNick->setText(szNotifyNicks);
			m_pNotifyNick->setEnabled(true);
		}

		if(r->propertyDict())
		{
			KviPointerHashTableIterator<QString,QString> it(*(r->propertyDict()));
			while(QString *s = it.current())
			{
				m_pPropertyDict->insert(it.currentKey(),new QString(*s));
				++it;
			}
		}

		m_pIgnoreEnabled->setChecked(r->ignoreEnagled());

		gb->setEnabled(r->ignoreEnagled());

		m_pIgnoreQuery->setChecked(r->ignoreFlags() & KviRegisteredUser::Query);
		m_pIgnoreChannel->setChecked(r->ignoreFlags() & KviRegisteredUser::Channel);
		m_pIgnoreNotice->setChecked(r->ignoreFlags() & KviRegisteredUser::Notice);
		m_pIgnoreCtcp->setChecked(r->ignoreFlags() & KviRegisteredUser::Ctcp);
		m_pIgnoreInvite->setChecked(r->ignoreFlags() & KviRegisteredUser::Invite);
		m_pIgnoreDcc->setChecked(r->ignoreFlags() & KviRegisteredUser::Dcc);
	} else {
		// default values
		if(!m_pIgnoreEnabled->isChecked())
		{
			gb->setEnabled(false);
		}
	}
}
Exemple #9
0
ClientSettings::ClientSettings(ClientInterface* par)
{
    m_parent = par;
    setParent(par);
    setWhatsThis(tr("Ici, vous pouvez régler bon nombre d'options du logiciel."));

    setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint|Qt::WindowTitleHint|Qt::WindowCloseButtonHint|Qt::WindowContextHelpButtonHint);

    m_settings = allocateSettings(this);

    QVBoxLayout* la = new QVBoxLayout;
    QVBoxLayout* la2 = new QVBoxLayout;
    QHBoxLayout* hla= new QHBoxLayout;
    setLayout(hla);
    hla->addLayout(la);
    hla->addLayout(la2);

    {
        QGroupBox *gb = new QGroupBox(tr("Général"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        {
            QHBoxLayout* h_la = new QHBoxLayout;
            v_la->addLayout(h_la);

            m_nickname = new QLineEdit(m_settings->value(PARAM_NICK).toString(), this);
            m_nickname->setMaxLength(MAX_NICKNAME_LENGHT);
            m_nickname->setWhatsThis(tr("Entrez ici le pseudo que vous utiliserez sur le chat. A contrario de la commande /pseudo, ce pseudo sera automatiquement appliqué à chaque connexion."));
            h_la->addWidget(new QLabel(tr("Pseudo :")));
            h_la->addWidget(m_nickname);
        }

    }

    {
        QGroupBox *gb = new QGroupBox(tr("Interface"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);
        m_selectInterface = new QPushButton("...", this);
        m_selectInterface->setWhatsThis(tr("Parcourir le disque dur..."));
        connect(m_selectInterface, SIGNAL(pressed()), this, SLOT(selectInterface()));
        m_interfacePath = new QLineEdit(m_settings->value(PARAM_INTERFACE, DEFAULT_INTERFACE).toString(), this);
        connect(m_interfacePath, SIGNAL(returnPressed()), this, SLOT(openInterface()));
        h_la->addWidget(m_interfacePath);
        h_la->addWidget(m_selectInterface);
        }

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_saveInterface = new QPushButton(tr("Sauvegarder"), this);
        m_saveInterface->setWhatsThis(tr("Sauvegarder une interface."));
        connect(m_saveInterface, SIGNAL(pressed()), this, SLOT(saveInterface()));
        h_la->addWidget(m_saveInterface);

        m_openInterface = new QPushButton(tr("Charger"), this);
        m_openInterface->setWhatsThis(tr("Charger l'interface marquée plus haut."));
        connect(m_openInterface, SIGNAL(pressed()), this, SLOT(openInterface()));
        h_la->addWidget(m_openInterface);
        }
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Thème"));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);
        m_selectCSS = new QPushButton("...", this);
        m_selectCSS->setWhatsThis(tr("Parcourir le disque dur..."));
        connect(m_selectCSS, SIGNAL(pressed()), this, SLOT(selectCSS()));
        m_CSSPath = new QLineEdit(m_settings->value(PARAM_CSS).toString(), this);
        connect(m_CSSPath, SIGNAL(returnPressed()), this, SLOT(openCSS()));
        h_la->addWidget(m_CSSPath);
        h_la->addWidget(m_selectCSS);

        m_openCSS = new QPushButton(tr("Charger"), this);
        m_openCSS->setWhatsThis(tr("Charger la feuille de style indiquée plus haut."));
        connect(m_openCSS, SIGNAL(pressed()), this, SLOT(openCSS()));
        v_la->addWidget(m_openCSS);
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Paramètres de connexion"));
        gb->setWhatsThis(tr("Ces options ne sont disponibles que lorsque vous n'êtes pas connecté à un serveur."));
        la->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Addresse IP et port du serveur :")));

        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_serverIP = new QLineEdit(m_settings->value(PARAM_IP, SERVER_IP).toString(), this);
        m_serverIP->setInputMask("000.000.000.000;");
        m_serverPort = new QSpinBox(this);
        m_serverPort->setMinimum(1024);
        m_serverPort->setMaximum(65535);
        m_serverPort->setValue(m_settings->value(PARAM_PORT, SERVER_PORT).toInt());
        h_la->addWidget(m_serverIP);
        h_la->addWidget(new QLabel(":"));
        h_la->addWidget(m_serverPort);

        if(par->isConnected())
            gb->setEnabled(false);
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Paramètres du son"));
        la2->addWidget(gb);
        QVBoxLayout* v_la = new QVBoxLayout;
        gb->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Volume des sons d'ambiance :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_sound = new QSlider(this);
        m_sound->setMaximum(1000);
        m_sound->setOrientation(Qt::Horizontal);
        m_sound->setValue(static_cast<int>(m_settings->value(PARAM_SOUND, 100.f).toFloat()*10));
        connect(m_sound, SIGNAL(valueChanged(int)), this, SLOT(soundSliderChanged(int)));
        m_soundSpinBox=new QDoubleSpinBox(this);
        m_soundSpinBox->setMaximum(100); m_soundSpinBox->setMinimum(0); m_soundSpinBox->setMaximum(100); m_soundSpinBox->setDecimals(1);
        m_soundSpinBox->setValue(m_settings->value(PARAM_SOUND, 100.f).toFloat());
        connect(m_soundSpinBox, SIGNAL(valueChanged(double)), this, SLOT(soundSpinBoxChanged(double)));
        h_la->addWidget(m_sound);
        h_la->addWidget(m_soundSpinBox);
        }
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        h_la->addWidget(new QLabel(tr("Périphériques sonore :")));
        m_chb_dvc_out=new QCheckBox(tr("Utiliser le périphérique par défaut"), this);
        v_la->addWidget(m_chb_dvc_out);
        m_cb_dvc_out=new QComboBox(this);
        m_cb_dvc_out->addItems(getOALDevices(true));
        m_cb_dvc_out->setCurrentIndex(m_cb_dvc_out->findText(getOALCurrentDevice(true)));
        h_la->addWidget(m_cb_dvc_out);

        }
        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        h_la->addWidget(new QLabel(tr("Périphériques de capture :")));
        m_chb_dvc_in=new QCheckBox(tr("Utiliser le périphérique par défaut"), this);
        v_la->addWidget(m_chb_dvc_in);
        m_cb_dvc_in=new QComboBox(this);
        m_cb_dvc_in->addItems(getOALDevices(false));
        int ind=m_cb_dvc_in->findText(getOALCurrentDevice(false));
        if(ind==-1)
        {
            QString d=getOALCurrentDevice(false);
            m_cb_dvc_in->addItem(d);
            m_cb_dvc_in->setCurrentIndex(m_cb_dvc_in->findText(d));
        }
        else
            m_cb_dvc_in->setCurrentIndex(ind);

        h_la->addWidget(m_cb_dvc_in);
        }

    }

    {
        m_voip = new QGroupBox(tr("Paramètres de la VOIP"));
        m_voip->setCheckable(true);
        m_voip->setChecked(m_settings->value(PARAM_VOIP_ENABLED, true).toBool());
        la2->addWidget(m_voip);
        QVBoxLayout* v_la = new QVBoxLayout;
        m_voip->setLayout(v_la);

        v_la->addWidget(new QLabel(tr("Volume de la reception :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_VOIPSound = new QSlider(this);
        m_VOIPSound->setMaximum(1000);
        m_VOIPSound->setOrientation(Qt::Horizontal);
        m_VOIPSound->setValue(static_cast<int>(m_settings->value(PARAM_VOIP_SOUND, 100.f).toFloat()*10));
        connect(m_VOIPSound, SIGNAL(valueChanged(int)), this, SLOT(VOIPSoundSliderChanged(int)));
        m_VOIPSoundSpinBox=new QDoubleSpinBox(this);
        m_VOIPSoundSpinBox->setMaximum(100); m_VOIPSoundSpinBox->setMinimum(0); m_VOIPSoundSpinBox->setDecimals(1);
        m_VOIPSoundSpinBox->setValue(m_settings->value(PARAM_VOIP_SOUND, 100.f).toFloat());
        connect(m_VOIPSoundSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VOIPSoundSpinBoxChanged(double)));
        h_la->addWidget(m_VOIPSound);
        h_la->addWidget(m_VOIPSoundSpinBox);
        }

        v_la->addWidget(new QLabel(tr("Qualité de la VOIP (sortant) :")));

        {
        QHBoxLayout* h_la = new QHBoxLayout;
        v_la->addLayout(h_la);

        m_VOIPQuality = new QSlider(this);
        m_VOIPQuality->setMinimum(1); m_VOIPQuality->setMaximum(100);
        m_VOIPQuality->setOrientation(Qt::Horizontal);
        m_VOIPQuality->setValue(static_cast<int>(m_settings->value(PARAM_VOIP_QUALITY, 4).toFloat()*10));
        connect(m_VOIPQuality, SIGNAL(valueChanged(int)), this, SLOT(VOIPQualitySliderChanged(int)));
        h_la->addWidget(new QLabel(tr("Plus rapide")));
        h_la->addWidget(m_VOIPQuality);
        h_la->addWidget(new QLabel(tr("Plus clair")));
        }
    }

    {
        QGroupBox *gb = new QGroupBox(tr("Bibliothèques de sons"));
        la2->addWidget(gb);

        QPushButton* m_libsListRefresh = new QPushButton(tr("Rafraichir"), this);
        connect(m_libsListRefresh, SIGNAL(pressed()), this, SLOT(refreshLibs()));
        QPushButton* m_libsListLoad = new QPushButton(tr("Charger"), this);
        connect(m_libsListLoad, SIGNAL(pressed()), this, SLOT(loadLibs()));

        QScrollArea* m_libsScroll=new QScrollArea(this);
        {
        QVBoxLayout* v = new QVBoxLayout;
        gb->setLayout(v);
        v->addWidget(m_libsListRefresh);
        v->addWidget(m_libsScroll);
        v->addWidget(m_libsListLoad);
        }
        m_libs_la = new QVBoxLayout;
        {
        gar=new QWidget(this);
        m_libsScroll->setWidget(gar);
        gar->setLayout(m_libs_la);
        }


    }

    {
        m_ok = new QPushButton(tr("Valider"), this);
        m_ok->setDefault(true);
        connect(m_ok, SIGNAL(pressed()), this, SLOT(ok()));
        m_cancel = new QPushButton(tr("Annuler"), this);
        connect(m_cancel, SIGNAL(pressed()), this, SLOT(reject()));
        QHBoxLayout* h_la = new QHBoxLayout;
        h_la->addWidget(m_ok);
        h_la->addWidget(m_cancel);
        la->addLayout(h_la);
    }
    refreshLibs();
}
Exemple #10
0
PermissionsSetupPage::PermissionsSetupPage( QWidget *parent ) : QWidget( parent )
{
	QGridLayout * layout = new QGridLayout( this );
	layout->cellRect( 1, 1 );
	layout->setMargin( 0 );
	layout->setSpacing( 0 );
	QSpacerItem *spacer_top = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( spacer_top, 0, 1 );
	QSpacerItem *spacer_left = new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Minimum );
	layout->addItem( spacer_left, 1, 0 );

	// Logo
	QPixmap permissionsSetupPixmap ( KStandardDirs::locate( "data", "krecipes/pics/dbpermissions.png" ) );
	logo = new QLabel( this );
	logo->setPixmap( permissionsSetupPixmap );
	logo->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
	layout->addWidget( logo, 1, 1, 8, 1, Qt::AlignTop );

	// Spacer to separate the logo
	QSpacerItem *logoSpacer = new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Minimum );
	layout->addItem( logoSpacer, 1, 2 );

	// Explanation Text
	permissionsText = new QLabel( this );
	permissionsText->setText( i18n( "<p>This dialog will allow you to specify a MySQL account that has the necessary permissions to access the Krecipes MySQL database.</p><p><b><font size=\"+1\">Most users that use Krecipes and MySQL for the first time can just leave the default parameters and press \'Next\'.</font></b></p> <p>If you set a MySQL root password before, or you have already permissions as normal user, click on the appropriate option. Otherwise the account 'root' will be used, with no password.</p><p>[For security reasons, we strongly encourage you to setup a MySQL root password if you have not done so yet. Just type as root: mysqladmin password <i>your_password</i>]</p>" ) );
	permissionsText->setWordWrap(true);
	permissionsText->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
	permissionsText->setAlignment( Qt::AlignTop );
	layout->addWidget( permissionsText, 1, 3 );

	// Text spacer
	QSpacerItem *textSpacer = new QSpacerItem( 10, 30, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( textSpacer, 2, 3 );

	// "The user already has permissions" checkbox
	//FIXME: We need to do a workaround to have word wrapping in QCheckBox.
	//see http://bugreports.qt.nokia.com/browse/QTBUG-5370
	KHBox * noSetupContainer = new KHBox;
	noSetupCheckBox = new QCheckBox( noSetupContainer );
	noSetupCheckBox->setObjectName( "noSetupCheckBox" );
	noSetupCheckBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
	ClickableLabel * noSetupLabel = new ClickableLabel(
		i18n( "I have already set the necessary permissions" ),
		noSetupContainer );
	noSetupLabel->setWordWrap( true );
	connect( noSetupLabel, SIGNAL(clicked()), noSetupCheckBox, SLOT(click()) );
	layout->addWidget( noSetupContainer, 3, 3 );

	QSpacerItem *checkBoxSpacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( checkBoxSpacer, 4, 3 );

	// root checkbox
	//FIXME: We need to do a workaround to have word wrapping in QCheckBox.
	//see http://bugreports.qt.nokia.com/browse/QTBUG-5370
	KHBox * rootContainer = new KHBox;
	rootCheckBox = new QCheckBox( rootContainer );
	rootCheckBox->setObjectName( "rootCheckBox" );
	rootCheckBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
	ClickableLabel * rootLabel = new ClickableLabel(
		i18n( "I have already set a MySQL root/admin account" ),
		rootContainer );
	rootLabel->setWordWrap( true );
	connect( rootLabel, SIGNAL(clicked()), rootCheckBox, SLOT(click()) );
	layout->addWidget( rootContainer, 5, 3 );

	QSpacerItem *rootInfoSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( rootInfoSpacer, 6, 3 );

	// MySQL root/admin info
	QGroupBox *rootInfoGBox = new QGroupBox( this );
	QFormLayout *rootInfoLayout = new QFormLayout;
	rootInfoGBox->setTitle( i18n( "MySQL Administrator Account" ) );
	rootInfoGBox->setEnabled( false ); // Disable by default
	// User Entry
	userEdit = new KLineEdit( rootInfoGBox );
	userEdit->setText( "root" );
	rootInfoLayout->addRow( i18nc("@label:textbox Database Username", "Username:"******"Password:" ), passEdit );
	rootInfoGBox->setLayout(rootInfoLayout);
	layout->addWidget( rootInfoGBox, 7, 3 );

	// Bottom spacer
	QSpacerItem *bottomSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding );
	layout->addItem( bottomSpacer, 8, 1 );

	// Connect Signals & slots

	connect( rootCheckBox, SIGNAL( toggled( bool ) ), rootInfoGBox, SLOT( setEnabled( bool ) ) );
	connect( rootCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( rootCheckBoxChanged( bool ) ) );
	connect( noSetupCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( noSetupCheckBoxChanged( bool ) ) );
}
Exemple #11
0
 void setEnabledGroup(bool enabled) {
    group.setEnabled(enabled);
 }
Exemple #12
0
QWidget *ServerDialog::createCheatTab(){
    QVBoxLayout *layout = new QVBoxLayout;

    cheat_enable_checkbox = new QCheckBox(tr("Enable Cheat Menu"));
    cheat_enable_checkbox->setToolTip(tr("This option enables the cheat menu"));
    cheat_enable_checkbox->setChecked(Config.value("Cheat/EnableCheatMenu").toBool());

    QGroupBox *box = new QGroupBox(tr("cheat options"));
    box->setEnabled(cheat_enable_checkbox->isChecked());
    connect(cheat_enable_checkbox, SIGNAL(toggled(bool)), box, SLOT(setEnabled(bool)));
    connect(cheat_enable_checkbox, SIGNAL(toggled(bool)), this, SLOT(doCheat(bool)));

    QVBoxLayout *laybox = new QVBoxLayout;
    Config.beginGroup("Cheat");

    free_choose_generals_checkbox = new QCheckBox(tr("Choose generals freely"));
    free_choose_generals_checkbox->setChecked(Config.FreeChooseGenerals);

    free_choose_cards_checkbox = new QCheckBox(tr("Choose cards freely"));
    free_choose_cards_checkbox->setChecked(Config.FreeChooseCards);

    free_assign_checkbox = new QCheckBox(tr("Assign role and seat freely"));
    free_assign_checkbox->setChecked(Config.value("FreeAssign").toBool());

    free_assign_self_checkbox = new QCheckBox(tr("Assign only your own role"));
    free_assign_self_checkbox->setChecked(Config.FreeAssignSelf);
    free_assign_self_checkbox->setEnabled(free_assign_checkbox->isChecked());
    connect(free_assign_checkbox,SIGNAL(toggled(bool)), free_assign_self_checkbox, SLOT(setEnabled(bool)));

    free_discard_checkbox = new QCheckBox(tr("Regulate freely"));
    free_discard_checkbox->setChecked(Config.value("FreeRegulate").toBool());

    gambling_cards_checkbox = new QCheckBox(tr("Gambling Cards"));
    gambling_cards_checkbox->setChecked(Config.value("GamblingCards").toBool());

    free_change_general_checkbox = new QCheckBox(tr("Change me freely"));
    free_change_general_checkbox->setChecked(Config.value("FreeChange").toBool());

    free_undead_checkbox = new QCheckBox(tr("Undead body"));
    free_undead_checkbox->setChecked(Config.value("FreeUnDead").toBool());

    hands_up_checkbox = new QCheckBox(tr("Hands up"));
    hands_up_checkbox->setChecked(Config.value("HandsUp").toBool());

    Config.endGroup();
    laybox->addWidget(free_choose_generals_checkbox);
    laybox->addWidget(free_choose_cards_checkbox);
    laybox->addWidget(free_assign_checkbox);
    laybox->addWidget(free_assign_self_checkbox);
    laybox->addWidget(free_discard_checkbox);
    laybox->addWidget(gambling_cards_checkbox);
    laybox->addWidget(free_change_general_checkbox);
    laybox->addWidget(free_undead_checkbox);
    laybox->addWidget(hands_up_checkbox);
    box->setLayout(laybox);

    same_checkbox  = new QCheckBox(tr("Enable Same"));
    same_checkbox->setChecked(Config.EnableSame);

    endless_checkbox  = new QCheckBox(tr("Endless Mode"));
    endless_checkbox->setChecked(Config.EnableEndless);
    endless_timebox = new QSpinBox;
    endless_timebox->setRange(1, 100);
    endless_timebox->setValue(Config.value("EndlessTimes", 3).toInt());
    endless_timebox->setToolTip(tr("This box set the swap times"));
    QLabel *endless_lab = new QLabel(tr("Endless swap"));

    layout->addWidget(cheat_enable_checkbox);
    layout->addWidget(box);
    layout->addWidget(same_checkbox);
    layout->addLayout(HLay(endless_checkbox, new QLabel, endless_lab, endless_timebox));
    layout->addStretch();

    QWidget *widget = new QWidget;
    widget->setLayout(layout);

    endless_lab->setVisible(Config.EnableEndless);
    endless_timebox->setVisible(Config.EnableEndless);
    connect(endless_checkbox, SIGNAL(toggled(bool)), endless_lab, SLOT(setVisible(bool)));
    connect(endless_checkbox, SIGNAL(toggled(bool)), endless_timebox, SLOT(setVisible(bool)));

    return widget;
}
Exemple #13
0
ElmDlg::ElmDlg(SpatialDataView* pView, ElmInteractive* pElmInteractive, QWidget* pParent) :
   QDialog(pParent),
   mPixelOffset(1.0, 1.0),
   mMaxDisplayedPixels(10000),
   mCurrentIndex(-1),
   mpElmInteractive(pElmInteractive),
   mpView(pView, SIGNAL_NAME(Subject, Deleted), Slot(this, &ElmDlg::viewDeleted))
{
   // Initialization
   VERIFYNRV(mpView.get() != NULL);
   VERIFYNRV(mpElmInteractive != NULL);
   setWindowTitle(QString::fromStdString("Empirical Line Method - " + mpView->getDisplayName()));
   mpAoiElement.addSignal(SIGNAL_NAME(Subject, Modified), Slot(this, &ElmDlg::aoiModified));
   mpAoiElement.addSignal(SIGNAL_NAME(Subject, Deleted), Slot(this, &ElmDlg::aoiDeleted));

   // "Use Existing Gains/Offsets File" Layout Begin
   mpExistingFileBrowser = new FileBrowser;

   QHBoxLayout* pUseExistingFileLayout = new QHBoxLayout;
   pUseExistingFileLayout->addWidget(mpExistingFileBrowser);

   QGroupBox* pUseExistingFileGroup = new QGroupBox;
   pUseExistingFileGroup->setLayout(pUseExistingFileLayout);
   pUseExistingFileGroup->setEnabled(false);
   // "Use Existing Gains/Offsets File" Layout End


   // Element Layout Begin
   mpElementComboBox = new QComboBox;
   mpElementComboBox->setToolTip("This is the list of available ELM Elements.");
   mpElementComboBox->setWhatsThis("This is the list of available ELM Elements. "
      "ELM elements are simply a group of selected pixels, similar to an AOI, that specify the location "
      "of an object whose signature matches a corresponding input reflectance signature. "
      "At least two elements must be created to run the ELM algorithm.");

   QPushButton* pNewElementButton = new QPushButton("New Element");
   pNewElementButton->setToolTip("Click this button to create a new ELM element.");
   pNewElementButton->setWhatsThis("Click this button to create a new ELM element. "
      "Pixels must be selected and a corresponding signature must be selected for each element. "
      "At least two elements must be created to run the ELM algorithm.");

   QPushButton* pDeleteElementButton = new QPushButton("Delete Element");
   pDeleteElementButton->setToolTip("Click this button to delete the currently selected ELM Element.");
   pDeleteElementButton->setWhatsThis("Click this button to delete the currently selected ELM Element. "
      "The Element will be removed from the list and its pixels will be deleted from the scene.");

   QVBoxLayout* pElementLayout = new QVBoxLayout;
   pElementLayout->addWidget(mpElementComboBox);
   pElementLayout->addWidget(pNewElementButton);
   pElementLayout->addWidget(pDeleteElementButton);

   QGroupBox* pElementGroup = new QGroupBox("Current Element");
   pElementGroup->setLayout(pElementLayout);
   // Element Layout End


   // Pixel Layout Begin
   mpPixelList = new QListWidget;
   mpPixelList->setSortingEnabled(false);
   mpPixelList->setSelectionMode(QAbstractItemView::ExtendedSelection);
   mpPixelList->setToolTip("When pixels in the scene are selected, their coordinates are listed in this box.");
   mpPixelList->setWhatsThis("When pixels in the scene are selected, their coordinates are listed in this box. "
      "To remove pixels from the list, highlight the pixels to remove and click the \"Delete Pixels\" button.");

   QPushButton* pDeletePixelButton = new QPushButton("Delete Pixels");
   pDeletePixelButton->setToolTip("Click this button to exclude the currently selected "
      "pixel(s) in the list from any further processing.");
   pDeletePixelButton->setWhatsThis("Click this button to exclude the currently selected "
      "pixel(s) in the list from any further processing. The pixels will be removed from "
      "the list so that they cannot be considered during execution.");

   QVBoxLayout* pPixelLayout = new QVBoxLayout;
   pPixelLayout->addWidget(mpPixelList);
   pPixelLayout->addWidget(pDeletePixelButton);

   QGroupBox* pPixelGroup = new QGroupBox(QString("Pixels (Up to %1 displayed)").arg(mMaxDisplayedPixels));
   pPixelGroup->setLayout(pPixelLayout);
   // Pixel Layout End


   // Signature Layout Begin
   mpSignature = new QLineEdit;
   mpSignature->setReadOnly(true);

   QPushButton* pSignatureButton = new QPushButton("Change...");
   pSignatureButton->setToolTip("Select the corresponding reflectance signature for the selected Element.");
   pSignatureButton->setWhatsThis("Select the corresponding reflectance signature for the selected Element. ");

   QHBoxLayout* pSignatureLayout = new QHBoxLayout;
   pSignatureLayout->addWidget(mpSignature);
   pSignatureLayout->addWidget(pSignatureButton);

   QGroupBox* pSignatureGroup = new QGroupBox("Signature");
   pSignatureGroup->setLayout(pSignatureLayout);
   // Signature Layout End


   QGridLayout* pCalculateLayout = new QGridLayout;
   pCalculateLayout->addWidget(pElementGroup, 1, 0);
   pCalculateLayout->addWidget(pPixelGroup, 1, 1, 2, 1);
   pCalculateLayout->addWidget(pSignatureGroup, 3, 0, 1, 3);

   QGroupBox* pCalculateGroup = new QGroupBox;
   pCalculateGroup->setLayout(pCalculateLayout);
   pCalculateGroup->setEnabled(false);
   // "Calculate Gains/Offsets" Layout End


   // Button Box Begin
   QDialogButtonBox* pButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
      Qt::Horizontal, this);
   // Button Box End


   // Overall Layout Begin
   mpUseExistingFileRadio = new QRadioButton("Use Existing Gains/Offsets File");
   mpCalculateRadio = new QRadioButton("Calculate Gains/Offsets");

   QVBoxLayout* pOverallLayout = new QVBoxLayout(this);
   pOverallLayout->setMargin(10);
   pOverallLayout->setSpacing(5);
   pOverallLayout->addWidget(mpUseExistingFileRadio);
   pOverallLayout->addWidget(pUseExistingFileGroup);
   pOverallLayout->addWidget(mpCalculateRadio);
   pOverallLayout->addWidget(pCalculateGroup);
   pOverallLayout->addWidget(pButtonBox);
   // Overall Layout End


   // Make GUI connections
   VERIFYNRV(connect(mpUseExistingFileRadio, SIGNAL(toggled(bool)), pUseExistingFileGroup, SLOT(setEnabled(bool))));
   VERIFYNRV(connect(mpCalculateRadio, SIGNAL(toggled(bool)), pCalculateGroup, SLOT(setEnabled(bool))));
   VERIFYNRV(connect(mpElementComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(currentIndexChanged(int))));
   VERIFYNRV(connect(pNewElementButton, SIGNAL(clicked()), this, SLOT(newElement())));
   VERIFYNRV(connect(pDeleteElementButton, SIGNAL(clicked()), this, SLOT(deleteElement())));
   if (ElmCore::hasSettingElmHelp())
   {
      pButtonBox->addButton(QDialogButtonBox::Help);
      VERIFYNRV(connect(pButtonBox, SIGNAL(helpRequested()), this, SLOT(help())));
   }
   VERIFYNRV(connect(pButtonBox, SIGNAL(accepted()), this, SLOT(accept())));
   VERIFYNRV(connect(pButtonBox, SIGNAL(rejected()), this, SLOT(reject())));
   VERIFYNRV(connect(pDeletePixelButton, SIGNAL(clicked()), this, SLOT(deletePixels())));
   VERIFYNRV(connect(pSignatureButton, SIGNAL(clicked()), this, SLOT(selectSignature())));


   // AOI toolbar defaults
   Service<DesktopServices> pDesktopServices;
   pDesktopServices->setAoiSelectionTool(RECTANGLE_OBJECT, DRAW);


   // Create an initial element
   newElement();


   // Enable the appropriate GroupBox
   const QString defaultFilename = QString::fromStdString(mpElmInteractive->getDefaultGainsOffsetsFilename());
   if (QFile::exists(defaultFilename) == true)
   {
      mpUseExistingFileRadio->setChecked(true);
      mpExistingFileBrowser->setFilename(defaultFilename);
   }
   else
   {
      mpCalculateRadio->setChecked(true);
   }
}