summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
authorzautrix <zautrix>2005-06-18 09:12:06 (UTC)
committer zautrix <zautrix>2005-06-18 09:12:06 (UTC)
commit39112dfe29d2108d54d37f25dc57dcd9299f1f93 (patch) (unidiff)
treed240d7a346ae56d41a68e77ae83eba119665b86b /korganizer/mainwindow.cpp
parent86e7069527cf45b4ba7889619fb0a8a6dd5867cc (diff)
downloadkdepimpi-39112dfe29d2108d54d37f25dc57dcd9299f1f93.zip
kdepimpi-39112dfe29d2108d54d37f25dc57dcd9299f1f93.tar.gz
kdepimpi-39112dfe29d2108d54d37f25dc57dcd9299f1f93.tar.bz2
icons for todos
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index f945383..0367bea 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -84,101 +84,130 @@ class KOex2phonePrefs : public QDialog
84 QVBoxLayout* lay = new QVBoxLayout( this ); 84 QVBoxLayout* lay = new QVBoxLayout( this );
85 lay->setSpacing( 3 ); 85 lay->setSpacing( 3 );
86 lay->setMargin( 3 ); 86 lay->setMargin( 3 );
87 QLabel *lab; 87 QLabel *lab;
88 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 88 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
89 lab->setAlignment (AlignHCenter ); 89 lab->setAlignment (AlignHCenter );
90 QHBox* temphb; 90 QHBox* temphb;
91 temphb = new QHBox( this ); 91 temphb = new QHBox( this );
92 new QLabel( i18n("I/O device: "), temphb ); 92 new QLabel( i18n("I/O device: "), temphb );
93 mPhoneDevice = new QLineEdit( temphb); 93 mPhoneDevice = new QLineEdit( temphb);
94 lay->addWidget( temphb ); 94 lay->addWidget( temphb );
95 temphb = new QHBox( this ); 95 temphb = new QHBox( this );
96 new QLabel( i18n("Connection: "), temphb ); 96 new QLabel( i18n("Connection: "), temphb );
97 mPhoneConnection = new QLineEdit( temphb); 97 mPhoneConnection = new QLineEdit( temphb);
98 lay->addWidget( temphb ); 98 lay->addWidget( temphb );
99 temphb = new QHBox( this ); 99 temphb = new QHBox( this );
100 new QLabel( i18n("Model(opt.): "), temphb ); 100 new QLabel( i18n("Model(opt.): "), temphb );
101 mPhoneModel = new QLineEdit( temphb); 101 mPhoneModel = new QLineEdit( temphb);
102 lay->addWidget( temphb ); 102 lay->addWidget( temphb );
103 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 103 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
104 mWriteBackFuture->setChecked( true ); 104 mWriteBackFuture->setChecked( true );
105 lay->addWidget( mWriteBackFuture ); 105 lay->addWidget( mWriteBackFuture );
106 temphb = new QHBox( this ); 106 temphb = new QHBox( this );
107 new QLabel( i18n("Max. weeks in future: ") , temphb ); 107 new QLabel( i18n("Max. weeks in future: ") , temphb );
108 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 108 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
109 mWriteBackFutureWeeks->setValue( 8 ); 109 mWriteBackFutureWeeks->setValue( 8 );
110 lay->addWidget( temphb ); 110 lay->addWidget( temphb );
111 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 111 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
112 lab->setAlignment (AlignHCenter ); 112 lab->setAlignment (AlignHCenter );
113 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 113 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
114 lay->addWidget( ok ); 114 lay->addWidget( ok );
115 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 115 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
116 lay->addWidget( cancel ); 116 lay->addWidget( cancel );
117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 117 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 118 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
119 resize( 220, 240 ); 119 resize( 220, 240 );
120 qApp->processEvents(); 120 qApp->processEvents();
121 int dw = QApplication::desktop()->width(); 121 int dw = QApplication::desktop()->width();
122 int dh = QApplication::desktop()->height(); 122 int dh = QApplication::desktop()->height();
123 move( (dw-width())/2, (dh - height() )/2 ); 123 move( (dw-width())/2, (dh - height() )/2 );
124 } 124 }
125 125
126public: 126public:
127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 127 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
128 QCheckBox* mWriteBackFuture; 128 QCheckBox* mWriteBackFuture;
129 QSpinBox* mWriteBackFutureWeeks; 129 QSpinBox* mWriteBackFutureWeeks;
130}; 130};
131 131
132QPixmap* sgListViewCompletedPix[6];
133
134
132int globalFlagBlockStartup; 135int globalFlagBlockStartup;
133MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 136MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
134 QMainWindow( parent, name ) 137 QMainWindow( parent, name )
135{ 138{
136 139 sgListViewCompletedPix[5] = &listviewPix;
140 sgListViewCompletedPix[0] = &listviewPix0;
141 sgListViewCompletedPix[1] = &listviewPix20;
142 sgListViewCompletedPix[2] = &listviewPix40;
143 sgListViewCompletedPix[3] = &listviewPix60;
144 sgListViewCompletedPix[4] = &listviewPix80;
145 if ( sgListViewCompletedPix[5]->height() < 5 ) {
146 int size = 12;
147 sgListViewCompletedPix[5]->resize( 11, 11 );
148 sgListViewCompletedPix[5]->fill( Qt::white );
149 QPainter p ( sgListViewCompletedPix[5] );
150 p.drawRect( 0,0,11,11);
151 int half = size/2;
152 int heihei = size/2;
153 int x = 1;
154 p.drawLine ( 2, 5, 4 , 7 ) ;
155 p.drawLine ( 4 , 7 , 8, 3) ;
156 int iii = 0;
157 for ( iii = 0; iii < 5; ++iii ) {
158 sgListViewCompletedPix[iii]->resize( 11, 11 );
159 sgListViewCompletedPix[iii]->fill( Qt::white );
160 QPainter p ( sgListViewCompletedPix[iii] );
161 p.drawRect( 0,0,11,11);
162 if ( iii )
163 p.fillRect( 1,1,iii*2,9,Qt::gray );
164 }
165 }
137 mClosed = false; 166 mClosed = false;
138 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 167 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
139 QString confFile = locateLocal("config","korganizerrc"); 168 QString confFile = locateLocal("config","korganizerrc");
140 QFileInfo finf ( confFile ); 169 QFileInfo finf ( confFile );
141 bool showWarning = !finf.exists(); 170 bool showWarning = !finf.exists();
142 setIcon(SmallIcon( "ko24" ) ); 171 setIcon(SmallIcon( "ko24" ) );
143 mBlockAtStartup = true; 172 mBlockAtStartup = true;
144 mFlagKeyPressed = false; 173 mFlagKeyPressed = false;
145 setCaption("KO/Pi"); 174 setCaption("KO/Pi");
146 KOPrefs *p = KOPrefs::instance(); 175 KOPrefs *p = KOPrefs::instance();
147 KPimGlobalPrefs::instance()->setGlobalConfig(); 176 KPimGlobalPrefs::instance()->setGlobalConfig();
148 p->mCurrentDisplayedView = 0; 177 p->mCurrentDisplayedView = 0;
149 if ( p->mHourSize > 22 ) 178 if ( p->mHourSize > 22 )
150 p->mHourSize = 22; 179 p->mHourSize = 22;
151 QMainWindow::ToolBarDock tbd; 180 QMainWindow::ToolBarDock tbd;
152 if ( p->mToolBarHor ) { 181 if ( p->mToolBarHor ) {
153 if ( p->mToolBarUp ) 182 if ( p->mToolBarUp )
154 tbd = Bottom; 183 tbd = Bottom;
155 else 184 else
156 tbd = Top; 185 tbd = Top;
157 } 186 }
158 else { 187 else {
159 if ( p->mToolBarUp ) 188 if ( p->mToolBarUp )
160 tbd = Right; 189 tbd = Right;
161 else 190 else
162 tbd = Left; 191 tbd = Left;
163 } 192 }
164 if ( KOPrefs::instance()->mUseAppColors ) 193 if ( KOPrefs::instance()->mUseAppColors )
165 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 194 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
166 globalFlagBlockStartup = 1; 195 globalFlagBlockStartup = 1;
167 iconToolBar = new QPEToolBar( this ); 196 iconToolBar = new QPEToolBar( this );
168 addToolBar (iconToolBar , tbd ); 197 addToolBar (iconToolBar , tbd );
169 198
170#ifdef DESKTOP_VERSION 199#ifdef DESKTOP_VERSION
171 if ( KOPrefs::instance()->mShowIconFilter ) 200 if ( KOPrefs::instance()->mShowIconFilter )
172#else 201#else
173 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 202 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
174#endif 203#endif
175 204
176{ 205{
177 if ( p->mToolBarHorF ) { 206 if ( p->mToolBarHorF ) {
178 if ( p->mToolBarUpF ) 207 if ( p->mToolBarUpF )
179 tbd = Bottom; 208 tbd = Bottom;
180 else 209 else
181 tbd = Top; 210 tbd = Top;
182 } 211 }
183 else { 212 else {
184 if ( p->mToolBarUpF ) 213 if ( p->mToolBarUpF )