[go: up one dir, main page]

File: topreferencesui.cpp

package info (click to toggle)
tora 1.3.21-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 14,252 kB
  • ctags: 10,397
  • sloc: cpp: 108,822; sh: 10,861; makefile: 766; xml: 69; perl: 6
file content (119 lines) | stat: -rw-r--r-- 4,140 bytes parent folder | download
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
/****************************************************************************
** Form implementation generated from reading ui file 'topreferencesui.ui'
**
** Created: Mon Feb 20 12:46:39 2006
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "topreferencesui.h"

#include <qvariant.h>
#include <qlistbox.h>
#include <qframe.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a toPreferencesUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
toPreferencesUI::toPreferencesUI( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "toPreferencesUI" );
    toPreferencesUILayout = new QGridLayout( this, 1, 1, 11, 6, "toPreferencesUILayout"); 

    TabSelection = new QListBox( this, "TabSelection" );
    TabSelection->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)7, 0, 0, TabSelection->sizePolicy().hasHeightForWidth() ) );

    toPreferencesUILayout->addWidget( TabSelection, 0, 0 );

    Parent = new QFrame( this, "Parent" );
    Parent->setFrameShape( QFrame::NoFrame );
    Parent->setFrameShadow( QFrame::Raised );

    toPreferencesUILayout->addWidget( Parent, 0, 1 );

    layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); 

    HelpButton = new QPushButton( this, "HelpButton" );
    HelpButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)0, 0, 0, HelpButton->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( HelpButton );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Preferred, QSizePolicy::Minimum );
    layout1->addItem( Spacer1 );

    PushButton2_2 = new QPushButton( this, "PushButton2_2" );
    layout1->addWidget( PushButton2_2 );

    PushButton1 = new QPushButton( this, "PushButton1" );
    PushButton1->setDefault( TRUE );
    layout1->addWidget( PushButton1 );

    PushButton2 = new QPushButton( this, "PushButton2" );
    layout1->addWidget( PushButton2 );

    toPreferencesUILayout->addMultiCellLayout( layout1, 1, 1, 0, 1 );
    languageChange();
    resize( QSize(588, 480).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( PushButton2, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( TabSelection, SIGNAL( selectionChanged(QListBoxItem*) ), this, SLOT( selectTab(QListBoxItem*) ) );
    connect( HelpButton, SIGNAL( clicked() ), this, SLOT( help() ) );
    connect( PushButton2_2, SIGNAL( clicked() ), this, SLOT( saveSetting() ) );

    // tab order
    setTabOrder( TabSelection, HelpButton );
    setTabOrder( HelpButton, PushButton2_2 );
    setTabOrder( PushButton2_2, PushButton1 );
    setTabOrder( PushButton1, PushButton2 );
}

/*
 *  Destroys the object and frees any allocated resources
 */
toPreferencesUI::~toPreferencesUI()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toPreferencesUI::languageChange()
{
    setCaption( tr( "Preferences" ) );
    HelpButton->setText( tr( "&Help" ) );
    HelpButton->setAccel( QKeySequence( tr( "Alt+H" ) ) );
    PushButton2_2->setText( tr( "Apply" ) );
    PushButton1->setText( tr( "&Ok" ) );
    PushButton1->setAccel( QKeySequence( tr( "Alt+O" ) ) );
    PushButton2->setText( tr( "Cancel" ) );
}

void toPreferencesUI::help()
{
    qWarning( "toPreferencesUI::help(): Not implemented yet" );
}

void toPreferencesUI::selectTab(QListBoxItem*)
{
    qWarning( "toPreferencesUI::selectTab(QListBoxItem*): Not implemented yet" );
}

void toPreferencesUI::saveSetting()
{
    qWarning( "toPreferencesUI::saveSetting(): Not implemented yet" );
}