Diffstat (limited to 'noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp index d740b6f..915233a 100644 --- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp +++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerconfig.cpp | |||
@@ -28,182 +28,182 @@ | |||
28 | #include <qvariant.h> | 28 | #include <qvariant.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qwhatsthis.h> | 30 | #include <qwhatsthis.h> |
31 | #include <qlabel.h> | 31 | #include <qlabel.h> |
32 | #include <qstringlist.h> | 32 | #include <qstringlist.h> |
33 | #include <qmainwindow.h> | 33 | #include <qmainwindow.h> |
34 | 34 | ||
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | 36 | ||
37 | StocktickerPluginConfig::StocktickerPluginConfig( QWidget *parent, const char* name) | 37 | StocktickerPluginConfig::StocktickerPluginConfig( QWidget *parent, const char* name) |
38 | : TodayConfigWidget(parent, name ) { | 38 | : TodayConfigWidget(parent, name ) { |
39 | 39 | ||
40 | QGridLayout *layout = new QGridLayout( this ); | 40 | QGridLayout *layout = new QGridLayout( this ); |
41 | layout->setSpacing(2); | 41 | layout->setSpacing(2); |
42 | layout->setMargin( 2); | 42 | layout->setMargin( 2); |
43 | 43 | ||
44 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 44 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
45 | LineEdit1->setFocus(); | 45 | LineEdit1->setFocus(); |
46 | // QWhatsThis::add( LineEdit1, tr("Enter the stock symbols you want to be shown here.")); | 46 | // QWhatsThis::add( LineEdit1, tr("Enter the stock symbols you want to be shown here.")); |
47 | 47 | ||
48 | layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 4); | 48 | layout->addMultiCellWidget( LineEdit1, 0, 0, 0, 4); |
49 | 49 | ||
50 | Config cfg( "stockticker"); | 50 | Config cfg( "stockticker"); |
51 | cfg.setGroup( "Symbols" ); | 51 | cfg.setGroup( "Symbols" ); |
52 | QString symbollist; | 52 | QString symbollist; |
53 | symbollist = cfg.readEntry("Symbols", ""); | 53 | symbollist = cfg.readEntry("Symbols", ""); |
54 | LineEdit1->setText(symbollist); | 54 | LineEdit1->setText(symbollist); |
55 | 55 | ||
56 | QLabel *label; | 56 | QLabel *label; |
57 | label = new QLabel(this); | 57 | label = new QLabel(this); |
58 | label->setText( tr("Enter stock symbols seperated\nby a space.")); | 58 | label->setText( tr("Enter stock symbols seperated\nby a space.")); |
59 | label->setMaximumHeight(60); | 59 | label->setMaximumHeight(60); |
60 | layout->addMultiCellWidget( label, 1, 1, 0, 4); | 60 | layout->addMultiCellWidget( label, 1, 1, 0, 4); |
61 | 61 | ||
62 | cfg.setGroup( "Fields" ); | 62 | cfg.setGroup( "Fields" ); |
63 | 63 | ||
64 | timeCheck= new QCheckBox ( "Time",this ); | 64 | timeCheck= new QCheckBox ( "Time",this ); |
65 | timeCheck->setChecked( cfg.readBoolEntry("timeCheck",1)); | 65 | timeCheck->setChecked( cfg.readBoolEntry("timeCheck",1)); |
66 | layout->addMultiCellWidget(timeCheck, 2, 2, 0, 0 ); | 66 | layout->addMultiCellWidget(timeCheck, 2, 2, 0, 0 ); |
67 | QWhatsThis::add( timeCheck, tr("Toggles Time of current price field")); | 67 | QWhatsThis::add( timeCheck, tr("Toggles Time of current price field")); |
68 | 68 | ||
69 | dateCheck= new QCheckBox ( "Date", this ); | 69 | dateCheck= new QCheckBox ( "Date", this ); |
70 | dateCheck->setChecked( cfg.readBoolEntry("dateCheck",1)); | 70 | dateCheck->setChecked( cfg.readBoolEntry("dateCheck",1)); |
71 | layout->addMultiCellWidget( dateCheck, 2, 2, 1, 1 ); | 71 | layout->addMultiCellWidget( dateCheck, 2, 2, 1, 1 ); |
72 | QWhatsThis::add(dateCheck, tr("Toggles date field")); | 72 | QWhatsThis::add(dateCheck, tr("Toggles date field")); |
73 | 73 | ||
74 | symbolCheck= new QCheckBox ( "Symbol", this ); | 74 | symbolCheck= new QCheckBox ( "Symbol", this ); |
75 | symbolCheck->setChecked( cfg.readBoolEntry("symbolCheck",1)); | 75 | symbolCheck->setChecked( cfg.readBoolEntry("symbolCheck",1)); |
76 | layout->addMultiCellWidget( symbolCheck, 2, 2, 2, 2 ); | 76 | layout->addMultiCellWidget( symbolCheck, 2, 2, 2, 2 ); |
77 | QWhatsThis::add(symbolCheck, tr("Toggles Symbol field")); | 77 | QWhatsThis::add(symbolCheck, tr("Toggles Symbol field")); |
78 | 78 | ||
79 | nameCheck= new QCheckBox ( "Name", this ); | 79 | nameCheck= new QCheckBox ( "Name", this ); |
80 | nameCheck->setChecked( cfg.readBoolEntry("nameCheck",1)); | 80 | nameCheck->setChecked( cfg.readBoolEntry("nameCheck",1)); |
81 | layout->addMultiCellWidget( nameCheck, 3, 3, 0, 0 ); | 81 | layout->addMultiCellWidget( nameCheck, 3, 3, 0, 0 ); |
82 | QWhatsThis::add(nameCheck, tr("Toggles Name of symbols owner field")); | 82 | QWhatsThis::add(nameCheck, tr("Toggles Name of symbols owner field")); |
83 | 83 | ||
84 | currentPriceCheck= new QCheckBox ( "Price", this ); | 84 | currentPriceCheck= new QCheckBox ( "Price", this ); |
85 | currentPriceCheck->setChecked( cfg.readBoolEntry("currentPriceCheck",1)); | 85 | currentPriceCheck->setChecked( cfg.readBoolEntry("currentPriceCheck",1)); |
86 | layout->addMultiCellWidget( currentPriceCheck, 3, 3, 1, 1 ); | 86 | layout->addMultiCellWidget( currentPriceCheck, 3, 3, 1, 1 ); |
87 | QWhatsThis::add(currentPriceCheck, tr("Toggles current Price field")); | 87 | QWhatsThis::add(currentPriceCheck, tr("Toggles current Price field")); |
88 | 88 | ||
89 | lastPriceCheck= new QCheckBox ( "Last Price", this ); | 89 | lastPriceCheck= new QCheckBox ( "Last Price", this ); |
90 | lastPriceCheck->setChecked( cfg.readBoolEntry("lastPriceCheck",1)); | 90 | lastPriceCheck->setChecked( cfg.readBoolEntry("lastPriceCheck",1)); |
91 | layout->addMultiCellWidget(lastPriceCheck, 3, 3, 2, 2); | 91 | layout->addMultiCellWidget(lastPriceCheck, 3, 3, 2, 2); |
92 | QWhatsThis::add(lastPriceCheck, tr("Toggles last price field")); | 92 | QWhatsThis::add(lastPriceCheck, tr("Toggles last price field")); |
93 | 93 | ||
94 | openPriceCheck= new QCheckBox ( "Open Price", this); | 94 | openPriceCheck= new QCheckBox ( "Open Price", this); |
95 | openPriceCheck->setChecked( cfg.readBoolEntry("openPriceCheck",1)); | 95 | openPriceCheck->setChecked( cfg.readBoolEntry("openPriceCheck",1)); |
96 | layout->addMultiCellWidget( openPriceCheck, 4, 4, 0, 0 ); | 96 | layout->addMultiCellWidget( openPriceCheck, 4, 4, 0, 0 ); |
97 | QWhatsThis::add(openPriceCheck, tr("Toggles opening price field")); | 97 | QWhatsThis::add(openPriceCheck, tr("Toggles opening price field")); |
98 | 98 | ||
99 | minPriceCheck= new QCheckBox ( "Min Price", this ); | 99 | minPriceCheck= new QCheckBox ( "Min Price", this ); |
100 | minPriceCheck->setChecked( cfg.readBoolEntry("minPriceCheck",1)); | 100 | minPriceCheck->setChecked( cfg.readBoolEntry("minPriceCheck",1)); |
101 | layout->addMultiCellWidget( minPriceCheck, 4, 4, 1, 1); | 101 | layout->addMultiCellWidget( minPriceCheck, 4, 4, 1, 1); |
102 | QWhatsThis::add(minPriceCheck, tr("Toggles minimum daily price field")); | 102 | QWhatsThis::add(minPriceCheck, tr("Toggles minimum daily price field")); |
103 | 103 | ||
104 | maxPriceCheck= new QCheckBox ( "Max Price", this); | 104 | maxPriceCheck= new QCheckBox ( "Max Price", this); |
105 | maxPriceCheck->setChecked( cfg.readBoolEntry("maxPriceCheck",1)); | 105 | maxPriceCheck->setChecked( cfg.readBoolEntry("maxPriceCheck",1)); |
106 | layout->addMultiCellWidget( maxPriceCheck, 4, 4, 2, 2 ); | 106 | layout->addMultiCellWidget( maxPriceCheck, 4, 4, 2, 2 ); |
107 | QWhatsThis::add(maxPriceCheck, tr("Toggles maximum daily price field")); | 107 | QWhatsThis::add(maxPriceCheck, tr("Toggles maximum daily price field")); |
108 | 108 | ||
109 | variationCheck= new QCheckBox ( "Variation", this ); | 109 | variationCheck= new QCheckBox ( "Variation", this ); |
110 | variationCheck->setChecked( cfg.readBoolEntry("variationCheck",1)); | 110 | variationCheck->setChecked( cfg.readBoolEntry("variationCheck",1)); |
111 | layout->addMultiCellWidget( variationCheck, 5, 5, 0, 0 ); | 111 | layout->addMultiCellWidget( variationCheck, 5, 5, 0, 0 ); |
112 | QWhatsThis::add(variationCheck, tr("Toggles daily variation of price field")); | 112 | QWhatsThis::add(variationCheck, tr("Toggles daily variation of price field")); |
113 | 113 | ||
114 | volumeCheck= new QCheckBox ( "Volume", this ); | 114 | volumeCheck= new QCheckBox ( "Volume", this ); |
115 | volumeCheck->setChecked( cfg.readBoolEntry("volumeCheck",1)); | 115 | volumeCheck->setChecked( cfg.readBoolEntry("volumeCheck",1)); |
116 | layout->addMultiCellWidget( volumeCheck , 5, 5, 1, 1); | 116 | layout->addMultiCellWidget( volumeCheck , 5, 5, 1, 1); |
117 | QWhatsThis::add(volumeCheck, tr("Toggles volume of trading field")); | 117 | QWhatsThis::add(volumeCheck, tr("Toggles volume of trading field")); |
118 | 118 | ||
119 | timerDelaySpin = new QSpinBox( this, "timer spin" ); | 119 | timerDelaySpin = new QSpinBox( this, "timer spin" ); |
120 | QWhatsThis::add( timerDelaySpin , tr( "How often stocks prices should be looked up. In minutes" ) ); | 120 | QWhatsThis::add( timerDelaySpin , tr( "How often stocks prices should be looked up. In minutes" ) ); |
121 | timerDelaySpin->setMaxValue( 60); | 121 | timerDelaySpin->setMaxValue( 60); |
122 | 122 | ||
123 | cfg.setGroup("Timer"); | 123 | cfg.setGroup("Timer"); |
124 | timerDelaySpin->setValue( cfg.readNumEntry("Delay",0)); | 124 | timerDelaySpin->setValue( cfg.readNumEntry("Delay",15)); |
125 | layout->addMultiCellWidget( timerDelaySpin , 6, 6, 0, 0); | 125 | layout->addMultiCellWidget( timerDelaySpin , 6, 6, 0, 0); |
126 | 126 | ||
127 | QLabel *label2; | 127 | QLabel *label2; |
128 | label2 = new QLabel(this); | 128 | label2 = new QLabel(this); |
129 | label2->setText( tr("Minutes between lookups.")); | 129 | label2->setText( tr("Minutes between lookups.")); |
130 | label2->setMaximumHeight(60); | 130 | label2->setMaximumHeight(60); |
131 | layout->addMultiCellWidget( label2, 6, 6, 1, 2); | 131 | layout->addMultiCellWidget( label2, 6, 6, 1, 2); |
132 | 132 | ||
133 | scrollSpeed = new QSpinBox( this, "Scrollspin" ); | 133 | scrollSpeed = new QSpinBox( this, "Scrollspin" ); |
134 | QWhatsThis::add( timerDelaySpin , tr( "Speed of scrolling action, in milliseconds" ) ); | 134 | QWhatsThis::add( timerDelaySpin , tr( "Speed of scrolling action, in milliseconds" ) ); |
135 | scrollSpeed->setMaxValue( 1000); | 135 | scrollSpeed->setMaxValue( 1000); |
136 | scrollSpeed->setSteps(50,50); | 136 | scrollSpeed->setSteps(50,50); |
137 | cfg.setGroup("Timer"); | 137 | cfg.setGroup("Timer"); |
138 | scrollSpeed->setValue( cfg.readNumEntry("ScrollSpeed",50)); | 138 | scrollSpeed->setValue( cfg.readNumEntry("ScrollSpeed",50)); |
139 | layout->addMultiCellWidget( scrollSpeed , 7, 7, 0, 0); | 139 | layout->addMultiCellWidget( scrollSpeed , 7, 7, 0, 0); |
140 | 140 | ||
141 | QLabel *label3; | 141 | QLabel *label3; |
142 | label3 = new QLabel(this); | 142 | label3 = new QLabel(this); |
143 | label3->setText( tr("Scroll Speed, in milliseconds")); | 143 | label3->setText( tr("Scroll Speed, in milliseconds")); |
144 | label3->setMaximumHeight(60); | 144 | label3->setMaximumHeight(60); |
145 | layout->addMultiCellWidget( label3, 7, 7, 1, 2); | 145 | layout->addMultiCellWidget( label3, 7, 7, 1, 2); |
146 | 146 | ||
147 | scrollLength = new QSpinBox( this, "ScrollLength" ); | 147 | scrollLength = new QSpinBox( this, "ScrollLength" ); |
148 | QWhatsThis::add( timerDelaySpin , tr( "Length of scrolling" ) ); | 148 | QWhatsThis::add( timerDelaySpin , tr( "Length of scrolling" ) ); |
149 | scrollLength->setMaxValue( 10); | 149 | scrollLength->setMaxValue( 10); |
150 | // scrollLength->setSteps(5,5); | 150 | // scrollLength->setSteps(5,5); |
151 | cfg.setGroup("Timer"); | 151 | cfg.setGroup("Timer"); |
152 | scrollLength->setValue( cfg.readNumEntry("ScrollLength",1)); | 152 | scrollLength->setValue( cfg.readNumEntry("ScrollLength",1)); |
153 | layout->addMultiCellWidget( scrollLength , 8, 8, 0, 0); | 153 | layout->addMultiCellWidget( scrollLength , 8, 8, 0, 0); |
154 | 154 | ||
155 | QLabel *label4; | 155 | QLabel *label4; |
156 | label4 = new QLabel(this); | 156 | label4 = new QLabel(this); |
157 | label4->setText( tr("Scroll Length")); | 157 | label4->setText( tr("Scroll Length")); |
158 | label4->setMaximumHeight(60); | 158 | label4->setMaximumHeight(60); |
159 | layout->addMultiCellWidget( label4, 8, 8, 1, 2); | 159 | layout->addMultiCellWidget( label4, 8, 8, 1, 2); |
160 | 160 | ||
161 | // lookupButton = new QPushButton(this, "LookupButton"); | 161 | // lookupButton = new QPushButton(this, "LookupButton"); |
162 | // lookupButton->setText(tr("Symbol Lookup")); | 162 | // lookupButton->setText(tr("Symbol Lookup")); |
163 | // connect(lookupButton,SIGNAL(clicked()),SLOT( doLookup())); | 163 | // connect(lookupButton,SIGNAL(clicked()),SLOT( doLookup())); |
164 | // layout->addMultiCellWidget( lookupButton , 9, 9, 0, 0); | 164 | // layout->addMultiCellWidget( lookupButton , 9, 9, 0, 0); |
165 | 165 | ||
166 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | 166 | QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); |
167 | layout->addItem( spacer, 9, 0 ); | 167 | layout->addItem( spacer, 9, 0 ); |
168 | 168 | ||
169 | } | 169 | } |
170 | 170 | ||
171 | 171 | ||
172 | void StocktickerPluginConfig::writeConfig() { | 172 | void StocktickerPluginConfig::writeConfig() { |
173 | Config cfg( "stockticker"); | 173 | Config cfg( "stockticker"); |
174 | cfg.setGroup( "Symbols" ); | 174 | cfg.setGroup( "Symbols" ); |
175 | QString outText = text().upper(); | 175 | QString outText = text().upper(); |
176 | outText.stripWhiteSpace(); | 176 | outText.stripWhiteSpace(); |
177 | cfg.writeEntry("Symbols", outText ); | 177 | cfg.writeEntry("Symbols", outText ); |
178 | cfg.setGroup( "Fields" ); | 178 | cfg.setGroup( "Fields" ); |
179 | cfg.writeEntry("timeCheck",timeCheck->isChecked()); | 179 | cfg.writeEntry("timeCheck",timeCheck->isChecked()); |
180 | cfg.writeEntry("dateCheck",dateCheck->isChecked()); | 180 | cfg.writeEntry("dateCheck",dateCheck->isChecked()); |
181 | cfg.writeEntry("symbolCheck",symbolCheck->isChecked()); | 181 | cfg.writeEntry("symbolCheck",symbolCheck->isChecked()); |
182 | cfg.writeEntry("nameCheck",nameCheck->isChecked()); | 182 | cfg.writeEntry("nameCheck",nameCheck->isChecked()); |
183 | cfg.writeEntry("currentPriceCheck",currentPriceCheck->isChecked()); | 183 | cfg.writeEntry("currentPriceCheck",currentPriceCheck->isChecked()); |
184 | cfg.writeEntry("lastPriceCheck",lastPriceCheck->isChecked()); | 184 | cfg.writeEntry("lastPriceCheck",lastPriceCheck->isChecked()); |
185 | cfg.writeEntry("openPriceCheck",openPriceCheck->isChecked()); | 185 | cfg.writeEntry("openPriceCheck",openPriceCheck->isChecked()); |
186 | cfg.writeEntry("minPriceCheck",minPriceCheck->isChecked()); | 186 | cfg.writeEntry("minPriceCheck",minPriceCheck->isChecked()); |
187 | cfg.writeEntry("maxPriceCheck",maxPriceCheck->isChecked()); | 187 | cfg.writeEntry("maxPriceCheck",maxPriceCheck->isChecked()); |
188 | cfg.writeEntry("variationCheck",variationCheck->isChecked()); | 188 | cfg.writeEntry("variationCheck",variationCheck->isChecked()); |
189 | cfg.writeEntry("volumeCheck",volumeCheck->isChecked()); | 189 | cfg.writeEntry("volumeCheck",volumeCheck->isChecked()); |
190 | 190 | ||
191 | cfg.setGroup("Timer"); | 191 | cfg.setGroup("Timer"); |
192 | cfg.writeEntry("Delay",timerDelaySpin->value()); | 192 | cfg.writeEntry("Delay",timerDelaySpin->value()); |
193 | cfg.writeEntry("ScrollLength",scrollLength->value()); | 193 | cfg.writeEntry("ScrollLength",scrollLength->value()); |
194 | cfg.writeEntry("ScrollSpeed",scrollSpeed->value()); | 194 | cfg.writeEntry("ScrollSpeed",scrollSpeed->value()); |
195 | 195 | ||
196 | cfg.write(); | 196 | cfg.write(); |
197 | } | 197 | } |
198 | 198 | ||
199 | StocktickerPluginConfig::~StocktickerPluginConfig() { | 199 | StocktickerPluginConfig::~StocktickerPluginConfig() { |
200 | } | 200 | } |
201 | 201 | ||
202 | QString StocktickerPluginConfig::text() const { | 202 | QString StocktickerPluginConfig::text() const { |
203 | return LineEdit1->text(); | 203 | return LineEdit1->text(); |
204 | } | 204 | } |
205 | 205 | ||
206 | void StocktickerPluginConfig::doLookup() { | 206 | void StocktickerPluginConfig::doLookup() { |
207 | 207 | ||
208 | system("stockticker"); | 208 | system("stockticker"); |
209 | } | 209 | } |