Example #1
0
    ConnectionBasicTab::ConnectionBasicTab(ConnectionSettings *settings) :
        _settings(settings)
    {
        QLabel *connectionDescriptionLabel = new QLabel(
            "Choose any connection name that will help you to identify this connection.");
        connectionDescriptionLabel->setWordWrap(true);
        connectionDescriptionLabel->setContentsMargins(0, -2, 0, 20);

        QLabel *serverDescriptionLabel = new QLabel(
            "Specify host and port of MongoDB server. Host can be either IP or domain name.");
        serverDescriptionLabel->setWordWrap(true);
        serverDescriptionLabel->setContentsMargins(0, -2, 0, 20);

        _connectionName = new QLineEdit(_settings->connectionName());
        _serverAddress = new QLineEdit(_settings->serverHost());
        _serverPort = new QLineEdit(QString::number(_settings->serverPort()));
        _serverPort->setFixedWidth(80);

        QGridLayout *connectionLayout = new QGridLayout;
        connectionLayout->addWidget(new QLabel("Name:"),      1, 0);
        connectionLayout->addWidget(_connectionName,         1, 1, 1, 3);
        connectionLayout->addWidget(connectionDescriptionLabel,               2, 1, 1, 3);
        connectionLayout->addWidget(serverDescriptionLabel, 4, 1, 1, 3);
        connectionLayout->addWidget(new QLabel("Address:"),    3, 0);
        connectionLayout->addWidget(_serverAddress,          3, 1);
        connectionLayout->addWidget(new QLabel(":"),      3, 2);
        connectionLayout->addWidget(_serverPort,             3, 3);
        connectionLayout->setAlignment(Qt::AlignTop);

        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addLayout(connectionLayout);
        setLayout(mainLayout);

        _connectionName->setFocus();
    }
    ConnectionBasicTab::ConnectionBasicTab(ConnectionSettings *settings) :
        _settings(settings)
    {
        QLabel *connectionDescriptionLabel = new QLabel(
            "Choose any connection name that will help you to identify this connection.");
        connectionDescriptionLabel->setWordWrap(true);
        connectionDescriptionLabel->setContentsMargins(0, -2, 0, 20);

        QLabel *serverDescriptionLabel = new QLabel(
            "Specify host and port of MongoDB server. Host can be either IP or domain name.");
        serverDescriptionLabel->setWordWrap(true);
        serverDescriptionLabel->setContentsMargins(0, -2, 0, 20);

        _connectionName = new QLineEdit(QtUtils::toQString(_settings->connectionName()));
        _serverAddress = new QLineEdit(QtUtils::toQString(_settings->serverHost()));
        _serverPort = new QLineEdit(QString::number(_settings->serverPort()));
        _serverPort->setFixedWidth(80);
        QRegExp rx("\\d+");//(0-65554)
        _serverPort->setValidator(new QRegExpValidator(rx, this));

        _sslSupport = new QCheckBox("SSL support");
        _sslSupport->setChecked(_settings->sslInfo()._sslSupport);

        _sslPEMKeyFile = new QLineEdit(QtUtils::toQString(_settings->sslInfo()._sslPEMKeyFile));
#ifdef Q_OS_WIN
        QRegExp pathx("([a-zA-Z]:)?([\\\\/][a-zA-Z0-9_.-]+)+[\\\\/]?");
#else
        QRegExp pathx("^\\/?([\\d\\w\\.]+)(/([\\d\\w\\.]+))*\\/?$");
#endif // Q_OS_WIN
        _sslPEMKeyFile->setValidator(new QRegExpValidator(pathx, this));

        _selectFileB = new QPushButton("...");
        _selectFileB->setFixedSize(20,20);       
        VERIFY(connect(_selectFileB, SIGNAL(clicked()), this, SLOT(setSslPEMKeyFile())));

        QGridLayout *connectionLayout = new QGridLayout;
        connectionLayout->addWidget(new QLabel("Name:"),          1, 0);
        connectionLayout->addWidget(_connectionName,              1, 1, 1, 3);
        connectionLayout->addWidget(connectionDescriptionLabel,   2, 1, 1, 3);
        connectionLayout->addWidget(serverDescriptionLabel,       4, 1, 1, 3);
        connectionLayout->addWidget(new QLabel("Address:"),       3, 0);
        connectionLayout->addWidget(_serverAddress,               3, 1);
        connectionLayout->addWidget(new QLabel(":"),              3, 2);
        connectionLayout->addWidget(_serverPort,                  3, 3);
        connectionLayout->setAlignment(Qt::AlignTop);
        connectionLayout->addWidget(_sslSupport,          5, 1);
        connectionLayout->addWidget(_selectFileB,          5, 2);
        connectionLayout->addWidget(_sslPEMKeyFile,          5, 3);

        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addLayout(connectionLayout);
        setLayout(mainLayout);

        sslSupportStateChange(_sslSupport->checkState());
        VERIFY(connect(_sslSupport,SIGNAL(stateChanged(int)),this,SLOT(sslSupportStateChange(int))));

        _connectionName->setFocus();
    }
Example #3
0
AboutDialog::AboutDialog(QWidget* parent)
		: QDialog(parent)
{
	setWindowTitle(tr("About Dolphin"));
	setAttribute(Qt::WA_DeleteOnClose);

	QString text = QStringLiteral("");
	QString small = QStringLiteral("<p style='margin-top:0px; margin-bottom:0px; font-size:9pt;'>");
	QString medium = QStringLiteral("<p style='margin-top:15px; font-size:11pt;'>");

	text.append(QStringLiteral("<p style='font-size:50pt; font-weight:400; margin-bottom:0px;'>") +
		tr("Dolphin") + QStringLiteral("</p>"));
	text.append(QStringLiteral("<p style='font-size:18pt; margin-top:0px;'>%1</p>")
		.arg(QString::fromUtf8(scm_desc_str)));

	text.append(small + tr("Branch: ") + QString::fromUtf8(scm_branch_str) + QStringLiteral("</p>"));
	text.append(small + tr("Revision: ") + QString::fromUtf8(scm_rev_git_str) + QStringLiteral("</p>"));
	text.append(small + tr("Compiled: ") + QStringLiteral(__DATE__ " " __TIME__ "</p>"));

	text.append(medium + tr("Check for updates: ") +
		QStringLiteral("<a href='https://dolphin-emu.org/download'>dolphin-emu.org/download</a></p>"));
	text.append(medium + tr("Dolphin is a free and open-source GameCube and Wii emulator.") + QStringLiteral("</p>"));
	text.append(medium + tr("This software should not be used to play games you do not legally own.") + QStringLiteral("</p>"));
	text.append(medium + QStringLiteral(
		"<a href='https://github.com/dolphin-emu/dolphin/blob/master/license.txt'>%1</a> | "
		"<a href='https://github.com/dolphin-emu/dolphin/graphs/contributors'>%2</a> | "
		"<a href='https://forums.dolphin-emu.org/'>%3</a></p>"
	).arg(tr("Licence")).arg(tr("Authors")).arg(tr("Support")));

	QLabel* text_label = new QLabel(text);
	text_label->setTextInteractionFlags(Qt::TextBrowserInteraction);
	text_label->setOpenExternalLinks(true);

	QLabel* copyright = new QLabel(tr(
		"© 2003-%1 Dolphin Team. “GameCube” and “Wii” are"
		" trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way."
	).arg(QStringLiteral(__DATE__).right(4)));

	QLabel* logo = new QLabel();
	logo->setPixmap(Resources::GetMisc(Resources::LOGO_LARGE));
	logo->setContentsMargins(30, 0, 30, 0);

	QVBoxLayout* main_layout = new QVBoxLayout;
	QHBoxLayout* h_layout = new QHBoxLayout;

	setLayout(main_layout);
	main_layout->addLayout(h_layout);
	main_layout->addWidget(copyright);
	copyright->setAlignment(Qt::AlignCenter);
	copyright->setContentsMargins(0, 15, 0, 0);

	h_layout->setAlignment(Qt::AlignLeft);
	h_layout->addWidget(logo);
	h_layout->addWidget(text_label);
}
Example #4
0
LabelWidget::LabelWidget(QString inputLabel, QWidget *parent)
    :QWidget(parent)
{
    setAutoFillBackground(true);
    setMinimumHeight(36);
    setMaximumHeight(36);
    setContentsMargins(0,0,0,0);

    QLabel *label = new QLabel(inputLabel, this);
    label->setContentsMargins(0,0,0,0);
    label->setStyleSheet("font-family : helvetica; color: black;");
    QLabel *plusIcon = new QLabel(this);
    plusIcon->setPixmap(QPixmap(":/icons/plusIcon.png"));

    //QVBoxLayout *vLabelLayout = new QVBoxLayout();
    //vLabelLayout->setContentsMargins(0,0,0,0);
    //vLabelLayout->setSpacing(0);
    //vLabelLayout->addWidget(label);

    //QVBoxLayout *vIconLayout = new QVBoxLayout();
    //vIconLayout->addWidget(plusIcon);

    QHBoxLayout *hLayout = new QHBoxLayout();
    hLayout->setContentsMargins(27,0,13,0);
    //hLayout->addSpacing(25);
    hLayout->addWidget(label);
    //hLayout->addLayout(vLabelLayout);
    hLayout->addStretch();
    hLayout->addWidget(plusIcon);
    //hLayout->addLayout(vIconLayout);

    setLayout(hLayout);
}
Example #5
0
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setFixedWidth(205);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);

    QLabel* header = new QLabel();
    header->setMinimumSize(156,156);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(156,156);
    header->setContentsMargins(26,26,0,0);
    header->setScaledContents(true);
    toolbar->addWidget(header);

	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");

}
Example #6
0
void ForgetPwdVerifyPage::initializeWidget()
{
    //提示信息页面操作
    hintMsgPage = new HintMsgPage(this);
    hintMsgPage->hide();
    connect(hintMsgPage, SIGNAL(submitClicked(bool)), this, SLOT(on_hintMsgPage(bool)));

    //导航栏
    QString strTitle = tr("验 证");
    QString strLeftBtn = tr("取消");
    QPixmap leftArrowsPixmap(ImagePath::NAVIGATION_LEFT_ARROWS);
    navigationBar = new NavigationBar(this);
    navigationBar->setTitleText(strTitle);
    navigationBar->setLeftText(strLeftBtn);
    navigationBar->setLeftPixMap(leftArrowsPixmap);
    connect(navigationBar, SIGNAL(leftClicked()), this, SLOT(on_btnPrePage_clicked()));

    QHBoxLayout* pHLTop = new QHBoxLayout();
    pHLTop->addWidget(navigationBar);
    pHLTop->setSpacing(0);
    pHLTop->setMargin(0);
    this->setTopbarLayout(pHLTop);

    //验证部分
    QLabel* lblMsgHint = new QLabel(this);
    lblMsgHint->setText(tr("已发送验证码到您的邮箱"));
    lblMsgHint->setFixedHeight(this->screenHeight()*0.05);
    lblMsgHint->setAlignment(Qt::AlignLeft);
    lblMsgHint->setContentsMargins(this->screenWidth()*0.02, 0, this->screenWidth()*0.02, 0);
    lblMsgHint->setStyleSheet("color:rgb(122,123,128); font:16px;");

    editValidate = new QLineEdit(this);
    editValidate->setFixedHeight(this->screenHeight()*0.08);
    editValidate->setPlaceholderText(tr("输入6位验证码"));
    editValidate->setStyleSheet(SheetStyle::FORGETPWD_VALIDATION_LINEEDIT);
    editValidate->setTextMargins(this->screenWidth()*0.02, 0, this->screenWidth()*0.02, 0);

    QVBoxLayout* vbInfoLayout = new QVBoxLayout;
    vbInfoLayout->addWidget(lblMsgHint);
    vbInfoLayout->addWidget(editValidate);
    vbInfoLayout->setAlignment(Qt::AlignCenter);
    vbInfoLayout->setSpacing(0);
    vbInfoLayout->setMargin(0);

    btnNextStep = new QPushButton(tr("下一步"), this);
    btnNextStep->setFixedHeight(this->screenHeight()*0.074);
    btnNextStep->setStyleSheet(SheetStyle::QPUSHBUTTON);
    connect(btnNextStep, SIGNAL(clicked()), this, SLOT(on_btnNextStep_clicked()));

    QVBoxLayout* vbLayout = new QVBoxLayout;
    vbLayout->addLayout(vbInfoLayout);
    vbLayout->addSpacing(this->screenHeight()*0.03);
    vbLayout->addWidget(btnNextStep);
    vbLayout->setAlignment(Qt::AlignTop);
    vbLayout->addStretch(0);
    vbLayout->addSpacing(0);
    vbLayout->setContentsMargins(this->screenWidth()*0.054,this->screenHeight()*0.026,this->screenWidth()*0.054,0);
    this->setBodyPartLayout(vbLayout);
}
    ConnectionSslTab::ConnectionSslTab(ConnectionSettings *settings) :
        _settings(settings)
    {
        _sslPemFilePath = new QLineEdit(QtUtils::toQString(_settings->sslInfo()._sslPEMKeyFile));

/*
// Commented because of this:
// https://github.com/paralect/robomongo/issues/391

#ifdef Q_OS_WIN
        QRegExp pathx("([a-zA-Z]:)?([\\\\/][a-zA-Z0-9_.-]+)+[\\\\/]?");
#else
        QRegExp pathx("^\\/?([\\d\\w\\.]+)(/([\\d\\w\\.]+))*\\/?$");
#endif // Q_OS_WIN

        _sslPemFilePath->setValidator(new QRegExpValidator(pathx, this));
*/
        _sslSupport = new QCheckBox("Use SSL protocol");
        _sslSupport->setStyleSheet("margin-bottom: 7px");
        _sslSupport->setChecked(_settings->sslInfo()._sslSupport);

        _selectPemFileButton = new QPushButton("...");
        _selectPemFileButton->setFixedSize(20, 20);
        VERIFY(connect(_selectPemFileButton, SIGNAL(clicked()), this, SLOT(setSslPEMKeyFile())));

        _sslPemLabel = new QLabel("SSL Certificate:");

        _sslPemDescriptionLabel = new QLabel(
            "<nobr>SSL Certificate and SSL Private Key combined into one file (*.pem)");
        _sslPemDescriptionLabel->setWordWrap(true);
        _sslPemDescriptionLabel->setAlignment(Qt::AlignTop);
        _sslPemDescriptionLabel->setContentsMargins(0, -2, 0, 0);
        _sslPemDescriptionLabel->setMinimumSize(_sslPemDescriptionLabel->sizeHint());

        QLabel *sslNoteLabel = new QLabel(
            "<b>Note:</b> Support for Certificate Authority (CA) file and "
            "encrypted SSL Private Keys are planned for future releases.");
        sslNoteLabel->setWordWrap(true);
        sslNoteLabel->setAlignment(Qt::AlignTop);
        sslNoteLabel->setContentsMargins(0, 20, 0, 0);

        QGridLayout *_authLayout = new QGridLayout;
        _authLayout->setAlignment(Qt::AlignTop);
        _authLayout->addWidget(_sslSupport,              0, 0, 1, 3);
        _authLayout->addWidget(_sslPemLabel,             1, 0);
        _authLayout->addWidget(_sslPemFilePath,          1, 1, 1, 1);
        _authLayout->addWidget(_selectPemFileButton,     1, 2, 1, 1);
        _authLayout->addWidget(_sslPemDescriptionLabel,  2, 1, 1, 2);
        _authLayout->addWidget(sslNoteLabel,             3, 0, 1, 4);

        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addLayout(_authLayout);
        setLayout(mainLayout);

        sslSupportStateChange(_sslSupport->checkState());
        VERIFY(connect(_sslSupport, SIGNAL(stateChanged(int)), this, SLOT(sslSupportStateChange(int))));
    }
Example #8
0
Change::Change(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Change)
{
    pathToRes = new QString("/home/midv/Projects/TrajectoryBuilder/Trajectory/resourses/");
    ui->setupUi(this);
    QHBoxLayout *generalLay = new QHBoxLayout(this);
    generalLay->setContentsMargins(0,0,0,0);
    QLabel *label = new QLabel();
    label->setFixedSize(this->size());
    label->setContentsMargins(0,0,0,0);
    label->setStyleSheet("QLabel{border:4px solid #00aa00; border-radius:10px}");
    generalLay->addWidget(label);
    QHBoxLayout *lay = new QHBoxLayout();
    label->setLayout(lay);
    lay->setAlignment(Qt::AlignCenter);
    lay->setSpacing(0);
    lay->setContentsMargins(5,0,0,0);
    QtSvgButton *button1 = new QtSvgButton();
    button1->setLockalSkin(*pathToRes,"Line");
    connect(button1,SIGNAL(clicked()),SLOT(pressButton1()));
    button1->setFixedSize(110,110);
    lay->addWidget(button1);
    QtSvgButton *button2 = new QtSvgButton();
    button2->setLockalSkin(*pathToRes,"Aссel");
    connect(button2,SIGNAL(clicked()),SLOT(pressButton2()));
    button2->setFixedSize(110,110);
    lay->addWidget(button2);
    QtSvgButton *button3 = new QtSvgButton();
    button3->setLockalSkin(*pathToRes,"ArcV");
    connect(button3,SIGNAL(clicked()),SLOT(pressButton3()));
    button3->setFixedSize(110,110);
    lay->addWidget(button3);
    QtSvgButton *button4 = new QtSvgButton();
    button4->setLockalSkin(*pathToRes,"ArcH");
    connect(button4,SIGNAL(clicked()),SLOT(pressButton4()));
    button4->setFixedSize(110,110);
    lay->addWidget(button4);
    QtSvgButton *button5 = new QtSvgButton();
    button5->setLockalSkin(*pathToRes,"ZmeyV");
    connect(button5,SIGNAL(clicked()),SLOT(pressButton5()));
    button5->setFixedSize(110,110);
    lay->addWidget(button5);
    QtSvgButton *button6 = new QtSvgButton();
    button6->setLockalSkin(*pathToRes,"ZmeyH");
    connect(button6,SIGNAL(clicked()),SLOT(pressButton6()));
    button6->setFixedSize(110,110);
    lay->addWidget(button6);
    QtSvgButton *button7 = new QtSvgButton();
    button7->setLockalSkin(*pathToRes,"Remove");
    connect(button7,SIGNAL(clicked()),SLOT(pressButton7()));
    button7->setFixedSize(110,110);
    lay->addWidget(button7);
}
Example #9
0
void* QmitkExtWorkbenchWindowAdvisor::CreateEmptyWindowContents(void* parent)
{
 QWidget* parentWidget = static_cast<QWidget*>(parent);
 QLabel* label = new QLabel(parentWidget);
 label->setText("<b>No perspectives are open. Open a perspective in the <i>Window->Open Perspective</i> menu.</b>");
 label->setContentsMargins(10,10,10,10);
 label->setAlignment(Qt::AlignTop);
 label->setEnabled(false);
 parentWidget->layout()->addWidget(label);
 return label;
}
Example #10
0
void
PanelsWidget::addPanel( PanelData *panel )
{
    const int headerRow = layout_->rowCount();

    // icon:
    if (!panel->icon().isNull()) {
        QLabel *iconLabel = new QLabel(root_);
        iconLabel->setPixmap( panel->icon().pixmap( Constants::ICON_SIZE, Constants::ICON_SIZE ) );
        iconLabel->setContentsMargins( 0, Constants::ABOVE_HEADING_MARGIN, 0, 0 );
        layout_->addWidget( iconLabel, headerRow, 0, /*rowSpan=*/3, /*colSpan=*/1, Qt::AlignTop | Qt::AlignHCenter );
    }

    // name:
    QLabel *nameLabel = new QLabel(root_);
    nameLabel->setText( panel->displayName() );
    QPalette palette = nameLabel->palette();
    for (int i = QPalette::Active; i < QPalette::NColorGroups; ++i ) {
        QColor foregroundColor = palette.color(QPalette::ColorGroup(i), QPalette::Foreground);
        foregroundColor.setAlpha(110);
        palette.setBrush(QPalette::ColorGroup(i), QPalette::Foreground, foregroundColor);
    }
    nameLabel->setPalette(palette);
    nameLabel->setContentsMargins(0, Constants::ABOVE_HEADING_MARGIN, 0, 0);
    QFont f = nameLabel->font();
    f.setBold(true);
    f.setPointSizeF(f.pointSizeF() * 1.6);
    nameLabel->setFont(f);
    layout_->addWidget(nameLabel, headerRow, 1, 1, 1, Qt::AlignVCenter | Qt::AlignLeft);

    // line:
    const int lineRow(headerRow + 1);
    QWidget *line = new OnePixelBlackLine(root_);
    layout_->addWidget(line, lineRow, 1, 1, -1, Qt::AlignTop);

    // add the widget:
    const int widgetRow(lineRow + 1);
    addPanelWidget(panel, widgetRow);
    layout_->setRowStretch( lineRow + 1, 100 );
}
Example #11
0
QgsWelcomePage::QgsWelcomePage( bool skipVersionCheck, QWidget *parent )
  : QWidget( parent )
{
  QgsSettings settings;

  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->setMargin( 0 );
  mainLayout->setContentsMargins( 0, 0, 0, 0 );
  setLayout( mainLayout );

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

  mainLayout->addLayout( layout );

  QWidget *recentProjectsContainer = new QWidget;
  recentProjectsContainer->setLayout( new QVBoxLayout );
  recentProjectsContainer->layout()->setContentsMargins( 0, 0, 0, 0 );
  recentProjectsContainer->layout()->setMargin( 0 );

  int titleSize = QApplication::fontMetrics().height() * 1.4;
  QLabel *recentProjectsTitle = new QLabel( QStringLiteral( "<div style='font-size:%1px;font-weight:bold'>%2</div>" ).arg( titleSize ).arg( tr( "Recent Projects" ) ) );
  recentProjectsTitle->setContentsMargins( 10, 3, 0, 0 );

  recentProjectsContainer->layout()->addWidget( recentProjectsTitle );

  mRecentProjectsListView = new QListView();
  mRecentProjectsListView->setResizeMode( QListView::Adjust );
  mRecentProjectsListView->setContextMenuPolicy( Qt::CustomContextMenu );
  connect( mRecentProjectsListView, &QListView::customContextMenuRequested, this, &QgsWelcomePage::showContextMenuForProjects );

  mModel = new QgsWelcomePageItemsModel( mRecentProjectsListView );
  mRecentProjectsListView->setModel( mModel );
  mRecentProjectsListView->setItemDelegate( new QgsWelcomePageItemDelegate( mRecentProjectsListView ) );

  recentProjectsContainer->layout()->addWidget( mRecentProjectsListView );

  layout->addWidget( recentProjectsContainer );

  mVersionInformation = new QLabel;
  mainLayout->addWidget( mVersionInformation );
  mVersionInformation->setVisible( false );

  mVersionInfo = new QgsVersionInfo();
  if ( !QgsApplication::isRunningFromBuildDir() && settings.value( QStringLiteral( "qgis/checkVersion" ), true ).toBool() && !skipVersionCheck )
  {
    connect( mVersionInfo, &QgsVersionInfo::versionInfoAvailable, this, &QgsWelcomePage::versionInfoReceived );
    mVersionInfo->checkVersion();
  }

  connect( mRecentProjectsListView, &QAbstractItemView::activated, this, &QgsWelcomePage::itemActivated );
}
Example #12
0
//
// Version page
//
VersionPage::VersionPage(Context *context) : context(context)
{
    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText(GcCrashDialog::versionHTML());
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);

    setLayout(mainLayout);
}
Example #13
0
//
// Version page
//
VersionPage::VersionPage(MainWindow *main, QDir home) : main(main), home(home)
{
    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText(GcCrashDialog::versionHTML());
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);

    setLayout(mainLayout);
}
QHBoxLayout *FAttentionSettingsWidget::buildHBox(QString labeltext, QWidget *widget)
{
	QHBoxLayout *hbox = new QHBoxLayout;
	QLabel *label = new QLabel(labeltext, this);
	label->setObjectName("settingslabel");
	label->setContentsMargins(0, 0, 0, 0);
	hbox->addWidget(label);
	hbox->addStretch();
	if(widget) {
		hbox->addWidget(widget);
	}
	return hbox;
}
Example #15
0
void LogListWidget::appendLine(const QString &line)
{
  QListWidgetItem *item = new QListWidgetItem;
  // We need to use QLabel here to support rich text
  QLabel *lbl = new QLabel(line);
  lbl->setContentsMargins(4, 2, 4, 2);
  item->setSizeHint(lbl->sizeHint());
  insertItem(0, item);
  setItemWidget(item, lbl);
  const int nbLines = count();
  // Limit log size
  if (nbLines > m_maxLines)
    delete takeItem(nbLines - 1);
}
FilesystemWidget::FilesystemWidget(QWidget *parent)
{
    setParent(parent);

    // Create the toolbar
    QToolBar *fsToolbar = new QToolBar();
    fsToolbar->setMovable(false);

    goUpAction = new QAction(IconFactory::fromTheme("go-up"), tr("Go up"), this);
    connect(goUpAction, SIGNAL(triggered()), this, SLOT(goUp()));
    fsToolbar->addAction(goUpAction);

    goHomeAction = new QAction(IconFactory::fromTheme("go-home"), tr("Go to the home folder"), this);
    connect(goHomeAction, SIGNAL(triggered()), this, SLOT(goHome()));
    fsToolbar->addAction(goHomeAction);

    // TODO: use placeholderText in Qt 4.7.
    filterEdit = new QLineEdit();
    QLabel* filterLabel = new QLabel(tr("Filter:"));
    filterLabel->setContentsMargins(5, 0, 5, 0);
    fsToolbar->addSeparator();
    fsToolbar->addWidget(filterLabel);
    fsToolbar->addWidget(filterEdit);
    connect(filterEdit, SIGNAL(textChanged(QString)), this, SLOT(setNameFilter(QString)));

    // Create the filesystem view
    fsWidgetModel = new QFileSystemModel();
    fsWidgetModel->setNameFilterDisables(false);
    fsWidgetModel->setFilter(QDir::AllDirs|QDir::Files|QDir::NoDotAndDotDot);
    fsListView = new QListView();
    fsListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    fsListView->setDragEnabled(true);
    fsListView->setModel(fsWidgetModel);

    // We shall use this to filter available file extensions from Phonon
    //fsWidgetModel->setFilter(getPhononExtensions());

    connect(fsWidgetModel, SIGNAL(rootPathChanged(QString)), this, SLOT(pathChanged()));
    connect(fsListView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(doubleClickAt(QModelIndex)));

    // Create a new horizontal box
    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(fsToolbar);
    vlayout->addWidget(fsListView);
    goHome();

    this->setLayout(vlayout);
}
KSaneDeviceDialog::KSaneDeviceDialog(QWidget *parent)
    : KDialog(parent)
{

    setButtons(KDialog::User1 | KDialog::Ok | KDialog::Cancel);
    setButtonText(User1, i18n("Reload devices list"));
    
    m_btnGroup = new QButtonGroup(this);

    m_btnBox = new QGroupBox;
    QVBoxLayout *layout = new QVBoxLayout;
    m_btnContainer = new QWidget;
    m_btnLayout = new QVBoxLayout(m_btnContainer);
    QScrollArea *area = new QScrollArea;
    
    m_btnBox->setLayout(layout);

    QLabel *explanation =
      new QLabel(i18n("<html>The SANE (Scanner Access Now Easy) system could not find any device.<br>"
                      "Check that the scanner is plugged in and turned on<br>"
                      "or check your systems scanner setup.<br>"
                      "For details about SANE see the "
                      "<a href='http://www.sane-project.org/'>SANE homepage</a>.</html>"));
    explanation->setOpenExternalLinks(true);
    int l,t,r,b;
    layout->getContentsMargins(&l, &t, &r, &b);
    explanation->setContentsMargins(l, t, r, b);

    layout->addWidget(explanation);
    m_btnBox->adjustSize();  // make sure to see the complete explanation text
    layout->addWidget(area);
    layout->setContentsMargins(0,0,0,0);

    area->setWidgetResizable(true);
    area->setFrameShape(QFrame::NoFrame);
    area->setWidget(m_btnContainer);

    setMainWidget(m_btnBox);
    setMinimumHeight(200);
    m_findDevThread = FindSaneDevicesThread::getInstance();

    connect(m_findDevThread, SIGNAL(finished()), this, SLOT(updateDevicesList()));
    connect(this, SIGNAL(user1Clicked()),        this, SLOT(reloadDevicesList()));

    reloadDevicesList();
}
Example #18
0
void Menu::showMainMenu(bool showInAnyway)
{
    if(!showInAnyway)
        if(menuExists)
        {
            menuExists=false;
            this->hide();
            return;
        }
    menuExists=true;
    QWidget *menuWidget1 = new QWidget();
    menuBasicLayout->replaceWidget(menuWidget,menuWidget1);
    delete(menuWidget);
    menuWidget = menuWidget1;
    QPalette Pal(menuWidget->palette());
    Pal.setColor(QPalette::Background, backGroundColor);
    menuWidget->setAutoFillBackground(true);
    menuWidget->setPalette(Pal);

    menuLayout = new QVBoxLayout();
    menuWidget->setLayout(menuLayout);

    QLabel *title = new QLabel();
    title->setText(tr("НАСТРОЙКИ"));
    title->setFont(QFont("Calibri",menuTitleTxtSize));
    title->setContentsMargins(10*scaleFactor,10*scaleFactor,0,0);
    title->setStyleSheet("color : "+titleColor+";");
    title->setAlignment(Qt::AlignLeft|Qt::AlignTop);
    menuLayout->addWidget(title);
    menuLayout->addSpacing(10*scaleFactor);

    MenuItem *itemB;
    for(int i=0; i<mainMenuItemTxt.length(); i++)
    {
        itemB = new MenuItem(i,mainMenuItemTxt[i],menuItemTxtSize,10*scaleFactor, 20*scaleFactor);
        connect(itemB,SIGNAL(click(int)),this,SLOT(showSubMenu(int)));
        menuLayout->addWidget(itemB);
    }
    menuLayout->addStretch(1);
    this->show();
}
//
// About page
//
AboutPage::AboutPage(Context *context) : context(context)
{
    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText(
              tr(
                "<center>"
                "<img src=\":images/gc.png\" height=80>"
                "<h2>GoldenCheetah</h2>"
                "Cycling Power Analysis Software<br>for Linux, Mac, and Windows"
                "<p>GoldenCheetah is licensed under the<br>"
                "<a href=\"http://www.gnu.org/copyleft/gpl.html\">GNU General "
                "Public License</a>."
                "<p>Source code can be obtained from<br>"
                "<a href=\"http://goldencheetah.org/\">"
                "http://goldencheetah.org/</a>."
                "<p>Activity files and other data are stored in<br>"
                "<a href=\"%1\">%2</a>"
                "<p>Trademarks used with permission<br>"
                "TSS, NP, IF courtesy of <a href=\"http://www.peaksware.com\">"
                "Peaksware LLC</a>.<br>"
                "BikeScore, xPower, SwimScore courtesy of <a href=\"http://www.physfarm.com\">"
                "Physfarm Training Systems</a>.<br>"
                "Virtual Speed courtesy of Tom Compton <a href=\"http://www.analyticcycling.com\">"
                "AnalyticCycling</a>.<br>"
                "<br>The core body temperature module was developed by the <br>"
                "<a href=\"http://www.usariem.army.mil/\">U.S. Army Research Institute of Environmental Medicine</a>"
                "<br> and is patent pending<br>"
                "</center>"
                )
                .arg(QString(QUrl::fromLocalFile(context->athlete->home->root().absolutePath()).toEncoded()))
                .arg(context->athlete->home->root().absolutePath().replace(" ", "&nbsp;"))
    );

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);
    setLayout(mainLayout);
}
void BuildSettingsWidget::addSubWidget(NamedWidget *widget)
{
    widget->setContentsMargins(0, 10, 0, 0);

    QLabel *label = new QLabel(this);
    label->setText(widget->displayName());
    connect(widget, SIGNAL(displayNameChanged(QString)),
            label, SLOT(setText(QString)));
    QFont f = label->font();
    f.setBold(true);
    f.setPointSizeF(f.pointSizeF() * 1.2);
    label->setFont(f);

    label->setContentsMargins(0, 10, 0, 0);

    layout()->addWidget(label);
    layout()->addWidget(widget);

    m_labels.append(label);
    m_subWidgets.append(widget);
}
Example #21
0
//
// About page
//
AboutPage::AboutPage(MainWindow *main, QDir home) : main(main), home(home)
{
    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText(
              tr(
                "<center>"
                "<h2>GoldenCheetah</h2>"
                "Cycling Power Analysis Software<br>for Linux, Mac, and Windows"
                "<p>GoldenCheetah is licensed under the<br>"
                "<a href=\"http://www.gnu.org/copyleft/gpl.html\">GNU General "
                "Public License</a>."
                "<p>Source code can be obtained from<br>"
                "<a href=\"http://goldencheetah.org/\">"
                "http://goldencheetah.org/</a>."
                "<p>Activity files and other data are stored in<br>"
                "<a href=\"%1\">%2</a>"
                "<p>Trademarks used with permission<br>"
                "TSS, NP, IF courtesy of <a href=\"http://www.peaksware.com\">"
                "Peaksware LLC</a>.<br>"
                "BikeScore, xPower courtesy of <a href=\"http://www.physfarm.com\">"
                "Physfarm Training Systems</a>.<br>"
                "Virtual Speed courtesy of Tom Compton <a href=\"http://www.analyticcycling.com\">"
                "Analytic Cycling</a>."
                "</center>"
                )
                .arg(QString(QUrl::fromLocalFile(main->home.absolutePath()).toEncoded()))
                .arg(main->home.absolutePath().replace(" ", "&nbsp;"))
    );

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);
    setLayout(mainLayout);
}
void SwitchLayout::fillListWidget()
{
    m_KeyboradTextList.clear();
    m_ListWidget->clear();

    for (int i = 0, length = m_KeyboardList.length(); i < length; i++) {
        QListWidgetItem *item = new QListWidgetItem;
        // setFlags(Qt::NoItemFlags) can remove the default highlight
        item->setFlags(Qt::NoItemFlags);
        item->setSizeHint(size);

        // customItem and text within it
        QWidget *customItem = new QWidget;
        customItem->setFixedSize(size);
        QLabel *text = new QLabel(customItem);
        text->setFont(m_f);
        m_KeyboradTextList << text;
        // make sure left-margin and right-margin be 10px
        text->setContentsMargins(10, 0, 10, 0);
        text->setFixedSize(size);
        text->setText(m_LayoutInterface->GetLayoutDesc(m_KeyboardList[i]));

        // highlight the chosen customItem and text withint it, when app starts
        if (m_LayoutInterface->currentLayout() == m_KeyboardList[i]) {
            m_CurrentIndexOfKeyBoard = i;
            text->setStyleSheet(KEYBOARD_ITEM_HIGHLIGHT_STYLE);
        } else {
            text->setStyleSheet(KEYBOARD_ITEM_NORMAL_STYLE);
        }

        m_ListWidget->addItem(item);
        m_ListWidget->setItemWidget(item, customItem);
    }

    m_HBoxLayout->addWidget(m_ListWidget);
}
void NotificationManager::addSimpleTextNotificationWithTimeout(QString theNotificationText, int timeoutMilliseconds, NotificationPriority priority, QString printableExplanationOfNotification, QString notificationItemId)
{
//    DLog("Tmp off");
    QString explanationOfNotif = theNotificationText;
    if(!printableExplanationOfNotification.isEmpty()) {
        explanationOfNotif = printableExplanationOfNotification;
    }
//    DLog("Printable expl.: ") << explanationOfNotif;
    NotificationWidget *notifWidget = new NotificationWidget(notificationItemId, explanationOfNotif);
    notifWidget->setObjectName("notifWidget");

    switch(priority) {
    case LowPriority:
        notifWidget->setStyleSheet(GlobalObjectRegistry::sharedGlobalObjectRegistry()->getGuiConfigurationManager()->getStyleForId("Notification/Widget/SimpleText/LowPriority/style"));
        break;
    case NormalPriority:
        notifWidget->setStyleSheet(GlobalObjectRegistry::sharedGlobalObjectRegistry()->getGuiConfigurationManager()->getStyleForId("Notification/Widget/SimpleText/NormalPriority/style"));
        break;
    case HighPriority:
        notifWidget->setStyleSheet(GlobalObjectRegistry::sharedGlobalObjectRegistry()->getGuiConfigurationManager()->getStyleForId("Notification/Widget/SimpleText/HighPriority/style"));
        break;
    case ErrorPriority:
        notifWidget->setStyleSheet(GlobalObjectRegistry::sharedGlobalObjectRegistry()->getGuiConfigurationManager()->getStyleForId("Notification/Widget/SimpleText/CriticalPriority/style"));
        break;

    default:
        DLog("Unknown priority. Normal is applied.");
        notifWidget->setStyleSheet(GlobalObjectRegistry::sharedGlobalObjectRegistry()->getGuiConfigurationManager()->getStyleForId("Notification/Widget/SimpleText/NormalPriority/style"));
    }

    QLabel *notifTextLable = new QLabel(theNotificationText);
    notifTextLable->setContentsMargins(5, 0, 5, 0);
    notifWidget->setContentWidget(notifTextLable);

    this->addNotification(notifWidget, timeoutMilliseconds, true);
}
Example #24
0
MintingView::MintingView(QWidget *parent) :
    QWidget(parent), model(0), mintingView(0)
{
    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);

    QString legendBoxStyle = "background-color: rgb(%1,%2,%3); border: 1px solid black;";

    QLabel *youngColor = new QLabel(" ");
    youngColor->setMaximumHeight(15);
    youngColor->setMaximumWidth(10);
    youngColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_YOUNG.red()).arg(COLOR_MINT_YOUNG.green()).arg(COLOR_MINT_YOUNG.blue()));
    QLabel *youngLegend = new QLabel(tr("transaction is too young"));
    youngLegend->setContentsMargins(5,0,15,0);

    QLabel *matureColor = new QLabel(" ");
    matureColor->setMaximumHeight(15);
    matureColor->setMaximumWidth(10);
    matureColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_MATURE.red()).arg(COLOR_MINT_MATURE.green()).arg(COLOR_MINT_MATURE.blue()));
    QLabel *matureLegend = new QLabel(tr("transaction is mature"));
    matureLegend->setContentsMargins(5,0,15,0);

    QLabel *oldColor = new QLabel(" ");
    oldColor->setMaximumHeight(15);
    oldColor->setMaximumWidth(10);
    oldColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_OLD.red()).arg(COLOR_MINT_OLD.green()).arg(COLOR_MINT_OLD.blue()));
    QLabel *oldLegend = new QLabel(tr("transaction has reached maximum probability"));
    oldLegend->setContentsMargins(5,0,15,0);

    QHBoxLayout *legendLayout = new QHBoxLayout();
    legendLayout->setContentsMargins(10,10,0,0);
    legendLayout->addWidget(youngColor);
    legendLayout->addWidget(youngLegend);
    legendLayout->addWidget(matureColor);
    legendLayout->addWidget(matureLegend);
    legendLayout->addWidget(oldColor);
    legendLayout->addWidget(oldLegend);
    legendLayout->insertStretch(-1);
	
	QLabel *label1 = new QLabel(this);
	label1->setText("Staking Estimations");
	label1->setAlignment(Qt::AlignLeft);
	QFont font( "Arial", 16, QFont::Bold);
	label1->setFont(font);
	label1->setFixedWidth(250);
	
	QLabel *mintingLabel = new QLabel(tr("Check the arrow icon below for more staking information. *BETA*"));

    QLabel *mintingLabel2 = new QLabel(tr(" [Display staking probability within]: "));
    mintingCombo = new QComboBox();
    mintingCombo->addItem(tr("10 min"), Minting10min);
    mintingCombo->addItem(tr("24 hours"), Minting1day);
    mintingCombo->addItem(tr("7 days"), Minting7days);
    mintingCombo->addItem(tr("30 days"), Minting30days);
    mintingCombo->addItem(tr("60 days"), Minting60days);
    mintingCombo->addItem(tr("90 days"), Minting90days);
    mintingCombo->setFixedWidth(120);

    hlayout->insertStretch(0);
    hlayout->addWidget(mintingLabel);
	hlayout->addWidget(mintingLabel2);
    hlayout->addWidget(mintingCombo);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(view);
    vlayout->addLayout(legendLayout);

    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_WS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    mintingView = view;

    connect(mintingCombo, SIGNAL(activated(int)), this, SLOT(chooseMintingInterval(int)));

    // Actions
    QAction *copyTxIDAction = new QAction(tr("Copy transaction ID of input"), this);
    QAction *copyAddressAction = new QAction(tr("Copy address of input"), this);
    QAction *showHideAddressAction = new QAction(tr("Show/hide 'Address' column"), this);
    QAction *showHideTxIDAction = new QAction(tr("Show/hide 'Transaction' column"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyTxIDAction);
    contextMenu->addAction(showHideAddressAction);
    contextMenu->addAction(showHideTxIDAction);

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
    connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
    connect(showHideAddressAction, SIGNAL(triggered()), this, SLOT(showHideAddress()));
    connect(showHideTxIDAction, SIGNAL(triggered()), this, SLOT(showHideTxID()));

    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
}
Example #25
0
  displayPrivate(::display * parent) : _parent(parent)
  {
    setupUi(_parent);
    _parameterWidget->setVisible(false);
    _queryonstart->hide(); // hide until query on start enabled
    _autoupdate->hide(); // hide until auto update is enabled
    _search->hide();
    _searchLit->hide();
    _listLabelFrame->setVisible(false);
    _useAltId = false;
    _queryOnStartEnabled = false;
    _autoUpdateEnabled = false;

    // Build Toolbar even if we hide it so we get actions
    _newBtn = new QToolButton(_toolBar);
    _newBtn->setObjectName("_newBtn");
    _newBtn->setFocusPolicy(Qt::NoFocus);
    _newAct = _toolBar->addWidget(_newBtn);
    _newAct->setVisible(false);

    _closeBtn = new QToolButton(_toolBar);
    _closeBtn->setObjectName("_closeBtn");
    _closeBtn->setFocusPolicy(Qt::NoFocus);
    _closeAct = _toolBar->addWidget(_closeBtn);

    _sep1 = _toolBar->addSeparator();

    // Move parameter widget controls into toolbar
    _moreBtn = new QToolButton(_toolBar);
    _moreBtn->setObjectName("_moreBtn");
    _moreBtn->setFocusPolicy(Qt::NoFocus);
    _moreBtn->setCheckable(true);
    _moreAct = _toolBar->addWidget(_moreBtn);
    _moreAct->setVisible(false);

    QLabel* filterListLit = _parent->findChild<QLabel*>("_filterListLit");
    filterListLit->setContentsMargins(3,0,3,0);
    XComboBox* filterList = _parent->findChild<XComboBox*>("_filterList");

    _filterLitAct = _toolBar->insertWidget(_moreAct, filterListLit);
    _filterLitAct->setVisible(false);

    _filterAct = _toolBar->insertWidget(_moreAct, filterList);
    _filterAct->setVisible(false);

    _sep2 = _toolBar->addSeparator();
    _sep2->setVisible(false);

    // Print buttons
    _printBtn = new QToolButton(_toolBar);
    _printBtn->setObjectName("_printBtn");
    _printBtn->setFocusPolicy(Qt::NoFocus);
    _printAct = _toolBar->addWidget(_printBtn);
    _printAct->setVisible(false); // hide the print button until a reportName is set

    _previewBtn = new QToolButton(_toolBar);
    _previewBtn->setObjectName("_previewBtn");
    _printBtn->setFocusPolicy(Qt::NoFocus);
    _previewAct = _toolBar->addWidget(_previewBtn);
    _previewAct->setVisible(false); // hide the preview button until a reportName is set
    _sep3 = _toolBar->addSeparator();
    _sep3->setVisible(false);

    // Optional search widget in toolbar
    _search->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    _searchAct = _toolBar->addWidget(_search);
    _searchAct->setVisible(false);

    // Remaining buttons in toolbar
    _queryBtn = new QToolButton(_toolBar);
    _queryBtn->setObjectName("_queryBtn");
    _queryBtn->setFocusPolicy(Qt::NoFocus);
    _queryAct = _toolBar->addWidget(_queryBtn);

    // Menu actions for query options
    _queryMenu = new QMenu(_queryBtn);
    _queryOnStartAct = new QAction(_queryMenu);
    _queryOnStartAct->setCheckable(true);
    _queryOnStartAct->setVisible(false);
    _queryMenu->addAction(_queryOnStartAct);

    _autoUpdateAct = new QAction(_queryMenu);
    _autoUpdateAct->setCheckable(true);
    _autoUpdateAct->setVisible(false);
    _queryMenu->addAction(_autoUpdateAct);

    _parent->layout()->setContentsMargins(0,0,0,0);
    _parent->layout()->setSpacing(0);
  }
Example #26
0
//
// Contributors page
//
ContributorsPage::ContributorsPage(Context *context) : context(context)
{
    QStringList contributors;
    contributors.append("Alejandro Martinez");
    contributors.append("Andrew Bryson");
    contributors.append("Andy Froncioni");
    contributors.append("Austin Roach");
    contributors.append("Berend De Schouwer");
    contributors.append("Bruno Assis");
    contributors.append("Chris Cleeland");
    contributors.append("Christian Charette");
    contributors.append("Claus Assmann");
    contributors.append("Dag Gruneau");
    contributors.append("Damien Grauser");
    contributors.append("Darren Hague");
    contributors.append("Dave Waterworth");
    contributors.append("Dean Junk");
    contributors.append("Eric Brandt");
    contributors.append("Eric Murray");
    contributors.append("Frank Zschockelt");
    contributors.append("Gareth Coco");
    contributors.append("Greg Lonnon");
    contributors.append("Ilja Booij");
    contributors.append("Jaime Jofre");
    contributors.append("Jamie Kimberley");
    contributors.append("Jan de Visser");
    contributors.append("Jim Ley");
    contributors.append("J&#246;rn Rischm&#252;ller");
    contributors.append("John Ehrlinger");
    contributors.append("Jon Beverley");
    contributors.append("Jon Escombe");
    contributors.append("Josef Gebel");
    contributors.append("Julian Baumgartner");
    contributors.append("Julian Simioni");
    contributors.append("Justin Knotzke");
    contributors.append("Keisuke Yamaguchi");
    contributors.append("Keith Reynolds");
    contributors.append("Ken Sallot");
    contributors.append("Luke NRG");
    contributors.append("Magnus Gille");
    contributors.append("Marc Boudreau");
    contributors.append("Mark Liversedge");
    contributors.append("Mark Rages");
    contributors.append("Michael Puchowicz");
    contributors.append("Mitsukuni Sato");
    contributors.append("Omar Torres");
    contributors.append("Ned Harding");
    contributors.append("Okano Takayoshi");
    contributors.append("Patrick McNerthney");
    contributors.append("Dr Phil Skiba");
    contributors.append("Philip Willoughby");
    contributors.append("Rainer Clasen");
    contributors.append("Ralf Spenneberg");
    contributors.append("Robb Romans");
    contributors.append("Robert Carlsen");
    contributors.append("Roberto Massa");
    contributors.append("Ron Alford");
    contributors.append("Satoru Kurashiki");
    contributors.append("Sean Rhea");
    contributors.append("Stefan Schake");
    contributors.append("Stephan Lips");
    contributors.append("Steven Gribble");
    contributors.append("Thomas Weichmann");
    contributors.append("Tilman Schmiedeberg");
    contributors.append("Walter B&#252;rki");
    contributors.append("Yves Arrouye");

    QString contributorsTable = "<center><table><tr>";
    for (int i=0;i<contributors.count();i++){
        contributorsTable.append("<td><center>"+contributors.at(i)+"</center></td>");
        if ((i+1) % 3 == 0)
            contributorsTable.append("</tr><tr>");
    }
    contributorsTable.append("</tr></table></center>");

    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText(contributorsTable);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);

    setLayout(mainLayout);
}
Example #27
0
//
// Contributors page
//
ContributorsPage::ContributorsPage(MainWindow *main, QDir home) : main(main), home(home)
{
    QStringList contributors;
    contributors.append("Alejandro Martinez");
    contributors.append("Andrew Bryson");
    contributors.append("Andy Froncioni");
    contributors.append("Austin Roach");
    contributors.append("Berend De Schouwer");
    contributors.append("Bruno Assis");
    contributors.append("Chris Cleeland");
    contributors.append("Claus Assmann");
    contributors.append("Dag Gruneau");
    contributors.append("Damien Grauser");
    contributors.append("Darren Hague");
    contributors.append("Eric Brandt");
    contributors.append("Eric Murray");
    contributors.append("Frank Zschockelt");
    contributors.append("Gareth Coco");
    contributors.append("Greg Lonnon");
    contributors.append("Ilja Booij");
    contributors.append("Jamie Kimberley");
    contributors.append("Jim Ley");
    contributors.append("John Ehrlinger");
    contributors.append("Josef Gebel");
    contributors.append("Julian Baumgartner");
    contributors.append("Julian Simioni");
    contributors.append("Justin Knotzke");
    contributors.append("Keisuke Yamaguchi");
    contributors.append("Ken Sallot");
    contributors.append("Luke NRG");
    contributors.append("Magnus Gille");
    contributors.append("Marc Boudreau");
    contributors.append("Mark Liversedge");
    contributors.append("Mark Rages");
    contributors.append("Mitsukuni Sato");
    contributors.append("Ned Harding");
    contributors.append("Patrick McNerthney");
    contributors.append("Rainer Clasen");
    contributors.append("Robb Romans");
    contributors.append("Robert Carlsen");
    contributors.append("Roberto Massa");
    contributors.append("Ron Alford");
    contributors.append("Sean Rhea");
    contributors.append("Steven Gribble");
    contributors.append("Thomas Weichmann");
    contributors.append("Walter B&#252;rki");

    QString contributorsTable = "<center><table><tr>";
    for (int i=0;i<contributors.count();i++){
        contributorsTable.append("<td>"+contributors.at(i)+"</td>");
        if ((i+1) % 2 == 0)
            contributorsTable.append("</tr><tr>");
    }
    contributorsTable.append("</tr></table></center>");

    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText(contributorsTable);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);

    setLayout(mainLayout);
}
Example #28
0
//
// Version page
//
VersionPage::VersionPage(MainWindow *main, QDir home) : main(main), home(home)
{
    // -- OS ----
    QString os = "";

    #ifdef Q_OS_LINUX
    os = "Linux";
    #endif

    #ifdef WIN32
    os = "Win";
    #endif

    #ifdef Q_OS_MAC
    os = QString("Mac OS X 10.%1").arg(QSysInfo::MacintoshVersion - 2);
    if (QSysInfo::MacintoshVersion == QSysInfo::MV_SNOWLEOPARD)
        os += " Snow Leopard";
    else if (QSysInfo::MacintoshVersion == QSysInfo::MV_LION)
        os += " Lion";
    else if (QSysInfo::MacintoshVersion == 10)
        os += " Mountain Lion";

    #endif

    // -- SCHEMA VERSION ----
    int schemaVersionInt = main->metricDB->db()->getDBVersion();
    QString schemaVersion = QString("%1").arg(schemaVersionInt);

    // -- SRMIO ----
    QString srmio = "none";

    #ifdef GC_HAVE_SRMIO
    srmio = "yes";
    #endif

    // -- D2XX ----
    QString d2xx = "none";

    #ifdef GC_HAVE_D2XX
    d2xx = "yes";
    #endif

    // -- LIBOAUTH ----
    QString oauth = "none";

    #ifdef GC_HAVE_LIBOAUTH
    oauth = LIBOAUTH_VERSION;
    #endif

    // -- QWTPLOT3D ----
    QString qwtplot3d = "none";

    #ifdef GC_HAVE_QWTPLOT3D
    qwtplot3d = QString::number(QWT3D_MAJOR_VERSION) + "."
            + QString::number(QWT3D_MINOR_VERSION) + "."
            + QString::number(QWT3D_PATCH_VERSION);
    #endif

    // -- KML ----
    QString kml = "none";

    #ifdef GC_HAVE_KML
    kml = "yes";
    #endif

    // -- ICAL ----
    QString ical = "none";

    #ifdef GC_HAVE_ICAL
    ical = ICAL_VERSION;
    #endif

    // -- USBXPRESS ----
    QString usbxpress = "none";
    #ifdef GC_HAVE_USBXPRESS
    usbxpress = "yes";
    #endif

    // -- LIBUSB ----
    QString libusb = "none";
    #ifdef GC_HAVE_LIBUSB
    libusb = "yes";
    #endif

    // -- VLC ----
    QString vlc = "none";
    #ifdef GC_HAVE_VLC
    vlc = "yes";
    #endif

    // -- LUCENE ----
    QString clucene = "none";
    #ifdef GC_HAVE_LUCENE
    clucene = _CL_VERSION;
    #endif

    // -- LION SUPPORT ----
    #ifdef Q_OS_MAC
    QString lionSupport = "no";
    #ifdef GC_HAVE_LION
    lionSupport = "yes";
    #endif
    #endif

    QString gc_version = tr(
            "<p>Build date: %1 %2"
            "<br>Version: %3"
            "<br>DB Schema: %4"
            "<br>OS: %5"
            "<br>")
            .arg(__DATE__)
            .arg(__TIME__)
            .arg(GC_VERSION)
            .arg(schemaVersion)
            .arg(os);

    QString lib_version = tr(
            "<table>"
            "<tr><td colspan=\"2\">QT</td><td>%1</td></tr>"
            "<tr><td colspan=\"2\">QWT</td><td>%2</td></tr>"
            "<tr><td colspan=\"2\">BOOST</td><td>%3</td></tr>"
            "<tr><td colspan=\"2\">GCC</td><td>%4</td></tr>"
            "<tr><td colspan=\"2\">SRMIO</td><td>%5</td></tr>"
            "<tr><td colspan=\"2\">OAUTH</td><td>%6</td></tr>"
            "<tr><td colspan=\"2\">D2XX</td><td>%7</td></tr>"
            "<tr><td colspan=\"2\">QWTPLOT3D</td><td>%8</td></tr>"
            "<tr><td colspan=\"2\">KML</td><td>%9</td></tr>"
            "<tr><td colspan=\"2\">ICAL</td><td>%10</td></tr>"
            "<tr><td colspan=\"2\">USBXPRESS</td><td>%11</td></tr>"
            "<tr><td colspan=\"2\">LIBUSB</td><td>%12</td></tr>"
            "<tr><td colspan=\"2\">VLC</td><td>%13</td></tr>"
            "<tr><td colspan=\"2\">LUCENE</td><td>%14</td></tr>"
            #ifdef Q_OS_MAC
            "<tr><td colspan=\"2\">LION SUPPORT</td><td>%15</td></tr>"
            #endif
            "</table>"
            )
            .arg(QT_VERSION_STR)
            .arg(QWT_VERSION_STR)
            .arg(BOOST_LIB_VERSION)
            .arg(GCC_VERSION)
            .arg(srmio)
            .arg(oauth)
            .arg(d2xx)
            .arg(qwtplot3d)
            .arg(kml)
            .arg(ical)
            .arg(usbxpress)
            .arg(libusb)
            .arg(vlc)
            .arg(clucene)
            #ifdef Q_OS_MAC
            .arg(lionSupport)
            #endif
            ;

    QLabel *text;
    text=new QLabel(this);
    text->setContentsMargins(0,0,0,0);
    text->setText("<center>"  +
                  gc_version  +
                  lib_version +
                  "</center>");


    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSpacing(0);
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->addWidget(text);

    setLayout(mainLayout);
}
void LibraryItemDelegateArtists::paint(QPainter *painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
{

	if(!index.isValid()) return;

		QLabel label;

		QRect rect(option.rect);

		painter->save();
		painter->translate(0, 0);



		if(index.column() == 0){
			int num_albums = index.model()->data(index, Qt::WhatsThisRole).toInt();

			if(num_albums <= 1)
				label.setPixmap(QPixmap(Helper::getIconPath() + "play_small.png"));
			else
				label.setPixmap(QPixmap(Helper::getIconPath() + "fwd_orange.png"));

			label.setContentsMargins(2, 0, 2, 2);
		}

		else if(index.column() == 1){

			QStringList list = index.model()->data(index, Qt::WhatsThisRole).toStringList();
			Artist artist;
			artist.fromStringList(list);

			QString text = "<b>" + artist.name + "</b>";
			label.setText(text);
			label.setContentsMargins(2, 0, 2, 2);
		}

		else if(index.column() == 2){
			QString text = index.model()->data(index, Qt::WhatsThisRole).toString();
			label.setText(text + " tracks");
			label.setContentsMargins(2, 0, 4, 2);
			label.setAlignment(Qt::AlignRight | Qt::AlignVCenter);
		}

		QString style;
		QString fg_color;

		bool is_selected = ((option.state & QStyle::State_Selected) != 0);

		QPalette palette = _parent->palette();
		QColor col_background = palette.color(QPalette::Active, QPalette::Background);
		QColor col_highlight = palette.color(QPalette::Active, QPalette::Highlight);
		//QColor col_highlight_lighter = palette.color(QPalette::Active, QPalette::Highlight).light();

		int val_bg = col_background.lightness();
		int val_sel = col_highlight.lightness();

		if(!is_selected){

			if(val_bg > 96) fg_color = " color: #202020";
			else fg_color = " color: #D8D8D8; ";

			style = QString("background-color: transparent; ") + fg_color;
		}

		else {
			if(val_sel > 96) fg_color = " color: #202020";
			else fg_color = " color: #D8D8D8; ";

			style = QString("background-color: " + col_highlight.name() + ";") + fg_color;
		}


		label.setAlignment( Qt::AlignVCenter );
		label.setStyleSheet(style);
		label.setFixedHeight(_parent->rowHeight(index.row())-1);
		label.setFixedWidth(_parent->columnWidth(index.column()));
		label.setContentsMargins(2, 0, 2, 0);

		label.setStyleSheet(style);
		label.render(painter, rect.topLeft() );

		painter->restore();

}
Example #30
0
/**
 * First Panel - Meta Info
 * All the usual MetaData are displayed and can be changed.
 **/
MetaPanel::MetaPanel( QWidget *parent,
                      intf_thread_t *_p_intf )
                      : QWidget( parent ), p_intf( _p_intf )
{
    QGridLayout *metaLayout = new QGridLayout( this );
    metaLayout->setVerticalSpacing( 0 );

    QFont smallFont = QApplication::font();
    smallFont.setPointSize( smallFont.pointSize() - 1 );
    smallFont.setBold( true );

    int line = 0; /* Counter for GridLayout */
    p_input = NULL;
    QLabel *label;

#define ADD_META( string, widget, col, colspan ) {                        \
    label = new QLabel( qtr( string ) ); label->setFont( smallFont );     \
    label->setContentsMargins( 3, 2, 0, 0 );                              \
    metaLayout->addWidget( label, line++, col, 1, colspan );              \
    widget = new QLineEdit;                                               \
    metaLayout->addWidget( widget, line, col, 1, colspan );               \
    CONNECT( widget, textEdited( QString ), this, enterEditMode() );      \
}

    /* Title, artist and album*/
    ADD_META( VLC_META_TITLE, title_text, 0, 10 ); line++;
    ADD_META( VLC_META_ARTIST, artist_text, 0, 10 ); line++;
    ADD_META( VLC_META_ALBUM, collection_text, 0, 7 );

    /* Date */
    label = new QLabel( qtr( VLC_META_DATE ) );
    label->setFont( smallFont ); label->setContentsMargins( 3, 2, 0, 0 );
    metaLayout->addWidget( label, line - 1, 7, 1, 2 );

    /* Date (Should be in years) */
    date_text = new QLineEdit;
    date_text->setAlignment( Qt::AlignRight );
    date_text->setInputMask("0000");
    date_text->setMaximumWidth( 140 );
    metaLayout->addWidget( date_text, line, 7, 1, -1 );
    line++;

    /* Genre Name */
    /* TODO List id3genres.h is not includable yet ? */
    ADD_META( VLC_META_GENRE, genre_text, 0, 7 );

    /* Number - on the same line */
    label = new QLabel( qtr( VLC_META_TRACK_NUMBER ) );
    label->setFont( smallFont ); label->setContentsMargins( 3, 2, 0, 0 );
    metaLayout->addWidget( label, line - 1, 7, 1, 3  );

    seqnum_text = new QLineEdit;
    seqnum_text->setMaximumWidth( 64 );
    seqnum_text->setAlignment( Qt::AlignRight );
    metaLayout->addWidget( seqnum_text, line, 7, 1, 1 );

    label = new QLabel( "/" ); label->setFont( smallFont );
    metaLayout->addWidget( label, line, 8, 1, 1 );

    seqtot_text = new QLineEdit;
    seqtot_text->setMaximumWidth( 64 );
    seqtot_text->setAlignment( Qt::AlignRight );
    metaLayout->addWidget( seqtot_text, line, 9, 1, 1 );
    line++;

    /* Rating - on the same line */
    /*
    metaLayout->addWidget( new QLabel( qtr( VLC_META_RATING ) ), line, 4, 1, 2 );
    rating_text = new QSpinBox; setSpinBounds( rating_text );
    metaLayout->addWidget( rating_text, line, 6, 1, 1 );
    */

    /* Now Playing - Useful for live feeds (HTTP, DVB, ETC...) */
    ADD_META( VLC_META_NOW_PLAYING, nowplaying_text, 0, 7 );
    nowplaying_text->setReadOnly( true ); line--;

    /* Language on the same line */
    ADD_META( VLC_META_LANGUAGE, language_text, 7, -1 ); line++;
    ADD_META( VLC_META_PUBLISHER, publisher_text, 0, 7 );

    fingerprintButton = new QPushButton( qtr("&Fingerprint") );
    fingerprintButton->setToolTip( qtr( "Find meta data using audio fingerprinting" ) );
    fingerprintButton->setVisible( false );
    metaLayout->addWidget( fingerprintButton, line, 7 , 3, -1 );
    CONNECT( fingerprintButton, clicked(), this, fingerprint() );

    line++;

    lblURL = new QLabel;
    lblURL->setOpenExternalLinks( true );
    lblURL->setTextFormat( Qt::RichText );
    metaLayout->addWidget( lblURL, line -1, 7, 1, -1 );

    ADD_META( VLC_META_COPYRIGHT, copyright_text, 0,  7 ); line++;

    /* ART_URL */
    art_cover = new CoverArtLabel( this, p_intf );
    metaLayout->addWidget( art_cover, line, 7, 6, 3, Qt::AlignLeft );

    ADD_META( VLC_META_ENCODED_BY, encodedby_text, 0, 7 ); line++;

    label = new QLabel( qtr( N_("Comments") ) ); label->setFont( smallFont );
    label->setContentsMargins( 3, 2, 0, 0 );
    metaLayout->addWidget( label, line++, 0, 1, 7 );
    description_text = new QTextEdit;
    description_text->setAcceptRichText( false );
    metaLayout->addWidget( description_text, line, 0, 1, 7 );
    // CONNECT( description_text, textChanged(), this, enterEditMode() ); //FIXME
    line++;

    /* VLC_META_SETTING: Useless */
    /* ADD_META( TRACKID )  Useless ? */
    /* ADD_URI - Do not show it, done outside */

    metaLayout->setColumnStretch( 1, 20 );
    metaLayout->setColumnMinimumWidth ( 1, 80 );
    metaLayout->setRowStretch( line, 10 );
#undef ADD_META

    CONNECT( seqnum_text, textEdited( QString ), this, enterEditMode() );
    CONNECT( seqtot_text, textEdited( QString ), this, enterEditMode() );

    CONNECT( date_text, textEdited( QString ), this, enterEditMode() );
//    CONNECT( THEMIM->getIM(), artChanged( QString ), this, enterEditMode() );
/*    CONNECT( rating_text, valueChanged( QString ), this, enterEditMode( QString ) );*/

    /* We are not yet in Edit Mode */
    b_inEditMode = false;
}