示例#1
0
/**
 * Constructor. Sets up the wizard and loads the wizard pages.
 * Each wizard page has its own class.
 * @param doc   the UML document
 */
ClassWizard::ClassWizard(UMLDoc* doc)
    : QWizard( (QWidget*)doc->parent())
{
    m_doc = doc;
    //create a unique class to start with
    UMLObject * pTemp = 0;
    QString name = i18n("new_class");
    QString newName = name;
    QString num;
    int i = 0;
    m_pClass = new UMLClassifier( newName );
    do {
        m_pClass->setName( newName );
        pTemp = m_doc->findUMLObject( newName );
        num.setNum( ++i);
        newName = name;
        newName.append("_").append( num );
    } while( pTemp );

    setWizardStyle(QWizard::ModernStyle);
    setPixmap(QWizard::LogoPixmap, Icon_Utils::UserIcon(Icon_Utils::it_Code_Gen_Wizard));
    setWindowTitle(i18n("Class Wizard"));
    setOption(QWizard::NoBackButtonOnStartPage, true);
    setOption(QWizard::HaveHelpButton, true);
    connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

    addPage(createGeneralPage());
    addPage(createAttributesPage());
    addPage(createOperationsPage());
}
示例#2
0
UIVMCloseDialog::UIVMCloseDialog(QWidget *pParent)
    : QIWithRetranslateUI<QIDialog>(pParent)
{
#ifdef Q_WS_MAC
    /* Check if Mac Sheet is allowed: */
    if (vboxGlobal().isSheetWindowAllowed(pParent))
    {
        vboxGlobal().setSheetWindowUsed(pParent, true);
        setWindowFlags(Qt::Sheet);
    }
#endif /* Q_WS_MAC */

    /* Apply UI decorations */
    Ui::UIVMCloseDialog::setupUi(this);

#ifdef Q_WS_MAC
    /* Make some more space around the content */
    hboxLayout->setContentsMargins(40, 0, 40, 0);
    vboxLayout2->insertSpacing(1, 20);
    /* and more space between the radio buttons */
    gridLayout->setSpacing(15);
#endif /* Q_WS_MAC */
    /* Set fixed size */
    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    connect(mButtonBox, SIGNAL(helpRequested()),
            &msgCenter(), SLOT(sltShowHelpHelpDialog()));
}
示例#3
0
// constructor used when the query builder must make its own
// connection to the database
SaQueryBuilder::SaQueryBuilder( QgsVectorLayer *layer,
                                QWidget *parent, Qt::WFlags fl )
    : QDialog( parent, fl ), mLayer( layer )
{
  setupUi( this );
  connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );

  QPushButton *pbn = new QPushButton( tr( "&Test" ) );
  buttonBox->addButton( pbn, QDialogButtonBox::ActionRole );
  connect( pbn, SIGNAL( clicked() ), this, SLOT( test() ) );

  pbn = new QPushButton( tr( "&Clear" ) );
  buttonBox->addButton( pbn, QDialogButtonBox::ActionRole );
  connect( pbn, SIGNAL( clicked() ), this, SLOT( clear() ) );

  // remove the ILIKE button since ILIKE is a PostgreSQL special
  // not supported by SQL Anywhere
  btnILike->setVisible( false );

  setupGuiViews();

  mOrigSubsetString = layer->subsetString();

  lblDataUri->setText( layer->publicSource() );
  txtSQL->setText( mOrigSubsetString );

  populateFields();
}
示例#4
0
FirstRunDlg::FirstRunDlg(QWidget* const parent)
    : QWizard(parent),
      d(new Private)
{
    setWizardStyle(QWizard::ClassicStyle);
    setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton
                                                   << QWizard::BackButton
                                                   << QWizard::CancelButton
                                                   << QWizard::NextButton
                                                   << QWizard::FinishButton);

    d->welcomePage    = new WelcomePage(this);    // First assistant page
    d->collectionPage = new CollectionPage(this);
    d->databasePage   = new DatabasePage(this);
    d->rawPage        = new RawPage(this);
    d->metadataPage   = new MetadataPage(this);
    d->previewPage    = new PreviewPage(this);
    d->openFilePage   = new OpenFilePage(this);
    d->tooltipsPage   = new TooltipsPage(this);

    // NOTE: Added here new assistant pages...

    d->startScanPage  = new StartScanPage(this);  // Last assistant page

    resize(600, 600);

    connect(button(QWizard::FinishButton), SIGNAL(clicked()),
            this, SLOT(slotFinishPressed()));

    connect(this, SIGNAL(helpRequested()),
            this, SLOT(slotHelp()));
}
示例#5
0
//! [0] //! [1] //! [2]
LicenseWizard::LicenseWizard(QWidget *parent)
    : QWizard(parent)
{
//! [0]
    setPage(Page_Intro, new IntroPage);
    setPage(Page_Evaluate, new EvaluatePage);
    setPage(Page_Register, new RegisterPage);
    setPage(Page_Details, new DetailsPage);
    setPage(Page_Conclusion, new ConclusionPage);
//! [1]

    setStartId(Page_Intro);
//! [2]

//! [3]
#ifndef Q_WS_MAC
//! [3] //! [4]
    setWizardStyle(ModernStyle);
#endif
//! [4] //! [5]
    setOption(HaveHelpButton, true);
//! [5] //! [6]
    setPixmap(QWizard::LogoPixmap, QPixmap(":/images/logo.png"));

//! [7]
    connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
//! [7]

    setWindowTitle(tr("License Wizard"));
//! [8]
}
示例#6
0
  DlgTerminate::DlgTerminate(QWidget *parent) : QDialog(parent)
  {
    QLabel* lblError = new QLabel(tr("A fatal error ocurred during initialization of <b>Impresario</b>. The application needs to be terminated."));
    lblError->setWordWrap(true);
    lblError->setTextFormat(Qt::RichText);
    QVBoxLayout* groupTextLayout = new QVBoxLayout();
    groupTextLayout->addWidget(lblError);
    QGroupBox* groupText = new QGroupBox();
    groupText->setLayout(groupTextLayout);

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

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

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

    // set signal handlers
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(onAbout()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
  }
VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg(QWidget *pParent, const CMachine &machine)
    : QIWithRetranslateUI<QIDialog>(pParent)
{
    /* Apply UI decorations */
    Ui::VBoxTakeSnapshotDlg::setupUi(this);

    /* Alt key filter */
    QIAltKeyFilter *altKeyFilter = new QIAltKeyFilter(this);
    altKeyFilter->watchOn(mLeName);

    /* Setup connections */
    connect (mButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));
    connect (mLeName, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &)));

    /* Check if machine have immutable attachments */
    int immutableMediums = 0;

    if (machine.GetState() == KMachineState_Paused)
    {
        foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments())
        {
            CMedium medium = attachment.GetMedium();
            if (!medium.isNull() && !medium.GetParent().isNull() && medium.GetBase().GetType() == KMediumType_Immutable)
                ++ immutableMediums;
        }
    }
