Example #1
0
KoTagFilterWidget::KoTagFilterWidget(QWidget* parent): QWidget(parent)
,d( new Private())
{
    d->tagSearchBarTooltip_saving_disabled = i18nc (
            "@info:tooltip",
            "<qt>Entering search terms here will add to, or remove resources from the current tag view."
            "<para>To filter based on the partial, case insensitive name of a resource:<br>"
            "<icode>partialname</icode> or <icode>!partialname</icode>.</para>"
            "<para>In-/exclusion of other tag sets:<br>"
            "<icode>[Tagname]</icode> or <icode>![Tagname]</icode>.</para>"
            "<para>Case sensitive and full name matching in-/exclusion:<br>"
            "<icode>\"ExactMatch\"</icode> or <icode>!\"ExactMatch\"</icode>.</para>"
            "Filter results cannot be saved for the <interface>All Presets</interface> view.<br>"
            "In this view, pressing <interface>Enter</interface> or clearing the filter box will restore all items.<br>"
            "Create and/or switch to a different tag if you want to save filtered resources into named sets.</qt>"
            );

    d->tagSearchBarTooltip_saving_enabled = i18nc (
            "@info:tooltip",
            "<qt>Entering search terms here will add to, or remove resources from the current tag view."
            "<para>To filter based on the partial, case insensitive name of a resource:<br>"
            "<icode>partialname</icode> or <icode>!partialname</icode>.</para>"
            "<para>In-/exclusion of other tag sets:<br>"
            "<icode>[Tagname]</icode> or <icode>![Tagname]</icode>.</para>"
            "<para>Case sensitive and full name matching in-/exclusion:<br>"
            "<icode>\"ExactMatch\"</icode> or <icode>!\"ExactMatch\"</icode>.</para>"
            "Pressing <interface>Enter</interface> or clicking the <interface>Save</interface> button will save the changes.</qt>"
            );

    QGridLayout* filterBarLayout = new QGridLayout;


    d->tagSearchLineEdit = new KLineEdit(this);
    d->tagSearchLineEdit->setClearButtonEnabled(true);
    d->tagSearchLineEdit->setPlaceholderText(i18n("Enter resource filters here"));
    d->tagSearchLineEdit->setToolTip(d->tagSearchBarTooltip_saving_disabled);
    d->tagSearchLineEdit->setEnabled(true);

    filterBarLayout->setSpacing(0);
    filterBarLayout->setMargin(0);
    filterBarLayout->setColumnStretch(0, 1);
    filterBarLayout->addWidget(d->tagSearchLineEdit, 0, 0);

    d->tagSearchSaveButton = new QPushButton(this);
    d->tagSearchSaveButton->setIcon(koIcon("media-floppy"));
    d->tagSearchSaveButton->setToolTip(i18nc("@info:tooltip", "<qt>Save the currently filtered set as the new members of the current tag.</qt>"));
    d->tagSearchSaveButton->setEnabled(false);

    filterBarLayout->addWidget(d->tagSearchSaveButton, 0, 1);

    connect(d->tagSearchSaveButton, SIGNAL(pressed()),
            this, SLOT(onSaveButtonClicked()));
    connect(d->tagSearchLineEdit, SIGNAL(returnPressed()),
            this, SLOT(onSaveButtonClicked()));
    connect(d->tagSearchLineEdit, SIGNAL(textChanged(QString)),
            this, SLOT(onTextChanged(QString)));
    allowSave(false);
    this->setLayout(filterBarLayout);

}
QWidget *ptFilter_ChannelMixer::doCreateGui() {
  auto guiBody = new QWidget;
  Ui_ChannelMixerForm form;

  form.setupUi(guiBody);
  this->initDesignerGui(guiBody);
  FMixerNameStore.setAssocLabel(form.MixernameLabel);

  form.ChannelMatrixGrid->setVerticalSpacing(6);
  form.ChannelMatrixGrid->setHorizontalSpacing(6);

  connect(form.LoadButton, SIGNAL(clicked()), SLOT(onLoadButtonClicked()));
  connect(form.SaveButton, SIGNAL(clicked()), SLOT(onSaveButtonClicked()));

  connect(form.Red2Red,     SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Red2Green,   SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Red2Blue,    SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Green2Red,   SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Green2Green, SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Green2Blue,  SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Blue2Red,    SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Blue2Green,  SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));
  connect(form.Blue2Blue,   SIGNAL(valueChanged(QString,QVariant)), SLOT(onValueChanged(QString,QVariant)));

  return guiBody;
}
EditContactEntryDialog::EditContactEntryDialog(data::ptr<data::ContactEntry> contactEntry, QList<data::ptr<data::ContactGroup>> contactGroups, QWidget* parent) :
    QDialog(parent),
    ui(new Ui::EditContactEntryDialog),
    m_contactEntry(contactEntry),
    m_contactGroups(contactGroups)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);

    VERIFY(connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject())));
    VERIFY(connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onSaveButtonClicked())));

    ui->nameEdit->setText(contactEntry->getName());
    ui->nicknameEdit->setText(contactEntry->getNickname());
    ui->fileAsEdit->setText(contactEntry->getFileAs());
    ui->companyEdit->setText(contactEntry->getOrgName());
    ui->jobTitleEdit->setText(contactEntry->getOrgTitle());

    for (auto contactGroup : contactGroups)
    {
        /*if (contactGroup->isSystemGroup())
        {
            continue;
        }*/
        QCheckBox* checkBox = new QCheckBox(ui->groupsGroupBox);
        checkBox->setText(contactGroup->getTitle());
        ui->groupsGroupBoxLayout->insertWidget(ui->groupsGroupBoxLayout->count() - 1, checkBox);
        checkBox->setChecked(contactEntry->getContactGroups().contains(contactGroup));
        m_checkBoxesToContactGroups.insert(checkBox, contactGroup);
    }

    initPropertiesTreeWidget();
}
Example #4
0
/******************************************************************************
 * Slot called when the Save As button has been clicked.
 *
 * Open a user interface dialog to save data in file.
 * Currently, format is XML document.
 ******************************************************************************/
void Qtfe::onSaveAsButtonClicked()
{
	// Open a user interface dialog to save file
	QString name = QFileDialog::getSaveFileName( 0, QString(), QString(), "*.xml" );
	if ( name.isEmpty() )
	{
		return;
	}
	
	// Update member variables
	_filename = name;
	_filenameLineEdit->setText( _filename );

	// Serialize data in file
	onSaveButtonClicked();
}
Example #5
0
/******************************************************************************
 * Constructor
 *
 * @param pParent parent widget
 * @param pFlags window flags
 ******************************************************************************/
Qtfe::Qtfe( QWidget* pParent, Qt::WindowFlags pFlags )
:	QWidget( pParent, pFlags )
,	_channels()
,	_outputs()
,	_filename()
{
	// Setup the Ui
	setupUi( this );

	// Add a layout to add channels and outputs widget in the transfer function container (groupbox)
	QVBoxLayout* layout = new QVBoxLayout( _transferFunctionGroupBox );

	// Do connections
	QObject::connect( _savePushButton, SIGNAL( clicked() ), this, SLOT( onSaveButtonClicked() ) );
	QObject::connect( _saveAsPushButton, SIGNAL( clicked() ), this, SLOT( onSaveAsButtonClicked() ) );
	QObject::connect( _loadToolButton, SIGNAL( clicked() ), this, SLOT( onLoadButtonClicked() ) );
	QObject::connect( _quitPushButton, SIGNAL( clicked() ), this, SLOT( onQuitButtonClicked() ) );
}