Пример #1
0
void ConnectFriendWizard::setTitleText(QWizardPage *page, const QString &title)
{
	if (!page) {
		return;
	}

	page->setTitle(title);

	mTitleString.remove(page);
	updateStylesheet();
}
Пример #2
0
ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
	QWizard(parent), ui(new Ui::ConnectFriendWizard)
{
	ui->setupUi(this);

	mTitleFontSize = 0; // Standard
	mTitleFontWeight = 0; // Standard

// this define comes from Qt example. I don't have mac, so it wasn't tested
#ifndef Q_OS_MAC
	setWizardStyle(ModernStyle);
#endif

	setStartId(Page_Intro);

// at this moment I don't know, what information should be in help
//	setOption(HaveHelpButton, true);
//	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

	setPixmap(QWizard::LogoPixmap, QPixmap(":/images/connect/connectFriendLogo.png"));

// we have no good pictures for watermarks
//	setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/connectFriendWatermark.png"));

	/* register global fields */
	ui->ErrorMessagePage->registerField("errorMessage", ui->messageLabel, "text");

	/* disable not used pages */
	ui->foffRadioButton->hide();
	ui->rsidRadioButton->hide();
	
	ui->fr_label->hide();
	ui->requestinfolabel->hide();

    connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->_options_GB,SLOT(setEnabled(bool))) ;
    connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ;
	
    connect(ui->gmailButton, SIGNAL(clicked()), this, SLOT(inviteGmail()));
    connect(ui->yahooButton, SIGNAL(clicked()), this, SLOT(inviteYahoo()));
    connect(ui->outlookButton, SIGNAL(clicked()), this, SLOT(inviteOutlook()));
    connect(ui->aolButton, SIGNAL(clicked()), this, SLOT(inviteAol()));
    connect(ui->yandexButton, SIGNAL(clicked()), this, SLOT(inviteYandex()));
    connect(ui->emailButton, SIGNAL(clicked()), this, SLOT(runEmailClient2()));

    
    subject = tr("RetroShare Invitation");
    body = GetStartedDialog::GetInviteText();
	
    body += "\n" + GetStartedDialog::GetCutBelowText();
    body += "\n\n" + QString::fromUtf8(rsPeers->GetRetroshareInvite(false).c_str());

	updateStylesheet();
}
Пример #3
0
void RecipeWidget::init(HeadcookerWindow *win)
{
    ui->setupUi(this);
    this->win = win;

    ui->bodyWidget->setObjectName("body");

    ui->instructions->setObjectName("instructions");
    ui->instructions->verticalScrollBar()->setObjectName("scrollbar");
    ui->backButton->setObjectName("backButton");
    ui->tagWidget->setObjectName("tagBox");
    ui->ingredientBox->setObjectName("ingredientBox");
    ui->instructionBox->setObjectName("instructionBox");
    ui->recipeName->setObjectName("headline");
    ui->subtitle->setObjectName("subtitle");
    ui->servingsText->setObjectName("metaInfo");
    ui->servingsEdit->setObjectName("inputArea");

    connect(ui->backButton, SIGNAL(clicked()), this, SLOT(back()));

    ui->recipeName->setText(recipe->getTitle());
    ui->subtitle->setText(recipe->getSubtitle());
    ui->instructions->setText(recipe->getInstructions());

    updateIngredients();

    //Metainformations
    ui->servingsEdit->setText(QString::number(recipe->getServings()));

    if (ui->metaInfoWidget->layout() != NULL)
        delete ui->metaInfoWidget->layout();
    FlowLayout *metaInfoLayout = new FlowLayout;
    ui->metaInfoWidget->setLayout(metaInfoLayout);
    for (QPair<QString, QString> metaInfo : recipe->getMetaInfo()) {
        QLabel *name = new QLabel(metaInfo.first);
        name->setObjectName("metaInfo");
        QFont font = name->font();
        font.setBold(true);
        name->setFont(font);

        QLabel *value = new QLabel(metaInfo.second);
        value->setObjectName("text");
        metaInfoLayout->addWidget(name);
        metaInfoLayout->addWidget(value);
    }

    //Tags
    if (ui->tagWidget->layout()) {
        delete ui->tagWidget->layout();
    }

    tagLayout = new FlowLayout;
    ui->tagWidget->setLayout(tagLayout);
    for (QString tag : recipe->getTags()) {
       addTag(tag);
    }

    ui->servingsEdit->setValidator(new QDoubleValidator);

    addAddTagButton();

    connect(&leftClickMapper, SIGNAL(mapped(QString)), this, SLOT(leftClick(QString)));
    connect(&rightClickMapper, SIGNAL(mapped(QString)), this, SLOT(rightClick(QString)));

    connect(Options::ptr(), SIGNAL(updated()), this, SLOT(updateStylesheet()));

    connect(ui->servingsEdit, SIGNAL(textChanged(QString)), this, SLOT(updateIngredients(QString)));

    updateStylesheet();
}
Пример #4
0
void ConnectFriendWizard::setTitleColor(const QString &color)
{
	mTitleColor = color;
	updateStylesheet();
}
Пример #5
0
void ConnectFriendWizard::setTitleFontWeight(int weight)
{
	mTitleFontWeight = weight;
	updateStylesheet();
}
Пример #6
0
void ConnectFriendWizard::setTitleFontSize(int size)
{
	mTitleFontSize = size;
	updateStylesheet();
}