示例#8
0
QDateDisplayDlg::QDateDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget();
    pDateDisplayGen=new QDateDisplayGeneralDlg();

    tabWidget->addTab(pDateDisplayGen, tr("日期显示"));

    datalist = new QStringList();
    int i = 0;
    for (i=0; i<200; i++)
    {
        datalist->append("");
    }

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(confyButton()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    InitAllProperty(pItem);
    this->setWindowTitle(tr("日期显示"));
    this->resize(420,500);
}
VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg(QWidget *pParent, const CMachine &machine)
    : QIWithRetranslateUI<QIDialog>(pParent)
{
#ifdef Q_WS_MAC
    /* No sheets in another mode than normal for now. Firstly it looks ugly and
     * secondly in some cases it is broken. */
    if (   vboxGlobal().isSheetWindowsAllowed(pParent)
        || qobject_cast<VBoxSnapshotsWgt*>(pParent))
        setWindowFlags(Qt::Sheet);
#endif /* Q_WS_MAC */

    /* Apply UI decorations */
    Ui::VBoxTakeSnapshotDlg::setupUi(this);

    /* Alt key filter */
    QIAltKeyFilter *altKeyFilter = new QIAltKeyFilter(this);
    altKeyFilter->watchOn(mLeName);

    /* Setup connections */
    connect (mButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));
    connect (mLeName, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &)));

    /* Check if machine have immutable attachments */
    int immutableMediums = 0;

    if (machine.GetState() == KMachineState_Paused)
    {
        foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments())
        {
            CMedium medium = attachment.GetMedium();
            if (!medium.isNull() && !medium.GetParent().isNull() && medium.GetBase().GetType() == KMediumType_Immutable)
                ++ immutableMediums;
        }
    }
