open manual
This commit is contained in:
parent
df8f4bfd40
commit
a196e49410
4 changed files with 25 additions and 16 deletions
|
@ -2,32 +2,24 @@
|
||||||
|
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QLibraryInfo>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QLibraryInfo>
|
|
||||||
#include <QDir>
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
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};
|
QApplication kimaApp{argc, argv};
|
||||||
|
|
||||||
QCoreApplication::setOrganizationName("RustySoft");
|
// QCoreApplication::setOrganizationName("RustySoft");
|
||||||
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
||||||
QCoreApplication::setApplicationName("KIMA2");
|
QCoreApplication::setApplicationName("kima2");
|
||||||
|
|
||||||
QTranslator qTranslator;
|
QTranslator qTranslator;
|
||||||
QLocale german(QLocale::German);
|
QLocale german(QLocale::German);
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
qTranslator.load("qt_" + german.name(),
|
qTranslator.load("qt_" + german.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
qTranslator.load("qt_" + german.name(),
|
qTranslator.load("qt_" + german.name(),
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
#include <QtGui/QDesktopServices>
|
||||||
|
|
||||||
constexpr int STATUSBAR_TIMEOUT = 5000;
|
constexpr int STATUSBAR_TIMEOUT = 5000;
|
||||||
|
|
||||||
|
@ -55,6 +57,14 @@ MainWindow::MainWindow()
|
||||||
&MainWindow::onCancelAllArticlesButtonClicked);
|
&MainWindow::onCancelAllArticlesButtonClicked);
|
||||||
connect(ui_.aboutQtAction, &QAction::triggered, this, &MainWindow::onAboutQt);
|
connect(ui_.aboutQtAction, &QAction::triggered, this, &MainWindow::onAboutQt);
|
||||||
connect(ui_.aboutAction, &QAction::triggered, this, &MainWindow::onAbout);
|
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_.reportAction, &QAction::triggered, this, [=]() { ReportDialog(this).exec(); });
|
||||||
connect(ui_.configAction, &QAction::triggered, this, [=]() {
|
connect(ui_.configAction, &QAction::triggered, this, [=]() {
|
||||||
int result = SettingsDialog(this).exec();
|
int result = SettingsDialog(this).exec();
|
||||||
|
|
|
@ -420,6 +420,7 @@ drucken</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="aboutAction"/>
|
<addaction name="aboutAction"/>
|
||||||
<addaction name="aboutQtAction"/>
|
<addaction name="aboutQtAction"/>
|
||||||
|
<addaction name="openManualAction"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuSales">
|
<widget class="QMenu" name="menuSales">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
@ -494,6 +495,11 @@ drucken</string>
|
||||||
<string>Importieren von anderer Kasse (JSON)</string>
|
<string>Importieren von anderer Kasse (JSON)</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="openManualAction">
|
||||||
|
<property name="text">
|
||||||
|
<string>Handbuch</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -20,6 +20,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(par
|
||||||
int feeInPercent = settings.value("global/feeInPercent").toInt();
|
int feeInPercent = settings.value("global/feeInPercent").toInt();
|
||||||
int maxFeeInEuro = settings.value("global/maxFeeInEuro").toInt();
|
int maxFeeInEuro = settings.value("global/maxFeeInEuro").toInt();
|
||||||
|
|
||||||
|
if (parent)
|
||||||
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
|
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
|
||||||
|
|
||||||
ui_.cashPointNoSpinBox->setValue(cashPointNo);
|
ui_.cashPointNoSpinBox->setValue(cashPointNo);
|
||||||
|
@ -61,7 +62,7 @@ void SettingsDialog::accept()
|
||||||
|
|
||||||
if (oldCashPointNo != newCashPointNo) {
|
if (oldCashPointNo != newCashPointNo) {
|
||||||
int result{0};
|
int result{0};
|
||||||
if (market_->getSales().size() > 0) {
|
if (market_ && market_->getSales().size() > 0) {
|
||||||
result = QMessageBox(QMessageBox::Icon::Question, "Sind Sie sicher?",
|
result = QMessageBox(QMessageBox::Icon::Question, "Sind Sie sicher?",
|
||||||
"Möchten Sie die Kassen-Nr wirklich ändern? Diese muss über alle "
|
"Möchten Sie die Kassen-Nr wirklich ändern? Diese muss über alle "
|
||||||
"Installationen hinweg eindeutig sein.",
|
"Installationen hinweg eindeutig sein.",
|
||||||
|
|
Loading…
Reference in a new issue