diff --git a/kcms/kfontinst/kcmfontinst/FontFilter.h b/kcms/kfontinst/kcmfontinst/FontFilter.h --- a/kcms/kfontinst/kcmfontinst/FontFilter.h +++ b/kcms/kfontinst/kcmfontinst/FontFilter.h @@ -31,7 +31,6 @@ class QLabel; class QMenu; class QActionGroup; -class KAction; namespace KFI { diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.h b/kcms/kfontinst/kcmfontinst/KCmFontInst.h --- a/kcms/kfontinst/kcmfontinst/KCmFontInst.h +++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.h @@ -32,12 +32,12 @@ #include #include -class KPushButton; -class KProgressDialog; +class QPushButton; +class QProgressDialog; class QTemporaryDir; class KToggleAction; class KActionMenu; -class KAction; +class QAction; class QLabel; class QMenu; class QProcess; @@ -118,24 +118,24 @@ CGroupList *itsGroupList; CGroupListView *itsGroupListView; KActionMenu *itsToolsMenu; - KPushButton *itsDeleteGroupControl, + QPushButton *itsDeleteGroupControl, *itsEnableGroupControl, *itsDisableGroupControl, *itsAddFontControl, *itsDeleteFontControl; CFontFilter *itsFilter; QString itsLastStatusBarMsg; KIO::Job *itsJob; - KProgressDialog *itsProgress; + QProgressDialog *itsProgress; CUpdateDialog *itsUpdateDialog; QTemporaryDir *itsTempDir; QProcess *itsPrintProc; QSet itsDeletedFonts; QList itsModifiedUrls; CJobRunner *itsRunner; QMenu *itsPreviewMenu, *itsPreviewListMenu; - KAction *itsDownloadFontsAct; + QAction *itsDownloadFontsAct; QWidget *itsPreviewWidget; bool itsPreviewHidden; }; diff --git a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp --- a/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp +++ b/kcms/kfontinst/kcmfontinst/KCmFontInst.cpp @@ -45,27 +45,28 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include #include #include -#include #include #include -#include #include -#include #include #include #include #include #include #include #include #include -#include +#include #include #define CFG_GROUP "Main Settings" @@ -102,20 +103,21 @@ return name; } -class CPushButton : public KPushButton +class CPushButton : public QPushButton { public: CPushButton(const KGuiItem &item, QWidget *parent) - : KPushButton(item, parent) + : QPushButton(parent) { - theirHeight=qMax(theirHeight, KPushButton::sizeHint().height()); + KGuiItem::assign(this, item); + theirHeight=qMax(theirHeight, QPushButton::sizeHint().height()); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); } QSize sizeHint() const { - QSize sh(KPushButton::sizeHint()); + QSize sh(QPushButton::sizeHint()); sh.setHeight(theirHeight); if(sh.width()setMargin(0); // Toolbar... - KAction *duplicateFontsAct=new KAction(QIcon::fromTheme("system-search"), i18n("Scan for Duplicate Fonts..."), this); - //*validateFontsAct=new KAction(QIcon::fromTheme("checkmark"), i18n("Validate Fonts..."), this); + QAction *duplicateFontsAct=new QAction(QIcon::fromTheme("system-search"), i18n("Scan for Duplicate Fonts..."), this); + //*validateFontsAct=new QAction(QIcon::fromTheme("checkmark"), i18n("Validate Fonts..."), this); if(!Misc::root()) - itsDownloadFontsAct=new KAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Get New Fonts..."), this); + itsDownloadFontsAct=new QAction(QIcon::fromTheme("get-hot-new-stuff"), i18n("Get New Fonts..."), this); itsToolsMenu=new KActionMenu(QIcon::fromTheme("system-run"), i18n("Tools"), this); itsToolsMenu->addAction(duplicateFontsAct); //itsToolsMenu->addAction(validateFontsAct); @@ -233,7 +235,7 @@ itsGroupList=new CGroupList(groupWidget); itsGroupListView=new CGroupListView(groupWidget, itsGroupList); - KPushButton *createGroup=new CPushButton(KGuiItem(QString(), "list-add", + QPushButton *createGroup=new CPushButton(KGuiItem(QString(), "list-add", i18n("Create a new group")), groupWidget); @@ -352,7 +354,7 @@ itsPreviewMenu->addSeparator(); CPreviewSelectAction *prevSel=new CPreviewSelectAction(itsPreviewMenu); itsPreviewMenu->addAction(prevSel); - KAction *changeTextAct=new KAction(QIcon::fromTheme("edit-rename"), i18n("Change Preview Text..."), this); + QAction *changeTextAct=new QAction(QIcon::fromTheme("edit-rename"), i18n("Change Preview Text..."), this); itsPreviewMenu->addAction(changeTextAct), itsPreviewListMenu = new QMenu(itsPreviewList); @@ -804,9 +806,10 @@ void CKCmFontInst::addGroup() { bool ok; - QString name(KInputDialog::getText(i18n("Create New Group"), + QString name(QInputDialog::getText(this, i18n("Create New Group"), i18n("Please enter the name of the new group:"), - i18n("New Group"), &ok, this)); + QLineEdit::Normal, + i18n("New Group"), &ok)); if(ok && !name.isEmpty()) itsGroupList->createGroup(name); @@ -830,12 +833,12 @@ void CKCmFontInst::changeText() { - bool status; - QRegExpValidator validator(QRegExp(".*"), 0L); - QString oldStr(itsPreview->engine()->getPreviewString()), - newStr(KInputDialog::getText(i18n("Preview Text"), - i18n("Please enter new text:"), - oldStr, &status, this, &validator)); + bool status; + QString oldStr(itsPreview->engine()->getPreviewString()), + newStr(QInputDialog::getText(this, i18n("Preview Text"), + i18n("Please enter new text:"), + QLineEdit::Normal, + oldStr, &status)); if(status && oldStr!=newStr) { @@ -1061,27 +1064,27 @@ if(!itsProgress) { - itsProgress=new KProgressDialog(this, i18n("Scanning Files..."), - i18n("Looking for additional files to install...")); + itsProgress = new QProgressDialog(this); + itsProgress->setWindowTitle(i18n("Scanning Files...")); + itsProgress->setLabelText(i18n("Looking for additional files to install...")); itsProgress->setModal(true); itsProgress->setAutoReset(true); itsProgress->setAutoClose(true); } - itsProgress->setAllowCancel(false); + itsProgress->setCancelButton(0); itsProgress->setMinimumDuration(500); - itsProgress->progressBar()->show(); - itsProgress->progressBar()->setRange(0, src.size()); - itsProgress->progressBar()->setValue(0); + itsProgress->setRange(0, src.size()); + itsProgress->setValue(0); int steps=src.count()<200 ? 1 : src.count()/10; for(it=src.begin(); it!=end; ++it) { QList associatedUrls; itsProgress->setLabelText(i18n("Looking for files associated with %1", (*it).url())); - itsProgress->progressBar()->setValue(itsProgress->progressBar()->value()+1); - if(1==steps || 0==(itsProgress->progressBar()->value()%steps)) + itsProgress->setValue(itsProgress->value()+1); + if(1==steps || 0==(itsProgress->value()%steps)) { bool dialogVisible(itsProgress->isVisible()); QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents); diff --git a/kcms/kfontinst/viewpart/FontViewPart.h b/kcms/kfontinst/viewpart/FontViewPart.h --- a/kcms/kfontinst/viewpart/FontViewPart.h +++ b/kcms/kfontinst/viewpart/FontViewPart.h @@ -39,8 +39,7 @@ class QLabel; class QProcess; class QAction; -class KAction; -class KIntNumInput; +class QSpinBox; class QTemporaryDir; namespace KFI @@ -91,7 +90,7 @@ QFrame *itsFrame; QLabel *itsFaceLabel; // *itsMetaLabel; - KIntNumInput *itsFaceSelector; + QSpinBox *itsFaceSelector; QAction *itsChangeTextAction; int itsFace; KSharedConfigPtr itsConfig; diff --git a/kcms/kfontinst/viewpart/FontViewPart.cpp b/kcms/kfontinst/viewpart/FontViewPart.cpp --- a/kcms/kfontinst/viewpart/FontViewPart.cpp +++ b/kcms/kfontinst/viewpart/FontViewPart.cpp @@ -45,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include #include //#include @@ -115,8 +115,8 @@ itsPreview=new CFontPreview(previewFrame); itsPreview->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); itsFaceLabel=new QLabel(i18n("Show Face:"), itsFaceWidget); - itsFaceSelector=new KIntNumInput(1, itsFaceWidget); - itsFaceSelector->setSliderEnabled(false); + itsFaceSelector=new QSpinBox(itsFaceWidget); + itsFaceSelector->setValue(1); itsInstallButton=new QPushButton(i18n("Install..."), controls); itsInstallButton->setEnabled(false); previewLayout->addWidget(itsPreview); @@ -352,7 +352,8 @@ if(!isFonts && itsPreview->engine()->getNumIndexes()>1) { showFs=true; - itsFaceSelector->setRange(1, itsPreview->engine()->getNumIndexes(), 1); + itsFaceSelector->setRange(1, itsPreview->engine()->getNumIndexes()); + itsFaceSelector->setSingleStep(1); itsFaceSelector->blockSignals(true); itsFaceSelector->setValue(1); itsFaceSelector->blockSignals(false); @@ -440,12 +441,12 @@ void CFontViewPart::changeText() { - bool status; - QRegExpValidator validator(QRegExp(".*"), 0L); - QString oldStr(itsPreview->engine()->getPreviewString()), - newStr(KInputDialog::getText(i18n("Preview String"), - i18n("Please enter new string:"), - oldStr, &status, itsFrame, &validator)); + bool status; + QString oldStr(itsPreview->engine()->getPreviewString()), + newStr(QInputDialog::getText(itsFrame, i18n("Preview String"), + i18n("Please enter new string:"), + QLineEdit::Normal, + oldStr, &status)); if(status && newStr!=oldStr) {