summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/mythinstall/misc_settings.cpp
blob: 7c3eb6777e1a6f2b7d62eb5f23bb471bfcc98596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
#include <mythcontext.h>
#include <unistd.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <cstdlib>
#include "misc_settings.h"
#include "mv_common.h"
#include "uitypes.h"

extern  HostParms hostparm;

static HostCheckBox *HostShowToolTips()
{
    HostCheckBox *gc = new HostCheckBox("HostShowToolTips");
    gc->setLabel(QObject::tr("Show shortcuts"));
    gc->setValue(true);
    gc->setHelpText(QObject::tr("Shows a popup window describing how to open a console and various other items."));
    return gc;
};

static HostComboBox *Hostupdateplan()
{
    HostComboBox *gc = new HostComboBox("Hostupdateplan");
    gc->setLabel(QObject::tr("Automatic updates"));
    gc->addSelection("None");
    gc->addSelection("Myth_only");
    gc->addSelection("All");
    gc->setHelpText("Download and apply updates.  None: Will not download any updates , Myth_only: automatic updates for MythTV, All: Automatic updates for the entire system.");
    return gc;

}
static HostLineEdit *HostZipcode()
{
    HostLineEdit *gc = new HostLineEdit("HostZipcode");
    gc->setLabel(QObject::tr("Zip Code"));
    gc->setHelpText(QObject::tr("The zipcode will be used to configure MythMovieTimes.  Leave it blank to use the existing value. People located outside the U.S.A should probably leave this blank"));
    //gc->setRW();
    //gc->setRO();
    return gc;
};

//_______________Misc main frame
MiscMainFrame::MiscMainFrame():
 VerticalConfigurationGroup(false,false,false,false)

{
     bool MVAPP;
    #ifdef __MVAPP__
        MVAPP = true ;
    #else
         MVAPP = false ;
    #endif
    bool showLabels;
    hostparm.ThisSystemType = gContext->GetSetting("HostSystemType");
    if  ( hostparm.ThisSystemType == "Standalone" || hostparm.ThisSystemType=="Master_backend")
     {
            showLabels = false;
     }
   else
   {
        showLabels = true;
   }
    TransLabelSetting *temptimezone = new TransLabelSetting();
    temptimezone->setValue("Timezone:  " + hostparm.ThisTimeZone );
    TransLabelSetting *tempzipcode = new TransLabelSetting();
    tempzipcode->setValue("Zipcode: " + hostparm.ThisHostZipcode );
    GridConfigurationGroup* miscsettings_2 =
        new GridConfigurationGroup(1,true, true,false,false);

     if (  showLabels  && ( hostparm.ThisHostZipcode != "" ))
       if (MVAPP)
           miscsettings_2->addChild(tempzipcode);
       else
           miscsettings_2->addChild(HostZipcode());
    else
       miscsettings_2->addChild(HostZipcode());

    TimezoneRegion *timezoneregion = new TimezoneRegion();
    TimezoneButton *timezonebutton = new TimezoneButton();

    VerticalConfigurationGroup* miscsettings =
        new VerticalConfigurationGroup(false, true,false,false);
     if (  showLabels  && ( hostparm.ThisTimeZone != "" ))
       {
        if (MVAPP)
            {
                miscsettings->addChild(temptimezone);
                timezonebutton->disableButton();
            }
        else
            miscsettings->addChild(timezoneregion);
        }
    else
        miscsettings->addChild(timezoneregion);

    miscsettings->addChild(timezonebutton);
    miscsettings->addChild(miscsettings_2);
    addChild(miscsettings);

    connect(timezonebutton, SIGNAL(mf_launch_tzgui()),timezoneregion ,SLOT(timezone_gathersettings()));
    connect(timezoneregion,SIGNAL(mf_show_tz(QString)),this,SLOT(mf_show_tz(QString)));
    connect(this,SIGNAL(update_timezone(QString)),timezoneregion,SLOT(update_timezone_values(QString)));

    autoLaunchTimer = new QTimer(this);
    connect(autoLaunchTimer, SIGNAL(timeout()), timezonebutton, SLOT(launch_tzgui()));
    autoLaunchTimer->start(0);
 }

