OpenGLDebugMessageWindow::OpenGLDebugMessageWindow(QWidget *parent) :
    QDialog(parent)
{
    m_view = new QTreeView;
    m_view->setRootIsDecorated(false);

    QDialogButtonBox *buttonBox = new QDialogButtonBox;
    QPushButton *closeButton = buttonBox->addButton(QDialogButtonBox::Close);
    connect(closeButton, &QPushButton::clicked, this, &QWidget::close);

    m_clearButton = buttonBox->addButton(QDialogButtonBox::Reset);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(m_view);
    layout->addWidget(buttonBox);
    setLayout(layout);

    resize(600, 300);
}
Example #2
0
File: main.cpp Project: jhj/aqp-qt5
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setApplicationName(app.translate("main", "Matrix Quiz"));
#ifdef Q_WS_MAC
    app.setCursorFlashTime(0);
#endif

    qsrand(static_cast<uint>(time(0)));

    QWebSettings *webSettings = QWebSettings::globalSettings();
    webSettings->setAttribute(QWebSettings::AutoLoadImages, true);
    webSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
    webSettings->setAttribute(QWebSettings::PluginsEnabled, true);

    QString url = QUrl::fromLocalFile(AQP::applicationPathOf() +
                                      "/matrixquiz.html").toString();
    BrowserWindow *browser = new BrowserWindow(url, new WebPage);
    browser->showToolBar(false);
    browser->enableActions(false);
    QDialogButtonBox *buttonBox = new QDialogButtonBox;
    QPushButton *quitButton = buttonBox->addButton(
            app.translate("main", "&Quit"),
            QDialogButtonBox::AcceptRole);
    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(browser, 1);
    layout->addWidget(buttonBox);
    QDialog dialog;
    dialog.setLayout(layout);
    QObject::connect(quitButton, SIGNAL(clicked()),
                     &dialog, SLOT(accept()));
    dialog.setWindowTitle(app.applicationName());
    dialog.show();
    return app.exec();
}
Example #3
0
    AboutDialog::AboutDialog(QWidget *parent)
        : QDialog(parent)
    {
        setWindowIcon(GuiRegistry::instance().mainWindowIcon());

        setWindowTitle("About "PROJECT_NAME_TITLE);
        setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
        QGridLayout *layout = new QGridLayout(this);
        layout->setSizeConstraint(QLayout::SetFixedSize);

        QLabel *copyRightLabel = new QLabel(description);
        copyRightLabel->setWordWrap(true);
        copyRightLabel->setOpenExternalLinks(true);
        copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

        QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
        QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
        buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
        connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

        QIcon icon = GuiRegistry::instance().mainWindowIcon();
        QPixmap iconPixmap = icon.pixmap(48, 48);


        QLabel *logoLabel = new QLabel;
        logoLabel->setPixmap(iconPixmap);
        layout->addWidget(logoLabel , 0, 0, 1, 1);
        layout->addWidget(copyRightLabel, 0, 1, 4, 4);
        layout->addWidget(buttonBox, 4, 0, 1, 5);
    }
