Kaydet (Commit) ab713ba1 authored tarafından Caolán McNamara's avatar Caolán McNamara

Changing scanners has no effect

I guess no-one ever tested with multiple scanners but it just happens that my
laptops webcam is presented as a (non-functional) scanner alongside the real
one

Change-Id: Ie36651cfc867027ef19e272dbabe46de6c4261ee
üst 88e940f3
......@@ -182,7 +182,6 @@ SaneDlg::SaneDlg( Window* pParent, Sane& rSane, bool bScanEnabled ) :
get(mpRightField, "rightSpinbutton");
get(mpBottomField, "bottomSpinbutton");
get(mpDeviceBox, "deviceCombobox");
mpDeviceBox->SetStyle(mpDeviceBox->GetStyle() | WB_SORT);
get(mpReslBox, "reslCombobox");
get(mpAdvancedBox, "advancedCheckbutton");
get(mpVectorBox, "vectorSpinbutton-nospin");
......@@ -264,13 +263,12 @@ void SaneDlg::InitDevices()
mrSane.Close();
mrSane.ReloadDevices();
mpDeviceBox->Clear();
for( int i = 0; i < Sane::CountDevices(); i++ )
mpDeviceBox->InsertEntry( Sane::GetName( i ) );
for (int i = 0; i < Sane::CountDevices(); ++i)
mpDeviceBox->InsertEntry(Sane::GetName(i));
if( Sane::CountDevices() )
{
mrSane.Open( 0 );
mpDeviceBox->SelectEntry( Sane::GetName( 0 ) );
mrSane.Open(0);
mpDeviceBox->SelectEntryPos(0);
}
}
......@@ -599,12 +597,12 @@ IMPL_LINK( SaneDlg, SelectHdl, ListBox*, pListBox )
{
if( pListBox == mpDeviceBox && Sane::IsSane() && Sane::CountDevices() )
{
OUString aNewDevice = mpDeviceBox->GetSelectEntry();
int nNumber;
if( aNewDevice == Sane::GetName( nNumber = mrSane.GetDeviceNumber() ) )
int nNewNumber = mpDeviceBox->GetSelectEntryPos();
int nOldNumber = mrSane.GetDeviceNumber();
if (nNewNumber != nOldNumber)
{
mrSane.Close();
mrSane.Open( nNumber );
mrSane.Open(nNewNumber);
InitFields();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment