-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
8,813 additions
and
8,813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,77 @@ | ||
#include "DlgOption.h" | ||
#include "ui_DlgOption.h" | ||
#include "Global/TasksTools.h" | ||
#include "RabbitCommonDir.h" | ||
#include "RabbitCommonTools.h" | ||
#include <QSettings> | ||
#include "LunarCalendar.h" | ||
#include <QLoggingCategory> | ||
|
||
static Q_LOGGING_CATEGORY(log, "Rabbit.LunarCalendar.Option") | ||
|
||
CDlgOption::CDlgOption(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::CDlgOption) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->cbRunFromBoot->setChecked(RabbitCommon::CTools::IsStartRun()); | ||
QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), | ||
QSettings::IniFormat); | ||
bool bShow = set.value("Options/MainWindow/Show", false).toBool(); | ||
ui->cbShowMainWindows->setChecked(bShow); | ||
int nType = set.value("Options/Calendar/Type", 0).toInt(); | ||
if(0 == nType) | ||
ui->cbAutomation->setChecked(true); | ||
if(static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeSolar) & nType) | ||
ui->cbSolar->setChecked(true); | ||
if(static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeLunar) & nType) | ||
ui->cbLunar->setChecked(true); | ||
} | ||
|
||
CDlgOption::~CDlgOption() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void CDlgOption::on_buttonBox_accepted() | ||
{ | ||
if(ui->cbRunFromBoot->checkState() == Qt::Checked) | ||
RabbitCommon::CTools::InstallStartRun(); | ||
else | ||
RabbitCommon::CTools::RemoveStartRun(); | ||
|
||
QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), | ||
QSettings::IniFormat); | ||
set.setValue("Options/MainWindow/Show", ui->cbShowMainWindows->isChecked()); | ||
if(ui->cbAutomation->isChecked()) | ||
set.setValue("Options/Calendar/Type", 0); | ||
else { | ||
int nType = 0; | ||
nType = set.value("Options/Calendar/Type", 0).toInt(); | ||
if(ui->cbSolar->isChecked()) | ||
{ | ||
nType |= static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeSolar); | ||
} else { | ||
nType &= ~static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeSolar); | ||
} | ||
if(ui->cbLunar->isChecked()) { | ||
nType |= static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeLunar); | ||
} else { | ||
nType &= ~static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeLunar); | ||
} | ||
set.setValue("Options/Calendar/Type", nType); | ||
} | ||
} | ||
|
||
void CDlgOption::on_cbAutomation_toggled(bool checked) | ||
{ | ||
qDebug(log) << "on_cbAutomation_clicked"; | ||
if(checked) { | ||
ui->cbLunar->setEnabled(false); | ||
ui->cbSolar->setEnabled(false); | ||
} else { | ||
ui->cbLunar->setEnabled(true); | ||
ui->cbSolar->setEnabled(true); | ||
} | ||
} | ||
#include "DlgOption.h" | ||
#include "ui_DlgOption.h" | ||
#include "Global/TasksTools.h" | ||
#include "RabbitCommonDir.h" | ||
#include "RabbitCommonTools.h" | ||
#include <QSettings> | ||
#include "LunarCalendar.h" | ||
#include <QLoggingCategory> | ||
|
||
static Q_LOGGING_CATEGORY(log, "Rabbit.LunarCalendar.Option") | ||
|
||
CDlgOption::CDlgOption(QWidget *parent) : | ||
QDialog(parent), | ||
ui(new Ui::CDlgOption) | ||
{ | ||
ui->setupUi(this); | ||
|
||
ui->cbRunFromBoot->setChecked(RabbitCommon::CTools::IsStartRun()); | ||
QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), | ||
QSettings::IniFormat); | ||
bool bShow = set.value("Options/MainWindow/Show", false).toBool(); | ||
ui->cbShowMainWindows->setChecked(bShow); | ||
int nType = set.value("Options/Calendar/Type", 0).toInt(); | ||
if(0 == nType) | ||
ui->cbAutomation->setChecked(true); | ||
if(static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeSolar) & nType) | ||
ui->cbSolar->setChecked(true); | ||
if(static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeLunar) & nType) | ||
ui->cbLunar->setChecked(true); | ||
} | ||
|
||
CDlgOption::~CDlgOption() | ||
{ | ||
delete ui; | ||
} | ||
|
||
void CDlgOption::on_buttonBox_accepted() | ||
{ | ||
if(ui->cbRunFromBoot->checkState() == Qt::Checked) | ||
RabbitCommon::CTools::InstallStartRun(); | ||
else | ||
RabbitCommon::CTools::RemoveStartRun(); | ||
|
||
QSettings set(RabbitCommon::CDir::Instance()->GetFileUserConfigure(), | ||
QSettings::IniFormat); | ||
set.setValue("Options/MainWindow/Show", ui->cbShowMainWindows->isChecked()); | ||
if(ui->cbAutomation->isChecked()) | ||
set.setValue("Options/Calendar/Type", 0); | ||
else { | ||
int nType = 0; | ||
nType = set.value("Options/Calendar/Type", 0).toInt(); | ||
if(ui->cbSolar->isChecked()) | ||
{ | ||
nType |= static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeSolar); | ||
} else { | ||
nType &= ~static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeSolar); | ||
} | ||
if(ui->cbLunar->isChecked()) { | ||
nType |= static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeLunar); | ||
} else { | ||
nType &= ~static_cast<int>(CLunarCalendar::_CalendarType::CalendarTypeLunar); | ||
} | ||
set.setValue("Options/Calendar/Type", nType); | ||
} | ||
} | ||
|
||
void CDlgOption::on_cbAutomation_toggled(bool checked) | ||
{ | ||
qDebug(log) << "on_cbAutomation_clicked"; | ||
if(checked) { | ||
ui->cbLunar->setEnabled(false); | ||
ui->cbSolar->setEnabled(false); | ||
} else { | ||
ui->cbLunar->setEnabled(true); | ||
ui->cbSolar->setEnabled(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
#ifndef DLGOPTION_H | ||
#define DLGOPTION_H | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class CDlgOption; | ||
} | ||
|
||
class CDlgOption : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit CDlgOption(QWidget *parent = nullptr); | ||
~CDlgOption(); | ||
|
||
private slots: | ||
void on_buttonBox_accepted(); | ||
void on_cbAutomation_toggled(bool checked); | ||
|
||
private: | ||
Ui::CDlgOption *ui; | ||
}; | ||
|
||
#endif // DLGOPTION_H | ||
#ifndef DLGOPTION_H | ||
#define DLGOPTION_H | ||
|
||
#include <QDialog> | ||
|
||
namespace Ui { | ||
class CDlgOption; | ||
} | ||
|
||
class CDlgOption : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit CDlgOption(QWidget *parent = nullptr); | ||
~CDlgOption(); | ||
|
||
private slots: | ||
void on_buttonBox_accepted(); | ||
void on_cbAutomation_toggled(bool checked); | ||
|
||
private: | ||
Ui::CDlgOption *ui; | ||
}; | ||
|
||
#endif // DLGOPTION_H |
Oops, something went wrong.