Skip to content

Commit c153fad

Browse files
committed
Settings: Hide frame containing encoder combobo if the label and the combobox are not visible: move settings to inifile: fix path for custom vehicles: fix the build configuration and remove unnecesry qt parts.
1 parent b183e00 commit c153fad

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

src/RGSettingsDialog.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ RGSettingsDialog::RGSettingsDialog(RGEncVideo *videoSettings,QWidget *parent)
3939
ui.encoderSelectionLabel->setVisible(false);
4040
#endif
4141

42+
if (!ui.encoderSelectionCB->isVisible() && !ui.encoderSelectionLabel->isVisible()){
43+
ui.groupBox_2->setVisible(false);
44+
45+
}
46+
4247

4348
mGenerateBeginEndFramesCB = ui.mIconLessBeginEndFramesCB;
4449
mSmoothLengthSB = ui.mSmoothLengthSB;
@@ -55,7 +60,7 @@ RGSettingsDialog::RGSettingsDialog(RGEncVideo *videoSettings,QWidget *parent)
5560

5661
RGSettingsDialog::~RGSettingsDialog()
5762
{
58-
ui.tabWidget->widget(0)->setParent(NULL);
63+
ui.tabWidget->widget(0)->setParent(nullptr);
5964
}
6065

6166
int RGSettingsDialog::getSmoothCoef()
@@ -81,8 +86,8 @@ void RGSettingsDialog::on_encoderSelectionCB_activated(const QString &text)
8186
void RGSettingsDialog::accept()
8287
{
8388
//Advanced settings
84-
if (mVideoEncoder->encoderName() != ui.encoderSelectionCB->currentText())
85-
{
89+
if (ui.encoderSelectionCB->isVisible() && mVideoEncoder->encoderName() != ui.encoderSelectionCB->currentText())
90+
{
8691
QMessageBox::StandardButton answer = QMessageBox::question (this, "Encoder changed",
8792
"Changing the encoder will reset the movie generation codec settings. Continue?",
8893
QMessageBox::Yes | QMessageBox::No,
@@ -97,7 +102,7 @@ void RGSettingsDialog::accept()
97102
ui.encoderSelectionCB->setCurrentIndex(ui.encoderSelectionCB->findText(RGSettings::getVideoEncoder()));
98103
return;
99104
}
100-
}
105+
}
101106

102107
RGSettings::setVideoEncoder(ui.encoderSelectionCB->currentText());
103108
RGSettings::setSmoothLength(mSmoothLengthSB->value());

src/RGVehicleList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ RGVehicleList::RGVehicleList()
4545

4646
//Also look in user's local data directory for custom vehicles
4747
//TODO: Should also be working on linux: check! then above linux dependent block can be removed!
48-
vehicleDir.setPath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/vehicles");
48+
vehicleDir.setPath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/vehicles");
4949
if (vehicleDir.exists())
5050
{
5151
vehicles.append(vehicleDir.entryInfoList());

src/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <QMessageBox>
2424
#include <QFile>
2525
#include <QFileDialog>
26+
#include <QSettings>
2627

2728
#include "RGApplicationName.h"
2829
#include "RGMainWindow.h"
@@ -73,16 +74,20 @@
7374
* v1.7.1 FFMpeg default converter and provided with the installation
7475
*/
7576

76-
extern const QString applicationName("Route Generator version 1.7.1");
77+
extern const QString applicationName("Route Generator version 1.7.1a");
7778

7879
int main(int argc, char *argv[])
7980
{
8081
QApplication app(argc, argv);
8182

8283
//For storing application settings
84+
QSettings::setDefaultFormat(QSettings::IniFormat);
85+
//ToDo: Make a self contained settings inside the app executable directory
86+
//for a portable version of the app
8387
app.setOrganizationName("MJProductions");
8488
app.setApplicationName("Route Generator");
8589

90+
8691
RGMainWindow *mainWindow = new RGMainWindow;
8792
mainWindow->setWindowTitle(applicationName);
8893

src/routegen.pro

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
######################################################################
44

55
TEMPLATE = app
6-
CONFIG += debug release
7-
TARGET = routegen
6+
CONFIG += debug_and_release
7+
CONFIG(debug, debug|release) {
8+
TARGET = "routegen_debug"
9+
} else {
10+
TARGET = "routegen"
11+
}
812
DEPENDPATH += .
913
INCLUDEPATH += .
1014
MOC_DIR = ./build/moc
1115
OBJECTS_DIR = ./build/obj
1216
UI_DIR = ./build/ui
13-
#QT += webkit
14-
QT += gui core webengine widgets webenginewidgets
17+
QT += webenginewidgets
1518

1619
# Input
1720
HEADERS += RGMainWindow.h RGVehicleDialog.h RGSettings.h RGSettingsDialog.h RGGoogleMap.h \

0 commit comments

Comments
 (0)