- fixes for Linux
This commit is contained in:
parent
5a328a7518
commit
201ecac7b3
3
README.txt
Normal file
3
README.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Linux:
|
||||||
|
Please don't forget before build:
|
||||||
|
sudo apt install mesa-common-dev libglu1-mesa-dev
|
||||||
@ -1,27 +0,0 @@
|
|||||||
#include "appevents.h"
|
|
||||||
|
|
||||||
ClientInitEvent::ClientInitEvent()
|
|
||||||
:QEvent(static_cast<Type>(ClientInitId))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientCloseEvent::ClientCloseEvent()
|
|
||||||
:QEvent(static_cast<Type>(ClientCloseId))
|
|
||||||
{}
|
|
||||||
|
|
||||||
AttachDatabaseEvent::AttachDatabaseEvent()
|
|
||||||
:QEvent(static_cast<Type>(AttachDatabaseId))
|
|
||||||
{}
|
|
||||||
|
|
||||||
SelectTaskEvent::SelectTaskEvent(PTask task)
|
|
||||||
:QEvent(static_cast<Type>(SelectTaskId)), mTask(task)
|
|
||||||
{}
|
|
||||||
|
|
||||||
PTask SelectTaskEvent::task()
|
|
||||||
{
|
|
||||||
return mTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
UiInitEvent::UiInitEvent()
|
|
||||||
:QEvent(static_cast<Type>(UiInitId))
|
|
||||||
{}
|
|
||||||
@ -12,39 +12,30 @@ enum
|
|||||||
UiInitId
|
UiInitId
|
||||||
};
|
};
|
||||||
|
|
||||||
class ClientInitEvent: public QEvent
|
template <int N>
|
||||||
|
class ClientEvent: public QEvent
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
int mType = N;
|
||||||
public:
|
public:
|
||||||
ClientInitEvent();
|
ClientEvent<N>()
|
||||||
|
:QEvent(static_cast<QEvent::Type>(N))
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ClientCloseEvent: public QEvent
|
class SelectTaskEvent: public ClientEvent<SelectTaskId>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ClientCloseEvent();
|
SelectTaskEvent(PTask task) {
|
||||||
};
|
mTask = task;
|
||||||
|
}
|
||||||
|
|
||||||
class AttachDatabaseEvent: public QEvent
|
PTask task() {
|
||||||
{
|
return mTask;
|
||||||
public:
|
}
|
||||||
AttachDatabaseEvent();
|
|
||||||
};
|
|
||||||
|
|
||||||
class SelectTaskEvent: public QEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SelectTaskEvent(PTask task);
|
|
||||||
PTask task();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PTask mTask;
|
PTask mTask;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UiInitEvent: public QEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
UiInitEvent();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // APPEVENTS_H
|
#endif // APPEVENTS_H
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
// Auto generated file ! Please do not edit !
|
// Auto generated file ! Please do not edit !
|
||||||
#define APP_BUILD_NUMBER 154
|
#define APP_BUILD_NUMBER 170
|
||||||
@ -67,7 +67,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
this->setUpdatesEnabled(true);
|
this->setUpdatesEnabled(true);
|
||||||
|
|
||||||
// init event
|
// init event
|
||||||
QApplication::postEvent(this, new UiInitEvent());
|
QApplication::postEvent(this, new ClientEvent<UiInitId>());
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -102,7 +102,7 @@ void MainWindow::attachDatabase()
|
|||||||
askDbPassword(tr("Invalid password, please try again."));
|
askDbPassword(tr("Invalid password, please try again."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
QApplication::postEvent(this, new UiInitEvent());
|
QApplication::postEvent(this, new ClientEvent<UiInitId>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -430,7 +430,6 @@ void MainWindow::customEvent(QEvent *ev)
|
|||||||
|
|
||||||
case static_cast<QEvent::Type>(UiInitId):
|
case static_cast<QEvent::Type>(UiInitId):
|
||||||
setupMainUi();
|
setupMainUi();
|
||||||
connectUiToDatabase();
|
|
||||||
loadGeometry();
|
loadGeometry();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -439,6 +438,12 @@ void MainWindow::customEvent(QEvent *ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onDatabaseAvailable()
|
||||||
|
{
|
||||||
|
connectUiToDatabase();
|
||||||
|
mStackedViews->setCurrentIndex(ViewIndex_Main);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::preferences()
|
void MainWindow::preferences()
|
||||||
{
|
{
|
||||||
PreferencesDlg pref(this, *mSettings);
|
PreferencesDlg pref(this, *mSettings);
|
||||||
@ -845,7 +850,7 @@ void MainWindow::setupMainUi()
|
|||||||
FvUpdater::sharedUpdater()->SetFeedURL("http://satorilight.com/LittAppCast.xml");
|
FvUpdater::sharedUpdater()->SetFeedURL("http://satorilight.com/LittAppCast.xml");
|
||||||
#endif
|
#endif
|
||||||
initClient();
|
initClient();
|
||||||
QApplication::postEvent(this, new AttachDatabaseEvent());
|
QApplication::postEvent(this, new ClientEvent<AttachDatabaseId>());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::buildPasswordView()
|
void MainWindow::buildPasswordView()
|
||||||
@ -1442,7 +1447,7 @@ void MainWindow::showTimeReport()
|
|||||||
|
|
||||||
void MainWindow::criticalAlertFinished(int /*status*/)
|
void MainWindow::criticalAlertFinished(int /*status*/)
|
||||||
{
|
{
|
||||||
QApplication::postEvent(this, new ClientCloseEvent());
|
QApplication::postEvent(this, new ClientEvent<ClientCloseId>());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::warningAlertFinished(int /*status*/)
|
void MainWindow::warningAlertFinished(int /*status*/)
|
||||||
@ -1674,7 +1679,7 @@ void MainWindow::onDbPasswordEntered(const QString& password)
|
|||||||
askDbPassword(tr("Invalid password, please try again."));
|
askDbPassword(tr("Invalid password, please try again."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
QApplication::postEvent(this, new UiInitEvent());
|
onDatabaseAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onDbPasswordCancelled()
|
void MainWindow::onDbPasswordCancelled()
|
||||||
@ -1700,7 +1705,7 @@ void MainWindow::onNewDbPasswordEntered(const QString& password)
|
|||||||
showFatal(tr("Failed to create new database. Exiting."));
|
showFatal(tr("Failed to create new database. Exiting."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
QApplication::postEvent(this, new UiInitEvent());
|
onDatabaseAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onDatabaseChanged(const QString& path)
|
void MainWindow::onDatabaseChanged(const QString& path)
|
||||||
@ -1710,6 +1715,7 @@ void MainWindow::onDatabaseChanged(const QString& path)
|
|||||||
mSettings->save();
|
mSettings->save();
|
||||||
Storage::instance().setPath(path);
|
Storage::instance().setPath(path);
|
||||||
|
|
||||||
|
// Try to open database
|
||||||
askDbPassword();
|
askDbPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -159,6 +159,7 @@ private:
|
|||||||
void buildOpenOrCreateView();
|
void buildOpenOrCreateView();
|
||||||
void buildMainView();
|
void buildMainView();
|
||||||
|
|
||||||
|
void onDatabaseAvailable();
|
||||||
signals:
|
signals:
|
||||||
void onTimeFormatChanged();
|
void onTimeFormatChanged();
|
||||||
void onTimeChanged();
|
void onTimeChanged();
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>400</width>
|
<width>16000</width>
|
||||||
<height>400</height>
|
<height>400</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@ -59,7 +59,7 @@ void Settings::load()
|
|||||||
QString Settings::getDatabasePath()
|
QString Settings::getDatabasePath()
|
||||||
{
|
{
|
||||||
// Path to settings file
|
// Path to settings file
|
||||||
QString path = helper::path::pathToSettings();
|
QString path;// = helper::path::pathToSettings();
|
||||||
|
|
||||||
QString stored_path = data()[KEY_DB_FILENAME].toString();
|
QString stored_path = data()[KEY_DB_FILENAME].toString();
|
||||||
if (!stored_path.isEmpty())
|
if (!stored_path.isEmpty())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user