Esempio n. 1
0
OutputManager::OutputManager(QWidget* parent, Qt::WindowFlags flags)
	: QWidget(parent, flags)
{
	/* Create a new layout for this widget */
	new QVBoxLayout(this);

	/* Toolbar */
	m_toolbar = new QToolBar(tr("Output Manager"), this);
	m_toolbar->addAction(QIcon(":/edit.png"), tr("Edit Mapping"),
			     this, SLOT(slotEditClicked()));
	layout()->addWidget(m_toolbar);

	/* Tree */
	m_tree = new QTreeWidget(this);
	layout()->addWidget(m_tree);
	m_tree->setRootIsDecorated(false);
	m_tree->setItemsExpandable(false);
	m_tree->setSortingEnabled(false);
	m_tree->setAllColumnsShowFocus(true);

	QStringList columns;
	columns << tr("Universe") << tr("Plugin") << tr("Output");
	m_tree->setHeaderLabels(columns);

	connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
		this, SLOT(slotEditClicked()));

	updateTree();
}
Esempio n. 2
0
void ChaserEditor::init()
{
  setCaption("Chaser Editor");
  resize(520, 300);
  setFixedSize(520, 300);

  m_nameLabel = new QLabel(this);
  m_nameLabel->setGeometry(10, 10, 130, 30);
  m_nameLabel->setText("Chaser Name");

  m_nameEdit = new QLineEdit(this);
  m_nameEdit->setGeometry(130, 10, 230, 30);
  m_nameEdit->setText(m_function->name());
  m_nameEdit->setFocus();
  m_nameEdit->setSelection(0, m_function->name().length());

  m_functionList = new QListView(this);
  m_functionList->setGeometry(10, 50, 350, 230);
  m_functionList->setSorting(-1);
  m_functionList->addColumn("#");
  m_functionList->addColumn("Device");
  m_functionList->addColumn("Function");
  m_functionList->setAllColumnsShowFocus(true);
  m_functionList->setResizeMode(QListView::LastColumn);

  m_raiseButton = new QToolButton(UpArrow, this);
  m_raiseButton->setGeometry(360, 50, 20, 115);
  connect(m_raiseButton, SIGNAL(clicked()), this, SLOT(slotRaiseClicked()));

  m_lowerButton = new QToolButton(DownArrow, this);
  m_lowerButton->setGeometry(360, 165, 20, 115);
  connect(m_lowerButton, SIGNAL(clicked()), this, SLOT(slotLowerClicked()));
  
  m_addButton = new QPushButton(this);
  m_addButton->setText("&Add Step");
  m_addButton->setGeometry(390, 50, 120, 30);
  connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddClicked()));

  m_removeButton = new QPushButton(this);
  m_removeButton->setText("&Remove step");
  m_removeButton->setGeometry(390, 90, 120, 30);
  connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));

  m_editButton = new QPushButton(this);
  m_editButton->setText("&Edit step");
  m_editButton->setGeometry(390, 130, 120, 30);
  connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditClicked()));

  m_ok = new QPushButton(this);
  m_ok->setText("&OK");
  m_ok->setGeometry(390, 220, 120, 30);
  connect(m_ok, SIGNAL(clicked()), this, SLOT(slotOKClicked()));

  m_cancel = new QPushButton(this);
  m_cancel->setText("&Cancel");
  m_cancel->setGeometry(390, 260, 120, 30);
  connect(m_cancel, SIGNAL(clicked()), this, SLOT(slotCancelClicked()));

  addItems();
}
Esempio n. 3
0
ConfigureMIDIOut::ConfigureMIDIOut(QWidget* parent, MIDIOut* plugin)
	: QDialog(parent)
{
	Q_ASSERT(plugin != NULL);
	m_plugin = plugin;

	/* Setup UI controls */
	setupUi(this);
	m_list->header()->setResizeMode(QHeaderView::ResizeToContents);

	connect(m_refreshButton, SIGNAL(clicked()),
		this, SLOT(slotRefreshClicked()));
	connect(m_editButton, SIGNAL(clicked()),
		this, SLOT(slotEditClicked()));
	connect(m_list, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
		this, SLOT(slotEditClicked()));

	/* Listen to device additions/removals */
	connect(plugin, SIGNAL(deviceRemoved(MIDIDevice*)),
		this, SLOT(slotDeviceRemoved(MIDIDevice*)));
	connect(plugin, SIGNAL(deviceAdded(MIDIDevice*)),
		this, SLOT(slotDeviceAdded(MIDIDevice*)));

	refreshList();
}
Esempio n. 4
0
BusManager::BusManager(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f)
{
	Q_ASSERT(parent != NULL);

	/* Create a new layout for this widget */
	new QVBoxLayout(this);

	/* Toolbar */
	m_toolbar = new QToolBar(tr("Bus Manager"), this);
	m_toolbar->addAction(QIcon(":/edit.png"), tr("Edit bus name"),
			     this, SLOT(slotEditClicked()));
	layout()->addWidget(m_toolbar);

	/* Tree */
	m_tree = new QTreeWidget(this);
	layout()->addWidget(m_tree);
	m_tree->setRootIsDecorated(false);
	m_tree->setItemsExpandable(false);
	m_tree->setSortingEnabled(false);
	m_tree->setAllColumnsShowFocus(true);
	m_tree->header()->setResizeMode(QHeaderView::ResizeToContents);

	QStringList columns;
	columns << tr("Bus ID") << tr("Name");
	m_tree->setHeaderLabels(columns);

	fillTree();
}
Esempio n. 5
0
KWMailMergeConfigDialog::KWMailMergeConfigDialog(QWidget *parent,KWMailMergeDataBase *db)
    : KDialogBase(Plain, i18n( "Mail Merge Setup" ), Close, Close, parent, "", true )
{
    db_=db;
    QWidget *back = plainPage();
    QVBoxLayout *layout=new QVBoxLayout(back);
//    QVBox *back = new QVBox( page );
    layout->setSpacing( KDialog::spacingHint() );

//    QVBox *row1 = new QVBox( back );
//    row1->setSpacing( KDialog::spacingHint() );

    QLabel *l = new QLabel( i18n( "Datasource:" ),back );
//    l->setMaximumHeight( l->sizeHint().height() );
    layout->addWidget(l);

    QHBox *row1=new QHBox(back);
    layout->addWidget(row1);
    row1->setSpacing( KDialog::spacingHint() );
    edit=new QPushButton(i18n("Edit Current..."),row1);
    create=new QPushButton(i18n("Create New..."),row1);
    open=new QPushButton(i18n("Open Existing..."),row1);

    KSeparator *separator1 = new KSeparator(back);
    layout->addWidget(separator1);

    l = new QLabel( i18n( "Merging:" ),back );
    layout->addWidget(l);
//  l->setMaximumHeight( l->sizeHint().height() );
    QHBox *row2=new QHBox(back);
    layout->addWidget(row2);
    row2->setSpacing( KDialog::spacingHint() );
    preview=new QPushButton(i18n("Print Preview..."),row2);
    document=new QPushButton(i18n("Create New Document"),row2);
    document->hide();
    (void) new QWidget(row2);
    layout->addStretch();

    KSeparator *separator2 = new KSeparator(back);
    layout->addWidget(separator2);

    enableDisableEdit();

    connect(edit,SIGNAL(clicked()), this, SLOT(slotEditClicked()));
    connect(create,SIGNAL(clicked()),this,SLOT(slotCreateClicked()));
    connect(open,SIGNAL(clicked()),this,SLOT(slotOpenClicked()));
    connect(preview,SIGNAL(clicked()),this,SLOT(slotPreviewClicked()));
    connect(document,SIGNAL(clicked()),this,SLOT(slotDocumentClicked()));
}
Esempio n. 6
0
int BusManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotEditClicked(); break;
        case 1: slotItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
