@@ -23,7 +23,7 @@ mod imp;
23
23
// Imports
24
24
use adwaita:: { gio, glib} ;
25
25
use gio:: Settings ;
26
- use glib:: { Object , SourceId , translate:: FromGlib , clone } ;
26
+ use glib:: { clone , translate:: FromGlib , Object , SourceId } ;
27
27
use gtk:: { prelude:: * , subclass:: prelude:: * , Align , Button , Grid , Label , LayoutChild , Orientation } ;
28
28
use std:: { sync:: Arc , sync:: Mutex , sync:: MutexGuard } ;
29
29
@@ -154,7 +154,7 @@ impl GpuPage {
154
154
155
155
// Load list of Views
156
156
let loaded_views_data: Vec < String > = settings_obj. get :: < Vec < String > > ( "viewconfigs" ) ;
157
- println ! ( "views saved:`{}`" , loaded_views_data. len( ) ) ; //TEST
157
+ println ! ( "views saved:`{}`" , loaded_views_data. len( ) ) ; //TEST
158
158
159
159
// Create Views
160
160
// If present in saved settings, use! otherwise follow below defaults
@@ -181,7 +181,8 @@ impl GpuPage {
181
181
//child_manager.set_property("column-span", 1);
182
182
183
183
// Build title label & add to grid
184
- let label_value: String = String :: from ( "Please edit the list of Views using 'Edit Views' button" ) ;
184
+ let label_value: String =
185
+ String :: from ( "Please edit the list of Views using 'Edit Views' button" ) ;
185
186
let new_title_label: Label = Label :: builder ( )
186
187
. label ( & label_value)
187
188
. name ( "default" )
@@ -200,15 +201,15 @@ impl GpuPage {
200
201
& new_grid,
201
202
Some ( "default" ) ,
202
203
"Default" ,
203
- "package-x-generic-symbolic"
204
+ "package-x-generic-symbolic" ,
204
205
) ;
205
- } else {
206
+ } else {
206
207
// Create temporary structure for sorting loaded data
207
208
let mut loaded_views: Vec < String > = vec ! [ String :: from( "" ) ; loaded_views_data. len( ) ] ;
208
209
209
210
// For each loaded view
210
211
for index in 0 ..loaded_views_data. len ( ) {
211
- println ! ( "item: `{}`" , loaded_views_data[ index] ) ; //TEST
212
+ println ! ( "item: `{}`" , loaded_views_data[ index] ) ; //TEST
212
213
213
214
// Split current item into the 4 parts
214
215
let parts: Vec < & str > = loaded_views_data[ index] . split ( ':' ) . collect :: < Vec < & str > > ( ) ;
@@ -220,16 +221,18 @@ impl GpuPage {
220
221
221
222
// If from valid page
222
223
if parts[ 0 ] == self . property :: < String > ( "uuid" ) {
223
- println ! ( "VALID UUID" ) ; //TEST
224
+ println ! ( "VALID UUID" ) ; //TEST
224
225
225
226
// If a valid position
226
227
match parts[ 1 ] . parse :: < usize > ( ) {
227
- Ok ( position) => if position <= loaded_views_data. len ( ) {
228
- println ! ( "VALID POSITION INDEX: `{}`" , position) ; //TEST
228
+ Ok ( position) => {
229
+ if position <= loaded_views_data. len ( ) {
230
+ println ! ( "VALID POSITION INDEX: `{}`" , position) ; //TEST
229
231
230
- // Add to final list
231
- loaded_views[ position] = parts[ 2 ] . to_owned ( ) ;
232
- } ,
232
+ // Add to final list
233
+ loaded_views[ position] = parts[ 2 ] . to_owned ( ) ;
234
+ }
235
+ }
233
236
Err ( _) => panic ! ( "Invalid Property position in gschema data.." ) ,
234
237
}
235
238
}
@@ -269,7 +272,7 @@ impl GpuPage {
269
272
& new_view_grid,
270
273
Some ( & new_stack_item_name) ,
271
274
& loaded_views[ index] ,
272
- "package-x-generic-symbolic"
275
+ "package-x-generic-symbolic" ,
273
276
) ;
274
277
}
275
278
}
@@ -297,7 +300,7 @@ impl GpuPage {
297
300
298
301
// Load list of Properties for current Page
299
302
let loaded_properties_data: Vec < String > = settings_obj. get :: < Vec < String > > ( "pageconfigs" ) ;
300
- println ! ( "items saved:`{}`" , loaded_properties_data. len( ) ) ; //TEST
303
+ println ! ( "items saved:`{}`" , loaded_properties_data. len( ) ) ; //TEST
301
304
302
305
// If present in saved settings, use! otherwise follow below defaults
303
306
if let 0 = loaded_properties_data. len ( ) {
@@ -310,13 +313,16 @@ impl GpuPage {
310
313
}
311
314
} else {
312
315
// Create temporary structure for sorting loaded data
313
- let mut loaded_properties: Vec < String > = vec ! [ String :: from( "" ) ; loaded_properties_data. len( ) ] ;
316
+ let mut loaded_properties: Vec < String > =
317
+ vec ! [ String :: from( "" ) ; loaded_properties_data. len( ) ] ;
314
318
315
319
for index in 0 ..loaded_properties_data. len ( ) {
316
- println ! ( "item: `{}`" , loaded_properties_data[ index] ) ; //TEST
320
+ println ! ( "item: `{}`" , loaded_properties_data[ index] ) ; //TEST
317
321
318
322
// Split current item into the 4 parts
319
- let parts: Vec < & str > = loaded_properties_data[ index] . split ( ':' ) . collect :: < Vec < & str > > ( ) ;
323
+ let parts: Vec < & str > = loaded_properties_data[ index]
324
+ . split ( ':' )
325
+ . collect :: < Vec < & str > > ( ) ;
320
326
321
327
// Catch any malformed items
322
328
if parts. len ( ) != 4 {
@@ -325,22 +331,24 @@ impl GpuPage {
325
331
326
332
// If from valid page
327
333
if parts[ 0 ] == self . property :: < String > ( "uuid" ) {
328
- println ! ( "VALID UUID" ) ; //TEST
334
+ println ! ( "VALID UUID" ) ; //TEST
329
335
330
336
// If from valid view
331
337
if parts[ 1 ] == view_name {
332
- println ! ( "VALID VIEW #" ) ; //TEST
338
+ println ! ( "VALID VIEW #" ) ; //TEST
333
339
334
340
// If a valid position
335
341
match parts[ 2 ] . parse :: < usize > ( ) {
336
- Ok ( position) => if position <= loaded_properties_data. len ( ) {
337
- println ! ( "VALID POSITION INDEX: `{}`" , position) ; //TEST
342
+ Ok ( position) => {
343
+ if position <= loaded_properties_data. len ( ) {
344
+ println ! ( "VALID POSITION INDEX: `{}`" , position) ; //TEST
338
345
339
- println ! ( "VALID PROPERTY: `{}`" , parts[ 3 ] ) ; //TEST
346
+ println ! ( "VALID PROPERTY: `{}`" , parts[ 3 ] ) ; //TEST
340
347
341
- // Add to final list
342
- loaded_properties[ position] = parts[ 3 ] . to_owned ( ) ;
343
- } ,
348
+ // Add to final list
349
+ loaded_properties[ position] = parts[ 3 ] . to_owned ( ) ;
350
+ }
351
+ }
344
352
Err ( _) => panic ! ( "Invalid Property position in gschema data.." ) ,
345
353
}
346
354
}
@@ -391,9 +399,9 @@ impl GpuPage {
391
399
// Remove recurring closure
392
400
id. remove ( ) ;
393
401
394
- println ! ( "REMOVED RECURRING CLOSURE.." ) ; //TEST
402
+ println ! ( "REMOVED RECURRING CLOSURE.." ) ; //TEST
395
403
} else {
396
- println ! ( "NO PRE-EXISTING RECURRING CLOSURE.." ) ; //TEST
404
+ println ! ( "NO PRE-EXISTING RECURRING CLOSURE.." ) ; //TEST
397
405
}
398
406
}
399
407
@@ -414,7 +422,7 @@ impl GpuPage {
414
422
// For each Property
415
423
let mut labels: Vec < Label > = Vec :: new ( ) ;
416
424
for property in Arc :: clone ( & properties_store) . lock ( ) . unwrap ( ) . iter ( ) {
417
- println ! ( "BUILDING PROPERTY LABEL: `{}`" , property) ; //TEST
425
+ println ! ( "BUILDING PROPERTY LABEL: `{}`" , property) ; //TEST
418
426
419
427
//==BUILD==
420
428
// Build grid for 2 labels and attach to this page
@@ -536,7 +544,7 @@ impl GpuPage {
536
544
537
545
// Add to list of content labels, for updating in closure (see below)
538
546
labels. push ( new_content_label) ;
539
- } ,
547
+ }
540
548
None => panic ! ( "Cannot find layout manager.." ) ,
541
549
}
542
550
}
0 commit comments