Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
01c08e0b
Commit
01c08e0b
authored
19 years ago
by
yanmorin
Browse files
Options
Downloads
Patches
Plain Diff
Add combo box instead of radio group for driver list
parent
4e38adb7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gui/qt/ConfigurationPanel.ui
+10
-15
10 additions, 15 deletions
src/gui/qt/ConfigurationPanel.ui
src/gui/qt/ConfigurationPanel.ui.h
+31
-100
31 additions, 100 deletions
src/gui/qt/ConfigurationPanel.ui.h
with
41 additions
and
115 deletions
src/gui/qt/ConfigurationPanel.ui
+
10
−
15
View file @
01c08e0b
...
@@ -749,11 +749,18 @@
...
@@ -749,11 +749,18 @@
<widget
class=
"QVButtonGroup"
>
<widget
class=
"QVButtonGroup"
>
<property
name=
"name"
><cstring>
DriverChoice
</cstring></property>
<property
name=
"name"
><cstring>
DriverChoice
</cstring></property>
<property
name=
"title"
><string>
Driver for Speaker
</string></property>
<property
name=
"title"
><string>
Driver for Speaker
</string></property>
<widget
class=
"QComboBox"
>
<property
name=
"name"
><cstring>
cboDriverChoiceOut
</cstring></property>
</widget>
</widget>
</widget>
<widget
class=
"QVButtonGroup"
>
<widget
class=
"QVButtonGroup"
>
<property
name=
"name"
><cstring>
DriverChoiceIn
</cstring></property>
<property
name=
"name"
><cstring>
DriverChoiceIn
</cstring></property>
<property
name=
"title"
><string>
Driver for Microphone
</string></property>
<property
name=
"title"
><string>
Driver for Microphone
</string></property>
<widget
class=
"QComboBox"
>
<property
name=
"name"
><cstring>
cboDriverChoiceIn
</cstring></property>
</widget>
</widget>
</widget>
<widget
class=
"QLayoutWidget"
>
<widget
class=
"QLayoutWidget"
>
<property
name=
"name"
><cstring>
layoutforsounddriver
</cstring></property>
<property
name=
"name"
><cstring>
layoutforsounddriver
</cstring></property>
<hbox>
<hbox>
...
@@ -1426,18 +1433,6 @@ Montreal, Quebec H2T 1S6</p></string>
...
@@ -1426,18 +1433,6 @@ Montreal, Quebec H2T 1S6</p></string>
<receiver>
ConfigurationPanel
</receiver>
<receiver>
ConfigurationPanel
</receiver>
<slot>
slotRegister()
</slot>
<slot>
slotRegister()
</slot>
</connection>
</connection>
<connection>
<sender>
DriverChoice
</sender>
<signal>
clicked(int)
</signal>
<receiver>
ConfigurationPanel
</receiver>
<slot>
driverSlot(int)
</slot>
</connection>
<connection>
<sender>
DriverChoiceIn
</sender>
<signal>
clicked(int)
</signal>
<receiver>
ConfigurationPanel
</receiver>
<slot>
driverSlotIn(int)
</slot>
</connection>
<connection>
<connection>
<sender>
buttonTestSoundDriver
</sender>
<sender>
buttonTestSoundDriver
</sender>
<signal>
clicked()
</signal>
<signal>
clicked()
</signal>
...
@@ -1495,6 +1490,8 @@ Montreal, Quebec H2T 1S6</p></string>
...
@@ -1495,6 +1490,8 @@ Montreal, Quebec H2T 1S6</p></string>
<tabstop>
sendDTMFas
</tabstop>
<tabstop>
sendDTMFas
</tabstop>
<tabstop>
Menu
</tabstop>
<tabstop>
Menu
</tabstop>
<tabstop>
Tab_Audio
</tabstop>
<tabstop>
Tab_Audio
</tabstop>
<tabstop>
cboDriverChoiceOut
</tabstop>
<tabstop>
cboDriverChoiceIn
</tabstop>
<tabstop>
buttonTestSoundDriver
</tabstop>
<tabstop>
buttonTestSoundDriver
</tabstop>
<tabstop>
codec1
</tabstop>
<tabstop>
codec1
</tabstop>
<tabstop>
codec2
</tabstop>
<tabstop>
codec2
</tabstop>
...
@@ -1520,8 +1517,6 @@ Montreal, Quebec H2T 1S6</p></string>
...
@@ -1520,8 +1517,6 @@ Montreal, Quebec H2T 1S6</p></string>
<slot>
changeTabSlot()
</slot>
<slot>
changeTabSlot()
</slot>
<slot>
useStunSlot( int id )
</slot>
<slot>
useStunSlot( int id )
</slot>
<slot>
applySkinSlot()
</slot>
<slot>
applySkinSlot()
</slot>
<slot>
driverSlot( int id )
</slot>
<slot>
driverSlotIn( int id )
</slot>
<slot>
updateSkins()
</slot>
<slot>
updateSkins()
</slot>
<slot>
updateRingtones()
</slot>
<slot>
updateRingtones()
</slot>
<slot>
updateCodecs()
</slot>
<slot>
updateCodecs()
</slot>
...
...
This diff is collapsed.
Click to expand it.
src/gui/qt/ConfigurationPanel.ui.h
+
31
−
100
View file @
01c08e0b
...
@@ -162,19 +162,8 @@ ConfigurationPanel::generate()
...
@@ -162,19 +162,8 @@ ConfigurationPanel::generate()
.
get
(
SIGNALISATION_SECTION
,
.
get
(
SIGNALISATION_SECTION
,
SIGNALISATION_PULSE_LENGTH
).
toUInt
());
SIGNALISATION_PULSE_LENGTH
).
toUInt
());
QRadioButton
*
device
=
cboDriverChoiceOut
->
setCurrentItem
(
ConfigurationManager
::
instance
().
get
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
).
toUInt
());
static_cast
<
QRadioButton
*
>
(
DriverChoice
->
find
(
ConfigurationManager
::
instance
()
cboDriverChoiceIn
->
setCurrentItem
(
ConfigurationManager
::
instance
().
get
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
).
toUInt
());
.
get
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
).
toUInt
()));
if
(
device
)
{
device
->
setChecked
(
true
);
}
device
=
static_cast
<
QRadioButton
*
>
(
DriverChoiceIn
->
find
(
ConfigurationManager
::
instance
()
.
get
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
).
toUInt
()));
if
(
device
)
{
device
->
setChecked
(
true
);
}
//preference tab
//preference tab
updateSkins
();
updateSkins
();
...
@@ -228,10 +217,15 @@ void ConfigurationPanel::saveSlot()
...
@@ -228,10 +217,15 @@ void ConfigurationPanel::saveSlot()
if
(
codec3
->
currentText
()
!=
NULL
)
{
if
(
codec3
->
currentText
()
!=
NULL
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_CODEC3
,
codec3
->
currentText
());
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_CODEC3
,
codec3
->
currentText
());
}
}
if
(
ringsChoice
->
currentText
()
!=
NULL
)
{
if
(
ringsChoice
->
currentText
()
!=
NULL
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_RINGTONE
,
ringsChoice
->
currentText
());
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_RINGTONE
,
ringsChoice
->
currentText
());
}
}
if
(
cboDriverChoiceOut
->
currentText
()
!=
NULL
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
,
QString
::
number
(
cboDriverChoiceOut
->
currentItem
()));
}
if
(
cboDriverChoiceIn
->
currentText
()
!=
NULL
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
,
QString
::
number
(
cboDriverChoiceIn
->
currentItem
()));
}
SkinManager
::
instance
().
load
(
SkinChoice
->
currentText
());
SkinManager
::
instance
().
load
(
SkinChoice
->
currentText
());
SkinManager
::
instance
().
save
();
SkinManager
::
instance
().
save
();
...
@@ -297,24 +291,6 @@ void ConfigurationPanel::applySkinSlot()
...
@@ -297,24 +291,6 @@ void ConfigurationPanel::applySkinSlot()
}
}
void
ConfigurationPanel
::
driverSlot
(
int
id
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
,
QString
::
number
(
id
));
lblSoundDriver
->
setPaletteForegroundColor
(
black
);
lblSoundDriver
->
setText
(
tr
(
"Not tested"
));
}
void
ConfigurationPanel
::
driverSlotIn
(
int
id
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
,
QString
::
number
(
id
));
lblSoundDriver
->
setPaletteForegroundColor
(
black
);
lblSoundDriver
->
setText
(
tr
(
"Not tested"
));
}
void
ConfigurationPanel
::
updateSkins
()
void
ConfigurationPanel
::
updateSkins
()
{
{
SkinChoice
->
clear
();
SkinChoice
->
clear
();
...
@@ -352,46 +328,21 @@ void ConfigurationPanel::updateCodecs()
...
@@ -352,46 +328,21 @@ void ConfigurationPanel::updateCodecs()
void
ConfigurationPanel
::
updateAudioDevicesIn
()
void
ConfigurationPanel
::
updateAudioDevicesIn
()
{
{
static
std
::
list
<
QRadioButton
*
>
buttonsIn
;
QComboBox
*
cbo
=
cboDriverChoiceIn
;
while
(
buttonsIn
.
begin
()
!=
buttonsIn
.
end
())
{
DriverChoiceIn
->
remove
(
*
buttonsIn
.
begin
());
buttonsIn
.
pop_front
();
}
int
top
=
0
;
//In
std
::
list
<
AudioDevice
>
audio
=
ConfigurationManager
::
instance
().
getAudioDevicesIn
();
std
::
list
<
AudioDevice
>
audio
=
ConfigurationManager
::
instance
().
getAudioDevicesIn
();
std
::
list
<
AudioDevice
>::
iterator
pos
;
std
::
list
<
AudioDevice
>::
iterator
pos
;
cbo
->
clear
();
for
(
pos
=
audio
.
begin
();
pos
!=
audio
.
end
();
pos
++
)
{
for
(
pos
=
audio
.
begin
();
pos
!=
audio
.
end
();
pos
++
)
{
QString
hostApiName
=
pos
->
hostApiName
;
QString
hostApiName
=
pos
->
hostApiName
;
QString
deviceName
=
pos
->
deviceName
;
QString
deviceName
=
pos
->
deviceName
;
QString
name
=
hostApiName
+
QString
name
=
hostApiName
+
QObject
::
tr
(
" (device #%1)"
).
arg
(
pos
->
index
);
QObject
::
tr
(
" (device #%1)"
).
arg
(
pos
->
index
);
if
(
name
.
length
()
>
50
)
{
name
=
name
.
left
(
50
)
+
"..."
;
// New radio button with found device name
QRadioButton
*
device
=
new
QRadioButton
(
DriverChoiceIn
);
buttonsIn
.
push_back
(
device
);
DriverChoiceIn
->
insert
(
device
,
pos
->
index
.
toUInt
());
//device->setGeometry( QRect( 10, 30 + top, 360, 21 ) );
// Set label of radio button
//device->setText(deviceName);
// Add tooltip for each one
QString
text
=
deviceName
+
" "
+
name
;
if
(
text
.
length
()
>
50
)
{
device
->
setText
(
text
.
left
(
50
)
+
"..."
);
}
}
else
{
cbo
->
insertItem
(
name
);
device
->
setText
(
text
);
}
}
QToolTip
::
add
(
device
,
text
);
top
+=
30
;
}
// Set position of the button group, with appropriate length
//DriverChoiceIn->setGeometry( QRect( 10, 200, 410, top + 30 ) );
}
}
void
ConfigurationPanel
::
updateAudioDevicesOut
()
void
ConfigurationPanel
::
updateAudioDevicesOut
()
...
@@ -401,50 +352,21 @@ void ConfigurationPanel::updateAudioDevicesOut()
...
@@ -401,50 +352,21 @@ void ConfigurationPanel::updateAudioDevicesOut()
void
ConfigurationPanel
::
updateAudioDevices
()
void
ConfigurationPanel
::
updateAudioDevices
()
{
{
static
std
::
list
<
QRadioButton
*
>
buttons
;
QComboBox
*
cbo
=
cboDriverChoiceOut
;
while
(
buttons
.
begin
()
!=
buttons
.
end
())
{
DriverChoice
->
remove
(
*
buttons
.
begin
());
buttons
.
pop_front
();
}
int
top
=
0
;
std
::
list
<
AudioDevice
>
audio
=
ConfigurationManager
::
instance
().
getAudioDevicesOut
();
std
::
list
<
AudioDevice
>
audio
=
ConfigurationManager
::
instance
().
getAudioDevicesOut
();
std
::
list
<
AudioDevice
>::
iterator
pos
;
std
::
list
<
AudioDevice
>::
iterator
pos
;
cbo
->
clear
();
for
(
pos
=
audio
.
begin
();
pos
!=
audio
.
end
();
pos
++
)
{
for
(
pos
=
audio
.
begin
();
pos
!=
audio
.
end
();
pos
++
)
{
QString
hostApiName
=
pos
->
hostApiName
;
QString
hostApiName
=
pos
->
hostApiName
;
QString
deviceName
=
pos
->
deviceName
;
QString
deviceName
=
pos
->
deviceName
;
QString
name
=
hostApiName
+
QString
name
=
hostApiName
+
QObject
::
tr
(
" (device #%1)"
).
arg
(
pos
->
index
);
QObject
::
tr
(
" (device #%1)"
).
arg
(
pos
->
index
);
if
(
name
.
length
()
>
50
)
{
name
=
name
.
left
(
50
)
+
"..."
;
// New radio button with found device name
QRadioButton
*
device
=
new
QRadioButton
(
DriverChoice
);
buttons
.
push_back
(
device
);
DriverChoice
->
insert
(
device
,
pos
->
index
.
toUInt
());
//device->setGeometry( QRect( 10, 30 + top, 360, 21 ) );
// Set label of radio button
//device->setText(deviceName);
// Add tooltip for each one
QString
text
=
deviceName
+
" "
+
name
;
if
(
text
.
length
()
>
50
)
{
device
->
setText
(
text
.
left
(
50
)
+
"..."
);
}
}
else
{
cbo
->
insertItem
(
name
);
device
->
setText
(
text
);
}
}
QToolTip
::
add
(
device
,
text
);
top
+=
30
;
}
// Set position of the button group, with appropriate length
//DriverChoice->setGeometry( QRect( 10, 10, 410, top + 30 ) );
}
}
...
@@ -476,6 +398,15 @@ ConfigurationPanel::slotRegisterReturn( bool hasError, QString )
...
@@ -476,6 +398,15 @@ ConfigurationPanel::slotRegisterReturn( bool hasError, QString )
void
ConfigurationPanel
::
slotTestSoundDriver
()
void
ConfigurationPanel
::
slotTestSoundDriver
()
{
{
// save driver in configuration manager
if
(
cboDriverChoiceOut
->
currentText
()
!=
NULL
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
,
QString
::
number
(
cboDriverChoiceOut
->
currentItem
()));
}
if
(
cboDriverChoiceIn
->
currentText
()
!=
NULL
)
{
ConfigurationManager
::
instance
().
set
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
,
QString
::
number
(
cboDriverChoiceIn
->
currentItem
()));
}
// save driver on portaudio
ConfigurationManager
::
instance
().
save
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
);
ConfigurationManager
::
instance
().
save
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEOUT
);
ConfigurationManager
::
instance
().
save
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
);
ConfigurationManager
::
instance
().
save
(
AUDIO_SECTION
,
AUDIO_DEFAULT_DEVICEIN
);
emit
soundDriverChanged
();
emit
soundDriverChanged
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment