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();
|
||||
|
@ -608,7 +608,7 @@ QString Settings::getStyle() const
|
|||
return style;
|
||||
}
|
||||
|
||||
void Settings::setStyle(const QString& newStyle)
|
||||
void Settings::setStyle(const QString& newStyle)
|
||||
{
|
||||
style = newStyle;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,22 +63,22 @@ public:
|
|||
|
||||
bool getAutostartInTray() const;
|
||||
void setAutostartInTray(bool newValue);
|
||||
|
||||
|
||||
bool getCloseToTray() const;
|
||||
void setCloseToTray(bool newValue);
|
||||
|
||||
|
||||
bool getMinimizeToTray() const;
|
||||
void setMinimizeToTray(bool newValue);
|
||||
|
||||
bool getLightTrayIcon() const;
|
||||
void setLightTrayIcon(bool newValue);
|
||||
|
||||
|
||||
QString getStyle() const;
|
||||
void setStyle(const QString& newValue);
|
||||
|
||||
bool getShowSystemTray() const;
|
||||
void setShowSystemTray(const bool& newValue);
|
||||
|
||||
|
||||
bool getUseEmoticons() const;
|
||||
void setUseEmoticons(bool newValue);
|
||||
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
|
||||
QString getTranslation() const;
|
||||
void setTranslation(QString newValue);
|
||||
|
||||
|
||||
void setAutoSaveEnabled(bool newValue);
|
||||
bool getAutoSaveEnabled() const;
|
||||
|
||||
|
@ -205,11 +205,11 @@ public:
|
|||
int getSecondColumnHandlePosFromRight() const;
|
||||
void setSecondColumnHandlePosFromRight(const int pos);
|
||||
|
||||
const QString &getTimestampFormat() const;
|
||||
void setTimestampFormat(const QString &format);
|
||||
|
||||
const QString &getDateFormat() const;
|
||||
void setDateFormat(const QString &format);
|
||||
const QString& getTimestampFormat() const;
|
||||
void setTimestampFormat(const QString& format);
|
||||
|
||||
const QString& getDateFormat() const;
|
||||
void setDateFormat(const QString& format);
|
||||
|
||||
bool isMinimizeOnCloseEnabled() const;
|
||||
void setMinimizeOnClose(bool newValue);
|
||||
|
@ -310,7 +310,7 @@ private:
|
|||
|
||||
QHash<QString, QByteArray> widgetSettings;
|
||||
QHash<QString, QString> autoAccept;
|
||||
bool autoSaveEnabled;
|
||||
bool autoSaveEnabled;
|
||||
QString globalAutoAcceptDir;
|
||||
|
||||
// GUI
|
||||
|
@ -363,8 +363,6 @@ signals:
|
|||
void logStorageOptsChanged();
|
||||
void smileyPackChanged();
|
||||
void emojiFontChanged();
|
||||
void timestampFormatChanged();
|
||||
void dateFormatChanged();
|
||||
void compactLayoutChanged();
|
||||
};
|
||||
|
||||
|
|
|
@ -104,11 +104,11 @@ 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;
|
||||
QStringList datestamps;
|
||||
dateFormats.append(ql.dateFormat());
|
||||
|
@ -117,20 +117,16 @@ GeneralForm::GeneralForm(SettingsWidget *myParent) :
|
|||
timeFormats.append(ql.timeFormat());
|
||||
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->dateFormats->setCurrentText(QString("%1 - %2").arg(Settings::getInstance().getDateFormat(),
|
||||
QDate::currentDate().toString(Settings::getInstance().getDateFormat()))
|
||||
);
|
||||
|
||||
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->autoAwaySpinBox->setValue(Settings::getInstance().getAutoAwayTime());
|
||||
|
||||
bodyUI->cbEnableUDP->setChecked(!Settings::getInstance().getForceTCP());
|
||||
|
|
Loading…
Reference in New Issue
Block a user