Esempio n. 1
0
/*
 * This SLOT is called every time the user clicks a url inside newsTab textBrowser
 */
void MainWindow::onTabNewsSourceChanged(QUrl newSource)
{
  if(newSource.isRelative())
  {
    //If the user clicked a relative and impossible to display link...
    QTextBrowser *text = ui->twProperties->widget(ctn_TABINDEX_NEWS)->findChild<QTextBrowser*>("textBrowser");
    if (text)
    {
      disconnect(text, SIGNAL(sourceChanged(QUrl)), this, SLOT(onTabNewsSourceChanged(QUrl)));
      text->setHtml(utils::parseDistroNews());
      connect(text, SIGNAL(sourceChanged(QUrl)), this, SLOT(onTabNewsSourceChanged(QUrl)));
    }
  }
}
Esempio n. 2
0
void ChatWidget::fileHashingFinished(QList<HashedFile> hashedFiles)
{
	std::cerr << "ChatWidget::fileHashingFinished() started." << std::endl;

	QString message;

	QList<HashedFile>::iterator it;
	for (it = hashedFiles.begin(); it != hashedFiles.end(); ++it) {
		HashedFile& hashedFile = *it;
		QString ext = QFileInfo(hashedFile.filename).suffix();

		RetroShareLink link;

		if(mDefaultExtraFileFlags & RS_FILE_REQ_ANONYMOUS_ROUTING)
			link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash));
		else
			link.createExtraFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash),QString::fromStdString(rsPeers->getOwnId()));

		if (hashedFile.flag & HashedFile::Picture) {
			message += QString("<img src=\"file:///%1\" width=\"100\" height=\"100\">").arg(hashedFile.filepath);
			message+="<br>";
		} else {
			QString image = FilesDefs::getImageFromFilename(hashedFile.filename, false);
			if (!image.isEmpty()) {
				message += QString("<img src=\"%1\">").arg(image);
			}
		}
		message += link.toHtmlSize();
		if (it != hashedFiles.end()) {
			message += "<BR>";
		}
	}

#ifdef CHAT_DEBUG
	std::cerr << "ChatWidget::fileHashingFinished message : " << message.toStdString() << std::endl;
#endif

	/* convert to real html document */
	QTextBrowser textBrowser;
	textBrowser.setHtml(message);
	std::wstring msg = textBrowser.toHtml().toStdWString();

	if (rsMsgs->sendPrivateChat(peerId, msg)) {
		QDateTime currentTime = QDateTime::currentDateTime();
		addChatMsg(false, name, currentTime, currentTime, QString::fromStdWString(msg), TYPE_NORMAL);
	}
}
Esempio n. 3
0
File: help.cpp Progetto: Kafay/vlc
HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )

{
    setWindowTitle( qtr( "Help" ) );
    setMinimumSize( 350, 300 );

    QGridLayout *layout = new QGridLayout( this );
    QTextBrowser *helpBrowser = new QTextBrowser( this );
    helpBrowser->setOpenExternalLinks( true );
    helpBrowser->setHtml( qtr(I_LONGHELP) );
    QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
    closeButton->setDefault( true );

    layout->addWidget( helpBrowser, 0, 0, 1, 0 );
    layout->addWidget( closeButton, 1, 3 );

    BUTTONACT( closeButton, close() );
    readSettings( "Help", QSize( 500, 450 ) );
}
Esempio n. 4
0
void SupportWidget::setupUi()
{
   QVBoxLayout * vb = new QVBoxLayout;
   setLayout(vb);

   QTextBrowser * lblContact = new QTextBrowser(this);
   lblContact->setOpenExternalLinks(true);
   QString supText = "<h3>We love to hear from the people who use our software.</h3>"
      "<font color=orange>Contact us</font>"
      "<p>"
      "Technical support is available by e-mail addressed to our support department at <a href=\"mailto:[email protected]\" target=_blank>[email protected]</a>. "
      "Please feel free to email us, normally we will reply to you within one business day."
      "<p>Please specify in your message the following details:<ul>"
      "<li> program version"
      "<li> processor type"
      "<li> operating system version"
      "<li> amount of memory available"
      "<li> active applications</ul>"
      "<p><font color=orange>Registration key reclamation</font><p>"
      "If you are a registered user of the program and for a certain reason you need to reclaim your registration key, please contact us at <a href=\"mailto:[email protected]\" target=_blank>[email protected]</a> subject <b>Registration key reclamation</b>,"
      "  message with the following information:<ul>"
      "<li> Your first and last names</li>"
      "<li> The e-mail address the registration message was sent to</li>"
      "<li>  Program name</li>"
      "<li>  License type</li>"
      "<li>  Purchase date</li>"
      "<li>  Purchase method</li>"
      "<li>  Other purchase details</li></ul>"
      "The new registration data will be sent to you within 24 hours."
      "We will send you a registration key by e-mail free of charge. If you use an e-mail address different from the one specified during the registration, please specify all your registration information, including your previous e-mail address. We will send you a registration key after we have checked the registration information.";

   lblContact->setHtml(supText);
   vb->addWidget(lblContact);

   QLabel * lblInfo = new QLabel(this);
   lblInfo->setTextInteractionFlags(Qt::TextSelectableByMouse);
   QDate dtRelease = QDate::fromString(RELEASE_DATE, "yyyy-MM-dd");
   
   lblInfo->setText(QString("Holdem Folder (c) v. %1 by %2 All Right Reserved")
      .arg(VERSION).arg(dtRelease.toString(Qt::SystemLocaleShortDate)));
   lblInfo->setCursor(Qt::IBeamCursor);
   vb->addWidget(lblInfo);
}
Esempio n. 5
0
DialogAbout::DialogAbout(PageWelcome* parent)
	: QDialog(parent) {

	setWindowTitle(tr("About SimpleScreenRecorder"));

	QString html_about;
	{
		QFile file(":/about.htm");
		if(file.open(QIODevice::ReadOnly | QIODevice::Text))
			html_about = file.readAll();
	}

	html_about.replace("%MOREINFO%", tr("For more information:"));
	html_about.replace("%SOURCECODE%", tr("The source code of this program can be found at:"));
	html_about.replace("%USES%", tr("This program uses:"));
	html_about.replace("%USES_QT4%", tr("%1 for the graphical user interface").arg("<a href=\"https://qt-project.org/\">Qt 4</a>"));
	html_about.replace("%USES_LIBAV_FFMPEG%", tr("%1 or %2 (depending on your distribution) for video/audio encoding").arg("<a href=\"http://libav.org/\">libav</a>").arg("<a href=\"http://ffmpeg.org/\">ffmpeg</a>"));
	html_about.replace("%USES_ELFHACKS%", tr("%1 for hooking system functions for OpenGL recording").arg("<a href=\"https://github.com/nullkey/elfhacks\">elfhacks</a>"));
	html_about.replace("%VERSION%", PACKAGE_VERSION);
	html_about.replace("%VERSIONINFO%", GetVersionInfo().replace("\n", "<br>\n"));

	QTextBrowser *textbrowser = new QTextBrowser(this);
	textbrowser->setHtml(html_about);
	textbrowser->setOpenExternalLinks(true);
	textbrowser->setMinimumSize(700, 500);

	QPushButton *pushbutton_close = new QPushButton("Close", this);

	connect(pushbutton_close, SIGNAL(clicked()), this, SLOT(accept()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(textbrowser);
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addStretch();
		layout2->addWidget(pushbutton_close);
		layout2->addStretch();
	}

}
Esempio n. 6
0
/*---------------------------------------------------------------------------
* Hilfe
*---------------------------------------------------------------------------*/
void MainWindow::on_actionHilfe_triggered()
{
   if(!helpDialog)
   {
      // Hilfe laden
      QString helpText;
      QFile *f = new QFile(":/help/doc/hilfe.html");
      if(f->open(QFile::ReadOnly))
      {
         QTextStream strm(f);
         helpText = strm.readAll();
         f->close();
         delete f;
      }
      else
      {
         QMessageBox::warning( this,
                               tr("Hilfe"),
                               tr("Hilfe konnte nicht geladen werden!"));
         delete f;
         return;
      }

      // Hilfefenster erstellen
      helpDialog = new QDialog( this, Qt::Dialog);
      helpDialog->setWindowTitle(tr("DtaGui Hilfe"));
      helpDialog->resize(800,600);

      QTextBrowser *text = new QTextBrowser(this);
      text->setHtml(helpText);

      QVBoxLayout *layout = new QVBoxLayout();
      layout->addWidget(text);
      helpDialog->setLayout(layout);
   }

   // Hilfe anzeigen
   helpDialog->show();
   helpDialog->raise();
   helpDialog->activateWindow();
}
Esempio n. 7
0
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
    setWindowTitle(tr("Bluecherry Client - About"));
    setFixedSize(500, 400);
    setModal(true);

    QGridLayout *layout = new QGridLayout(this);

    QLabel *logo = new QLabel;
    logo->setPixmap(QPixmap(QLatin1String(":/images/logo.png"))
                    .scaled(130, 130, Qt::KeepAspectRatio, Qt::SmoothTransformation));
    logo->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    layout->addWidget(logo, 0, 0);

    QLabel *text = new QLabel;
    text->setText(tr("Bluecherry DVR Client<br>Version %1").arg(QApplication::applicationVersion()));
    text->setAlignment(Qt::AlignHCenter | Qt::AlignTop);

    QFont font = text->font();
    font.setPixelSize(15);
    text->setFont(font);

    layout->addWidget(text, 0, 1);
    layout->setColumnStretch(1, 1);

    QTextBrowser *license = new QTextBrowser;
    license->setHtml(getLicenseText());
    license->setStyleSheet(QLatin1String("font-size: 12px"));
    license->setReadOnly(true);
    license->setOpenExternalLinks(true);
    license->setTabChangesFocus(true);
    layout->addWidget(license, 1, 0, 1, 2);

    font = QFont();
    font.setStyleHint(QFont::SansSerif);
    font.setPixelSize(13);
    license->setFont(font);
}
Esempio n. 8
0
DialogAbout::DialogAbout(PageWelcome* parent)
	: QDialog(parent) {

	setWindowTitle("About SimpleScreenRecorder");

	QString html_about;
	{
		QFile file(":/about.htm");
		if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
			html_about = "Error: Can't load about dialog text.";
		} else {
			html_about = file.readAll();
		}
	}

	html_about.replace("%VERSION%", SSR_VERSION);
	html_about.replace("%VERSIONINFO%", GetVersionInfo().replace("\n", "<br>\n"));

	QTextBrowser *textbrowser = new QTextBrowser(this);
	textbrowser->setHtml(html_about);
	textbrowser->setOpenExternalLinks(true);
	textbrowser->setMinimumSize(700, 500);

	QPushButton *pushbutton_close = new QPushButton("Close", this);

	connect(pushbutton_close, SIGNAL(clicked()), this, SLOT(accept()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(textbrowser);
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addStretch();
		layout2->addWidget(pushbutton_close);
		layout2->addStretch();
	}

}
Esempio n. 9
0
/** Geocache information dialog */
CacheInfoDialog::CacheInfoDialog(Cache * cache, QWidget * parent) :
  QDialog(parent), cache_(cache) {

  setWindowTitle(cache->name + " (" + cache->waypoint + ")");

  // Grid layout as main layout
  QGridLayout * mainLayout = new QGridLayout(this);

  // cache name
  mainLayout->addWidget(new QLabel("<big><b>" + cache->name + "</b></big>"), 0,
    0, Qt::AlignLeft);

  // cache icon
  QLabel * pic = new QLabel;
  pic->setPixmap(cacheIcon(cache));
  mainLayout->addWidget(pic, 0, 1, Qt::AlignRight);

  // tab pages
  // setup description browser
  QTextBrowser * descBrowser = new QTextBrowser();
  descBrowser->setHtml(cache->desc);
  descBrowser->setOpenExternalLinks(true);

  // prepare tab widgets
  QTabWidget * tab = new QTabWidget;
  tab->addTab(new InfoTab(cache), "General");
  tab->addTab(descBrowser, "Description");

  mainLayout->addWidget(tab, 1, 0, 1, 2);

  // button box
  QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  mainLayout->addWidget(buttonBox, 2, 0, 1, 2, Qt::AlignRight);

  setLayout(mainLayout);
}
Esempio n. 10
0
void About::showAboutDialog()
{
    m_dialog = new QDialog ( QApplication::focusWidget() );
    m_dialog->setWindowTitle ( QObject::tr( "About..." ) );
    QVBoxLayout * layout = new QVBoxLayout ( m_dialog );

    QHBoxLayout * titleLayout = new QHBoxLayout ( );
    QLabel * programName = new QLabel ( QString ( "<b>" ) + QObject::tr(ApplicationName) + QString ( " " ) +QString( ZMVIEWER_VERSION_STRING ) + QString ( "</b>" ), m_dialog );
    titleLayout->addWidget ( programName );
    QLabel * programIcon = new QLabel ( m_dialog );
    programIcon->setPixmap ( qApp->windowIcon().pixmap ( 32,32 ) );
    titleLayout->addWidget ( programIcon );
    layout->addLayout ( titleLayout );

    QTabWidget * tab = new QTabWidget ( m_dialog );
    QLabel * label = new QLabel ( aboutText (), m_dialog );
    tab->addTab ( label , QObject::tr( "About" ) );

    QTextBrowser * authors = new QTextBrowser ( m_dialog );
    authors->setHtml ( authorsText () );
    authors->setReadOnly ( true );
    authors->setOpenExternalLinks ( m_dialog );

    tab->addTab ( authors , QObject::tr( "Authors and Thanks" ) );

    layout->addWidget ( tab );
    QPushButton * button = new QPushButton ( QObject::tr( "Ok" ) , m_dialog );
    QHBoxLayout * buttonLayout = new QHBoxLayout ( );
    buttonLayout->addItem ( new QSpacerItem ( 20,30, QSizePolicy::Expanding ) );
    buttonLayout->addWidget ( button );
    layout->addLayout ( buttonLayout );

    QObject::connect ( button, SIGNAL ( clicked() ),m_dialog,SLOT ( accept() ) );
    m_dialog->exec();
    m_dialog->deleteLater();
}
Esempio n. 11
0
HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )

{
    setWindowTitle( qtr( "Help" ) );
    setWindowRole( "vlc-help" );
    setMinimumSize( 350, 300 );

    QVBoxLayout *layout = new QVBoxLayout( this );

    QTextBrowser *helpBrowser = new QTextBrowser( this );
    helpBrowser->setOpenExternalLinks( true );
    helpBrowser->setHtml( qtr(I_LONGHELP) );

    QDialogButtonBox *closeButtonBox = new QDialogButtonBox( this );
    closeButtonBox->addButton(
        new QPushButton( qtr("&Close") ), QDialogButtonBox::RejectRole );
    closeButtonBox->setFocus();

    layout->addWidget( helpBrowser );
    layout->addWidget( closeButtonBox );

    CONNECT( closeButtonBox, rejected(), this, close() );
    restoreWidgetPosition( "Help", QSize( 500, 450 ) );
}
Esempio n. 12
0
AboutDialog::AboutDialog(const QString &lang, QWidget *parent) :
  Dialog(parent, Qt::MSWindowsFixedSizeDialogHint)
{
  setWindowTitle(tr("About"));
  setWindowFlags (windowFlags() & ~Qt::WindowContextHelpButtonHint);
  setObjectName("AboutDialog");
  setMinimumWidth(480);

  QTabWidget *tabWidget = new QTabWidget();

  QyurSqlTreeView treeView;

  QString revisionStr;
  if (QString("%1").arg(VCS_REVISION) != "0") {
      revisionStr = "<BR>" + tr("Revision") + " " + QString("%1").arg(VCS_REVISION);
  }
  QString appInfo =
      "<html><style>a { color: blue; text-decoration: none; }</style><body>"
      "<CENTER>"
      "<IMG SRC=\":/images/images/logo.png\">"
      "<BR><IMG SRC=\":/images/images/logo_text.png\">"
      "<P>"
      + tr("Version") + " " + "<B>" + QString(STRPRODUCTVER) + "</B>" + QString(" (%1)").arg(STRDATE)
      + revisionStr
      + "</P>"
      + "<BR>"
      + tr("QuiteRSS is a open-source cross-platform RSS/Atom news reader")
      + "<P>" + tr("Includes:")
      + QString(" Qt-%1, SQLite-%2, QyurSqlTreeView-%3,").
      arg(QT_VERSION_STR).arg(SQLITE_VERSION).
      arg(treeView.metaObject()->classInfo(treeView.metaObject()->indexOfClassInfo("Version")).value())
      + "<BR>"
      + QString(" WebKit-%4, QupZilla-1.7.0").
      arg(qWebKitVersion())
      + "</P>"
      + QString("<a href=\"%1\">%1</a>").arg("http://quiterss.org") +
      "<P>Copyright &copy; 2011-2015 QuiteRSS Team "
      + QString("<a href=\"%1\">E-mail</a>").arg("mailto:[email protected]") + "</P>"
      "</CENTER></body></html>";
  QLabel *infoLabel = new QLabel(appInfo);
  infoLabel->setOpenExternalLinks(true);
  infoLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

  QHBoxLayout *mainLayout = new QHBoxLayout();
  mainLayout->addWidget(infoLabel);
  QWidget *mainWidget = new QWidget();
  mainWidget->setLayout(mainLayout);

  QTextEdit *authorsTextEdit = new QTextEdit(this);
  authorsTextEdit->setReadOnly(true);
  QFile file;
  file.setFileName(":/file/AUTHORS");
  file.open(QFile::ReadOnly);
  authorsTextEdit->setText(QString::fromUtf8(file.readAll()));
  file.close();

  QHBoxLayout *authorsLayout = new QHBoxLayout();
  authorsLayout->addWidget(authorsTextEdit);
  QWidget *authorsWidget = new QWidget();
  authorsWidget->setLayout(authorsLayout);

  QTextBrowser *historyTextBrowser = new QTextBrowser();
  historyTextBrowser->setOpenExternalLinks(true);
  if (lang.contains("ru", Qt::CaseInsensitive))
    file.setFileName(":/file/HISTORY_RU");
  else
    file.setFileName(":/file/HISTORY_EN");
  file.open(QFile::ReadOnly);
  historyTextBrowser->setHtml(QString::fromUtf8(file.readAll()));
  file.close();

  QHBoxLayout *historyLayout = new QHBoxLayout();
  historyLayout->addWidget(historyTextBrowser);
  QWidget *historyWidget = new QWidget();
  historyWidget->setLayout(historyLayout);

  QTextEdit *licenseTextEdit = new QTextEdit();
  licenseTextEdit->setReadOnly(true);
  file.setFileName(":/file/COPYING");
  file.open(QFile::ReadOnly);
  QString str = QString(QString::fromUtf8(file.readAll())).section("-----", 1, 1);
  licenseTextEdit->setText(str);
  file.close();

  QHBoxLayout *licenseLayout = new QHBoxLayout();
  licenseLayout->addWidget(licenseTextEdit);
  QWidget *licenseWidget = new QWidget();
  licenseWidget->setLayout(licenseLayout);

  QString portable;
  if (mainApp->isPortable()) {
    if (!mainApp->isPortableAppsCom())
      portable = "(Portable)";
    else
      portable = "(PortableApps)";
  }
  Settings settings;
  QString information =
      "<table border=\"0\"><tr>"
      "<td>" + tr("Version") + " </td>"
      "<td>" + QString("%1.%2 %3 %4").arg(STRPRODUCTVER).arg(VCS_REVISION).arg(portable).arg(STRDATE) + "</td>"
      "</tr><tr></tr><tr>"
      "<td>" + tr("Application directory:") + " </td>"
      "<td>" + QCoreApplication::applicationDirPath() + "</td>"
      "</tr><tr>"
      "<td>" + tr("Resource directory:") + " </td>"
      "<td>" + mainApp->resourcesDir() + "</td>"
      "</tr><tr>"
      "<td>" + tr("Data directory:") + " </td>"
      "<td>" + mainApp->dataDir() + "</td>"
      "</tr><tr>"
      "<td>" + tr("Backup directory:") + " </td>"
      "<td>" + mainApp->dataDir() + "/backup" + "</td>"
      "</tr><tr></tr><tr>"
      "<td>" + tr("Database file:") + " </td>"
      "<td>" + mainApp->dbFileName() + "</td>"
      "</tr><tr>"
      "<td>" + tr("Settings file:") + " </td>"
      "<td>" + settings.fileName() + "</td>"
      "</tr><tr>"
      "<td>" + tr("Log file:") + " </td>"
      "<td>" + mainApp->dataDir() + "/debug.log" + "</td>"
      "</tr></table>";

  QTextEdit *informationTextEdit = new QTextEdit();
  informationTextEdit->setReadOnly(true);
  informationTextEdit->setText(information);

  QHBoxLayout *informationLayout = new QHBoxLayout();
  informationLayout->addWidget(informationTextEdit);

  QWidget *informationWidget = new QWidget();
  informationWidget->setLayout(informationLayout);

  tabWidget->addTab(mainWidget, tr("Version"));
  tabWidget->addTab(authorsWidget, tr("Authors"));
  tabWidget->addTab(historyWidget, tr("History"));
  tabWidget->addTab(licenseWidget, tr("License"));
  tabWidget->addTab(informationWidget, tr("Information"));

  pageLayout->addWidget(tabWidget);

  buttonBox->addButton(QDialogButtonBox::Close);
}
QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget )
{
    QLabel *label = NULL;
    QPushButton *button = NULL;
    QTextBrowser *textArea = NULL;
    QLineEdit *textInput = NULL;
    QCheckBox *checkBox = NULL;
    QComboBox *comboBox = NULL;
    QListWidget *list = NULL;
    SpinningIcon *spinIcon = NULL;
    struct /*extension_widget_t::*/extension_widget_value_t *p_value = NULL;			// sunqueen modify

    assert( p_widget->p_sys_intf == NULL );

    switch( p_widget->type )
    {
        case EXTENSION_WIDGET_LABEL:
            label = new QLabel( qfu( p_widget->psz_text ), this );
            p_widget->p_sys_intf = label;
            label->setTextFormat( Qt::RichText );
            label->setOpenExternalLinks( true );
            return label;

        case EXTENSION_WIDGET_BUTTON:
            button = new QPushButton( qfu( p_widget->psz_text ), this );
            clickMapper->setMapping( button, new WidgetMapper( p_widget ) );
            CONNECT( button, clicked(), clickMapper, map() );
            p_widget->p_sys_intf = button;
            return button;

        case EXTENSION_WIDGET_IMAGE:
            label = new QLabel( this );
            label->setPixmap( QPixmap( qfu( p_widget->psz_text ) ) );
            if( p_widget->i_width > 0 )
                label->setMaximumWidth( p_widget->i_width );
            if( p_widget->i_height > 0 )
                label->setMaximumHeight( p_widget->i_height );
            label->setScaledContents( true );
            p_widget->p_sys_intf = label;
            return label;

        case EXTENSION_WIDGET_HTML:
            textArea = new QTextBrowser( this );
            textArea->setOpenExternalLinks( true );
            textArea->setHtml( qfu( p_widget->psz_text ) );
            p_widget->p_sys_intf = textArea;
            return textArea;

        case EXTENSION_WIDGET_TEXT_FIELD:
            textInput = new QLineEdit( this );
            textInput->setText( qfu( p_widget->psz_text ) );
            textInput->setReadOnly( false );
            textInput->setEchoMode( QLineEdit::Normal );
            inputMapper->setMapping( textInput, new WidgetMapper( p_widget ) );
            /// @note: maybe it would be wiser to use textEdited here?
            CONNECT( textInput, textChanged(const QString &),
                     inputMapper, map() );
            p_widget->p_sys_intf = textInput;
            return textInput;

        case EXTENSION_WIDGET_PASSWORD:
            textInput = new QLineEdit( this );
            textInput->setText( qfu( p_widget->psz_text ) );
            textInput->setReadOnly( false );
            textInput->setEchoMode( QLineEdit::Password );
            inputMapper->setMapping( textInput, new WidgetMapper( p_widget ) );
            /// @note: maybe it would be wiser to use textEdited here?
            CONNECT( textInput, textChanged(const QString &),
                     inputMapper, map() );
            p_widget->p_sys_intf = textInput;
            return textInput;

        case EXTENSION_WIDGET_CHECK_BOX:
            checkBox = new QCheckBox( this );
            checkBox->setText( qfu( p_widget->psz_text ) );
            checkBox->setChecked( p_widget->b_checked );
            clickMapper->setMapping( checkBox, new WidgetMapper( p_widget ) );
            CONNECT( checkBox, stateChanged( int ), clickMapper, map() );
            p_widget->p_sys_intf = checkBox;
            return checkBox;

        case EXTENSION_WIDGET_DROPDOWN:
            comboBox = new QComboBox( this );
            comboBox->setEditable( false );
            for( p_value = p_widget->p_values;
                 p_value != NULL;
                 p_value = p_value->p_next )
            {
                comboBox->addItem( qfu( p_value->psz_text ), p_value->i_id );
            }
            /* Set current item */
            if( p_widget->psz_text )
            {
                int idx = comboBox->findText( qfu( p_widget->psz_text ) );
                if( idx >= 0 )
                    comboBox->setCurrentIndex( idx );
            }
            selectMapper->setMapping( comboBox, new WidgetMapper( p_widget ) );
            CONNECT( comboBox, currentIndexChanged( const QString& ),
                     selectMapper, map() );
            return comboBox;

        case EXTENSION_WIDGET_LIST:
            list = new QListWidget( this );
            list->setSelectionMode( QAbstractItemView::ExtendedSelection );
            for( p_value = p_widget->p_values;
                 p_value != NULL;
                 p_value = p_value->p_next )
            {
                QListWidgetItem *item =
                    new QListWidgetItem( qfu( p_value->psz_text ) );
                item->setData( Qt::UserRole, p_value->i_id );
                list->addItem( item );
            }
            selectMapper->setMapping( list, new WidgetMapper( p_widget ) );
            CONNECT( list, itemSelectionChanged(),
                     selectMapper, map() );
            return list;

        case EXTENSION_WIDGET_SPIN_ICON:
            spinIcon = new SpinningIcon( this );
            spinIcon->play( p_widget->i_spin_loops );
            p_widget->p_sys_intf = spinIcon;
            return spinIcon;

        default:
            msg_Err( p_intf, "Widget type %d unknown", p_widget->type );
            return NULL;
    }
}
Esempio n. 14
0
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
    QLabel* labelIcon = new QLabel(this);
    labelIcon->setPixmap(qApp->windowIcon().pixmap(QSize(58, 58)));

