Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.11.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
cloose committed Mar 28, 2016
2 parents 74ae0e4 + a6fa7b0 commit 0665474
Show file tree
Hide file tree
Showing 11 changed files with 624 additions and 296 deletions.
53 changes: 27 additions & 26 deletions CuteMarkEd.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,34 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ManufacturerName="CuteMarkEd Project"?>
<?define ProductName="CuteMarkEd"?>
<?define ProductVersion="0.11.2"?>
<Product Name="$(var.ProductName)"
Id="*"
<?define ProductVersion="0.11.3"?>
<Product Name="$(var.ProductName)"
Id="*"
UpgradeCode="335156FC-CB7F-4357-98D4-B5519E66402B"
Language="1033"
Version="$(var.ProductVersion)"
Language="1033"
Version="$(var.ProductVersion)"
Manufacturer="$(var.ManufacturerName)">

<Package Id="*"
InstallerVersion="200"
InstallerVersion="200"
Compressed="yes"
Description="CuteMarkEd Installer"
Manufacturer="$(var.ManufacturerName)"
/>

<Media Id="1"
Cabinet="cutemarked.cab"
<Media Id="1"
Cabinet="cutemarked.cab"
EmbedCab="yes"
/>

<MajorUpgrade
DowngradeErrorMessage="CuteMarkEd is already installed with a higher version."
AllowSameVersionUpgrades="yes" />

<!-- Directory tree -->
<Directory Id="TARGETDIR" Name="SourceDir">
<!-- Directory tree -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="$(var.ProductName)">
<Directory Id="accessible" Name="accessible"/>
<Directory Id="dictionaries" Name="dictionaries"/>
<Directory Id="iconengines" Name="iconengines"/>
<Directory Id="imageformats" Name="imageformats"/>
Expand All @@ -39,7 +38,7 @@
<Directory Id="translations" Name="translations"/>
</Directory>
</Directory>

<Directory Id="ProgramMenuFolder">
<Directory Id="ProgramMenuDir" Name="$(var.ProductName) $(var.ProductVersion)">
<Component Id="ApplicationShortcuts" Guid="EDF171FF-255B-4036-A363-C81D6E0F4F21">
Expand Down Expand Up @@ -80,13 +79,14 @@
<File Id="Qt5QuickLibrary" Source="Qt5Quick.dll"/>
<File Id="Qt5SensorsLibrary" Source="Qt5Sensors.dll"/>
<File Id="Qt5SqlLibrary" Source="Qt5Sql.dll"/>
<File Id="Qt5WebChannelLibrary" Source="Qt5WebChannel.dll"/>
<File Id="Qt5WebKitLibrary" Source="Qt5WebKit.dll"/>
<File Id="Qt5WebKitWidgetsLibrary" Source="Qt5WebKitWidgets.dll"/>
<File Id="Qt5WidgetsLibrary" Source="Qt5Widgets.dll"/>
<File Id="Qt5WinExtras" Source="Qt5WinExtras.dll"/>
<File Id="icudt51Library" Source="icudt51.dll"/>
<File Id="icuin51Library" Source="icuin51.dll"/>
<File Id="icuuc51Library" Source="icuuc51.dll"/>
<File Id="icudt53Library" Source="icudt53.dll"/>
<File Id="icuin53Library" Source="icuin53.dll"/>
<File Id="icuuc53Library" Source="icuuc53.dll"/>
<File Id="libgcc_s_dw2Library" Source="libgcc_s_dw2-1.dll"/>
<File Id="libstdcppLibrary" Source="libstdc++-6.dll"/>
<File Id="libwinpthreadLibrary" Source="libwinpthread-1.dll"/>
Expand All @@ -110,12 +110,6 @@
</Component>
</DirectoryRef>