AMBeamConfigurationWizard::AMBeamConfigurationWizard(QWidget* parent)
	: AMGraphicsViewWizard(parent)
{
	/// two points for each square, three squares.
	setNumberOfPoints(6);
	setNumberOfPages(numberOfPoints());
	setFreePage(Page_Free);

	setRotationEnabled(false);

	setPage(Page_Intro, new AMWizardPage);
	setPage(Page_Final, new AMWizardPage);
	setPage(Page_Option, new AMWizardOptionPage);
	for(int i = 0; i < numberOfPages(); i++)
	{
		setPage(pageWait(i), new AMBeamWaitPage);
		/* kind of a dirty hack here, but this makes the
		   wait logic cleaner */
		if(i < 3)
			setPage(pageSet(i), new AMBeamCheckPage);
		else
			setPage(pageSet(i), new AMBeamSelectPage);
	}
	setStartId(Page_Intro);
	setOption(HaveHelpButton, true);
	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
	setWindowTitle(message(Wizard_Title));
	/* have to disconnect/connect the buttons to get them to work with the new slots */
	disconnect(button(QWizard::BackButton), SIGNAL(clicked()), this, SLOT(back()));
	connect(button(QWizard::BackButton), SIGNAL(clicked()), this, SLOT(back()));
	disconnect(button(QWizard::NextButton), SIGNAL(clicked()), this, SLOT(next()));
	connect(button(QWizard::NextButton), SIGNAL(clicked()), this, SLOT(next()));

	setMinimumSize(600,600);

	setting_ = false;
	reviewBeamShape_ = true;




	for(int i = 0; i < numberOfPoints(); i++)
	{
		pointListAppend(new QPointF(0,0));
	}

	topLeft_ = true;

	coordinateListAppend(new QVector3D(0,0,0));
	coordinateListAppend(new QVector3D(0,-1,0));
	coordinateListAppend(new QVector3D(0,1,0));
	coordinateListAppend(new QVector3D(0,0,0));
	coordinateListAppend(new QVector3D(0,-1,0));
	coordinateListAppend(new QVector3D(0,1,0));


	addOptionPage(Page_Intro);

}
示例#11
0
ExtensionListItem::ExtensionListItem(bool editor, bool showUpdateInfo, QWidget* pParent) : QWidget(pParent)
{
   //KIP - Fix up the layout of this widget.
   QVBoxLayout* pTopLevel = new QVBoxLayout(this);

   QHBoxLayout* pInfo = new QHBoxLayout;
   pTopLevel->addLayout(pInfo);
   mpIcon = new QLabel("pix", this);
   pInfo->addWidget(mpIcon);
   pInfo->addSpacing(10);

   QVBoxLayout* pText = new QVBoxLayout;
   pInfo->addLayout(pText);
   pInfo->addStretch();

   QHBoxLayout* pFirst = new QHBoxLayout;
   pText->addLayout(pFirst);
   mpName = new QLabel(this);
   mpName->setWordWrap(true);
   QFont boldFont = mpName->font();
   boldFont.setBold(true);
   mpName->setFont(boldFont);
   pFirst->addWidget(mpName);
   mpVersion = new QLabel(this);
   pFirst->addWidget(mpVersion);

   mpDescription = new QLabel(this);
   mpDescription->setWordWrap(true);
   pText->addWidget(mpDescription);

   if (showUpdateInfo)
   {
      mpUpdateInfo = new QLabel(this);
      mpUpdateInfo->setFont(boldFont);
      pText->addWidget(mpUpdateInfo);
   }
   else
   {
      mpUpdateInfo = NULL;
   }

   if (editor)
   {
      mpButtons = new QDialogButtonBox(this);
      mpButtons->addButton("Disable", QDialogButtonBox::ActionRole)->setEnabled(false);
      mpUninstallButton = mpButtons->addButton("Uninstall", QDialogButtonBox::DestructiveRole);
      connect(mpUninstallButton, SIGNAL(clicked()), this, SLOT(uninstall()));
      mpButtons->addButton("About", QDialogButtonBox::HelpRole);
      mpButtons->addButton("Update", QDialogButtonBox::ApplyRole)->setEnabled(false);
      pTopLevel->addWidget(mpButtons);
      connect(mpButtons, SIGNAL(helpRequested()), this, SLOT(about()));
   }
   else
   {
      mpButtons = NULL;
      mpUninstallButton = NULL;
   }
   pTopLevel->addStretch();
}
示例#12
0
InterpretDialog::InterpretDialog(QWidget *parent) :
        QDialog(parent)
{
    //setHelp("nv-interpret");

    setModal(true);
    setWindowTitle(tr("Interpret"));

    QGridLayout *metagrid = new QGridLayout;
    setLayout(metagrid);
    QGroupBox *vbox = new QGroupBox(tr("Interpretations to apply"), this);
    QVBoxLayout *vboxLayout = new QVBoxLayout;
    metagrid->addWidget(vbox, 0, 0);

    m_applyTextDynamics = new QCheckBox
                          (tr("Apply text dynamics (p, mf, ff etc)"));
    vboxLayout->addWidget(m_applyTextDynamics);
    m_applyHairpins = new QCheckBox
                      (tr("Apply hairpin dynamics"));
    vboxLayout->addWidget(m_applyHairpins);
    m_stressBeats = new QCheckBox
                    (tr("Stress beats"));
    vboxLayout->addWidget(m_stressBeats);
    m_articulate = new QCheckBox
                   (tr("Articulate slurs, staccato, tenuto etc"));
    vboxLayout->addWidget(m_articulate);
    m_allInterpretations = new QCheckBox
                           (tr("All available interpretations"));
    vboxLayout->addWidget(m_allInterpretations);

    vbox->setLayout(vboxLayout);

    QSettings settings;
    settings.beginGroup( NotationViewConfigGroup );

    m_allInterpretations->setChecked
    ( qStrToBool( settings.value("interpretall", "true" ) ) );
    m_applyTextDynamics->setChecked
    ( qStrToBool( settings.value("interprettextdynamics", "true" ) ) );
    m_applyHairpins->setChecked
    ( qStrToBool( settings.value("interprethairpins", "true" ) ) );
    m_stressBeats->setChecked
    ( qStrToBool( settings.value("interpretstressbeats", "true" ) ) );
    m_articulate->setChecked
    ( qStrToBool( settings.value("interpretarticulate", "true" ) ) );

    connect(m_allInterpretations,
            SIGNAL(clicked()), this, SLOT(slotAllBoxChanged()));

    slotAllBoxChanged();
    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
    metagrid->addWidget(buttonBox, 1, 0);
    metagrid->setRowStretch(0, 10);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(slotHelpRequested()));

    settings.endGroup();
}
示例#13
0
PasteNotationDialog::PasteNotationDialog(QWidget *parent) :
    QDialog(parent),
    m_defaultType(getSavedPasteType())
{
    //setHelp("nv-paste-types");

    setModal(true);
    setWindowTitle(tr("Paste"));

    QGridLayout *metagrid = new QGridLayout;
    setLayout(metagrid);
    QWidget *vbox = new QWidget(this);
    QVBoxLayout *vboxLayout = new QVBoxLayout;
    metagrid->addWidget(vbox, 0, 0);


    QGroupBox *pasteTypeGroup = new QGroupBox( tr("Paste type"), vbox );
    QVBoxLayout *pasteTypeGroupLayout = new QVBoxLayout;
    vboxLayout->addWidget(pasteTypeGroup);

    PasteEventsCommand::PasteTypeMap pasteTypes =
        PasteEventsCommand::getPasteTypes();

    for (PasteEventsCommand::PasteTypeMap::iterator i = pasteTypes.begin();
            i != pasteTypes.end(); ++i) {

        QRadioButton *button = new QRadioButton(i->second, pasteTypeGroup);
        pasteTypeGroupLayout->addWidget(button);
        button->setChecked(m_defaultType == i->first);
        QObject::connect(button, SIGNAL(clicked()),
                         this, SLOT(slotPasteTypeChanged()));

        m_pasteTypeButtons.push_back(button);
    }
    pasteTypeGroup->setLayout(pasteTypeGroupLayout);


    QGroupBox *setAsDefaultGroup = new QGroupBox( tr("Options"), vbox );
    QVBoxLayout *setAsDefaultGroupLayout = new QVBoxLayout;
    vboxLayout->addWidget(setAsDefaultGroup);
    vbox->setLayout(vboxLayout);

    m_setAsDefaultButton = new QCheckBox
                           (tr("Make this the default paste type"), setAsDefaultGroup);
    setAsDefaultGroupLayout->addWidget(m_setAsDefaultButton);
    m_setAsDefaultButton->setChecked(true);
    setAsDefaultGroup->setLayout(setAsDefaultGroupLayout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help );
    metagrid->addWidget(buttonBox, 1, 0);
    metagrid->setRowStretch(0, 10);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(slotHelpRequested()));
}
// +-----------------------------------------------------------
ft::FaceFitConfig::FaceFitConfig(QWidget *pParent) :
	QDialog(pParent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint),
	ui(new Ui::FaceFitConfig)
{
    ui->setupUi(this);
	setFixedSize(size());
	connect(ui->pathButton, SIGNAL(clicked()), this, SLOT(on_actionSelectPath_triggered()));
	connect(ui->pathEdit, SIGNAL(textChanged(QString)), this, SLOT(onPathChanged(QString)));
	connect(ui->buttonBox, SIGNAL(helpRequested()), this, SLOT(onShowHelp()));
	onPathChanged(ui->pathEdit->text());
}
示例#15
0
Table::Table(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget(this);

    pGeneralDlg = new TableDlg;

    tabWidget->addTab(pGeneralDlg, tr("外观设置"));
    pSecurity = new SecurityWidget(this);
    tabWidget->addTab(pSecurity, tr("权限设置"));
    pSecurity->setGroupVVisible(false);
    pSecurity->setTouchGroupEnabled(false);

    datalist = new QStringList();
    int i = 0;
    for (i=0; i<= 50; i++)
    {
        datalist->append("");
    }

    if(pItem)
    {
        pGeneralDlg->DoubleClickInit(pItem);
        QTableItem* pTable = dynamic_cast<QTableItem *>(pItem);
        if(pTable)
        {
            pSecurity->init(pTable);
        }
    }
    else
    {
        pGeneralDlg->InitParament();
        pSecurity->init(0);
    }

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);


    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));


    mainLayout=new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("表格"));

    this->resize(450,500);
}
示例#16
0
DataGroupDisplayDlg::DataGroupDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
    QDialog(parent)
{
    tabWidget = new QTabWidget();
    TrendChartGenDlg=new DataGroupDisplayGenDlg;
    TrendChartPenDlg=new QTrendChartPenDlg;
    TrendChartXYDlg=new QTrendChartXYDlg;
    VisibilityDlg=new QVisibilityDlg;

    datalist = new QStringList();
    int i = 0;
    for (i=0; i <= 200; i++)
    {
       datalist->append("");
    }

    tabWidget->addTab(TrendChartGenDlg, tr("一般"));
    tabWidget->addTab(TrendChartPenDlg, tr("笔"));
    tabWidget->addTab(TrendChartXYDlg, tr("XY轴"));
    tabWidget->addTab(VisibilityDlg, tr("显现"));

    if(pItem)
    {
        TrendChartGenDlg->DoubleClickInit(pItem);
        TrendChartPenDlg->Init(pItem);
        TrendChartXYDlg->Init(pItem);
        VisibilityDlg->Init(pItem);
    }
    else
    {
        TrendChartGenDlg->InitParament();
        TrendChartPenDlg->Init(NULL);
        TrendChartXYDlg->Init(NULL);
        VisibilityDlg->Init(NULL);
    }
    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);


    connect(buttonBox, SIGNAL(accepted()), this, SLOT(confyButton()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));
    connect(TrendChartGenDlg, SIGNAL(GenNomberofDataChange()), this, SLOT(ChangePenAmount()));
    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("数据群组显示元件"));

    this->resize(750,600);
}
示例#17
0
ReplaceSymbolSetDialog::ReplaceSymbolSetDialog(QWidget* parent, Map* map, Map* symbol_map)
 : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint), map(map), symbol_map(symbol_map)
{
	setWindowTitle(tr("Replace symbol set"));
	
	QLabel* desc_label = new QLabel(tr("Configure how the symbols should be replaced, and which."));
	
	import_all_check = new QCheckBox(tr("Import all new symbols, even if not used as replacement"));
	import_all_check->setChecked(true);
	delete_unused_symbols_check = new QCheckBox(tr("Delete original symbols which are unused after the replacement"));
	delete_unused_symbols_check->setChecked(true);
	delete_unused_colors_check = new QCheckBox(tr("Delete unused colors after the replacement"));
	delete_unused_colors_check->setChecked(true);
	
	QLabel* mapping_label = new QLabel(tr("Symbol mapping:"));
	preserve_symbol_states_check = new QCheckBox(tr("Keep the symbols' hidden / protected states of the old symbol set"));
	preserve_symbol_states_check->setChecked(true);
	match_by_number_check = new QCheckBox(tr("Match replacement symbols by symbol number"));
	match_by_number_check->setChecked(true);
	
	mapping_table = new QTableWidget();
	mapping_table->verticalHeader()->setVisible(false);
	mapping_table->setColumnCount(2);
	mapping_table->setHorizontalHeaderLabels(QStringList() << tr("Original") << tr("Replacement"));
	mapping_table->horizontalHeader()->setSectionsClickable(false);
	mapping_table->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
	mapping_table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
	
	QDialogButtonBox* button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal);
	
	QVBoxLayout* layout = new QVBoxLayout();
	layout->addWidget(desc_label);
	layout->addSpacing(16);
	layout->addWidget(import_all_check);
	layout->addWidget(delete_unused_symbols_check);
	layout->addWidget(delete_unused_colors_check);
	layout->addSpacing(16);
	layout->addWidget(mapping_label);
	layout->addWidget(preserve_symbol_states_check);
	layout->addWidget(match_by_number_check);
	layout->addWidget(mapping_table);
	layout->addSpacing(16);
	layout->addWidget(button_box);
	setLayout(layout);
	
	connect(match_by_number_check, SIGNAL(clicked(bool)), this, SLOT(matchByNumberClicked(bool)));
	connect(button_box, SIGNAL(helpRequested()), this, SLOT(showHelp()));
	connect(button_box, SIGNAL(accepted()), this, SLOT(apply()));
	connect(button_box, SIGNAL(rejected()), this, SLOT(reject()));
	
	matchByNumberClicked(true);
}
示例#18
0
void FindFileDialog::createButtons()
{
    browseButton = new QToolButton;
    browseButton->setText(tr("..."));
    connect(browseButton, SIGNAL(clicked()), this, SLOT(browse()));

    buttonBox = new QDialogButtonBox(QDialogButtonBox::Open
                                     | QDialogButtonBox::Cancel
                                     | QDialogButtonBox::Help);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(openFile()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(help()));
}
int QDialogButtonBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: clicked((*reinterpret_cast< QAbstractButton*(*)>(_a[1]))); break;
        case 1: accepted(); break;
        case 2: helpRequested(); break;
        case 3: rejected(); break;
        case 4: d_func()->_q_handleButtonClicked(); break;
        case 5: d_func()->_q_handleButtonDestroyed(); break;
        default: ;
        }
        _id -= 6;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break;
        case 1: *reinterpret_cast<int*>(_v) = QFlag(standardButtons()); break;
        case 2: *reinterpret_cast< bool*>(_v) = centerButtons(); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break;
        case 1: setStandardButtons(QFlag(*reinterpret_cast<int*>(_v))); break;
        case 2: setCenterButtons(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_type_t type) :
    WiresharkDialog(parent, cf),
    ui(new Ui::FollowStreamDialog),
    follow_type_(type),
    truncated_(false),
    save_as_(false)
{
    ui->setupUi(this);

    setAttribute(Qt::WA_DeleteOnClose, true);
    memset(&follow_info_, 0, sizeof(follow_info_));
    follow_info_.show_type = SHOW_ASCII;
    follow_info_.show_stream = BOTH_HOSTS;

    ui->teStreamContent->installEventFilter(this);

    // XXX Use recent settings instead
    resize(parent.width() * 2 / 3, parent.height());

    QComboBox *cbcs = ui->cbCharset;
    cbcs->blockSignals(true);
    cbcs->addItem(tr("ASCII"), SHOW_ASCII);
    cbcs->addItem(tr("C Arrays"), SHOW_CARRAY);
    cbcs->addItem(tr("EBCDIC"), SHOW_EBCDIC);
    cbcs->addItem(tr("Hex Dump"), SHOW_HEXDUMP);
    cbcs->addItem(tr("UTF-8"), SHOW_UTF8);
    cbcs->addItem(tr("YAML"), SHOW_YAML);
    cbcs->addItem(tr("Raw"), SHOW_RAW);
    cbcs->blockSignals(false);

    b_filter_out_ = ui->buttonBox->addButton(tr("Hide this stream"), QDialogButtonBox::ActionRole);
    connect(b_filter_out_, SIGNAL(clicked()), this, SLOT(filterOut()));

    b_print_ = ui->buttonBox->addButton(tr("Print"), QDialogButtonBox::ActionRole);
    connect(b_print_, SIGNAL(clicked()), this, SLOT(printStream()));

    b_save_ = ui->buttonBox->addButton(tr("Save as" UTF8_HORIZONTAL_ELLIPSIS), QDialogButtonBox::ActionRole);
    connect(b_save_, SIGNAL(clicked()), this, SLOT(saveAs()));

    ProgressFrame::addToButtonBox(ui->buttonBox, &parent);

    connect(ui->buttonBox, SIGNAL(helpRequested()), this, SLOT(helpButton()));
    connect(ui->teStreamContent, SIGNAL(mouseMovedToTextCursorPosition(int)),
            this, SLOT(fillHintLabel(int)));
    connect(ui->teStreamContent, SIGNAL(mouseClickedOnTextCursorPosition(int)),
            this, SLOT(goToPacketForTextPos(int)));
    connect(&cap_file_, SIGNAL(captureFileClosing()), this, SLOT(captureFileClosing()));

    fillHintLabel(-1);
}
示例#21
0
/* TODO: rename _nonxTupleDB to _isxTupleDB internally and
         set it based on db contents, not command line parameter input
 */
login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, modal ? (fl | Qt::Dialog) : fl)
{
  setObjectName(name);
  Q_INIT_RESOURCE(xTupleCommon);
  setupUi(this);

  //_options = _buttonBox->addButton(tr("Options..."), QDialogButtonBox::ActionRole);
  _recent = _buttonBox->addButton(tr("Recent"), QDialogButtonBox::ActionRole);
  //_options->setEnabled(false);
  _recent->setEnabled(false);
  _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Login"));

  connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sLogin()));
  connect(_buttonBox, SIGNAL(helpRequested()), this, SLOT(sOpenHelp()));
  //connect(_options, SIGNAL(clicked()), this, SLOT(sOptions()));
  connect(_server, SIGNAL(editingFinished()), this, SLOT(sChangeURL()));
  connect(_database, SIGNAL(editTextChanged(QString)), this, SLOT(sChangeURL()));
  connect(_port, SIGNAL(editingFinished()), this, SLOT(sChangeURL()));
  //connect(_otherOption, SIGNAL(toggled(bool)), _options, SLOT(setEnabled(bool)));
  //connect(_otherOption, SIGNAL(toggled(bool)), _recent, SLOT(setEnabled(bool)));
  //connect(_otherOption, SIGNAL(toggled(bool)), this, SLOT(sHandleButton()));

  _splash = 0;

  _captive = false; _nonxTupleDB = false;
  _multipleConnections = false;
  _setSearchPath = false;
  _cloudDatabaseURL= "pgsql://%1.xtuplecloud.com:5432/%1_%2";

  _password->setEchoMode(QLineEdit::Password);

  //updateRecentOptionsActions();
  _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/demo").toString();
  /*
  if(xtsettingsValue("/xTuple/_demoOption", false).toBool())
    _demoOption->setChecked(true);
  else
    _prodOption->setChecked(true);

  if(xtsettingsValue("/xTuple/_cloudOption", false).toBool())
    _cloudOption->setChecked(true);
  else
    _otherOption->setChecked(true);
  _company->setText(xtsettingsValue("/xTuple/cloud_company", "").toString());
  */

  adjustSize();
}
示例#22
0
FirstRunDlg::FirstRunDlg(QWidget* const parent)
    : QWizard(parent),
      d(new Private)
{
    setWizardStyle(QWizard::ClassicStyle);
    setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton
                                                   << QWizard::BackButton
                                                   << QWizard::CancelButton
                                                   << QWizard::NextButton
                                                   << QWizard::FinishButton);

    bool migrateAvailable;

