Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 17863 → Rev 17864

/trunk/Scribus/scribus/prefsmanager.cpp
1704,15 → 1704,7
continue;
QDomElement kscc=docu.createElement("Shortcut");
kscc.setAttribute("Action",ksc.value().actionName);
QString ks(Prefs_KeyboardShortcuts::getKeyText(ksc.value().keySequence));
#ifdef Q_OS_MAC
ks.replace("Ctrl","Meta");
ks.replace("Cmd","Ctrl");
#endif
#ifdef Q_OS_WIN32
ks.replace("Windows","Meta");
#endif
kscc.setAttribute("KeySequence",ks);
kscc.setAttribute("KeySequence", Prefs_KeyboardShortcuts::getKeyText(ksc.value().keySequence));
elem.appendChild(kscc);
}
QDomElement cosd=docu.createElement("DefaultColorSet");
/trunk/Scribus/scribus/commonstrings.cpp
449,6 → 449,7
CommonStrings::metaModifier=tr("Ctrl");
#endif
#ifdef Q_OS_WIN32
CommonStrings::controlModifier=tr("Ctrl");
CommonStrings::metaModifier=tr("Windows");
#endif
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
221,9 → 221,9
{
if (it.value().keySequence.isEmpty() && it.key().isEmpty())
continue;
QDomElement function_shortcut=doc.createElement("function");
function_shortcut.setAttribute("name",it.key());
function_shortcut.setAttribute("shortcut",getKeyText(it.value().keySequence));
QDomElement function_shortcut = doc.createElement("function");
function_shortcut.setAttribute("name", it.key());
function_shortcut.setAttribute("shortcut", getKeyText(it.value().keySequence));
keySetElement.appendChild(function_shortcut);
}
QFile f(filename);
296,6 → 296,24
// we prefer plain English
QString res;
if ((KeyC & Qt::META) != 0)
res += "Meta+";
if ((KeyC & Qt::CTRL) != 0)
res += "Ctrl+";
if ((KeyC & Qt::ALT) != 0)
res += "Alt+";
if ((KeyC & Qt::SHIFT) != 0)
res += "Shift+";
return res + QString(QKeySequence(KeyC & ~(Qt::META | Qt::CTRL | Qt::ALT | Qt::SHIFT)));
}
 
QString Prefs_KeyboardShortcuts::getTrKeyText(int KeyC)
{
if ((KeyC & ~(Qt::META | Qt::CTRL | Qt::ALT | Qt::SHIFT)) == 0)
return "";
// on OSX Qt translates modifiers to forsaken symbols, arrows and the like
// we prefer plain English
QString res;
if ((KeyC & Qt::META) != 0)
res += CommonStrings::metaModifier + "+";
if ((KeyC & Qt::CTRL) != 0)
res += CommonStrings::controlModifier + "+";
500,13 → 518,13
break;
default:
keyCode |= k->key();
keyDisplay->setText(getKeyText(keyCode));
keyDisplay->setText(getTrKeyText(keyCode));
releaseKeyboard();
if (checkKey(keyCode))
{
QMessageBox::information(this, CommonStrings::trWarning,
tr("The %1 key sequence is already in use by \"%2\"")
.arg(getKeyText(keyCode))
.arg(getTrKeyText(keyCode))
.arg(getAction(keyCode)),
CommonStrings::tr_OK);
selectedLVI->setText(1,keyMap[lviToActionMap[selectedLVI]].keySequence);
/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.h
34,7 → 34,9
bool event( QEvent* ev );
void keyPressEvent(QKeyEvent *k);
void keyReleaseEvent(QKeyEvent *k);
 
static QString getKeyText(int KeyC);
static QString getTrKeyText(int KeyC);
 
public slots:
void languageChange();