<DirectoryRef Id="accessible">
<Component Id="QtAccessiblityComponent" Guid="A4B2D7FA-3B7F-4F03-B3B1-AF5C212F4B44" DiskId="1">
<File Id="QtAccessibleWidgetsPlugin" Source="accessible/qtaccessiblewidgets.dll"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="dictionaries">
<Component Id="DictionariesComponent" Guid="AAC09D8C-FFD2-46DF-BDA2-081D26AFF431" DiskId="1">
<File Id="cs_CZ.aff" Source="dictionaries/cs_CZ.aff"/>
Expand All @@ -132,7 +126,7 @@
<File Id="README_en_US.txt" Source="dictionaries/README_en_US.txt"/>
</Component>
</DirectoryRef>

<!-- Fontawesome Icon Engine -->
<DirectoryRef Id="iconengines">
<Component Id="IconEngineComponent" Guid="E7E34602-4099-4A73-8533-7631EF7D598A" DiskId="1">
Expand All @@ -142,14 +136,17 @@

<DirectoryRef Id="imageformats">
<Component Id="QtImageFormatsComponent" Guid="B688FB5F-318F-494D-BF56-C83F3BB3F946" DiskId="1">
<File Id="QtDdsPlugin" Source="imageformats/qdds.dll"/>
<File Id="QtGifPlugin" Source="imageformats/qgif.dll"/>
<File Id="QtIcoPlugin" Source="imageformats/qico.dll"/>
<File Id="QtJp2Plugin" Source="imageformats/qjp2.dll"/>
<File Id="QtJpegPlugin" Source="imageformats/qjpeg.dll"/>
<File Id="QtMngPlugin" Source="imageformats/qmng.dll"/>
<File Id="QtSvgPlugin" Source="imageformats/qsvg.dll"/>
<File Id="QtTgaPlugin" Source="imageformats/qtga.dll"/>
<File Id="QtTiffPlugin" Source="imageformats/qtiff.dll"/>
<File Id="QtWbmpPlugin" Source="imageformats/qwbmp.dll"/>
<File Id="QtWebpPlugin" Source="imageformats/qwebp.dll"/>
</Component>
</DirectoryRef>

Expand All @@ -168,22 +165,26 @@
<DirectoryRef Id="translations">
<Component Id="QtTranslationsComponent" Guid="245EDE4C-00C9-4FA9-9E78-D4B1C526AAF0" DiskId="1">
<File Id="QtCSTranslation" Source="translations/qt_cs.qm"/>
<File Id="QtDATranslation" Source="translations/qt_da.qm"/>
<File Id="QtDETranslation" Source="translations/qt_de.qm"/>
<File Id="QtESTranslation" Source="translations/qt_es.qm"/>
<File Id="QtFRTranslation" Source="translations/qt_fr.qm"/>
<File Id="QtHUTranslation" Source="translations/qt_hu.qm"/>
<File Id="QtITTranslation" Source="translations/qt_it.qm"/>
<File Id="QtJATranslation" Source="translations/qt_ja.qm"/>
<File Id="QtPLTranslation" Source="translations/qt_pl.qm"/>
<File Id="QtPTTranslation" Source="translations/qt_pt.qm"/>
<File Id="QtRUTranslation" Source="translations/qt_ru.qm"/>
<File Id="QtSKTranslation" Source="translations/qt_sk.qm"/>
<File Id="QtUKTranslation" Source="translations/qt_uk.qm"/>
<File Id="QtZHCNTranslation" Source="translations/qt_zh_CN.qm"/>
<File Id="QtZHTWTranslation" Source="translations/qt_zh_TW.qm"/>
</Component>
</DirectoryRef>

<Feature Id="Complete" Title="CuteMarkEd" Level="1">
<ComponentRef Id="ProductComponent"/>
<ComponentRef Id="Qt5Component"/>
<ComponentRef Id="QtAccessiblityComponent"/>
<ComponentRef Id="QtImageFormatsComponent"/>
<ComponentRef Id="QtPlatformsComponent"/>
<ComponentRef Id="QtPrintSupportComponent"/>
Expand All @@ -201,7 +202,7 @@
<!-- Allow user to change the installation directory -->
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<UIRef Id="WixUI_InstallDir" />