BtModuleManagerDialog::BtModuleManagerDialog(QWidget* parent)
        : BtConfigDialog(parent) {
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowTitle(tr("Bookshelf Manager"));

    // Install page
    BtInstallPage* installPage = new BtInstallPage();
    addPage(installPage);

    //Uninstall page
    BtRemovePage* removePage = new BtRemovePage();
    addPage(removePage);

    //Index page
    BtIndexPage* indexPage = new BtIndexPage();
    addPage(indexPage);

    slotChangePage(0);

    // Dialog button (Close)
    QDialogButtonBox* bbox = new QDialogButtonBox(this);
    bbox->addButton(QDialogButtonBox::Close);
    util::prepareDialogBox(bbox);
    addButtonBox(bbox);
    connect(bbox, SIGNAL(rejected()), SLOT(close()));

    loadDialogSettings();
}
Example #5
0
PeakColorDlg::PeakColorDlg(QWidget *parent) :
    QDialog(parent)
{
    setWindowTitle( tr("Set Peak Colors - CARA") );
    QVBoxLayout* vbox = new QVBoxLayout(this);

    d_list = new QListWidget( this );
    d_list->setViewMode( QListView::IconMode );
    d_list->setResizeMode(QListView::Adjust);
    d_list->setUniformItemSizes(true);
    d_list->setWrapping(true);
    vbox->addWidget( d_list );

    QDialogButtonBox* bb = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this );
    vbox->addWidget( bb );
    connect(bb, SIGNAL(accepted()), this, SLOT(accept()));
    connect(bb, SIGNAL(rejected()), this, SLOT(reject()));

    QPushButton* b = bb->addButton( tr("Set Color"), QDialogButtonBox::ActionRole );
    b->setEnabled(false);
    connect( b, SIGNAL(clicked()), this, SLOT(onColor()) );
    connect( d_list, SIGNAL(itemSelectionChanged()), this, SLOT(onSelection()) );
    connect( this, SIGNAL(oneSelected(bool)), b,SLOT(setEnabled(bool)) );
    connect( d_list, SIGNAL(itemDoubleClicked(QListWidgetItem*)),this, SLOT(onColor()) );

    setMinimumSize(400,300);
}
Example #6
0
MMSendDlg::MMSendDlg(MMUserView* _mmv, QWidget* p)
  : QDialog(p),
    mmv(_mmv),
    icqEventTag(0)
{
  Support::setWidgetProps(this, "MMSendDialog");
  setAttribute(Qt::WA_DeleteOnClose, true);

  QVBoxLayout* v = new QVBoxLayout(this);

  grpSending = new QGroupBox();
  QVBoxLayout* laySending = new QVBoxLayout(grpSending);
  barSend = new QProgressBar();
  laySending->addWidget(barSend);

  QDialogButtonBox* buttons = new QDialogButtonBox();
  btnCancel = buttons->addButton(QDialogButtonBox::Cancel);

  v->addWidget(grpSending);
  v->addWidget(buttons);

  connect(btnCancel, SIGNAL(clicked()), SLOT(slot_cancel()));
  connect(gGuiSignalManager, SIGNAL(doneUserFcn(const Licq::Event*)),
      SLOT(slot_done(const Licq::Event*)));

  barSend->setMaximum(mmv->contacts().size());
  barSend->setValue(0);

  setMinimumWidth(300);
}
Example #7
0
AddDialog::AddDialog(PlantsModel* plants_model, QWidget* parent) :
  plants_model(plants_model), QDialog(parent)
{
    setModal(true);
    QFormLayout* formLayout = new QFormLayout(this);
    nameInput = new QLineEdit();
    formLayout->addRow(tr("Name :"), nameInput);
    QPushButton* OKbutton = new QPushButton(tr("Add"));
    QPushButton* Canbutton = new QPushButton(tr("Cancel"));
    QDialogButtonBox* buttonBox = new QDialogButtonBox();
    buttonBox->addButton(OKbutton, QDialogButtonBox::AcceptRole);
    buttonBox->addButton(Canbutton, QDialogButtonBox::RejectRole);
    formLayout->addRow(buttonBox);
    QObject::connect(Canbutton, SIGNAL(clicked()), this, SLOT(hide()));
    QObject::connect(OKbutton, SIGNAL(clicked()), this, SLOT(add()));
}
Example #8
0
CreateFeatureDialog::CreateFeatureDialog(QWidget * parent, osm::NewFeatureCategories & cats)
  : QDialog(parent)
{
  cats.AddLanguage("en");  // Default.
  cats.AddLanguage(languages::GetCurrentNorm());

  QListWidget * allSortedList = new QListWidget();

  auto const & typeNames = cats.GetAllCreatableTypeNames();
  for (auto const & name : typeNames)
  {
    new QListWidgetItem(name.c_str() /* name */, allSortedList);
  }
  connect(allSortedList, SIGNAL(clicked(QModelIndex const &)), this,
          SLOT(OnListItemSelected(QModelIndex const &)));

  QDialogButtonBox * dbb = new QDialogButtonBox();
  dbb->addButton(QDialogButtonBox::Close);
  connect(dbb, SIGNAL(clicked(QAbstractButton *)), this, SLOT(reject()));

  QVBoxLayout * vBox = new QVBoxLayout();
  vBox->addWidget(allSortedList);
  vBox->addWidget(dbb);
  setLayout(vBox);

  setWindowTitle("OSM Editor");
}
Example #9
0
Dialog::Dialog(QWidget *parent, Form *form, std::string topText, std::string confirmButtonText, std::string cancelButtonText)
    : QDialog(parent)
{
    this->form = form;



    setFixedWidth(500);
    setModal(true);



    QVBoxLayout *layout = new QVBoxLayout(this);

    layout->addWidget(new QLabel(QString::fromStdString(topText)));

    if (form != nullptr) {
        layout->addSpacing(15);
        layout->addWidget(new HorizontalSeperator(QColor(200, 200, 200), 1));
        layout->addSpacing(15);

        layout->addWidget(form);
    }

    layout->addSpacing(15);
    layout->addWidget(new HorizontalSeperator(QColor(200, 200, 200), 1));
    layout->addSpacing(15);

    cancelButton = new QPushButton(QString::fromStdString(cancelButtonText));
    confirmButton = new QPushButton(QString::fromStdString(confirmButtonText));

    QDialogButtonBox *dialogButtonBox = new QDialogButtonBox();
    dialogButtonBox->addButton(cancelButton, QDialogButtonBox::RejectRole);
    dialogButtonBox->addButton(confirmButton, QDialogButtonBox::AcceptRole);

    layout->addWidget(dialogButtonBox);



    connect(dialogButtonBox, SIGNAL(accepted()), this, SIGNAL(accepted()));
    connect(dialogButtonBox, SIGNAL(rejected()), this, SIGNAL(rejected()));

    if (form != nullptr) {
        connect(form, SIGNAL(valid()), this, SLOT(formValid()));
        connect(form, SIGNAL(invalid()), this, SLOT(formInvalid()));
    }
}
Example #10
0
void NetworkManager::proxyAuthentication(const QString &proxyHost, QAuthenticator *auth, QWidget *parent)
{
    const QNetworkProxy proxy = QNetworkProxy::applicationProxy();
    if (!proxy.user().isEmpty() && !proxy.password().isEmpty()) {
        auth->setUser(proxy.user());
        auth->setPassword(proxy.password());
        return;
    }

    QDialog* dialog = new QDialog(parent);
    dialog->setWindowTitle(tr("Proxy authorisation required"));

    QFormLayout* formLa = new QFormLayout(dialog);

    QLabel* label = new QLabel(dialog);
    QLabel* userLab = new QLabel(dialog);
    QLabel* passLab = new QLabel(dialog);
    userLab->setText(tr("Username: "******"Password: "******"A username and password are being requested by proxy %1. ").arg(proxyHost));
    formLa->addRow(label);
    formLa->addRow(userLab, user);
    formLa->addRow(passLab, pass);
    formLa->addWidget(box);

    if (dialog->exec() != QDialog::Accepted) {
        *auth = QAuthenticator();
        delete dialog;
        return;
    }

    auth->setUser(user->text());
    auth->setPassword(pass->text());

    delete dialog;
}
Example #11
0
void YourAccounts::createGui()
{
	QVBoxLayout *mainLayout = new QVBoxLayout(this);

	QHBoxLayout *contentLayout = new QHBoxLayout();
	mainLayout->addItem(contentLayout);

	AccountsView = new QListView(this);
	AccountsView->setMinimumWidth(150);
	contentLayout->addWidget(AccountsView);
	MyAccountsModel = m_injectedFactory->makeInjected<AccountsModel>(m_accountManager, AccountsView);
	auto *chain = new ModelChain{this};
	auto accountProxyModel = new AccountsProxyModel(chain);
	chain->setBaseModel(MyAccountsModel);
	accountProxyModel->addFilter(new HaveProtocolFilter(accountProxyModel));
	chain->addProxyModel(accountProxyModel);

	QAction *separator = new QAction(this);
	separator->setSeparator(true);

	AddExistingAccountAction = new QAction(m_iconsManager->iconByPath(KaduIcon("contact-new")), tr("Add existing account"), this);
	CreateNewAccountAction = new QAction(m_iconsManager->iconByPath(KaduIcon("system-users")), tr("Create new account"), this);

	ActionListModel *actionsModel = new ActionListModel(this);
	actionsModel->appendAction(separator);
	actionsModel->appendAction(AddExistingAccountAction);
	actionsModel->appendAction(CreateNewAccountAction);

	QList<QAbstractItemModel *> models;
	models.append(chain->lastModel());
	models.append(actionsModel);

	ActionFilterProxyModel *proxyModel = new ActionFilterProxyModel(this);
	proxyModel->setSourceModel(MergedProxyModelFactory::createInstance(models, this));
	proxyModel->setModel(chain->lastModel());
	proxyModel->addHideWhenModelEmpty(separator);

	AccountsView->setModel(proxyModel);
	AccountsView->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
	AccountsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
	AccountsView->setIconSize(QSize(32, 32));
	connect(AccountsView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
			this, SLOT(accountSelectionChanged(const QItemSelection &, const QItemSelection &)));

	QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this);
	mainLayout->addWidget(buttons);

	QPushButton *cancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCloseButton), tr("Close"), this);

	connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(close()));
	buttons->addButton(cancelButton, QDialogButtonBox::RejectRole);

	MainStack = new QStackedWidget(this);

	contentLayout->addWidget(MainStack, 100);

	createAccountWidget();
	createEditAccountWidget();
}
Example #12
0
VersionDialog::VersionDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    setWindowIcon(QIcon(":/core/images/openpilot_logo_32.png"));

    setWindowTitle(tr("About OpenPilot GCS"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString version = QLatin1String(GCS_VERSION_LONG);
    version += QDate(2007, 25, 10).toString(Qt::SystemLocaleDate);

    QString ideRev;
#ifdef GCS_REVISION
     //: This gets conditionally inserted as argument %8 into the description string.
     ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(GCS_REVISION_STR).left(10));
#endif

     const QString description = tr(
        "<h3>OpenPilot GCS %1</h3>"
        "Based on Qt %2 (%3 bit)<br/>"
        "<br/>"
        "Built on %4 at %5<br />"
        "<br/>"
        "%8"
        "<br/>"
        "Copyright 2008-%6 %7. All rights reserved.<br/>"
        "<br/>"
         "<small>This program is free software; you can redistribute it and/or modify<br/>"
         "it under the terms of the GNU General Public License as published by<br/>"
         "the Free Software Foundation; either version 3 of the License, or<br/>"
         "(at your option) any later version.<br/><br/>"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.</small><br/>")
        .arg(version, QLatin1String(QT_VERSION_STR), QString::number(QSysInfo::WordSize),
             QLatin1String(__DATE__), QLatin1String(__TIME__), QLatin1String(GCS_YEAR), 
             (QLatin1String(GCS_AUTHOR)), ideRev);

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    QTC_ASSERT(closeButton, /**/);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/openpilot_logo_128.png")));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
Example #13
0
CrashReporter::CrashReporter(QWidget *p) : QDialog(p) {
    setWindowTitle(tr("Mumble Crash Report"));

    QVBoxLayout *vbl= new QVBoxLayout(this);

    QLabel *l;

    l = new QLabel(tr("<p><b>We're terribly sorry, but it seems Mumble has crashed. Do you want to send a crash report to the Mumble developers?</b></p>"
                      "<p>The crash report contains a partial copy of Mumble's memory at the time it crashed, and will help the developers fix the problem.</p>"));

    vbl->addWidget(l);

    QHBoxLayout *hbl = new QHBoxLayout();

    qleEmail = new QLineEdit(g.qs->value(QLatin1String("crashemail")).toString());
    l = new QLabel(tr("Email address (optional)"));
    l->setBuddy(qleEmail);

    hbl->addWidget(l);
    hbl->addWidget(qleEmail, 1);
    vbl->addLayout(hbl);

    qteDescription=new QTextEdit();
    l->setBuddy(qteDescription);
    l = new QLabel(tr("Please describe briefly, in English, what you were doing at the time of the crash"));

    vbl->addWidget(l);
    vbl->addWidget(qteDescription, 1);

    QPushButton *pbOk = new QPushButton(tr("Send Report"));
    pbOk->setDefault(true);

    QPushButton *pbCancel = new QPushButton(tr("Don't send report"));
    pbCancel->setAutoDefault(false);

    QDialogButtonBox *dbb = new QDialogButtonBox(Qt::Horizontal);
    dbb->addButton(pbOk, QDialogButtonBox::AcceptRole);
    dbb->addButton(pbCancel, QDialogButtonBox::RejectRole);
    connect(dbb, SIGNAL(accepted()), this, SLOT(accept()));
    connect(dbb, SIGNAL(rejected()), this, SLOT(reject()));
    vbl->addWidget(dbb);

    qelLoop = new QEventLoop(this);
    qpdProgress = NULL;
    qnrReply = NULL;
}
Example #14
0
NErrorWhileDialog::NErrorWhileDialog(const QStringList& args,
                                     const QString& errmsg,
                                     const int errcode,
                                     QWidget *parent)
  : QDialog(parent)
{
  QVBoxLayout *box = new QVBoxLayout;

// Label

  QLabel *l = new QLabel(label(ErrorWhileRunning));
  box->addWidget(l);

// Command args

  QPlainTextEdit *t = new QPlainTextEdit(this);
  t->setPlainText(args.join(" "));
  t->setReadOnly(true);
  box->addWidget(t);

// Label

  l = new QLabel(label(ErrorMessageFollows));
  box->addWidget(l);

// Error message

  t = new QPlainTextEdit(this);
  const QString s = label(ErrorCode, QString("%1").arg(errcode));
  t->setPlainText(QString("%1\n%2").arg(errmsg).arg(s));
  t->setReadOnly(true);
  box->addWidget(t);

// Button box

  QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok);
  QPushButton *b = new QPushButton(tr("Co&py"));
  b->setToolTip(tr("Copy to clipboard"));

  bb->addButton(b, QDialogButtonBox::ActionRole);

  connect(bb, SIGNAL(accepted()), this, SLOT(accept()));
  connect(b, SIGNAL(clicked()), this, SLOT(copy()));
  box->addWidget(bb);

// Window

  setFixedSize(QSize(400,340));
  setWindowTitle(tr("Error"));
  setLayout(box);
  show();

// Save

  _errcode = errcode;
  _errmsg = errmsg;
  _args = args;
}
db_error_dialog::db_error_dialog(const QString error) : m_error_text(error)
{
  setWindowTitle(tr("Database error"));
  QVBoxLayout* layout = new QVBoxLayout(this);

  setMinimumWidth(400);		// reasonable minimum

  QPlainTextEdit* label = new QPlainTextEdit;
  label->setPlainText(error);
  label->setReadOnly(true);
  label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
  label->setFrameShape(QFrame::Box);
  label->setFrameShadow(QFrame::Raised);
  layout->addWidget(label);

  m_btn_group = new QButtonGroup(this);
  QButtonGroup* g = m_btn_group;

  QRadioButton* btn1 = new QRadioButton(tr("Continue"));
  g->addButton(btn1, 1);
  btn1->setChecked(true);

  QRadioButton* btn2 = new QRadioButton(tr("Try to reconnect"));
  g->addButton(btn2, 2);

  QRadioButton* btn3 = new QRadioButton(tr("Quit application"));
  g->addButton(btn3, 3);

  layout->addWidget(btn1);
  layout->addWidget(btn2);
  layout->addWidget(btn3);

  QPushButton* btn_OK = new QPushButton(tr("OK"));
  btn_OK->setDefault(true);

  QPushButton* copy_btn = new QPushButton(tr("Copy"));

  QDialogButtonBox* buttonBox = new QDialogButtonBox(Qt::Horizontal);
  buttonBox->addButton(copy_btn, QDialogButtonBox::ActionRole);
  buttonBox->addButton(btn_OK, QDialogButtonBox::AcceptRole);
  layout->addWidget(buttonBox);
  connect(copy_btn, SIGNAL(clicked()), this, SLOT(copy_error()));
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(this, SIGNAL(accepted()), this, SLOT(handle_error()));
}
Example #16
0
ServiceViewer::ServiceViewer(Plasma::DataEngine *engine, const QString &source, QWidget *parent)
    : QDialog(parent),
      m_engine(engine),
      m_service(0),
      m_source(source),
      m_operationCount(0),
      m_operationButton(new QPushButton(i18n("Start Operation"), this))
{
    setAttribute(Qt::WA_DeleteOnClose);
    QWidget* mainWidget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout();

    QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
    buttonBox->addButton(m_operationButton, QDialogButtonBox::ActionRole);
    buttonBox->addButton(QDialogButtonBox::Close);

    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    layout->addWidget(mainWidget);
    layout->addWidget(buttonBox);
    setLayout(layout);

    setupUi(mainWidget);
    m_operationStatus->hide();

    connect(m_operationButton, SIGNAL(clicked()), this, SLOT(startOperation()));
    m_operationButton->setEnabled(false);

    connect(m_operations, SIGNAL(currentIndexChanged(QString)),
            this, SLOT(operationSelected(QString)));

    QString engineName = i18nc("Plasma engine with unknown name", "Unknown");
    QString serviceName = i18nc("Plasma service with unknown name", "Unknown");

    if (m_engine) {
        engineName = KStringHandler::capwords(m_engine->pluginInfo().name());
        qDebug() << "########### CALLING SERVICE FOR SOURCE: " << m_source;
        m_service = m_engine->serviceForSource(m_source);

        if (m_service != 0) {
            serviceName = m_service->name();
            updateOperations();
            connect(m_service, SIGNAL(operationsChanged()), this, SLOT(updateOperations()));
            connect(m_engine, SIGNAL(destroyed(QObject*)), this, SLOT(engineDestroyed()));
        } else {
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicExportFeatureImpl::configureForExport(caf::PdmUiPropertyViewDialog* propertyViewDialog)
{
    QDialogButtonBox* dialogButtonBox = propertyViewDialog->dialogButtonBox();

    dialogButtonBox->clear();

    dialogButtonBox->addButton("Export", QDialogButtonBox::AcceptRole);
    dialogButtonBox->addButton("Cancel", QDialogButtonBox::RejectRole);
}
Example #18
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();
}
Example #19
0
QDialogButtonBox *Dialog::createButtons()
{
    QPushButton *closeButton = new QPushButton(tr("&Close"));
    QPushButton *revertButton = new QPushButton(tr("&Revert"));
    QPushButton *submitButton = new QPushButton(tr("&Submit"));

    closeButton->setDefault(true);

    connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(revertButton, SIGNAL(clicked()), this, SLOT(revert()));
    connect(submitButton, SIGNAL(clicked()), this, SLOT(submit()));

    QDialogButtonBox *buttonBox = new QDialogButtonBox;
    buttonBox->addButton(submitButton, QDialogButtonBox::ResetRole);
    buttonBox->addButton(revertButton, QDialogButtonBox::ResetRole);
    buttonBox->addButton(closeButton, QDialogButtonBox::RejectRole);

    return buttonBox;
}
VersionDialog::VersionDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));

    setWindowTitle(tr("About Qt Creator"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString ideRev;
#ifdef IDE_REVISION
     //: This gets conditionally inserted as argument %8 into the description string.
     ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(14));
#endif

     const QString description = tr(
        "<h3>%1</h3>"
        "%2<br/>"
        "<br/>"
        "Built on %3 at %4<br />"
        "<br/>"
        "%5"
        "<br/>"
        "Copyright 2008-%6 %7. All rights reserved.<br/>"
        "<br/>"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.<br/>")
        .arg(ICore::versionString(),
             ICore::buildCompatibilityString(),
             QLatin1String(__DATE__), QLatin1String(__TIME__),
             ideRev,
             QLatin1String(Constants::IDE_YEAR),
             QLatin1String(Constants::IDE_AUTHOR));

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    QTC_CHECK(closeButton);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(Constants::ICON_QTLOGO_128)));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
Example #21
0
InputDialog::InputDialog(const QString &title, const QString &label,
                         QWidget *parent, QWidget *input, Qt::WindowFlags f)
    : QDialog(parent, f)
{
    QSettings settings;
    settings.beginGroup(GeneralOptionsConfigGroup);
    bool Thorn = settings.value("use_thorn_style", true).toBool();
    settings.endGroup();

    QString localStyle("QDialog {background-color: #000000} QLabel{background-color: transparent; color: #FFFFFF}");
    if (Thorn) setStyleSheet(localStyle);

    // set the window title
    setWindowTitle(tr("Rosegarden"));
    QVBoxLayout *vboxLayout = new QVBoxLayout(this);

    QLabel *t = new QLabel(QString("<qt><h3>%1</h3></qt>").arg(title));
    vboxLayout->addWidget(t);    

    // add the passed label to our layout
/*    QLabel *lbl = new QLabel(label, this);
    vboxLayout->addWidget(lbl);
    vboxLayout->addStretch(1);*/

    // make a group box to hold the controls, for visual consistency with other
    // dialogs
    QGroupBox *gbox = new QGroupBox(this);
    vboxLayout->addWidget(gbox);
    QVBoxLayout *gboxLayout = new QVBoxLayout;
    gbox->setLayout(gboxLayout);
    gboxLayout->addWidget(new QLabel(label));

    // add the passed input widget to our layout, and reparent it
    input->setParent(this);
    gboxLayout->addWidget(input);
    gboxLayout->addStretch(1);

    // I have no idea what this is for, but Qt had it, so we'll keep it in our
    // doctored version
//    lbl->setBuddy(input);

    // Put some clicky buttons and hook them up
    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel,
                                                       Qt::Horizontal, this);
    QPushButton *okButton = static_cast<QPushButton *>(buttonBox->addButton(QDialogButtonBox::Ok));
    okButton->setDefault(true);
    vboxLayout->addWidget(buttonBox);

    QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    // No size grip.  Size grips are stupid looking, and I detest them.
    // Rosegarden has a NO SIZE GRIP policy.
    setSizeGripEnabled(false);
}
Example #22
0
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    //setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));

    setWindowTitle("About MMMLauncher");
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    QString ideRev;
#ifdef IDE_REVISION
     //: This gets conditionally inserted as argument %8 into the description string.
     ideRev = tr("From revision %1<br/>").arg(QString::fromLatin1(Constants::IDE_REVISION_STR).left(10));
