changeset 53:a43d8cf2fa95

Various fixes and improvements. Fix windows packaging.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 19 Jul 2016 17:45:57 +0200
parents 263880612637
children dcfb8e9d5ee9
files CMakeLists.txt INSTALL src/CMakeLists.txt src/constants.h src/filenamerequester.cpp src/mainwindow.cpp
diffstat 6 files changed, 26 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Jul 19 17:45:10 2016 +0200
+++ b/CMakeLists.txt	Tue Jul 19 17:45:57 2016 +0200
@@ -7,6 +7,7 @@
 
 cmake_minimum_required(VERSION 2.8.8)
 project(eduexportconvert)
+set(PRETTY_NAME EduExportConverter)
 
 
 ### Generic Setup
@@ -68,4 +69,5 @@
 add_subdirectory(src)
 
 configure_file (doc/Doxyfile.in doc/Doxyfile)
+configure_file (packaging/win-createpackage.sh.in packaging/win-createpackage.sh)
 add_subdirectory(doc)
--- a/INSTALL	Tue Jul 19 17:45:10 2016 +0200
+++ b/INSTALL	Tue Jul 19 17:45:57 2016 +0200
@@ -87,6 +87,12 @@
 This binary can be compressed with UPX or directly used. Without further
 dependencies.
 
+To create the Windows installer package you need makensis installed
+(debian package nsis) and run:
+
+    cd build-windows
+    ./packaging/win-createpackage.sh
+
 For MacOSX
 ==========
 Install the usual development tools / xcode.
--- a/src/CMakeLists.txt	Tue Jul 19 17:45:10 2016 +0200
+++ b/src/CMakeLists.txt	Tue Jul 19 17:45:57 2016 +0200
@@ -41,12 +41,6 @@
 
 qt5_add_resources(APPLICATION_SRC icons/icons.qrc)
 
-add_executable(${PROJECT_NAME}
-    ${_add_executable_params}
-    ${APPLICATION_SRC}
-    ${TRANSLATION_SRC}
-)
-
 # See: https://bugreports.qt-project.org/browse/QTBUG-35918
 # extra static libs should be automatically managed but they
 # are not so we make this here explicitly neccessary.
@@ -97,6 +91,7 @@
 if (WIN32)
    get_target_property(_loc Qt5::Widgets LOCATION)
    get_filename_component(_qtpath ${_loc} PATH)
+   set (_add_executable_params WIN32)
    set(EXTRA_STATIC_LIBS
        -L${_qtpath}
        Qt5::QWindowsIntegrationPlugin
@@ -106,6 +101,12 @@
        -ladvapi32 -lshell32 -luser32 -lkernel32 -lqtfreetype -lqtharfbuzzng -lpcre16)
 endif()
 
+add_executable(${PROJECT_NAME}
+    ${_add_executable_params}
+    ${APPLICATION_SRC}
+    ${TRANSLATION_SRC}
+)
+
 target_link_libraries(${PROJECT_NAME}
     Qt5::Widgets
     Qt5::PrintSupport
--- a/src/constants.h	Tue Jul 19 17:45:10 2016 +0200
+++ b/src/constants.h	Tue Jul 19 17:45:57 2016 +0200
@@ -101,4 +101,6 @@
 
 #define MAX_FILENAME_COUNT 10000
 
+#define PRETTY_NAME "EduExportConverter"
+
 #endif // CONSTANTS_H
--- a/src/filenamerequester.cpp	Tue Jul 19 17:45:10 2016 +0200
+++ b/src/filenamerequester.cpp	Tue Jul 19 17:45:57 2016 +0200
@@ -84,12 +84,6 @@
       nameFilter(),
       existingOnly(true)
 {
-    dirmodel.setObjectName(QStringLiteral("dirmodel"));
-    completer.setObjectName(QStringLiteral("completer"));
-    lineedit.setObjectName(QStringLiteral("lineedit"));
-    button.setObjectName(QStringLiteral("button"));
-    hlay.setObjectName(QStringLiteral("hlay"));
-
     button.setIcon(QApplication::style()->standardIcon(QStyle::SP_DirIcon));
     lineedit.setCompleter(&completer);
     lineedit.setClearButtonEnabled(true);
@@ -122,7 +116,8 @@
 
 void FileNameRequester::setFileName(const QString &file)
 {
-    d->lineedit.setText(file);
+    const QString converted = QDir::toNativeSeparators(file);
+    d->lineedit.setText(converted);
 }
 
 QString FileNameRequester::fileName() const
--- a/src/mainwindow.cpp	Tue Jul 19 17:45:10 2016 +0200
+++ b/src/mainwindow.cpp	Tue Jul 19 17:45:57 2016 +0200
@@ -52,6 +52,8 @@
     mInputRequester->setExistingOnly(true);
     inputLabel->setBuddy(mInputRequester);
 
+    setWindowTitle(QStringLiteral(PRETTY_NAME));
+
     inoutLay->addWidget(mInputRequester, 0, 1);
 
     auto outLabel = new QLabel(tr("Export Folder:"));
@@ -104,6 +106,7 @@
     connect(mTitleEdit, &QLineEdit::textChanged, this, &MainWindow::checkCompleted);
     connect(mInputRequester, &FileNameRequester::fileNameChanged, this, &MainWindow::checkCompleted);
     connect(mOutRequester, &FileNameRequester::fileNameChanged, this, &MainWindow::checkCompleted);
+    connect(btns, &QDialogButtonBox::rejected, this, &QMainWindow::close);
 }
 
 void MainWindow::showErrorMessage(const QString& errMsg) {
@@ -120,6 +123,8 @@
     if (mSettings.contains("geometry")) {
         restoreGeometry(mSettings.value("geometry").toByteArray());
         restoreState(mSettings.value("windowState").toByteArray());
+    } else {
+        resize(480, 360);
     }
 
     setInputFile(mSettings.value("lastInput",
@@ -135,6 +140,8 @@
 void MainWindow::setInputFile(const QString& file)
 {
     mInputRequester->setFileName(file);
+    QFileInfo fi(file);
+    mOutRequester->setFileName(fi.dir().path());
 }
 
 void MainWindow::setTitle(const QString& title) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)