mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Change default datetime formats (d/m m/d agnostic), style fixes, removed unnecessary signals
This commit is contained in:
parent
14a565bc3a
commit
bab280a0ea
|
@ -240,8 +240,8 @@ void Settings::load()
|
|||
emojiFontPointSize = s.value("emojiFontPointSize", 16).toInt();
|
||||
firstColumnHandlePos = s.value("firstColumnHandlePos", 50).toInt();
|
||||
secondColumnHandlePosFromRight = s.value("secondColumnHandlePosFromRight", 50).toInt();
|
||||
timestampFormat = s.value("timestampFormat", "hh:mm").toString();
|
||||
dateFormat = s.value("dateFormat", "dd-MM-yyyy").toString();
|
||||
timestampFormat = s.value("timestampFormat", "hh:mm:ss").toString();
|
||||
dateFormat = s.value("dateFormat", "dddd, MMMM d, yyyy").toString();
|
||||
minimizeOnClose = s.value("minimizeOnClose", false).toBool();
|
||||
minimizeToTray = s.value("minimizeToTray", false).toBool();
|
||||
lightTrayIcon = s.value("lightTrayIcon", false).toBool();
|
||||
|
@ -953,7 +953,7 @@ void Settings::setSecondColumnHandlePosFromRight(const int pos)
|
|||
secondColumnHandlePosFromRight = pos;
|
||||
}
|
||||
|
||||
const QString &Settings::getTimestampFormat() const
|
||||
const QString& Settings::getTimestampFormat() const
|
||||
{
|
||||
return timestampFormat;
|
||||
}
|
||||
|
@ -961,10 +961,9 @@ const QString &Settings::getTimestampFormat() const
|
|||
void Settings::setTimestampFormat(const QString &format)
|
||||
{
|
||||
timestampFormat = format;
|
||||
emit timestampFormatChanged();
|
||||
}
|
||||
|
||||
const QString &Settings::getDateFormat() const
|
||||
const QString& Settings::getDateFormat() const
|
||||
{
|
||||
return dateFormat;
|
||||
}
|
||||
|
@ -972,7 +971,6 @@ const QString &Settings::getDateFormat() const
|
|||
void Settings::setDateFormat(const QString &format)
|
||||
{
|
||||
dateFormat = format;
|
||||
emit dateFormatChanged();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -205,11 +205,11 @@ public:
|
|||
int getSecondColumnHandlePosFromRight() const;
|
||||
void setSecondColumnHandlePosFromRight(const int pos);
|
||||
|
||||
const QString &getTimestampFormat() const;
|
||||
void setTimestampFormat(const QString &format);
|
||||
const QString& getTimestampFormat() const;
|
||||
void setTimestampFormat(const QString& format);
|
||||
|
||||
const QString &getDateFormat() const;
|
||||
void setDateFormat(const QString &format);
|
||||
const QString& getDateFormat() const;
|
||||
void setDateFormat(const QString& format);
|
||||
|
||||
bool isMinimizeOnCloseEnabled() const;
|
||||
void setMinimizeOnClose(bool newValue);
|
||||
|
@ -363,8 +363,6 @@ signals:
|
|||
void logStorageOptsChanged();
|
||||
void smileyPackChanged();
|
||||
void emojiFontChanged();
|
||||
void timestampFormatChanged();
|
||||
void dateFormatChanged();
|
||||
void compactLayoutChanged();
|
||||
};
|
||||
|
||||
|
|
|
@ -104,9 +104,9 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
|||
bodyUI->emoticonSize->setValue(Settings::getInstance().getEmojiFontPointSize());
|
||||
|
||||
QStringList timestamps;
|
||||
foreach (QString timestamp, timeFormats) {
|
||||
for (QString timestamp : timeFormats)
|
||||
timestamps << QString("%1 - %2").arg(timestamp, QTime::currentTime().toString(timestamp));
|
||||
}
|
||||
|
||||
bodyUI->timestamp->addItems(timestamps);
|
||||
|
||||
QLocale ql;
|
||||
|
@ -118,18 +118,14 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
|||
timeFormats.append(ql.timeFormat(QLocale::LongFormat));
|
||||
timeFormats.removeDuplicates();
|
||||
|
||||
foreach (QString datestamp, dateFormats) {
|
||||
for (QString datestamp : dateFormats)
|
||||
datestamps << QString("%1 - %2").arg(datestamp, QDate::currentDate().toString(datestamp));
|
||||
}
|
||||
|
||||
bodyUI->dateFormats->addItems(datestamps);
|
||||
|
||||
bodyUI->timestamp->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getTimestampFormat(),
|
||||
QTime::currentTime().toString(Settings::getInstance().getTimestampFormat()))
|
||||
);
|
||||
bodyUI->timestamp->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getTimestampFormat(), QTime::currentTime().toString(Settings::getInstance().getTimestampFormat())));
|
||||
|
||||
bodyUI->dateFormats->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getDateFormat(),
|
||||
QDate::currentDate().toString(Settings::getInstance().getDateFormat()))
|
||||
);
|
||||
bodyUI->dateFormats->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getDateFormat(), QDate::currentDate().toString(Settings::getInstance().getDateFormat())));
|
||||
|
||||
bodyUI->autoAwaySpinBox->setValue(Settings::getInstance().getAutoAwayTime());
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user