#endif

     const QString description = tr(
        "<h3>MMMLauncher %1</h3>"
        "%2<br/>"
        "Built on %3 at %4<br />"
        "<br/>"
        "Crafted by: %5 (%6)<br/>"
        "Thanks to: %7 (%8)<br/>"    
        "<br />"
        "Support: <a href='irc://nyanch.at/#mmm'>irc://nyanch.at/#mmm</a><br />"
        "<br />"
        "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
        "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
        "PARTICULAR PURPOSE.<br/>")
        .arg(
                 QApplication::applicationVersion(),
                 MMMLUtils::buildCompatibilityString(),
                 QLatin1String(__DATE__), QLatin1String(__TIME__),
                 QApplication::organizationName(), "<a href='"+ QApplication::organizationDomain() +"'>"+ QApplication::organizationDomain() +"</a>",
                 "Endres", "For the old MMMLauncher"
        );

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(":/images/images/about.png")));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
Example #23
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();
}
Example #24
0
GotoTimeDialog::GotoTimeDialog( intf_thread_t *_p_intf)
               : QVLCDialog( (QWidget*)_p_intf->p_sys->p_mi, _p_intf )
{
    setWindowFlags( Qt::Tool );
    setWindowTitle( qtr( "Go to Time" ) );
    setWindowRole( "vlc-goto-time" );

    QGridLayout *mainLayout = new QGridLayout( this );
    mainLayout->setSizeConstraint( QLayout::SetFixedSize );

    QPushButton *gotoButton = new QPushButton( qtr( "&Go" ) );
    QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );
    QDialogButtonBox *buttonBox = new QDialogButtonBox;

    gotoButton->setDefault( true );
    buttonBox->addButton( gotoButton, QDialogButtonBox::AcceptRole );
    buttonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );

    QLabel *timeIntro = new QLabel( qtr( "Go to time" ) + ":" );
    timeIntro->setWordWrap( true );
    timeIntro->setAlignment( Qt::AlignCenter );

    timeEdit = new QTimeEdit();
    timeEdit->setDisplayFormat( "HH'H':mm'm':ss's'" );
    timeEdit->setAlignment( Qt::AlignRight );
    timeEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );

    QPushButton *resetButton = new QPushButton( QIcon(":/update.svg"), "" );
    resetButton->setToolTip( qtr("Reset") );

    mainLayout->addWidget( timeIntro, 0, 0, 1, 1 );
    mainLayout->addWidget( timeEdit, 0, 1, 1, 1 );
    mainLayout->addWidget( resetButton, 0, 2, 1, 1 );

    mainLayout->addWidget( buttonBox, 1, 0, 1, 3 );

    BUTTONACT( gotoButton, close() );
    BUTTONACT( cancelButton, cancel() );
    BUTTONACT( resetButton, reset() );

    QVLCTools::restoreWidgetPosition( p_intf, "gototimedialog", this );
}
Example #25
0
void ProgressWindow::createGui()
{
	QVBoxLayout *mainLayout = new QVBoxLayout(this);
	mainLayout->setMargin(12);
	mainLayout->setSpacing(16);

	QLabel *label = new QLabel(this);
	label->setText(QString("<b>%1</b>").arg(Label));
	label->setWordWrap(true);

	QWidget *progressWidget = new QWidget(this);
	QHBoxLayout *progressLayout = new QHBoxLayout(progressWidget);
	progressLayout->setMargin(0);

	ProgressBar = new QProgressBar(this);
	ProgressBar->setMinimum(0);
	ProgressBar->setMaximum(0);

	progressLayout->addWidget(new QLabel(tr("Progress:"), progressWidget));
	progressLayout->addWidget(ProgressBar);

	TextListWidget = new QListWidget(this);
	TextListWidget->setMinimumHeight(200);
	TextListWidget->hide();

	QDialogButtonBox *buttons = new QDialogButtonBox(this);
	CloseButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCloseButton), tr("Close"));
	CloseButton->setEnabled(false);
	connect(CloseButton, SIGNAL(clicked(bool)), this, SLOT(close()));

	ShowDetailsButton = new QPushButton(tr("Show details >>>"));
	connect(ShowDetailsButton, SIGNAL(clicked(bool)), this, SLOT(showDetailsClicked()));

	buttons->addButton(CloseButton, QDialogButtonBox::DestructiveRole);
	buttons->addButton(ShowDetailsButton, QDialogButtonBox::ActionRole);

	mainLayout->addWidget(label);
	mainLayout->addWidget(progressWidget);
	mainLayout->addWidget(TextListWidget);
	mainLayout->addStretch(1);
	mainLayout->addWidget(buttons);
}
Example #26
0
SetReferenceDialog::SetReferenceDialog(QWidget * parent) :
    QDialog(parent)
{
    QVBoxLayout * layout = new QVBoxLayout();

    QGridLayout * grid = new QGridLayout();

    {
        QGroupBox * group = new QGroupBox("New object reference");
        QVBoxLayout * groupLayout = new QVBoxLayout();
        groupLayout->setMargin(0);

        m_reference = new ObjrefWidget();
        m_reference->setObjectName("reference");
        groupLayout->addWidget(m_reference);
        group->setLayout(groupLayout);
        
        grid->addWidget(group, 1, 0, 1, 2);
    }

    layout->addLayout(grid);

    // Buttons
    QDialogButtonBox * btns = new QDialogButtonBox();
    QPushButton * pasteButton = 
        btns->addButton("&Paste IOR from clipboard", QDialogButtonBox::ActionRole);
    QPushButton * createButton = 
        btns->addButton("&Apply", QDialogButtonBox::AcceptRole);
    QPushButton * cancelButton = 
        btns->addButton("C&ancel", QDialogButtonBox::RejectRole);
    layout->addWidget(btns);

    connect(pasteButton, SIGNAL(clicked()),
            m_reference, SLOT(pasteIOR()));
    connect(createButton, SIGNAL(clicked()),
            this, SLOT(update()));
    connect(cancelButton, SIGNAL(clicked()),
            window(), SLOT(hide()));
    // End buttons

    setLayout(layout);
}
Example #27
0
void ChatDataWindow::createButtons(QVBoxLayout *layout)
{
	QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this);

	OkButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogOkButton), tr("OK"), this);
	OkButton->setDefault(true);
	buttons->addButton(OkButton, QDialogButtonBox::AcceptRole);
	ApplyButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogApplyButton), tr("Apply"), this);
	buttons->addButton(ApplyButton, QDialogButtonBox::ApplyRole);

	QPushButton *cancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Cancel"), this);
	buttons->addButton(cancelButton, QDialogButtonBox::RejectRole);

	connect(OkButton, SIGNAL(clicked(bool)), this, SLOT(updateChatAndClose()));
	connect(ApplyButton, SIGNAL(clicked(bool)), this, SLOT(updateChat()));
	connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(close()));

	layout->addSpacing(16);
	layout->addWidget(buttons);
}
EncodeDecodeDialog::EncodeDecodeDialog(QWidget* parent)
    : QDialog(parent)
{
    setWindowIcon(GuiFactory::instance().encodeDecodeIcon());

    setWindowTitle(translations::trEncodeDecode);
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QVBoxLayout* layout = new QVBoxLayout;

    QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton* closeButton = buttonBox->button(QDialogButtonBox::Close);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    VERIFY(connect(buttonBox, &QDialogButtonBox::rejected, this, &EncodeDecodeDialog::reject));

    QToolButton* decode = new QToolButton;
    decode->setIcon(GuiFactory::instance().executeIcon());
    VERIFY(connect(decode, &QToolButton::clicked, this, &EncodeDecodeDialog::decode));

    decoders_ = new QComboBox;
    for(int i = 0; i < SIZEOFMASS(common::EDecoderTypes); ++i) {
        decoders_->addItem(common::convertFromString<QString>(common::EDecoderTypes[i]));
    }

    QHBoxLayout* toolBarLayout = new QHBoxLayout;
    toolBarLayout->setContentsMargins(0, 0, 0, 0);
    toolBarLayout->addWidget(decode);
    toolBarLayout->addWidget(decoders_);

    encodeButton_ = new QRadioButton;
    decodeButton_ = new QRadioButton;
    toolBarLayout->addWidget(encodeButton_);
    toolBarLayout->addWidget(decodeButton_);

    QSplitter* splitter = new QSplitter;
    splitter->setOrientation(Qt::Horizontal);
    splitter->setHandleWidth(1);
    splitter->setContentsMargins(0, 0, 0, 0);
    toolBarLayout->addWidget(splitter);

    input_ = new FastoEditor;
    input_->installEventFilter(this);
    output_ = new FastoEditor;
    output_->installEventFilter(this);

    layout->addWidget(input_);
    layout->addLayout(toolBarLayout);
    layout->addWidget(output_);
    layout->addWidget(buttonBox);

    setMinimumSize(QSize(width, height));
    setLayout(layout);

    retranslateUi();
}
Example #29
0
VersionDialog::VersionDialog(QWidget *parent)
    : QDialog(parent)
{
    // We need to set the window icon explicitly here since for some reason the
    // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
    setWindowIcon(QIcon(QLatin1String(":/application/images/about.png")));

    setWindowTitle(tr("About %1").arg(Application::Constants::APP_NAME_STR));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
    QGridLayout *layout = new QGridLayout(this);
    layout->setSizeConstraint(QLayout::SetFixedSize);

    const QString versionString = tr("%1 %2").arg(Application::Constants::APP_NAME_STR,
                                            Application::Constants::APP_VERSION_STR);
    const QString buildCompatibilityString = tr("Based on Qt %1 (%2, %3 bit)").arg(QLatin1String(qVersion()),
                                                                      compilerString(),
                                                                      QString::number(QSysInfo::WordSize));
    const QString ideRev = tr("From revision %1<br/>").arg(Application::Constants::APP_VERSION_PATCH);
    const QString description = tr(
       "<h3>%1</h3>"
       "%2<br/>"
       "<br/>"
       "Built on %3 at %4<br />"
       "<br/>"
       "%5"
       "<br/>"
       "Copyright 2014 %6. All rights reserved.<br/>"
       "<br/>"
       "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
       "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
       "PARTICULAR PURPOSE.<br/>")
       .arg(versionString,
            buildCompatibilityString,
            QLatin1String(__DATE__), QLatin1String(__TIME__),
            ideRev,
            QLatin1String(Application::Constants::APP_ORGNAME_STR));

    QLabel *copyRightLabel = new QLabel(description);
    copyRightLabel->setWordWrap(true);
    copyRightLabel->setOpenExternalLinks(true);
    copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
    QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close);
    //QTC_CHECK(closeButton);
    buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
    connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));

    QLabel *logoLabel = new QLabel;
    logoLabel->setPixmap(QPixmap(QLatin1String(":/application/images/about.png")));
    layout->addWidget(logoLabel , 0, 0, 1, 1);
    layout->addWidget(copyRightLabel, 0, 1, 4, 4);
    layout->addWidget(buttonBox, 4, 0, 1, 5);
}
ClearPrivateData::ClearPrivateData(QWidget *parent)
    : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
{
    setWindowTitle(tr("Clear Private Data"));

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(new QLabel(tr("Clear the following items:")));

    QSettings settings;
    settings.beginGroup(QLatin1String("clearprivatedata"));

    m_browsingHistory = new QCheckBox(tr("&Browsing History"));
    m_browsingHistory->setChecked(settings.value(QLatin1String("browsingHistory"), true).toBool());
    layout->addWidget(m_browsingHistory);

    m_downloadHistory = new QCheckBox(tr("&Download History"));
    m_downloadHistory->setChecked(settings.value(QLatin1String("downloadHistory"), true).toBool());
    layout->addWidget(m_downloadHistory);

    m_searchHistory = new QCheckBox(tr("&Search History"));
    m_searchHistory->setChecked(settings.value(QLatin1String("searchHistory"), true).toBool());
    layout->addWidget(m_searchHistory);

    m_cookies = new QCheckBox(tr("&Cookies"));
    m_cookies->setChecked(settings.value(QLatin1String("cookies"), true).toBool());
    layout->addWidget(m_cookies);

    m_cache = new QCheckBox(tr("C&ached Web Pages"));
    if (BrowserApplication::networkAccessManager()->cache()) {
        m_cache->setChecked(settings.value(QLatin1String("cache"), true).toBool());
    } else {
        m_cache->setEnabled(false);
    }
    layout->addWidget(m_cache);

    m_favIcons = new QCheckBox(tr("Website &Icons"));
    m_favIcons->setChecked(settings.value(QLatin1String("favIcons"), true).toBool());
    layout->addWidget(m_favIcons);

    settings.endGroup();

    QPushButton *acceptButton = new QPushButton(tr("Clear &Private Data"));
    acceptButton->setDefault(true);
    QPushButton *rejectButton = new QPushButton(tr("&Cancel"));
    QDialogButtonBox *buttonBox = new QDialogButtonBox;
    buttonBox->addButton(acceptButton, QDialogButtonBox::AcceptRole);
    buttonBox->addButton(rejectButton, QDialogButtonBox::RejectRole);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    layout->addWidget(buttonBox);

    setLayout(layout);
    acceptButton->setFocus(Qt::OtherFocusReason);
}