From 47d455dd55be855e4cc691c32f687f723d9247ee Mon Sep 17 00:00:00 2001
From: toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>
Date: Wed, 25 Nov 2009 17:56:58 +0000
Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
 BUG:215923

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
---
 kdvi/fontprogress.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 kdvi/fontprogress.cpp

(limited to 'kdvi/fontprogress.cpp')

diff --git a/kdvi/fontprogress.cpp b/kdvi/fontprogress.cpp
new file mode 100644
index 00000000..3935ceba
--- /dev/null
+++ b/kdvi/fontprogress.cpp
@@ -0,0 +1,104 @@
+// fontprogress.cpp
+//
+// (C) 2001--2004 Stefan Kebekus
+// Distributed under the GPL
+
+#include <config.h>
+
+#include "fontprogress.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kprocio.h>
+#include <kprogress.h>
+#include <qapplication.h>
+#include <qframe.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+#include <qvbox.h>
+
+/* 
+ *  Constructs a fontProgressDialog which is a child of 'parent', with the 
+ *  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 )
+{
+  setCursor( QCursor( 3 ) );
+
+  setButtonCancel(KGuiItem(i18n("Abort"), "stop", abortTip));
+
+  if (helpIndex.isEmpty() == false) {
+    setHelp(helpIndex, "kdvi");
+    setHelpLinkText( i18n( "What's going on here?") ); 
+    enableLinkedHelp(true);
+  } else
+    enableLinkedHelp(false);
+
+  QVBox *page = makeVBoxMainWidget();
+
+  TextLabel1   = new QLabel( label, page, "TextLabel2" );
+  TextLabel1->setAlignment( int( QLabel::AlignCenter ) );
+  QWhatsThis::add( TextLabel1, whatsThis );
+  QToolTip::add( TextLabel1, ttip );
+
+  if (progressbar) {
+    ProgressBar1 = new KProgress( page, "ProgressBar1" );
+    ProgressBar1->setFormat(i18n("%v of %m"));
+    QWhatsThis::add( ProgressBar1, whatsThis );
+    QToolTip::add( ProgressBar1, ttip );
+  } else 
+    ProgressBar1 = NULL;
+  
+  TextLabel2   = new QLabel( "", page, "TextLabel2" );
+  TextLabel2->setAlignment( int( QLabel::AlignCenter ) );
+  QWhatsThis::add( TextLabel2, whatsThis );
+  QToolTip::add( TextLabel2, ttip );
+
+  progress = 0;
+  procIO = 0;
+  qApp->connect(this, SIGNAL(finished()), this, SLOT(killProcIO()));
+}
+
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+
+fontProgressDialog::~fontProgressDialog()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+
+void fontProgressDialog::increaseNumSteps(const QString& explanation)
+{
+  if (ProgressBar1 != 0)
+    ProgressBar1->setProgress(progress++);
+  TextLabel2->setText( explanation );
+}
+
+
+void fontProgressDialog::setTotalSteps(int steps, KProcIO *proc)
+{
+  procIO = proc;
+  if (ProgressBar1 != 0) {
+    ProgressBar1->setTotalSteps(steps);
+    ProgressBar1->setProgress(0);
+  }
+  progress = 0;
+}
+
+
+void fontProgressDialog::killProcIO()
+{
+  if (!procIO.isNull())
+    procIO->kill();
+}
+
+
+#include "fontprogress.moc"
-- 
cgit v1.2.1