Skip to content

Commit

Permalink
Added qt.conf to correct font path on linux workaround for Issue #7
Browse files Browse the repository at this point in the history
Added resource file for Windows icon
Added embeded resource
  • Loading branch information
imatefx committed Apr 30, 2014
1 parent f8af2b1 commit 3a3217e
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 2,752 deletions.
13 changes: 13 additions & 0 deletions AppResources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<RCC>
<qresource prefix="/fonts">
<file>DejaVuSans.ttf</file>
<file>FuturaBookBT.ttf</file>
<file>bitstream.pfb</file>
</qresource>
<qresource prefix="/qt/etc">
<file>qt.conf</file>
</qresource>
<qresource prefix="/icons">
<file>appicon.ico</file>
</qresource>
</RCC>
12 changes: 9 additions & 3 deletions AutoFileBackup.pro
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = AutoFileBackup
TEMPLATE = app


SOURCES += main.cpp\
autofilebackup.cpp \
diff_match_patch/diff_match_patch.cpp \
filecopysettings.cpp \
droptablewidget.cpp

HEADERS += autofilebackup.h \
diff_match_patch/diff_match_patch.h \
filecopysettings.h \
droptablewidget.h

FORMS += autofilebackup.ui

RESOURCES += \
AppResources.qrc

CONFIG += console



RC_FILE = winicon.rc
Binary file added DejaVuSans.ttf
Binary file not shown.
Binary file added appicon.ico
Binary file not shown.
25 changes: 22 additions & 3 deletions autofilebackup.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "autofilebackup.h"
#include "autofilebackup.h"
#include "ui_autofilebackup.h"
#include <QFileSystemWatcher>
#include <QTime>
Expand All @@ -7,13 +7,32 @@
#include "filecopysettings.h"
#include <QSettings>
#include <QDebug>
#include <QFontDatabase>
#include <QTextStream>

QFileSystemWatcher *folderMonitor;
QFileSystemWatcher *fileMonitor;
QList<QString> watchedFiles;
AutoFileBackup::AutoFileBackup(QWidget *parent) : QWidget(parent), ui(new Ui::AutoFileBackup)
{

setWindowIcon(QIcon(":/icons/appicon.ico"));
// Load the embedded font.
QString fontPath = ":/fonts/DejaVuSans.ttf";
// QFontDatabase::removeAllApplicationFonts();
int fontId = QFontDatabase::addApplicationFont(fontPath);

QFont font("DejaVu Sans",9);
// font.setStyleName("Regular");
this->setFont(font);
qDebug() << fontId ;
qDebug() << QWidget::fontInfo().family();
qDebug() << QWidget::fontInfo().styleName();
qDebug() << QWidget::fontInfo().style();
QFontDatabase db1;
qDebug() << db1.families();


ui->setupUi(this);

folderMonitor = new QFileSystemWatcher(this);
Expand Down Expand Up @@ -66,7 +85,7 @@ void AutoFileBackup::on_removeFileButton_clicked()


int selectedCount = ui->watchedFilesTableWidget->selectedItems().count();

qDebug() << selectedCount;

while(ui->watchedFilesTableWidget->selectedItems().count() > 0)
{
Expand Down Expand Up @@ -132,7 +151,7 @@ void AutoFileBackup::fileChanged(const QString &path)
}
}

void AutoFileBackup::directoryChanged(const QString &path)
void AutoFileBackup::directoryChanged(const QString &)
{
// addLog("Directory Modified",path,logLevel);
// Check the changed directory for all the watched files , Sometimes editors delete the original file and use a
Expand Down
2 changes: 1 addition & 1 deletion autofilebackup.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private slots:

void on_removeFileButton_clicked();

void directoryChanged(const QString & path);
void directoryChanged(const QString &);

void fileChanged(const QString & path);

Expand Down
10 changes: 9 additions & 1 deletion autofilebackup.ui
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<height>509</height>
</rect>
</property>
<property name="font">
<font>
<family>DejaVu Sans</family>
</font>
</property>
<property name="windowTitle">
<string>AutoFileBackup</string>
</property>
Expand All @@ -35,6 +40,9 @@
<property name="defaultDropAction">
<enum>Qt::IgnoreAction</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
Expand All @@ -48,7 +56,7 @@
<number>2</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
Expand Down
Binary file added bitstream.pfb
Binary file not shown.
Loading

0 comments on commit 3a3217e

Please sign in to comment.