-rw-r--r-- | core/pim/today/todaybase.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp index b60c915..9331ee3 100644 --- a/core/pim/today/todaybase.cpp +++ b/core/pim/today/todaybase.cpp | |||
@@ -25,115 +25,139 @@ | |||
25 | #include <qvariant.h> | 25 | #include <qvariant.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
27 | #include <qwhatsthis.h> | 27 | #include <qwhatsthis.h> |
28 | #include <qimage.h> | 28 | #include <qimage.h> |
29 | #include <qpixmap.h> | 29 | #include <qpixmap.h> |
30 | //#include <qscrollview.h> | 30 | //#include <qscrollview.h> |
31 | 31 | ||
32 | #include <qpe/resource.h> | 32 | #include <qpe/resource.h> |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * Constructs a TodayBase which is a child of 'parent', with the | 35 | * Constructs a TodayBase which is a child of 'parent', with the |
36 | * name 'name' and widget flags set to 'f' | 36 | * name 'name' and widget flags set to 'f' |
37 | */ | 37 | */ |
38 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) | 38 | TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) |
39 | : QWidget( parent, name, fl ) | 39 | : QWidget( parent, name, fl ) |
40 | { | 40 | { |
41 | // logo | 41 | // logo |
42 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); | 42 | QPixmap logo = Resource::loadPixmap( "today/today_logo"); |
43 | // datebook | 43 | // datebook |
44 | QPixmap datebook = Resource::loadPixmap("DateBook"); | 44 | QPixmap datebook = Resource::loadPixmap("DateBook"); |
45 | // todo | 45 | // todo |
46 | QPixmap todo = Resource::loadPixmap( "TodoList" ); | 46 | QPixmap todo = Resource::loadPixmap( "TodoList" ); |
47 | // config icon | 47 | // config icon |
48 | QPixmap config = Resource::loadPixmap( "today/config" ); | 48 | QPixmap config = Resource::loadPixmap( "today/config" ); |
49 | // mail icon | ||
50 | QPixmap mail = Resource::loadPixmap( "today/mail" ); | ||
49 | 51 | ||
50 | if ( !name ) | 52 | |
51 | setName( "TodayBase" ); | 53 | //if ( !name ) |
52 | resize( 223, 307 ); | 54 | // setName( "TodayBase" ); |
55 | //resize( 223, 307 ); | ||
53 | 56 | ||
54 | QVBoxLayout * layout = new QVBoxLayout(this); | 57 | QVBoxLayout * layout = new QVBoxLayout(this); |
55 | 58 | ||
56 | Frame4 = new QFrame( this, "Frame4" ); | 59 | Frame4 = new QFrame( this, "Frame4" ); |
57 | Frame4->setFrameShape( QScrollView::StyledPanel ); | 60 | Frame4->setFrameShape( QScrollView::StyledPanel ); |
58 | Frame4->setFrameShadow( QScrollView::Sunken ); | 61 | Frame4->setFrameShadow( QScrollView::Sunken ); |
59 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); | 62 | Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); |
60 | 63 | ||
61 | // hehe, qt is ... | 64 | // hehe, qt is ... |
62 | getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); | 65 | getridoffuckingstrippeldlinesbutton = new QPushButton (Frame4, "asdfsad" ); |
63 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); | 66 | getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); |
64 | 67 | ||
65 | DatesButton = new QPushButton (Frame4, "DatesButton" ); | 68 | DatesButton = new QPushButton (Frame4, "DatesButton" ); |
66 | DatesButton->setGeometry( QRect( 2, 10, 36, 32 ) ); | 69 | DatesButton->setGeometry( QRect( 2, 4, 36, 32 ) ); |
67 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 70 | DatesButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
68 | DatesButton->setPixmap( datebook ); | 71 | DatesButton->setPixmap( datebook ); |
69 | DatesButton->setFlat( TRUE ); | 72 | DatesButton->setFlat( TRUE ); |
70 | 73 | ||
71 | DatesField = new QLabel( Frame4, "DatesField" ); | 74 | DatesField = new QLabel( Frame4, "DatesField" ); |
72 | DatesField->setGeometry( QRect( 40, 10, 203, 120 ) ); | 75 | DatesField->setGeometry( QRect( 40, 4, 203, 120 ) ); |
73 | DatesField->setText( tr( "No appointments today" ) ); | 76 | DatesField->setText( tr( "No appointments today" ) ); |
74 | DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | 77 | DatesField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); |
75 | 78 | ||
76 | // today logo | 79 | // today logo |
77 | Frame = new QLabel( this, "Frame" ); | 80 | Frame = new QLabel( this, "Frame" ); |
78 | QPalette pal; | 81 | QPalette pal; |
79 | QColorGroup cg; | 82 | QColorGroup cg; |
80 | cg.setColor( QColorGroup::Text, white ); | 83 | cg.setColor( QColorGroup::Text, white ); |
81 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); | 84 | cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); |
82 | pal.setActive( cg ); | 85 | pal.setActive( cg ); |
83 | 86 | ||
84 | Frame->setPalette( pal ); | 87 | Frame->setPalette( pal ); |
85 | Frame->setFrameShape( QFrame::StyledPanel ); | 88 | Frame->setFrameShape( QFrame::StyledPanel ); |
86 | Frame->setFrameShadow( QFrame::Raised ); | 89 | Frame->setFrameShadow( QFrame::Raised ); |
87 | Frame->setLineWidth( 0 ); | 90 | Frame->setLineWidth( 0 ); |
88 | Frame->setMaximumHeight(50); | 91 | Frame->setMaximumHeight(50); |
89 | Frame->setMinimumHeight(50); | 92 | Frame->setMinimumHeight(50); |
90 | // date | 93 | // date |
91 | TextLabel1 = new QLabel( Frame, "TextLabel1" ); | 94 | TextLabel1 = new QLabel( Frame, "TextLabel1" ); |
92 | TextLabel1->setPalette( pal ); | 95 | TextLabel1->setPalette( pal ); |
93 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); | 96 | TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); |
94 | QFont TextLabel1_font( TextLabel1->font() ); | 97 | QFont TextLabel1_font( TextLabel1->font() ); |
95 | TextLabel1_font.setBold( TRUE ); | 98 | TextLabel1_font.setBold( TRUE ); |
96 | TextLabel1->setFont( TextLabel1_font ); | 99 | TextLabel1->setFont( TextLabel1_font ); |
97 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); | 100 | TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); |
98 | TextLabel1->setTextFormat( QLabel::AutoText ); | 101 | TextLabel1->setTextFormat( QLabel::AutoText ); |
99 | 102 | ||
100 | // todo | 103 | // todo |
101 | Frame15 = new QFrame( this, "Frame15" ); | 104 | Frame15 = new QFrame( this, "Frame15" ); |
102 | Frame15->setFrameShape( QFrame::StyledPanel ); | 105 | Frame15->setFrameShape( QFrame::StyledPanel ); |
103 | Frame15->setFrameShadow( QFrame::Sunken ); | 106 | Frame15->setFrameShadow( QFrame::Sunken ); |
104 | 107 | ||
105 | TodoButton = new QPushButton (Frame15, "TodoButton" ); | 108 | TodoButton = new QPushButton (Frame15, "TodoButton" ); |
106 | TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); | 109 | TodoButton->setGeometry( QRect( 2, 4, 36, 32 ) ); |
107 | TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 110 | TodoButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
108 | TodoButton->setPixmap( todo ); | 111 | TodoButton->setPixmap( todo ); |
109 | TodoButton->setFlat( TRUE ); | 112 | TodoButton->setFlat( TRUE ); |
110 | 113 | ||
111 | TodoField = new QLabel( Frame15, "TodoField" ); | 114 | TodoField = new QLabel( Frame15, "TodoField" ); |
112 | TodoField->setGeometry( QRect( 40, 10, 196, 120 ) ); | 115 | TodoField->setGeometry( QRect( 40, 4, 196, 120 ) ); |
113 | TodoField->setFrameShadow( QLabel::Plain ); | 116 | TodoField->setFrameShadow( QLabel::Plain ); |
114 | TodoField->setText( tr( "No current todos" ) ); | 117 | TodoField->setText( tr( "No current todos" ) ); |
115 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | 118 | TodoField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); |
116 | 119 | ||
117 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); | 120 | PushButton1 = new QPushButton (Frame15, "PushButton1" ); |
118 | PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); | 121 | PushButton1->setGeometry( QRect( 216, 68, 25, 21 ) ); |
119 | PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); | 122 | PushButton1->setBackgroundOrigin( QPushButton::WidgetOrigin ); |
120 | PushButton1->setPixmap( config ); | 123 | PushButton1->setPixmap( config ); |
121 | PushButton1->setAutoDefault( TRUE ); | 124 | PushButton1->setAutoDefault( TRUE ); |
122 | PushButton1->setFlat( TRUE ); | 125 | PushButton1->setFlat( TRUE ); |
123 | 126 | ||
127 | |||
128 | MailFrame = new QFrame( this, "MailFrame" ); | ||
129 | MailFrame->setFrameShape( QScrollView::StyledPanel ); | ||
130 | MailFrame->setFrameShadow( QScrollView::Sunken ); | ||
131 | MailFrame->setBackgroundOrigin( QScrollView::ParentOrigin ); | ||
132 | |||
133 | MailButton = new QPushButton (MailFrame, "MailButton" ); | ||
134 | MailButton->setGeometry( QRect( 2, 10, 36, 19 ) ); | ||
135 | MailButton->setBackgroundOrigin( QPushButton::WidgetOrigin ); | ||
136 | MailButton->setPixmap( mail ); | ||
137 | MailButton->setFlat( TRUE ); | ||
138 | |||
139 | MailField = new QLabel( MailFrame, "DatesField" ); | ||
140 | MailField->setGeometry( QRect( 40, 10, 203, 120 ) ); | ||
141 | MailField->setText( tr( "Opiemail not installed" ) ); | ||
142 | MailField->setAlignment( int( QLabel::AlignTop | QLabel::AlignLeft ) ); | ||
143 | MailField->setMaximumHeight(15); | ||
144 | MailField->setMinimumHeight(10); | ||
145 | |||
124 | layout->addWidget(Frame); | 146 | layout->addWidget(Frame); |
125 | layout->addWidget(Frame4); | 147 | layout->addWidget(Frame4); |
148 | layout->addWidget(MailFrame); | ||
126 | layout->addWidget(Frame15); | 149 | layout->addWidget(Frame15); |
127 | 150 | ||
128 | layout->setStretchFactor(Frame4,3); | 151 | layout->setStretchFactor(Frame4,4); |
129 | layout->setStretchFactor(Frame15,2); | 152 | layout->setStretchFactor(MailFrame,1); |
153 | layout->setStretchFactor(Frame15,3); | ||
130 | } | 154 | } |
131 | 155 | ||
132 | /* | 156 | /* |
133 | * Destroys the object and frees any allocated resources | 157 | * Destroys the object and frees any allocated resources |
134 | */ | 158 | */ |
135 | TodayBase::~TodayBase() | 159 | TodayBase::~TodayBase() |
136 | { | 160 | { |
137 | // no need to delete child widgets, Qt does it all for us | 161 | // no need to delete child widgets, Qt does it all for us |
138 | } | 162 | } |
139 | 163 | ||