Exemple #1
0
AboutDialog::AboutDialog() {
	setWindowTitle(tr("%1 - About").arg(PROGRAM_NAME));
	setAttribute(Qt::WA_DeleteOnClose);

	QVBoxLayout *vbox = new QVBoxLayout(this);
	vbox->setSizeConstraint(QLayout::SetFixedSize);

	QHBoxLayout *hbox = new QHBoxLayout;
	vbox->addLayout(hbox);

	QString str = tr(
		"<p><font face='Arial' size='20'><b>%1</b></font></p>"
		"<p>Copyright 2008-2009 by jlh (<a href='mailto:[email protected]'>[email protected]</a>)<br>"
		"Copyright 2010-2011 by Peter Savichev (proton) (<a href='*****@*****.**'>[email protected]</a>)<br>"
		"Version: %2<br>"
		"Website: <a href='%3'>%3</a></p>");
	str = str.arg(PROGRAM_NAME).arg(recorderVersion).arg(websiteURL);
	QLabel *label = new QLabel(str);
	label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
	label->setTextFormat(Qt::RichText);
	label->setOpenExternalLinks(true);
	hbox->addWidget(label, 1, Qt::AlignTop);

	label = new QLabel;
	label->setPixmap(QPixmap(":/res/tray-red.png"));
	hbox->addWidget(label, 0, Qt::AlignTop);

	str = tr(
		"<hr>"
		"<p>This program is free software; you can redistribute it and/or modify it under<br>"
		"the terms of the GNU General Public License as published by the <a href='http://www.fsf.org/'>Free<br>"
		"Software Foundation</a>; either <a href='http://www.gnu.org/licenses/old-licenses/gpl-2.0.html'>version 2 of the License</a>, "
		"<a href='http://www.gnu.org/licenses/gpl.html'>version 3 of the<br>"
		"License</a>, or (at your option) any later version.</p>"

		"<p>This program is distributed in the hope that it will be useful, but WITHOUT<br>"
		"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY<br>"
		"or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public<br>"
		"License for more details.</p>"
		"<hr>"
		"<p>This product uses the Skype API but is not endorsed, certified or otherwise<br>"
		"approved in any way by Skype.</p>"
		"<hr>"
		"<p><small>Git commit: %1<br>"
		"Build date: %2</small></p>");
	str = str.arg(recorderCommit, recorderDate);
	label = new QLabel(str);
	label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
	label->setTextFormat(Qt::RichText);
	label->setOpenExternalLinks(true);
	vbox->addWidget(label);

	QPushButton *button = new QPushButton(tr("&Close"));
	connect(button, SIGNAL(clicked()), this, SLOT(close()));
	vbox->addWidget(button);

	show();
}
Exemple #2
0
void AddFriendForm::addFriendRequestWidget(const QString &friendAddress, const QString &message)
{
    QWidget* friendWidget = new QWidget(tabWidget);
    QHBoxLayout* friendLayout = new QHBoxLayout(friendWidget);
    QVBoxLayout* horLayout = new QVBoxLayout();
    horLayout->setMargin(0);
    friendLayout->addLayout(horLayout);

    CroppingLabel* friendLabel = new CroppingLabel(friendWidget);
    friendLabel->setText("<b>" + friendAddress + "</b>");
    horLayout->addWidget(friendLabel);

    QLabel* messageLabel = new QLabel(message);
    messageLabel->setTextFormat(Qt::PlainText);
    messageLabel->setWordWrap(true);
    horLayout->addWidget(messageLabel, 1);

    QPushButton* acceptButton = new QPushButton(friendWidget);
    acceptButtons.append(acceptButton);
    connect(acceptButton, &QPushButton::released, this, &AddFriendForm::onFriendRequestAccepted);
    friendLayout->addWidget(acceptButton);
    retranslateAcceptButton(acceptButton);

    QPushButton* rejectButton = new QPushButton(friendWidget);
    rejectButtons.append(rejectButton);
    connect(rejectButton, &QPushButton::released, this, &AddFriendForm::onFriendRequestRejected);
    friendLayout->addWidget(rejectButton);
    retranslateRejectButton(rejectButton);

    requestsLayout->insertWidget(0, friendWidget);
}
Exemple #3
0
FirstRunDialog::FirstRunDialog() :
	IconDialogBase(tr("Information"), QStyle::SP_MessageBoxInformation)
{
	QLabel *label = new QLabel(tr(
		"<p>Welcome to SkypeRec!</p>"

		"<p>Please note that SkypeRec does not have a main window.<br>"
		"Instead, it hides itself in the system tray, from where you can open<br>"
		"the preferences dialog, start or stop recording your Skype calls, or<br>"
		"access previously recorded calls.</p>"

		"<p>Thank you for using SkypeRec!</p>"
	));
	label->setTextFormat(Qt::RichText);
	vbox->addWidget(label);

	//TODO:
//	QWidget *checkBox = new SmartCheckBox("Do not show this information again", preferences.get(Pref::SuppressFirstRunInformation));
//	vbox->addWidget(checkBox);

	QPushButton *button = new QPushButton("&OK");
	button->setDefault(true);
	connect(button, SIGNAL(clicked()), this, SLOT(close()));
	hbox->addWidget(button, 0, Qt::AlignHCenter);

	show();
}
Exemple #4
0
aboutWidget::aboutWidget()
{
    setWindowIcon(QIcon("/usr/share/h3cc/icons/h3cc128x128.png"));
    setFixedSize(180,260);
    QGridLayout *layout = new QGridLayout;
    setLayout(layout);
    setWindowTitle(tr("About H3C 802.1x Client"));
    QLabel *label = new QLabel;
    label->setPixmap(QPixmap("/usr/share/h3cc/icons/h3cc128x128.png"));
    label->setAlignment(Qt::AlignCenter);
    layout->addWidget(label,0,0);
    QLabel *despLabel = new QLabel;
    despLabel->setTextFormat(Qt::RichText);
    despLabel->setText(tr("H3C 802.1x client By <br>"
			"lovewilliam AT "
			"<font color=\"Red\">S</font>"
			"<font color=\"Orange\">D</font>"
			"<font color=\"Blue\">U</font>"
			"<font color=\"Yellow\">.</font>"
			"<font color=\"Green\">S</font>"
			"<font color=\"Purple\">C</font>"
			"<br>"
			"Visit "
			"<a href=\"http://www.bigstarstar.tk/\">http://www.bigstarstar.tk</a>"));
    despLabel->setAlignment(Qt::AlignCenter);
    layout->addWidget(despLabel,1,0);
    QPushButton *btnOK = new QPushButton;
    btnOK->setText(tr("I Know!:)"));
    layout->addWidget(btnOK,2,0);
    connect(btnOK,SIGNAL(clicked(bool)),this,SLOT(deleteLater()));
    setMaximumHeight(height());
    setMaximumWidth(width());
//    setMinimumHeight(height());
//    setMinimumWidth(width());
}
 InsertHtmlDialogPrivate( InsertHtmlDialog *qq )
   : q( qq )
 {
   q->setCaption( i18n( "Insert HTML" ) );
   q->setButtons( KDialog::Ok|KDialog::Cancel );
   q->setButtonText( KDialog::Ok, i18n( "Insert" ) );
   QWidget *page = new QWidget( q );
   q->setMainWidget( page );
   QVBoxLayout *lay = new QVBoxLayout( page );
   QLabel *label = new QLabel( i18n( "Insert HTML tags and texts:" ) );
   lay->addWidget( label );
   editor = new KTextEdit;
   new HtmlHighlighter( editor->document() );
   editor->setAcceptRichText( false );
   editor->setFocus();
   lay->addWidget( editor );
   label = new QLabel( i18n( "Example: <i> Hello word </i>" ) );
   QFont font = label->font();
   font.setBold( true );
   label->setFont( font );
   label->setTextFormat( Qt::PlainText );
   lay->addWidget( label );
   q->connect( editor, SIGNAL(textChanged()),
               q, SLOT(_k_slotTextChanged()) );
   q->enableButtonOk( false );
   q->resize( 640, 480 );
 }
Exemple #6
0
QuickHelp::QuickHelp(QWidget* widget, QPoint pos, QString text)
	: QFrame(0, Qt::ToolTip),
	  widget_(widget),
	  window_(widget->window())
{
	setAttribute(Qt::WA_DeleteOnClose);
	
	widget_->installEventFilter(this);
	window_->installEventFilter(this);
	
	QLabel* label = new QLabel;
	label->setStyleSheet(
		QString("QLabel { background-color: %1; }").arg(label->palette().toolTipBase().color().name())
	);
	label->setTextFormat(Qt::RichText);
	// label->setOpenExternalLinks(true);
	label->setText(text);
	connect(label, SIGNAL(linkActivated(const QString&)), this, SLOT(openLink(const QString&)));
	
	#ifdef QT_MAC_USE_COCOA
	setFrameStyle(QFrame::NoFrame);
	#else
	setFrameStyle(QFrame::Plain|QFrame::StyledPanel);
	#endif
	
	QVBoxLayout* col = new QVBoxLayout;
	col->setSpacing(0);
	col->setMargin(0);
	col->addWidget(label);
	setLayout(col);
	
	move(widget->mapToGlobal(pos));
	show();
}
SqlBatchImporterConfig::SqlBatchImporterConfig( QWidget *parent )
    : DatabaseImporterConfig( parent )
{
    QWidget *gridHolder = new QWidget( this );

    QGridLayout *databaseLayout = new QGridLayout( gridHolder );

    QLabel *explanationLabel = new QLabel( i18n( "Input file produced by amarokcollectionscanner.<br>"
                                                 "See <a href=\"http://community.kde.org/Amarok/Development/BatchMode\">Batch Mode</a>." ), gridHolder );
    explanationLabel->setTextFormat( Qt::RichText );
    explanationLabel->setAlignment( Qt::AlignHCenter );
    explanationLabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Minimum ); // Don't stretch vertically

    QLabel *label = new QLabel( i18n( "Input file" ), gridHolder );
    m_inputFilePathInput = new QLineEdit( gridHolder );
    QCompleter *completer = new QCompleter( this );
    completer->setModel( new QDirModel( completer ) );
    m_inputFilePathInput->setCompleter( completer );
    m_inputFilePathInput->setText( QDir::homePath() + "/result.xml" );
    label->setBuddy( m_inputFilePathInput );

    databaseLayout->addWidget( explanationLabel, 0, 0, 1, 2 );
    databaseLayout->addWidget( label, 1, 0 );
    databaseLayout->addWidget( m_inputFilePathInput, 1, 1 );

    gridHolder->setLayout( databaseLayout );

    QWidget *spacer = new QWidget( this );
    spacer->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
}
void WorkoutMetricsSummary::updateMetrics(QStringList &order, QHash<QString,RideMetricPtr>  &metrics)
{
    int row = 0;

    foreach(QString name, order)
    {
        RideMetricPtr rmp = metrics[name];
        if(!metricMap.contains(name))
        {
            QLabel *label = new QLabel((rmp->name()) + ":");
			label->setTextFormat(Qt::RichText);
            QLabel *lcd = new QLabel();
            metricMap[name] = QPair<QLabel*,QLabel*>(label,lcd);
            layout->addWidget(label,metricMap.size(),0);
            layout->addWidget(lcd,metricMap.size(),1);
        }
        QLabel *lcd = metricMap[name].second;
        if(name == "time_riding")
        {
            QTime start (0,0,0);
            QTime time = start.addSecs(rmp->value(true));
            QString s = time.toString("HH:mm:ss");
            //qDebug() << s << " " << time.second();
            lcd->setText(s);
        }
        else
        {
            lcd->setText(QString::number(rmp->value(true),'f',rmp->precision()) + " " + (rmp->units(true)) );
        }
        //qDebug() << name << ":" << (int)rmp->value(true);
        row++;
    }
void MessageHandlerWidget::fatalMessageReceived(const QString &app, const QString &message,
                                                const QTime &time, const QStringList &backtrace)
{
  if (Endpoint::isConnected() && !qobject_cast<MessageHandlerClient*>(ObjectBroker::object<MessageHandlerInterface*>())) {
    // only show on remote side
    return;
  }
  QDialog dlg;
  dlg.setWindowTitle(tr("QFatal in %1 at %2").arg(app).arg(time.toString()));

  QGridLayout *layout = new QGridLayout;

  QLabel *iconLabel = new QLabel;
  QIcon icon = dlg.style()->standardIcon(QStyle::SP_MessageBoxCritical, 0, &dlg);
  int iconSize = dlg.style()->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, &dlg);
  iconLabel->setPixmap(icon.pixmap(iconSize, iconSize));
  iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
  layout->addWidget(iconLabel, 0, 0);

  QLabel *errorLabel = new QLabel;
  errorLabel->setTextFormat(Qt::PlainText);
  errorLabel->setWordWrap(true);
  errorLabel->setText(message);
  layout->addWidget(errorLabel, 0, 1);

  QDialogButtonBox *buttons = new QDialogButtonBox;

  if (!backtrace.isEmpty()) {
    QListWidget *backtraceWidget = new QListWidget;
    foreach (const QString &frame, backtrace) {
      backtraceWidget->addItem(frame);
    }
Exemple #10
0
ScriptTerminatorWidget::ScriptTerminatorWidget( const QString &message )
: PopupWidget( 0 )
{
    setFrameStyle( QFrame::StyledPanel | QFrame::Raised );

    setContentsMargins( 4, 4, 4, 4 );

    setMinimumWidth( 26 );
    setMinimumHeight( 26 );
    setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );

    QPalette p = QToolTip::palette();
    setPalette( p );

    QLabel *alabel = new QLabel( message, this );
    alabel->setWordWrap( true );
    alabel->setTextFormat( Qt::RichText );
    alabel->setTextInteractionFlags( Qt::TextBrowserInteraction );
    alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
    alabel->setPalette( p );

    KPushButton *button = new KPushButton( i18n( "Terminate" ), this );
    button->setPalette(p);;
    connect( button, SIGNAL(clicked()), SIGNAL(terminate()) );
    button = new KPushButton( KStandardGuiItem::close(), this );
    button->setPalette(p);
    connect( button, SIGNAL(clicked()), SLOT(hide()) );

    reposition();
}
  DlgTerminate::DlgTerminate(QWidget *parent) : QDialog(parent)
  {
    QLabel* lblError = new QLabel(tr("A fatal error ocurred during initialization of <b>Impresario</b>. The application needs to be terminated."));
    lblError->setWordWrap(true);
    lblError->setTextFormat(Qt::RichText);
    QVBoxLayout* groupTextLayout = new QVBoxLayout();
    groupTextLayout->addWidget(lblError);
    QGroupBox* groupText = new QGroupBox();
    groupText->setLayout(groupTextLayout);

    QDialogButtonBox* buttonBox = new QDialogButtonBox();
    QPushButton* btnTerminate = new QPushButton(QIcon(":/icons/resources/quit.png"),tr("Quit"));
    QPushButton* btnAbout = new QPushButton(tr("About..."));
    buttonBox->addButton(btnAbout,QDialogButtonBox::HelpRole);
    buttonBox->addButton(btnTerminate,QDialogButtonBox::RejectRole);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(groupText);
    mainLayout->addWidget(new syslog::WndLogger(),1);
    mainLayout->addSpacing(5);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);

    setWindowTitle(tr("Impresario"));
    setWindowIcon(QIcon(":/icons/resources/impresario.png"));

    // set signal handlers
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(onAbout()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
  }
void DlgSettingsExportFormat::createPreview(QGridLayout *layout, int &row)
{
  LOG4CPP_INFO_S ((*mainCat)) << "DlgSettingsExportFormat::createPreview";

  QLabel *label = new QLabel (tr ("Preview"));
  layout->addWidget (label, row, 0, 1, 3);

  // Legend. Padding and margin in rich text do not work so &nbsp; is used for spacing
  QLabel *labelLegend = new QLabel;
  labelLegend->setTextFormat (Qt::RichText);
  QString legendHtml = QString ("<span style=\"background-color: %1\">&nbsp;Functions&nbsp;</span>"
                                "&nbsp;&nbsp;&nbsp;"
                                "<span style=\"background-color: %2\">&nbsp;Relations&nbsp;</span>")
      .arg (COLOR_FUNCTIONS)
      .arg (COLOR_RELATIONS);
  labelLegend->setText (legendHtml);
  layout->addWidget (labelLegend, row++, 1, 1, 2, Qt::AlignRight);

  m_editPreview = new QTextEdit;
  m_editPreview->setReadOnly (true);
  m_editPreview->setWhatsThis (tr ("Preview window shows how current settings affect the exported file.\n\n"
                                   "Functions (shown here in blue) are output first, followed by relations "
                                   "(shown here in green) if any exist."));
  m_editPreview->setMinimumHeight (MINIMUM_PREVIEW_HEIGHT);
  m_editPreview->document()->setDefaultStyleSheet("div { padding-left: 20px; }");
  QPalette p = m_editPreview->palette();
  p.setColor (QPalette::Base, QColor (240, 240, 240)); // Replace attention-getting white border by gray
  m_editPreview->setPalette (p);

  layout->addWidget (m_editPreview, row++, 0, 1, 3);
}
Exemple #13
0
GroupChatForm::GroupChatForm(Group* chatGroup)
    : group(chatGroup), inCall{false}
{
    nusersLabel = new QLabel();

    tabber = new TabCompleter(msgEdit, group);

    fileButton->setEnabled(false);
    if (group->isAvGroupchat())
    {
        videoButton->setEnabled(false);
        videoButton->setObjectName("grey");
    }
    else
    {
        videoButton->setVisible(false);
        callButton->setVisible(false);
        volButton->setVisible(false);
        micButton->setVisible(false);
    }

    nameLabel->setText(group->getGroupWidget()->getName());

    nusersLabel->setFont(Style::getFont(Style::Medium));
    nusersLabel->setText(GroupChatForm::tr("%1 users in chat","Number of users in chat").arg(group->getPeersCount()));
    nusersLabel->setObjectName("statusLabel");

    avatar->setPixmap(Style::scaleSvgImage(":/img/group_dark.svg", avatar->width(), avatar->height()), Qt::transparent);

    msgEdit->setObjectName("group");

    namesListLayout = new FlowLayout(0,5,0);
    QStringList names(group->getPeerList());
    
    for (const QString& name : names)
    {
        QLabel *l = new QLabel(name);
        l->setTextFormat(Qt::PlainText);
        namesListLayout->addWidget(l);
    }
    
    headTextLayout->addWidget(nusersLabel);
    headTextLayout->addLayout(namesListLayout);
    headTextLayout->addStretch();

    nameLabel->setMinimumHeight(12);
    nusersLabel->setMinimumHeight(12);

    connect(sendButton, SIGNAL(clicked()), this, SLOT(onSendTriggered()));
    connect(msgEdit, SIGNAL(enterPressed()), this, SLOT(onSendTriggered()));
    connect(msgEdit, &ChatTextEdit::tabPressed, tabber, &TabCompleter::complete);
    connect(msgEdit, &ChatTextEdit::keyPressed, tabber, &TabCompleter::reset);
    connect(callButton, &QPushButton::clicked, this, &GroupChatForm::onCallClicked);
    connect(micButton, SIGNAL(clicked()), this, SLOT(onMicMuteToggle()));
    connect(volButton, SIGNAL(clicked()), this, SLOT(onVolMuteToggle()));
    connect(nameLabel, &CroppingLabel::textChanged, this, [=](QString text, QString orig)
        {if (text != orig) emit groupTitleChanged(group->getGroupId(), text.left(128));} );

    setAcceptDrops(true);
}
Exemple #14
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
QLabel* IssuesDockWidget::createHyperlinkLabel(PipelineMessage msg)
{
  QString filterClassName = (msg.getFilterClassName() );
  QString filterHumanLabel = (msg.getFilterHumanLabel() );
  QString msgPrefix = (msg.getPrefix());

  if ( filterClassName.isEmpty() || filterHumanLabel.isEmpty() )
  {
    if(filterClassName.isEmpty() == false) { return new QLabel(filterClassName); }
    else if(filterHumanLabel.isEmpty() == false) { return new QLabel(filterHumanLabel); }

    return new QLabel("Unknown Filter Class");
  }

  QUrl filterURL = DREAM3DHelpUrlGenerator::generateHTMLUrl( filterClassName.toLower() );
  QString filterHTMLText("<a href=\"");
  filterHTMLText.append(filterURL.toString()).append("\">").append(filterHumanLabel).append("</a>");

  QLabel* hyperlinkLabel = new QLabel(filterHTMLText);
  hyperlinkLabel->setTextFormat(Qt::RichText);
  hyperlinkLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
  hyperlinkLabel->setOpenExternalLinks(false);
  connect(hyperlinkLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(showFilterHelp(const QString&)));

  return hyperlinkLabel;
}
WalkmeshManager::WalkmeshManager(QWidget *parent, const QGLWidget *shareWidget) :
	QDialog(parent, Qt::Tool),
	idFile(0), caFile(0), infFile(0), scriptsAndTexts(0)
{
	setWindowTitle(tr("Zones"));

	walkmesh = Config::value("OpenGL", true).toBool() ? new WalkmeshWidget(0, shareWidget) : 0;
	QWidget *walkmeshWidget = walkmesh ? walkmesh : new QWidget(this);

	slider1 = new QSlider(this);
	slider2 = new QSlider(this);
	slider3 = new QSlider(this);

	slider1->setRange(-180, 180);
	slider2->setRange(-180, 180);
	slider3->setRange(-180, 180);

	slider1->setValue(0);
	slider2->setValue(0);
	slider3->setValue(0);

	QLabel *keyInfos = new QLabel(tr("Utilisez les touches directionnelles pour déplacer la caméra."));
	keyInfos->setTextFormat(Qt::PlainText);
	keyInfos->setWordWrap(true);

	QPushButton *resetCamera = new QPushButton(tr("Remettre à 0"));

	QCheckBox *showModels = new QCheckBox(tr("Afficher modèles"));

	tabWidget = new QTabWidget(this);
	tabWidget->addTab(buildCameraPage(), tr("Caméra"));
	tabWidget->addTab(buildWalkmeshPage(), tr("Walkmesh"));
	tabWidget->addTab(buildGatewaysPage(), tr("Sorties"));
	tabWidget->addTab(buildDoorsPage(), tr("Portes"));
	tabWidget->addTab(buildArrowPage(), tr("Flèches"));
	tabWidget->addTab(buildCameraRangePage(), tr("Limites caméra"));
	tabWidget->addTab(buildMiscPage(), tr("Divers"));
	tabWidget->setFixedHeight(250);

	QGridLayout *layout = new QGridLayout(this);
	layout->addWidget(walkmeshWidget, 0, 0, 4, 1);
	layout->addWidget(slider1, 0, 1);
	layout->addWidget(slider2, 0, 2);
	layout->addWidget(slider3, 0, 3);
	layout->addWidget(keyInfos, 1, 1, 1, 3);
	layout->addWidget(resetCamera, 2, 1, 1, 3);
	layout->addWidget(showModels, 3, 1, 1, 3);
	layout->addWidget(tabWidget, 4, 0, 1, 4);

	if(walkmesh) {
		connect(slider1, SIGNAL(valueChanged(int)), walkmesh, SLOT(setXRotation(int)));
		connect(slider2, SIGNAL(valueChanged(int)), walkmesh, SLOT(setYRotation(int)));
		connect(slider3, SIGNAL(valueChanged(int)), walkmesh, SLOT(setZRotation(int)));
		connect(resetCamera, SIGNAL(clicked()), SLOT(resetCamera()));
		connect(showModels, SIGNAL(toggled(bool)), SLOT(setModelsVisible(bool)));

		showModels->setChecked(true);
	}
}
Exemple #16
0
Donate::Donate(QWidget *parent) : QDialog(parent)
{
    setWindowTitle(QApplication::translate("MainWindow", "Donate"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    resize(Gui::Screen::scaled(450, 0));

    // Initialize "Thanks" section:

    QString thanks = QString("<hr>%1:<br>").arg(tr("Thank you for your support"));

    QRegExp rx("\\((.+)\\)");
    rx.setMinimal(true);

    QFile inputFile("authors.txt");
    if (inputFile.open(QIODevice::ReadOnly)) {

        QTextStream stream(&inputFile);

        while (!stream.atEnd()) {

            QString line = stream.readLine();

            if (line == "Supported by:") {
                while (!line.isEmpty() && !stream.atEnd()) {
                    line = stream.readLine();
                    line = line.replace(rx, "(<a href=\"\\1\">\\1</a>)");
                    thanks += line + "<br>";
                }
                thanks.chop(8);
                break;
            }
        }

        inputFile.close();
    }

    // Create GUI:

    QVBoxLayout *layout = new QVBoxLayout(this);

    Wallets *wallets = new Wallets(this);
    wallets->add("PayPal:", "*****@*****.**", Url::WEBSITE + "donate/#paypal");
    wallets->add("BitCoin:", "1M299bkCjSQL1TDbTzD38a7YyN96NvSo2k", Url::WEBSITE + "donate/#bitcoin");
    wallets->add("Yandex.Money:", "410011762016796", "https://money.yandex.ru/to/410011762016796");

    QLabel *donators = new QLabel(this);
    donators->setAlignment(Qt::AlignCenter);
    donators->setTextFormat(Qt::RichText);
    donators->setOpenExternalLinks(true);
    donators->setText(thanks);

    QPushButton *btnOk = new QPushButton("OK", this);

    layout->addWidget(wallets);
    layout->addWidget(btnOk);
    layout->addWidget(donators);

    connect(btnOk, SIGNAL(clicked()), this, SLOT(accept()));
}
QLabel * MENU_KERNEL::CREATE_STATUS_BAR_LABEL()
{
    QLabel * label    = new QLabel ( this );
    label->setFont ( QFont ( "Sans Serif",9 ) );
    label->setTextFormat ( Qt::RichText );

    return label;
}
Exemple #18
0
void
MessageBar::show( const QString& message, const QString& id )
{    
    QLabel* label = findChild<QLabel*>( id );
    
    if (label && id.size()) {
        if (message.isEmpty())
        {
            QProgressBar* p = label->findChild<QProgressBar*>();
            if (p)
                p->setRange( 0, 1 ),
                p->setValue( 1 );
            QTimer::singleShot( 3000, label, SLOT(deleteLater()) );
        }
        else
            label->setText( message );
        return;
    }
    
    label = new QLabel( message, ui.papyrus );
    label->setBackgroundRole( QPalette::Base );
    label->setMargin( 8 );
    label->setIndent( 4 );
    label->setTextFormat( Qt::RichText );
    label->setOpenExternalLinks( true );
    label->setTextInteractionFlags( Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse );
    
    ImageButton* close = new ImageButton( ":/buckets/radio_clear_all_x.png" );
    QHBoxLayout* h = new QHBoxLayout( label );
    h->addStretch();
    
    if (id.size())
    {
        label->setObjectName( id );
        
        QProgressBar* p;
        h->addWidget( p = new QProgressBar );
        p->setRange( 0, 0 );
        p->setFixedWidth( 90 );
    }

    h->addWidget( close );
    h->setMargin( 4 );
    
    label->setFixedWidth( width() );
    label->adjustSize();
    label->show();
    
    ui.papyrus->move( 0, -label->height() );

    doLayout();
    
    connect( close, SIGNAL(clicked()), label, SLOT(deleteLater()) );    
    connect( label, SIGNAL(destroyed()), SLOT(onLabelDestroyed()), Qt::QueuedConnection );
        
    m_timeline->setFrameRange( height(), ui.papyrus->height() );
    m_timeline->start();
}
Exemple #19
0
void FirstRun::buildPrivDialog()
{
    setWindowTitle( qtr( "Privacy and Network Access Policy" ) );
    setWindowRole( "vlc-privacy" );
    setWindowModality( Qt::ApplicationModal );
    setWindowFlags( Qt::Dialog );
    setAttribute( Qt::WA_DeleteOnClose );

    QGridLayout *gLayout = new QGridLayout( this );

    QGroupBox *blabla = new QGroupBox( qtr( "Privacy and Network Access Policy" ) );
    QGridLayout *blablaLayout = new QGridLayout( blabla );
    QLabel *text = new QLabel( qtr(
        "<p>In order to protect your privacy, <i>VLC media player</i> "
        "does <b>not</b> collect personal data or transmit them, "
        "not even in anonymized form, to anyone."
        "</p>\n"
        "<p>Nevertheless, <i>VLC</i> is able to automatically retrieve "
        "information about the media in your playlist from third party "
        "Internet-based services. This includes cover art, track names, "
        "artist names and other meta-data."
        "</p>\n"
        "<p>Consequently, this may entail identifying some of your media files to third party "
        "entities. Therefore the <i>VLC</i> developers require your express "
        "consent for the media player to access the Internet automatically."
        "</p>\n"
        ) );
    text->setWordWrap( true );
    text->setTextFormat( Qt::RichText );

    blablaLayout->addWidget( text, 0, 0 ) ;

    QGroupBox *options = new QGroupBox( qtr( "Network Access Policy" ) );
    QGridLayout *optionsLayout = new QGridLayout( options );

    gLayout->addWidget( blabla, 0, 0, 1, 3 );
    gLayout->addWidget( options, 1, 0, 1, 3 );
    int line = 0;

    checkbox = new QCheckBox( qtr( "Automatically retrieve media info" ) );
    checkbox->setChecked( true );
    optionsLayout->addWidget( checkbox, line++, 0 );

#ifdef UPDATE_CHECK
    checkbox2 = new QCheckBox( qtr( "Regularly check for VLC updates" ) );
    checkbox2->setChecked( true );
    optionsLayout->addWidget( checkbox2, line++, 0 );
#endif

    QDialogButtonBox *buttonsBox = new QDialogButtonBox( this );
    buttonsBox->addButton( qtr( "Continue" ), QDialogButtonBox::AcceptRole );

    gLayout->addWidget( buttonsBox, 2, 0, 2, 3 );

    CONNECT( buttonsBox, accepted(), this, save() );
    buttonsBox->setFocus();
}
Exemple #20
0
QWidget* PrefsDialog::createProgrammerForm(QList<Platform *> platforms) {
    QGroupBox * formGroupBox = new QGroupBox(tr("Platform Support"));
    QVBoxLayout *layout = new QVBoxLayout();
    layout->setSpacing(SPACING);

    foreach (Platform * platform, platforms) {
        QLabel *platformLb = new QLabel("");
        platformLb->setTextFormat(Qt::RichText);
        platformLb->setText(tr("<b>%1</b>").arg(platform->getName()));
        layout->addWidget(platformLb);

        QFrame * locationFrame = new QFrame(formGroupBox);
        QHBoxLayout * locationLayout = new QHBoxLayout();
        locationLayout->setMargin(0);
        locationLayout->setSpacing(0);
        locationFrame->setLayout(locationLayout);

        QLabel *locationLb = new QLabel(tr("Location:"));
        locationLayout->addWidget(locationLb);
        locationLayout->addSpacing(SPACING);

        QLineEdit * locationLE = new QLineEdit(locationFrame);
        locationLE->setText(platform->getCommandLocation());
        locationLayout->addWidget(locationLE);
        m_programmerLEs.insert(platform->getName(), locationLE);

        QPushButton * locateBtn = new QPushButton(tr("..."),locationFrame);
        locationLayout->addWidget(locateBtn);
        locateBtn->setProperty("platform", platform->getName());
        connect(locateBtn, SIGNAL(clicked()), this, SLOT(chooseProgrammer()));

        layout->addWidget(locationFrame);

        QLabel *hintLb = new QLabel("");
        hintLb->setTextFormat(Qt::RichText);
        hintLb->setOpenExternalLinks(true);
        hintLb->setText(tr("You need to have <a href='%1'>%2</a> (version %3 or newer) installed.")
                        .arg(platform->getDownloadUrl().toString())
                        .arg(platform->getIdeName())
                        .arg(platform->getMinVersion()));
        layout->addWidget(hintLb);

        layout->addSpacing(SPACING);
    }
Exemple #21
0
QLabel* QSourceProperties::_create_text_label(const QString& text)
{
  QLabel* buffer = new QLabel(text);

  buffer->setObjectName("item");
  buffer->setTextFormat(Qt::RichText);
  buffer->setAlignment(Qt::AlignLeft);

  return buffer;
}
Exemple #22
0
void FirstRun::buildPrivDialog()
{
    setWindowTitle( qtr( "Privacy and Network Access Policy" ) );
    setWindowRole( "vlc-privacy" );
    setWindowModality( Qt::ApplicationModal );
    setWindowFlags( Qt::Dialog );
    setAttribute( Qt::WA_DeleteOnClose );

    QGridLayout *gLayout = new QGridLayout( this );

    QGroupBox *blabla = new QGroupBox( qtr( "Privacy and Network Access Policy" ) );
    QGridLayout *blablaLayout = new QGridLayout( blabla );
    QLabel *text = new QLabel( qtr(
        "<p><i>VLC media player</i> does <b>not</b> send or collect any "
        "information, even anonymously, about your usage.</p>\n"
        "<p>However, it can connect to the Internet "
        "in order to display <b>medias information</b> "
#ifdef UPDATE_CHECK
        "or to check for available <b>updates</b>"
#endif
        ".</p>\n"
        "<p><i>VideoLAN</i> (the authors) requires you to express your consent "
        "before allowing this software to access the Internet.</p>\n"
        "<p>According to your choices, please check or uncheck the following options:</p>\n"
        ) );
    text->setWordWrap( true );
    text->setTextFormat( Qt::RichText );

    blablaLayout->addWidget( text, 0, 0 ) ;

    QGroupBox *options = new QGroupBox( qtr( "Network Access Policy" ) );
    QGridLayout *optionsLayout = new QGridLayout( options );

    gLayout->addWidget( blabla, 0, 0, 1, 3 );
    gLayout->addWidget( options, 1, 0, 1, 3 );
    int line = 0;

    checkbox = new QCheckBox( qtr( "Allow downloading media information" ) );
    checkbox->setChecked( true );
    optionsLayout->addWidget( checkbox, line++, 0 );

#ifdef UPDATE_CHECK
    checkbox2 = new QCheckBox( qtr( "Allow checking for VLC updates" ) );
    checkbox2->setChecked( true );
    optionsLayout->addWidget( checkbox2, line++, 0 );
#endif

    QDialogButtonBox *buttonsBox = new QDialogButtonBox( this );
    buttonsBox->addButton( qtr( "Save and Continue" ), QDialogButtonBox::AcceptRole );

    gLayout->addWidget( buttonsBox, 2, 0, 2, 3 );

    CONNECT( buttonsBox, accepted(), this, save() );
    buttonsBox->setFocus();
}
Exemple #23
0
//! @return The widget contained by the tab "Contributions"
QWidget *AboutQUCS::contributorsTab() const
{
    QLabel *contributors = new QLabel();

    // addAuthor(contributors, "Name Lastname", "*****@*****.**", tr("Whatever"));

    contributors->setAlignment(Qt::AlignCenter);
    contributors->setOpenExternalLinks(true);
    contributors->setTextFormat(Qt::RichText);
    return contributors;
}
AboutWidget::AboutWidget(const QString& content, QWidget* parent)
	: QWidget(parent)
{
	QVBoxLayout* layout = new QVBoxLayout;
	QLabel* label = new QLabel(content);
	label->setWordWrap(true);
	label->setTextFormat(Qt::RichText);
	label->setOpenExternalLinks(true);
	layout->addWidget(label);
	setLayout(layout);
}
Exemple #25
0
LegalInformationDialog::LegalInformationDialog() :
	IconDialogBase(tr("Legal information"), QStyle::SP_MessageBoxInformation)
{
	QLabel *label = new QLabel(tr("Please make sure that recording this call is legal and that all involved parties\nagree with it."));
	vbox->addWidget(label);

	QWidget *additionalInfo = new QWidget;
	additionalInfo->hide();
	QVBoxLayout *additionalInfoLayout = new QVBoxLayout(additionalInfo);
	additionalInfoLayout->setMargin(0);

	additionalInfoLayout->addSpacing(10);

	label = new QLabel(tr(
		"<p>The legality of recording calls depends on whether the involved parties agree<br>"
		"with it and on the laws that apply to their geographic locations.  Here is a<br>"
		"simple rule of thumb:</p>"

		"<p>If all involved parties have been asked for permission to record a call and<br>"
		"agree with the intended use or storage of the resulting file, then recording a<br>"
		"call is probably legal.</p>"

		"<p>If not all involved parties have been asked for permission, or if they don't<br>"
		"explicitely agree with it, or if the resulting file is used for purposes other than<br>"
		"what has been agreed upon, then it's probably illegal to record calls.</p>"

		"<p>For more serious legal advice, consult a lawyer.  For more information, you can<br>"
		"search the internet for '<a href='http://www.google.com/search?q=call+recording+legal'>call recording legal</a>'.</p>"
	));
	label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
	label->setTextFormat(Qt::RichText);
	label->setOpenExternalLinks(true);
	additionalInfoLayout->addWidget(label);

	additionalInfoLayout->addSpacing(10);

	QCheckBox* checkBox = new QCheckBox(tr("Do not show this information again"));
	connect(checkBox, SIGNAL(toggled(bool)), &settings, SLOT(setGuiHideLegalInfo(bool)));
	additionalInfoLayout->addWidget(checkBox);

	vbox->addWidget(additionalInfo);

	QPushButton* button = new QPushButton(tr("More information >>"));
	connect(button, SIGNAL(clicked()), button, SLOT(hide()));
	connect(button, SIGNAL(clicked()), additionalInfo, SLOT(show()));
	vbox->addWidget(button, 0, Qt::AlignLeft);

	button = new QPushButton(tr("&OK"));
	button->setDefault(true);
	connect(button, SIGNAL(clicked()), this, SLOT(close()));
	hbox->addWidget(button, 0, Qt::AlignHCenter);

	show();
}
Exemple #26
0
//! @return The widget contained by the tab "Translators"
QWidget *AboutQUCS::translatorsTab() const
{
    QLabel *translators = new QLabel();

    addAuthor(translators, "Pablo Daniel Pareja Obregon", "*****@*****.**",
            tr("Spanish translation"));

    translators->setAlignment(Qt::AlignCenter);
    translators->setOpenExternalLinks(true);
    translators->setTextFormat(Qt::RichText);
    return translators;
}
Exemple #27
0
    QLabel* createLink(QString path)
    {
        QLabel *label = new QLabel();
        label->setTextFormat(Qt::RichText);
        label->setTextInteractionFlags(Qt::TextBrowserInteraction);
        label->setOpenExternalLinks(true);

        QString link("<a href=" + path + ">" + path + "</a>");

        label->setText(link);
        return label;
    }
Exemple #28
0
KMConfigFilter::KMConfigFilter(QWidget *parent, const char *name) : KMConfigPage(parent, name)
{
    setPageName(i18n("Filter"));
    setPageHeader(i18n("Printer Filtering Settings"));
    setPagePixmap("filter");

    QGroupBox *box = new QGroupBox(0, Qt::Vertical, i18n("Printer Filter"), this);

    m_list1 = new KListBox(box);
    m_list1->setSelectionMode(KListBox::Extended);
    m_list2 = new KListBox(box);
    m_list2->setSelectionMode(KListBox::Extended);
    m_add = new QToolButton(box);
    m_add->setIconSet(QApplication::reverseLayout() ? SmallIconSet("back") : SmallIconSet("forward"));
    m_remove = new QToolButton(box);
    m_remove->setIconSet(QApplication::reverseLayout() ? SmallIconSet("forward") : SmallIconSet("back"));
    m_locationre = new QLineEdit(box);
    QLabel *lab = new QLabel(box);
    lab->setText(
        i18n("The printer filtering allows you to view only a specific set of "
             "printers instead of all of them. This may be useful when there are a "
             "lot of printers available but you only use a few ones. Select the "
             "printers you want to see from the list on the left or enter a <b>Location</b> "
             "filter (ex: Group_1*). Both are cumulative and ignored if empty."));
    lab->setTextFormat(Qt::RichText);
    QLabel *lab1 = new QLabel(i18n("Location filter:"), box);

    QVBoxLayout *l0 = new QVBoxLayout(this, 0, KDialog::spacingHint());
    l0->addWidget(box, 1);
    QVBoxLayout *l1 = new QVBoxLayout(box->layout(), KDialog::spacingHint());
    l1->addWidget(lab);
    QGridLayout *l2 = new QGridLayout(0, 4, 3, 0, KDialog::spacingHint());
    l1->addLayout(l2);
    l2->setRowStretch(0, 1);
    l2->setRowStretch(3, 1);
    l2->setColStretch(0, 1);
    l2->setColStretch(2, 1);
    l2->addMultiCellWidget(m_list1, 0, 3, 0, 0);
    l2->addMultiCellWidget(m_list2, 0, 3, 2, 2);
    l2->addWidget(m_add, 1, 1);
    l2->addWidget(m_remove, 2, 1);
    QHBoxLayout *l3 = new QHBoxLayout(0, 0, KDialog::spacingHint());
    l1->addLayout(l3, 0);
    l3->addWidget(lab1, 0);
    l3->addWidget(m_locationre, 1);

    connect(m_add, SIGNAL(clicked()), SLOT(slotAddClicked()));
    connect(m_remove, SIGNAL(clicked()), SLOT(slotRemoveClicked()));
    connect(m_list1, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
    connect(m_list2, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
    m_add->setEnabled(false);
    m_remove->setEnabled(false);
}
LongMessageWidget::LongMessageWidget( QWidget *anchor, const QString &message,
                                     Amarok::Logger::MessageType type )
        : PopupWidget( anchor )
        , m_counter( 0 )
        , m_timeout( 6000 )
{
    DEBUG_BLOCK
    Q_UNUSED( type )

    setFrameStyle( QFrame::StyledPanel | QFrame::Raised );

    setContentsMargins( 4, 4, 4, 4 );

    setMinimumWidth( 26 );
    setMinimumHeight( 26 );
    setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );

    QPalette p = QToolTip::palette();
    setPalette( p );

    KHBox *hbox = new KHBox( this );
    layout()->addWidget( hbox );

    hbox->setSpacing( 12 );

    m_countdownFrame = new CountdownFrame( hbox );
    m_countdownFrame->setObjectName( "counterVisual" );
    m_countdownFrame->setFixedWidth( fontMetrics().width( "X" ) );
    m_countdownFrame->setFrameStyle( QFrame::Plain | QFrame::Box );
    QPalette pal;
    pal.setColor( m_countdownFrame->foregroundRole(), p.dark().color() );
    m_countdownFrame->setPalette( pal );

    QLabel *alabel = new QLabel( message, hbox );
    alabel->setWordWrap( true );
    alabel->setOpenExternalLinks( true );
    alabel->setObjectName( "label" );
    alabel->setTextFormat( Qt::RichText );
    alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
    alabel->setPalette( p );

    hbox = new KHBox( this );
    layout()->addWidget( hbox );

    KPushButton *button = new KPushButton( KStandardGuiItem::close(), hbox );
    button->setObjectName( "closeButton" );
    connect( button, SIGNAL( clicked() ), SLOT( close() ) );

    reposition();

    show();
    m_timerId = startTimer( m_timeout / m_countdownFrame->height() );
}
Exemple #30
0
void BuddyDeleteWindow::createGui()
{
    QVBoxLayout *mainLayout = new QVBoxLayout(this);

    QWidget *topWidget = new QWidget(this);
    mainLayout->addWidget(topWidget);

    QHBoxLayout *topLayout = new QHBoxLayout(topWidget);

    QLabel *iconLabel = new QLabel(topWidget);
    iconLabel->setPixmap(m_iconsManager->iconByPath(KaduIcon("dialog-warning")).pixmap(32, 32));
    topLayout->addWidget(iconLabel, 0, Qt::AlignTop);

    QWidget *contentWidget = new QWidget(topWidget);
    topLayout->addWidget(contentWidget);

    QVBoxLayout *contentLayout = new QVBoxLayout(contentWidget);

    QLabel *messageLabel = new QLabel(
        tr("The following buddies will be deleted:<br/>%1.<br/>Are you sure?").arg(getBuddiesNames()), contentWidget);
    messageLabel->setTextFormat(Qt::RichText);
    messageLabel->setWordWrap(true);
    contentLayout->addWidget(messageLabel);

    QLabel *additionalDataLabel = new QLabel(tr("Please select additional data that will be removed:"), contentWidget);
    contentLayout->addWidget(additionalDataLabel);

    AdditionalDataListView = new QListWidget(contentWidget);
    contentLayout->addWidget(AdditionalDataListView);
    connect(
        AdditionalDataListView, SIGNAL(itemPressed(QListWidgetItem *)), this,
        SLOT(additionalDataListViewItemPressed(QListWidgetItem *)));
    connect(
        AdditionalDataListView, SIGNAL(itemClicked(QListWidgetItem *)), this,
        SLOT(additionalDataListViewItemClicked(QListWidgetItem *)));

    fillAdditionalDataListView();

    QPushButton *deleteButton = new QPushButton(tr("Delete"));
    QPushButton *cancelButton =
        new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Cancel"));
    cancelButton->setDefault(true);

    QDialogButtonBox *buttons = new QDialogButtonBox(this);
    buttons->addButton(deleteButton, QDialogButtonBox::DestructiveRole);
    buttons->addButton(cancelButton, QDialogButtonBox::RejectRole);
    mainLayout->addWidget(buttons);

    connect(deleteButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
    connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(reject()));
}