- 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
|
||||
};
|
||||
|
||||
class ClientInitEvent: public QEvent
|
||||
template <int N>
|
||||
class ClientEvent: public QEvent
|
||||
{
|
||||
private:
|
||||
int mType = N;
|
||||
public:
|
||||
ClientInitEvent();
|
||||
ClientEvent<N>()
|
||||
:QEvent(static_cast<QEvent::Type>(N))
|
||||
{}
|
||||
};
|
||||
|
||||
class ClientCloseEvent: public QEvent
|
||||
class SelectTaskEvent: public ClientEvent<SelectTaskId>
|
||||
{
|
||||
public:
|
||||
ClientCloseEvent();
|
||||
};
|
||||
SelectTaskEvent(PTask task) {
|
||||
mTask = task;
|
||||
}
|
||||
|
||||
class AttachDatabaseEvent: public QEvent
|
||||
{
|
||||
public:
|
||||
AttachDatabaseEvent();
|
||||
};
|
||||
|
||||
class SelectTaskEvent: public QEvent
|
||||
{
|
||||
public:
|
||||
SelectTaskEvent(PTask task);
|
||||
PTask task();
|
||||
PTask task() {
|
||||
return mTask;
|
||||
}
|
||||
|
||||
protected:
|
||||
PTask mTask;
|
||||
};
|
||||
|
||||
class UiInitEvent: public QEvent
|
||||
{
|
||||
public:
|
||||
UiInitEvent();
|
||||
};
|
||||
|
||||
|
||||
#endif // APPEVENTS_H
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
// 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);
|
||||
|
||||
// init event
|
||||
QApplication::postEvent(this, new UiInitEvent());
|
||||
QApplication::postEvent(this, new ClientEvent<UiInitId>());
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
@ -102,7 +102,7 @@ void MainWindow::attachDatabase()
|
||||
askDbPassword(tr("Invalid password, please try again."));
|
||||
}
|
||||
else
|
||||
QApplication::postEvent(this, new UiInitEvent());
|
||||
QApplication::postEvent(this, new ClientEvent<UiInitId>());
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -430,7 +430,6 @@ void MainWindow::customEvent(QEvent *ev)
|
||||
|
||||
case static_cast<QEvent::Type>(UiInitId):
|
||||
setupMainUi();
|
||||
connectUiToDatabase();
|
||||
loadGeometry();
|
||||
break;
|
||||
|
||||
@ -439,6 +438,12 @@ void MainWindow::customEvent(QEvent *ev)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onDatabaseAvailable()
|
||||
{
|
||||
connectUiToDatabase();
|
||||
mStackedViews->setCurrentIndex(ViewIndex_Main);
|
||||
}
|
||||
|
||||
void MainWindow::preferences()
|
||||
{
|
||||
PreferencesDlg pref(this, *mSettings);
|
||||
@ -845,7 +850,7 @@ void MainWindow::setupMainUi()
|
||||
FvUpdater::sharedUpdater()->SetFeedURL("http://satorilight.com/LittAppCast.xml");
|
||||
#endif
|
||||
initClient();
|
||||
QApplication::postEvent(this, new AttachDatabaseEvent());
|
||||
QApplication::postEvent(this, new ClientEvent<AttachDatabaseId>());
|
||||
}
|
||||
|
||||
void MainWindow::buildPasswordView()
|
||||
@ -1442,7 +1447,7 @@ void MainWindow::showTimeReport()
|
||||
|
||||
void MainWindow::criticalAlertFinished(int /*status*/)
|
||||
{
|
||||
QApplication::postEvent(this, new ClientCloseEvent());
|
||||
QApplication::postEvent(this, new ClientEvent<ClientCloseId>());
|
||||
}
|
||||
|
||||
void MainWindow::warningAlertFinished(int /*status*/)
|
||||
@ -1674,7 +1679,7 @@ void MainWindow::onDbPasswordEntered(const QString& password)
|
||||
askDbPassword(tr("Invalid password, please try again."));
|
||||
}
|
||||
else
|
||||
QApplication::postEvent(this, new UiInitEvent());
|
||||
onDatabaseAvailable();
|
||||
}
|
||||
|
||||
void MainWindow::onDbPasswordCancelled()
|
||||
@ -1700,7 +1705,7 @@ void MainWindow::onNewDbPasswordEntered(const QString& password)
|
||||
showFatal(tr("Failed to create new database. Exiting."));
|
||||
}
|
||||
else
|
||||
QApplication::postEvent(this, new UiInitEvent());
|
||||
onDatabaseAvailable();
|
||||
}
|
||||
|
||||
void MainWindow::onDatabaseChanged(const QString& path)
|
||||
@ -1710,6 +1715,7 @@ void MainWindow::onDatabaseChanged(const QString& path)
|
||||
mSettings->save();
|
||||
Storage::instance().setPath(path);
|
||||
|
||||
// Try to open database
|
||||
askDbPassword();
|
||||
}
|
||||
|
||||
|
||||
@ -159,6 +159,7 @@ private:
|
||||
void buildOpenOrCreateView();
|
||||
void buildMainView();
|
||||
|
||||
void onDatabaseAvailable();
|
||||
signals:
|
||||
void onTimeFormatChanged();
|
||||
void onTimeChanged();
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<width>16000</width>
|
||||
<height>400</height>
|
||||
</size>
|
||||
</property>
|
||||
|
||||
@ -59,7 +59,7 @@ void Settings::load()
|
||||
QString Settings::getDatabasePath()
|
||||
{
|
||||
// Path to settings file
|
||||
QString path = helper::path::pathToSettings();
|
||||
QString path;// = helper::path::pathToSettings();
|
||||
|
||||
QString stored_path = data()[KEY_DB_FILENAME].toString();
|
||||
if (!stored_path.isEmpty())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user