Navigation Menu

Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
fix for Qt 2.x again
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Mueller committed Nov 28, 2001
1 parent 7cfbe22 commit af675eb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
17 changes: 17 additions & 0 deletions qt-gui/src/mainwin.cpp
Expand Up @@ -297,14 +297,22 @@ CMainWindow::CMainWindow(CICQDaemon *theDaemon, CSignalManager *theSigMan,
#endif
if (strcmp(szTemp, "default") != 0)
{
#if QT_VERSION >= 300
f.fromString(szTemp);
#else
f.setRawName(szTemp);
#endif
qApp->setFont(f, true);
}
licqConf.ReadStr("EditFont", szTemp, "default");
if(!strcmp(szTemp, "default"))
f = qApp->font();
else
#if QT_VERSION >= 300
f.fromString(szTemp);
#else
f.setRawName(szTemp);
#endif
delete MLEditWrap::editFont;
MLEditWrap::editFont = new QFont(f);

Expand Down Expand Up @@ -2309,12 +2317,21 @@ void CMainWindow::saveOptions()
licqConf.SetSection("appearance");
licqConf.WriteStr("Skin", skin->szSkinName);
licqConf.WriteStr("Icons", m_szIconSet);
#if QT_VERSION >= 300
licqConf.WriteStr("Font", qApp->font() == defaultFont ?
"default" : qApp->font().toString().latin1());
licqConf.WriteStr("EditFont",
(MLEditWrap::editFont == NULL ||
*MLEditWrap::editFont == defaultFont) ?
"default" : MLEditWrap::editFont->toString().latin1());
#else
licqConf.WriteStr("Font", qApp->font() == defaultFont ?
"default" : qApp->font().rawName().latin1());
licqConf.WriteStr("EditFont",
(MLEditWrap::editFont == NULL ||
*MLEditWrap::editFont == defaultFont) ?
"default" : MLEditWrap::editFont->rawName().latin1());
#endif
licqConf.WriteBool("GridLines", m_bGridLines);
licqConf.WriteBool("FontStyles", m_bFontStyles);
licqConf.WriteNum("Flash", (unsigned short)m_nFlash);
Expand Down
15 changes: 15 additions & 0 deletions qt-gui/src/optionsdlg.cpp
Expand Up @@ -370,13 +370,21 @@ void OptionsDlg::ApplyOptions()
{
QFont f(mainwin->defaultFont);
if(edtEditFont->text().find(tr("default"), 0, false) != 0)
#if QT_VERSION >= 300
f.fromString(edtEditFont->text());
#else
f.setRawName(edtEditFont->text());
#endif
delete MLEditWrap::editFont;
MLEditWrap::editFont = new QFont(f);

f = mainwin->defaultFont;
if(edtFont->text().find(tr("default"), 0, false) != 0)
#if QT_VERSION >= 300
f.fromString(edtFont->text());
#else
f.setRawName(edtFont->text());
#endif
qApp->setFont(f, true);

mainwin->m_bGridLines = chkGridLines->isChecked();
Expand Down Expand Up @@ -556,10 +564,17 @@ void OptionsDlg::ApplyOptions()
void OptionsDlg::setupFontName(QLineEdit* le, const QFont& font)
{
QString s;
#if QT_VERSION >= 300
if (font == mainwin->defaultFont)
s = tr("default (%1)").arg(font.toString());
else
s = font.toString();
#else
if (font == mainwin->defaultFont)
s = tr("default (%1)").arg(font.rawName());
else
s = font.rawName();
#endif
le->setFont(font);
le->setText(s);
le->setCursorPosition(0);
Expand Down

0 comments on commit af675eb

Please sign in to comment.