示例#1
0
OverviewPage::OverviewPage(QWidget *parent, BitcoinGUI *_gui):
    QWidget(parent),
    gui(_gui),
    ui(new Ui::OverviewPage)
{
    ui->setupUi(this);

    //#a13469 #6c3d94

    ui->labelIntroText->setStyleSheet(".QLabel{color:#000000; border: 1px solid black;background-color: #C3C0BB; padding:10px;}");
    ui->labelIntroText->setText("<b>Welcome to SpreadCoin, "
                                "the project that is building a network where any possible application "
                                "or service can be run in a decentralised manner.</b>");
#ifdef Q_OS_WIN32
    ui->labelIntroText->setFixedHeight(50);
#else
    ui->labelIntroText->setFixedHeight(60);
#endif

    ClickableLabel *JumpSelector = new ClickableLabel();//Label(this);
    ClickableLabel *JumpSelector2 = new ClickableLabel();
    ClickableLabel *JumpSelector3 = new ClickableLabel();
    ClickableLabel *JumpSelector4 = new ClickableLabel();

    JumpSelector->setStyleSheet(".ClickableLabel{background-color: #EEEEEE; border: none; border-radius: 10px; padding:10px;}");
    JumpSelector2->setStyleSheet(".ClickableLabel{background-color: #EEEEEE; border: none; border-radius: 10px; padding:10px;}");
    JumpSelector3->setStyleSheet(".ClickableLabel{background-color: #EEEEEE; border: none; border-radius: 10px; padding:10px;}");
    JumpSelector4->setStyleSheet(".ClickableLabel{background-color: #EEEEEE; border: none; border-radius: 10px; padding:10px;}");

    JumpSelector->setWordWrap(true);
    JumpSelector2->setWordWrap(true);
    JumpSelector3->setWordWrap(true);
    JumpSelector4->setWordWrap(true);

    JumpSelector->setCursor(QCursor(Qt::PointingHandCursor));
    JumpSelector2->setCursor(QCursor(Qt::PointingHandCursor));
    JumpSelector3->setCursor(QCursor(Qt::PointingHandCursor));
    JumpSelector4->setCursor(QCursor(Qt::PointingHandCursor));

    JumpSelector->setText("<span style='font-size:12pt;'><b>Wallet</b></span><br><br>"
                   "<span style='font-size:10pt;'>Send and receive coins, view your transactions, manage your address book and backup your wallet.</span>");
    JumpSelector2->setText("<span style='font-size:12pt;'><b>Vanity Gen</b></span><br><br>"
                    "<span style='font-size:10pt;'>Create uniquely recognizable<br>SPR addresses with the in-wallet Vanity Address Generator.</span>");
    JumpSelector3->setText("<span style='font-size:12pt;'><b>Mining</b></span><br><br>"
                    "<span style='font-size:10pt;'>View<br>current and historical<br>network mining data.</span>");
    JumpSelector4->setText("<span style='font-size:12pt;'><b>Settings</b></span><br><br>"
                    "<span style='font-size:10pt;'>Change local network settings, application behaviour and <br>display options.</span>");

    JumpSelector->setAlignment(Qt::AlignCenter);
    JumpSelector2->setAlignment(Qt::AlignCenter);
    JumpSelector3->setAlignment(Qt::AlignCenter);
    JumpSelector4->setAlignment(Qt::AlignCenter);

    JumpSelector->setFixedWidth(200);
    JumpSelector->setMinimumHeight(100);
    JumpSelector2->setFixedWidth(200);
    JumpSelector2->setMinimumHeight(100);
    JumpSelector3->setFixedWidth(200);
    JumpSelector3->setMinimumHeight(100);
    JumpSelector4->setFixedWidth(200);
    JumpSelector4->setMinimumHeight(100);

    ui->gridLayout->addWidget(JumpSelector,0,0,Qt::AlignCenter);
    ui->gridLayout->addWidget(JumpSelector2,0,1,Qt::AlignCenter);
    ui->gridLayout->addWidget(JumpSelector3,1,0,Qt::AlignCenter);
    ui->gridLayout->addWidget(JumpSelector4,1,1,Qt::AlignCenter);

    connect(JumpSelector, SIGNAL(clicked()), this,SLOT(gotoSendCoinsPage()));
    connect(JumpSelector2, SIGNAL(clicked()), this,SLOT(gotoVanityGenPage()));
    connect(JumpSelector3, SIGNAL(clicked()), this,SLOT(gotoMiningInfoPage()));
    connect(JumpSelector4, SIGNAL(clicked()), this,SLOT(gotoSettings()));


    ui->linkLabel1->setStyleSheet(".QLabel{color:#FFFFFF; background-color: #6c3d94; border: none; border-radius: 10px; padding:10px;}");
    ui->linkLabel2->setStyleSheet(".QLabel{color:#FFFFFF; background-color: #6c3d94; border: none; border-radius: 10px; padding:10px;}");
    ui->linkLabel3->setStyleSheet(".QLabel{color:#FFFFFF; background-color: #6c3d94; border: none; border-radius: 10px; padding:10px;}");

    ui->linkLabel1->setOpenExternalLinks(true);
    ui->linkLabel2->setOpenExternalLinks(true);
    ui->linkLabel3->setOpenExternalLinks(true);

    ui->linkLabel1->setTextFormat(Qt::RichText);

    ui->linkLabel1->setText("<a style='text-decoration:none; ' href='http://www.spreadcoin.info'>"
                            "<span style='font-size:12pt; font-weight:300; color:#FFFFFF;'><b>Official Website</b></span><br>"
                            "<span style='font-size:8pt; font-weight:300; color:#FFFFFF;'>For the most up-to-date Downloads or News</span>"
                            "</a>");
    ui->linkLabel2->setText("<a style='text-decoration:none; ' href='http://www.spreadcointalk.org'>"
                            "<span style='font-size:12pt; font-weight:300; color:#FFFFFF;'><b>Official Forum</b></span><br>"
                            "<span style='font-size:8pt; font-weight:300; color:#FFFFFF;'>For Tutorials and Technical Support</span>"
                            "</a>");
    ui->linkLabel3->setText("<a style='text-decoration:none; ' href='https://bitcointalk.org/index.php?topic=1045373.0'>"
                            "<span style='font-size:12pt; font-weight:300; color:#FFFFFF;'><b>Bitcointalk Forum</b></span><br>"
                            "<span style='font-size:8pt; font-weight:300; color:#FFFFFF;'>For General Discussion</span>"
                            "</a>");
}
示例#2
0
PermissionsSetupPage::PermissionsSetupPage( QWidget *parent ) : QWidget( parent )
{
	QGridLayout * layout = new QGridLayout( this );
	layout->cellRect( 1, 1 );
	layout->setMargin( 0 );
	layout->setSpacing( 0 );
	QSpacerItem *spacer_top = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( spacer_top, 0, 1 );
	QSpacerItem *spacer_left = new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Minimum );
	layout->addItem( spacer_left, 1, 0 );

	// Logo
	QPixmap permissionsSetupPixmap ( KStandardDirs::locate( "data", "krecipes/pics/dbpermissions.png" ) );
	logo = new QLabel( this );
	logo->setPixmap( permissionsSetupPixmap );
	logo->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
	layout->addWidget( logo, 1, 1, 8, 1, Qt::AlignTop );

	// Spacer to separate the logo
	QSpacerItem *logoSpacer = new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::Minimum );
	layout->addItem( logoSpacer, 1, 2 );

	// Explanation Text
	permissionsText = new QLabel( this );
	permissionsText->setText( i18n( "<p>This dialog will allow you to specify a MySQL account that has the necessary permissions to access the Krecipes MySQL database.</p><p><b><font size=\"+1\">Most users that use Krecipes and MySQL for the first time can just leave the default parameters and press \'Next\'.</font></b></p> <p>If you set a MySQL root password before, or you have already permissions as normal user, click on the appropriate option. Otherwise the account 'root' will be used, with no password.</p><p>[For security reasons, we strongly encourage you to setup a MySQL root password if you have not done so yet. Just type as root: mysqladmin password <i>your_password</i>]</p>" ) );
	permissionsText->setWordWrap(true);
	permissionsText->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum );
	permissionsText->setAlignment( Qt::AlignTop );
	layout->addWidget( permissionsText, 1, 3 );

	// Text spacer
	QSpacerItem *textSpacer = new QSpacerItem( 10, 30, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( textSpacer, 2, 3 );

	// "The user already has permissions" checkbox
	//FIXME: We need to do a workaround to have word wrapping in QCheckBox.
	//see http://bugreports.qt.nokia.com/browse/QTBUG-5370
	KHBox * noSetupContainer = new KHBox;
	noSetupCheckBox = new QCheckBox( noSetupContainer );
	noSetupCheckBox->setObjectName( "noSetupCheckBox" );
	noSetupCheckBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
	ClickableLabel * noSetupLabel = new ClickableLabel(
		i18n( "I have already set the necessary permissions" ),
		noSetupContainer );
	noSetupLabel->setWordWrap( true );
	connect( noSetupLabel, SIGNAL(clicked()), noSetupCheckBox, SLOT(click()) );
	layout->addWidget( noSetupContainer, 3, 3 );

	QSpacerItem *checkBoxSpacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( checkBoxSpacer, 4, 3 );

	// root checkbox
	//FIXME: We need to do a workaround to have word wrapping in QCheckBox.
	//see http://bugreports.qt.nokia.com/browse/QTBUG-5370
	KHBox * rootContainer = new KHBox;
	rootCheckBox = new QCheckBox( rootContainer );
	rootCheckBox->setObjectName( "rootCheckBox" );
	rootCheckBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
	ClickableLabel * rootLabel = new ClickableLabel(
		i18n( "I have already set a MySQL root/admin account" ),
		rootContainer );
	rootLabel->setWordWrap( true );
	connect( rootLabel, SIGNAL(clicked()), rootCheckBox, SLOT(click()) );
	layout->addWidget( rootContainer, 5, 3 );

	QSpacerItem *rootInfoSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum, QSizePolicy::Fixed );
	layout->addItem( rootInfoSpacer, 6, 3 );

	// MySQL root/admin info
	QGroupBox *rootInfoGBox = new QGroupBox( this );
	QFormLayout *rootInfoLayout = new QFormLayout;
	rootInfoGBox->setTitle( i18n( "MySQL Administrator Account" ) );
	rootInfoGBox->setEnabled( false ); // Disable by default
	// User Entry
	userEdit = new KLineEdit( rootInfoGBox );
	userEdit->setText( "root" );
	rootInfoLayout->addRow( i18nc("@label:textbox Database Username", "Username:"******"Password:" ), passEdit );
	rootInfoGBox->setLayout(rootInfoLayout);
	layout->addWidget( rootInfoGBox, 7, 3 );

	// Bottom spacer
	QSpacerItem *bottomSpacer = new QSpacerItem( 10, 20, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding );
	layout->addItem( bottomSpacer, 8, 1 );

	// Connect Signals & slots

	connect( rootCheckBox, SIGNAL( toggled( bool ) ), rootInfoGBox, SLOT( setEnabled( bool ) ) );
	connect( rootCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( rootCheckBoxChanged( bool ) ) );
	connect( noSetupCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( noSetupCheckBoxChanged( bool ) ) );
}