KPrHtmlExportDialog::KPrHtmlExportDialog(const QList<KoPAPageBase*> &slides, const QString &title, const QString &author, QWidget *parent)
: KDialog(parent)
, m_allSlides(slides)
, m_title(title)
{
    QWidget *widget = new QWidget(this);
    ui.setupUi(widget);
    setMainWidget(widget);
    setCaption( i18n("Html Export"));
    setButtonText(Ok, i18n("Export"));
    ui.klineedit_title->setText(m_title);
    ui.klineedit_author->setText(author);

    connect(ui.kpushbuttonBrowseTemplate, SIGNAL(clicked()), this, SLOT(browserAction()));

    connect(&preview, SIGNAL(loadFinished(bool)), this, SLOT(renderPreview()));
    connect(ui.klineedit_title, SIGNAL(editingFinished()), this, SLOT(generatePreview()));
    connect(ui.klineedit_author, SIGNAL(editingFinished()), this, SLOT(generatePreview()));
    connect(ui.kListBox_slides, SIGNAL(currentRowChanged(int)), this, SLOT(generatePreview(int)));
    connect(ui.kcombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(generatePreview()));
    connect(ui.kPushButton_selectAll, SIGNAL(clicked()), this, SLOT(checkAllItems()));
    connect(ui.kPushButton_deselectAll, SIGNAL(clicked()), this, SLOT(uncheckAllItems()));
    connect(ui.toolButton_previous, SIGNAL(clicked()), this, SLOT(generatePrevious()));
    connect(ui.toolButton_next, SIGNAL(clicked()), this, SLOT(generateNext()));
    connect(ui.kPushButton_Favorite, SIGNAL(clicked()), this, SLOT(favoriteAction()));
    connect(ui.kcombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateFavoriteButton()));

    this->updateFavoriteButton();
    this->frameToRender = 0;
    this->generateSlidesNames(slides);
    this->loadTemplatesList();
    this->generatePreview();
}
void CharSelectEnhanced::newCharClass(int c)
{
//     tDebug("newCharClass start");
	m_characterClass = usedCharClasses[c];
	generatePreview(m_characterClass);
//     tDebug("newCharClass end");
}
Exemple #3
0
void KgColors::slotDisable()
{
    bool enabled = generals->find("KDE Default")->isChecked();

    importBtn->setEnabled(!enabled);
    exportBtn->setEnabled(!enabled);

    for (int i = 0; i < labelList.count() && i < endOfPanelColors ; i++)
        labelList.at(i)->setEnabled(!enabled);

    for (int j = 0; j < itemList.count() && j < endOfPanelColors ; j++)
        itemList.at(j)->setEnabled(!enabled);

    generals->find("Enable Alternate Background")->setEnabled(enabled);
    generals->find("Show Current Item Always")->setEnabled(!enabled);
    generals->find("Dim Inactive Colors")->setEnabled(!enabled);

    bool dimmed = !enabled && generals->find("Dim Inactive Colors")->isChecked();
    if (dimmed)
        inactiveColorStack->setCurrentWidget(dimmedInactiveWidget);
    else
        inactiveColorStack->setCurrentWidget(normalInactiveWidget);

    enabled = enabled || !generals->find("Show Current Item Always")->isChecked();

    getColorSelector("Inactive Current Foreground")->setEnabled(!enabled);
    getColorSelector("Inactive Current Background")->setEnabled(!enabled);

    generatePreview();
}
Exemple #4
0
void TabSwitchWidget::next()
{
    if(m_buttons.empty())
        return;

    m_buttons[m_active++]->setChecked(false);

    if((size_t)m_active >= m_buttons.size())
        m_active = 0;

    m_buttons[m_active]->setChecked(true);
    ui->scrollArea->ensureWidgetVisible(m_buttons[m_active]);

    int idx = m_buttons[m_active]->property("tabIndex").toInt();
    generatePreview(idx);
}
void CharSelectEnhanced::newFont(int font)
{
//     tDebug("newFont start");
	QString oldFont(m_fontInUse);
	m_fontInUse = fontSelector->itemText(font);
	if (!m_fontInUse.isEmpty())
	{
		m_charTableModel->setFontInUse(m_fontInUse);
		(*m_doc->AllFonts)[m_fontInUse].increaseUsage();
		if (!oldFont.isEmpty())
			(*m_doc->AllFonts)[oldFont].decreaseUsage();
		delEdit();
		scanFont();
		generatePreview(0);
		m_characterClass = 0;
		setupRangeCombo();
	}
//     tDebug("newFont end");
}
Exemple #6
0
void KgColors::slotImportColors()
{
    // find $KDEDIR/share/apps/krusader
    QString basedir= QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("total_commander.keymap"));
    basedir = QFileInfo(basedir).absolutePath();
    // let the user select a file to load
    QString file = QFileDialog::getOpenFileName(0, i18n("Select a color-scheme file"), basedir, QStringLiteral("*.color"));
    if (file.isEmpty()) {
        return;
    }
    QFile f(file);
    if (!f.open(QIODevice::ReadOnly)) {
        KMessageBox::error(this, i18n("Error: unable to read from file"), i18n("Error"));
        return;
    }
    QDataStream stream(&f);
    // ok, import away
    deserialize(stream);
    generatePreview();
}
Exemple #7
0
void K3bVideoDVDRippingPreview::slotTranscodeFinished( KProcess* )
{
  // read the image
  QString filename = m_tempDir->name() + "000000.ppm";// + tempQDir->entryList( QDir::Files ).first();
  kdDebug() << "(K3bVideoDVDRippingPreview) reading from file " << filename << endl;
  m_preview = QImage( filename );
  bool success = !m_preview.isNull() && !m_canceled;

  // remove temp files
  delete m_tempDir;
  m_tempDir = 0;

  // clean up
  delete m_process;
  m_process = 0;

  // retry the first chapter in case another failed
  if( !success && m_chapter > 1 )
    generatePreview( m_dvd, m_title, 1 );
  else
    emit previewDone( success );
}
Exemple #8
0
int KgColors::addColorSelector(QString cfgName, QString name, QColor dflt, QString dfltName,
                               ADDITIONAL_COLOR *addColor, int addColNum)
{
    int index = itemList.count() - offset;

    labelList.append(addLabel(colorsGrid, index, 0, name, colorsGrp));
    KonfiguratorColorChooser *chooser = createColorChooser("Colors", cfgName, dflt, colorsGrp, false, addColor, addColNum);
    chooser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

    if (!dfltName.isEmpty())
        chooser->setDefaultText(dfltName);

    colorsGrid->addWidget(chooser, index, 1);

    connect(chooser, SIGNAL(colorChanged()), this, SLOT(generatePreview()));
    if (!offset)
        connect(chooser, SIGNAL(colorChanged()), this, SLOT(slotActiveChanged()));

    itemList.append(chooser);
    itemNames.append(cfgName);

    return index;
}
void KPrHtmlExportDialog::generateNext()
{
    generatePreview(++frameToRender);
}
void KPrHtmlExportDialog::generatePrevious()
{
    generatePreview(--frameToRender);
}