<!-- Skip license dialog -->
<UI>
<Publish Dialog="WelcomeDlg"
Expand All @@ -215,7 +216,7 @@
Value="WelcomeDlg"
Order="2">1</Publish>
</UI>

<Icon Id="CuteMarkEd.exe" SourceFile="cutemarked.exe"/>
</Product>
</Wix>
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ A Qt-based, free and open source markdown editor with live HTML preview, math ex

### DOWNLOAD

[Sources](https://github.com/cloose/CuteMarkEd/archive/v0.11.2.tar.gz)
[MS Windows (Installer)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.2.msi)
[MS Windows (ZIP file)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.2.zip)
[Sources](https://github.com/cloose/CuteMarkEd/archive/v0.11.3.tar.gz)
[MS Windows (Installer)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.3.msi)
[MS Windows (ZIP file)](http://dl.bintray.com/cloose/CuteMarkEd/cutemarked-0.11.3.zip)
[OpenSUSE 13.2 (RPM)](https://build.opensuse.org/project/show?project=home%3Acloose1974)
[Fedora 20 (RPM)](https://build.opensuse.org/project/show?project=home%3Acloose1974)
[Fedora 21 (RPM)](https://build.opensuse.org/project/show?project=home%3Acloose1974)
Expand All @@ -19,6 +19,20 @@ A Qt-based, free and open source markdown editor with live HTML preview, math ex

### NEWS

#### Version 0.11.3

Improvements:

* `IMPROVED` Update Russian translation

Fixes:

* `FIXED` Missing links in exported PDF file (#275)
* `FIXED` Use of non-native line endings when a file is saved (#97)
* `FIXED` Corrupt files on system crashes or running out of disk space (#285)
* `FIXED` Accessing all drives although the file explorer is not visible (#273)
* `FIXED` Relative paths in recently used files menu (#256)

#### Version 0.11.2

Improvements:
Expand Down Expand Up @@ -81,7 +95,7 @@ Fixes:

### DEPENDENCIES

* [Qt 5.2](http://qt-project.org) (LGPL v2.1)
* [Qt 5.4](http://qt-project.org) (LGPL v2.1)
* [Discount 2.1.7](http://www.pell.portland.or.us/~orc/Code/discount/) (3-clause BSD)
* [PEG Markdown Highlight](http://hasseg.org/peg-markdown-highlight/) (MIT License)
* [hunspell 1.3.2](http://hunspell.sourceforge.net/) (LGPL v2.1)
Expand Down
3 changes: 2 additions & 1 deletion app/app.pro
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ HEADERS += \
imagetooldialog.h \
snippetcompleter.h \
snippetstablemodel.h \
aboutdialog.h
aboutdialog.h \
savefileadapter.h

FORMS += \
mainwindow.ui \
Expand Down
11 changes: 9 additions & 2 deletions app/controls/fileexplorerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ class FileSortFilterProxyModel : public QSortFilterProxyModel

FileExplorerWidget::FileExplorerWidget(QWidget *parent) :
QWidget(parent),
initialized(false),
ui(new Ui::FileExplorerWidget),
model(new QFileSystemModel(this)),
sortModel(new FileSortFilterProxyModel(this))
{
ui->setupUi(this);

model->setRootPath("");

sortModel->setDynamicSortFilter(true);
sortModel->setSourceModel(model);

Expand All @@ -51,6 +50,14 @@ FileExplorerWidget::~FileExplorerWidget()
delete ui;
}

void FileExplorerWidget::showEvent(QShowEvent *event)
{
if (!initialized) {
model->setRootPath("");
initialized = true;
}
}

void FileExplorerWidget::fileOpen(const QModelIndex &index)
{
QFileInfo info = model->fileInfo(sortModel->mapToSource(index));
Expand Down
4 changes: 4 additions & 0 deletions app/controls/fileexplorerwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ class FileExplorerWidget : public QWidget
signals:
void fileSelected(const QString &filePath);

protected:
void showEvent(QShowEvent *event);

private slots:
void fileOpen(const QModelIndex &index);

private:
bool initialized;
Ui::FileExplorerWidget *ui;
QFileSystemModel *model;
QSortFilterProxyModel *sortModel;
Expand Down
8 changes: 6 additions & 2 deletions app/controls/recentfilesmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "recentfilesmenu.h"

#include <QFileInfo>
#include <QDir>
#include <QSettings>

RecentFilesMenu::RecentFilesMenu(QWidget *parent) :
Expand Down Expand Up @@ -52,9 +53,12 @@ void RecentFilesMenu::saveState() const

void RecentFilesMenu::addFile(const QString &fileName)
{
QFileInfo fileInfo(fileName);
QString absoluteNativeFileName(QDir::toNativeSeparators(fileInfo.absoluteFilePath()));

// add file to top of list
recentFiles.removeAll(fileName);
recentFiles.prepend(fileName);
recentFiles.removeAll(absoluteNativeFileName);
recentFiles.prepend(absoluteNativeFileName);

// remove last entry if list contains more than 10 entries
if (recentFiles.size() > 10) {
Expand Down
2 changes: 1 addition & 1 deletion app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int main(int argc, char *argv[])
app.setOrganizationName("CuteMarkEd Project");
app.setApplicationName("CuteMarkEd");
app.setApplicationDisplayName("CuteMarkEd");
app.setApplicationVersion("0.11.2");
app.setApplicationVersion("0.11.3");

#ifdef Q_OS_WIN
QStringList fileTypes;
Expand Down
31 changes: 23 additions & 8 deletions app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include "options.h"
#include "optionsdialog.h"
#include "revealviewsynchronizer.h"
#include "savefileadapter.h"
#include "snippetcompleter.h"
#include "tabletooldialog.h"

Expand Down Expand Up @@ -226,15 +227,22 @@ bool MainWindow::fileSave()
return fileSaveAs();
}

QTextDocumentWriter writer(fileName, "plaintext");
SaveFileAdapter file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
return false;
}

QTextDocumentWriter writer(&file, "plaintext");
bool success = writer.write(ui->plainTextEdit->document());
if (success) {
file.commit();

// set status to unmodified
ui->plainTextEdit->document()->setModified(false);
setWindowModified(false);

// add to recent file list
recentFilesMenu->addFile(QDir::toNativeSeparators(fileName));
recentFilesMenu->addFile(fileName);
}

return success;
Expand Down Expand Up @@ -304,10 +312,17 @@ void MainWindow::fileExportToHtml()

void MainWindow::fileExportToPdf()
{
ExportPdfDialog dialog(fileName);
if (dialog.exec() == QDialog::Accepted) {
ui->webView->print(dialog.printer());
}
// using temporary QTextDocument instance to get links exported\printed correctly,
// as links will dissappear when printing directly from QWebView in current Qt implementation
// of QWebView::print() method (possible bug in Qt?)
// more info here: http://stackoverflow.com/questions/11629093/add-working-url-into-pdf-using-qt-qprinter

ExportPdfDialog dialog(fileName);
if (dialog.exec() == QDialog::Accepted) {
QTextDocument doc;
doc.setHtml(ui->webView->page()->currentFrame()->toHtml());
doc.print(dialog.printer());
}
}

void MainWindow::filePrint()
Expand Down Expand Up @@ -854,7 +869,7 @@ bool MainWindow::load(const QString &fileName)

// open file
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
if (!file.open(QFile::ReadOnly | QIODevice::Text)) {
return false;
}

Expand All @@ -869,7 +884,7 @@ bool MainWindow::load(const QString &fileName)
setFileName(fileName);

// add to recent files
recentFilesMenu->addFile(QDir::toNativeSeparators(fileName));
recentFilesMenu->addFile(fileName);

return true;
}
Expand Down
Loading

0 comments on commit 0665474

Please sign in to comment.