QString MiscMainFrame::mf_show_tz(QString tz)
{
    QString GTimezone;
    int rc;

    if (autoLaunchTimer->isActive())
    {
      autoLaunchTimer->stop();

      // This was triggered by the timer. Only launch the timezone gui if the timezone is unknown.
      if (!timezone_unknown)
	return NULL;
    }

    cout << "MiscMainFrame::mf_show_tz " << tz << "\n";

    if ((tz == "") || timezone_unknown)
      tz = "guess";

   //launch tzgui and load output into Gtimezone
    int screenheight = 0, screenwidth = 0;
    float wmult = 0, hmult = 0;
    QString m_height , m_width , cmd;
    gContext->GetScreenSettings(screenwidth, wmult, screenheight, hmult);
    m_height.setNum(screenheight);
    m_width.setNum(screenwidth);
    QString tzpath;
    tzpath=MV_ROOT;
    tzpath.append("bin/timezone.bin");
    //cmd="ACCEL=500 " + tzpath + " -z " + tz + " -h " + m_height + " -w " + m_width + " > /tmp/.selected_tz" ;
    cmd=tzpath + " -z " + tz + " -h " + m_height + " -w " + m_width + " > /tmp/.selected_tz" ;
    rc=myth_system(cmd);
    if ( rc == 0 )
    {
        //read in value
        QString line;
        QFile file("/tmp/.selected_tz");
        if ( file.open(IO_ReadOnly | IO_Translate) )
        {
            QTextStream t( &file );        // use a text stream
            while ( !t.eof() )
            {
                line = t.readLine();
                if ( line.contains("/"))
                    {
                        GTimezone = line.simplifyWhiteSpace();
                        break;
                    }
            }
            file.close();
        }
	timezone_unknown = FALSE;
        emit update_timezone(GTimezone);
    }

}


//_______________Misc main frame
MiscMainFrame2::MiscMainFrame2():
 VerticalConfigurationGroup(false,false,false,false)
 {
    VerticalConfigurationGroup* miscsettings =
        new VerticalConfigurationGroup(false, true,false,false);

        GridConfigurationGroup* miscsettings_2 =
         new GridConfigurationGroup(1,false, false,false,false);
         miscsettings_2->addChild(HostShowToolTips());
         miscsettings_2->addChild(Hostupdateplan());

        NFSSettings *nfssettings = new NFSSettings();

        miscsettings->addChild(nfssettings);
        miscsettings->addChild(miscsettings_2);

        addChild(miscsettings);

 }


//_______________Misc time timezone

TimezoneButton::TimezoneButton():
    VerticalConfigurationGroup(false,false,false,false)
    {
      TZButton = new TransButtonSetting;
      TZButton->setLabel("Hitchhikers guide to timezones");
      addChild(TZButton);
      connect(TZButton, SIGNAL(pressed()),this,SLOT(launch_tzgui()));

    };

void TimezoneButton::launch_tzgui()
{
    emit mf_launch_tzgui();
}

void TimezoneButton::disableButton()
{
    TZButton->setEnabled(false);
}



//This is used for the timezone
QStringList findFilesRecursively ( QStringList paths, QString fileTypes ) {
    if ( fileTypes.isEmpty() ) fileTypes = "*";
    QStringList result, more;
    QStringList::Iterator it;
    for ( uint i = 0 ; i < paths.size() ; i++ )
    { // inefficient...whatever
        QDir dir( paths[i] );
        dir.setSorting( QDir::Reversed );
        more = dir.entryList( fileTypes, QDir::Files );
        for ( it = more.begin() ; it != more.end() ; ++it )
            result.append( paths[i] + "/" + *it );
        // reg exp in next line excludes . and .. dirs (and .* actually)
        more = dir.entryList( QDir::Dirs ).grep( QRegExp( "[^.]" ) );
        for ( it = more.begin() ; it != more.end() ; ++it )
            *it = paths[i] + "/" + *it;
        more = findFilesRecursively( more, fileTypes );
        for ( it = more.begin() ; it != more.end() ; ++it )
            result.append( *it );
    }
    return result; // yields absolute paths
}


void TimezoneRegion::timezoneregion_fillselection_zone()
{
    HostTimeZoneRegion->setLabel(QObject::tr("TimeZone"));
    HostTimeZoneRegion->addSelection("US");
    HostTimeZoneRegion->addSelection("Pacific");
    HostTimeZoneRegion->addSelection("Mideast");
    HostTimeZoneRegion->addSelection("Mexico");
    HostTimeZoneRegion->addSelection("Indian");
    HostTimeZoneRegion->addSelection("Europe");
    HostTimeZoneRegion->addSelection("Etc");
    HostTimeZoneRegion->addSelection("Chile");
    HostTimeZoneRegion->addSelection("Canada");
    HostTimeZoneRegion->addSelection("Brazil");
    HostTimeZoneRegion->addSelection("Australia");
    HostTimeZoneRegion->addSelection("Atlantic");
    HostTimeZoneRegion->addSelection("Asia");
    HostTimeZoneRegion->addSelection("Arctic");
    HostTimeZoneRegion->addSelection("Antarctica");
    HostTimeZoneRegion->addSelection("America");
    HostTimeZoneRegion->addSelection("Africa");
    //--single region
    HostTimeZoneRegion->addSelection("Zulu");
    HostTimeZoneRegion->addSelection("WET");
    HostTimeZoneRegion->addSelection("W-SU");
    HostTimeZoneRegion->addSelection("Universal");
    HostTimeZoneRegion->addSelection("UTC");
    HostTimeZoneRegion->addSelection("UCT");
    HostTimeZoneRegion->addSelection("Turkey");
    HostTimeZoneRegion->addSelection("Singapore");
    HostTimeZoneRegion->addSelection("ROK");
    HostTimeZoneRegion->addSelection("ROC");
    HostTimeZoneRegion->addSelection("Portugal");
    HostTimeZoneRegion->addSelection("Poland");
    HostTimeZoneRegion->addSelection("PST8PDT");
    HostTimeZoneRegion->addSelection("PRC");
    HostTimeZoneRegion->addSelection("Navajo");
    HostTimeZoneRegion->addSelection("NZ-CHAT");
    HostTimeZoneRegion->addSelection("NZ");
    HostTimeZoneRegion->addSelection("MST7MDT");
    HostTimeZoneRegion->addSelection("MST");
    HostTimeZoneRegion->addSelection("MET");
    HostTimeZoneRegion->addSelection("Libya");
    HostTimeZoneRegion->addSelection("Kwajalein");
    HostTimeZoneRegion->addSelection("Japan");
    HostTimeZoneRegion->addSelection("Jamaica");
    HostTimeZoneRegion->addSelection("Israel");
    HostTimeZoneRegion->addSelection("Iran");
    HostTimeZoneRegion->addSelection("Iceland");
    HostTimeZoneRegion->addSelection("Hongkong");
    HostTimeZoneRegion->addSelection("HST");
    HostTimeZoneRegion->addSelection("Greenwich");
    HostTimeZoneRegion->addSelection("GMT0");
    HostTimeZoneRegion->addSelection("GMT-0");
    HostTimeZoneRegion->addSelection("GMT+0");
    HostTimeZoneRegion->addSelection("GMT");
    HostTimeZoneRegion->addSelection("GB-Eire");
    HostTimeZoneRegion->addSelection("GB");
    HostTimeZoneRegion->addSelection("Factory");
    HostTimeZoneRegion->addSelection("Eire");
    HostTimeZoneRegion->addSelection("Egypt");
    HostTimeZoneRegion->addSelection("EST5EDT");
    HostTimeZoneRegion->addSelection("EST");
    HostTimeZoneRegion->addSelection("EET");
    HostTimeZoneRegion->addSelection("Cuba");
    HostTimeZoneRegion->addSelection("CST6CDT");
    HostTimeZoneRegion->addSelection("CET");
    HostTimeZoneRegion->setHelpText(QObject::tr("Timezone Region"));
}

void TimezoneRegion::timezoneregion_fillselection(QString tzonefile )
{
    QString currentitem;
    int foundtab;
    int foundslashes;
    QString timezonefile="/usr/share/zoneinfo/posix/";
    timezonefile.append(tzonefile);
    QStringList answer = findFilesRecursively( timezonefile, "*" );
    QStringList onlyfiles = "";
    QStringList::Iterator it;
    for ( it = answer.begin(); it != answer.end(); ++it )
        {
            currentitem = *it;
            foundtab=currentitem.contains(".tab");
            if ( foundtab == 0 )
            {
                foundslashes=currentitem.contains("/");
                currentitem = currentitem.section( '/', 6, foundslashes );

                if ( tzonefile == "US")
                    HostTimezoneRegion_US->addSelection(currentitem);
                else if ( tzonefile == "Pacific")
                    HostTimezoneRegion_Pacific->addSelection(currentitem);
                else if ( tzonefile == "Mideast")
                    HostTimezoneRegion_Mideast->addSelection(currentitem);
                else if ( tzonefile == "Mexico")
                    HostTimezoneRegion_Mexico->addSelection(currentitem);
                else if ( tzonefile == "Indian")
                    HostTimezoneRegion_Indian->addSelection(currentitem);
                else if ( tzonefile == "Europe")
                    HostTimezoneRegion_Europe->addSelection(currentitem);
                else if ( tzonefile == "Etc")
                    HostTimezoneRegion_Etc->addSelection(currentitem);
                else if ( tzonefile == "Chile")
                    HostTimezoneRegion_Chile->addSelection(currentitem);
                else if ( tzonefile == "Canada")
                    HostTimezoneRegion_Canada->addSelection(currentitem);
                else if ( tzonefile == "Brazil")
                    HostTimezoneRegion_Brazil->addSelection(currentitem);
                else if ( tzonefile == "Australia")
                    HostTimezoneRegion_Australia->addSelection(currentitem);
                else if ( tzonefile == "Atlantic")
                    HostTimezoneRegion_Atlantic->addSelection(currentitem);
                else if ( tzonefile == "Asia")
                    HostTimezoneRegion_Asia->addSelection(currentitem);
                else if ( tzonefile == "Arctic")
                    HostTimezoneRegion_Arctic->addSelection(currentitem);
                else if ( tzonefile == "Antarctica")
                    HostTimezoneRegion_Antarctica->addSelection(currentitem);
                else if ( tzonefile == "America")
                    HostTimezoneRegion_America->addSelection(currentitem);
                else if ( tzonefile == "Africa")
                    HostTimezoneRegion_Africa->addSelection(currentitem);
            }
        }
};

void TimezoneRegion::timezone_gathersettings()
{
    QString tz;
    QString subregion;
    QString region=HostTimeZoneRegion->getValue();
    if ( region == "US")
          subregion=HostTimezoneRegion_US->getValue();
    else if ( region == "Pacific")
          subregion=HostTimezoneRegion_Pacific->getValue();
    else if ( region == "Mideast")
          subregion=HostTimezoneRegion_Mideast->getValue();
    else if ( region == "Mexico")
          subregion=HostTimezoneRegion_Mexico->getValue();
    else if ( region == "Indian")
          subregion=HostTimezoneRegion_Indian->getValue();
    else if ( region == "Europe")
          subregion=HostTimezoneRegion_Europe->getValue();
    else if ( region == "Etc")
          subregion=HostTimezoneRegion_Etc->getValue();
    else if ( region == "Chile")
          subregion=HostTimezoneRegion_Chile->getValue();
    else if ( region == "Canada")
          subregion=HostTimezoneRegion_Canada->getValue();
    else if ( region == "Brazil")
          subregion=HostTimezoneRegion_Brazil->getValue();
    else if ( region == "Australia")
          subregion=HostTimezoneRegion_Australia->getValue();
    else if ( region == "Atlantic")
          subregion=HostTimezoneRegion_Atlantic->getValue();
    else if ( region == "Asia")
          subregion=HostTimezoneRegion_Asia->getValue();
    else if ( region == "Arctic")
          subregion=HostTimezoneRegion_Arctic->getValue();
    else if ( region == "Antarctica")
          subregion=HostTimezoneRegion_Antarctica->getValue();
    else if ( region == "America")
          subregion=HostTimezoneRegion_America->getValue();
    else if ( region == "Africa")
          subregion=HostTimezoneRegion_Africa->getValue();

    tz=region+"/"+subregion;

    emit mf_show_tz(tz);
}

TimezoneRegion::TimezoneRegion():
    TriggeredConfigurationGroup(true,false,true,true,true,true,true,true)
{
    SetVertical(false);
    HostTimeZoneRegion= new HostComboBox("HostTimeZoneRegion");
    timezoneregion_fillselection_zone();
    Setting* trigger = HostTimeZoneRegion;
    addChild(trigger);
    setTrigger(trigger);
    //define all the new comboboxes
    HostTimezoneRegion_US = new  HostComboBox("HostTimezoneRegion_US");
    HostTimezoneRegion_Pacific = new HostComboBox("HostTimezoneRegion_Pacific");
    HostTimezoneRegion_Mideast = new HostComboBox("HostTimezoneRegion_Mideast");
    HostTimezoneRegion_Mexico = new  HostComboBox("HostTimezoneRegion_Mexico");
    HostTimezoneRegion_Indian = new HostComboBox("HostTimezoneRegion_Indian");
    HostTimezoneRegion_Europe = new HostComboBox("HostTimezoneRegion_Europe");
    HostTimezoneRegion_Etc = new HostComboBox("HostTimezoneRegion_Etc");
    HostTimezoneRegion_Chile = new HostComboBox("HostTimezoneRegion_Chile");
    HostTimezoneRegion_Canada = new HostComboBox("HostTimezoneRegion_Canada");
    HostTimezoneRegion_Brazil = new HostComboBox("HostTimezoneRegion_Brazil");
    HostTimezoneRegion_Australia = new HostComboBox("HostTimezoneRegion_Australia");
    HostTimezoneRegion_Atlantic = new HostComboBox("HostTimezoneRegion_Atlantic");
    HostTimezoneRegion_Asia = new HostComboBox("HostTimezoneRegion_Asia");
    HostTimezoneRegion_Arctic = new HostComboBox("HostTimezoneRegion_Arctic");
    HostTimezoneRegion_Antarctica = new HostComboBox("HostTimezoneRegion_Antarctica");
    HostTimezoneRegion_America = new HostComboBox("HostTimezoneRegion_America");
    HostTimezoneRegion_Africa = new HostComboBox("HostTimezoneRegion_Africa");
    //fill the new comboboxes
    timezoneregion_fillselection("US");
    timezoneregion_fillselection("Pacific");
    timezoneregion_fillselection("Mideast");
    timezoneregion_fillselection("Mexico");
    timezoneregion_fillselection("Indian");
    timezoneregion_fillselection("Europe");
    timezoneregion_fillselection("Etc");
    timezoneregion_fillselection("Chile");
    timezoneregion_fillselection("Canada");
    timezoneregion_fillselection("Brazil");
    timezoneregion_fillselection("Australia");
    timezoneregion_fillselection("Atlantic");
    timezoneregion_fillselection("Asia");
    timezoneregion_fillselection("Arctic");
    timezoneregion_fillselection("Antarctica");
    timezoneregion_fillselection("America");
    timezoneregion_fillselection("Africa");

    // Add subregions to regions
    addTarget("US",  HostTimezoneRegion_US );
    addTarget("Pacific",   HostTimezoneRegion_Pacific  );
    addTarget("Mideast",    HostTimezoneRegion_Mideast  );
    addTarget("Mexico", HostTimezoneRegion_Mexico  );
    addTarget("Indian", HostTimezoneRegion_Indian   );
    addTarget("Europe",  HostTimezoneRegion_Europe );
    addTarget("Etc",  HostTimezoneRegion_Etc   );
    addTarget("Chile",       HostTimezoneRegion_Chile );
    addTarget("Canada",  HostTimezoneRegion_Canada );
    addTarget("Brazil",  HostTimezoneRegion_Brazil  );
    addTarget("Australia",  HostTimezoneRegion_Australia  );
    addTarget("Atlantic",    HostTimezoneRegion_Atlantic  );
    addTarget("Asia",   HostTimezoneRegion_Asia );
    addTarget("Arctic",    HostTimezoneRegion_Arctic );
    addTarget("Antarctica",     HostTimezoneRegion_Antarctica   );
    addTarget("America", HostTimezoneRegion_America  );
    addTarget("Africa",     HostTimezoneRegion_Africa );
    //--single region
    addTarget("Zulu", new VerticalConfigurationGroup(false, false));
    addTarget("WET", new VerticalConfigurationGroup(false, false));
    addTarget("W-SU", new VerticalConfigurationGroup(false, false));
    addTarget("Universal", new VerticalConfigurationGroup(false, false));
    addTarget("UTC", new VerticalConfigurationGroup(false, false));
    addTarget("UCT", new VerticalConfigurationGroup(false, false));
    addTarget("Turkey", new VerticalConfigurationGroup(false, false));
    addTarget("Singapore", new VerticalConfigurationGroup(false, false));
    addTarget("ROK", new VerticalConfigurationGroup(false, false));
    addTarget("ROC", new VerticalConfigurationGroup(false, false));
    addTarget("Portugal", new VerticalConfigurationGroup(false, false));
    addTarget("Poland", new VerticalConfigurationGroup(false, false));
    addTarget("PST8PDT", new VerticalConfigurationGroup(false, false));
    addTarget("PRC", new VerticalConfigurationGroup(false, false));
    addTarget("Navajo", new VerticalConfigurationGroup(false, false));
    addTarget("NZ-CHAT", new VerticalConfigurationGroup(false, false));
    addTarget("NZ", new VerticalConfigurationGroup(false, false));
    addTarget("MST7MDT", new VerticalConfigurationGroup(false, false));
    addTarget("MST", new VerticalConfigurationGroup(false, false));
    addTarget("MET", new VerticalConfigurationGroup(false, false));
    addTarget("Libya", new VerticalConfigurationGroup(false, false));
    addTarget("Kwajalein", new VerticalConfigurationGroup(false, false));
    addTarget("Japan", new VerticalConfigurationGroup(false, false));
    addTarget("Jamaica", new VerticalConfigurationGroup(false, false));
    addTarget("Israel", new VerticalConfigurationGroup(false, false));
    addTarget("Iran", new VerticalConfigurationGroup(false, false));
    addTarget("Iceland", new VerticalConfigurationGroup(false, false));
    addTarget("Hongkong", new VerticalConfigurationGroup(false, false));
    addTarget("HST", new VerticalConfigurationGroup(false, false));
    addTarget("Greenwich", new VerticalConfigurationGroup(false, false));
    addTarget("GMT0", new VerticalConfigurationGroup(false, false));
    addTarget("GMT-0", new VerticalConfigurationGroup(false, false));
    addTarget("GMT+0", new VerticalConfigurationGroup(false, false));
    addTarget("GMT", new VerticalConfigurationGroup(false, false));
    addTarget("GB-Eire", new VerticalConfigurationGroup(false, false));
    addTarget("GB", new VerticalConfigurationGroup(false, false));
    addTarget("Factory", new VerticalConfigurationGroup(false, false));
    addTarget("Eire", new VerticalConfigurationGroup(false, false));
    addTarget("Egypt", new VerticalConfigurationGroup(false, false));
    addTarget("EST5EDT", new VerticalConfigurationGroup(false, false));
    addTarget("EST", new VerticalConfigurationGroup(false, false));
    addTarget("EET", new VerticalConfigurationGroup(false, false));
    addTarget("Cuba", new VerticalConfigurationGroup(false, false));
    addTarget("CST6CDT", new VerticalConfigurationGroup(false, false));
    addTarget("CET", new VerticalConfigurationGroup(false, false));
};

void TimezoneRegion::update_timezone_values(QString Gtimezone)
{
    QString region;
    QString subregion;
    region=Gtimezone.section('/',0,0);
    subregion=Gtimezone.section('/',1,1);
    HostTimeZoneRegion->setValue(region);

    if ( region == "US")
        HostTimezoneRegion_US->setValue(subregion);
    else if ( region == "Pacific")
        HostTimezoneRegion_Pacific->setValue(subregion);
    else if ( region == "Mideast")
        HostTimezoneRegion_Mideast->setValue(subregion);
    else if ( region == "Mexico")
        HostTimezoneRegion_Mexico->setValue(subregion);
    else if ( region == "Indian")
        HostTimezoneRegion_Indian->setValue(subregion);
    else if ( region == "Europe")
        HostTimezoneRegion_Europe->setValue(subregion);
    else if ( region == "Etc")
        HostTimezoneRegion_Etc->setValue(subregion);
    else if ( region == "Chile")
        HostTimezoneRegion_Chile->setValue(subregion);
    else if ( region == "Canada")
        HostTimezoneRegion_Canada->setValue(subregion);
    else if ( region == "Brazil")
        HostTimezoneRegion_Brazil->setValue(subregion);
    else if ( region == "Australia")
        HostTimezoneRegion_Australia->setValue(subregion);
    else if ( region == "Atlantic")
        HostTimezoneRegion_Atlantic->setValue(subregion);
    else if ( region == "Asia")
        HostTimezoneRegion_Asia->setValue(subregion);
    else if ( region == "Arctic")
        HostTimezoneRegion_Arctic->setValue(subregion);
    else if ( region == "Antarctica")
        HostTimezoneRegion_Antarctica->setValue(subregion);
    else if ( region == "America")
        HostTimezoneRegion_America->setValue(subregion);
    else if ( region == "Africa")
        HostTimezoneRegion_Africa->setValue(subregion);
}


