summaryrefslogtreecommitdiffabout
path: root/korganizer/navigatorbar.cpp
Unidiff
Diffstat (limited to 'korganizer/navigatorbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index f6a1a6a..59c3e45 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -17,56 +17,59 @@
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qstring.h> 25#include <qstring.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qframe.h> 29#include <q3frame.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qpopupmenu.h> 31#include <q3popupmenu.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <QDesktopWidget>
34//Added by qt3to4:
35#include <Q3HBoxLayout>
33 36
34#include <kdebug.h> 37#include <kdebug.h>
35#include <klocale.h> 38#include <klocale.h>
36#include <kglobal.h> 39#include <kglobal.h>
37#include <kiconloader.h> 40#include <kiconloader.h>
38#include "libkdepim/kdatepicker.h" 41#include "libkdepim/kdatepicker.h"
39#include <knotifyclient.h> 42#include <knotifyclient.h>
40#include "kdatetbl.h" 43#include "kdatetbl.h"
41 44
42#include "koglobals.h" 45#include "koglobals.h"
43#include <kglobalsettings.h> 46#include <kglobalsettings.h>
44#include "koprefs.h" 47#include "koprefs.h"
45#ifndef KORG_NOPLUGINS 48#ifndef KORG_NOPLUGINS
46#include "kocore.h" 49#include "kocore.h"
47#endif 50#endif
48 51
49#include <kcalendarsystem.h> 52#include <kcalendarsystem.h>
50 53
51#include "navigatorbar.h" 54#include "navigatorbar.h"
52 55
53NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name ) 56NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
54 : QWidget( parent, name ) 57 : QWidget( parent, name )
55{ 58{
56 QBoxLayout *topLayout = new QHBoxLayout( this ); 59 Q3BoxLayout *topLayout = new Q3HBoxLayout( this );
57 60
58 // Set up the control buttons and date label 61 // Set up the control buttons and date label
59 mCtrlFrame = new QFrame( this ); 62 mCtrlFrame = new Q3Frame( this );
60 mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised); 63 mCtrlFrame->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
61 mCtrlFrame->setLineWidth(1); 64 mCtrlFrame->setLineWidth(1);
62 65
63 topLayout->addWidget( mCtrlFrame ); 66 topLayout->addWidget( mCtrlFrame );
64 67
65 68
66 69
67 bool isRTL = KOGlobals::self()->reverseLayout(); 70 bool isRTL = KOGlobals::self()->reverseLayout();
68#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
69 bool isDesktop = false; 72 bool isDesktop = false;
70#else 73#else
71 bool isDesktop = true; 74 bool isDesktop = true;
72#endif 75#endif
@@ -120,52 +123,52 @@ NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *nam
120 mPrevWeek->setAutoRepeat( true ); 123 mPrevWeek->setAutoRepeat( true );
121 mNextWeek->setAutoRepeat( true ); 124 mNextWeek->setAutoRepeat( true );
122 mNextYear->setAutoRepeat( true ); 125 mNextYear->setAutoRepeat( true );
123 } else { 126 } else {
124 mPrevWeek->hide(); 127 mPrevWeek->hide();
125 mNextWeek->hide(); 128 mNextWeek->hide();
126 } 129 }
127 130
128 resetFont( font() ); 131 resetFont( font() );
129 132
130 133
131 // set up control frame layout 134 // set up control frame layout
132 QBoxLayout *ctrlLayout = new QHBoxLayout( mCtrlFrame, 1 ); 135 Q3BoxLayout *ctrlLayout = new Q3HBoxLayout( mCtrlFrame, 1 );
133 ctrlLayout->addWidget( mPrevYear, 3 ); 136 ctrlLayout->addWidget( mPrevYear, 3 );
134 ctrlLayout->addWidget( mPrevMonth, 3 ); 137 ctrlLayout->addWidget( mPrevMonth, 3 );
135 ctrlLayout->addWidget( mPrevWeek, 3 ); 138 ctrlLayout->addWidget( mPrevWeek, 3 );
136 //ctrlLayout->addStretch( 1 ); 139 //ctrlLayout->addStretch( 1 );
137 // ctrlLayout->addSpacing( 1 ); 140 // ctrlLayout->addSpacing( 1 );
138 // ctrlLayout->addWidget( mDateLabel ); 141 // ctrlLayout->addWidget( mDateLabel );
139 ctrlLayout->addWidget( mSelectMonth ); 142 ctrlLayout->addWidget( mSelectMonth );
140 // ctrlLayout->addSpacing( 1 ); 143 // ctrlLayout->addSpacing( 1 );
141 // ctrlLayout->addStretch( 1 ); 144 // ctrlLayout->addStretch( 1 );
142 ctrlLayout->addWidget( mNextWeek, 3 ); 145 ctrlLayout->addWidget( mNextWeek, 3 );
143 ctrlLayout->addWidget( mNextMonth, 3 ); 146 ctrlLayout->addWidget( mNextMonth, 3 );
144 ctrlLayout->addWidget( mNextYear, 3 ); 147 ctrlLayout->addWidget( mNextYear, 3 );
145 148
146 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) ); 149 connect( mPrevYear, SIGNAL( clicked() ), SIGNAL( goPrevYear() ) );
147 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) ); 150 connect( mPrevMonth, SIGNAL( clicked() ), SIGNAL( goPrevMonth() ) );
148 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) ); 151 connect( mNextMonth, SIGNAL( clicked() ), SIGNAL( goNextMonth() ) );
149 connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) ); 152 connect( mPrevWeek, SIGNAL( clicked() ), SIGNAL( goPrevWeek() ) );
150 connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) ); 153 connect( mNextWeek, SIGNAL( clicked() ), SIGNAL( goNextWeek() ) );
151 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) ); 154 connect( mNextYear, SIGNAL( clicked() ), SIGNAL( goNextYear() ) );
152 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) ); 155 connect( mSelectMonth, SIGNAL( clicked() ),SLOT( selectMonth() ) );
153 mPrevYear->setFocusPolicy(NoFocus); 156 mPrevYear->setFocusPolicy(Qt::NoFocus);
154 mPrevMonth->setFocusPolicy(NoFocus); 157 mPrevMonth->setFocusPolicy(Qt::NoFocus);
155 mNextMonth->setFocusPolicy(NoFocus); 158 mNextMonth->setFocusPolicy(Qt::NoFocus);
156 mPrevWeek->setFocusPolicy(NoFocus); 159 mPrevWeek->setFocusPolicy(Qt::NoFocus);
157 mNextWeek->setFocusPolicy(NoFocus); 160 mNextWeek->setFocusPolicy(Qt::NoFocus);
158 mNextYear->setFocusPolicy(NoFocus); 161 mNextYear->setFocusPolicy(Qt::NoFocus);
159 mSelectMonth->setFocusPolicy(NoFocus); 162 mSelectMonth->setFocusPolicy(Qt::NoFocus);
160 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) ); 163 setSizePolicy( QSizePolicy ( QSizePolicy::Expanding ,QSizePolicy::Fixed ) );
161 164
162} 165}
163 166
164NavigatorBar::~NavigatorBar() 167NavigatorBar::~NavigatorBar()
165{ 168{
166} 169}
167QSize NavigatorBar::sizeHint() const 170QSize NavigatorBar::sizeHint() const
168{ 171{
169 int wid = mCurrentMinWid ; 172 int wid = mCurrentMinWid ;
170 if ( mPrevYear->isVisible() ) 173 if ( mPrevYear->isVisible() )
171 wid += mCurrentButtonMinWid; 174 wid += mCurrentButtonMinWid;