Start to port it

svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=551054
remotes/origin/kdvi
Laurent Montel 20 years ago
parent ecfa0ef5fd
commit 0d5bd30954
  1. 15
      dviRenderer.cpp
  2. 11
      fontprogress.cpp
  3. 4
      fontprogress.h
  4. 16
      infodialog.cpp
  5. 4
      infodialog.h

@ -163,9 +163,9 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
int pageWidth = page->width();
int pageHeight = page->height();
QImage img(pageWidth, pageHeight, QImage::Format_RGB32);
foreGroundPainter = new QPainter(&img);
foreGroundPainter = new QPainter(&img);
if (foreGroundPainter != 0) {
errorMsg = QString::null;
draw_page();
@ -177,7 +177,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
kDebug(kvs::dvi) << "painter creation failed." << endl;
}
page->setImage(img);
page->isEmpty = false;
if (errorMsg.isEmpty() != true) {
KMessageBox::detailedError(parentWidget,
@ -232,9 +232,10 @@ void dviRenderer::showThatSourceInformationIsPresent()
bool showMsg = config->readEntry( "KDVI-info_on_source_specials", true);
if (showMsg) {
KDialogBase dialog(i18n("KDVI: Information"), KDialogBase::Yes, KDialogBase::Yes, KDialogBase::Yes,
parentWidget, "information", true, true, KStdGuiItem::ok());
KDialog dialog(parentWidget);
dialog.setCaption( i18n("KDVI: Information") );
dialog.setButtons( KDialog::Yes );
dialog.setButtonGuiItem( KDialog::Yes, KStdGuiItem::ok() );
KVBox *topcontents = new KVBox (&dialog);
topcontents->setSpacing(KDialog::spacingHint()*2);
topcontents->setMargin(KDialog::marginHint()*2);
@ -261,7 +262,7 @@ void dviRenderer::showThatSourceInformationIsPresent()
dialog.enableLinkedHelp(true);
dialog.setMainWidget(topcontents);
dialog.enableButtonSeparator(false);
dialog.incInitialSize( extraSize );
dialog.setInitialSize( extraSize );
dialog.exec();
showMsg = !checkbox->isChecked();

@ -23,16 +23,20 @@
* name 'name' and widget flags set to 'f'
*/
fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString& label, const QString& abortTip, const QString& whatsThis, const QString& ttip, QWidget* parent, const QString& name, bool progressbar)
: KDialogBase( parent, "Font Generation Progress Dialog", true, name, Cancel, Cancel, true ),
: KDialog( parent),
TextLabel2(0),
TextLabel1(0),
ProgressBar1(0),
progress(0),
process(0)
{
setCaption( i18n( "Font Generation Progress Dialog" ) );
setModal( true );
setButtons( Cancel );
setDefaultButton( Cancel );
setCursor(QCursor(Qt::WaitCursor));
setButtonCancel(KGuiItem(i18n("Abort"), "stop", abortTip));
setButtonGuiItem(Cancel, KGuiItem(i18n("Abort"), "stop", abortTip));
if (helpIndex.isEmpty() == false) {
setHelp(helpIndex, "kdvi");
@ -41,7 +45,8 @@ fontProgressDialog::fontProgressDialog(const QString& helpIndex, const QString&
} else
enableLinkedHelp(false);
KVBox* page = makeVBoxMainWidget();
KVBox* page = new KVBox( this );
setMainWidget( page );
TextLabel1 = new QLabel(label, page);
TextLabel1->setAlignment(Qt::AlignCenter);

@ -8,7 +8,7 @@
#ifndef FONT_GENERATION_H
#define FONT_GENERATION_H
#include <kdialogbase.h>
#include <kdialog.h>
#include <QPointer>
@ -29,7 +29,7 @@ class QProcess;
*
*
**/
class fontProgressDialog : public KDialogBase
class fontProgressDialog : public KDialog
{
Q_OBJECT

@ -22,7 +22,7 @@
infoDialog::infoDialog( QWidget* parent )
: KDialogBase( Tabbed, "Document Info", Ok, Ok, parent, "Document Info", false, false),
: KPageDialog( parent),
TextLabel1(0),
TextLabel2(0),
TextLabel3(0),
@ -30,7 +30,12 @@ infoDialog::infoDialog( QWidget* parent )
headline(QString::null),
pool(QString::null)
{
QFrame *page1 = addPage( i18n("DVI File") );
setCaption( i18n( "Document Info" ) );
setButtons( Ok );
setModal( false );
setFaceType( KPageDialog::Tabbed );
QFrame *page1 = new QFrame( this );
addPage( page1, i18n("DVI File") );
QVBoxLayout *topLayout1 = new QVBoxLayout( page1 );
topLayout1->setSpacing( 6 );
topLayout1->setMargin( 0 );
@ -39,7 +44,9 @@ infoDialog::infoDialog( QWidget* parent )
TextLabel1->setToolTip( i18n("Information on the currently loaded DVI-file.") );
topLayout1->addWidget( TextLabel1 );
QFrame *page2 = addPage( i18n("Fonts") );
QFrame *page2 = new QFrame( this );
addPage( page2, i18n("Fonts") );
QVBoxLayout *topLayout2 = new QVBoxLayout( page2 );
topLayout2->setSpacing( 6 );
topLayout2->setMargin( 0 );
@ -52,7 +59,8 @@ infoDialog::infoDialog( QWidget* parent )
"This is useful for experts who want to locate problems in the setup of TeX or KDVI.") );
topLayout2->addWidget( TextLabel2 );
QFrame *page3 = addPage( i18n("External Programs") );
QFrame *page3 = new QFrame( this );
addPage( page3, i18n("External Programs") );
QVBoxLayout *topLayout3 = new QVBoxLayout( page3 );
topLayout3->setSpacing( 6 );
topLayout3->setMargin( 0 );

@ -7,7 +7,7 @@
#ifndef INFO_KDVI_H
#define INFO_KDVI_H
#include <kdialogbase.h>
#include <kpagedialog.h>
#include <QString>
@ -17,7 +17,7 @@ class QTextEdit;
class QWidget;
class infoDialog : public KDialogBase
class infoDialog : public KPageDialog
{
Q_OBJECT

Loading…
Cancel
Save