Пример #1
0
PropertyPanel::PropertyPanel( QWidget* parent, const char* name, WFlags fl )
	: PropertyPanelBase( parent, name, fl ),
	  component(0L),
	  port(0L)
{
	setTitleFont();
	setTitleColors();
	connect( kapp, SIGNAL( kdisplayFontChanged() ),
			 this, SLOT( setTitleFont() ));
	connect( kapp, SIGNAL( kdisplayPaletteChanged() ),
			 this, SLOT( setTitleColors() ));
	connect( portValueGroup, SIGNAL( clicked(int) ),
			 this, SLOT( pvModeChanged(int) ));
	connect( constantValueEdit, SIGNAL( returnPressed() ),
			 this, SLOT( writePortProperties() ));
	connect( constantValueComboBox, SIGNAL( activated(int) ),
			 this, SLOT( writePortProperties() ));
	connect( portCombo, SIGNAL( activated(int) ),
			 this, SLOT( comboPortSelected(int) ));
	connect( connectButton, SIGNAL( clicked() ),
			 this, SLOT( connectButtonClicked() ));

	constantValueComboBox->hide();
	setEnabled( false );
	tipLabel->hide();
}
Пример #2
0
void myDialog::on_connectPushButton_clicked()
{
    connectPar.ftpServer = ui->ftpServerLineEdit->text();
    connectPar.username = ui->usernameLineEdit->text();
    connectPar.password = ui->passwordLineEdit->text();
    connectPar.remotePath = ui->remotePathLineEdit->text();
    emit connectButtonClicked(connectPar);
    return;
}
Пример #3
0
ConfigDialog::ConfigDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ConfigDialog)
{
    ui->setupUi(this);

    connect(ui->connectButton, SIGNAL(clicked(bool)), this, SLOT(connectButtonClicked()));

    ui->connectButton->setText("Connect");

    t = new QTimer();
    t->setInterval(3000);
    connect(t, SIGNAL(timeout()), this, SLOT(connectButtonClicked()));
    t->start();

    autoConnect = true;
}
Пример #4
0
ConnectionWidget::ConnectionWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ConnectionWidget)
{
    ui->setupUi(this);

    QObject::connect(ui->connect_pb, SIGNAL(clicked()), SLOT(connectButtonClicked()));  //add a function for the Connect button click

    this->show();

    ui->connect_pb->setEnabled(false);
    ui->label->setEnabled(false);
    ui->comPort->setEnabled(false);

    _selected = 0;

    RTLSDisplayApplication::connectReady(this, "onReady()");
}
Пример #5
0
TestClient::TestClient()
    : KMainWindow( 0 ),
      m_status( AppDisconnected ), m_view( new QWidget( this ) )
{
    ui.setupUi( m_view );

    setCentralWidget(m_view);

    networkStatusChanged( Solid::Networking::status() );
    appDisconnected();

    kDebug() << "About to connect";
    connect( Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)), SLOT(networkStatusChanged(Solid::Networking::Status)) );
    kDebug() << "Connected.";
    connect( Solid::Networking::notifier(), SIGNAL(shouldConnect()), this, SLOT(doConnect()) );
    connect( Solid::Networking::notifier(), SIGNAL(shouldDisconnect()), this, SLOT(doDisconnect()) );

    connect( ui.connectButton, SIGNAL(clicked()), SLOT(connectButtonClicked()) );
}
Пример #6
0
ConnectionDialog::ConnectionDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ConnectionDialog)
{
    ui->setupUi(this);

    // Setup validators
    QIntValidator* portVal = new QIntValidator(0, 65535);
    this->ui->lineEditPort->setValidator(portVal);

    // Validator to for name to be only English alphanumeric characters and between 1 and 50 characters
    QRegularExpressionValidator* nameValid = new QRegularExpressionValidator(QRegularExpression("[a-z,A-Z,0-9]{1,50}"), this->ui->lineEditName);
    this->ui->lineEditName->setValidator((nameValid));

    // Allow only inputs which match an IP address to be entered
    QRegularExpressionValidator* ipValid = new QRegularExpressionValidator(QRegularExpression("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"), this->ui->lineEditAddress);
    this->ui->lineEditAddress->setValidator(ipValid);

    // Put ships names in a QStringList
    QStringList ships;
    ships << "PigShip" << "BirdofPreyShip" << "KittenCupPlanet" << "ColourfulShip" << "DuckShip" << "FireflyShip" << "FlyingSaucerShip" << "PlanetTreckShip" << "RingworldPlanet" << "ShippyShip" << "SpaceShuttleShip" << "TARDISShip";
    this->ui->shipNames->addItems(ships);

    // Connect Combo box to update pixmap
    connect(this->ui->shipNames, SIGNAL(currentIndexChanged(QString)), this, SLOT(updateShipImage(QString)));

    // Connect signals
    connect(this->ui->pushButtonJoin, SIGNAL(clicked()), this, SLOT(connectButtonClicked()));
    connect(this->ui->pushButtonQuit, SIGNAL(clicked()), this, SLOT(quitButtonClicked()));

    // Connect color buttons to color selection slot
    connect(this->ui->primColor, SIGNAL(clicked()), this, SLOT(colorSelectPrim()));
    connect(this->ui->secColor, SIGNAL(clicked()), this, SLOT(colorSelectSec()));
    connect(this->ui->tertColor, SIGNAL(clicked()), this, SLOT(colorSelectTert()));

    // Set default values for color selection - randomize so players don't share colors too often
    this->color1 = new QColor();
    this->color1->setRed(rand() % 256);
    this->color1->setGreen(rand() % 256);
    this->color1->setBlue(rand() % 256);

    this->color2 = new QColor();
    this->color2->setRed(rand() % 256);
    this->color2->setGreen(rand() % 256);
    this->color2->setBlue(rand() % 256);

    this->color3 = new QColor();
    this->color3->setRed(rand() % 256);
    this->color3->setGreen(rand() % 256);
    this->color3->setBlue(rand() % 256);

    QPixmap* colorDisplay = new QPixmap(25, 25);
    colorDisplay->fill(*this->color1);
    this->ui->primColorImage->setPixmap(*colorDisplay);
    colorDisplay->fill(*this->color2);
    this->ui->secColorImage->setPixmap(*colorDisplay);
    colorDisplay->fill(*this->color3);
    this->ui->tertColorImage->setPixmap(*colorDisplay);

    // Set image to current label
    int randIndex = qrand() % this->ui->shipNames->count();
    this->ui->shipNames->setCurrentIndex(randIndex);
    this->updateShipImage(this->ui->shipNames->currentText());

    // Load from config file
    QHash<QString, QString> config = Configurator::instance()->getConfig();
    if (config.contains("Address"))
        this->ui->lineEditAddress->setText(config.value("Address"));
    if (config.contains("ServerPort"))
        this->ui->lineEditPort->setText(config.value("ServerPort"));
    if (config.contains("Name"))
        this->ui->lineEditName->setText(config.value("Name"));
}