Ejemplo n.º 1
0
void NewProtocol::pageChanged(const QString&)
{
    if (currentPage() == m_connectWnd){
        emit apply();
        m_bConnect = true;
        unsigned status = CorePlugin::m_plugin->getManualStatus();
        if (status == STATUS_OFFLINE)
            status = STATUS_ONLINE;
        m_client->setStatus(status, false);
        m_connectWnd->setConnecting(true);
        setBackEnabled(m_connectWnd, false);
        setNextEnabled(currentPage(), false);
        setFinishEnabled(m_connectWnd, false);
    }
    if (m_last && (currentPage() == m_last)){
        setFinishEnabled(m_connectWnd, false);
        cancelButton()->show();
        backButton()->show();
        finishButton()->hide();
        showPage(protocolPage);
        protocolChanged(0);
    }
}
Ejemplo n.º 2
0
void MythWizard::updateButtons()
{
    if ( !d->current )
        return;

    int i;
    for( i = 0; i < d->pages.size() && d->pages[i] != d->current; i++ );
    bool notFirst( false );
    if ( i ) {
        i--;
        while( ( i >= 0 ) && !notFirst ) {
            notFirst |= appropriate( d->pages[i]->w );
            i--;
        }
    }
    setBackEnabled( d->current->backEnabled && notFirst );
    setNextEnabled( d->current->nextEnabled );
    d->finishButton->setEnabled( d->current->finishEnabled );

    if ( ( d->current->finishEnabled && !d->finishButton->isVisible() ) ||
         ( d->current->backEnabled && !d->backButton->isVisible() ) ||
         ( d->current->nextEnabled && !d->nextButton->isVisible() ) )
        layOut();
}
Ejemplo n.º 3
0
SaveThemeDialog::SaveThemeDialog(QWidget * pParent)
: KviTalWizard(pParent)
{
	setWindowTitle(__tr2qs_ctx("Save Current Theme - KVIrc","theme"));
	setMinimumSize(400,350);

	KviThemeInfo info;
	info.load(KVI_OPTION_STRING(KviOption_stringIconThemeSubdir),KviThemeInfo::Auto);

	// welcome page ==================================================================================
	QWidget * pPage = new QWidget(this);
	QGridLayout * pLayout = new QGridLayout(pPage);

	QLabel * pLabel = new QLabel(pPage);
	pLabel->setWordWrap(true);
	QString szText = "<p>";
	szText += __tr2qs_ctx("This procedure allows you to save the current theme settings to a single directory. It is useful if you want to apply other themes or play with the theme settings and later come back to this theme with a single click. It will also allow you to manually modify the theme settings and later export them to a distributable package.","theme");
	szText += "</p><p>";
	szText += __tr2qs_ctx("You will be asked to provide a theme name, a description and, if you want, a screenshot.","theme");
	szText += "</p><p>";
	szText += __tr2qs_ctx("Hit the \"Next\" button to begin.","theme");
	szText += "<p>";

	pLabel->setText(szText);
	pLayout->addWidget(pLabel,0,0);
	pLayout->setRowStretch(1,1);

	addPage(pPage,__tr2qs_ctx("Welcome","theme"));
	setBackEnabled(pPage,false);
	setNextEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setFinishEnabled(pPage,false);

	// packager information ================================================================================

	pPage = new QWidget(this);
	pLayout = new QGridLayout(pPage);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Here you need to provide information about you (the author) and a short description of the theme you're creating.","theme"));
	pLabel->setWordWrap(true);
	pLabel->setTextFormat(Qt::RichText);
	pLayout->addWidget(pLabel,0,0,1,2);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Theme Name:","theme"));
	pLayout->addWidget(pLabel,1,0);

	m_pThemeNameEdit = new QLineEdit(pPage);
	m_pThemeNameEdit->setText(info.name());
	pLayout->addWidget(m_pThemeNameEdit,1,1);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Version:","theme"));
	pLayout->addWidget(pLabel,2,0);

	m_pThemeVersionEdit = new QLineEdit(pPage);
	m_pThemeVersionEdit->setText(info.version());
	QRegExp rx("\\d{1,2}\\.\\d{1,2}(\\.\\d{1,2})?");
	QValidator *validator = new QRegExpValidator(rx, this);
	m_pThemeVersionEdit->setValidator(validator);

	pLayout->addWidget(m_pThemeVersionEdit,2,1);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Description:","theme"));
	pLayout->addWidget(pLabel,3,0);

	m_pThemeDescriptionEdit = new QTextEdit(pPage);
	m_pThemeDescriptionEdit->setText(info.description());
	pLayout->addWidget(m_pThemeDescriptionEdit,3,1);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Theme Author:","theme"));
	pLayout->addWidget(pLabel,4,0);

	m_pAuthorNameEdit = new QLineEdit(pPage);
	m_pAuthorNameEdit->setText(info.author());
	pLayout->addWidget(m_pAuthorNameEdit,4,1);


	pLayout->setRowStretch(3,1);
	pLayout->setColumnStretch(1,1);

	addPage(pPage,__tr2qs_ctx("Theme Information","theme"));
	setBackEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setNextEnabled(pPage,true);
	setFinishEnabled(pPage,false);

	// screenshot/logo/icon ================================================================================

	pPage = new QWidget(this);
	pLayout = new QGridLayout(pPage);

	pLabel = new QLabel(pPage);
	pLabel->setText(__tr2qs_ctx("Here you can either choose a screenshot image from disk or make one now. The screenshot will be displayed in the tooltips of the theme management dialog and will be also visible in the package installation dialog if you will export the theme to a distributable package.","theme"));
	pLabel->setWordWrap(true);
	pLabel->setTextFormat(Qt::RichText);
	pLayout->addWidget(pLabel,0,0);

	m_pImageLabel = new QLabel(pPage);
	m_pImageLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
	m_pImageLabel->setMinimumSize(300,225);
	m_pImageLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
	pLayout->addWidget(m_pImageLabel,1,0);

	m_pImageSelector = new KviFileSelector(pPage,"",&m_szScreenshotPath,true,0,KVI_FILTER_IMAGE);
	connect(m_pImageSelector,SIGNAL(selectionChanged(const QString &)),this,SLOT(imageSelectionChanged(const QString &)));
	pLayout->addWidget(m_pImageSelector,2,0);

	QPushButton * pButton = new QPushButton(pPage);
	pButton->setText(__tr2qs_ctx("Make Screenshot Now","theme"));
	connect(pButton,SIGNAL(clicked()),this,SLOT(makeScreenshot()));
	pLayout->addWidget(pButton,3,0);

	pLayout->setRowStretch(1,1);

	m_pImageSelectionPage = pPage;
	addPage(pPage,__tr2qs_ctx("Screenshot","theme"));
	setBackEnabled(pPage,true);
	setHelpEnabled(pPage,false);
	setNextEnabled(pPage,true);
	setFinishEnabled(pPage,true);
}
Ejemplo n.º 4
0
void CDPWizard::formSelected(const QString  &thePageNameQString)
{
    QString myQString;
    QLineEdit *myLineEdit;

    if (thePageNameQString==tr("Raw data file selection"))
    {
#ifdef QGISDEBUG
        std::cout << "Opening Raw Data File Selection page" << std::endl;
#endif

        checkInputFilenames();
    }

    if (thePageNameQString==tr("File type and variables")) //we do this after leaving the file selection page
    {

        //#ifdef QGISDEBUG
        std::cout << "Leaving file selection page" << std::endl;
        //#endif
        /** @todo Add some checking to make sure each file exists and is readable and valid for its type */
        climateDataProcessor->setMeanTempFileName(leMeanTemp->text());
        climateDataProcessor->setMinTempFileName(leMinTemp->text());
        climateDataProcessor->setMaxTempFileName(leMaxTemp->text());
        climateDataProcessor->setDiurnalTempFileName(leDiurnalTemp->text());
        climateDataProcessor->setMeanPrecipFileName(leMeanPrecipitation->text());
        climateDataProcessor->setFrostDaysFileName(leFrostDays->text());
        climateDataProcessor->setTotalSolarRadFileName(leTotalSolarRadiation->text());

        //turn off next button until one or more variables have been selected
        setNextEnabled(currentPage(), false);


        /////////////////////////////////////////////////////////////////////
        //
        // OK now we need to update the list of available calculations that
        //                       can be carried out.
        //
        /////////////////////////////////////////////////////////////////////
        //
        // get the input file type
        //
        climateDataProcessor->setInputFileType("GDAL Supported Raster");
        //Should not need to have the next line here - it slows everythinf down!
        //climateDataProcessor->makeFileGroups();
        //#ifdef QGISDEBUG

        std::cout << "Getting available calculations list" << std::endl;
        //#endif

        climateDataProcessor->makeAvailableCalculationsMap();
        // and then update the list box

        //List the calculations in  availableCalculationsMap  using an iterator
        QMap<QString, bool> myAvailableCalculationsMap = climateDataProcessor->getAvailableCalculationsMap();
        QMap<QString, bool>::const_iterator myIter;
        //#ifdef QGISDEBUG

        std::cout << myAvailableCalculationsMap.size() << " available calculations in list which are:" << std::endl;
        std::cout << climateDataProcessor->getDescription() << std::endl;
        //#endif
        //clear the current entries from the box
        lstVariablesToCalc->clear();
        for (myIter=myAvailableCalculationsMap.begin(); myIter != myAvailableCalculationsMap.end(); myIter++)
        {
            if (myIter.data())
            {
                //#ifdef QGISDEBUG
                std::cout << myIter.key() << QString(": true\n");
                //#endif

                //need to add some logic here to select the inserted item
                lstVariablesToCalc->insertItem(myIter.key());
            }
            else
            {
#ifdef QGISDEBUG
                std::cout << myIter->first <<  QString(": false\n");
#endif

                //need to add some logic here to select the inserted item
                lstVariablesToCalc->insertItem(myIter.key());
            }
        }
    } //end of test for page 3

    if (thePageNameQString==tr("Output destination")) //we do this after leaving the file type and variables page
    {

    }



    if (thePageNameQString==tr("Summary of processing to be performed")) //we do this when  we arrive at the summary of variables to be calculated
    {
        //update the summary of vars to calculate
        txtVariableSummary->clear();
        for ( unsigned int i = 0; i < lstVariablesToCalc->count(); i++ )
        {
            QListBoxItem *item = lstVariablesToCalc->item( i );
            // if the item is selected...
            if ( item->isSelected() )
            {
                // increment the count of selected items
                txtVariableSummary->append(item->text());
            }
        }

        //update the output file format summary box
        leInputFormatSummary->setText("GDAL Supported Raster");

        //update the file output path box
        leOutputPathSummary->setText(leOutputPath->text());

        txtInputFileSummary->clear();
        txtInputFileSummary->append(leMeanTemp->text());
        txtInputFileSummary->append(leMinTemp->text());
        txtInputFileSummary->append(leMaxTemp->text());
        txtInputFileSummary->append(leDiurnalTemp->text());
        txtInputFileSummary->append(leMeanPrecipitation->text());
        txtInputFileSummary->append(leMeanPrecipitation->text());
        txtInputFileSummary->append(leFrostDays->text());
        txtInputFileSummary->append(leTotalSolarRadiation->text());
    } //end of test for page 5

    if (thePageNameQString==tr("Progress")) //we do this when we start the calculation
    {
        qApp->processEvents();
        run();
    }
} //end of formSelected
Ejemplo n.º 5
0
void
ReplaceWidget::onPartitionSelected()
{
    if ( Calamares::JobQueue::instance()->globalStorage()->value( "firmwareType" ) == "efi" )
        m_isEfi = true;

    if ( m_ui->partitionTreeView->currentIndex() == QModelIndex() )
    {
        updateStatus( CalamaresUtils::PartitionPartition,
                      tr( "Select where to install %1.<br/>"
                          "<font color=\"red\">Warning: </font>this will delete all files "
                          "on the selected partition." )
                          .arg( *Calamares::Branding::VersionedName ) );
        setNextEnabled( false );
        return;
    }

    bool ok = false;
    double requiredSpaceB = Calamares::JobQueue::instance()
                            ->globalStorage()
                            ->value( "requiredStorageGB" )
                            .toDouble( &ok ) * 1024 * 1024 * 1024;

    PartitionModel* model = qobject_cast< PartitionModel* >( m_ui->partitionTreeView->model() );
    if ( model && ok )
    {
        const QStringList osproberLines = Calamares::JobQueue::instance()
                                    ->globalStorage()
                                    ->value( "osproberLines" ).toStringList();

        Partition* partition = model->partitionForIndex( m_ui->partitionTreeView->currentIndex() );
        if ( !partition ||
             partition->state() != Partition::StateNone )
        {
            updateStatus( CalamaresUtils::Fail,
                          tr( "The selected item does not appear to be a valid partition." ) );
            setNextEnabled( false );
            return;
        }

        if ( partition->roles().has( PartitionRole::Unallocated ) )
        {
            updateStatus( CalamaresUtils::Fail,
                          tr( "%1 cannot be installed on empty space. Please select an "
                              "existing partition." )
                          .arg( *Calamares::Branding::VersionedName ) );
            setNextEnabled( false );
            return;
        }

        if ( partition->roles().has( PartitionRole::Extended ) )
        {
            updateStatus( CalamaresUtils::Fail,
                          tr( "%1 cannot be installed on an extended partition. Please select an "
                              "existing primary or logical partition." )
                          .arg( *Calamares::Branding::VersionedName ) );
            setNextEnabled( false );
            return;
        }

        if ( partition->partitionPath().isEmpty() )
        {
            updateStatus( CalamaresUtils::Fail,
                          tr( "%1 cannot be installed on this partition." )
                          .arg( *Calamares::Branding::VersionedName ) );
            setNextEnabled( false );
            return;
        }

        QString prettyName = tr( "Data partition (%1)" )
                             .arg( partition->fileSystem().name() );
        for ( const QString& line : osproberLines )
        {
            QStringList lineColumns = line.split( ':' );

            QString path = lineColumns.value( 0 ).simplified();
            if ( path == partition->partitionPath() )
            {
                QString osName;
                if ( !lineColumns.value( 1 ).simplified().isEmpty() )
                    osName = lineColumns.value( 1 ).simplified();
                else if ( !lineColumns.value( 2 ).simplified().isEmpty() )
                    osName = lineColumns.value( 2 ).simplified();

                if ( osName.isEmpty() )
                {
                    prettyName = tr( "Unknown system partition (%1)" )
                                 .arg( partition->fileSystem().name() );
                }
                else
                {
                    prettyName = tr ( "%1 system partition (%2)" )
                                 .arg( osName.replace( 0, 1, osName.at( 0 ).toUpper() ) )
                                 .arg( partition->fileSystem().name() );
                }
                break;
            }
        }

        if ( partition->capacity() < requiredSpaceB )
        {
            updateStatus( CalamaresUtils::Fail,
                          tr( "<strong>%4</strong><br/><br/>"
                              "The partition %1 is too small for %2. Please select a partition "
                              "with capacity at least %3 GiB." )
                          .arg( partition->partitionPath() )
                          .arg( *Calamares::Branding::VersionedName )
                          .arg( requiredSpaceB / ( 1024. * 1024. * 1024. ),
                                0, 'f', 1 )
                          .arg( prettyName ) );
            setNextEnabled( false );
            return;
        }

        m_ui->bootComboBox->hide();
        m_ui->bootComboBox->clear();
        m_ui->bootStatusLabel->hide();
        m_ui->bootStatusLabel->clear();

        if ( m_isEfi )
        {
            QList< Partition* > efiSystemPartitions = m_core->efiSystemPartitions();
            if ( efiSystemPartitions.count() == 0 )
            {
                updateStatus( CalamaresUtils::Fail,
                              tr( "<strong>%2</strong><br/><br/>"
                                  "An EFI system partition cannot be found anywhere "
                                  "on this system. Please go back and use manual "
                                  "partitioning to set up %1." )
                              .arg( *Calamares::Branding::ShortProductName )
                              .arg( prettyName ) );
                setNextEnabled( false );
            }
            else if ( efiSystemPartitions.count() == 1 )
            {
                updateStatus( CalamaresUtils::PartitionPartition,
                              tr( "<strong>%3</strong><br/><br/>"
                                  "%1 will be installed on %2.<br/>"
                                  "<font color=\"red\">Warning: </font>all data on partition "
                                  "%2 will be lost.")
                                .arg( *Calamares::Branding::VersionedName )
                                .arg( partition->partitionPath() )
                                .arg( prettyName ) );
                m_ui->bootStatusLabel->show();
                m_ui->bootStatusLabel->setText(
                    tr( "The EFI system partition at %1 will be used for starting %2." )
                        .arg( efiSystemPartitions.first()->partitionPath() )
                        .arg( *Calamares::Branding::ShortProductName ) );
                setNextEnabled( true );
            }
            else
            {
                updateStatus( CalamaresUtils::PartitionPartition,
                              tr( "<strong>%3</strong><br/><br/>"
                                  "%1 will be installed on %2.<br/>"
                                  "<font color=\"red\">Warning: </font>all data on partition "
                                  "%2 will be lost.")
                                .arg( *Calamares::Branding::VersionedName )
                                .arg( partition->partitionPath() )
                                .arg( prettyName ) );
                m_ui->bootStatusLabel->show();
                m_ui->bootStatusLabel->setText( tr( "EFI system partition:" ) );
                m_ui->bootComboBox->show();
                for ( int i = 0; i < efiSystemPartitions.count(); ++i )
                {
                    Partition* efiPartition = efiSystemPartitions.at( i );
                    m_ui->bootComboBox->addItem( efiPartition->partitionPath(), i );
                    if ( efiPartition->devicePath() == partition->devicePath() &&
                         efiPartition->number() == 1 )
                        m_ui->bootComboBox->setCurrentIndex( i );
                }
                setNextEnabled( true );
            }
        }
        else
        {
            updateStatus( CalamaresUtils::PartitionPartition,
                          tr( "<strong>%3</strong><br/><br/>"
                              "%1 will be installed on %2.<br/>"
                              "<font color=\"red\">Warning: </font>all data on partition "
                              "%2 will be lost.")
                            .arg( *Calamares::Branding::VersionedName )
                            .arg( partition->partitionPath() )
                            .arg( prettyName ) );
            setNextEnabled( true );
        }
    }
}
Ejemplo n.º 6
0
void NewProtocol::okEnabled(bool bEnable)
{
    setNextEnabled(m_setup, bEnable);
}
Ejemplo n.º 7
0
void CODBCCreate::dl_click( QListViewItem *item )
#endif
{
	current_driver = item->text( 0 );
	setNextEnabled( box1, TRUE );
}
Ejemplo n.º 8
0
void RegistrationWizard::realNameChanged(const QString &)
{
	QString tmp = m_pEditRealName->text();
	setNextEnabled(m_pPage1,!(tmp.isEmpty() || tmp.isNull()));
}
Ejemplo n.º 9
0
ConnectionWizard::ConnectionWizard(bool o, StrGlobal *g, RouteInfo *r)
	: ConnectionWizardBase()
{
	out = o;
	global = g;
	route = *r;
	rptr = r;
	
	rtype = None;
	pto = NULL;
	
	RSItemIO *io = r->getToIO();
	
	if (io)
	{
		RSItemBaseWithType *owner = (RSItemBaseWithType *)io->getOwner();
		switch (owner->type())
		{
			case RSItemBaseWithType::In:
				rtype = In;
				break;
			case RSItemBaseWithType::Out:
				rtype = Out;
				break;
			case RSItemBaseWithType::FX:
				rtype = FX;
				break;
			case RSItemBaseWithType::Patch:
				if (io->isOutput())
					rtype = POut;
				else
					rtype = PIn;
				pto = (StrPatch *)owner;
				break;
			default:
				break;
		}
	}

	if (!out)
	{
		rbOutput->hide();
	}
	else
	{
		rbFX->hide();
		rbInput->hide();
	}
	
	StrPatch *patch;
	
	lbPatch->clear();
	for(patch = global->Patches.first(); patch; patch = global->Patches.next() )
	{
		lbPatch->insertItem(patch->name());
		patchList.append(patch);
	}
	
	connect(rbNone, SIGNAL(clicked()), this, SLOT(noneClicked()));
	connect(rbFX, SIGNAL(clicked()), this, SLOT(fxClicked()));
	connect(rbInput, SIGNAL(clicked()), this, SLOT(inClicked()));
	connect(rbOutput, SIGNAL(clicked()), this, SLOT(outClicked()));
	connect(rbPatch, SIGNAL(clicked()), this, SLOT(patchClicked()));
	
	connect(lbPatch, SIGNAL(clicked(QListBoxItem *)), this, SLOT(patchListClicked(QListBoxItem *)));
	connect(lbEnd, SIGNAL(clicked(QListBoxItem *)), this, SLOT(endListClicked(QListBoxItem *)));
	
	connect(finishButton(), SIGNAL(clicked()), this, SLOT(finishClicked()));
	
	connect(this, SIGNAL(selected(const QString &)), this, SLOT(selected(const QString &)));
	helpButton()->hide();
	
	setFinishEnabled(pageType, true);
	setNextEnabled(pageType, true);
	setFinishEnabled(pagePatch, true);
	setNextEnabled(pagePatch, true);
	setFinishEnabled(pageEnd, true);
	setNextEnabled(pageEnd, true);
}