Beispiel #1
0
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_commandsListModel(0), m_tapesTableModel(0) {
	ui->setupUi(this);
	m_commandsListModel.connect(&m_commands, &m_currentCommandIndex);
	m_tapesTableModel.connect(m_machine.tapes());
	ui->commandsListView->setModel(&m_commandsListModel);
	ui->tapesTableView->setModel(&m_tapesTableModel);
	m_currentCommandIndex = -1;
	m_editingCommand = 0;
	m_selectedTapeIndex = -1;
	connect(ui->commandsListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(handleCommandsSelectionChanged(QItemSelection, QItemSelection)));
	connect(ui->tapesTableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(handleTapesSelectionChanged(QItemSelection, QItemSelection)));
	connect(ui->addCommandToolButton, SIGNAL(clicked()), this, SLOT(handleAddCommandPushButtonClicked()));
	connect(ui->removeCommandToolButton, SIGNAL(clicked()), this, SLOT(handleRemoveCommandPushButtonClicked()));
	connect(ui->stateSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleStateSpinBoxValueChanged(int)));
	connect(ui->conditionComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(handleConditionComboboxCurrentIndexChanged(int)));
	connect(ui->conditionLineEdit, SIGNAL(textEdited(QString)), this, SLOT(handleConditionLineEditTextEdited(QString)));
	connect(ui->destinationSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleDestinationSpinBoxValueChanged(int)));
	connect(ui->changeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(handleChangeComboboxCurrentIndexChanged(int)));
	connect(ui->changeLineEdit, SIGNAL(textEdited(QString)), this, SLOT(handleChangeLineEditTextEdited(QString)));
	connect(ui->goLeftRadioButton, SIGNAL(clicked(bool)), this, SLOT(handleGoLeftRadioButtonClicked(bool)));
	connect(ui->goRightRadioButton, SIGNAL(clicked(bool)), this, SLOT(handleGoRightRadioButtonClicked(bool)));
	connect(ui->stayRadioButton, SIGNAL(clicked(bool)), this, SLOT(handleStayRadioButtonClicked(bool)));
	connect(ui->addTapeToolButton, SIGNAL(clicked()), this, SLOT(handleAddTapeToolButtonClicked()));
	connect(ui->eraseTapeToolButton, SIGNAL(clicked()), this, SLOT(handleEraseTapeToolButtonClicked()));
	connect(ui->removeTapeToolButton, SIGNAL(clicked()), this, SLOT(handleRemoveTapeToolButtonClicked()));
	connect(ui->currentStateSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleCurrentStateSpinBoxValueChanged(int)));
	connect(ui->headPositionSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleHeadPositionSpinBoxValueChanged(int)));
	connect(ui->leftFOVSpinBox, SIGNAL(valueChanged(int)), this, SLOT(handleLeftFOVSpinBoxValueChanged(int)));
	connect(ui->rightFOVSpinBox,SIGNAL(valueChanged(int)), this, SLOT(handleRightFOVSpinBoxValueChanged(int)));
	connect(ui->actionExecute, SIGNAL(triggered()), this, SLOT(handleActionExecuteTriggered()));
	connect(ui->actionEvaluate, SIGNAL(triggered()), this, SLOT(handleActionEvaluateTriggered()));
	connect(ui->actionStep, SIGNAL(triggered()), this, SLOT(handleActionStepTriggered()));
	connect(ui->actionStepAndEvaluate, SIGNAL(triggered()), this, SLOT(handleActionStepAndEvaluateTriggered()));
	connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(handleActionNewTriggered()));
	connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(handleActionOpenTriggered()));
	connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(handleActionSaveTriggered()));
	connect(ui->actionSave_as, SIGNAL(triggered()), this, SLOT(handleActionSaveAsTriggered()));
	for (int i = 0; i < m_tapesTableModel.columnCount(QModelIndex()); i++)
		ui->tapesTableView->setColumnWidth(i, 32);
}
Beispiel #2
0
QgsFilePickerWidget::QgsFilePickerWidget( QWidget *parent )
    : QWidget( parent )
    , mFilePath( QString() )
    , mButtonVisible( true )
    , mUseLink( false )
    , mFullUrl( false )
    , mDialogTitle( QString() )
    , mDefaultRoot( QString() )
    , mStorageMode( File )
{
  setBackgroundRole( QPalette::Window );
  setAutoFillBackground( true );

  QGridLayout* layout = new QGridLayout();
  layout->setMargin( 0 );

  // If displaying a hyperlink, use a QLabel
  mLinkLabel = new QLabel( this );
  // Make Qt opens the link with the OS defined viewer
  mLinkLabel->setOpenExternalLinks( true );
  // Label should always be enabled to be able to open
  // the link on read only mode.
  mLinkLabel->setEnabled( true );
  mLinkLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
  mLinkLabel->setTextFormat( Qt::RichText );
  layout->addWidget( mLinkLabel, 0, 0 );
  mLinkLabel->hide(); // do not show by default

  // otherwise, use the traditional QLineEdit
  mLineEdit = new QgsFilterLineEdit( this );
  connect( mLineEdit, SIGNAL( textEdited( QString ) ), this, SLOT( textEdited( QString ) ) );
  layout->addWidget( mLineEdit, 1, 0 );

  mFilePickerButton = new QToolButton( this );
  mFilePickerButton->setText( "..." );
  connect( mFilePickerButton, SIGNAL( clicked() ), this, SLOT( openFileDialog() ) );
  layout->addWidget( mFilePickerButton, 0, 1, 2, 1 );

  setLayout( layout );
}
Gui_Admin::Gui_Admin(QWidget* parent): QWidget(parent), db(new LinkedDB){
    this->setWindowTitle("Welcome to LinQedIn Admin");
    this->resize(QDesktopWidget().availableGeometry(this).size() * 0.5);
    this->setFixedSize(this->size());

    QHBoxLayout* adminLayout = new QHBoxLayout();

    QVBoxLayout* firstCol = new QVBoxLayout();
    usersList = new QListWidget(this);
    for(std::list<SmartUser>::const_iterator it = db->begin(); it != db->end(); ++it) {
        QListWidgetItem* user = new QListWidgetItem(QString::fromStdString((*it)->account()->username().getLogin()));
        usersList->insertItem(usersList->count(),user);
    }
    usersList->setCurrentRow(0);
    usersList->setFixedHeight(this->height()/1.75);
    usersList->setFixedWidth(200);
    filterSearch = new QLineEdit();
    filterSearch->setPlaceholderText("filter users by username");
    filterSearch->setFixedWidth(200);
    connect(filterSearch, SIGNAL(textEdited(QString)), this, SLOT(filterUsers(QString)));
    firstCol->addSpacing(50);
    firstCol->addWidget(filterSearch, 0, Qt::AlignCenter);
    firstCol->addWidget(usersList,0, Qt::AlignCenter);
    firstCol->addSpacing(50);

    QVBoxLayout* secCol = new QVBoxLayout();
    QPushButton* adduserB = new QPushButton("add new user");
    adduserB->setFixedSize(160,30);
    connect(adduserB, SIGNAL(clicked()), this, SLOT(openAddUser()));
    QPushButton* removeuserB = new QPushButton("remove user");
    removeuserB->setFixedSize(160,30);
    connect(removeuserB, SIGNAL(clicked()), this, SLOT(removeUser()));
    QPushButton* changesubuserB = new QPushButton("change Subscription");
    changesubuserB->setFixedSize(160,30);
    connect(changesubuserB, SIGNAL(clicked()), this, SLOT(openChangeSubType()));
    QPushButton* logoutB = new QPushButton("Logout");
    logoutB->setFixedSize(160,30);
    connect(logoutB, SIGNAL(clicked()), this, SLOT(logout()));

    secCol->setSpacing(10);
    secCol->addSpacing(50);
    secCol->addWidget(adduserB,0, Qt::AlignLeft);
    secCol->addWidget(removeuserB,0, Qt::AlignLeft);
    secCol->addWidget(changesubuserB,0, Qt::AlignLeft);
    secCol->addWidget(logoutB, 0, Qt::AlignLeft);
    secCol->addSpacing(50);


    adminLayout->addLayout(firstCol);
    adminLayout->addLayout(secCol);
    setLayout(adminLayout);
}
Beispiel #4
0
PaletteDetailView::PaletteDetailView(PaletteModel * model, QWidget * parent)
    : QWidget(parent)
    , m_currentKColorEditColor(ColorUtil::DEFAULT_COLOR)
{
    m_model = model;

    m_view = new QTableView(this);
    m_view->setModel(m_model);
    m_view->setItemDelegate(new PaletteDelegate(this));
    m_view->setSelectionMode(QAbstractItemView::SingleSelection);
    m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
    m_view->setEditTriggers(QAbstractItemView::AllEditTriggers);
    m_view->setCornerButtonEnabled(false);
    m_view->setMouseTracking(true);
    m_view->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
    m_view->verticalHeader()->setResizeMode(QHeaderView::Fixed);

    updatePaletteDetails();

    PaletteDetailViewControls *viewControls = new PaletteDetailViewControls(this);

    QHBoxLayout *viewLayout = new QHBoxLayout();
    viewLayout->addWidget(m_view);
    viewLayout->addWidget(viewControls);

    m_paletteNameLineEdit = new KLineEdit(this);
    m_paletteNameLineEdit->setClearButtonShown(true);
    m_paletteNameLineEdit->setText(m_model->paletteName());

    m_paletteDescriptionLink = new KUrlLabel(QString(), i18n("Add description"), this);

    updateDescriptionLink();

    QHBoxLayout * nameLayout = new QHBoxLayout();
    nameLayout->addWidget(new QLabel(i18n("Palette Name:"), this));
    nameLayout->addWidget(m_paletteNameLineEdit);

    QHBoxLayout * descriptionLayout = new QHBoxLayout();
    descriptionLayout->addWidget(m_paletteDescriptionLink);
    descriptionLayout->addWidget(new QLabel(i18n(" for this palette"), this), Qt::AlignLeft);

    QVBoxLayout * mainLayout = new QVBoxLayout(this);
    mainLayout->addLayout(nameLayout);
    mainLayout->addLayout(descriptionLayout);
    mainLayout->addLayout(viewLayout);

    connect(m_paletteNameLineEdit   , SIGNAL( textEdited(QString) ), SLOT( updatePaletteName(QString)     ));
    connect(m_paletteDescriptionLink, SIGNAL( leftClickedUrl()    ), SLOT( showPaletteDescriptionWidget() ));

    connect(m_model, SIGNAL( dataChanged(QModelIndex, QModelIndex) ), SLOT( updatePaletteDetails() ));
    connect(m_model, SIGNAL( rowsRemoved(QModelIndex, int, int)    ), SLOT( updatePaletteDetails() ));
}
Beispiel #5
0
LocationBar::LocationBar(QupZilla* mainClass)
    : LineEdit(mainClass)
    , p_QupZilla(mainClass)
    , m_webView(0)
    , m_pasteAndGoAction(0)
    , m_clearAction(0)
    , m_holdingAlt(false)
    , m_loadProgress(0)
    , m_progressVisible(false)
    , m_forceLineEditPaintEvent(false)
{
    setObjectName("locationbar");
    setDragEnabled(true);

    m_bookmarkIcon = new BookmarkIcon(p_QupZilla);
    m_goIcon = new GoIcon(this);
    m_rssIcon = new RssIcon(this);
    m_rssIcon->setToolTip(tr("Add RSS from this page..."));
    m_siteIcon = new SiteIcon(this);
    DownIcon* down = new DownIcon(this);

    ////RTL Support
    ////if we don't add 'm_siteIcon' by following code, then we should use suitable padding-left value
    //// but then, when typing RTL text the layout dynamically changed and within RTL layout direction
    //// padding-left is equivalent to padding-right and vice versa, and because style sheet is
    //// not changed dynamically this create padding problems.
    addWidget(m_siteIcon, LineEdit::LeftSide);

    addWidget(m_goIcon, LineEdit::RightSide);
    addWidget(m_bookmarkIcon, LineEdit::RightSide);
    addWidget(m_rssIcon, LineEdit::RightSide);
    addWidget(down, LineEdit::RightSide);

    m_completer.setLocationBar(this);
    connect(&m_completer, SIGNAL(showCompletion(QString)), this, SLOT(showCompletion(QString)));
    connect(&m_completer, SIGNAL(completionActivated()), this, SLOT(urlEnter()));

    connect(this, SIGNAL(textEdited(QString)), this, SLOT(textEdit()));
    connect(m_siteIcon, SIGNAL(clicked()), this, SLOT(showSiteInfo()));
    connect(m_goIcon, SIGNAL(clicked(QPoint)), this, SLOT(urlEnter()));
    connect(m_rssIcon, SIGNAL(clicked(QPoint)), this, SLOT(rssIconClicked()));
    connect(m_bookmarkIcon, SIGNAL(clicked(QPoint)), this, SLOT(bookmarkIconClicked()));
    connect(down, SIGNAL(clicked(QPoint)), this, SLOT(showMostVisited()));
    connect(mApp->searchEnginesManager(), SIGNAL(activeEngineChanged()), this, SLOT(updatePlaceHolderText()));
    connect(mApp->searchEnginesManager(), SIGNAL(defaultEngineChanged()), this, SLOT(updatePlaceHolderText()));
    connect(mApp, SIGNAL(message(Qz::AppMessageType, bool)), SLOT(onMessage(Qz::AppMessageType, bool)));

    loadSettings();

    clearIcon();
    updatePlaceHolderText();
}
void
Tomahawk::EchonestControl::updateWidgets()
{
    if( !m_input.isNull() )
        delete m_input.data();
    if( !m_match.isNull() )
        delete m_match.data();
    m_overrideType = -1;

    // make sure the widgets are the proper kind for the selected type, and hook up to their slots
    if( selectedType() == "Artist" ) {
        m_currentType = Echonest::DynamicPlaylist::Artist;

        QComboBox* match = new QComboBox();
        QLineEdit* input =  new QLineEdit();

        match->addItem( "Limit To", Echonest::DynamicPlaylist::ArtistType );
        match->addItem( "Similar To", Echonest::DynamicPlaylist::ArtistRadioType );
        m_matchString = match->currentText();
        m_matchData = match->itemData( match->currentIndex() ).toString();

        input->setPlaceholderText( "Artist name" );
        input->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed );
        input->setCompleter( new QCompleter( QStringList(), input ) );
        input->completer()->setCaseSensitivity( Qt::CaseInsensitive );

        connect( match, SIGNAL( currentIndexChanged(int) ), this, SLOT( updateData() ) );
        connect( match, SIGNAL( currentIndexChanged(int) ), this, SIGNAL( changed() ) );
        connect( input, SIGNAL( textChanged(QString) ), this, SLOT( updateData() ) );
        connect( input, SIGNAL( editingFinished() ), this, SLOT( editingFinished() ) );
        connect( input, SIGNAL( textEdited( QString ) ), &m_editingTimer, SLOT( stop() ) );
        connect( input, SIGNAL( textEdited( QString ) ), &m_delayedEditTimer, SLOT( start() ) );
        connect( input, SIGNAL( textEdited( QString ) ), this, SLOT( artistTextEdited( QString ) ) );

        match->hide();
        input->hide();
        m_match = QWeakPointer< QWidget >( match );
        m_input = QWeakPointer< QWidget >( input );
    } else if( selectedType() == "Artist Description" ) {
Beispiel #7
0
WordEditDialog::WordEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::WordEditDialog)
{
    ui->setupUi(this);
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
    setWindowFlags(Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint);
#endif
    setModal(true);

    mValidateThread = new ValidateExpressionThread(this);
    connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, int_t)), this, SLOT(expressionChanged(bool, bool, int_t)));
    connect(ui->expressionLineEdit, SIGNAL(textEdited(QString)), mValidateThread, SLOT(textChanged(QString)));
    mWord = 0;
}
Beispiel #8
0
BasicSettingsPage::BasicSettingsPage(QWidget* parent)
    : QWidget(parent), block(false), model(0)
{
    ui.setupUi(this);

    connect(ui.themeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(updateModel()));
    connect(ui.fontComboBox, SIGNAL(currentFontChanged(QFont)), SLOT(updateModel()));
    connect(ui.sizeSpinBox, SIGNAL(valueChanged(int)), SLOT(updateModel()));
    connect(ui.blockSpinBox, SIGNAL(valueChanged(int)), SLOT(updateModel()));
    connect(ui.timeStampEdit, SIGNAL(textEdited(QString)), SLOT(updateModel()));
    connect(ui.stripNicksCheckBox, SIGNAL(toggled(bool)), SLOT(updateModel()));
    connect(ui.hideEventsCheckBox, SIGNAL(toggled(bool)), SLOT(updateModel()));
}
Beispiel #9
0
LineEdit::LineEdit(QWidget *parent):
    QLineEdit(parent),
    currentBegin(""),
    reply(nullptr)
{
    currentCompleter = new QCompleter(this);

    networkManager = UZApplication::instance()->networkManager();
    p_identifier = ++senderIdentifier;

    connect(this,SIGNAL(textEdited(QString)),this,SLOT(checkContent()));
    connect(networkManager,&NetworkManager::responseReady,this,&LineEdit::updateContent);
}
Beispiel #10
0
DataRange::DataRange(QWidget *parent)
  : QWidget(parent) {
  setupUi(this);

  connect(_countFromEnd, SIGNAL(toggled(bool)), this, SLOT(countFromEndChanged()));
  connect(_readToEnd, SIGNAL(toggled(bool)), this, SLOT(readToEndChanged()));
  connect(_doSkip, SIGNAL(toggled(bool)), this, SLOT(doSkipChanged()));

  connect(_start, SIGNAL(textEdited(QString)), this, SLOT(startChanged()));
  connect(_range, SIGNAL(textEdited(QString)), this, SLOT(rangeChanged()));
  connect(_last, SIGNAL(textEdited(QString)), this, SLOT(lastChanged()));
  connect(_skip, SIGNAL(valueChanged(int)), this, SIGNAL(modified()));
  connect(_doFilter, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_countFromEnd, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_readToEnd, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_doSkip, SIGNAL(toggled(bool)), this, SIGNAL(modified()));
  connect(_startUnits, SIGNAL(currentIndexChanged(int)), this, SLOT(unitsChanged()));
  connect(_rangeUnits, SIGNAL(currentIndexChanged(int)), this, SLOT(unitsChanged()));

  _controlField0 = Range;
  _controlField1 = Start;
}
modCalcAngDist::modCalcAngDist(QWidget *parentSplit)
        : QFrame(parentSplit) {

    setupUi(this);
    FirstRA->setDegType(false);
    SecondRA->setDegType(false);

    connect( FirstRA, SIGNAL(editingFinished()), this, SLOT(slotValidatePositions()) );
    connect( FirstDec, SIGNAL(editingFinished()), this, SLOT(slotValidatePositions()) );
    connect( SecondRA, SIGNAL(editingFinished()), this, SLOT(slotValidatePositions()) );
    connect( SecondDec, SIGNAL(editingFinished()), this, SLOT(slotValidatePositions()) );
    connect( FirstRA, SIGNAL(textEdited(QString)), this, SLOT(slotResetTitle()) );
    connect( FirstDec, SIGNAL(textEdited(QString)), this, SLOT(slotResetTitle()) );
    connect( SecondRA, SIGNAL(textEdited(QString)), this, SLOT(slotResetTitle()) );
    connect( SecondDec, SIGNAL(textEdited(QString)), this, SLOT(slotResetTitle()) );
    connect( FirstObjectButton, SIGNAL(clicked()), this, SLOT(slotObjectButton()) );
    connect( SecondObjectButton, SIGNAL(clicked()), this, SLOT(slotObjectButton()) );
    connect( runButtonBatch, SIGNAL(clicked()), this, SLOT(slotRunBatch()) );

    show();
    slotValidatePositions();
}
Beispiel #12
0
SearchBarWidget::SearchBarWidget(QWidget *parent) : QWidget(parent),
	m_ui(new Ui::SearchBarWidget)
{
	m_ui->setupUi(this);

	connect(m_ui->queryLineEdit, SIGNAL(textEdited(QString)), this, SIGNAL(queryChanged()));
	connect(m_ui->queryLineEdit, SIGNAL(returnPressed()), this, SLOT(notifyRequestedSearch()));
	connect(m_ui->caseSensitiveButton, SIGNAL(clicked()), this, SLOT(notifyFlagsChanged()));
	connect(m_ui->highlightButton, SIGNAL(clicked()), this, SLOT(notifyFlagsChanged()));
	connect(m_ui->nextButton, SIGNAL(clicked()), this, SLOT(notifyRequestedSearch()));
	connect(m_ui->previousButton, SIGNAL(clicked()), this, SLOT(notifyRequestedSearch()));
	connect(m_ui->closeButton, SIGNAL(clicked()), this, SLOT(hide()));
}
Beispiel #13
0
USBAddr::USBAddr(QWidget *parent) :
    _Addr(parent)
{
    busLabel = new QLabel("Bus:", this);
    portLabel = new QLabel("Port:", this);
    bus = new QLineEdit(this);
    bus->setPlaceholderText(
                tr("a hex value between 0 and 0xfff, inclusive"));
    port = new QLineEdit(this);
    port->setPlaceholderText(
                tr("a dotted notation, such as 1.2 or 2.1.3.1"));
    commonlayout = new QGridLayout();
    commonlayout->addWidget(busLabel, 0, 0);
    commonlayout->addWidget(portLabel, 1, 0);
    commonlayout->addWidget(bus, 0, 1);
    commonlayout->addWidget(port, 1, 1);
    setLayout(commonlayout);
    connect(bus, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
    connect(port, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
}
Beispiel #14
0
void RunBar::_initConnections()
{
    connect(this, SIGNAL(textEdited(QString)), this, SLOT(_typed(QString)));
    connect(this, SIGNAL(returnPressed()), this, SLOT(confirmed()));
    connect(_hinter, SIGNAL(changed()), this, SLOT(_hinterChanged()));
    connect(_settings, SIGNAL(changed()), this, SLOT(_settingsChanged()));
    connect(_toggleAction, SIGNAL(triggered()), this, SLOT(toggle()));
    connect(_editHistoryAction, SIGNAL(triggered()), this, SLOT(editHistory()));
    connect(_reloadAction, SIGNAL(triggered()), this, SLOT(reload()));
    connect(_showSettingsAction, SIGNAL(triggered()), _settings, SLOT(show()));
    connect(_tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(_toggleForTray(QSystemTrayIcon::ActivationReason)));
    connect(&_autoRefresh, SIGNAL(timeout()), _hinter, SLOT(reloadIfNeeded()));
}
ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidget *parent) :
    QScrollArea(parent),
    ui(new Ui::ModulePreferencesScrollArea),
    module_(module)
{
    ui->setupUi(this);

    if (!module) return;

    /* Show the preference's description at the top of the page */
    QFont font;
    font.setBold(TRUE);
    QLabel *label = new QLabel(module->description);
    label->setFont(font);
    ui->verticalLayout->addWidget(label);

    /* Add items for each of the preferences */
    prefs_pref_foreach(module, pref_show, (gpointer) ui->verticalLayout);

    foreach (QLineEdit *le, findChildren<QLineEdit *>()) {
        pref_t *pref = le->property(pref_prop_).value<pref_t *>();
        if (!pref) continue;

        switch (pref->type) {
        case PREF_UINT:
            connect(le, SIGNAL(textEdited(QString)), this, SLOT(uintLineEditTextEdited(QString)));
            break;
        case PREF_STRING:
        case PREF_FILENAME:
        case PREF_DIRNAME:
            connect(le, SIGNAL(textEdited(QString)), this, SLOT(stringLineEditTextEdited(QString)));
            break;
        case PREF_RANGE:
            connect(le, SIGNAL(textEdited(QString)), this, SLOT(rangeSyntaxLineEditTextEdited(QString)));
            break;
        default:
            break;
        }
    }
Beispiel #16
0
QWidget *CustomWizardFieldPage::registerLineEdit(const QString &fieldName,
                                                 const CustomWizardField &field)
{
    QLineEdit *lineEdit = new QLineEdit;

    const QString validationRegExp = field.controlAttributes.value(QLatin1String("validator"));
    if (!validationRegExp.isEmpty()) {
        QRegExp re(validationRegExp);
        if (re.isValid())
            lineEdit->setValidator(new QRegExpValidator(re, lineEdit));
        else
            qWarning("Invalid custom wizard field validator regular expression %s.", qPrintable(validationRegExp));
    }
    registerField(fieldName, lineEdit, "text", SIGNAL(textEdited(QString)));
    // Connect to completeChanged() for derived classes that reimplement isComplete()
    connect(lineEdit, SIGNAL(textEdited(QString)), SIGNAL(completeChanged()));

    const QString defaultText = field.controlAttributes.value(QLatin1String("defaulttext"));
    const QString placeholderText = field.controlAttributes.value(QLatin1String("placeholdertext"));
    m_lineEdits.push_back(LineEditData(lineEdit, defaultText, placeholderText));
    return lineEdit;
}
Beispiel #17
0
void RootWindow::createTextAnswers( QVector<strAnswers> &answers, int questionNum )
{
    Edit *edit;
//    qDebug() << "new Edit";
    edit = new Edit( _entAnss.value( questionNum ), questionNum );

    connect( edit, SIGNAL( textEdited( QString ) ),
             edit, SLOT( ansEntered( QString ) ) );

    connect( edit, SIGNAL( ansSignalEntered( int, QString ) ),
             this, SLOT( ansEntered( int, QString ) ) );
    _answersLay->addWidget( edit );
}
LYGithubProductBacklogAddIssueView::LYGithubProductBacklogAddIssueView(QWidget *parent)
	: QDialog(parent)
{
	issueCreatedSuccessfully_ = false;
	exitCountDownTimer_ = 0;

	issueTitleEdit_ = new QLineEdit();

	issueBodyEdit_ = new QTextEdit();

	submitIssuesButton_ = new QPushButton(QIcon(":/22x22/greenCheck.png"), "Submit");
	submitIssuesButton_->setEnabled(false);

	cancelButton_ = new QPushButton(QIcon(":/22x22/list-remove-2.png"), "Cancel");

	waitingBar_ = new QProgressBar();
	waitingBar_->setMinimum(0);
	waitingBar_->setMaximum(0);
	waitingBar_->setMinimumWidth(200);
	waitingBar_->hide();

	messageLabel_ = new QLabel();

	QHBoxLayout *messageVL = new QHBoxLayout();
	messageVL->addWidget(messageLabel_, 0, Qt::AlignCenter);
	messageVL->addWidget(waitingBar_, 0, Qt::AlignCenter);

	QVBoxLayout *fl = new QVBoxLayout();
	fl->addWidget(new QLabel("Title"), 0, Qt::AlignLeft);
	fl->addWidget(issueTitleEdit_);
	fl->addWidget(new QLabel("Description"), 0, Qt::AlignLeft);
	fl->addWidget(issueBodyEdit_);

	QHBoxLayout *hl = new QHBoxLayout();
	hl->addStretch();
	hl->addWidget(submitIssuesButton_);
	hl->addWidget(cancelButton_);

	QVBoxLayout *vl = new QVBoxLayout();
	vl->addLayout(fl);
	vl->addLayout(messageVL);
	vl->addLayout(hl);

	setLayout(vl);

	connect(cancelButton_, SIGNAL(clicked()), this, SLOT(onCancelButtonClicked()));
	connect(submitIssuesButton_, SIGNAL(clicked()), this, SLOT(onSubmitIssueButtonClicked()));

	connect(issueTitleEdit_, SIGNAL(textEdited(QString)), this, SLOT(onEditsChanged()));
	connect(issueBodyEdit_, SIGNAL(textChanged()), this, SLOT(onEditsChanged()));
}
Beispiel #19
0
MainWindowView::MainWindowView(MainWindow *parent)
    : m_ui(new Ui::MainWindowView)
    , m_parent(parent)
    , m_model(0)
    , m_pt(0)
{
    m_ui->setupUi(this);
	m_ui->splitter->setStretchFactor(1, 3);
    
    QMenu* moreButtonMenu = new QMenu(m_ui->moreButton);
    moreButtonMenu->addAction(QIcon::fromTheme("view-preview"), i18n("New Image"))->setProperty("type", int(CARD_IMAGE));
    moreButtonMenu->addAction(QIcon::fromTheme("preferences-plugin"), i18n("New Logic Relation"))->setProperty("type", int(CARD_LOGIC));
    moreButtonMenu->addAction(QIcon::fromTheme("preferences-desktop-text-to-speech"), i18n("New Sound"))->setProperty("type", int(CARD_SOUND));
    moreButtonMenu->addAction(QIcon::fromTheme("preferences-desktop-font"), i18n("New Word"))->setProperty("type", int(CARD_WORD));
    moreButtonMenu->addAction(QIcon::fromTheme("dialog-ok-apply"), i18n("New Found Sound"))->setProperty("type", int(CARD_FOUND));
	connect(moreButtonMenu, SIGNAL(triggered(QAction*)), this, SLOT(addFeature(QAction*)));
    m_ui->moreButton->setMenu(moreButtonMenu);

	connect(m_ui->fileKurl, SIGNAL(urlSelected(KUrl)), this, SLOT(fileSelected()));
	connect(m_ui->backKurl, SIGNAL(urlSelected(KUrl)), this, SLOT(backSelected()));
	connect(m_ui->wordEdit, SIGNAL(textChanged(QString)), this, SLOT(wordChanged(QString)));
	connect(m_ui->playButton, SIGNAL(clicked()), this, SLOT(playSound()));
	connect(m_ui->delButton, SIGNAL(clicked()), this, SLOT(deleteElement()));
	connect(m_ui->addButton, SIGNAL(clicked()), this, SLOT(addElement()));

	connect(m_ui->titleEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->descriptionEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->authorEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->versionEdit, SIGNAL(textEdited(QString)), this, SIGNAL(changed()));
	connect(m_ui->dateEdit, SIGNAL(dateChanged(QDate)), this, SIGNAL(changed()));
	connect(m_ui->maintypeBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed()));


    m_media = new Phonon::MediaObject(this);
    Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::GameCategory, this);
    createPath(m_media, audioOutput);

}
Beispiel #20
0
SearchWidget::SearchWidget(MainWindow *mainWindow)
    : QWidget(mainWindow)
    , m_ui(new Ui::SearchWidget())
    , m_mainWindow(mainWindow)
    , m_isNewQueryString(false)
    , m_noSearchResults(true)
{
    m_ui->setupUi(this);

    QString searchPatternHint;
    QTextStream stream(&searchPatternHint, QIODevice::WriteOnly);
    stream << "<html><head/><body><p>"
           << tr("A phrase to search for.") << "<br>"
           << tr("Spaces in a search term may be protected by double quotes.")
           << "</p><p>"
           << tr("Example:", "Search phrase example")
           << "<br>"
           << tr("<b>foo bar</b>: search for <b>foo</b> and <b>bar</b>",
                 "Search phrase example, illustrates quotes usage, a pair of "
                 "space delimited words, individal words are highlighted")
           << "<br>"
           << tr("<b>&quot;foo bar&quot;</b>: search for <b>foo bar</b>",
                 "Search phrase example, illustrates quotes usage, double quoted"
                 "pair of space delimited words, the whole pair is highlighted")
           << "</p></body></html>" << flush;
    m_ui->m_searchPattern->setToolTip(searchPatternHint);

    // Icons
    m_ui->searchButton->setIcon(GuiIconProvider::instance()->getIcon("edit-find"));
    m_ui->downloadButton->setIcon(GuiIconProvider::instance()->getIcon("download"));
    m_ui->goToDescBtn->setIcon(GuiIconProvider::instance()->getIcon("application-x-mswinurl"));
    m_ui->pluginsButton->setIcon(GuiIconProvider::instance()->getIcon("preferences-system-network"));
    m_ui->copyURLBtn->setIcon(GuiIconProvider::instance()->getIcon("edit-copy"));
    connect(m_ui->tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));

    m_searchEngine = new SearchEngine;
    connect(m_searchEngine, SIGNAL(searchStarted()), SLOT(searchStarted()));
    connect(m_searchEngine, SIGNAL(newSearchResults(QList<SearchResult>)), SLOT(appendSearchResults(QList<SearchResult>)));
    connect(m_searchEngine, SIGNAL(searchFinished(bool)), SLOT(searchFinished(bool)));
    connect(m_searchEngine, SIGNAL(searchFailed()), SLOT(searchFailed()));
    connect(m_searchEngine, SIGNAL(torrentFileDownloaded(QString)), SLOT(addTorrentToSession(QString)));

    // Fill in category combobox
    fillCatCombobox();
    fillPluginComboBox();

    connect(m_ui->m_searchPattern, SIGNAL(returnPressed()), m_ui->searchButton, SLOT(click()));
    connect(m_ui->m_searchPattern, SIGNAL(textEdited(QString)), this, SLOT(searchTextEdited(QString)));
    connect(m_ui->selectPlugin, SIGNAL(currentIndexChanged(int)), this, SLOT(selectMultipleBox(int)));
}
Beispiel #21
0
OpenBookmarkDialog::OpenBookmarkDialog(QWidget *parent) : Dialog(parent),
	m_completer(nullptr),
	m_ui(new Ui::OpenBookmarkDialog)
{
	m_ui->setupUi(this);

	m_completer = new QCompleter(new QStringListModel(BookmarksManager::getKeywords()), m_ui->lineEdit);
	m_completer->setCaseSensitivity(Qt::CaseSensitive);
	m_completer->setCompletionMode(QCompleter::InlineCompletion);
	m_completer->setFilterMode(Qt::MatchStartsWith);

	connect(this, SIGNAL(accepted()), this, SLOT(openBookmark()));
	connect(m_ui->lineEdit, SIGNAL(textEdited(QString)), this, SLOT(setCompletion(QString)));
}
Beispiel #22
0
QWidget* PredicatUVObligatoire::getEditorWidget(QWidget *parent)
{
    QHBoxLayout *lay = new QHBoxLayout(parent);
    QLineEdit *line = new QLineEdit(uv, parent);
    QWidget* container = new QWidget(parent);

    connect(line, SIGNAL(textEdited(QString)), this, SLOT(updateUv(QString)));

    lay->addWidget(new QLabel("UV obligatoire", parent));
    lay->addWidget(line);
    container->setLayout(lay);
    connect(this, SIGNAL(destroyed()), container, SLOT(deleteLater()));
    return container;
}
void PropertiesManager::createRegimeProperties(RegimeGraphicsItem *i)
{
    QLabel *label = new QLabel("<b>Edit Regime</b>");
    addRow(label);
    QLineEdit *edit_name = new QLineEdit();
    edit_name->installEventFilter(&eventFilterObject);
    edit_name->setText(i->getRegimeName());
    edit_name->setValidator(validator);
    connect(edit_name, SIGNAL(textEdited(QString)), i, SLOT(setRegimeName(QString)));
    addRow(tr("&Name:"),edit_name);

    root->addItemsToolbar->addAction(root->actionAddTimeDerivative);
    root->actionDeleteItems->setEnabled(true);
}
LabelEditWidget::LabelEditWidget( QWidget* parent )
    : QWidget( parent ),
      d( new Private() )
{
    d->q = this;

    d->m_labelContainer = new QWidget( this );
    d->m_label = new KSqueezedTextLabel( d->m_labelContainer );
    d->m_label->installEventFilter( this );
    d->m_button = new QToolButton( d->m_labelContainer );
    d->m_button->setIcon( KIcon( "edit-rename" ) );
    d->m_button->setAutoRaise( true );

    QHBoxLayout* lay = new QHBoxLayout( d->m_labelContainer );
    lay->setMargin( 0 );
    lay->addWidget( d->m_label );
    lay->addWidget( d->m_button );

    d->m_lineEdit = new KLineEdit( this );
    d->m_lineEdit->installEventFilter( this );

    d->m_stack = new QStackedLayout( this );
    d->m_stack->setMargin( 0 );
    d->m_stack->addWidget( d->m_labelContainer );
    d->m_stack->addWidget( d->m_lineEdit );

    connect( d->m_lineEdit, SIGNAL( textEdited(QString) ),
             this, SIGNAL( textEdited(QString) ) );
    connect( d->m_lineEdit, SIGNAL( textChanged(QString) ),
             this, SLOT( _k_textChanged(QString) ) );
    connect( d->m_lineEdit, SIGNAL( editingFinished() ),
             this, SLOT( _k_editingFinished() ) );
    connect( d->m_button, SIGNAL( clicked() ),
             this, SLOT( _k_buttonClicked() ) );

    d->m_stack->setCurrentWidget( d->m_labelContainer );
}
Beispiel #25
0
bool CLineEdit::setEditMode(bool p)
{
  if (p == _editMode)
    return p;

  if (!_canEdit)
    return false;

  _editMode=p;
  _modeAct->setChecked(p);

  if (_x_preferences)
  {
    if (!_x_preferences->boolean("ClusterButtons"))
    {
      if (_editMode)
        _menuLabel->setPixmap(QPixmap(":/widgets/images/edit.png"));
      else
        _menuLabel->setPixmap(QPixmap(":/widgets/images/magnifier.png"));
    }

    if (!_x_metrics->boolean("DisableAutoComplete") && _editMode)
      disconnect(this, SIGNAL(textEdited(QString)), this, SLOT(sHandleCompleter()));
    else if (!_x_metrics->boolean("DisableAutoComplete"))
      connect(this, SIGNAL(textEdited(QString)), this, SLOT(sHandleCompleter()));
  }
  sUpdateMenu();

  setDisabled(_editMode &&
              _x_metrics->value("CRMAccountNumberGeneration") == "A");

 if (!_editMode)
   selectAll();

  emit editable(p);
  return p;
}
Direct_Kernel_Boot::Direct_Kernel_Boot(QWidget *parent) :
    _QWidget(parent)
{
    loaderLabel = new QLabel(tr("Boot loader path:"), this);
    kernelLabel = new QLabel(tr("Kernel path:"), this);
    initrdLabel = new QLabel(tr("Initrd path:"), this);
    cmdlineLabel = new QLabel(tr("Command line:"), this);
    dtbLabel = new QLabel(
tr("Path to the (optional) device tree binary (dtb) image in the host OS:"),
                this);
    loader = new Path_To_File(this);
    QString _placeHolderText = QString("/usr/lib/xen/boot/hvmloader");
    loader->setPlaceholderText(_placeHolderText);
    kernel = new Path_To_File(this);
    _placeHolderText = QString("/root/f21-i386-vmlinuz");
    kernel->setPlaceholderText(_placeHolderText);
    initrd = new Path_To_File(this);
    _placeHolderText = QString("/root/f21-i386-initrd");
    initrd->setPlaceholderText(_placeHolderText);
    cmdline = new QLineEdit(this);
    cmdline->setPlaceholderText("console=ttyS0 ks=http://example.com/f21-i386/os/");
    dtb = new Path_To_File(this);
    _placeHolderText = QString("/root/ppc.dtb");
    dtb->setPlaceholderText(_placeHolderText);
    commonLayout = new QVBoxLayout(this);
    commonLayout->addWidget(loaderLabel);
    commonLayout->addWidget(loader);
    commonLayout->addWidget(kernelLabel);
    commonLayout->addWidget(kernel);
    commonLayout->addWidget(initrdLabel);
    commonLayout->addWidget(initrd);
    commonLayout->addWidget(cmdlineLabel);
    commonLayout->addWidget(cmdline);
    commonLayout->addWidget(dtbLabel);
    commonLayout->addWidget(dtb);
    commonLayout->insertStretch(-1);
    setLayout(commonLayout);
    // dataChanged connections
    connect(loader, SIGNAL(dataChanged()),
            this, SLOT(stateChanged()));
    connect(kernel, SIGNAL(dataChanged()),
            this, SLOT(stateChanged()));
    connect(initrd, SIGNAL(dataChanged()),
            this, SLOT(stateChanged()));
    connect(cmdline, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
    connect(dtb, SIGNAL(dataChanged()),
            this, SLOT(stateChanged()));
}
Beispiel #27
0
arOpenItem::arOpenItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);

    _commprcnt = 0.0;

    _save = _buttonBox->button(QDialogButtonBox::Save);
    _save->setDisabled(true);

    connect(_buttonBox,      SIGNAL(accepted()),                 this, SLOT(sSave()));
    connect(_buttonBox,      SIGNAL(rejected()),                 this, SLOT(sClose()));
    connect(_cust,           SIGNAL(newId(int)),                this, SLOT(sPopulateCustInfo(int)));
    connect(_cust,           SIGNAL(valid(bool)),               _save, SLOT(setEnabled(bool)));
    connect(_terms,          SIGNAL(newID(int)),                this, SLOT(sPopulateDueDate()));
    connect(_docDate,        SIGNAL(newDate(const QDate&)),     this, SLOT(sPopulateDueDate()));
    connect(_taxLit,         SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail()));
    connect(_amount,         SIGNAL(valueChanged()),            this, SLOT(sCalculateCommission()));
    connect(_docNumber,      SIGNAL(textEdited(QString)),       this, SLOT(sReleaseNumber()));

    _last = -1;
    _aropenid = -1;
    _seqiss = 0;

    _arapply->addColumn(tr("Type"),            _dateColumn, Qt::AlignCenter,true, "doctype");
    _arapply->addColumn(tr("Doc. #"),                   -1, Qt::AlignLeft,  true, "docnumber");
    _arapply->addColumn(tr("Apply Date"),      _dateColumn, Qt::AlignCenter,true, "arapply_postdate");
    _arapply->addColumn(tr("Dist. Date"),      _dateColumn, Qt::AlignCenter,true, "arapply_distdate");
    _arapply->addColumn(tr("Amount"),         _moneyColumn, Qt::AlignRight, true, "arapply_applied");
    _arapply->addColumn(tr("Currency"),    _currencyColumn, Qt::AlignLeft,  true, "currabbr");
    _arapply->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight, true, "baseapplied");

    _printOnPost->setVisible(false);

    if (omfgThis->singleCurrency())
        _arapply->hideColumn("currabbr");

    _cust->setType(CLineEdit::ActiveCustomers);
    _terms->setType(XComboBox::ARTerms);
    _salesrep->setType(XComboBox::SalesReps);

    _altSalescatid->setType(XComboBox::SalesCategoriesActive);

    _rsnCode->setType(XComboBox::ReasonCodes);

    _journalNumber->setEnabled(FALSE);

    _altAccntid->setType(GLCluster::cRevenue | GLCluster::cExpense);
}
Beispiel #28
0
GoodsDialogView::GoodsDialogView(QWidget *parent, GoodsDialogController *controller) :
    QDialog(parent)
{
    this->controller = controller;
    lineSymbol = new QLineEdit();
    lineSymbol->setMaxLength(200);
    linePkwiu = new QLineEdit();
    linePriceMagNet = new QLineEdit();
    linePriceMagGross = new QLineEdit();
    lineName = new QLineEdit();
    lineName->setMaxLength(200);
    lineWeight = new QLineEdit();
    radioGood = new QRadioButton();
    radioService = new QRadioButton();
    boxGoodGroup = new QComboBox();
    boxUnit = new QComboBox();
    boxTax = new QComboBox();
    tableFeature = new QTableView();
    picture = new QLabel();
    textDescription = new QTextEdit();
    framePicture = new QFrame();
    addToWarehouseComboBox = new QComboBox();

    createTabWidget();
    createTablePrices();
    createMenu();
    addAllStandardComponents();
    addAllPriceComponents();
    addAllFeatureComponents();
    setTabOrders();
    connect(lineName,SIGNAL(textEdited(QString)),controller,SLOT(nameTyping(QString)));
    connect(lineSymbol,SIGNAL(textEdited(QString)),controller,SLOT(checkAutoSymbol(QString)));

    this->setMaximumSize(650,460);
    this->setMinimumSize(650,460);
}
Beispiel #29
0
FileFsType::FileFsType(QWidget *parent, QString _type) :
    _FsType(parent, _type)
{
    source->setPlaceholderText(tr("Source host file"));
    target->setPlaceholderText(tr("Target guest directory"));
    connect(sourceLabel, SIGNAL(clicked()),
            this, SLOT(getSourcePath()));
    // dataChanged connections
    connect(source, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
    connect(target, SIGNAL(textEdited(QString)),
            this, SLOT(stateChanged()));
    connect(readOnly, SIGNAL(toggled(bool)),
            this, SLOT(stateChanged()));
    // Currently this only works with type='mount' for the QEMU/KVM driver.
    //connect(accessMode, SIGNAL(currentIndexChanged(int)),
    //        this, SLOT(stateChanged()));
    connect(driver, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
    connect(wrPolicy, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
    connect(format, SIGNAL(currentIndexChanged(int)),
            this, SLOT(stateChanged()));
}
Beispiel #30
0
dlgSetup::dlgSetup(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::dlgSetup)
{
    ui->setupUi(this);

    ui->comboBaud->insertItems(0,QStringList()
                               <<"300"
                               <<"1200"
                               <<"2400"
                               <<"4800"
                               <<"9600"
                               <<"19200"
                               <<"38400"
                               <<"57600"
                               <<"115200"
                               <<"230400");
    ui->comboBaud->setCurrentIndex(4);  // 9600
    refresh();
    connect(ui->btnRefresh,SIGNAL(clicked()),this,SLOT(refresh()));
    connect(ui->btnClose,SIGNAL(clicked()),this,SLOT(accept()));
    connect(ui->editTerminator,SIGNAL(textEdited(QString)),this,SLOT(calcHex(QString)));
    connect(ui->editTermHex,SIGNAL(textEdited(QString)),this,SLOT(calcAscii(QString)));
}