open manual

This commit is contained in:
Martin Brodbeck 2018-08-07 20:39:15 +02:00
parent df8f4bfd40
commit a196e49410
4 changed files with 25 additions and 16 deletions

View file

@ -2,32 +2,24 @@
#include "settingsdialog.h"
#include <QApplication>
#include <QDir>
#include <QLibraryInfo>
#include <QMessageBox>
#include <QSettings>
#include <QTranslator>
#include <QLibraryInfo>
#include <QDir>
int main(int argc, char* argv[])
{
// Q_INIT_RESOURCE(application);
// Set the locale to german, so that currency is correct
// std::locale german("de_DE.utf-8");
//std::locale myLocale("");
//std::locale::global(myLocale);
QApplication kimaApp{argc, argv};
QCoreApplication::setOrganizationName("RustySoft");
// QCoreApplication::setOrganizationName("RustySoft");
QCoreApplication::setOrganizationDomain("rustysoft.de");
QCoreApplication::setApplicationName("KIMA2");
QCoreApplication::setApplicationName("kima2");
QTranslator qTranslator;
QLocale german(QLocale::German);
#ifdef __linux__
qTranslator.load("qt_" + german.name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
qTranslator.load("qt_" + german.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
#endif
#ifdef _WIN32
qTranslator.load("qt_" + german.name(),

View file

@ -18,6 +18,8 @@
#include <QFileDialog>
#include <QMessageBox>
#include <QSettings>
#include <QStandardPaths>
#include <QtGui/QDesktopServices>
constexpr int STATUSBAR_TIMEOUT = 5000;
@ -55,6 +57,14 @@ MainWindow::MainWindow()
&MainWindow::onCancelAllArticlesButtonClicked);
connect(ui_.aboutQtAction, &QAction::triggered, this, &MainWindow::onAboutQt);
connect(ui_.aboutAction, &QAction::triggered, this, &MainWindow::onAbout);
connect(ui_.openManualAction, &QAction::triggered, this, []() {
auto locations = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
for (auto location : locations) {
if (QFile::exists(location + QString("/Benutzerhandbuch.pdf"))) {
QDesktopServices::openUrl(location + QString("/Benutzerhandbuch.pdf"));
}
}
});
connect(ui_.reportAction, &QAction::triggered, this, [=]() { ReportDialog(this).exec(); });
connect(ui_.configAction, &QAction::triggered, this, [=]() {
int result = SettingsDialog(this).exec();

View file

@ -420,6 +420,7 @@ drucken</string>
</property>
<addaction name="aboutAction"/>
<addaction name="aboutQtAction"/>
<addaction name="openManualAction"/>
</widget>
<widget class="QMenu" name="menuSales">
<property name="title">
@ -494,6 +495,11 @@ drucken</string>
<string>Importieren von anderer Kasse (JSON)</string>
</property>
</action>
<action name="openManualAction">
<property name="text">
<string>Handbuch</string>
</property>
</action>
</widget>
<resources/>
<connections/>

View file

@ -20,6 +20,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(par
int feeInPercent = settings.value("global/feeInPercent").toInt();
int maxFeeInEuro = settings.value("global/maxFeeInEuro").toInt();
if (parent)
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
ui_.cashPointNoSpinBox->setValue(cashPointNo);
@ -61,7 +62,7 @@ void SettingsDialog::accept()
if (oldCashPointNo != newCashPointNo) {
int result{0};
if (market_->getSales().size() > 0) {
if (market_ && market_->getSales().size() > 0) {
result = QMessageBox(QMessageBox::Icon::Question, "Sind Sie sicher?",
"Möchten Sie die Kassen-Nr wirklich ändern? Diese muss über alle "
"Installationen hinweg eindeutig sein.",