Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
Show First 20 Lines • Show All 853 Lines • ▼ Show 20 Lines | bool GetStartOnSystemStartup() { | ||||
return false; | return false; | ||||
} | } | ||||
bool SetStartOnSystemStartup(bool fAutoStart) { | bool SetStartOnSystemStartup(bool fAutoStart) { | ||||
return false; | return false; | ||||
} | } | ||||
#endif | #endif | ||||
void saveWindowGeometry(const QString &strSetting, QWidget *parent) { | |||||
QSettings settings; | |||||
settings.setValue(strSetting + "Pos", parent->pos()); | |||||
settings.setValue(strSetting + "Size", parent->size()); | |||||
} | |||||
void restoreWindowGeometry(const QString &strSetting, const QSize &defaultSize, | |||||
QWidget *parent) { | |||||
QSettings settings; | |||||
QPoint pos = settings.value(strSetting + "Pos").toPoint(); | |||||
QSize size = settings.value(strSetting + "Size", defaultSize).toSize(); | |||||
if (!pos.x() && !pos.y()) { | |||||
QRect screen = QApplication::desktop()->screenGeometry(); | |||||
pos.setX((screen.width() - size.width()) / 2); | |||||
pos.setY((screen.height() - size.height()) / 2); | |||||
} | |||||
parent->resize(size); | |||||
parent->move(pos); | |||||
} | |||||
void setClipboard(const QString &str) { | void setClipboard(const QString &str) { | ||||
QApplication::clipboard()->setText(str, QClipboard::Clipboard); | QApplication::clipboard()->setText(str, QClipboard::Clipboard); | ||||
QApplication::clipboard()->setText(str, QClipboard::Selection); | QApplication::clipboard()->setText(str, QClipboard::Selection); | ||||
} | } | ||||
#if BOOST_FILESYSTEM_VERSION >= 3 | #if BOOST_FILESYSTEM_VERSION >= 3 | ||||
fs::path qstringToBoostPath(const QString &path) { | fs::path qstringToBoostPath(const QString &path) { | ||||
return fs::path(path.toStdString(), utf8); | return fs::path(path.toStdString(), utf8); | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |