Esempio n. 1
0
void FileChooser::clear()
{
    m_filename = String();
#ifdef OWB_ICON_SUPPORT
    m_icon = chooseIcon(m_filename);
#endif //OWB_ICON_SUPPORT
}
void FileChooser::chooseFile(const String& filename)
{
    if (m_filename == filename)
        return;
    m_filename = filename;
    m_icon = chooseIcon(filename);
    if (m_client)
        m_client->valueChanged();
}
Esempio n. 3
0
void FileChooser::chooseFile(const String& filename)
{
    if (m_filename == filename)
        return;
    m_filename = filename;
#ifdef OWB_ICON_SUPPORT
    m_icon = chooseIcon(filename);
#endif //OWB_ICON_SUPPORT
    if (m_client)
        m_client->valueChanged();
}
Esempio n. 4
0
Structureelement::Structureelement(QString name, QUrl url, int time, qint32 size, QString cid, MyItemType typeEX)
    :QStandardItem(name),
     included(true),
     url(url),
     time(QDateTime::fromMSecsSinceEpoch(qint64(1000) * time)),
     size(size),
     typeEX(typeEX),
     cid(cid)
{
    synchronised = NOT_SYNCHRONISED;
    chooseIcon();
}
Esempio n. 5
0
EditSearchEngine::EditSearchEngine(const QString &title, QWidget* parent)
    : QDialog(parent)
    , ui(new Ui::EditSearchEngine)
{
    setWindowTitle(title);
    ui->setupUi(this);

    connect(ui->iconFromFile, SIGNAL(clicked()), this, SLOT(chooseIcon()));

    ui->buttonBox->setFocus();

    setFixedHeight(sizeHint().height());
}
Esempio n. 6
0
// Überladener Konstruktor für Nachrichtenelemente, welche nicht heruntergeladen werden können.
Structureelement::Structureelement(QString body, QString topic, QString author, int time, QString cid, MyItemType typeEX)
    :QStandardItem(topic),
     included(true),
     body(body),
     topic(topic),
     author(author),
     time(QDateTime::fromMSecsSinceEpoch(qint64(1000) * time)),
     typeEX(typeEX),
     cid(cid)
{
    synchronised = NOT_SYNCHRONISED;
    chooseIcon();
}
Esempio n. 7
0
QgsAttributeActionDialog::QgsAttributeActionDialog( QgsAttributeAction* actions,
    const QgsFields& fields,
    QWidget* parent ):
    QWidget( parent ), mActions( actions )
{
  setupUi( this );
  QHeaderView *header = attributeActionTable->horizontalHeader();
  header->setHighlightSections( false );
  header->setStretchLastSection( true );
  attributeActionTable->setColumnWidth( 0, 100 );
  attributeActionTable->setColumnWidth( 1, 230 );
  attributeActionTable->setCornerButtonEnabled( false );

  connect( attributeActionTable, SIGNAL( itemSelectionChanged() ),
           this, SLOT( itemSelectionChanged() ) );
  connect( actionName, SIGNAL( textChanged( QString ) ), this, SLOT( updateButtons() ) );
  connect( actionAction, SIGNAL( textChanged() ), this, SLOT( updateButtons() ) );

  connect( moveUpButton, SIGNAL( clicked() ), this, SLOT( moveUp() ) );
  connect( moveDownButton, SIGNAL( clicked() ), this, SLOT( moveDown() ) );
  connect( removeButton, SIGNAL( clicked() ), this, SLOT( remove() ) );
  connect( addDefaultActionsButton, SIGNAL( clicked() ), this, SLOT( addDefaultActions() ) );

  connect( browseButton, SIGNAL( clicked() ), this, SLOT( browse() ) );
  connect( insertButton, SIGNAL( clicked() ), this, SLOT( insert() ) );
  connect( updateButton, SIGNAL( clicked() ), this, SLOT( update() ) );
  connect( insertFieldButton, SIGNAL( clicked() ), this, SLOT( insertField() ) );
  connect( insertExpressionButton, SIGNAL( clicked() ), this, SLOT( insertExpression() ) );

  connect( chooseIconButton, SIGNAL( clicked() ), this, SLOT( chooseIcon() ) );

  init();
  // Populate the combo box with the field names. Will the field names
  // change? If so, they need to be passed into the init() call, or
  // some access to them retained in this class.
  for ( int idx = 0; idx < fields.count(); ++idx )
    fieldComboBox->addItem( fields[idx].name() );
}
Esempio n. 8
0
CustomActionDialog::CustomActionDialog(QWidget* parent, Qt::WFlags fl)
    : QDialog(parent, fl)
{
    setWindowTitle(tr("MantidPlot") + " - " + tr("Add Custom Action"));

    itemsList = new QListWidget();
    itemsList->setSelectionMode(QAbstractItemView::SingleSelection);
	itemsList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
	itemsList->setSpacing(2);

    QGroupBox *gb1 = new QGroupBox();
	gb1->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred));

	QGridLayout *gl1 = new QGridLayout(gb1);

	gl1->addWidget(new QLabel(tr("Folder")), 0, 0);
	folderBox = new QLineEdit();

	gl1->addWidget(folderBox, 0, 1);
	folderBtn = new QPushButton(tr("Choose &Folder"));
	gl1->addWidget(folderBtn, 0, 2);

	gl1->addWidget(new QLabel(tr("Script File")), 1, 0);
	fileBox = new QLineEdit();

	gl1->addWidget(fileBox, 1, 1);
	fileBtn = new QPushButton(tr("Choose &Script"));
	gl1->addWidget(fileBtn, 1, 2);

	gl1->addWidget(new QLabel(tr("Icon")), 2, 0);
	iconBox = new QLineEdit();
	gl1->addWidget(iconBox, 2, 1);
	iconBtn = new QPushButton(tr("Choose &Icon"));
	gl1->addWidget(iconBtn, 2, 2);

	gl1->addWidget(new QLabel(tr("Text")), 3, 0);
	textBox = new QLineEdit();
	gl1->addWidget(textBox, 3, 1);

	gl1->addWidget(new QLabel(tr("Tool Tip Text")), 4, 0);
	toolTipBox = new QLineEdit();
	gl1->addWidget(toolTipBox, 4, 1);

	gl1->addWidget(new QLabel(tr("Shortcut")), 5, 0);
	shortcutBox = new QLineEdit();
	gl1->addWidget(shortcutBox, 5, 1);

    menuBtn = new QRadioButton(tr("&Menu"));
    gl1->addWidget(menuBtn, 6, 0);
    menuBox = new QComboBox();
    gl1->addWidget(menuBox, 6, 1);

    toolBarBtn = new QRadioButton(tr("&Tool Bar"));
    toolBarBtn->setChecked(true);
    gl1->addWidget(toolBarBtn, 7, 0);
    toolBarBox = new QComboBox();
    gl1->addWidget(toolBarBox, 7, 1);
    gl1->setRowStretch(8, 1);
	gl1->setColumnStretch(1, 10);

	QHBoxLayout * bottomButtons = new QHBoxLayout();
	bottomButtons->addStretch();
	buttonSave = new QPushButton(tr("&Save"));
	buttonSave->setAutoDefault( true );
	bottomButtons->addWidget(buttonSave);
	
	buttonAdd = new QPushButton(tr("&Add"));
	buttonAdd->setAutoDefault( true );
	bottomButtons->addWidget(buttonAdd);

	buttonRemove = new QPushButton(tr("&Remove"));
	buttonRemove->setAutoDefault(true);
	bottomButtons->addWidget(buttonRemove);

	buttonCancel = new QPushButton(tr("&Close"));
	buttonCancel->setAutoDefault( true );
	bottomButtons->addWidget( buttonCancel );

	QHBoxLayout *vl = new QHBoxLayout();
	vl->addWidget(itemsList);
	vl->addWidget(gb1);

    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    mainLayout->addLayout(vl);
	mainLayout->addLayout(bottomButtons);

	init();

	QShortcut *accelRemove = new QShortcut(QKeySequence(Qt::Key_Delete), this);
	connect(accelRemove, SIGNAL(activated()), this, SLOT(removeAction()));

	connect(buttonSave, SIGNAL(clicked()), this, SLOT(saveCurrentAction()));
	connect(buttonAdd, SIGNAL(clicked()), this, SLOT(addAction()));
	connect(buttonRemove, SIGNAL(clicked()), this, SLOT(removeAction()));
	connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
	connect(iconBtn, SIGNAL(clicked()), this, SLOT(chooseIcon()));
	connect(fileBtn, SIGNAL(clicked()), this, SLOT(chooseFile()));
	connect(folderBtn, SIGNAL(clicked()), this, SLOT(chooseFolder()));
	connect(itemsList, SIGNAL(currentRowChanged(int)), this, SLOT(setCurrentAction(int)));
}
FileChooser::FileChooser(FileChooserClient* client, const String& filename)
    : m_client(client)
    , m_filename(filename)
    , m_icon(chooseIcon(filename))
{
}
void FileChooser::clear()
{
    m_filename = String();
    m_icon = chooseIcon(m_filename);
}