#include <KDialog>
#include <KIcon>
#include <KMimeType>
-//#include <KFileMetaInfo>
#include <KZip>
#include <KTempDir>
#include <KStandardDirs>
QBoxLayout *previewLayout=new QBoxLayout(QBoxLayout::LeftToRight, previewFrame),
*controlsLayout=new QBoxLayout(QBoxLayout::LeftToRight, controls),
*faceLayout=new QBoxLayout(QBoxLayout::LeftToRight, itsFaceWidget);
-// QBoxLayout *metaLayout=new QBoxLayout(QBoxLayout::LeftToRight, metaBox);
-// itsMetaLabel=new QLabel(metaBox);
-// itsMetaLabel->setAlignment(Qt::AlignTop);
-// metaLayout->addWidget(itsMetaLabel);
previewLayout->setMargin(0);
previewLayout->setSpacing(0);
faceLayout->setMargin(0);
if (!url.isValid() || !closeUrl())
return false;
-// itsMetaLabel->setText(QString());
-// itsMetaInfo.clear();
-
itsFontDetails=FC::decode(url);
if(!itsFontDetails.family.isEmpty() ||
KFI_KIO_FONTS_PROTOCOL==url.protocol() || KIO::NetAccess::mostLocalUrl(url, itsFrame).isLocalFile())
int fileIndex(-1);
QString fontFile;
-// itsMetaUrl=url();
delete itsTempDir;
itsTempDir=NULL;
{
fontFile=itsTempDir->name()+entry->name();
//setLocalFilePath(itsTempDir->name()+entry->name());
-// itsMetaUrl=KUrl::fromPath(localFilePath());
break;
}
else
}
itsChangeTextAction->setEnabled(st);
-// if(st)
-// getMetaInfo(itsFaceSelector->isVisible() && itsFaceSelector->value()>0
-// ? itsFaceSelector->value()-1 : 0);
-// else
if(!st)
KMessageBox::error(itsFrame, i18n("Could not read font."));
}
}
}
-#if 0
-void CFontViewPart::getMetaInfo(int face)
-{
- if(itsMetaInfo[face].isEmpty())
- {
- // Pass as much inofmration as possible to analyzer...
- if(KFI_KIO_FONTS_PROTOCOL!=itsMetaUrl.protocol())
- {
- itsMetaUrl.removeQueryItem(KFI_KIO_FACE);
- if(face>0)
- itsMetaUrl.addQueryItem(KFI_KIO_FACE, QString().setNum(face));
- }
-
- KFileMetaInfo meta(itsMetaUrl);
-
- if(meta.isValid() && meta.keys().count())
- {
- QStringList keys(meta.keys());
- QStringList::const_iterator it(keys.begin()),
- end(keys.end());
-
- itsMetaInfo[face]="<table>";
- for(; it!=end; ++it)
- {
- KFileMetaInfoItem mi(meta.item(*it));
-
- itsMetaInfo[face]+="<tr><td><b>"+mi.name()+"</b></td></tr><tr><td>"+
- mi.value().toString()+"</td></tr>";
- }
-
- itsMetaInfo[face]+="</table>";
- itsMetaLabel->setText(itsMetaInfo[face]);
- }
- else
- itsMetaLabel->setText(i18n("<p>No information</p>"));
- }
- else
- itsMetaLabel->setText(itsMetaInfo[face]);
-}
-#endif
-
BrowserExtension::BrowserExtension(CFontViewPart *parent)
: KParts::BrowserExtension(parent)
{
private:
void checkInstallable();
-// void getMetaInfo(int face);
private:
-// QMap<int, QString> itsMetaInfo;
CFontPreview *itsPreview;
QPushButton *itsInstallButton;
QWidget *itsFaceWidget;
QFrame *itsFrame;
QLabel *itsFaceLabel;
-// *itsMetaLabel;
KIntNumInput *itsFaceSelector;
QAction *itsChangeTextAction;
KSharedConfigPtr itsConfig;
BrowserExtension *itsExtension;
QProcess *itsProc;
-// KUrl itsMetaUrl;
KTempDir *itsTempDir;
Misc::TFont itsFontDetails;
FontInstInterface *itsInterface;