diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-10-08 18:50:35 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-10-08 18:50:35 +0400 |
commit | 7e7d5b15d4dfa1fb6ce0595478021569a670c356 (patch) | |
tree | 00ebf063843a29ce43dc96c65a2a9bd324de8229 /src | |
parent | 7990f3980a281199419eeadf4a03214b49c25b8a (diff) |
Various compile fixes for Linux
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@775 05730e5d-ab1b-0410-a4ac-84af385074fa
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/ALSAAudio.cpp | 5 | ||||
-rw-r--r-- | src/mumble/ALSAAudio.h | 2 | ||||
-rw-r--r-- | src/mumble/ALSAAudio.ui | 4 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut_unix.cpp | 44 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut_unix.h | 3 |
5 files changed, 35 insertions, 23 deletions
diff --git a/src/mumble/ALSAAudio.cpp b/src/mumble/ALSAAudio.cpp index c8bdfa9a7..8d4f266e0 100644 --- a/src/mumble/ALSAAudio.cpp +++ b/src/mumble/ALSAAudio.cpp @@ -252,6 +252,11 @@ void ALSAConfig::load(const Settings &r) { qsOutputDelay->setValue(r.iDXOutputDelay); } +bool ALSAConfig::expert(bool b) { + qcbOutput->setVisible(b); + return true; +} + void ALSAConfig::on_qsOutputDelay_valueChanged(int v) { qlOutputDelay->setText(tr("%1ms").arg(v*20)); } diff --git a/src/mumble/ALSAAudio.h b/src/mumble/ALSAAudio.h index 90c0275a7..9732964a0 100644 --- a/src/mumble/ALSAAudio.h +++ b/src/mumble/ALSAAudio.h @@ -33,6 +33,7 @@ #include "AudioInput.h" #include "AudioOutput.h" +#include "ConfigDialog.h" #include <alsa/asoundlib.h> #include "ui_ALSAAudio.h" @@ -48,6 +49,7 @@ class ALSAConfig : public ConfigWidget, public Ui::ALSAConfig { public slots: void save() const; void load(const Settings &r); + bool expert(bool); void on_qsOutputDelay_valueChanged(int v); }; diff --git a/src/mumble/ALSAAudio.ui b/src/mumble/ALSAAudio.ui index f025e7d09..9e40d62e3 100644 --- a/src/mumble/ALSAAudio.ui +++ b/src/mumble/ALSAAudio.ui @@ -60,13 +60,13 @@ </widget> </item> <item> - <widget class="QGroupBox" name="groupBox_2" > + <widget class="QGroupBox" name="qcbOutput" > <property name="title" > <string>Output Options</string> </property> <layout class="QHBoxLayout" > <item> - <widget class="QLabel" name="label_3" > + <widget class="QLabel" name="qliOutputDelay" > <property name="text" > <string>Output Delay</string> </property> diff --git a/src/mumble/GlobalShortcut_unix.cpp b/src/mumble/GlobalShortcut_unix.cpp index b3fae9e36..5c12fddfc 100644 --- a/src/mumble/GlobalShortcut_unix.cpp +++ b/src/mumble/GlobalShortcut_unix.cpp @@ -45,7 +45,7 @@ static ConfigWidget *GlobalShortcutXConfigDialogNew(Settings &st) { return new GlobalShortcutXConfig(st); } -static ConfigRegistrar registrar(55, GlobalShortcutXConfigDialogNew); +static ConfigRegistrar registrar(12, GlobalShortcutXConfigDialogNew); XInputKeyWidget::XInputKeyWidget(QWidget *p) : QLineEdit(p) { setReadOnly(true); @@ -54,12 +54,9 @@ XInputKeyWidget::XInputKeyWidget(QWidget *p) : QLineEdit(p) { displayKeys(); } -void XInputKeyWidget::setShortcut(GlobalShortcut *gs) { - if (gsx->qhGlobalToX.contains(gs)) { - Shortcut *s = gsx->qhGlobalToX[gs]; - qlButtons = s->qlButtons; - displayKeys(); - } +void XInputKeyWidget::setShortcut(QList<int> ql) { + qlButtons = ql; + displayKeys(); } void XInputKeyWidget::focusInEvent(QFocusEvent *e) { @@ -137,7 +134,6 @@ GlobalShortcutXConfig::GlobalShortcutXConfig(Settings &st) : ConfigWidget(st) { foreach(GlobalShortcut *gs, gsx->qmShortcuts) { XInputKeyWidget *dikw=new XInputKeyWidget(); - dikw->setShortcut(gs); lab=new QLabel(gs->name); l->addWidget(lab, i+1, 0); @@ -171,26 +167,34 @@ QIcon GlobalShortcutXConfig::icon() const { void GlobalShortcutXConfig::save() const { Settings::ShortcutMap m; - //TODO -/* + + foreach(GlobalShortcut *gs, gsx->qmShortcuts) { XInputKeyWidget *dikw = qhKeys[gs]; - if (dikw->bModified) { - QString base=QString::fromLatin1("GS%1_").arg(gs->idx); - s.qs->setValue(base + QLatin1String("num"), dikw->qlButtons.count()); - int i=0; - foreach(int bt, dikw->qlButtons) { - s.qs->setValue(base + QString::fromLatin1("%1_Key").arg(i), bt); - i++; - } + if (dikw->qlButtons.count() > 0) { + QList<QVariant> ql; + foreach(int i, dikw->qlButtons) + ql << i; + m.insert(gs->idx, ql); } } - gsx->bNeedRemap = true;*/ + s.qmShortcuts = m; } void GlobalShortcutXConfig::load(const Settings &r) { - //TODO + foreach(GlobalShortcut *gs, gsx->qmShortcuts) { + XInputKeyWidget *dikw = qhKeys.value(gs); + QList<int> qlb; + foreach(QVariant v, r.qmShortcuts.value(gs->idx)) { + qlb << v.toInt(); + } + dikw->setShortcut(qlb); + } +} + +bool GlobalShortcutXConfig::expert(bool) { + return true; } GlobalShortcutX::GlobalShortcutX() { diff --git a/src/mumble/GlobalShortcut_unix.h b/src/mumble/GlobalShortcut_unix.h index 83a867558..0ad97998d 100644 --- a/src/mumble/GlobalShortcut_unix.h +++ b/src/mumble/GlobalShortcut_unix.h @@ -50,7 +50,7 @@ class XInputKeyWidget : public QLineEdit { QList<int> qlButtons; bool bModified; XInputKeyWidget(QWidget *p = NULL); - void setShortcut(GlobalShortcut *gs); + void setShortcut(QList<int> ql); public slots: void setButton(bool); void displayKeys(); @@ -67,6 +67,7 @@ class GlobalShortcutXConfig : public ConfigWidget { public slots: void save() const; void load(const Settings &r); + bool expert(bool); }; #define NUM_BUTTONS 0x2ff |