コード例 #1
0
InputBookCardDialog::InputBookCardDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::InputBookCardDialog)
{
    ui->setupUi(this);
    connect(ui->lineEdit,SIGNAL(textChanged(QString)),this,SLOT(enableOkButton()));
}
コード例 #2
0
ファイル: optionsdialog.cpp プロジェクト: ionomy/ion
void OptionsDialog::doProxyIpChecks(QValidatedLineEdit* pUiProxyIp, QLineEdit* pUiProxyPort)
{
    const std::string strAddrProxy = pUiProxyIp->text().toStdString();
    CService addrProxy;

    // Check for a valid IPv4 / IPv6 address
    if (!(fProxyIpValid = LookupNumeric(strAddrProxy.c_str(), addrProxy))) {
        disableOkButton();
        pUiProxyIp->setValid(false);
        ui->statusLabel->setStyleSheet("QLabel { color: red; }");
        ui->statusLabel->setText(tr("The supplied proxy address is invalid."));
        return;
    }
    // Check proxy port
    if (!pUiProxyPort->hasAcceptableInput()){
        disableOkButton();
        ui->statusLabel->setStyleSheet("QLabel { color: red; }");
        ui->statusLabel->setText(tr("The supplied proxy port is invalid."));
        return;
    }

    proxyType checkProxy = proxyType(addrProxy);
    if (!checkProxy.IsValid()) {
        disableOkButton();
        ui->statusLabel->setStyleSheet("QLabel { color: red; }");
        ui->statusLabel->setText(tr("The supplied proxy settings are invalid."));
        return;
    }

    enableOkButton();
    ui->statusLabel->clear();
}
コード例 #3
0
ファイル: addnewmenu.cpp プロジェクト: crysislinux/openmenus
AddNewMenu::AddNewMenu(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddNewMenu)
{
    ui->setupUi(this);
    QRegExp regExp("[0-9]{1,14}([.][0-9]{0,4})?");
    ui->unitPrice->setValidator(new QRegExpValidator(regExp, this));
    connect(ui->okButton, SIGNAL(clicked()), this, SLOT(okClicked()));
    connect(ui->imagesButton, SIGNAL(clicked()), this, SLOT(selectImages()));
    connect(ui->mainImageButton, SIGNAL(clicked()), this, SLOT(selectMainImage()));
    connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(ui->name, SIGNAL(textChanged(QString)), this, SLOT(enableOkButton()));
    connect(ui->unitPrice, SIGNAL(textChanged(QString)), this, SLOT(enableOkButton()));
    ui->name->setFocus();
    ui->okButton->setEnabled(false);
}
コード例 #4
0
void ColumnSelectorDialog::on_removeAllButton_clicked()
{
    if(WidgetHelper::moveAllListViewItems(ui->selectedColumnsList, ui->allColumnsList)){
        allColumnsModel->sort(0);
        enableOkButton();
    }
}
コード例 #5
0
void DevicePropertiesDialog::show(const QString &path, const DeviceOptions &opts, const QList<DeviceStorage> &storage, int props, int disabledProps)
{
    devProp->update(path, opts, storage, props, disabledProps);
    connect(devProp, SIGNAL(updated()), SLOT(enableOkButton()));
    Dialog::show();
    enableButtonOk(false);
}
コード例 #6
0
ファイル: connectdialog.cpp プロジェクト: AchimTuran/kodimote
void ConnectDialog::removeHost()
{
    Kodi::instance()->hostModel()->removeHost(m_hostView->currentIndex().row());
    enableOkButton();
    if(Kodi::instance()->hostModel()->rowCount(QModelIndex()) == 0) {
        m_stackedLayout->setCurrentIndex(1);
    }
}
コード例 #7
0
ReadInput::ReadInput(QWidget *parent){
    this->setupUi(this);
    this->is_accepted = 0;
    connect(this->EnterExpression,SIGNAL(textChanged(QString)),this,SLOT(enableOkButton(QString)));
    connect(this->acceptButton,SIGNAL(clicked()),this,SLOT(accept()));
    connect(this->acceptButton,SIGNAL(clicked()),this,SLOT(bottunPressed()));
    connect(this->cancelButton,SIGNAL(clicked()),this,SLOT(reject()));
//    connect(this->cancelButton,SIGNAL(clicked()),this,SLOT(is_accept()));
}
bool AddHostDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: enableOkButton(); break;
    default:
	return AddHostDialogBase::qt_invoke( _id, _o );
    }
    return TRUE;
}
コード例 #9
0
void RemoteDevicePropertiesDialog::show(const DeviceOptions &opts, const RemoteFsDevice::Details &det, int props, int disabledProps, bool create, bool isConnected)
{
    isCreate=create;
    if (isCreate) {
        setCaption(tr("Add Device"));
    }

    if (create) {
        devProp->setVisible(false);
    } else {
        tab->setCurrentIndex(isConnected ? 1 : 0);
    }
    devProp->setEnabled(!create && isConnected);
    devProp->showRemoteConnectionNote(!isConnected);
    devProp->update(QString(), opts, QList<DeviceStorage>(), props, disabledProps);
    remoteProp->update(det, create, isConnected);
    connect(devProp, SIGNAL(updated()), SLOT(enableOkButton()));
    connect(remoteProp, SIGNAL(updated()), SLOT(enableOkButton()));
    Dialog::show();
    enableButtonOk(false);
}
コード例 #10
0
ColumnSelectorDialog::ColumnSelectorDialog(const QStringList &columnList,
                                           const QStringList &selColumnList,
                                           QWidget *parent, bool changeCase) :
    QDialog(parent),
    ui(new Ui::ColumnSelectorDialog),
    allowEmptySelection(false)
{
    ui->setupUi(this);

    allColumnsModel=new QStandardItemModel(ui->allColumnsList);
    allColumnsModel->setSortRole(Qt::UserRole + 1);
    selectedColumnsModel=new QStandardItemModel(ui->selectedColumnsList);

    ui->allColumnsList->setModel(allColumnsModel);
    ui->selectedColumnsList->setModel(selectedColumnsModel);

    int maxButtonWidth=ui->addOneButton->fontMetrics().width(">>>>");
    ui->addOneButton->setMaximumWidth(maxButtonWidth);
    ui->addAllButton->setMaximumWidth(maxButtonWidth);
    ui->removeOneButton->setMaximumWidth(maxButtonWidth);
    ui->removeAllButton->setMaximumWidth(maxButtonWidth);

    ui->allColumnsList->setMinimumWidth(150);
    ui->selectedColumnsList->setMinimumWidth(150);

    QStandardItem *newItem=0;
    int colCount=columnList.size();
    for(int i=0; i<colCount; ++i){
        newItem=new QStandardItem(changeCase ? columnList.at(i).toUpper().trimmed() : columnList.at(i));
        newItem->setData(i, Qt::UserRole + 1); //remember position
        newItem->setEditable(false);
        allColumnsModel->appendRow(newItem);
    }

    int selColCount=selColumnList.count();
    QList<QStandardItem*> foundItems;
    //QItemSelectionModel *selModel=ui->allColumnsList->selectionModel();
    for(int i=0; i<selColCount; ++i){
        foundItems=allColumnsModel->findItems(selColumnList.at(i));
        if(foundItems.count()>0){
            //selModel->select(foundItems.at(0)->index(), QItemSelectionModel::Select);
            selectedColumnsModel->appendRow(allColumnsModel->takeRow(foundItems.at(0)->index().row()));
        }
    }
    //if(selColCount>0){
    //    on_addOneButton_clicked();
    //    selModel->clear();
    //}

    enableOkButton();
}
コード例 #11
0
ファイル: connectdialog.cpp プロジェクト: AchimTuran/kodimote
void ConnectDialog::showManualLayout()
{
    if(m_stackedLayout->currentIndex() != 2) {
        m_stackedLayout->setCurrentIndex(2);
        m_manualButton->setText(tr("Back"));
    } else {
        if(Kodi::instance()->hostModel()->rowCount(QModelIndex()) > 0) {
            m_stackedLayout->setCurrentIndex(0);
        } else {
            m_stackedLayout->setCurrentIndex(1);
        }
        m_manualButton->setText(tr("Add Host"));
    }
    enableOkButton();
}
コード例 #12
0
void OptionsDialog::doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort)
{
    Q_UNUSED(nProxyPort);

    CService addrProxy;

    /* Check for a valid IPv4 / IPv6 address */
    if (!(fProxyIpsValid = LookupNumeric(pUiProxyIp->text().toStdString().c_str(), addrProxy)))
    {
        disableOkButton();
        pUiProxyIp->setValid(false);
        ui->statusLabel->setStyleSheet("QLabel { color: red; }");
        ui->statusLabel->setText(tr("The supplied proxy address is invalid."));
    }
    else
    {
        enableOkButton();
        ui->statusLabel->clear();
    }
}
コード例 #13
0
void DlgUpdate::downloadUpdate() {
    setLabel(tr("Downloading update..."));
    enableOkButton(false);
    enableUpdateButton(false);
    uDownloader->beginDownload(updateUrl);
}
コード例 #14
0
    NewProjectDialog::NewProjectDialog(QWidget *parent)
        : QDialog(parent)
        , _newProjectDialogForm(new FormNewProjectDialog)
    {
        _newProjectDialogForm->setupUi(this);

		_newProjectDialogForm->buttonOk->setEnabled(false);

		_sizes["320x240"] = QPoint(320, 240);
		_sizes["480x640"] = QPoint(480, 640);
		_sizes["800x600"] = QPoint(800, 600);
		_sizes["960x640"] = QPoint(960, 640);
		_sizes["1024x768"] = QPoint(1024, 768);
		_sizes["1136x640"] = QPoint(1136, 640);
		_sizes["1280x720"] = QPoint(1280, 720);
		_sizes["1600x900"] = QPoint(1600, 900);
		_sizes["1980x1080"] = QPoint(1980, 1080);
		_sizes["2048x1536"] = QPoint(2048, 1536);

		_newProjectDialogForm->comboboxSceernSize->addItem("320x240", QVariant(_sizes["320x240"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("480x640", QVariant(_sizes["480x640"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("800x600", QVariant(_sizes["800x600"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("960x640", QVariant(_sizes["960x640"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("1024x768", QVariant(_sizes["1024x768"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("1136x640", QVariant(_sizes["1136x640"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("1280x720", QVariant(_sizes["1280x720"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("1600x900", QVariant(_sizes["1600x900"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("1980x1080", QVariant(_sizes["1980x1080"]));
		_newProjectDialogForm->comboboxSceernSize->addItem("2048x1536", QVariant(_sizes["2048x1536"]));
		_newProjectDialogForm->comboboxSceernSize->setCurrentIndex(0);

		_newProjectDialogForm->comboboxCurrentOS->addItem("Windows");
		_newProjectDialogForm->comboboxCurrentOS->addItem("Windows8");
		_newProjectDialogForm->comboboxCurrentOS->addItem("Linux");
		_newProjectDialogForm->comboboxCurrentOS->addItem("Android");
		_newProjectDialogForm->comboboxCurrentOS->addItem("iOS");
		_newProjectDialogForm->comboboxCurrentOS->setCurrentIndex(0);

		_newProjectDialogForm->comboboxProjectType->addItem("Game", QVariant(QString(OQSettings::ProjectTypeInfo::_allProjectTypesInfo[OQSettings::ProjectTypeInfo::GameProject]._type.c_str())));
		_newProjectDialogForm->comboboxProjectType->setCurrentIndex(0);

		connect(_newProjectDialogForm->buttonOk, SIGNAL(clicked()), this, SLOT(setSettings()));
		connect(_newProjectDialogForm->buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
		connect(_newProjectDialogForm->checkboxScreenSizeByHand, SIGNAL(toggled(bool)), this, SLOT(modeToggled(bool)));

		connect(_newProjectDialogForm->buttonPathToProjectFolder, SIGNAL(clicked()), this, SLOT(openFolderDialog()));

		connect(_newProjectDialogForm->editPathToProjectFolder, SIGNAL(textChanged(QString)), this, SLOT(enableOkButton()));
		connect(_newProjectDialogForm->editProjectName, SIGNAL(textChanged(QString)), this, SLOT(enableOkButton()));
    }
コード例 #15
0
ファイル: connectdialog.cpp プロジェクト: AchimTuran/kodimote
ConnectDialog::ConnectDialog(QWidget *parent) :
    QDialog(parent)
{

    setAttribute(Qt::WA_DeleteOnClose, true);
    setWindowTitle("Kodimote - " + tr("Connect to Kodi"));

    m_stackedLayout = new QStackedLayout();

    KodiDiscovery *discovery = new KodiDiscovery(this);
    discovery->setContinuousDiscovery(true);

    m_hostView = new QListView();
    m_hostView->setModel(Kodi::instance()->hostModel());
    m_stackedLayout->addWidget(m_hostView);

    QLabel *infoLabel = new QLabel(tr("Searching for Kodi hosts.") + "\n"
      + tr("Please enable the following options in the Services settings of Kodi:") + "\n- "
      + tr("Allow control of Kodi via HTTP") + "\n- "
      + tr("Allow programs on other systems to control Kodi") + "\n- "
      + tr("Announce these services to other systems via Zeroconf") + "\n"
      + tr("If you don't use Zeroconf, add a host manually."));
    infoLabel->setWordWrap(true);
    infoLabel->setAlignment(Qt::AlignCenter);
    m_stackedLayout->addWidget(infoLabel);

    m_manualLayout = new QGridLayout();
    QWidget *manualWidget = new QWidget();
    manualWidget->setLayout(m_manualLayout);
    m_stackedLayout->addWidget(manualWidget);
#ifdef Q_WS_MAEMO_5
    QHBoxLayout *hLayout = new QHBoxLayout();
    hLayout->addLayout(m_stackedLayout);
    setLayout(hLayout);
#else
    QVBoxLayout *vLayout = new QVBoxLayout();
    vLayout->addLayout(m_stackedLayout);
    setLayout(vLayout);
#endif

    m_manualLayout->addWidget(new QLabel(tr("Host:")), 0, 0);

    m_hostName = new QLineEdit();
    m_manualLayout->addWidget(m_hostName, 0, 1);

    m_manualLayout->addWidget(new QLabel(tr("HTTP Port:")), 1, 0);

    m_port = new QLineEdit();
    m_port->setValidator(new QIntValidator());
    m_port->setText("8080");
    m_manualLayout->addWidget(m_port, 1, 1);

    m_manualLayout->addWidget(new QLabel(tr("MAC Address (optional):")), 2, 0);

    m_mac = new QLineEdit();
    m_mac->setInputMask("HH:HH:HH:HH:HH:HH;_");
    m_manualLayout->addWidget(m_mac, 2, 1);

//    gridLayout->addWidget(new QLabel("Username:"******"Password:"******"Connect"));
    m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);

    m_manualButton = m_buttonBox->addButton(tr("Add Host"), QDialogButtonBox::ActionRole);
    connect(m_manualButton, SIGNAL(clicked()), SLOT(showManualLayout()));

    m_removeButton = m_buttonBox->addButton(tr("Remove Host"), QDialogButtonBox::ResetRole);
    connect(m_removeButton, SIGNAL(clicked()), SLOT(removeHost()));
    m_removeButton->setEnabled(false);

    connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    if(Kodi::instance()->hostModel()->rowCount(QModelIndex()) > 0) {
        showHostList();
    } else {
        m_stackedLayout->setCurrentIndex(1);
    }
    connect(Kodi::instance()->hostModel(), SIGNAL(rowsInserted(QModelIndex, int, int)), SLOT(showHostList()));
    connect(m_hostView, SIGNAL(clicked(QModelIndex)), SLOT(enableOkButton()));

#ifdef Q_WS_MAEMO_5
    setMinimumHeight(400);
#endif
}
コード例 #16
0
void ColumnSelectorDialog::on_addAllButton_clicked()
{
    WidgetHelper::moveAllListViewItems(ui->allColumnsList, ui->selectedColumnsList);
    enableOkButton();
}
コード例 #17
0
ファイル: new_game.cpp プロジェクト: cjlano/eliot
NewGame::NewGame(const Dictionary &iDic, QWidget *iParent)
    : QDialog(iParent), m_dic(iDic)
{
    setupUi(this);

    m_blackPalette = lineEditMaster->palette();
    m_redPalette = lineEditMaster->palette();
    m_redPalette.setColor(QPalette::Text, Qt::red);

    radioButtonDuplicate->setToolTip(_q(
            "In duplicate mode, all the players are always faced with the same board and the same rack,\n"
            "thus eliminating any \"luck\" (and tactics).\n"
            "Each player scores the points of the word (s)he found, but only\n"
            "the best move is played on the board.\n"
            "This mode allows an unlimited number of simultaneous players, and is therefore\n"
            "often used for official tournaments."));
    radioButtonFreeGame->setToolTip(_q(
            "This mode is the classical one, often played in family, where players play in turn,\n"
            "each with his own rack. Players are allowed to change letters, thus passing their turn.\n"
            "With only 2 players, some tactics can often be used, because the best move\n"
            "is not necessarily the one with the best score."));
    radioButtonTraining->setToolTip(_q(
            "In training mode, the player can set the rack freely and can see all the possible moves.\n"
            "There is no opponent, the goal is simply to make some progress."));
    radioButtonArbitration->setToolTip(_q(
            "The arbitration mode allows arbitrating a duplicate game, possibly with many players.\n"
            "The arbitrator can set the master move, and keep track of the players moves easily.\n"
            "This mode is ideal for arbitrating duplicate games in clubs or in tournaments."));
    radioButtonTopping->setToolTip(_q(
            "In topping mode, the goal is to find the top as quickly as possible. The player is allowed\n"
            "to try as many moves as possible until he finds the top, but there are penalties\n"
            "when the player takes too much time to find it (or doesn't fint it at all).\n"
            "This mode can be quite difficult, and is mostly intended for experienced players."));

    checkBoxJoker->setToolTip(_q(
            "In a joker game, each rack contains a joker.\n"
            "When a word containing the joker is played on the grid, the joker is then replaced\n"
            "with the corresponding letter from the bag, and the joker stays in the rack.\n"
            "When the corresponding letter is not present in the bag, the joker is placed on the board.\n"
            "This variant, particularly interesting in Duplicate mode, is good to train using the joker."));
    checkBoxExplosive->setToolTip(_q(
            "An explosive game is a bit like a joker game, except that when the computer chooses the rack\n"
            "(containing a joker), it performs a search and finds the best word possible with the rack.\n"
            "Then, if possible, it replaces the joker in the rack with the letter allowing to play this best word.\n"
            "This variant, unlike the joker game, allows playing with a normal-looking rack, but it usually gives\n"
            "much higher scores than in a normal game."));
    checkBox7Among8->setToolTip(_q(
            "With this variant, the rack contains 8 letters instead of 7,\n"
            "but at most 7 can be played at the same time.\n"
            "This allows for more combinations during the game, and thus higher scores."));

    m_helper = new PlayersTableHelper(this, tablePlayers, pushButtonAdd);
    m_helper->addPopupRemoveAction();
    QAction *addToFavAction = new QAction(_q("Mark the selected player(s) as favorites"), this);
    addToFavAction->setStatusTip(_q("Add the selected player(s) to the list of favorite players"));
    QObject::connect(addToFavAction, SIGNAL(triggered()),
                     this, SLOT(addSelectedToFav()));
    m_helper->addPopupAction(addToFavAction);
    m_helper->setUpDown(buttonUp, buttonDown);

    // Initialize the model of the default players
    QList<PlayerDef> fav = PlayersTableHelper::getFavPlayers();
    Q_FOREACH(const PlayerDef &def, fav)
    {
        if (def.isDefault)
            m_helper->addPlayer(def);
    }

    // Default of the default :)
    if (m_helper->getRowCount() == 0)
    {
        m_helper->addPlayer(PlayerDef(_q("Player %1").arg(1), _q(kHUMAN), "", false));
        m_helper->addPlayer(PlayerDef(_q("Eliot"), _q(kAI), "100", false));
    }

    // Enable the Ok button only if there are enough players for the
    // current mode
    QObject::connect(m_helper, SIGNAL(rowCountChanged()),
                     this, SLOT(enableOkButton()));
    QObject::connect(radioButtonDuplicate, SIGNAL(toggled(bool)),
                     this, SLOT(enableOkButton()));
    QObject::connect(radioButtonFreeGame, SIGNAL(toggled(bool)),
                     this, SLOT(enableOkButton()));
    QObject::connect(radioButtonTraining, SIGNAL(toggled(bool)),
                     this, SLOT(enableOkButton()));
    QObject::connect(checkBoxUseMaster, SIGNAL(toggled(bool)),
                     this, SLOT(enableOkButton()));
    QObject::connect(lineEditMaster, SIGNAL(textChanged(QString)),
                     this, SLOT(enableOkButton()));

    QObject::connect(radioButtonDuplicate, SIGNAL(toggled(bool)),
                     this, SLOT(enablePlayers(bool)));
    QObject::connect(radioButtonFreeGame, SIGNAL(toggled(bool)),
                     this, SLOT(enablePlayers(bool)));
    QObject::connect(radioButtonTraining, SIGNAL(toggled(bool)),
                     this, SLOT(enablePlayers(bool)));
    QObject::connect(radioButtonArbitration, SIGNAL(toggled(bool)),
                     this, SLOT(enablePlayers(bool)));
    QObject::connect(radioButtonTopping, SIGNAL(toggled(bool)),
                     this, SLOT(enablePlayers(bool)));

    QObject::connect(radioButtonFreeGame, SIGNAL(toggled(bool)),
                     this, SLOT(enableMasterControls()));

    QObject::connect(checkBoxJoker, SIGNAL(stateChanged(int)),
                     this, SLOT(onJokerChecked(int)));
    QObject::connect(checkBoxExplosive, SIGNAL(stateChanged(int)),
                     this, SLOT(onExplosiveChecked(int)));

    // Master games
    QObject::connect(checkBoxUseMaster, SIGNAL(toggled(bool)),
                     widgetMasterControls, SLOT(setEnabled(bool)));
    QObject::connect(buttonBrowseMaster, SIGNAL(clicked()),
                     this, SLOT(browseMasterGame()));
    QObject::connect(lineEditMaster, SIGNAL(textChanged(QString)),
                     this, SLOT(validateMasterGame(QString)));

    QObject::connect(buttonAddFav, SIGNAL(clicked()),
                     this, SLOT(addFavoritePlayers()));

    // Auto-completion on the master game path
    QCompleter *completer = new QCompleter(this);
    QFileSystemModel *model = new QFileSystemModel(this);
    model->setRootPath(QDir::currentPath());
    completer->setModel(model);
    lineEditMaster->setCompleter(completer);
}
コード例 #18
0
    ui->z->setText(QString::number(z));
    ui->z->setValidator(new QIntValidator());

    getMinAndMax(rooms);

    createBlankTiles();

    foreach (Room *r, rooms) {
        addRoom(r);
    }

    connect(ui->name, SIGNAL(textEdited(QString)),
            this, SLOT(floorNameChanged(QString)));
    connect(ui->z, SIGNAL(textEdited(QString)),
            this, SLOT(enableOkButton()));
    connect(ui->addRoom, SIGNAL(clicked()),
            this, SLOT(addRoom()));
    connect(ui->editRoom, SIGNAL(clicked()),
            this, SLOT(editRoom()));
    connect(ui->removeRoom, SIGNAL(clicked()),
            this, SLOT(removeRoom()));
}

FloorDialog::~FloorDialog()
{
    delete ui;
}

QString FloorDialog::floorName() const
{