//________________Misc (NFS) Screen SETTINGS_________________________
static HostComboBox *HostHaveCentralNFS()
{
    HostComboBox *gc = new HostComboBox("HostHaveCentralNFS");
    gc->setLabel(QObject::tr("Central NFS server"));
    gc->addSelection("no");
    gc->addSelection("yes") ;
    gc->setHelpText(QObject::tr("Select yes, if your media is stored on an NFS server different than the masterbackend.  Say no if you are confused."));

    return gc;
}

static  HostComboBox *HostCentralNFSIP()
{
    HostComboBox *gc = new HostComboBox("HostCentralNFSIP",true);
    gc->setLabel(QObject::tr("NFS server and sharename "));
    gc->setHelpText(QObject::tr("Format should be  IP:/SHARENAME, for example  192.168.1.6:/media.  file:nfsmap  will load shares from the nfsmap file"));
    gc->addSelection("file:nfsmap") ;
    gc->addSelection("") ;
    return gc;
};

static HostComboBox *HostNFSmountpoint()
{
    #ifdef __MVAPP__
        HostComboBox *gc = new HostComboBox("HostNFSmountpoint");
        gc->addSelection("/data/media");
    #else
        HostComboBox *gc = new HostComboBox("HostNFSmountpoint",true);
        gc->addSelection("/myth");
    #endif
    gc->setLabel(QObject::tr("Local mount point of NFS share"));
    gc->addSelection("/mnt") ;
    gc->setHelpText(QObject::tr(""));
    return gc;
}


NFSSettings::NFSSettings():
    TriggeredConfigurationGroup(false,false,false,true,true,false,false,true)
    {
        setLabel(QObject::tr("Misc Settings"));

        Setting* havenfs = HostHaveCentralNFS();
        addChild(havenfs);
        setTrigger(havenfs);

    ConfigurationGroup* settings = new VerticalConfigurationGroup();
            settings->addChild(HostCentralNFSIP());
            settings->addChild(HostNFSmountpoint());

        addTarget("no", new VerticalConfigurationGroup());
        addTarget("yes", settings);
    };