Permalink
Browse files

Moved current filters to the top of the main window; Fixed not update…

…d watched directories; Fixed print dialog not showing up on Mac; etc.
  • Loading branch information...
Pierre Marchand
Pierre Marchand committed Feb 8, 2011
1 parent 7049936 commit d21222d1b78a4139a9e3baa56e000b56afc0dab9
View
@@ -1,66 +1,59 @@
<RCC>
- <qresource prefix="/" >
- <file alias="action-copy-char" >icons/action-copy-char-24.png</file>
- <file alias="Welcome.png" >graphic-resources/welcome.png</file>
- <file alias="fontmatrix_icon.png" >icons/application-fontmatrix_128.png</file>
- <file alias="fontmatrix_systray_icon.png" >icons/fontmatrix-systray.png</file>
- <file alias="icon_fake_partiallychecked" >icons/icon_warning-32.png</file>
- <file alias="fontmatrix_splash.png" >graphic-resources/splashscreen.png</file>
- <file alias="fontmatrix_info.png" >graphic-resources/font-info.png</file>
- <file alias="fontmatrix_glypg.png" >graphic-resources/font-glyph.png</file>
- <file alias="fontmatrix_playground.png" >graphic-resources/font-playground.png</file>
- <file alias="fontmatrix_tags.png" >graphic-resources/font-tag.png</file>
- <file alias="fontmatrix_compare.png" >graphic-resources/font-compare.png</file>
- <file alias="fontmatrix_tags_graphic.png" >graphic-resources/fontmatrix-tag-graphic.png</file>
- <file alias="fontmatrix_zoom.png" >graphic-resources/fontmatrix-zoom.png</file>
- <file alias="fontmatrix_clasification.png" >graphic-resources/font-class.png</file>
- <file alias="fontmatrix_antialias.png" >graphic-resources/fontmatrix-AA.png</file>
- <file alias="fontmatrix_tagseteditor.png" >graphic-resources/fontmatrix-tagseteditor.png</file>
- <file alias="fontmatrix_tagseteditor_icon.png" >graphic-resources/fontmatrix-tagseteditor-icon.png</file>
- <file alias="fontmatrix_fontbookexport_icon.png" >graphic-resources/fontmatrix-fontbookexport-icon.png</file>
- <file alias="fontmatrix_import_icon.png" >graphic-resources/fontmatrix-import-icon.png</file>
- <file alias="icon-TTF" >icons/font_truetype16.png</file>
- <file alias="icon-PS1" >icons/font_type116.png</file>
- <file alias="fontmatrix_sampletext.png" >graphic-resources/font-sampletext2.png</file>
- <file alias="icon-OTF" >icons/font_otf16.png</file>
- <file alias="icon_empty.png" >icons/action-empty-128.png</file>
- </qresource>
- <qresource prefix="/help" >
- <file alias="document-print.png" >icons/help/document-print.png</file>
- <file alias="exit.png" >icons/help/exit.png</file>
- <file alias="go-bottom.png" >icons/help/go-bottom.png</file>
- <file alias="go-down.png" >icons/help/go-down.png</file>
- <file alias="go-first.png" >icons/help/go-first.png</file>
- <file alias="go-home.png" >icons/help/go-home.png</file>
- <file alias="go-last.png" >icons/help/go-last.png</file>
- <file alias="go-next.png" >icons/help/go-next.png</file>
- <file alias="go-previous.png" >icons/help/go-previous.png</file>
- <file alias="go-top.png" >icons/help/go-top.png</file>
- <file alias="go-up.png" >icons/help/go-up.png</file>
- <file alias="help-browser.png" >icons/help/help-browser.png</file>
- </qresource>
- <qresource prefix="/texts" >
- <file alias="about" >messages/about.html</file>
- <file alias="about_people" >messages/about_people.html</file>
- </qresource>
- <qresource prefix="/texts" lang="de" >
- <file alias="about" >messages/about_de.html</file>
- </qresource>
- <qresource prefix="/texts" lang="fi" >
- <file alias="about" >messages/about_fi.html</file>
- </qresource>
- <qresource prefix="/texts" lang="fr" >
- <file alias="about" >messages/about_fr.html</file>
- </qresource>
- <qresource prefix="/texts" lang="uk" >
- <file alias="about" >messages/about_uk.html</file>
- </qresource>
- <qresource prefix="/shapers" >
- <file alias="latn.dict" >langs/latn.dict</file>
- <file alias="latn.match" >langs/latn.match</file>
- </qresource>
- <qresource prefix="/shapers" >
- <file alias="deva.dict" >langs/deva.dict</file>
- <file alias="deva.match" >langs/deva.match</file>
- </qresource>
+ <qresource prefix="/">
+ <file alias="action-copy-char">icons/action-copy-char-24.png</file>
+ <file alias="Welcome.png">graphic-resources/welcome.png</file>
+ <file alias="fontmatrix_icon.png">icons/application-fontmatrix_128.png</file>
+ <file alias="fontmatrix_systray_icon.png">icons/fontmatrix-systray.png</file>
+ <file alias="icon_fake_partiallychecked">icons/icon_warning-32.png</file>
+ <file alias="fontmatrix_splash.png">graphic-resources/splashscreen.png</file>
+ <file alias="fontmatrix_info.png">graphic-resources/font-info.png</file>
+ <file alias="fontmatrix_glypg.png">graphic-resources/font-glyph.png</file>
+ <file alias="fontmatrix_playground.png">graphic-resources/font-playground.png</file>
+ <file alias="fontmatrix_tags.png">graphic-resources/font-tag.png</file>
+ <file alias="fontmatrix_compare.png">graphic-resources/font-compare.png</file>
+ <file alias="fontmatrix_tags_graphic.png">graphic-resources/fontmatrix-tag-graphic.png</file>
+ <file alias="fontmatrix_zoom.png">graphic-resources/fontmatrix-zoom.png</file>
+ <file alias="fontmatrix_clasification.png">graphic-resources/font-class.png</file>
+ <file alias="fontmatrix_antialias.png">graphic-resources/fontmatrix-AA.png</file>
+ <file alias="fontmatrix_tagseteditor.png">graphic-resources/fontmatrix-tagseteditor.png</file>
+ <file alias="fontmatrix_tagseteditor_icon.png">graphic-resources/fontmatrix-tagseteditor-icon.png</file>
+ <file alias="fontmatrix_fontbookexport_icon.png">graphic-resources/fontmatrix-fontbookexport-icon.png</file>
+ <file alias="fontmatrix_import_icon.png">graphic-resources/fontmatrix-import-icon.png</file>
+ <file alias="icon-TTF">icons/font_truetype16.png</file>
+ <file alias="icon-PS1">icons/font_type116.png</file>
+ <file alias="fontmatrix_sampletext.png">graphic-resources/font-sampletext2.png</file>
+ <file alias="icon-OTF">icons/font_otf16.png</file>
+ <file alias="icon_empty.png">icons/action-empty-128.png</file>
+ <file>graphic-resources/filter-and.png</file>
+ <file>graphic-resources/filter-remove.png</file>
+ <file>graphic-resources/filter.png</file>
+ </qresource>
+ <qresource prefix="/help">
+ <file alias="document-print.png">icons/help/document-print.png</file>
+ <file alias="exit.png">icons/help/exit.png</file>
+ <file alias="go-bottom.png">icons/help/go-bottom.png</file>
+ <file alias="go-down.png">icons/help/go-down.png</file>
+ <file alias="go-first.png">icons/help/go-first.png</file>
+ <file alias="go-home.png">icons/help/go-home.png</file>
+ <file alias="go-last.png">icons/help/go-last.png</file>
+ <file alias="go-next.png">icons/help/go-next.png</file>
+ <file alias="go-previous.png">icons/help/go-previous.png</file>
+ <file alias="go-top.png">icons/help/go-top.png</file>
+ <file alias="go-up.png">icons/help/go-up.png</file>
+ <file alias="help-browser.png">icons/help/help-browser.png</file>
+ </qresource>
+ <qresource prefix="/texts">
+ <file alias="about">messages/about.html</file>
+ <file alias="about_people">messages/about_people.html</file>
+ <file alias="about">messages/about_de.html</file>
+ <file alias="about">messages/about_fi.html</file>
+ <file alias="about">messages/about_fr.html</file>
+ <file alias="about">messages/about_uk.html</file>
+ </qresource>
+ <qresource prefix="/shapers">
+ <file alias="latn.dict">langs/latn.dict</file>
+ <file alias="latn.match">langs/latn.match</file>
+ <file alias="deva.dict">langs/deva.dict</file>
+ <file alias="deva.match">langs/deva.match</file>
+ </qresource>
</RCC>
View
@@ -88,6 +88,8 @@ BrowserWidget::BrowserWidget(QWidget *parent) :
connect(ui->browserView, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotFolderViewContextMenu(const QPoint &)));
+ connect(dirWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(slotFolderRefresh(QString)));
+
}
BrowserWidget::~BrowserWidget()
@@ -320,7 +322,7 @@ void BrowserWidget::updateButtons()
void BrowserWidget::slotImport()
{
if(!curVariant.isEmpty())
- typotek::getInstance()->open(curVariant, true);
+ typotek::getInstance()->open(curVariant, false, true);
}
FolderViewMenu::FolderViewMenu() : QMenu()
@@ -359,19 +361,19 @@ void FolderViewMenu::exec(const QFileInfo &fi, const QPoint &p)
void FolderViewMenu::slotImportDir()
{
- QDir dir(selectedFileOrDir.absoluteFilePath());
- QStringList ffilter;
- ffilter << "*.otf" << "*.ttf" << "*.pfb";
- QStringList fontList = dir.entryList(ffilter);
- if (fontList.count() < 1)
- return;
- QString lastItem = fontList.at(fontList.count() - 1);
- fontList.removeAt(fontList.count() - 1);
- foreach(QString tmpFontPath, fontList) {
- QString absPath = dir.absolutePath() + "/" + tmpFontPath;
- typotek::getInstance()->open(absPath, false, true);
- }
- typotek::getInstance()->open(dir.absolutePath() + "/" + lastItem, true); // import the last font with the announce flag set to true
+// QDir dir(selectedFileOrDir.absoluteFilePath());
+// QStringList ffilter;
+// ffilter << "*.otf" << "*.ttf" << "*.pfb";
+// QStringList fontList = dir.entryList(ffilter);
+// if (fontList.count() < 1)
+// return;
+// QString lastItem = fontList.at(fontList.count() - 1);
+// fontList.removeAt(fontList.count() - 1);
+// foreach(QString tmpFontPath, fontList) {
+// QString absPath = dir.absolutePath() + "/" + tmpFontPath;
+// typotek::getInstance()->open(absPath, false, true);
+// }
+ typotek::getInstance()->open(selectedFileOrDir.absoluteFilePath(),false, true); // import the last font with the announce flag set to true
}
void FolderViewMenu::slotImportDirRecursively()
View
@@ -486,19 +486,29 @@ void ChartWidget::slotPrint()
FontItem *font(FMFontDb::DB()->Font(fontIdentifier));
if(font == 0)
return;
- QPrinter thePrinter ( QPrinter::HighResolution );
- QPrintDialog dialog(&thePrinter, this);
- dialog.setWindowTitle("Fontmatrix - " + tr("Print Chart") +" - " + font->fancyName() );
- if ( dialog.exec() != QDialog::Accepted )
- return;
- thePrinter.setFullPage ( true );
- QPainter aPainter ( &thePrinter );
+ if(printer == 0)
+ printer = new QPrinter(QPrinter::HighResolution);
+ if(printDialog == 0)
+ printDialog = new QPrintDialog(printer, this);
+
+ printDialog->setWindowTitle("Fontmatrix - " + tr("Print Chart") +" - " + font->fancyName() );
+
+
+ printDialog->open(this, SLOT(slotDoPrinting()));
+
+}
+
+void ChartWidget::slotDoPrinting()
+{
+ FontItem *font(FMFontDb::DB()->Font(fontIdentifier));
+ printer->setFullPage ( true );
+ QPainter aPainter ( printer );
- double pWidth(thePrinter.paperRect().width());
- double pHeight(thePrinter.paperRect().height());
- double pFactor( thePrinter.resolution() );
+ double pWidth(printer->paperRect().width());
+ double pHeight(printer->paperRect().height());
+ double pFactor(printer->resolution() );
qDebug()<<"Paper :"<<pWidth<<pHeight;
qDebug()<<"Resolution :"<<pFactor;
@@ -537,7 +547,7 @@ void ChartWidget::slotPrint()
}
else
{
- thePrinter.newPage();
+ printer->newPage();
}
aPainter.drawText(targetR.bottomLeft(), font->fancyName()+"[U"+QString::number(beginCharcode ,16).toUpper()+", U"+QString::number(stopAtCode ,16).toUpper()+"]");
pScene.render(&aPainter,targetR, sourceR, Qt::KeepAspectRatio);
View
@@ -74,6 +74,7 @@ private slots:
void slotSearchCharName();
void slotPrint();
+ void slotDoPrinting();
};
View
@@ -31,6 +31,7 @@
#include "fmpaths.h"
#include "filtersdialog.h"
#include "typotek.h"
+#include "mainviewwidget.h"
#include <QDialog>
#include <QGridLayout>
@@ -246,14 +247,13 @@ FilterBar::FilterBar(QWidget *parent) :
loadFilters();
- connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(slotSaveFilter()));
connect(ui->tagsView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotTagSelect(QModelIndex)));
connect(ui->tagsView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(slotTagEdit(QModelIndex)));
connect(ui->metadataLineEdit, SIGNAL(editingFinished()), this, SLOT(metaFilter()));
connect(ui->fieldCombo, SIGNAL(activated(int)), this, SLOT(metaSelectField(int)));
- connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(slotClearFilter()));
+// connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(slotClearFilter()));
connect(ui->panoseWidget, SIGNAL(filterChanged()), this, SLOT(slotPanoFilter()));
connect(FMFontDb::DB(), SIGNAL(tagsChanged()), tagListModel, SLOT(tagsDBChanged()));
@@ -346,6 +346,7 @@ void FilterBar::slotRemoveFilterItem(bool process)
if(filters.count() == 0)
{
FMFontDb::DB()->filterAllFonts();
+ curFilterWidget->setVisible(false);
emit filterChanged();
}
fi->deleteLater();
@@ -362,12 +363,14 @@ void FilterBar::removeAllFilters()
d->deleteLater();
}
filters.clear();
+ curFilterWidget->setVisible(false);
}
void FilterBar::addFilterItem(FilterData *f, bool process)
{
if(f != 0)
{
+ curFilterWidget->setVisible(true);
FilterItem * it(f->item());
if(!filters.contains(it))
{
@@ -376,7 +379,7 @@ void FilterBar::addFilterItem(FilterData *f, bool process)
connect(it, SIGNAL(remove()), this, SLOT(slotRemoveFilterItem()));
connect(f, SIGNAL(Changed()), this, SLOT(processFilters()));
filters.append(it);
- ui->filterListLayout->addWidget(it);
+ filterListLayout->addWidget(it);
if(process)
processFilters();
View
@@ -29,6 +29,8 @@
#include <QMenu>
#include <QStringListModel>
#include <QMouseEvent>
+#include <QHBoxLayout>
+
class FiltersDialogItem;
class FilterItem;
@@ -104,11 +106,16 @@ class FilterBar : public QWidget
explicit FilterBar(QWidget *parent = 0);
~FilterBar();
+ void setFilterListLayout(QHBoxLayout *l){filterListLayout = l;}
+ void setCurFilterWidget(QWidget * w){curFilterWidget = w;}
+
protected:
void changeEvent(QEvent *e);
private:
Ui::FilterBar *ui;
+ QHBoxLayout * filterListLayout;
+ QWidget * curFilterWidget;
QList<FilterItem*> filters;
void addFilterItem(FilterData* f, bool process = true);
@@ -139,7 +146,6 @@ private slots:
void filtersDialog();
- void slotSaveFilter();
void slotLoadFilter(const QString& fname);
void slotRemoveFilter(const QString& fname);
@@ -154,6 +160,9 @@ private slots:
void slotTogglePano(bool t);
void slotToggleFilter(bool t);
+public slots:
+ void slotSaveFilter();
+
};
#endif // FILTERBAR_H
Oops, something went wrong.

0 comments on commit d21222d

Please sign in to comment.