open manual
This commit is contained in:
parent
df8f4bfd40
commit
a196e49410
4 changed files with 25 additions and 16 deletions
|
@ -2,36 +2,28 @@
|
|||
|
||||
#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(),
|
||||
QApplication::applicationDirPath() + QDir::separator() + "translations");
|
||||
QApplication::applicationDirPath() + QDir::separator() + "translations");
|
||||
#endif
|
||||
kimaApp.installTranslator(&qTranslator);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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/>
|
||||
|
|
|
@ -20,7 +20,8 @@ SettingsDialog::SettingsDialog(QWidget* parent, Qt::WindowFlags f) : QDialog(par
|
|||
int feeInPercent = settings.value("global/feeInPercent").toInt();
|
||||
int maxFeeInEuro = settings.value("global/maxFeeInEuro").toInt();
|
||||
|
||||
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
|
||||
if (parent)
|
||||
market_ = dynamic_cast<MainWindow*>(parent)->getMarketplace();
|
||||
|
||||
ui_.cashPointNoSpinBox->setValue(cashPointNo);
|
||||
// ui_.posPrinterDeviceEdit->setText(posPrinterDevice);
|
||||
|
@ -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.",
|
||||
|
|
Loading…
Reference in a new issue