Esempio n. 7
0
InputManager::InputManager(QWidget* parent, Qt::WindowFlags flags)
    : QWidget(parent, flags)
{
    /* Create a new layout for this widget */
    new QVBoxLayout(this);

    /* Toolbar */
    m_toolbar = new QToolBar(tr("Input Manager"), this);
    m_toolbar->addAction(QIcon(":/edit.png"), tr("Edit Mapping"),
                         this, SLOT(slotEditClicked()));
    layout()->addWidget(m_toolbar);

    /* Tree */
    m_tree = new QTreeWidget(this);
    layout()->addWidget(m_tree);
    m_tree->setRootIsDecorated(false);
    m_tree->setItemsExpandable(false);
    m_tree->setSortingEnabled(false);
    m_tree->setAllColumnsShowFocus(true);
    m_tree->header()->setResizeMode(QHeaderView::ResizeToContents);

    QStringList columns;
    columns << tr("Universe") << tr("Plugin") << tr("Input") << tr("Profile")
            << tr("Editor universe");
    m_tree->setHeaderLabels(columns);

    connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotEditClicked()));

    /* Timer that clears the input data icon after a while */
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));

    /* Listen to input map's input data signals */
    connect(_app->inputMap(), SIGNAL(inputValueChanged(quint32,quint32,uchar)),
            this, SLOT(slotInputValueChanged(quint32,quint32,uchar)));

    /* Listen to document changes */
    connect(_app, SIGNAL(documentChanged(Doc*)),
            this, SLOT(slotDocumentChanged(Doc*)));
    /* Use the initial document */
    slotDocumentChanged(_app->doc());

    /* Listen to plugin configuration changes */
    connect(_app->inputMap(), SIGNAL(pluginConfigurationChanged(const QString&)),
            this, SLOT(slotPluginConfigurationChanged()));
}
Esempio n. 8
0
int ConfigureMIDIInput::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotDeviceAdded((*reinterpret_cast< MIDIDevice*(*)>(_a[1]))); break;
        case 1: slotDeviceRemoved((*reinterpret_cast< MIDIDevice*(*)>(_a[1]))); break;
        case 2: slotRefreshClicked(); break;
        case 3: slotEditClicked(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Esempio n. 9
0
KeyEditForm::KeyEditForm( QWidget *parent, const char *name )
    : KeyEditFormBase( parent, name )
{
    m_listView->setSorting( -1 );
    m_removeButton->setEnabled( false );
    m_editButton->setEnabled( false );

    QObject::connect( m_addButton, SIGNAL(clicked()),
                      this, SLOT(slotAddClicked()) );
    QObject::connect( m_removeButton, SIGNAL(clicked()),
                      this, SLOT(slotRemoveClicked()) );
    QObject::connect( m_editButton, SIGNAL(clicked()),
                      this, SLOT(slotEditClicked()) );

    QObject::connect( m_listView, SIGNAL(selectionChanged(QListViewItem *)),
                      this, SLOT(slotSelectionChanged(QListViewItem*)) );
}
Esempio n. 10
0
int VCXYPadProperties::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotAddClicked(); break;
        case 1: slotRemoveClicked(); break;
        case 2: slotEditClicked(); break;
        case 3: slotSelectionChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 4: accept(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
    updateTopLevelItems();

    viewLayout->addWidget(m_swordPathListBox);

    QVBoxLayout* buttonLayout = new QVBoxLayout();

    m_addButton = new QPushButton(tr("Add..."), this);
    m_addButton->setToolTip(tr("Add new folder"));
    m_addButton->setIcon(DU::getIcon(CResMgr::bookshelfmgr::paths::add_icon));
    connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
    buttonLayout->addWidget(m_addButton);

    m_editButton = new QPushButton(tr("Edit..."), this);
    m_editButton->setToolTip(tr("Edit the selected folder"));
    m_editButton->setIcon(DU::getIcon(CResMgr::bookshelfmgr::paths::edit_icon));
    connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditClicked()));
    buttonLayout->addWidget(m_editButton);

    m_removeButton = new QPushButton(tr("Remove"), this);
    m_removeButton->setToolTip(tr("Remove the selected folder"));
    m_removeButton->setIcon(DU::getIcon(CResMgr::bookshelfmgr::paths::remove_icon));
    connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));
    buttonLayout->addWidget(m_removeButton);

    QSpacerItem* spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
    buttonLayout->addItem(spacerItem);

    viewLayout->addLayout(buttonLayout);
    mainLayout->addLayout(viewLayout);

    QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
