Diffstat (limited to 'noncore/settings/networksettings2/cable/cableedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/cable/cableedit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/cable/cableedit.cpp b/noncore/settings/networksettings2/cable/cableedit.cpp index 6e1a13b..4e57845 100644 --- a/noncore/settings/networksettings2/cable/cableedit.cpp +++ b/noncore/settings/networksettings2/cable/cableedit.cpp | |||
@@ -8,48 +8,48 @@ | |||
8 | #include "cableedit.h" | 8 | #include "cableedit.h" |
9 | 9 | ||
10 | static long SpeedTable[] = { | 10 | static long SpeedTable[] = { |
11 | 2400, 9600, 19200, 38400, 57600, 115200, | 11 | 2400, 9600, 19200, 38400, 57600, 115200, |
12 | 230400, 460800, 500000, 921600, 1000000, | 12 | 230400, 460800, 500000, 921600, 1000000, |
13 | 1152000, 1500000, 2000000, 2500000, 3000000, | 13 | 1152000, 1500000, 2000000, 2500000, 3000000, |
14 | 3500000, 4000000, -1 | 14 | 3500000, 4000000, -1 |
15 | }; | 15 | }; |
16 | 16 | ||
17 | CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) { | 17 | CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) { |
18 | } | 18 | } |
19 | 19 | ||
20 | void CableEdit::showData( CableData_t & D ) { | 20 | void CableEdit::showData( CableData & D ) { |
21 | DeviceFile_LE->setText( D.Device ); | 21 | DeviceFile_LE->setText( D.Device ); |
22 | LockFile_LE->setText( D.LockFile ); | 22 | LockFile_LE->setText( D.LockFile ); |
23 | for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { | 23 | for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { |
24 | if( *Run == D.Speed ) { | 24 | if( *Run == D.Speed ) { |
25 | Speed_CB->setCurrentItem( | 25 | Speed_CB->setCurrentItem( |
26 | ((long)(Run)-(long)(SpeedTable))/sizeof(long) ); | 26 | ((long)(Run)-(long)(SpeedTable))/sizeof(long) ); |
27 | break; | 27 | break; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | Parity_CB->setCurrentItem( D.Parity ); | 30 | Parity_CB->setCurrentItem( D.Parity ); |
31 | DataBits_SB->setValue( D.DataBits ); | 31 | DataBits_SB->setValue( D.DataBits ); |
32 | StopBits_CB->setCurrentItem( D.StopBits ); | 32 | StopBits_CB->setCurrentItem( D.StopBits ); |
33 | HardwareFC_CB->setChecked( D.HardwareControl ); | 33 | HardwareFC_CB->setChecked( D.HardwareControl ); |
34 | SoftwareFC_CB->setChecked( D.SoftwareControl ); | 34 | SoftwareFC_CB->setChecked( D.SoftwareControl ); |
35 | } | 35 | } |
36 | 36 | ||
37 | QString CableEdit::acceptable( void ) { | 37 | QString CableEdit::acceptable( void ) { |
38 | if( DeviceFile_LE->text().isEmpty() ) | 38 | if( DeviceFile_LE->text().isEmpty() ) |
39 | return tr("Device filename needed"); | 39 | return tr("Device filename needed"); |
40 | return QString(); | 40 | return QString(); |
41 | } | 41 | } |
42 | 42 | ||
43 | bool CableEdit::commit( CableData_t & D ) { | 43 | bool CableEdit::commit( CableData & D ) { |
44 | bool SM = 0; | 44 | bool SM = 0; |
45 | 45 | ||
46 | TXTM( D.Device, DeviceFile_LE, SM ); | 46 | TXTM( D.Device, DeviceFile_LE, SM ); |
47 | TXTM( D.LockFile, LockFile_LE, SM ); | 47 | TXTM( D.LockFile, LockFile_LE, SM ); |
48 | 48 | ||
49 | for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { | 49 | for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { |
50 | if( *Run == D.Speed ) { | 50 | if( *Run == D.Speed ) { |
51 | if( D.Speed != Speed_CB->currentText().toLong() ) { | 51 | if( D.Speed != Speed_CB->currentText().toLong() ) { |
52 | SM = 1; | 52 | SM = 1; |
53 | D.Speed = Speed_CB->currentText().toLong(); | 53 | D.Speed = Speed_CB->currentText().toLong(); |
54 | } | 54 | } |
55 | break; | 55 | break; |