#if defined Q_OS_MAC
    QString strProduct("<span style=\"font-weight:bold;font-size:14px\">WizNote for Mac</span>");
#elif defined Q_OS_LINUX
    QString strProduct("<span style=\"font-weight:bold;font-size:14px\">WizNote for Linux</span>");
#else
    QString strProduct("<span style=\"font-weight:bold;font-size:14px\">WizNote for Windows</span>");
#endif

    QLabel* labelProduct = new QLabel(this);
    labelProduct->setText(strProduct);

    QString strPath = QApplication::applicationDirPath();
    QFileInfo fi(strPath);
    QDateTime t = fi.lastModified();
    QString strBuildNumber("(%1.%2.%3 %4:%5)");
    strBuildNumber = strBuildNumber.\
            arg(t.date().year()).\
            arg(t.date().month()).\
            arg(t.date().day()).\
            arg(t.time().hour()).\
            arg(t.time().minute());

    QString strInfo = QString(tr("<span style=\"font-size:11px\">Version %2 %3</span>")).arg(WIZ_CLIENT_VERSION, strBuildNumber);
    QLabel* labelBuild = new QLabel(this);
    labelBuild->setText(strInfo);

    QTextBrowser* textCredits = new QTextBrowser(this);
    textCredits->setOpenExternalLinks(true);
    textCredits->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    QString strHtml;

    QFile file(":/credits.html");
    if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
        QTextStream stream(&file);
        strHtml = stream.readAll();
        file.close();
    }

    //Utils::Misc::loadUnicodeTextFromFile(":/credits.html", strHtml);
    textCredits->setHtml(strHtml);

    QLabel* labelCopyright = new QLabel(this);
    labelCopyright->setText(tr("<span style=\"font-size:10px\">Copy Right 2013 Wiz inc. All rights reserved</span>"));

    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->setContentsMargins(0, 10, 0, 10);

    layout->addWidget(labelIcon);
    layout->addWidget(labelProduct);
    layout->addWidget(labelBuild);
    layout->addWidget(textCredits);
    layout->addWidget(labelCopyright);
    layout->setAlignment(labelIcon, Qt::AlignCenter);
    layout->setAlignment(labelProduct, Qt::AlignCenter);
    layout->setAlignment(labelBuild, Qt::AlignCenter);
    layout->setAlignment(textCredits, Qt::AlignCenter);
    layout->setAlignment(labelCopyright, Qt::AlignCenter);

    setWindowTitle(tr("About WizNote"));
}
Esempio n. 15
0
/*
 * This is the high level method that orquestrates the Distro RSS News printing in tabNews
 *
 * boolean parameter searchForLatestNews:
 *    controls whether this method tries to connect to the remote RSS News Feed (default is true)
 * boolean parameter gotoNewsTab:
 *    controls whether this method must set the mainwindow focus to NewsTab (default is true)
 */
void MainWindow::refreshDistroNews(bool searchForLatestNews, bool gotoNewsTab)
{
  qApp->processEvents();

  if (searchForLatestNews)
  {
    LinuxDistro distro = UnixCommand::getLinuxDistro();
    clearTabOutput();

    if (distro == ectn_ARCHLINUX || distro == ectn_ARCHBANGLINUX)
    {
      writeToTabOutputExt("<b>" +
                          StrConstants::getSearchingForDistroNews().arg("Arch Linux") + "</b>");
    }
    else if (distro == ectn_CHAKRA)
    {
      writeToTabOutputExt("<b>" +
                          StrConstants::getSearchingForDistroNews().arg("Chakra") + "</b>");
    }
    else if (distro == ectn_MANJAROLINUX)
    {
      writeToTabOutputExt("<b>" +
                          StrConstants::getSearchingForDistroNews().arg("Manjaro Linux") + "</b>");
    }

    qApp->processEvents();
  }

  CPUIntensiveComputing *cic = new CPUIntensiveComputing;
  QString distroRSSXML = retrieveDistroNews(searchForLatestNews);
  delete cic;

  QString html;

  if (distroRSSXML.count() >= 200)
  {
    if (distroRSSXML.at(0)=='*')
    {
      /* If this is an updated RSS, we must warn the user!
         And if the main window is hidden... */
      if (isHidden())
      {
        show();
      }

      ui->twProperties->setTabText(ctn_TABINDEX_NEWS, "** " + StrConstants::getTabNewsName() + " **");
      if (gotoNewsTab)
      {
        ui->twProperties->setCurrentIndex(ctn_TABINDEX_NEWS);
      }
    }
    else
    {
      if(searchForLatestNews)
      {
        ui->twProperties->setTabText(ctn_TABINDEX_NEWS, StrConstants::getTabNewsName());
      }
    }

    //First, we have to parse the raw RSS XML...
    html = parseDistroNews();
  }
  else
  {
    if(searchForLatestNews)
      ui->twProperties->setTabText(ctn_TABINDEX_NEWS, StrConstants::getTabNewsName());

    html = distroRSSXML;
  }

  //Now that we have the html table code, let's put it into TextBrowser's News tab
  QTextBrowser *text = ui->twProperties->widget(ctn_TABINDEX_NEWS)->findChild<QTextBrowser*>("textBrowser");
  if (text)
  {
    text->clear();
    text->setHtml(html);
  }

  clearTabOutput();
  qApp->processEvents();

  if (searchForLatestNews && gotoNewsTab)
  {
    _changeTabWidgetPropertiesIndex(ctn_TABINDEX_NEWS);
  }
}
Esempio n. 16
0
HelpDialog::HelpDialog()
    : KPToolDialog(0)
{
    setWindowIcon(QIcon::fromTheme(QString::fromLatin1("kipi-ogl")));
    setWindowTitle(i18n("Usage of OpenGL Image Viewer"));
    startButton()->setVisible(false);

    KPAboutData* about = new KPAboutData(ki18n("OpenGL Image Viewer"), 0,
                                         KAboutLicense::GPL,
                                         ki18n("A Kipi plugin to view image using OpenGL."),
                                         ki18n("(c) 2007-2008, Markus Leuthold\n"
                                               "(c) 2008-2013, Gilles Caulier"));

    about->addAuthor(i18n("Markus Leuthold"), i18n("Author"),
                     QString::fromLatin1("kusi at forum dot titlis dot org"));

    about->addAuthor(i18n("Gilles Caulier"), i18n("Developer"),
                     QString::fromLatin1("caulier dot gilles at gmail dot com"));

    setAboutData(about);

    // -------------------------------------------------------------------------------------------------------------------

    QTextBrowser* brw = new QTextBrowser(this);
    setMainWidget(brw);

    brw->setHtml(i18n(
        "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\""
        "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
        "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
        "p, li { white-space: pre-wrap; }\n"
        "</style></head><body style=\" font-family:'Sans Serif'; font-size:10pt; "
        "font-weight:400; font-style:normal;\">\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; "
        "-qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:x-large; "
        "font-weight:600; color:#5500ff;\">Image Access</span><br /></p>\n"
        "<table border=\"0\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;\" cellspacing=\"2\" cellpadding=\"0\">\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">next image  </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">scrollwheel down/down arrow"
                            "/right arrow/PgDown/Space/n   </p></td></tr>\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">previous image   </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">scrollwheel up/up arrow/left arrow/PgUp/p   </p></td></tr>\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">quit  </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Esc    </p></td></tr></table>\n"
        "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;"
                            "\"><span style=\" font-size:x-large; color:#5500ff;\">Display</span></p>\n"
        "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600; color:#5500ff;\"></p>\n"
        "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600; color:#5500ff;\"></p>\n"
        "<table border=\"0\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;\" cellspacing=\"2\" cellpadding=\"0\">\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">toggle fullscreen/normal   </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">f    </p></td></tr>\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:"
                            "0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">toggle scrollwheel action  </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">c (either zoom or change image)   </p></td></tr>\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">rotation   </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">r    </p></td></tr>\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">reset view   </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">double click    </p></td></tr>\n"
        "<tr>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-l"
                            "eft:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">original size  </p></td>\n"
        "<td>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">o   </p></td></tr></table>\n"
        "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /><span style=\" font-size:x-large; font-weight:600; color:#5500ff;\">Zooming</span></p>\n"
        "<ul style=\"-qt-list-indent: 1;\"><li style=\" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">move mouse in up/down-direction while pressing the right mouse button</li>\n"
        "<li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">alternatively, press c and use the scrollwheel<br /></li>\n"
        "<li style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">plus/minu"
                            "s</li>\n"
        "<li style=\" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">ctrl + scrollwheel</li></ul>\n"
        "<p style=\" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600; color:#5500ff;\"><span style=\" font-size:x-large;\">Panning</span></p>\n"
        "<ul style=\"-qt-list-indent: 1;\"><li style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">move mouse while pressing the left button</li></ul></body></html>",
    0));

    brw->setProperty("text", QVariant(i18n(
        "<b><font color=\"#5500ff\">"
        "<font size=\"+2\">Image Access</font></font></b><br>\n"
        "<TABLE> \n"
        " <TR> \n"
        " <TD>next image</TD> \n"
        " <TD>scrollwheel down/down arrow/right arrow/PgDown/Space/n</TD>\n"
        " </TR> \n"
        " <TR> \n"
        " <TD>previous image </TD> \n"
        " <TD>scrollwheel up/up arrow/left arrow/PgUp/p </TD> \n"
        " </TR>\n"
        "<TR> \n"
        " <TD>quit</TD> \n"
        " <TD>Esc</TD> \n"
        " </TR> \n"
        " </TABLE>\n"
        "<br>\n"
        " <TH><b><font color=\"#5500ff\"><font size=\"+2\">Display</font></font></b></TH> </br>\n"
        "<TABLE> \n"
        " <TR> \n"
        " <TD>toggle fullscreen/normal </TD> \n"
        " <TD>f</TD> \n"
        " </TR> \n"
        " <TR> \n"
        " <TD>toggle scrollwheel action</TD> \n"
        " <TD>c (either zoom or change image)</TD> \n"
        " </TR>\n"
        " <TR> \n"
        " <TD>rotation </TD> \n"
        " <TD>r</TD> \n"
        " </TR> \n"
        " <TR> \n"
        " <TD>reset view </TD> \n"
        " <TD>double click</TD> \n"
        " </TR> \n"
        " <TR> \n"
        " <TD>original size</TD> \n"
        " <TD>o</TD> \n"
        " </TR>\n"
        " </TABLE>\n"
        "<br>\n"
        "\n"
        "\n"
        "<b><font color=\"#5500ff\" size=\"+2\">Zooming</font></b><br> \n"
        "<UL>\n"
        ""
        "<LI>move mouse in up/down-direction while pressing the right mouse button\n"
        "<LI>alternatively, press c and use the scrollwheel<br>\n"
        "<LI>plus/minus\n"
        "<LI>ctrl + scrollwheel\n"
        "</UL>\n"
        "\n"
        "<b><font color=\"#5500ff\" size=\"+2\">Panning</font></b><br>\n"
        "<UL> \n"
        "<LI>move mouse while pressing the left button\n"
        "</UL>",
    0)));

    // ---------------------------------------------------------------------------------------------------------------------

    resize(700, 550);
}
Esempio n. 17
0
int main(int argc, char** argv)
{
  KAboutData about("DialogTest", 0, ki18n("DialogTest"), "version");
  KCmdLineArgs::init(argc, argv, &about);

  KApplication app;

  // -----
  QString text= // the explanation shown by the example dialog
    "<center><h1>KDialog Example</h1></center><hr><br>"
    "This example shows the usage of the <i>KDialog</i>  class. "
    "<i>KDialog</i> is the KDE user interface class used to create "
    "dialogs with simple layout without having to define an own dialog "
    "style for your application. <br>"
    "It provides some standards buttons that are needed in most dialogs. Each one may be "
    "hidden, enabled or disabled, and tooltips and quickhelp texts might be"
    " added. And you do not need to bother about geometry management, this "
    "is all done automatically.<br>"
    "The class supports the creation of dialogs without being forced "
    "to derive an own class for it, but you may derive your own class "
    "for a better code structure.<br>"
    "If you wrote a help chapter explaining what your dialog does, you "
    "should add a link to it to the dialog using <tt>setHelp</tt>. You do "
    "not have to take care about launching the help viewer, just set the "
    "help file and topic and of course copy it to your documentation "
    "directory during the program installation.";
  /* Create the dialog object. DialogBase is derived from QDialog, but
     you do not need to derive it to create a nice-looking dialog. Mostly,
     you already have a widget class representing the core of your dialog,
     and you only need to add a frame around it and the default buttons.

     If you want to derive it, you still can, moving all code shown here
     inside of your new class. */
  KDialog dialog;
  dialog.setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Details | KDialog::User1 | KDialog::Help );
  dialog.setButtonGuiItem( KDialog::User1 , KGuiItem("Test") );
  dialog.setCaption("dialog!");
  /* Set a help chapter. If you do not set one, the link is not shown, and the
     upper part of the frame shrinks as much as possible. The help window "
     "will of course only pop up if you correctly installed kdebase. */
  // I disabled it, as khcclient did not run for me.
   dialog.setHelp("kdehelp/intro.html", "");
  /* This QTextView is intended to be the main widget of our dialog. The
     main widget is placed inside the dialogs frame, with the buttons below
     it. You do not have to take care about the size handling, but it is a
     good idea to set the main wigdets minimum size, since the sizes Qt and
     the DialogBase class guess are sometimes ugly.

     It is important that your main widget is created with the dialog object
     as its parent! */
  QTextBrowser view;
  view.setHtml( text );
  dialog.setMainWidget( &view );

  QLabel label("this is a place for some advanced settings" ,&dialog);
  dialog.setDetailsWidget( &label);
	
  //view.setMinimumSize(400, view.heightForWidth(400)+20);
  view.setMinimumSize( 250, 300 );
  /* After finishing the setup of your main widget, the dialog needs to be
     adjusted. It is not done automatically, since the layout of the main
     widget may change before the dialog is shown. Additionally, setting a
     help chapter may cause a need for adjustment since it modifies the height
     of the upper frame. */
 // dialog.resize(dialog.minimumSize());
  /* The dialog object is used just as any other QDialog: */
  if(dialog.exec())
    {
      qDebug("Accepted.");
    } else {
      qDebug("Rejected.");
    }
  return 0;
}
Esempio n. 18
0
AboutForm::AboutForm(QWidget *parent) : QDialog(parent)
{
    QTextBrowser *aboutBrowser = new QTextBrowser;
    aboutBrowser->setReadOnly(true);
    aboutBrowser->setOpenExternalLinks(true);
    aboutBrowser->setHtml(tr(
    "<table border=0>"
    "<tr><td width=90%><b>%1</a> %2</b> by Mark Summerfield</td>"
    "<td rowspan=3><img align=right src=\":/icon.png\"></td></tr>"
    "<tr><td><tt>&lt;[email protected]&gt;</tt>.</td></tr>"
    "<tr><td colspan=2>Copyright &copy; 2008-13 "
    "<a href=\"http://www.qtrac.eu\">Qtrac</a> Ltd. All rights reserved."
    "</td></tr>"
    "<tr><td colspan=2>Built with Qt %3 and Poppler %4.</td></tr>"
    "</table><hr>"
    "<p>This program compares the text or the visual appearance of "
    "each page in two PDF files."
    "<hr><p>If you like %1 you might like my books:<ul>"
    "<li><a href=\"http://www.qtrac.eu/gobook.html\">"
    "Programming in Go</a></li>"
    "<li><a href=\"http://www.qtrac.eu/aqpbook.html\">"
    "Advanced Qt Programming</a></li>"
    "<li><a href=\"http://www.qtrac.eu/py3book.html\">"
    "Programming in Python 3</a></li>"
    "<li><a href=\"http://www.qtrac.eu/pyqtbook.html\">"
    "Rapid GUI Programming with Python and Qt</a></li>"
    "</ul>"
    "I also provide training and consultancy in C++, Go, Python&nbsp;2, "
    "Python&nbsp;3, C++/Qt, and PyQt4.").arg(qApp->applicationName())
            .arg(Version).arg(qVersion()).arg(POPPLER_VERSION));
    QTextBrowser *contributorsBrowser = new QTextBrowser;
    contributorsBrowser->setReadOnly(true);
    contributorsBrowser->setHtml(tr("<table>"
    "<tr><td>&bull;</td><td bgcolor=lightyellow><i>Anonymous Company</i> "
    "&mdash; funded the addition of the margin exclusion "
    "functionality</td></tr>"
    "<tr><td>&bull;</td><td><b>David Paleino</b> &mdash; "
    "Debian packager</td></tr>"
    "<tr><td>&bull;</td><td><b>Dirk Loss</b> &mdash; creating "
    "Mac binaries</td></tr>"
    "<tr><td>&bull;</td><td>Florian Heiderich &mdash; suggested "
    "using composition modes for showing subtle differences</td></tr>"
    "<tr><td>&bull;</td><td><b>Jasmin Blanchette</b> &mdash; "
    "the original idea and subsequent suggestions</td></tr>"
    "<tr><td>&bull;</td><td>Liviu Andronic &mdash; suggested adding "
    "drag and drop</td></tr>"
    "<tr><td>&bull;</td><td>Paul Howarth &mdash; suggestions "
    "resulting in Characters mode</td></tr>"
    "<tr><td>&bull;</td><td bgcolor=\"#F0F0F0\"><i>Pavel Fric</i> &mdash; "
    "Czech translation</td></tr>"
    "<tr><td>&bull;</td><td bgcolor=\"#F0F0F0\"><i>Pierre-Alain "
    "Bandinelli</i>&mdash; French translation</td></tr>"
    "<tr><td>&bull;</td><td bgcolor=\"#F0F0F0\"><i>Rainer Krachten</i> "
    "&mdash; German translation and various suggestions</td></tr>"
    "<tr><td>&bull;</td><td>Rory Gordon &mdash; suggested adding "
    "drag and drop</td></tr>"
    "<tr><td>&bull;</td><td><b>Steven Lee</b> &mdash; creating "
    "Windows binaries</td></tr>"
    "</table>"));
    QTextBrowser *licenceBrowser = new QTextBrowser;
    licenceBrowser->setReadOnly(true);
    licenceBrowser->setHtml(tr(
    "This program is free software: you can redistribute it "
    "and/or modify it under the terms of the GNU General Public License "
    "as published by the Free Software Foundation, either version 2 of "
    "the License, or (at your option), any "
    "later version. This program is distributed in the hope that it will "
    "be useful, but WITHOUT ANY WARRANTY; without even the implied "
    "warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. "
    "See the GNU General Public License (in file <tt>gpl-2.0.txt</tt>) "
    "for more details."));
    QTabWidget *tabWidget = new QTabWidget;
    tabWidget->addTab(aboutBrowser, tr("&About"));
    tabWidget->addTab(contributorsBrowser, tr("&Contributors"));
    tabWidget->addTab(licenceBrowser, tr("&License"));
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(tabWidget);
    setLayout(layout);
    resize(480, 400);
    setWindowTitle(tr("%1 — About").arg(qApp->applicationName()));
}
Esempio n. 19
0
//-----------------------------------------------------------------------------
QWidget* QmitkCmdLineModuleGui::getGui()
{
  if (!d->m_TopLevelWidget)
  {
    // Construct additional widgets to contain full GUI.
    QWidget *aboutBoxContainerWidget = new QWidget();

    ctkCollapsibleGroupBox *aboutBox = new ctkCollapsibleGroupBox(aboutBoxContainerWidget);
    aboutBox->setTitle("About");

    QTextBrowser *aboutBrowser = new QTextBrowser(aboutBox);
    aboutBrowser->setReadOnly(true);
    aboutBrowser->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    aboutBrowser->setOpenExternalLinks(true);
    aboutBrowser->setOpenLinks(true);

    QVBoxLayout *aboutLayout = new QVBoxLayout(aboutBox);
    aboutLayout->addWidget(aboutBrowser);

    QVBoxLayout *aboutBoxContainerWidgetLayout = new QVBoxLayout(aboutBoxContainerWidget);
    aboutBoxContainerWidgetLayout->addWidget(aboutBox);

    QWidget *helpBoxContainerWidget = new QWidget();

    ctkCollapsibleGroupBox *helpBox = new ctkCollapsibleGroupBox();
    helpBox->setTitle("Help");

    QTextBrowser *helpBrowser = new QTextBrowser(helpBox);
    helpBrowser->setReadOnly(true);
    helpBrowser->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    helpBrowser->setOpenExternalLinks(true);
    helpBrowser->setOpenLinks(true);

    QVBoxLayout *helpLayout = new QVBoxLayout(helpBox);
    helpLayout->addWidget(helpBrowser);

    QVBoxLayout *helpBoxContainerWidgetLayout = new QVBoxLayout(helpBoxContainerWidget);
    helpBoxContainerWidgetLayout->addWidget(helpBox);

    QObject* guiHandle = this->guiHandle();
    QWidget* generatedGuiWidgets = qobject_cast<QWidget*>(guiHandle);

    QWidget *topLevelWidget = new QWidget();

    QGridLayout *topLevelLayout = new QGridLayout(topLevelWidget);
    topLevelLayout->setContentsMargins(0,0,0,0);
    topLevelLayout->setSpacing(0);
    topLevelLayout->addWidget(aboutBoxContainerWidget, 0, 0);
    topLevelLayout->addWidget(helpBoxContainerWidget, 1, 0);
    topLevelLayout->addWidget(generatedGuiWidgets, 2, 0);

    ctkCmdLineModuleDescription description = this->moduleReference().description();

    QString helpString = "";

    if (!description.title().isEmpty())
    {
      QString titleHtml = "<h1>" + description.title() + "</h1>";
      helpString += titleHtml;
    }

    if (!description.description().isEmpty())
    {
      QString descriptionHtml = "<p>" + description.description() + "</p>";
      helpString += descriptionHtml;
    }

    if (!description.documentationURL().isEmpty())
    {
      QString docUrlHtml = "<p>For more information please see <a href=\"" + description.documentationURL()
          + "\">" + description.documentationURL() + "</a></p>";
      helpString += docUrlHtml;
    }

    QString aboutString = "";

    if (!description.title().isEmpty())
    {
      QString titleHtml = "<h1>" + description.title() + "</h1>";
      aboutString += titleHtml;
    }

    if (!description.contributor().isEmpty())
    {
      QString contributorHtml = "<h2>Contributed By</h2><p>" + description.contributor() + "</p>";
      aboutString += contributorHtml;
    }

    if (!description.license().isEmpty())
    {
      QString licenseHtml = "<h2>License</h2><p>" + description.license() + "</p>";
      aboutString += licenseHtml;
    }

    if (!description.acknowledgements().isEmpty())
    {
      QString acknowledgementsHtml = "<h2>Acknowledgements</h2><p>" + description.acknowledgements() + "</p>";
      aboutString += acknowledgementsHtml;
    }

    helpBrowser->clear();
    helpBrowser->setHtml(helpString);
    helpBox->setCollapsed(true);

    aboutBrowser->clear();
    aboutBrowser->setHtml(aboutString);
    aboutBox->setCollapsed(true);

    d->m_TopLevelWidget.reset(topLevelWidget);
  }

  return d->m_TopLevelWidget.data();
}
Esempio n. 20
0
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
  currAuths = {{
    "Guilherme Brondani Torri - " + tr("GUI programmer, Verilog-A dynamic loader"),
    "Mike Brinson - " + tr("testing, modelling and documentation, tutorial contributor"),
    "Richard Crozier - " + tr("testing, modelling, Octave."),
    "Bastien Roucaries - " + tr("bondwire and rectangular waveguide model implementation"),
    "Frans Schreuder - " + tr("GUI programmer, release"),
    "Vadim Kuznetsov - " + tr("filter synthesis (qucs-activefilter), SPICE integration (NGSPICE, Xyce)"),
    "Claudio Girardi - " + tr("testing, general fixes"),
    "Felix Salfelder - " + tr("refactoring, modularity"),
    "Andr\xe9s Mart\xednez Mera - " + tr("RF design tools")
  }};
  
  prevDevs = {{
      "Michael Margraf - " + tr("founder of the project, GUI programmer"),
      "Stefan Jahn - " + tr("Programmer of simulator"),
      "Jens Flucke - " + tr("webpages and translator"),
      "Raimund Jacob - " + tr("tester and applyer of Stefan's patches, author of documentation"),
      "Vincent Habchi - " + tr("coplanar line and filter synthesis code, documentation contributor"),
      "Toyoyuki Ishikawa - " + tr("some filter synthesis code and attenuator synthesis"),
      "Gopala Krishna A - " + tr("GUI programmer, Qt4 porter"),
      "Helene Parruitte - " + tr("programmer of the Verilog-AMS interface"),
      "Gunther Kraut - " + tr("equation solver contributions, exponential sources, author of documentation"),
      "Andrea Zonca - " + tr("temperature model for rectangular waveguide"),
      "Clemens Novak - " + tr("GUI programmer"),
      "You-Tang Lee (YodaLee) - " + tr("GUI programmer, Qt4 porter")
  }};

  trAuths = {{
    tr("German by") + " Stefan Jahn",
    tr("Polish by") + " Dariusz Pienkowski",
    tr("Romanian by") + " Radu Circa",
    tr("French by") + " Vincent Habchi, F5RCS",
    tr("Portuguese by") + " Luciano Franca, Helio de Sousa, Guilherme Brondani Torri",
    tr("Spanish by") + " Jose L. Redrejo Rodriguez",
    tr("Japanese by") + " Toyoyuki Ishikawa",
    tr("Italian by") + " Giorgio Luparia, Claudio Girardi",
    tr("Hebrew by") + " Dotan Nahum",
    tr("Swedish by") + " Markus Gothe, Peter Landgren",
    tr("Turkish by") + " Onur Cobanoglu, Ozgur Cobanoglu",
    tr("Hungarian by") + " Jozsef Bus",
    tr("Russian by") + " Igor Gorbounov",
    tr("Czech by") + " Marek Straka,Martin Stejskal",
    tr("Catalan by") + " Antoni Subirats",
    tr("Ukrainian by") + " Dystryk",
    tr("Arabic by") + " Chabane Noureddine",
    tr("Kazakh by") + " Erbol Keshubaev"
  }};
  
  std::shuffle(currAuths.begin(), currAuths.end(), rng);

  QLabel *lbl;

  setWindowTitle(tr("About Qucs"));

  all = new QVBoxLayout(this);
  //all->setContentsMargins(0,0,0,0);
  //all->setSpacing(0);

  QLabel *iconLabel = new QLabel();
  iconLabel->setPixmap(QPixmap(QString(":/bitmaps/hicolor/128x128/apps/qucs.png")));

  QWidget *hbox = new QWidget();
  QHBoxLayout *hl = new QHBoxLayout(hbox);
  hl->setContentsMargins(0,0,0,0);

  hl->addWidget(iconLabel);
  all->addWidget(hbox);
 
  QWidget *vbox = new QWidget();
  QVBoxLayout *vl = new QVBoxLayout(vbox);
  //vl->setContentsMargins(0,0,0,0);
  hl->addWidget(vbox);

  QString versionText;
  versionText = tr("Version")+" "+PACKAGE_VERSION+
#ifdef GIT
    " ("+GIT+") " +
#endif
    "\n";

  vl->addWidget(new QLabel("<span style='font-size:x-large; font-weight:bold;'>Quite Universal Circuit Simulator</span>"));
  lbl = new QLabel(versionText);
  lbl->setAlignment(Qt::AlignHCenter);
  vl->addWidget(lbl);
  vl->addWidget(new QLabel(tr("Copyright (C)")+" 2011-2016 Qucs Team\n"+
			   tr("Copyright (C)")+" 2003-2009 Michael Margraf"));

  lbl = new QLabel("\nThis is free software; see the source for copying conditions."
		   "\nThere is NO warranty; not even for MERCHANTABILITY or "
		   "\nFITNESS FOR A PARTICULAR PURPOSE.\n");
  lbl->setAlignment(Qt::AlignHCenter);
  all->addWidget(lbl);

  QTabWidget *t = new QTabWidget();
  all->addWidget(t);
  connect(t, SIGNAL(currentChanged(int)), this, SLOT(currentChangedSlot(int)));

  authorsBrowser = new QTextBrowser;
  // the Ctrl-Wheel event we would like to filter is handled by the viewport
  authorsBrowser->viewport()->installEventFilter(this);
  trBrowser = new QTextBrowser;
  trBrowser->viewport()->installEventFilter(this);

  QString supportText;
  // link to home page, help mailing list, IRC ?
  supportText = tr("Home Page") + " : <a href='http://qucs.sourceforge.net/'>http://qucs.sourceforge.net/</a><br/>"+
    tr("Documentation start page") + " : <a href='http://qucs.sourceforge.net/docs.html'>http://qucs.sourceforge.net/docs.html</a><br/>" +
    tr("Components reference manual") + " : <a href='http://qucs.github.io/qucs-manual/'>http://qucs.github.io/qucs-manual/</a><br/><br/>" +
    tr("If you need help on using Qucs, please join the") + "<br/>" +
    tr("help mailing list") + " : <a href='https://sourceforge.net/p/qucs/mailman/qucs-help/'>" + tr("qucs-help on SourceForge") + "</a><br/>" +
    "<small>(" + tr("please attach the schematic you are having problems with") + ")</small><br/><br/>" + 
    // use http://webchat.freenode.net/?channels=qucs ?
    tr("IRC general discussion channel") + " : <a href='irc://irc.freenode.net/qucs'>#qucs on freenode.net</a><br/><br/>" +
    tr("Additional resources") + " : <a href='https://github.com/Qucs/qucs#resources'>https://github.com/Qucs/qucs#resources</a>";

  QTextBrowser *supportBrowser = new QTextBrowser;
  supportBrowser->viewport()->installEventFilter(this);
  supportBrowser->setOpenExternalLinks(true);
  supportBrowser->setHtml(supportText);

  QString licenseText;
  licenseText = "Qucs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.<br/><br/>This software is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details..<br/><br/> You should have received a copy of the GNU General Public License along with Qucs, see the file COPYING. If not see <a href='http://www.gnu.org/licenses/'>http://www.gnu.org/licenses/</a> or write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,Boston, MA 02110-1301, USA.";

  QTextBrowser *licenseBrowser = new QTextBrowser;
  licenseBrowser->viewport()->installEventFilter(this);
  licenseBrowser->setOpenExternalLinks(true);
  licenseBrowser->setHtml(licenseText);

  t->addTab(authorsBrowser, tr("Authors"));
  t->addTab(trBrowser, tr("Translations"));
  t->addTab(supportBrowser, tr("Support"));
  t->addTab(licenseBrowser, tr("License"));

  QWidget *hbBtn = new QWidget();
  QHBoxLayout *hlBtn = new QHBoxLayout(hbBtn);
  hlBtn->setContentsMargins(0,0,0,0);
  all->addWidget(hbBtn);

  QPushButton *okButton = new QPushButton(tr("&OK"), parent);
  okButton->setFocus();
  connect(okButton, SIGNAL(clicked()), this, SLOT(close()));
  hlBtn->addStretch();
  hlBtn->addWidget(okButton);

  setAuthorsText();
  setTrText();
  prevTab = 0; // first Tab is selected by default
}
Esempio n. 21
0
void ProfileDataInfoDialog::about_variables() {

   QDialog *dialog = new QDialog(this);
   dialog->resize(QSize(700, 480));
   dialog->setWindowTitle(i18n("Usable Variables For Text Template"));
   QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
   QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
   okButton->setDefault(true);
   okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
   dialog->connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
   dialog->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

   QTextBrowser *tb = new QTextBrowser(dialog);
   tb->setHtml(i18n("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">"
   "<html>"
   "<head>"
     "<style type=\"text/css\">"
     "p, li { white-space: pre-wrap; }"
     "</style>"
   "</head>"
   "<body>"
     "Variables will be replaced by a special value and can even contain parameters.<br />"
     "For example the variable "
     "<div style=\"font-family:monospace; background: #b3c1d6; color: black\"><pre>"
     "$artist"
     "</pre></div>"
     "or the equivalent"
     "<div style=\"font-family:monospace; background: #b3c1d6; color: black\"><pre>"
     "${artist}"
     "</pre></div>"
     "will be replaced by the relevant artist of the cd. Variables may also have attribute, for example:"
     "<div style=\"font-family:monospace; background: #b3c1d6; color: black\"><pre>"
     "${today format=\"yyyy-MM-dd\"}"
     "</pre></div>"
     "This would print the current date. Setting the format will control how this is done. The example (above)"
     "would result int the date being printed as 2010-10-07 (if this was the current date). See below for more details.<br /><br />"
     "You can make use of the following variables:<br />"
     "<table border=1>"
     "<thead>"
     "<tr>"
     "<th>Variable</th><th>Parameter</th><th>Description</th><th>Example</th>"
     "</tr>"
     "</thead>"
     "<tbody>"
     "<tr>"
     "<td>$artist</td><td></td><td>Prints the relevant artist of the extracted cd.</td><td>${artist }</td>"
     "</tr>"
     "<tr>"
     "<td>$title</td><td></td><td>Prints the relevant title of the extracted cd.</td><td></td>"
     "</tr>"
     "<tr>"
     "<td>$date</td><td></td><td>Prints the relevant date (usually release year) of the extracted cd.</td><td></td>"
     "</tr>"
     "<tr>"
     "<td>$genre;</td><td></td><td>Prints the relevant genre of the extracted cd.</td><td></td>"
     "</tr>"
     "<tr>"
     "<td>$size</td><td>iec,precision</td><td>Prints the overall size of all extracted (compressed) music files (incl. the cover). The attribute iec can be one of the following: b, k, m, g. b means byte, k KiB, m MiB and g GiB. The attribute precision gives the number of decimal places. Default attributes are iec=\"m\" and precision=\"2\"</td><td>${size iec=\"k\" precision=\"2\"}</td>"
     "</tr>"
     "<tr>"
     "<td>$length</td><td></td><td>Prints the relevant overall length of all extracted tracks. The format is min:sec.</td><td></td>"
     "</tr>"
     "<tr>"
     "<td>$nooftracks</td><td></td><td>Prints the total number of extracted tracks.</td><td></td>"
     "</tr>"
     "<tr>"
     "<td>$discid</td><td>base</td><td>Prints the discid of the current cd. The attribute base is the base of the number. The default is 16 (hexadecimal).</td><td>${discid base=\"16\"}</td>"
     "</tr>"
     "<tr>"
     "<td>$today</td><td>format</td><td>Prints the current date. The attribute format specifies the output (*).</td><td>${today format=\"yyyy-MM-dddd\"}</td>"
     "</tr>"
     "<tr>"
     "<td>$now</td><td>format</td><td>Prints the current date and/or time. The attribute format specifies the output (*).</td><td>${now format=\"yyyy-MM-dddd hh:mm:ss\"}</td>"
     "</tr>"
     "<tr>"
     "<td>$encoder</td><td></td><td>Prints encoder name and version.</td>"
     "</tr>"
     "<tr>"
     "<td>$audex</td><td></td><td>Prints Audex name and version.</td>"
     "</tr>"
     "<tr>"
     "<td>$br</td><td></td><td>Prints a linebreak.</td><td></td>"
     "</tr>"
     "</tbody>"
     "</table>"
     "<br /><br />"
     "(* date/time format expressions)"
     "<table cellpadding=\"2\" cellspacing=\"1\" border=\"1\">"
     "<thead><tr valign=\"top\"><th>Expression</th><th>Output</th></tr></thead>"
     "<tr valign=\"top\"><td>d</td><td>The day as a number without a leading zero (1 to 31).</td></tr>"
     "<tr valign=\"top\"><td>dd</td><td>The day as a number with a leading zero (01 to 31).</td></tr>"
     "<tr valign=\"top\"><td>ddd</td><td>The abbreviated localized day name (e.g&#x2e; 'Mon' to 'Sun').</td></tr>"
     "<tr valign=\"top\"><td>dddd</td><td>The long localized day name (e.g&#x2e; 'Monday' to 'Sunday').</td></tr>"
     "<tr valign=\"top\"><td>M</td><td>The month as a number without a leading zero (1 to 12).</td></tr>"
     "<tr valign=\"top\"><td>MM</td><td>The month as a number with a leading zero (01 to 12).</td></tr>"
     "<tr valign=\"top\"><td>MMM</td><td>The abbreviated localized month name (e.g&#x2e; 'Jan' to 'Dec').</td></tr>"
     "<tr valign=\"top\"><td>MMMM</td><td>The long localized month name (e.g&#x2e; 'January' to 'December').</td></tr>"
     "<tr valign=\"top\"><td>yy</td><td>The year as two digit number (00 to 99).</td></tr>"
     "<tr valign=\"top\"><td>yyyy</td><td>The year as four digit number.</td></tr>"
     "</table>"
     "<br />"
     "<table cellpadding=\"2\" cellspacing=\"1\" border=\"1\">"
     "<thead><tr valign=\"top\"><th>Expression</th><th>Output</th></tr></thead>"
     "<tr valign=\"top\"><td>h</td><td>The hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display).</td></tr>"
     "<tr valign=\"top\"><td>hh</td><td>The hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display).</td></tr>"
     "<tr valign=\"top\"><td>H</td><td>The hour without a leading zero (0 to 23, even with AM/PM display).</td></tr>"
     "<tr valign=\"top\"><td>HH</td><td>The hour with a leading zero (00 to 23, even with AM/PM display).</td></tr>"
     "<tr valign=\"top\"><td>m</td><td>The minute without a leading zero (0 to 59).</td></tr>"
     "<tr valign=\"top\"><td>mm</td><td>The minute with a leading zero (00 to 59).</td></tr>"
     "<tr valign=\"top\"><td>s</td><td>The second without a leading zero (0 to 59).</td></tr>"
     "<tr valign=\"top\"><td>ss</td><td>The second with a leading zero (00 to 59).</td></tr>"
     "<tr valign=\"top\"><td>z</td><td>The milliseconds without leading zeroes (0 to 999).</td></tr>"
     "<tr valign=\"top\"><td>zz</td><td>The milliseconds with leading zeroes (000 to 999).</td></tr>"
     "<tr valign=\"top\"><td>AP or A</td><td>Interpret as an AM/PM time. AP must be either 'AM' or 'PM'.</td></tr>"
     "<tr valign=\"top\"><td>ap or a</td><td>Interpret as an AM/PM time. ap must be either 'am' or 'pm'.</td></tr>"
     "</table>"
   "</body>"
   "</html>"
   ));
   mainLayout->addWidget(tb);
   mainLayout->addWidget(buttonBox);
   connect(dialog, SIGNAL(clicked()), dialog, SLOT(close()));

   dialog->exec();

   delete dialog;

}
Esempio n. 22
0
void SecurityInfo::init()
{
    QTextBrowser *infoDisplay = new QTextBrowser();
    infoDisplay->setFrameShape( QFrame::NoFrame );

    QVBoxLayout *vb = new QVBoxLayout( this );
    vb->setSpacing( 0 );
    vb->setMargin( 0 );
    vb->addWidget( infoDisplay );

    QDesktopWidget *desktop = QApplication::desktop();
    double imageScale = ((double)desktop->availableGeometry(desktop->screenNumber(this)).width())/290.0;
    if (imageScale > 1.0)
        imageScale = 1.0;
    int imageSize = (int)(60 * imageScale);

    // Add logo, TODO update with SXE logo, or lids logo
    QString infoString = "<p><img width=\"%1\" height=\"%2\"src=\":image/qpe-logo\"></p>";
    infoString = infoString.arg( imageSize );
    infoString = infoString.arg( imageSize );

    // Add SXE info
    infoString += "<p><center>" +
            tr("Safe Execution Environment:") +
            " " +
            "</p></center>";

#ifndef QT_NO_SXE
    infoString += "<p><center><b>" +
                  tr("Enabled") +
                  "</b></center></p>";
#else
    infoString += "<p><center><font color=\"#ff0000\"><b>" +
                  tr("Disabled") +
                  "</b></font></center></p>";
#endif //QT_NO_SXE

    // Add LIDS info
    bool lidsEnabled = QFile::exists("/proc/sys/lids/locks");
    infoString += "<p><center>" +
            tr("Kernel LIDS support:") +
            " " +
            "</p></center>";

    if (lidsEnabled)
        infoString += "<p><center><b>" +
                tr("Available") +
                "</b></center></p>";
    else
        infoString += "<p><center><font color=\"#ff0000\"><b>" +
                tr("Unavailable") +
                "</b></font></center></p>";

    if (lidsEnabled)
    {
        QProcess lidsconf;
        lidsconf.start("lidsconf -L");
        if (lidsconf.waitForFinished())
        {
            QStringList output(QString(lidsconf.readAll()).split("\n"));
            if(!output.contains ("Killed"))
            {
                infoString += "<p><center>";
                infoString += tr("Security Rules: %1").arg(output.count() - 5);
                infoString += "</center></p>";
            }
        }
    }

    infoDisplay->setHtml( infoString );
}
Esempio n. 23
0
  void showTip() {
    m_browser->setHtml(m_currentTip.data(Qt::DisplayRole).toString());
}