TagGuesserConfigDlg::TagGuesserConfigDlg(QWidget *parent, const char *name)
    : KDialog(parent)
{
    setObjectName( QLatin1String( name ) );
    setModal(true);
    setCaption(i18n("Tag Guesser Configuration"));
    setButtons(Ok | Cancel);
    setDefaultButton(Ok);
    showButtonSeparator(true);

    m_child = new TagGuesserConfigDlgWidget(this);
    setMainWidget(m_child);

    m_child->bMoveUp->setIcon(KIcon( QLatin1String( "arrow-up" )));
    m_child->bMoveDown->setIcon(KIcon( QLatin1String( "arrow-down" )));

    m_tagSchemeModel = new QStringListModel(m_child->lvSchemes);
    m_child->lvSchemes->setModel(m_tagSchemeModel);
    m_child->lvSchemes->setHeaderHidden(true);
    m_tagSchemeModel->setStringList(TagGuesser::schemeStrings());

    connect(m_child->lvSchemes, SIGNAL(clicked(QModelIndex)), this, SLOT(slotCurrentChanged(QModelIndex)));
    connect(m_child->bMoveUp, SIGNAL(clicked()), this, SLOT(slotMoveUpClicked()));
    connect(m_child->bMoveDown, SIGNAL(clicked()), this, SLOT(slotMoveDownClicked()));
    connect(m_child->bAdd, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
    connect(m_child->bModify, SIGNAL(clicked()), this, SLOT(slotModifyClicked()));
    connect(m_child->bRemove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));

    resize( 400, 300 );
}
Exemple #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();
}
int VCCueListProperties::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: accept(); break;
        case 1: slotTabChanged(); break;
        case 2: slotAddClicked(); break;
        case 3: slotRemoveClicked(); break;
        case 4: slotRaiseClicked(); break;
        case 5: slotLowerClicked(); break;
        case 6: slotCutClicked(); break;
        case 7: slotCopyClicked(); break;
        case 8: slotPasteClicked(); break;
        case 9: slotNextAttachClicked(); break;
        case 10: slotNextDetachClicked(); break;
        case 11: slotNextChooseInputClicked(); break;
        case 12: slotNextAutoDetectInputToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 13: slotNextInputValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2]))); break;
        case 14: slotPreviousAttachClicked(); break;
        case 15: slotPreviousDetachClicked(); break;
        case 16: slotPreviousChooseInputClicked(); break;
        case 17: slotPreviousAutoDetectInputToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 18: slotPreviousInputValueChanged((*reinterpret_cast< quint32(*)>(_a[1])),(*reinterpret_cast< quint32(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 19;
    }
    return _id;
}
Exemple #4
0
CustomTemplates::CustomTemplates( QWidget *parent, const char *name )
  :CustomTemplatesBase( parent, name ), mCurrentItem( 0 )
{
  QFont f = KGlobalSettings::fixedFont();
  mEdit->setFont( f );

  mAdd->setIconSet( BarIconSet( "add", KIcon::SizeSmall ) );
  mRemove->setIconSet( BarIconSet( "remove", KIcon::SizeSmall ) );

  mList->setColumnWidth( 0, 50 );
  mList->setColumnWidth( 1, 100 );

  mEditFrame->setEnabled( false );

  connect( mEdit, SIGNAL( textChanged() ),
           this, SLOT( slotTextChanged( void ) ) );

  connect( mInsertCommand, SIGNAL( insertCommand(QString, int) ),
           this, SLOT( slotInsertCommand(QString, int) ) );

  connect( mAdd, SIGNAL( clicked() ),
           this, SLOT( slotAddClicked() ) );
  connect( mRemove, SIGNAL( clicked() ),
           this, SLOT( slotRemoveClicked() ) );
  connect( mList, SIGNAL( selectionChanged() ),
           this, SLOT( slotListSelectionChanged() ) );
  connect( mType, SIGNAL( activated( int ) ),
           this, SLOT( slotTypeActivated( int ) ) );

  connect( mKeyButton, SIGNAL( capturedShortcut( const KShortcut& ) ),
           this, SLOT( slotShortcutCaptured( const KShortcut& ) ) );

  mReplyPix = KIconLoader().loadIcon( "mail_reply", KIcon::Small );
  mReplyAllPix = KIconLoader().loadIcon( "mail_replyall", KIcon::Small );
  mForwardPix = KIconLoader().loadIcon( "mail_forward", KIcon::Small );

  mType->clear();
  mType->insertItem( QPixmap(), i18n( "Message->", "Universal" ), TUniversal );
  mType->insertItem( mReplyPix, i18n( "Message->", "Reply" ), TReply );
  mType->insertItem( mReplyAllPix, i18n( "Message->", "Reply to All" ), TReplyAll );
  mType->insertItem( mForwardPix, i18n( "Message->", "Forward" ), TForward );

  QString help =
      i18n( "<qt>"
            "<p>Here you can add, edit, and delete custom message "
            "templates to use when you compose a reply or forwarding message. "
            "Create the custom template by selecting it using the right mouse "
            " button menu or toolbar menu. Also, you can bind a keyboard "
            "combination to the template for faster operations.</p>"
            "<p>Message templates support substitution commands "
            "by simple typing them or selecting them from menu "
            "<i>Insert command</i>.</p>"
            "<p>There are four types of custom templates: used to "
            "<i>Reply</i>, <i>Reply to All</i>, <i>Forward</i>, and "
            "<i>Universal</i> which can be used for all kind of operations. "
            "You cannot bind keyboard shortcut to <i>Universal</i> templates.</p>"
            "</qt>" );
  mHelp->setText( i18n( "<a href=\"whatsthis:%1\">How does this work?</a>" ).arg( help ) );
}
Exemple #5
0
KMConfigFilter::KMConfigFilter(QWidget *parent, const char *name) : KMConfigPage(parent, name)
{
    setPageName(i18n("Filter"));
    setPageHeader(i18n("Printer Filtering Settings"));
    setPagePixmap("filter");

    QGroupBox *box = new QGroupBox(0, Qt::Vertical, i18n("Printer Filter"), this);

    m_list1 = new KListBox(box);
    m_list1->setSelectionMode(KListBox::Extended);
    m_list2 = new KListBox(box);
    m_list2->setSelectionMode(KListBox::Extended);
    m_add = new QToolButton(box);
    m_add->setIconSet(QApplication::reverseLayout() ? SmallIconSet("back") : SmallIconSet("forward"));
    m_remove = new QToolButton(box);
    m_remove->setIconSet(QApplication::reverseLayout() ? SmallIconSet("forward") : SmallIconSet("back"));
    m_locationre = new QLineEdit(box);
    QLabel *lab = new QLabel(box);
    lab->setText(
        i18n("The printer filtering allows you to view only a specific set of "
             "printers instead of all of them. This may be useful when there are a "
             "lot of printers available but you only use a few ones. Select the "
             "printers you want to see from the list on the left or enter a <b>Location</b> "
             "filter (ex: Group_1*). Both are cumulative and ignored if empty."));
    lab->setTextFormat(Qt::RichText);
    QLabel *lab1 = new QLabel(i18n("Location filter:"), box);

    QVBoxLayout *l0 = new QVBoxLayout(this, 0, KDialog::spacingHint());
    l0->addWidget(box, 1);
    QVBoxLayout *l1 = new QVBoxLayout(box->layout(), KDialog::spacingHint());
    l1->addWidget(lab);
    QGridLayout *l2 = new QGridLayout(0, 4, 3, 0, KDialog::spacingHint());
    l1->addLayout(l2);
    l2->setRowStretch(0, 1);
    l2->setRowStretch(3, 1);
    l2->setColStretch(0, 1);
    l2->setColStretch(2, 1);
    l2->addMultiCellWidget(m_list1, 0, 3, 0, 0);
    l2->addMultiCellWidget(m_list2, 0, 3, 2, 2);
    l2->addWidget(m_add, 1, 1);
    l2->addWidget(m_remove, 2, 1);
    QHBoxLayout *l3 = new QHBoxLayout(0, 0, KDialog::spacingHint());
    l1->addLayout(l3, 0);
    l3->addWidget(lab1, 0);
    l3->addWidget(m_locationre, 1);

    connect(m_add, SIGNAL(clicked()), SLOT(slotAddClicked()));
    connect(m_remove, SIGNAL(clicked()), SLOT(slotRemoveClicked()));
    connect(m_list1, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
    connect(m_list2, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
    m_add->setEnabled(false);
    m_remove->setEnabled(false);
}
int FunctionWizard::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: accept(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
Exemple #7
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*)) );
}
Exemple #8
0
VCCueListProperties::VCCueListProperties(QWidget* parent, VCCueList* cueList)
        : QDialog(parent)
{
    Q_ASSERT(cueList != NULL);
    m_cueList = cueList;

    setupUi(this);

    /* Name */
    m_nameEdit->setText(cueList->caption());
    m_nameEdit->setSelection(0, cueList->caption().length());

    /* Connections */
    connect(m_addButton, SIGNAL(clicked()),
            this, SLOT(slotAddClicked()));
    connect(m_removeButton, SIGNAL(clicked()),
            this, SLOT(slotRemoveClicked()));
    connect(m_raiseButton, SIGNAL(clicked()),
            this, SLOT(slotRaiseClicked()));
    connect(m_lowerButton, SIGNAL(clicked()),
            this, SLOT(slotLowerClicked()));
    connect(m_attachButton, SIGNAL(clicked()),
            this, SLOT(slotAttachClicked()));
    connect(m_detachButton, SIGNAL(clicked()),
            this, SLOT(slotDetachClicked()));

    /* Put all cues into the tree widget */
    QTreeWidgetItemIterator it(m_cueList->m_list);
    while (*it != NULL)
    {
        QTreeWidgetItem* item = new QTreeWidgetItem(m_list);
        item->setText(KVCCueListColumnNumber, QString("%1")
                      .arg(m_list->indexOfTopLevelItem(item) + 1));
        item->setText(KVCCueListColumnName,
                      (*it)->text(KVCCueListColumnName));
        item->setText(KVCCueListColumnID,
                      (*it)->text(KVCCueListColumnID));
        ++it;
    }

    m_list->header()->setResizeMode(QHeaderView::ResizeToContents);

    /* Key bind */
    m_keySequence = QKeySequence(cueList->keySequence());
    m_keyEdit->setText(m_keySequence.toString());
}
Exemple #9
0
GroupWisePrivacyDialog::GroupWisePrivacyDialog( GroupWiseAccount * account, QWidget *parent, const char * /*name*/ )
 : KDialog(  parent)
 , m_account( account ), m_dirty( false ), m_searchDlg(0)
{
	setCaption(i18nc( "Account specific privacy settings", "Manage Privacy for %1", account->accountId() ));
	setButtons(KDialog::Ok|KDialog::Apply|KDialog::Cancel);
	setDefaultButton(Ok);
	setModal(false);
	QWidget * wid = new QWidget( this );
	m_privacy.setupUi( wid );
	setMainWidget( wid );
	PrivacyManager * mgr = m_account->client()->privacyManager();
	// populate the widget;
	// admin lock
	if ( mgr->isPrivacyLocked() )
	{
		m_privacy.status->setText( i18n( "Privacy settings have been administratively locked" ) );
		disableWidgets();
	}

	populateWidgets();

	m_privacy.allowList->setSelectionMode( Q3ListBox::Extended );
	m_privacy.denyList->setSelectionMode( Q3ListBox::Extended );

	connect( m_privacy.btnAllow, SIGNAL(clicked()), SLOT(slotAllowClicked()) );
	connect( m_privacy.btnBlock, SIGNAL(clicked()), SLOT(slotBlockClicked()) );
	connect( m_privacy.btnAdd, SIGNAL(clicked()), SLOT(slotAddClicked()) );
	connect( m_privacy.btnRemove, SIGNAL(clicked()), SLOT(slotRemoveClicked()) );
	connect( m_privacy.allowList, SIGNAL(selectionChanged()), SLOT(slotAllowListClicked()) );
	connect( m_privacy.denyList, SIGNAL(selectionChanged()), SLOT(slotDenyListClicked()) );
	connect( mgr, SIGNAL(privacyChanged(QString,bool)), SLOT(slotPrivacyChanged()) );
	connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
	connect(this,SIGNAL(applyClicked()),this,SLOT(slotApply()));
	m_privacy.btnAdd->setEnabled( true );
	m_privacy.btnAllow->setEnabled( false );
	m_privacy.btnBlock->setEnabled( false );
	m_privacy.btnRemove->setEnabled( false );

/*	showButtonOK( true );
	showButtonApply( true );
	showButtonCancel( true );
	*/
	show();
}
void FunctionCollectionEditor::init()
{
  resize(500, 300);
  setFixedSize(500, 300);

  setCaption("Function Collection");
  
  m_nameLabel = new QLabel(this);
  m_nameLabel->setGeometry(10, 10, 100, 30);
  m_nameLabel->setText("Function:");

  m_nameEdit = new QLineEdit(this);
  m_nameEdit->setGeometry(100, 10, 260, 30);
  m_nameEdit->setText(m_functionCollection->name());
  m_nameEdit->setFocus();
  m_nameEdit->setSelection(0, m_functionCollection->name().length());

  m_functionList = new QListView(this);
  m_functionList->setGeometry(10, 50, 350, 240);
  m_functionList->addColumn("Device");
  m_functionList->addColumn("Function");
  m_functionList->setColumnWidth(0, (int) (350 * 0.49));
  m_functionList->setColumnWidth(1, (int) (350 * 0.49));
  m_functionList->setAllColumnsShowFocus(true);

  m_addButton = new QPushButton(this);
  m_addButton->setText("Add");
  m_addButton->setGeometry(380, 50, 100, 30);
  connect(m_addButton, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
  
  m_removeButton = new QPushButton(this);
  m_removeButton->setText("Remove");
  m_removeButton->setGeometry(380, 90, 100, 30);
  connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));

  m_ok = new QPushButton(this);
  m_ok->setText("OK");
  m_ok->setGeometry(380, 210, 100, 30);
  connect(m_ok, SIGNAL(clicked()), this, SLOT(accept()));
  
  m_cancel = new QPushButton(this);
  m_cancel->setText("Cancel");
  m_cancel->setGeometry(380, 250, 100, 30);
  connect(m_cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
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;
}
int ChaserEditor::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: accept(); break;
        case 1: slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 2: slotBusComboActivated((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: slotAddClicked(); break;
        case 4: slotRemoveClicked(); break;
        case 5: slotRaiseClicked(); break;
        case 6: slotLowerClicked(); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
int AddVCButtonMatrix::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: slotHorizontalChanged(); break;
        case 3: slotVerticalChanged(); break;
        case 4: slotButtonSizeChanged(); break;
        case 5: slotNormalFrameToggled((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 6: accept(); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
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());
}
Exemple #15
0
ChaserEditor::ChaserEditor(QWidget* parent, Chaser* chaser) : QDialog(parent)
{
	Q_ASSERT(chaser != NULL);

	setupUi(this);

	/* Resize columns to fit contents */
	m_tree->header()->setResizeMode(QHeaderView::ResizeToContents);

	/* Connect UI controls */
	connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
		this, SLOT(slotNameEdited(const QString&)));
	connect(m_add, SIGNAL(clicked()), this, SLOT(slotAddClicked()));
	connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemoveClicked()));
	connect(m_raise, SIGNAL(clicked()), this, SLOT(slotRaiseClicked()));
	connect(m_lower, SIGNAL(clicked()), this, SLOT(slotLowerClicked()));
	
	/* Create a copy of the original chaser so that we can freely modify
	   it and keep a pointer to the original so that we can move the
	   contents from the copied chaser to the original when OK is clicked */
	m_chaser = new Chaser(this);
	m_chaser->copyFrom(chaser);
	Q_ASSERT(m_chaser != NULL);
	m_original = chaser;

	/* Name edit */
	m_nameEdit->setText(m_chaser->name());
	m_nameEdit->setSelection(0, m_nameEdit->text().length());
	setWindowTitle(tr("Chaser - %1").arg(m_chaser->name()));

	/* Bus */
	connect(m_busCombo, SIGNAL(activated(int)),
		this, SLOT(slotBusComboActivated(int)));
	fillBusCombo();

	/* Running order */
	switch (m_chaser->runOrder())
	{
	default:
	case Chaser::Loop:
		m_loop->setChecked(true);
		break;
	case Chaser::PingPong:
		m_pingPong->setChecked(true);
		break;
	case Chaser::SingleShot:
		m_singleShot->setChecked(true);
		break;
	}

	/* Running direction */
	switch (m_chaser->direction())
	{
	default:
	case Chaser::Forward:
		m_forward->setChecked(true);
		break;
	case Chaser::Backward:
		m_backward->setChecked(true);
		break;
	}

	/* Chaser steps */
	updateStepList(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);
}
Exemple #17
0
void dialogEditIP::programInit(QString name)
{
  JailDir = pcbsd::Utils::getValFromPCConf("/usr/local/etc/warden.conf", "JDIR");
  jailName = name;
  QFile file;
  QString tmp;

  // Is VNET enabled?
  file.setFileName( JailDir + "/." + jailName + ".meta/vnet" );
  if ( file.exists() )
    checkVNET->setChecked(true);

  // Lets start loading IP addresses
  file.setFileName( JailDir + "/." + jailName + ".meta/ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv4->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/bridge-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIPBridge->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv4Bridge->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/defaultrouter-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIPRouter->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv4Router->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP6->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv6->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/bridge-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP6Bridge->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv6Bridge->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/defaultrouter-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); tmp=""; tmp = stream.readLine();
     lineIP6Router->setText(tmp);
     if ( ! tmp.isEmpty() )
        checkIPv6Router->setChecked(true);
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv4Alias << stream.readLine();
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-bridge-ipv4" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv4AliasBridge << stream.readLine();
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv6Alias << stream.readLine();
     file.close();
  }

  file.setFileName( JailDir + "/." + jailName + ".meta/alias-bridge-ipv6" );
  if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
     QTextStream stream( &file ); 
     while ( ! file.atEnd() )
       IPv6AliasBridge << stream.readLine();
     file.close();
  }

  // Our buttons / slots
  connect( checkVNET, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv4, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv4Bridge, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv4Router, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv6, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv6Bridge, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );
  connect( checkIPv6Router, SIGNAL( clicked() ), this, SLOT( slotCheckChecks() ) );

  connect( comboIPType, SIGNAL( currentIndexChanged(int) ), this, SLOT( slotComboIPChanged() ) );

  connect( pushSave, SIGNAL( clicked() ), this, SLOT( slotSaveClicked() ) );
  connect( pushCancel, SIGNAL( clicked() ), this, SLOT( slotCancelClicked() ) );
  connect( pushAdd, SIGNAL( clicked() ), this, SLOT( slotAddClicked() ) );
  connect( pushRemove, SIGNAL( clicked() ), this, SLOT( slotRemClicked() ) );

  slotCheckChecks();
  slotComboIPChanged();
  loadPerms();
}
    QStringList targets = instbackend::targetList();

    foreach (QString 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(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);
Exemple #19
0
RepositoryDialog::RepositoryDialog(KConfig& cfg, OrgKdeCervisia5CvsserviceCvsserviceInterface* cvsService,
                                   const QString& cvsServiceInterfaceName, QWidget* parent)
    : QDialog(parent)
    , m_partConfig(cfg)
    , m_cvsService(cvsService)
    , m_cvsServiceInterfaceName(cvsServiceInterfaceName)
{
    setWindowTitle(i18n("Configure Access to Repositories"));
    setModal(true);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
    QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(okButton, SIGNAL(clicked()), this, SLOT(slotOk()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    QBoxLayout* hbox = new QHBoxLayout;
    hbox->setMargin(0);
    mainLayout->addLayout(hbox);

    m_repoList = new QTreeWidget;
    hbox->addWidget(m_repoList, 10);
    m_repoList->setMinimumWidth(fontMetrics().width('0') * 60);
    m_repoList->setAllColumnsShowFocus(true);
    m_repoList->setRootIsDecorated(false);
    m_repoList->setHeaderLabels(QStringList() << i18n("Repository") << i18n("Method")
                                              << i18n("Compression") << i18n("Status"));
    m_repoList->setFocus();

    connect(m_repoList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
            this, SLOT(slotDoubleClicked(QTreeWidgetItem*, int)));
    connect(m_repoList, SIGNAL(itemSelectionChanged()),
            this,       SLOT(slotSelectionChanged()));

    QDialogButtonBox* actionbox = new QDialogButtonBox(Qt::Vertical);
    QPushButton* addbutton = actionbox->addButton(i18n("Add..."), QDialogButtonBox::ActionRole);
    m_modifyButton = actionbox->addButton(i18n("Modify..."), QDialogButtonBox::ActionRole);
    m_removeButton = actionbox->addButton(i18n("Remove"), QDialogButtonBox::ActionRole);
    m_loginButton  = actionbox->addButton(i18n("Login..."), QDialogButtonBox::ActionRole);
    m_logoutButton = actionbox->addButton(i18n("Logout"), QDialogButtonBox::ActionRole);
    hbox->addWidget(actionbox, 0);

    m_loginButton->setEnabled(false);
    m_logoutButton->setEnabled(false);

    connect( addbutton, SIGNAL(clicked()),
             this, SLOT(slotAddClicked()) );
    connect( m_modifyButton, SIGNAL(clicked()),
             this, SLOT(slotModifyClicked()) );
    connect( m_removeButton, SIGNAL(clicked()),
             this, SLOT(slotRemoveClicked()) );
    connect( m_loginButton, SIGNAL(clicked()),
             this, SLOT(slotLoginClicked()) );
    connect( m_logoutButton, SIGNAL(clicked()),
             this, SLOT(slotLogoutClicked()) );

    // open cvs DBUS service configuration file
    m_serviceConfig = new KConfig("cvsservicerc");

    readCvsPassFile();
    readConfigFile();

    if (QTreeWidgetItem *item = m_repoList->topLevelItem(0))
    {
        m_repoList->setCurrentItem(item);
        item->setSelected(true);
    }
    else
    {
        // we have no item so disable modify and remove button
        slotSelectionChanged();
    }

    connect(buttonBox, &QDialogButtonBox::helpRequested, this, &RepositoryDialog::slotHelp);

    setAttribute(Qt::WA_DeleteOnClose, true);

    KConfigGroup cg(&m_partConfig, "RepositoryDialog");
    restoreGeometry(cg.readEntry<QByteArray>("geometry", QByteArray()));

    QByteArray state = cg.readEntry<QByteArray>("RepositoryListView", QByteArray());
    m_repoList->header()->restoreState(state);

    mainLayout->addWidget(buttonBox);
}