Esempio n. 12
0
InputProfileEditor::InputProfileEditor(QWidget* parent, QLCInputProfile* profile,
                                       InputOutputMap *ioMap)
    : QDialog(parent)
    , m_ioMap(ioMap)
    , m_wizardActive(false)
    , m_latestItem(NULL)
{
    Q_ASSERT(ioMap != NULL);

    setupUi(this);

    /* Connect the buttons to slots */
    connect(m_addButton, SIGNAL(clicked()),
            this, SLOT(slotAddClicked()));
    connect(m_removeButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveClicked()));
    connect(m_editButton, SIGNAL(clicked()),
            this, SLOT(slotEditClicked()));
    connect(m_wizardButton, SIGNAL(clicked(bool)),
            this, SLOT(slotWizardClicked(bool)));
    connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotItemClicked(QTreeWidgetItem*,int)));
    connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
            this, SLOT(slotEditClicked()));
    connect(m_movementCombo, SIGNAL(currentIndexChanged(int)),
            this, SLOT(slotMovementComboChanged(int)));
    connect(m_sensitivitySpin, SIGNAL(valueChanged(int)),
            this, SLOT(slotSensitivitySpinChanged(int)));

    /* Listen to input data */
    connect(m_ioMap, SIGNAL(inputValueChanged(quint32, quint32, uchar, const QString&)),
            this, SLOT(slotInputValueChanged(quint32, quint32, uchar, const QString&)));

    if (profile == NULL)
    {
        m_profile = new QLCInputProfile();
    }
    else
    {
        m_profile = new QLCInputProfile(*profile);
        if ((QFile::permissions(m_profile->path()) &
                QFile::WriteUser) == 0)
        {
            QMessageBox::warning(this, tr("File not writable"),
                                 tr("You do not have permission to write to "
                                    "the file %1. You might not be able to "
                                    "save your modifications to the profile.")
                                 .arg(QDir::toNativeSeparators(
                                          m_profile->path())));
        }
    }

    /* Profile manufacturer & model */
    m_manufacturerEdit->setText(m_profile->manufacturer());
    m_modelEdit->setText(m_profile->model());

    m_behaviourBox->hide();
    /* Fill up the tree with profile's channels */
    fillTree();

    /* Timer that clears the input data icon after a while */
    m_timer = new QTimer(this);
    m_timer->setSingleShot(true);
    connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimerTimeout()));

    QSettings settings;
    QVariant var = settings.value(SETTINGS_GEOMETRY);
    if (var.isValid() == true)
        restoreGeometry(var.toByteArray());
    AppUtil::ensureWidgetIsVisible(this);
}
Esempio n. 13
0
BtInstallPathDialog::BtInstallPathDialog() {
    namespace DU = util::directory;

    setWindowTitle(tr("Bookshelf Folders"));

    QVBoxLayout *mainLayout;
    QHBoxLayout *viewLayout;

    mainLayout = new QVBoxLayout(this);
    viewLayout = new QHBoxLayout();

    QString l1 = tr("Works can be installed in one or more folders. After setting up folders here you can choose one of them in Install page.");
    /// \bug The following string has an extra space character:
    QString l2 = tr("BibleTime and the SWORD library find the works from  all of these folders. If a folder is removed here it still exists in the system with all the works in it.");

    QLabel* mainLabel = util::tool::explanationLabel(this,
                        tr("Configure bookshelf folders"), l1 + QString("<small><br/><br/>") + l2 + QString("</small>"));
    mainLayout->addWidget(mainLabel);

    QString swordConfPath = BtInstallBackend::swordConfigFilename();
    /// \todo After releasing 2.4, change the following line to: QLabel *confPathLabel = new QLabel(tr("Configuration file for the folders is: <b>%1</b>").arg(swordConfPath), this);
    QLabel* confPathLabel = new QLabel(tr("Configuration file for the folders is: ").append("<b>%1</b>").arg(swordConfPath), this);
    confPathLabel->setWordWrap(true);
    mainLayout->addWidget(confPathLabel);


    m_swordPathListBox = new QTreeWidget(this);
    m_swordPathListBox->setHeaderHidden(true);

    QString rwfolderitem(tr("Folders where new works can be installed"));
    m_writableItem = new QTreeWidgetItem(m_swordPathListBox, QStringList(rwfolderitem));;
    m_writableItem->setFlags(Qt::ItemIsEnabled);
    m_readableItem = new QTreeWidgetItem(m_swordPathListBox, QStringList(tr("Read-only folders")));;
    m_readableItem->setFlags(Qt::ItemIsEnabled);
    m_nonexistingItem = new QTreeWidgetItem(m_swordPathListBox, QStringList(tr("Nonexistent folders")));;
    m_nonexistingItem->setFlags(Qt::ItemIsEnabled);

    QStringList targets = BtInstallBackend::targetList();

    Q_FOREACH(QString const & pathname, targets)
        addPathToList(pathname);
    updateTopLevelItems();

    viewLayout->addWidget(m_swordPathListBox);

    QVBoxLayout* buttonLayout = new QVBoxLayout();

    m_addButton = new QPushButton(tr("&Add..."), this);
    m_addButton->setToolTip(tr("Add new folder"));
    m_addButton->setIcon(CResMgr::bookshelfmgr::paths::icon_add());
    connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
    buttonLayout->addWidget(m_addButton);

    m_editButton = new QPushButton(tr("&Edit..."), this);
    m_editButton->setToolTip(tr("Edit the selected folder"));
    m_editButton->setIcon(CResMgr::bookshelfmgr::paths::icon_edit());
    connect(m_editButton, SIGNAL(clicked()), this, SLOT(slotEditClicked()));
    buttonLayout->addWidget(m_editButton);

    m_removeButton = new QPushButton(tr("&Remove"), this);
    m_removeButton->setToolTip(tr("Remove the selected folder"));
    m_removeButton->setIcon(CResMgr::bookshelfmgr::paths::icon_remove());
    connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));
    buttonLayout->addWidget(m_removeButton);

    QSpacerItem* spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
    buttonLayout->addItem(spacerItem);

    viewLayout->addLayout(buttonLayout);
    mainLayout->addLayout(viewLayout);

    QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
    buttonBox->setOrientation(Qt::Horizontal);
    buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::NoButton | QDialogButtonBox::Ok);
    message::prepareDialogBox(buttonBox);
    mainLayout->addWidget(buttonBox);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    //clumsy way to set width. Could someone please fix Qt to have an easy way to set widget sizes?
    int textWidth = fontMetrics().width(rwfolderitem.append("MMMMMMMMMM"));
    int buttonWidth = m_addButton->width();
    resize(textWidth + buttonWidth, size().height());
}