#ifdef Q_OS_LINUX
    ::Kdelibs4Migration migration;

    // If there's a digikamrc file in $KDEHOME/share/config,
    // then we create the migration page in the wizard
    migrateAvailable = !migration.locateLocal("config", QLatin1String("digikamrc")).isEmpty();
#else
    migrateAvailable = false;
#endif

    d->welcomePage    = new WelcomePage(this);    // First assistant page

    if (migrateAvailable)
       d->migrateFromDigikam4Page = new MigrateFromDigikam4Page(this);

    d->collectionPage = new CollectionPage(this);
    d->databasePage   = new DatabasePage(this);
    d->rawPage        = new RawPage(this);
    d->metadataPage   = new MetadataPage(this);
    d->previewPage    = new PreviewPage(this);
    d->openFilePage   = new OpenFilePage(this);
    d->tooltipsPage   = new TooltipsPage(this);

    // NOTE: Added here new assistant pages...

    d->startScanPage  = new StartScanPage(this);  // Last assistant page

    resize(600, 600);

    connect(button(QWizard::FinishButton), SIGNAL(clicked()),
            this, SLOT(slotFinishPressed()));

    connect(this, SIGNAL(helpRequested()),
            this, SLOT(slotHelp()));
}
示例#23
0
LicenseWizard:: LicenseWizard(QWidget *parent)
	: QWizard(parent)
{
	setPage(Page_Intro, new IntroPage);
	setPage(Page_Evaluate, new EvaluatePage);
	setPage(Page_Register, new RegisterPage);
	setPage(Page_Details, new DetailsPage);
	setPage(Page_Conclusion, new ConclusionPage);

	setStartId(Page_Intro);
	setOption(HaveHelpButton, true);
	setPixmap(QWizard::LogoPixmap, QPixmap(":/images/logo.png"));
	setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/watermark.png"));
	
	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
	setWindowTitle("License Wizard");
}
示例#24
0
AuthDialogImpl::AuthDialogImpl(const QString &realm, const QString &user, QWidget *parent)
    : QDialog(parent)
    , m_AuthWidget(new AuthDialogWidget(realm, user, parent))
{
    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);
    mainLayout->addWidget(m_AuthWidget);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help);
    QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()));
    mainLayout->addWidget(buttonBox);
}
FollowStreamDialog::FollowStreamDialog(QWidget *parent, follow_type_t type, capture_file *cf) :
    QDialog(parent),
    ui(new Ui::FollowStreamDialog),
    cap_file_(cf),
    follow_type_(type),
    save_as_(false)
{
    ui->setupUi(this);

    setAttribute(Qt::WA_DeleteOnClose, true);
    memset(&follow_info_, 0, sizeof(follow_info_));

    ui->teStreamContent->installEventFilter(this);

    // XXX Use recent settings instead
    if (parent) {
        resize(parent->width() * 2 / 3, parent->height());
    }

    QComboBox *cbcs = ui->cbCharset;
    cbcs->blockSignals(true);
    cbcs->addItem("ASCII", SHOW_ASCII);
    cbcs->addItem("C Arrays", SHOW_CARRAY);
    cbcs->addItem("EBCDIC", SHOW_EBCDIC);
    cbcs->addItem("Hex Dump", SHOW_HEXDUMP);
    cbcs->addItem("UTF-8", SHOW_RAW);
    cbcs->addItem("YAML", SHOW_YAML);
    cbcs->blockSignals(false);

    b_filter_out_ = ui->buttonBox->addButton(tr("Hide this stream"), QDialogButtonBox::ActionRole);
    connect(b_filter_out_, SIGNAL(clicked()), this, SLOT(filterOut()));

    b_print_ = ui->buttonBox->addButton(tr("Print"), QDialogButtonBox::ActionRole);
    connect(b_print_, SIGNAL(clicked()), this, SLOT(printStream()));

    b_save_ = ui->buttonBox->addButton(tr("Save as..."), QDialogButtonBox::ActionRole);
    connect(b_save_, SIGNAL(clicked()), this, SLOT(saveAs()));

    connect(ui->buttonBox, SIGNAL(helpRequested()), this, SLOT(helpButton()));
    connect(ui->teStreamContent, SIGNAL(mouseMovedToTextCursorPosition(int)),
            this, SLOT(fillHintLabel(int)));
    connect(ui->teStreamContent, SIGNAL(mouseClickedOnTextCursorPosition(int)),
            this, SLOT(goToPacketForTextPos(int)));

    fillHintLabel(-1);
}
示例#26
0
NewWizard::NewWizard(QWidget* p)
	: QWizard(p)
{
	this->setPage(Page_New, new NewPage(this));
	m_matrix_page = new MatrixPage(this);
	this->setPage(Page_Matrix, m_matrix_page);
	this->setStartId(Page_New);

	#ifndef Q_WS_MAC
	setWizardStyle(ModernStyle);
	#endif  
	setOption(HaveHelpButton, true);
	setPixmap(QWizard::LogoPixmap, QPixmap(":/images/logo.png"));
	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
	setWindowTitle(tr("New Session Wizard"));
	vec.clear();
}
示例#27
0
StaticText::StaticText(QGraphicsItem *pItem,QWidget *parent) :
    QDialog(parent)
{
    QGraphicsItem *Item;

    tabWidget = new QTabWidget(this);

    pGeneralDlg = new StaticTextDlg ;
    securitywidget = new SecurityWidget;

    tabWidget->addTab(pGeneralDlg, tr("外观设置"));
    tabWidget->addTab(securitywidget, tr("权限设置"));
    if(pItem)
    {
        //pGeneralDlg->OnDoubleClickInit(pItem);
        //pVisibleDlg->Init(pItem);
        Item = dynamic_cast<StaticTextItem *> (pItem)->Clone();
        pGeneralDlg->OnDoubleClickInit(dynamic_cast<StaticTextItem *> (Item));//外观

        securitywidget->init(dynamic_cast<StaticTextItem *> (Item));//权限
    }
    else
    {
        pGeneralDlg->InitParament();
        securitywidget->init(0);
    }

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));


    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("静态文本"));
    this->setFixedSize(625,510);
    securitywidget->setTouchGroupEnabled(false);
}
VBoxSnapshotDetailsDlg::VBoxSnapshotDetailsDlg (QWidget *aParent)
    : QIWithRetranslateUI <QDialog> (aParent)
{
    /* Apply UI decorations */
    Ui::VBoxSnapshotDetailsDlg::setupUi (this);

    /* Setup mLbThumbnail label */
    mLbThumbnail->setCursor (Qt::PointingHandCursor);
    mLbThumbnail->installEventFilter (this);

    /* Setup mTeDetails browser */
    mTeDetails->viewport()->setAutoFillBackground (false);
    mTeDetails->setFocus();

    /* Setup connections */
    connect (mLeName, SIGNAL (textChanged (const QString&)), this, SLOT (onNameChanged (const QString&)));
    connect (mButtonBox, SIGNAL (helpRequested()), &msgCenter(), SLOT (sltShowHelpHelpDialog()));
}
示例#29
0
QHisTrendDisplayDlg::QHisTrendDisplayDlg(QGraphicsItem *pItem,QWidget *parent) :
        QDialog(parent)
{
    tabWidget = new QTabWidget();
    HisTrendDisplayGenDlg=new QHisTrendDisplayGenDlg;
    HisTrendDisplayPenDlg=new QHisTrendDisplayPenDlg;
    HisTrendDisplayXYDlg=new QHisTrendDisplayXYDlg;
    VisibilityDlg=new QVisibilityDlg;


    datalist = new QStringList();
    int i = 0;
    for (i=0; i <= 200; i++)
    {
        datalist->append("");
    }
    InitAllProperty(pItem);
    tabWidget->addTab(HisTrendDisplayGenDlg, tr("一般"));
    tabWidget->addTab(HisTrendDisplayPenDlg, tr("笔"));
    tabWidget->addTab(HisTrendDisplayXYDlg, tr("XY轴"));
    tabWidget->addTab(VisibilityDlg, tr("显现"));

    buttonBox = new QDialogButtonBox();
    buttonBox->addButton(tr("确定"),QDialogButtonBox::AcceptRole);
    buttonBox->addButton(tr("取消"),QDialogButtonBox::RejectRole);
    buttonBox->addButton(tr("帮助"),QDialogButtonBox::HelpRole);

    // buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
    //                                 | QDialogButtonBox::Cancel);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested ()), this, SLOT(loadHelp()));
    connect(HisTrendDisplayGenDlg, SIGNAL(GenNomberofDataChange()), this, SLOT(ChangePenAmount()));

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);
    this->setWindowTitle(tr("历史趋势图"));

    this->resize(750,530);

}
void
ControlPasswordInputDialog::clicked(QAbstractButton *button)
{
  QDialogButtonBox::StandardButton btn = ui.buttonBox->standardButton(button);
  switch (btn) {
    case QDialogButtonBox::Ok:
    case QDialogButtonBox::Reset:
    case QDialogButtonBox::Cancel:
      done(btn);
      break;

    case QDialogButtonBox::Help:
      emit helpRequested("troubleshooting.password");
      break;

    default:
      break;
  }
}