Skip to content

Commit

Permalink
Merge pull request #1 from Appsmata/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JacksiroKe authored Dec 12, 2021
2 parents 82abe72 + e63a351 commit 2789ed0
Show file tree
Hide file tree
Showing 34 changed files with 2,622 additions and 1,554 deletions.
3 changes: 0 additions & 3 deletions .vs/ProjectSettings.json

This file was deleted.

6 changes: 0 additions & 6 deletions .vs/VSWorkspaceState.json

This file was deleted.

Binary file removed .vs/slnx.sqlite
Binary file not shown.
Binary file removed Debug/res/icons/appicon.ico
Binary file not shown.
Binary file removed Debug/res/images/appicon.png
Binary file not shown.
Binary file removed Debug/res/images/splash.png
Binary file not shown.
22 changes: 22 additions & 0 deletions src/.qmake.stash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1929
QMAKE_CXX.QMAKE_MSC_FULL_VER = 192930137
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_MSC_VER \
QMAKE_MSC_FULL_VER
QMAKE_CXX.INCDIRS = \
"D:\\Dev\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\ATLMFC\\include" \
"D:\\Dev\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\include" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um" \
"D:\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt" \
"D:\\Windows Kits\\10\\include\\10.0.19041.0\\shared" \
"D:\\Windows Kits\\10\\include\\10.0.19041.0\\um" \
"D:\\Windows Kits\\10\\include\\10.0.19041.0\\winrt" \
"D:\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"
QMAKE_CXX.LIBDIRS = \
"D:\\Dev\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\ATLMFC\\lib\\x86" \
"D:\\Dev\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x86" \
"D:\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x86" \
"D:\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x86"
42 changes: 3 additions & 39 deletions src/data/app_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <QDateTime>

#include "app_database.h"
#include "../utils/database_utils.h"
#include "../utils/preferences_utils.h"
#include "../utils/db_utils.h"
#include "../utils/pref_utils.h"

AppDatabase::AppDatabase()
{
Expand Down Expand Up @@ -141,42 +141,6 @@ void AppDatabase::initDbOperations()
if (!appDB.tables().contains(Tables::search())) {
qDebug() << "Creating DB table: " + Tables::search() + " failed.";
}

//Creating Preferences Table
QSqlQuery qry5(appDB);
if (!qry5.exec(DbQueries::createPreferenceTable())) {
qDebug() << qry5.lastError().text();
}

if (!appDB.tables().contains(Tables::preferences())) {
qDebug() << "Creating DB table: " + Tables::preferences() + " failed.";
}

addValue(PrefUtils::preferencesAppUser(), PrefDefaults::preferencesAppUser());
addValue(PrefUtils::preferencesDarkMode(), PrefDefaults::preferencesDarkMode());
addValue(PrefUtils::preferencesEditMode(), PrefDefaults::preferencesEditMode());
addValue(PrefUtils::preferencesGeneralFontBold(), PrefDefaults::preferencesGeneralFontBold());
addValue(PrefUtils::preferencesGeneralFontSize(), PrefDefaults::preferencesGeneralFontSize());
addValue(PrefUtils::preferencesGeneralFontType(), PrefDefaults::preferencesGeneralFontType());
addValue(PrefUtils::preferencesInstalledDate(), PrefDefaults::preferencesInstalledDate());
addValue(PrefUtils::preferencesLanguage(), PrefDefaults::preferencesLanguage());
addValue(PrefUtils::preferencesLastWindowStartup(), PrefDefaults::preferencesLastWindowStartup());
addValue(PrefUtils::preferencesLastWindowWidth(), PrefDefaults::preferencesLastWindowWidth());
addValue(PrefUtils::preferencesListFontBold(), PrefDefaults::preferencesListFontBold());
addValue(PrefUtils::preferencesPresentFontBold(), PrefDefaults::preferencesPresentFontBold());
addValue(PrefUtils::preferencesPresentFontSize(), PrefDefaults::preferencesPresentFontSize());
addValue(PrefUtils::preferencesPresentFontType(), PrefDefaults::preferencesPresentFontType());
addValue(PrefUtils::preferencesPreviewFontBold(), PrefDefaults::preferencesPreviewFontBold());
addValue(PrefUtils::preferencesPreviewFontSize(), PrefDefaults::preferencesPreviewFontSize());
addValue(PrefUtils::preferencesPreviewFontType(), PrefDefaults::preferencesPreviewFontType());
addValue(PrefUtils::preferencesSearchAllbooks(), PrefDefaults::preferencesSearchAllbooks());
addValue(PrefUtils::preferencesSelectedBook(), PrefDefaults::preferencesSelectedBook());
addValue(PrefUtils::preferencesSelectedSong(), PrefDefaults::preferencesSelectedSong());
addValue(PrefUtils::preferencesShowHelpFirst(), PrefDefaults::preferencesShowHelpFirst());
addValue(PrefUtils::preferencesShowStartpage(), PrefDefaults::preferencesShowStartpage());
addValue(PrefUtils::preferencesTabletMode(), PrefDefaults::preferencesTabletMode());
addValue(PrefUtils::preferencesTheme(), PrefDefaults::preferencesTheme());

}

void AppDatabase::checkPreferences()
Expand Down Expand Up @@ -548,4 +512,4 @@ void AppDatabase::updateValue(QString key, QString value)
AppDatabase::~AppDatabase()
{

}
}
2 changes: 1 addition & 1 deletion src/data/delegates/pref_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <QDebug>

#include "pref_delegate.h"
#include "../data/models/preference.h"
#include "data/models/preference.h"

PrefDelegate::PrefDelegate(QObject* parent) : QStyledItemDelegate(parent) { }

Expand Down
4 changes: 2 additions & 2 deletions src/data/delegates/song_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <QDebug>

#include "song_delegate.h"
#include "../data/models/song.h"
#include "../utils/app_utils.h"
#include "data/models/song.h"
#include "utils/app_utils.h"

SongDelegate::SongDelegate(QObject* parent) : QStyledItemDelegate(parent) { }

Expand Down
19 changes: 14 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <QThread>

#include "data/app_database.h"
#include "utils/app_utils.h"
#include "utils/pref_utils.h"
#include "ui/home_window.h"

int main(int argc, char* argv[])
Expand All @@ -17,15 +19,22 @@ int main(int argc, char* argv[])
app.processEvents();
splash.close();

QCoreApplication::setApplicationName("vSongBook");
QCoreApplication::setApplicationVersion("3.1.0");
QCoreApplication::setOrganizationName("Appsmata Solutions");
QCoreApplication::setOrganizationDomain("vsongbook.appsmata.com");

//Check if database exists otherwise create it
AppDatabase* appDb = new AppDatabase();
appDb->checkDatabase();

QSettings preferences(AppUtils::appName(), AppUtils::orgDomain());

if (!preferences.value(PrefUtils::prefsFirstInstall()).toBool())
{
QCoreApplication::setApplicationName(AppUtils::appName());
QCoreApplication::setApplicationVersion(AppUtils::appVersion());
QCoreApplication::setOrganizationName(AppUtils::orgName());
QCoreApplication::setOrganizationDomain(AppUtils::orgDomain());

PrefUtils::defaultPrefs();
}

HomeWindow home;
home.showMaximized();
return app.exec();
Expand Down
Binary file modified src/res/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2789ed0

Please sign in to comment.