Verified Commit a09b1127 authored by Tobias WEBER's avatar Tobias WEBER
Browse files

cleanups

parent fdf79acf
......@@ -199,13 +199,15 @@ if [ $create_appdir -ne 0 ]; then
cp -rv /usr/local/opt/qt@5/plugins/platforms "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
cp -rv /usr/local/opt/qt@5/plugins/styles "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
#cp -rv /usr/local/opt/qt@5/plugins/renderers "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
#cp -rv /usr/local/opt/qt@5/plugins/imageformats "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
#cp -rv /usr/local/opt/qt@5/plugins/iconengines "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
cp -rv /usr/local/opt/qt@5/plugins/imageformats "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
cp -rv /usr/local/opt/qt@5/plugins/iconengines "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
#cp -rv /usr/local/opt/qt@5/plugins/printsupport "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
#cp -rv /usr/local/opt/qt@5/plugins/platformthemes "${APPDIRNAME}/Contents/Libraries/Qt_Plugins/"
rm -fv ${APPDIRNAME}/Contents/Libraries/Qt_Plugins/platforms/libqoffscreen.dylib
rm -fv ${APPDIRNAME}/Contents/Libraries/Qt_Plugins/platforms/libqwebgl.dylib
rm -fv ${APPDIRNAME}/Contents/Libraries/Qt_Plugins/imageformats/libq[^s][^v][^g]*.dylib
echo -e "--------------------------------------------------------------------------------"
......
/**
* calculate obstacles' voronoi edge paths
* the paths builder comprises two steps:
* - it calculates the path mesh (i.e. the roadmap) of possible instrument paths
* - it calculates a specific path on the path mesh
*
* @author Tobias Weber <tweber@ill.fr>
* @date jun-2021
* @license GPLv3, see 'LICENSE' file
......
/**
* calculate obstacles' voronoi edge paths
* the paths builder comprises two steps:
* - it calculates the path mesh (i.e. the roadmap) of possible instrument paths
* - it calculates a specific path on the path mesh
*
* @author Tobias Weber <tweber@ill.fr>
* @date jun-2021
* @license GPLv3, see 'LICENSE' file
......
......@@ -70,7 +70,7 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
titleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
QLabel *labelIcon = new QLabel(titleWidget);
std::string icon_file = g_res.FindResource("res/taspaths.svg");
std::string icon_file = g_res.FindResource("taspaths.svg");
QIcon icon{icon_file.c_str()};
QPixmap pixmap = icon.pixmap(48, 48);
labelIcon->setPixmap(pixmap);
......@@ -78,13 +78,16 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
labelIcon->setFrameShadow(QFrame::Raised);
labelIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QSpacerItem *spacer = new QSpacerItem(16, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
QSpacerItem *spacerIconTitle = new QSpacerItem(16, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
titleGrid->addWidget(labelIcon, 0, 0, 1, 1, Qt::AlignVCenter);
titleGrid->addItem(spacer, 0, 1, 1, 1);
titleGrid->addItem(spacerIconTitle, 0, 1, 1, 1);
titleGrid->addWidget(labTitle, 0, 2, 1, 1, Qt::AlignVCenter);
grid->addWidget(titleWidget, y++, 0, 1, 2);
QSpacerItem *spacerTitleSubtitle = new QSpacerItem(1, 4, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacerTitleSubtitle, y++,0,1,2);
// subtitle
QLabel *labSubtitle = new QLabel("Pathfinding software for triple-axis spectrometers.", this);
QFont fontSubtitle = labSubtitle->font();
......@@ -92,23 +95,23 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
labSubtitle->setFont(fontSubtitle);
grid->addWidget(labSubtitle, y++,0,1,2);
QSpacerItem *spacer1 = new QSpacerItem(1, 10, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacer1, y++,0,1,2);
QSpacerItem *spacerBelowSubtitle = new QSpacerItem(1, 10, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacerBelowSubtitle, y++,0,1,2);
QSpacerItem *spacer2 = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
grid->addItem(spacer2, y++,0,1,2);
QSpacerItem *spacerBelowSubtitle2 = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
grid->addItem(spacerBelowSubtitle2, y++,0,1,2);
QLabel *labSubtitle1 = new QLabel("DOI: ", this);
QFont fontLabel1 = labSubtitle1->font();
QLabel *labDOI1 = new QLabel("DOI: ", this);
QFont fontLabel1 = labDOI1->font();
fontLabel1.setWeight(QFont::Bold);
labSubtitle1->setFont(fontLabel1);
grid->addWidget(labSubtitle1, y,0,1,1);
QLabel *labSubtitle2 = new QLabel(
labDOI1->setFont(fontLabel1);
grid->addWidget(labDOI1, y,0,1,1);
QLabel *labDOI2 = new QLabel(
"<a href=\"https://doi.org/10.5281/zenodo.4625649\">"
"10.5281/zenodo.4625649</a>.",
this);
labSubtitle2->setOpenExternalLinks(1);
grid->addWidget(labSubtitle2, y++,1,1,1);
labDOI2->setOpenExternalLinks(1);
grid->addWidget(labDOI2, y++,1,1,1);
QLabel *labUrl1 = new QLabel("Repositories: ", this);
fontLabel1.setWeight(QFont::Bold);
......@@ -128,8 +131,8 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
QLabel *labVersion2 = new QLabel(TASPATHS_VERSION ".", this);
grid->addWidget(labVersion2, y++,1,1,1);
QSpacerItem *spacer3 = new QSpacerItem(1, 8, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacer3, y++,0,1,2);
QSpacerItem *spacerAfterVersion = new QSpacerItem(1, 8, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacerAfterVersion, y++,0,1,2);
QLabel *labAuthor1 = new QLabel("Author: ", this);
fontLabel1.setWeight(QFont::Bold);
......@@ -141,7 +144,7 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
QLabel *labDate1 = new QLabel("Date: ", this);
labDate1->setFont(fontLabel1);
grid->addWidget(labDate1, y,0,1,1);
QLabel *labDate2 = new QLabel("February 2021 - November 2021.", this);
QLabel *labDate2 = new QLabel("February 2021 - December 2021.", this);
grid->addWidget(labDate2, y++,1,1,1);
QLabel *labLic1 = new QLabel("License: ", this);
......@@ -151,8 +154,8 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
QLabel *labLic2 = new QLabel("GNU GPL Version 3.", this);
grid->addWidget(labLic2, y++,1,1,1);
QSpacerItem *spacer4 = new QSpacerItem(1, 8, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacer4, y++,0,1,2);
QSpacerItem *spacerBeforeTimestamp = new QSpacerItem(1, 8, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacerBeforeTimestamp, y++,0,1,2);
QLabel *labBuildDate1 = new QLabel("Build Timestamp: ", this);
labBuildDate1->setFont(fontLabel1);
......@@ -185,8 +188,8 @@ AboutDlg::AboutDlg(QWidget* parent, QSettings *sett)
QLabel *labBoostLib = new QLabel(boostlib2, this);
grid->addWidget(labBoostLib, y++,1,1,1);
QSpacerItem *spacer5 = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
grid->addItem(spacer5, y++,0,1,2);
QSpacerItem *spacerBeforeButtons = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
grid->addItem(spacerBeforeButtons, y++,0,1,2);
QDialogButtonBox *buttons = new QDialogButtonBox(this);
buttons->setStandardButtons(QDialogButtonBox::Ok);
......
......@@ -948,7 +948,7 @@ PathsTool::PathsTool(QWidget* pParent) : QMainWindow{pParent}
{
setWindowTitle(TASPATHS_TITLE);
if(std::string icon_file = g_res.FindResource("res/taspaths.svg"); !icon_file.empty())
if(std::string icon_file = g_res.FindResource("taspaths.svg"); !icon_file.empty())
{
QIcon icon{icon_file.c_str()};
setWindowIcon(icon);
......@@ -1000,7 +1000,7 @@ PathsTool::PathsTool(QWidget* pParent) : QMainWindow{pParent}
auto pGrid = new QGridLayout(plotpanel);
pGrid->setSpacing(4);
pGrid->setContentsMargins(4,4,4,4);
pGrid->setContentsMargins(4, 4, 4, 4);
pGrid->addWidget(m_renderer.get(), 0,0,1,4);
......
......@@ -268,10 +268,11 @@ static constexpr void apply_settings_loop(
std::unordered_map<std::string, SettingsVariable::t_variant> SettingsDlg::s_defaults = {};
SettingsDlg::SettingsDlg(QWidget* parent, QSettings *sett)
: QDialog{parent}, m_sett{sett}
SettingsDlg::SettingsDlg(QWidget* parent, QSettings *sett, bool hide_optional_settings)
: QDialog{parent}, m_sett{sett}, m_hide_optional_settings{hide_optional_settings}
{
setWindowTitle("Settings");
setWindowTitle("Preferences");
setSizeGripEnabled(true);
// table column widths
int col0_w = 200;
......@@ -298,7 +299,7 @@ SettingsDlg::SettingsDlg(QWidget* parent, QSettings *sett)
// general settings
QWidget *panelGeneral = new QWidget(this);
QGridLayout *gridGeneral = new QGridLayout(panelGeneral);
gridGeneral->setSpacing(4);
gridGeneral->setSpacing(6);
gridGeneral->setContentsMargins(6, 6, 6, 6);
// create the settings table
......@@ -340,7 +341,7 @@ SettingsDlg::SettingsDlg(QWidget* parent, QSettings *sett)
// gui settings
QWidget *panelGui = new QWidget(this);
QGridLayout *gridGui = new QGridLayout(panelGui);
gridGui->setSpacing(4);
gridGui->setSpacing(6);
gridGui->setContentsMargins(6, 6, 6, 6);
int yGui = 0;
......@@ -380,20 +381,23 @@ SettingsDlg::SettingsDlg(QWidget* parent, QSettings *sett)
get_setting<decltype(g_use_native_dialogs)>(sett, "settings/native_dialogs", &g_use_native_dialogs);
m_checkDialogs->setChecked(g_use_native_dialogs!=0);
// gui animations
m_checkAnimations = new QCheckBox("Use animations.", panelGui);
get_setting<decltype(g_use_animations)>(sett, "settings/animations", &g_use_animations);
m_checkAnimations->setChecked(g_use_animations!=0);
// tabbed docks
m_checkTabbedDocks = new QCheckBox("Allow tabbed dock widgets.", panelGui);
get_setting<decltype(g_tabbed_docks)>(sett, "settings/tabbed_docks", &g_tabbed_docks);
m_checkTabbedDocks->setChecked(g_tabbed_docks!=0);
// nested docks
m_checkNestedDocks = new QCheckBox("Allow nested dock widgets.", panelGui);
get_setting<decltype(g_nested_docks)>(sett, "settings/nested_docks", &g_nested_docks);
m_checkNestedDocks->setChecked(g_nested_docks!=0);
if(!hide_optional_settings)
{
// gui animations
m_checkAnimations = new QCheckBox("Use animations.", panelGui);
get_setting<decltype(g_use_animations)>(sett, "settings/animations", &g_use_animations);
m_checkAnimations->setChecked(g_use_animations!=0);
// tabbed docks
m_checkTabbedDocks = new QCheckBox("Allow tabbed dock widgets.", panelGui);
get_setting<decltype(g_tabbed_docks)>(sett, "settings/tabbed_docks", &g_tabbed_docks);
m_checkTabbedDocks->setChecked(g_tabbed_docks!=0);
// nested docks
m_checkNestedDocks = new QCheckBox("Allow nested dock widgets.", panelGui);
get_setting<decltype(g_nested_docks)>(sett, "settings/nested_docks", &g_nested_docks);
m_checkNestedDocks->setChecked(g_nested_docks!=0);
}
// add widgets to layout
......@@ -404,9 +408,13 @@ SettingsDlg::SettingsDlg(QWidget* parent, QSettings *sett)
gridGui->addWidget(btnFont, yGui++,2,1,1);
gridGui->addWidget(m_checkMenubar, yGui++,0,1,3);
gridGui->addWidget(m_checkDialogs, yGui++,0,1,3);
gridGui->addWidget(m_checkAnimations, yGui++,0,1,3);
gridGui->addWidget(m_checkTabbedDocks, yGui++,0,1,3);
gridGui->addWidget(m_checkNestedDocks, yGui++,0,1,3);
if(!hide_optional_settings)
{
gridGui->addWidget(m_checkAnimations, yGui++,0,1,3);
gridGui->addWidget(m_checkTabbedDocks, yGui++,0,1,3);
gridGui->addWidget(m_checkNestedDocks, yGui++,0,1,3);
}
QSpacerItem *spacer_end = new QSpacerItem(1, 1,
QSizePolicy::Minimum, QSizePolicy::Expanding);
......@@ -566,9 +574,13 @@ void SettingsDlg::ApplySettings()
g_font = m_editFont->text();
g_use_native_menubar = m_checkMenubar->isChecked();
g_use_native_dialogs = m_checkDialogs->isChecked();
g_use_animations = m_checkAnimations->isChecked();
g_tabbed_docks = m_checkTabbedDocks->isChecked();
g_nested_docks = m_checkNestedDocks->isChecked();
if(!m_hide_optional_settings)
{
g_use_animations = m_checkAnimations->isChecked();
g_tabbed_docks = m_checkTabbedDocks->isChecked();
g_nested_docks = m_checkNestedDocks->isChecked();
}
// write out the settings
if(m_sett)
......@@ -577,9 +589,13 @@ void SettingsDlg::ApplySettings()
m_sett->setValue("settings/font", g_font);
m_sett->setValue("settings/native_menubar", g_use_native_menubar);
m_sett->setValue("settings/native_dialogs", g_use_native_dialogs);
m_sett->setValue("settings/animations", g_use_animations);
m_sett->setValue("settings/tabbed_docks", g_tabbed_docks);
m_sett->setValue("settings/nested_docks", g_nested_docks);
if(!m_hide_optional_settings)
{
m_sett->setValue("settings/animations", g_use_animations);
m_sett->setValue("settings/tabbed_docks", g_tabbed_docks);
m_sett->setValue("settings/nested_docks", g_nested_docks);
}
}
ApplyGuiSettings();
......
......@@ -51,7 +51,9 @@ public:
/**
* constructor
*/
SettingsDlg(QWidget* parent = nullptr, QSettings *sett = nullptr);
SettingsDlg(QWidget* parent = nullptr,
QSettings *sett = nullptr,
bool hide_optional_settings = false);
/**
* destructor
......@@ -80,6 +82,7 @@ protected:
private:
QSettings *m_sett{nullptr};
bool m_hide_optional_settings{false};
QTableWidget *m_table{nullptr};
QComboBox *m_comboTheme{nullptr};
......
......@@ -63,15 +63,15 @@ GeoAboutDlg::GeoAboutDlg(QWidget* parent, QSettings *sett)
QSpacerItem *spacer0 = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
grid->addItem(spacer0, y++,0,1,2);
QLabel *labSubtitle1 = new QLabel("DOI: ", this);
QFont fontLabel1 = labSubtitle1->font();
QLabel *labDOI1 = new QLabel("DOI: ", this);
QFont fontLabel1 = labDOI1->font();
fontLabel1.setWeight(QFont::Bold);
labSubtitle1->setFont(fontLabel1);
grid->addWidget(labSubtitle1, y,0,1,1);
QLabel *labSubtitle2 = new QLabel("<a href=\"https://doi.org/10.5281/zenodo.4297475\">"
labDOI1->setFont(fontLabel1);
grid->addWidget(labDOI1, y,0,1,1);
QLabel *labDOI2 = new QLabel("<a href=\"https://doi.org/10.5281/zenodo.4297475\">"
"10.5281/zenodo.4297475</a>.", this);
labSubtitle2->setOpenExternalLinks(1);
grid->addWidget(labSubtitle2, y++,1,1,1);
labDOI2->setOpenExternalLinks(1);
grid->addWidget(labDOI2, y++,1,1,1);
QSpacerItem *spacer1 = new QSpacerItem(1, 8, QSizePolicy::Minimum, QSizePolicy::Fixed);
grid->addItem(spacer1, y++,0,1,2);
......
......@@ -691,7 +691,8 @@ HullWnd::HullWnd(QWidget* pParent) : QMainWindow{pParent},
connect(actionSettings, &QAction::triggered, this, [this]()
{
if(!this->m_dlgSettings)
this->m_dlgSettings = std::make_shared<GeoSettingsDlg>(this, &m_sett);
this->m_dlgSettings = std::make_shared<GeoSettingsDlg>(
this, &m_sett, true);
m_dlgSettings->show();
m_dlgSettings->raise();
......@@ -1295,8 +1296,8 @@ HullDlg::HullDlg(QWidget* pParent) : QDialog{pParent}
// grid
int y = 0;
auto pTabGrid = new QGridLayout(this);
pTabGrid->setSpacing(2);
pTabGrid->setContentsMargins(4,4,4,4);
pTabGrid->setSpacing(4);
pTabGrid->setContentsMargins(12, 12, 12, 12);
pTabGrid->addWidget(splitter, y++,0,1,9);
pTabGrid->addWidget(tabBtnAdd, y,0,1,1);
pTabGrid->addWidget(tabBtnDel, y,1,1,1);
......
......@@ -967,7 +967,8 @@ LinesWnd::LinesWnd(QWidget* pParent) : QMainWindow{pParent},
connect(actionSettings, &QAction::triggered, this, [this]()
{
if(!this->m_dlgSettings)
this->m_dlgSettings = std::make_shared<GeoSettingsDlg>(this, &m_sett);
this->m_dlgSettings = std::make_shared<GeoSettingsDlg>(
this, &m_sett, true);
m_dlgSettings->show();
m_dlgSettings->raise();
......
......@@ -461,7 +461,8 @@ PolyWnd::PolyWnd(QWidget* pParent) : QMainWindow{pParent},
connect(actionSettings, &QAction::triggered, this, [this]()
{
if(!this->m_dlgSettings)
this->m_dlgSettings = std::make_shared<GeoSettingsDlg>(this, &m_sett);
this->m_dlgSettings = std::make_shared<GeoSettingsDlg>(
this, &m_sett, true);
m_dlgSettings->show();
m_dlgSettings->raise();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment