From 1d0fe2e00707a2bfc2a637269eecfc81b5604823 Mon Sep 17 00:00:00 2001 From: LoudSnorer Date: Wed, 28 Dec 2022 13:24:01 -0500 Subject: [PATCH] Change file names --- oscar/daily.cpp | 12 ++--- oscar/daily.h | 4 +- oscar/oscar.pro | 4 +- oscar/overview.cpp | 12 ++--- oscar/overview.h | 4 +- ...pFiles.cpp => saveGraphLayoutSettings.cpp} | 53 ++++++++++--------- ...ackupFiles.h => saveGraphLayoutSettings.h} | 8 +-- 7 files changed, 49 insertions(+), 48 deletions(-) rename oscar/{backupFiles.cpp => saveGraphLayoutSettings.cpp} (92%) rename oscar/{backupFiles.h => saveGraphLayoutSettings.h} (94%) diff --git a/oscar/daily.cpp b/oscar/daily.cpp index 4909c7eb..aa393581 100644 --- a/oscar/daily.cpp +++ b/oscar/daily.cpp @@ -541,7 +541,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared) ui->JournalNotes->installEventFilter(this); // qDebug() << "Finished making new Daily object"; // sleep(3); - backupFiles=nullptr; + saveGraphLayoutSettings=nullptr; } Daily::~Daily() @@ -564,7 +564,7 @@ Daily::~Daily() delete ui; delete icon_on; delete icon_off; - if (backupFiles!=nullptr) delete backupFiles; + if (saveGraphLayoutSettings!=nullptr) delete saveGraphLayoutSettings; } void Daily::showEvent(QShowEvent *) @@ -2853,11 +2853,11 @@ void Daily::on_splitter_2_splitterMoved(int, int) } void Daily::on_backup_clicked() { - if (!backupFiles) { - backupFiles= new BackupFiles("daily",this); + if (!saveGraphLayoutSettings) { + saveGraphLayoutSettings= new SaveGraphLayoutSettings("daily",this); } - if (backupFiles) { - backupFiles->backupMenu(GraphView); + if (saveGraphLayoutSettings) { + saveGraphLayoutSettings->menu(GraphView); } } diff --git a/oscar/daily.h b/oscar/daily.h index 9d8edaf6..bc3efd13 100644 --- a/oscar/daily.h +++ b/oscar/daily.h @@ -28,7 +28,7 @@ #include "Graphs/gLineChart.h" #include "sessionbar.h" #include "mytextbrowser.h" -#include "backupFiles.h" +#include "saveGraphLayoutSettings.h" namespace Ui { @@ -363,7 +363,7 @@ private: #endif bool BookmarksChanged; - BackupFiles* backupFiles=nullptr; + SaveGraphLayoutSettings* saveGraphLayoutSettings=nullptr; }; #endif // DAILY_H diff --git a/oscar/oscar.pro b/oscar/oscar.pro index aef6e320..9ebec841 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -256,7 +256,7 @@ lessThan(QT_MAJOR_VERSION,5)|lessThan(QT_MINOR_VERSION,12) { SOURCES += \ checkupdates.cpp \ overview.cpp \ - backupFiles.cpp \ + saveGraphLayoutSettings.cpp \ common_gui.cpp \ cprogressbar.cpp \ daily.cpp \ @@ -363,7 +363,7 @@ QMAKE_EXTRA_COMPILERS += optimize HEADERS += \ checkupdates.h \ overview.h \ - backupFiles.h \ + saveGraphLayoutSettings.h \ common_gui.h \ cprogressbar.h \ daily.h \ diff --git a/oscar/overview.cpp b/oscar/overview.cpp index 5edc37c8..5e660a6f 100644 --- a/oscar/overview.cpp +++ b/oscar/overview.cpp @@ -171,7 +171,7 @@ Overview::Overview(QWidget *parent, gGraphView *shared) : connect(GraphView, SIGNAL(updateRange(double,double)), this, SLOT(on_RangeUpdate(double,double))); connect(GraphView, SIGNAL(GraphsChanged()), this, SLOT(updateGraphCombo())); connect(GraphView, SIGNAL(XBoundsChanged(qint64 ,qint64)), this, SLOT(on_XBoundsChanged(qint64 ,qint64))); - backupFiles=nullptr; + saveGraphLayoutSettings=nullptr; } Overview::~Overview() @@ -193,7 +193,7 @@ Overview::~Overview() delete icon_off ; delete icon_up_down ; delete icon_warning ; - if (backupFiles!=nullptr) delete backupFiles; + if (saveGraphLayoutSettings!=nullptr) delete saveGraphLayoutSettings; } void Overview::ResetFont() @@ -936,11 +936,11 @@ void Overview::on_toggleVisibility_clicked(bool checked) } void Overview::on_backup_clicked() { - if (!backupFiles) { - backupFiles= new BackupFiles("overview",this); + if (!saveGraphLayoutSettings) { + saveGraphLayoutSettings= new SaveGraphLayoutSettings("overview",this); } - if (backupFiles) { - backupFiles->backupMenu(GraphView); + if (saveGraphLayoutSettings) { + saveGraphLayoutSettings->menu(GraphView); } } diff --git a/oscar/overview.h b/oscar/overview.h index 2260b41a..786cefa3 100644 --- a/oscar/overview.h +++ b/oscar/overview.h @@ -23,7 +23,7 @@ #include "Graphs/gOverviewGraph.h" #endif #include "Graphs/gSummaryChart.h" -#include "backupFiles.h" +#include "saveGraphLayoutSettings.h" #include #include @@ -200,7 +200,7 @@ class Overview : public QWidget // Are start and end widgets displaying the same month. bool samePage; - BackupFiles* backupFiles=nullptr; + SaveGraphLayoutSettings* saveGraphLayoutSettings=nullptr; }; diff --git a/oscar/backupFiles.cpp b/oscar/saveGraphLayoutSettings.cpp similarity index 92% rename from oscar/backupFiles.cpp rename to oscar/saveGraphLayoutSettings.cpp index 7d708c3f..c1d95797 100644 --- a/oscar/backupFiles.cpp +++ b/oscar/saveGraphLayoutSettings.cpp @@ -18,10 +18,11 @@ #include #include #include "SleepLib/profiles.h" -#include "backupFiles.h" +#include "saveGraphLayoutSettings.h" -BackupFiles::BackupFiles(QString title,QWidget* parent) : parent(parent),title(title) + +SaveGraphLayoutSettings::SaveGraphLayoutSettings(QString title,QWidget* parent) : parent(parent),title(title) { // Initialize directory accesses to profile files. QString dirname = p_profile->Get("{DataFolder}/"); @@ -54,7 +55,7 @@ BackupFiles::BackupFiles(QString title,QWidget* parent) : parent(parent),title(t parseFilenameRe = new QRegularExpression(QString("^(%1[.](backup(\\d*)))[.]shg$").arg(title)); } -BackupFiles::~BackupFiles() +SaveGraphLayoutSettings::~SaveGraphLayoutSettings() { backupDialog->disconnect(backupaddFullBtn, SIGNAL(clicked()), this, SLOT (addFull_feature() )); backupDialog->disconnect(backupAddBtn, SIGNAL(clicked()), this, SLOT (add_feature() )); @@ -76,7 +77,7 @@ BackupFiles::~BackupFiles() delete parseFilenameRe; } -void BackupFiles::createMenu() { +void SaveGraphLayoutSettings::createMenu() { styleOn= calculateStyle(true,false); styleOff= calculateStyle(false,false); styleExitBtn=calculateStyle(true,true); @@ -185,7 +186,7 @@ void BackupFiles::createMenu() { }; -bool BackupFiles::confirmAction(QString name,QString question,QIcon* icon) { +bool SaveGraphLayoutSettings::confirmAction(QString name,QString question,QIcon* icon) { QMessageBox msgBox; msgBox.setText(question); if (icon!=nullptr) { @@ -207,7 +208,7 @@ bool BackupFiles::confirmAction(QString name,QString question,QIcon* icon) { } -QString BackupFiles::calculateStyle(bool on,bool exitBtn){ +QString SaveGraphLayoutSettings::calculateStyle(bool on,bool exitBtn){ QString btnStyle=QString("QPushButton{%1%2}").arg(on ?"color: black;background-color:white;" :"color: darkgray;background-color:#e8e8e8 ;" @@ -231,12 +232,12 @@ QString BackupFiles::calculateStyle(bool on,bool exitBtn){ return btnStyle; } -void BackupFiles::looksOn(QPushButton* button,bool on){ +void SaveGraphLayoutSettings::looksOn(QPushButton* button,bool on){ button->setEnabled(on); button->setStyleSheet(on?styleOn:styleOff); } -void BackupFiles::enableButtons(bool enable) { +void SaveGraphLayoutSettings::enableButtons(bool enable) { looksOn(backupUpdateBtn,enable); looksOn(backupRestoreBtn,enable); looksOn(backupDeleteBtn,enable); @@ -250,7 +251,7 @@ void BackupFiles::enableButtons(bool enable) { } } -void BackupFiles::update_feature() { +void SaveGraphLayoutSettings::update_feature() { if(!graphView) return; QListWidgetItem * item=backuplist->currentItem(); if (!item) return; @@ -260,7 +261,7 @@ void BackupFiles::update_feature() { graphView->SaveSettings(name); }; -void BackupFiles::restore_feature() { +void SaveGraphLayoutSettings::restore_feature() { if(!graphView) return; QListWidgetItem * item=backuplist->currentItem(); if (!item) return; @@ -270,16 +271,16 @@ void BackupFiles::restore_feature() { exit(); }; -void BackupFiles::rename_feature() { +void SaveGraphLayoutSettings::rename_feature() { if(!graphView) return; QListWidgetItem * item=backuplist->currentItem(); if (!item) return; backuplist->editItem(item); - // BackupFiles::itemChanged(QListWidgetItem *item) is called when edit changes the entry. + // SaveGraphLayoutSettings::itemChanged(QListWidgetItem *item) is called when edit changes the entry. // itemChanged will update the description map } -void BackupFiles::delete_feature() { +void SaveGraphLayoutSettings::delete_feature() { if(!graphView) return; QListWidgetItem * item=backuplist->currentItem(); if (!item) return; @@ -296,7 +297,7 @@ void BackupFiles::delete_feature() { enableButtons(true); } -void BackupFiles::addFull_feature() { +void SaveGraphLayoutSettings::addFull_feature() { QMessageBox msgBox; msgBox.setText(tr("Maximum number of Backups exceeded.")); msgBox.setStandardButtons(QMessageBox::Cancel); @@ -311,7 +312,7 @@ void BackupFiles::addFull_feature() { msgBox.exec(); } -void BackupFiles::add_feature() { +void SaveGraphLayoutSettings::add_feature() { if(!graphView) return; QString backupName = QString("%2%3").arg("backup").arg(unusedBackupNum,backupNumMaxLength,10,QLatin1Char('0')); @@ -328,7 +329,7 @@ void BackupFiles::add_feature() { } } -void BackupFiles::itemChanged(QListWidgetItem *item) +void SaveGraphLayoutSettings::itemChanged(QListWidgetItem *item) { QString backupName=item->data(backupFileName).toString(); QString desc= item->text(); @@ -356,12 +357,12 @@ void BackupFiles::itemChanged(QListWidgetItem *item) item->setText(desc); } -void BackupFiles::itemSelectionChanged() +void SaveGraphLayoutSettings::itemSelectionChanged() { enableButtons(true); } -int BackupFiles::backupNum(QString backupName) { +int SaveGraphLayoutSettings::backupNum(QString backupName) { QRegularExpressionMatch match = backupFileNumRe->match(backupName); int value=-1; if (match.hasMatch()) { @@ -370,7 +371,7 @@ int BackupFiles::backupNum(QString backupName) { return value; } -QListWidgetItem* BackupFiles::updateFileList(QString find) { +QListWidgetItem* SaveGraphLayoutSettings::updateFileList(QString find) { Q_UNUSED(find); QListWidgetItem* ret=nullptr; enableButtons(false); @@ -423,11 +424,11 @@ QListWidgetItem* BackupFiles::updateFileList(QString find) { } -void BackupFiles::exit() { +void SaveGraphLayoutSettings::exit() { backupDialog->close(); } -void BackupFiles::backupMenu(gGraphView* graphView) { +void SaveGraphLayoutSettings::menu(gGraphView* graphView) { this->graphView=graphView; updateFileList(); backupDialog->raise(); @@ -567,31 +568,31 @@ switch (ret) { backupDialog->disconnect(backuplist, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(itemEntered(QListWidgetItem*) )); -void BackupFiles::itemActivated(QListWidgetItem *item) +void SaveGraphLayoutSettings::itemActivated(QListWidgetItem *item) { Q_UNUSED( item ); DEBUGF Q( item->text() ); } -void BackupFiles::itemDoubleClicked(QListWidgetItem *item) +void SaveGraphLayoutSettings::itemDoubleClicked(QListWidgetItem *item) { Q_UNUSED( item ); DEBUGF Q( item->text() ); } -void BackupFiles::itemClicked(QListWidgetItem *item) +void SaveGraphLayoutSettings::itemClicked(QListWidgetItem *item) { Q_UNUSED( item ); DEBUGF Q( item->text() ); } -void BackupFiles::itemEntered(QListWidgetItem *item) +void SaveGraphLayoutSettings::itemEntered(QListWidgetItem *item) { Q_UNUSED( item ); DEBUGF Q( item->text() ); } -void BackupFiles::itemPressed(QListWidgetItem *item) +void SaveGraphLayoutSettings::itemPressed(QListWidgetItem *item) { Q_UNUSED( item ); DEBUGF Q( item->text() ); diff --git a/oscar/backupFiles.h b/oscar/saveGraphLayoutSettings.h similarity index 94% rename from oscar/backupFiles.h rename to oscar/saveGraphLayoutSettings.h index 31f4bd11..b3efffc8 100644 --- a/oscar/backupFiles.h +++ b/oscar/saveGraphLayoutSettings.h @@ -37,13 +37,13 @@ private: const QRegularExpression* parseDescriptionsRe; }; -class BackupFiles : public QWidget +class SaveGraphLayoutSettings : public QWidget { Q_OBJECT public: - explicit BackupFiles(QString title , QWidget* parent) ; - ~BackupFiles(); - void backupMenu(gGraphView* graphView); + explicit SaveGraphLayoutSettings(QString title , QWidget* parent) ; + ~SaveGraphLayoutSettings(); + void menu(gGraphView* graphView); protected: QIcon* m_icon_exit = new QIcon(":/icons/exit.png"); QIcon* m_icon_delete = new QIcon(":/icons/trash_can.png");