summaryrefslogtreecommitdiffstats
path: root/src/k9prefpreview.cpp
blob: 1989528bf419cd0e9ed87ca4dc9c728fe82e8f8f (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
//
// C++ Implementation: 
//
// Description: 
//
//
// Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//


#include "k9prefpreview.h"
#include "k9config.h"
#include <tqwidgetstack.h>
#include <tqradiobutton.h>
#include <tqcombobox.h>
#include <tqcheckbox.h>
#include <tdelocale.h>

k9prefPreview::k9prefPreview(TQWidget* parent, const char* name, WFlags fl)
: prefPreview(parent,name,fl)
{ load();
}

k9prefPreview::~k9prefPreview()
{
}

/*$SPECIALIZATION$*/

void k9prefPreview::load() {
    k9Config config;

    ckUseGL->setChecked(config.getUseGL());
    cbVout->setCurrentItem(config.getMplayerVout());
    cbAout->setCurrentItem(config.getMplayerAout());
    rbMplayer->setChecked(config.getUseMplayer());
    rbInternal->setChecked(!config.getUseMplayer());
    
    if (rbMplayer->isChecked()) 
	rbMplayerClick();
    else
	rbInternalClick();

}



void k9prefPreview::save() {
    k9Config config;

    if (rbMplayer->isChecked()) {
        config.setMplayerVout( cbVout->currentItem());
        config.setMplayerAout( cbAout->currentItem());	
    }else {
    	config.setUseGL( ckUseGL->isChecked());
    }
    config.setUseMplayer( rbMplayer->isChecked());
    config.save();
}


void k9prefPreview::rbInternalClick() {
  wsOptions->raiseWidget(0);
}

void k9prefPreview::rbMplayerClick() {
  wsOptions->raiseWidget(1);
}



#include "k9prefpreview.moc"