comparison src/main.cpp @ 122:f0db8267911b

Add comments.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Jul 2017 12:04:52 +0300
parents 404d567edaab
children e76d85ea87ac
comparison
equal deleted inserted replaced
121:404d567edaab 122:f0db8267911b
262 ui->setupUi(this); 262 ui->setupUi(this);
263 263
264 // Read config 264 // Read config
265 readSettings(); 265 readSettings();
266 266
267 // Setup other UI things 267 // Setup application icon and window title
268 setWindowIcon(QIcon(QPixmap(":/img/icon-64.png"))); 268 setWindowIcon(QIcon(QPixmap(":/img/icon-64.png")));
269 setWindowTitle(tr("%1 versio %3"). 269 setWindowTitle(tr("%1 versio %3").
270 arg(tr(APP_NAME)). 270 arg(tr(APP_NAME)).
271 arg(tr(APP_VERSION))); 271 arg(tr(APP_VERSION)));
272 272
273 // Setup large logo in the main window
273 QPixmap logoImage(":/img/logo.png"); 274 QPixmap logoImage(":/img/logo.png");
274 ui->button_LogoImage->setPixmap(logoImage); 275 ui->button_LogoImage->setPixmap(logoImage);
275 ui->button_LogoImage->setAlignment(Qt::AlignCenter); 276 ui->button_LogoImage->setAlignment(Qt::AlignCenter);
276 277
277 setCommonStyleSheet(this); 278 setCommonStyleSheet(this);
366 { 367 {
367 ui->statusbar->showMessage(msg); 368 ui->statusbar->showMessage(msg);
368 } 369 }
369 370
370 371
372 //
373 // Restoring and saving of current settings
374 //
371 void SyntilistaMainWindow::readSettings() 375 void SyntilistaMainWindow::readSettings()
372 { 376 {
373 QSettings settings(APP_VENDOR, APP_ID); 377 QSettings settings(APP_VENDOR, APP_ID);
374 378
375 // Restore window size and position 379 // Restore window size and position
432 else 436 else
433 setActivePerson(-1); 437 setActivePerson(-1);
434 } 438 }
435 439
436 440
441 //
442 // Set currently active person to given SQL id
443 //
437 void SyntilistaMainWindow::setActivePerson(qint64 id) 444 void SyntilistaMainWindow::setActivePerson(qint64 id)
438 { 445 {
439 currPerson.id = id; 446 currPerson.id = id;
440 447
441 ui->button_EditPerson->setEnabled(id >= 0); 448 ui->button_EditPerson->setEnabled(id >= 0);