Changeset 0bb39f5 for src/gui


Ignore:
Timestamp:
01/27/10 16:31:10 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
a790a90
Parents:
07ae23a
Message:

removed appsettings

  • created 'active' column in 'conference' table
Location:
src/gui
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/gui/alarmdialog.cpp

    r07ae23a r0bb39f5  
    11#include "alarmdialog.h"
    2 #include <appsettings.h>
     2#include <conference.h>
    33
    44#include <QApplication>
     
    4747    try
    4848    {
    49         Event event = Event::getById(mEventId,AppSettings::confId());
     49        Event event = Event::getById(mEventId,Conference::activeConference());
    5050        titleStr = "Event alarm";
    5151        messageStr = event.title();
     
    8989    try
    9090    {
    91         Event event = Event::getById(mEventId,AppSettings::confId());
     91        Event event = Event::getById(mEventId,Conference::activeConference());
    9292        event.setHasAlarm(false);
    9393        event.update("alarm");
  • src/gui/eventdialog.cpp

    r07ae23a r0bb39f5  
    11#include "eventdialog.h"
    2 #include <appsettings.h>
     2#include <conference.h>
    33
    44#include <QScrollBar>
     
    1818#endif
    1919
    20     Event event = Event::getById(mEventId,AppSettings::confId());
     20    Event event = Event::getById(mEventId,Conference::activeConference());
    2121
    2222    title->setText(event.title());
     
    4242void EventDialog::favouriteClicked()
    4343{
    44     Event event = Event::getById(mEventId,AppSettings::confId());
     44    Event event = Event::getById(mEventId,Conference::activeConference());
    4545
    4646    if(event.isFavourite())
     
    6565void EventDialog::alarmClicked()
    6666{
    67     Event event = Event::getById(mEventId,AppSettings::confId());
     67    Event event = Event::getById(mEventId,Conference::activeConference());
    6868
    6969    if(event.hasAlarm())
  • src/gui/favtabcontainer.cpp

    r07ae23a r0bb39f5  
    1 /*
    2  * favtabcontainer.cpp
    3  *
    4  *  Created on: Jan 27, 2010
    5  *      Author: maemo
    6  */
    71
    82#include "favtabcontainer.h"
     
    2216    // we need to reload favourites, because some favourite could be deleted
    2317    //static_cast<EventModel*>(favTreeView->model())->updateModel(aEventId);
    24     QDate aStartDate = Conference::getById(AppSettings::confId()).start();
    25     QDate aEndDate = Conference::getById(AppSettings::confId()).end();
    26     dayNavigator->setDates(aStartDate, aEndDate);
    27     updateTreeView( Conference::getById(AppSettings::confId()).start() );
     18    int confId = Conference::activeConference();
     19    QDate startDate = Conference::getById(confId).start();
     20    QDate endDate = Conference::getById(confId).end();
     21    dayNavigator->setDates(startDate, endDate);
     22    updateTreeView( Conference::getById(confId).start() );
    2823}
     24
  • src/gui/mainwindow.cpp

    r07ae23a r0bb39f5  
    11#include "mainwindow.h"
    2 #include <appsettings.h>
    32
    43#include <QTreeView>
     
    2827    setupUi(this);
    2928
    30     // Sanity check for existence of any Conference in the DB
    31     // it AppSettings::confId() is 0, but there are any Conference(s) in the DB
    32     // set the confId in the AppSettings for the ID of the first conference in the DB
     29    int confId = Conference::activeConference();
     30
    3331    QList<Conference> confs = Conference::getAll();
    34     if(!confs.count()) // no conference(s) in the DB
     32    if(confs.count())
    3533    {
    36         AppSettings::setConfId(0); // no conference in the DB
    37     }
    38     else
    39     {
    40         if(AppSettings::confId() == 0)
    41             AppSettings::setConfId(confs[0].id());
    42 
    4334        setWindowTitle(confs[0].title());
    4435    }
     
    6253    if(Conference::getAll().count()) // no conference(s) in the DB
    6354    {
    64         QDate startDate = Conference::getById(AppSettings::confId()).start();
    65         QDate endDate = Conference::getById(AppSettings::confId()).end();
     55        QDate startDate = Conference::getById(confId).start();
     56        QDate endDate = Conference::getById(confId).end();
    6657        //
    6758        dayTabContainer->setDates(startDate, endDate);
     
    7162        searchTabContainer->setDates(startDate, endDate);
    7263        //
    73         conferenceTitle->setText(Conference::getById(AppSettings::confId()).title());
    74         conferenceSubtitle->setText(Conference::getById(AppSettings::confId()).subtitle());
    75         conferenceWhere->setText(Conference::getById(AppSettings::confId()).city() + ", " + Conference::getById(AppSettings::confId()).venue());
     64        conferenceTitle->setText(Conference::getById(confId).title());
     65        conferenceSubtitle->setText(Conference::getById(confId).subtitle());
     66        conferenceWhere->setText(Conference::getById(confId).city() + ", " + Conference::getById(confId).venue());
    7667        conferenceWhen->setText(
    77                 Conference::getById(AppSettings::confId()).start().toString("dd-MM-yyyy")
     68                Conference::getById(confId).start().toString("dd-MM-yyyy")
    7869                + ", " +
    79                 Conference::getById(AppSettings::confId()).end().toString("dd-MM-yyyy"));
     70                Conference::getById(confId).end().toString("dd-MM-yyyy"));
    8071    }
    8172
     
    9990
    10091    QList<Conference> confs = Conference::getAll();
    101     if(!confs.count()) // no conference(s) in the DB
     92    if(confs.count())
    10293    {
    103         AppSettings::setConfId(0); // no conference in the DB
    104     }
    105     else
    106     {
    107         if(AppSettings::confId() == 0)
    108             AppSettings::setConfId(confs[0].id());
    109 
    11094        // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
    111         QDate startDate = Conference::getById(AppSettings::confId()).start();
    112         QDate endDate = Conference::getById(AppSettings::confId()).end();
     95        QDate startDate = Conference::getById(Conference::activeConference()).start();
     96        QDate endDate = Conference::getById(Conference::activeConference()).end();
    11397        dayTabContainer->setDates(startDate, endDate);
    11498        tracksTabContainer->setDates(startDate, endDate);
  • src/gui/searchtabcontainer.cpp

    r07ae23a r0bb39f5  
    1 
    2 #include <appsettings.h>
    31
    42#include "searchtabcontainer.h"
     
    6563    QString keyword = searchHeader->searchEdit->text().replace( QString("%"), QString("\\%") );
    6664    qDebug() << "\nKeyword to search: " << keyword;
    67     SqlEngine::searchEvent( AppSettings::confId(), columns, keyword );
    6865
    69     QDate startDate = Conference::getById(AppSettings::confId()).start();
    70     QDate endDate = Conference::getById(AppSettings::confId()).end();
     66    int confId = Conference::activeConference();
     67    SqlEngine::searchEvent( confId, columns, keyword );
     68
     69    QDate startDate = Conference::getById(confId).start();
     70    QDate endDate = Conference::getById(confId).end();
    7171    dayNavigator->setDates(startDate, endDate);
    72     updateTreeView( Conference::getById(AppSettings::confId()).start() );
     72    updateTreeView( Conference::getById(confId).start() );
    7373}
    7474
  • src/gui/tabcontainer.cpp

    r07ae23a r0bb39f5  
    3636    else
    3737    {
    38         QDate aStartDate = Conference::getById(AppSettings::confId()).start();
    39         QDate aEndDate = Conference::getById(AppSettings::confId()).end();
     38        QDate aStartDate = Conference::getById(Conference::activeConference()).start();
     39        QDate aEndDate = Conference::getById(Conference::activeConference()).end();
    4040        dayNavigator->setDates(aStartDate, aEndDate);
    4141    }
     
    4545{
    4646    dayNavigator->show();
    47     loadEvents( aDate, AppSettings::confId() );
     47    loadEvents( aDate, Conference::activeConference() );
    4848    treeView->reset();
    4949}
     
    102102}
    103103
    104 
    105 
  • src/gui/tabcontainer.h

    r07ae23a r0bb39f5  
    55#include "ui_tabcontainer.h"
    66
    7 #include <appsettings.h>
     7#include <conference.h>
    88#include <sqlengine.h>
    99#include <conference.h>
Note: See TracChangeset for help on using the changeset viewer.