Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some additional logs and notes #249

Merged
merged 2 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ set(CPACK_PACKAGE_VERSION_MAJOR "${ANTIMICROX_MAJOR_VERSION}")
set(CPACK_PACKAGE_VERSION_MINOR "${ANTIMICROX_MINOR_VERSION}")
set(CPACK_PACKAGE_VERSION_PATCH "${ANTIMICROX_PATCH_VERSION}")

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-dbg")
endif()

set(CPACK_PACKAGE_FILE_NAME "antimicrox-${ANTIMICROX_MAJOR_VERSION}.${ANTIMICROX_MINOR_VERSION}.${ANTIMICROX_PATCH_VERSION}-${CMAKE_HOST_SYSTEM_PROCESSOR}")

set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
Expand Down
10 changes: 7 additions & 3 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,13 @@ const int ANTIMICROX_MINOR_VERSION = PROJECT_MINOR_VERSION;
const int ANTIMICROX_PATCH_VERSION = PROJECT_PATCH_VERSION;

const QString programVersion =
(ANTIMICROX_PATCH_VERSION > 0)
? QString("%1.%2.%3").arg(ANTIMICROX_MAJOR_VERSION).arg(ANTIMICROX_MINOR_VERSION).arg(ANTIMICROX_PATCH_VERSION)
: QString("%1.%2").arg(ANTIMICROX_MAJOR_VERSION).arg(ANTIMICROX_MINOR_VERSION);
((ANTIMICROX_PATCH_VERSION > 0)
? QString("%1.%2.%3").arg(ANTIMICROX_MAJOR_VERSION).arg(ANTIMICROX_MINOR_VERSION).arg(ANTIMICROX_PATCH_VERSION)
: QString("%1.%2").arg(ANTIMICROX_MAJOR_VERSION).arg(ANTIMICROX_MINOR_VERSION))
#ifdef QT_DEBUG
+ "-d"
#endif
;

extern QWaitCondition waitThisOut;
extern QMutex sdlWaitMutex;
Expand Down
4 changes: 4 additions & 0 deletions src/joytabwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ void JoyTabWidget::changeJoyConfig(int index)
if (index > 0)
{
filename = configBox->itemData(index).toString();
qInfo() << "Change joystick " << m_joystick->getSDLName() << " profile to: " << filename;
}

if (!filename.isEmpty())
Expand Down Expand Up @@ -964,6 +965,7 @@ void JoyTabWidget::changeJoyConfig(int index)

void JoyTabWidget::saveSettings()
{
qInfo() << "Saving config settings: " << configBox->currentText() << " for controller: " << m_joystick->getSDLName();
QString filename = "";
QString lastfile = "";

Expand Down Expand Up @@ -1088,6 +1090,7 @@ void JoyTabWidget::saveSettings()

void JoyTabWidget::loadSettings(bool forceRefresh)
{
qInfo() << "Loading device settings for: " << m_joystick->getSDLName();
disconnect(configBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&JoyTabWidget::changeJoyConfig);

Expand Down Expand Up @@ -1430,6 +1433,7 @@ void JoyTabWidget::unloadConfig() { configBox->setCurrentIndex(0); }

void JoyTabWidget::saveDeviceSettings(bool sync)
{
qInfo() << "Saving device settings.";
m_settings->getLock()->lock();
m_settings->beginGroup("Controllers");
m_settings->getLock()->unlock();
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ int main(int argc, char *argv[])
{
mainWindow.saveAppConfig();
}
qDebug() << "Closing this app instance";

mainWindow.removeJoyTabs();
QObject::connect(&antimicrox, &QApplication::aboutToQuit, joypad_worker.data(), &InputDaemon::quit);
Expand Down
2 changes: 2 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ void MainWindow::saveAppConfig()
{
if (m_joysticks->size() > 0)
{
qInfo() << "Started saving app config";
JoyTabWidget *temptabwidget = qobject_cast<JoyTabWidget *>(ui->tabWidget->widget(0)); // static_cast
m_settings->setValue("DisplayNames", temptabwidget->isDisplayingNames() ? "1" : "0");

Expand Down Expand Up @@ -765,6 +766,7 @@ void MainWindow::saveAppConfig()
}

m_settings->endGroup();
qDebug() << "App config saved";
}

m_settings->setValue("WindowSize", size());
Expand Down