summaryrefslogtreecommitdiff
path: root/core/pim/datebook2
Unidiff
Diffstat (limited to 'core/pim/datebook2') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook2/mainwindow.cpp4
-rw-r--r--core/pim/datebook2/mainwindow.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/core/pim/datebook2/mainwindow.cpp b/core/pim/datebook2/mainwindow.cpp
index 7d436ae..be30415 100644
--- a/core/pim/datebook2/mainwindow.cpp
+++ b/core/pim/datebook2/mainwindow.cpp
@@ -1,36 +1,36 @@
1 1
2#include <qcopchannel_qws.h> 2#include <qcopchannel_qws.h>
3#include <qwidgetstack.h> 3#include <qwidgetstack.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qaction.h> 5#include <qaction.h>
6#include <qpopupmenu.h> 6#include <qpopupmenu.h>
7#include <qtimer.h> 7#include <qtimer.h>
8 8
9#include <qpe/qpeapplication.h> 9#include <qpe/qpeapplication.h>
10#include <qpe/ir.h> 10#include <qpe/ir.h>
11#include <qmenubar.h> 11#include <qmenubar.h>
12#include <qpe/qpetoolbar.h> 12#include <qtoolbar.h>
13#include <qpe/qpemessagebox.h> 13#include <qpe/qpemessagebox.h>
14#include <qpe/resource.h> 14#include <qpe/resource.h>
15 15
16#include "editor.h" 16#include "editor.h"
17#include "show.h" 17#include "show.h"
18#include "templatemanager.h" 18#include "templatemanager.h"
19#include "bookmanager.h" 19#include "bookmanager.h"
20#include "mainwindow.h" 20#include "mainwindow.h"
21 21
22 22
23using namespace Datebook; 23using namespace Datebook;
24 24
25MainWindow::MainWindow() 25MainWindow::MainWindow()
26 : OPimMainWindow( "Datebook", 0, 0 ), m_descMan( "Descriptions" ), m_locMan( "Locations" ) 26 : OPimMainWindow( "Datebook", 0, 0 ), m_descMan( "Descriptions" ), m_locMan( "Locations" )
27{ 27{
28 setIcon( Resource::loadPixmap( "datebook_icon" ) ); 28 setIcon( Resource::loadPixmap( "datebook_icon" ) );
29 initUI(); 29 initUI();
30 initManagers(); 30 initManagers();
31 initView(); 31 initView();
32 initConfig(); 32 initConfig();
33 33
34 QTimer::singleShot(0, this, SLOT(populate() ) ); 34 QTimer::singleShot(0, this, SLOT(populate() ) );
35 35
36 QCopChannel* chan = new QCopChannel( "QPE/System", this ); 36 QCopChannel* chan = new QCopChannel( "QPE/System", this );
@@ -69,49 +69,49 @@ void MainWindow::beam( int uid ) {
69 69
70} 70}
71void MainWindow::show( int uid ) { 71void MainWindow::show( int uid ) {
72 72
73 eventShow()->show( manager()->event( uid ) ); 73 eventShow()->show( manager()->event( uid ) );
74} 74}
75void MainWindow::add( const OPimRecord& ad) { 75void MainWindow::add( const OPimRecord& ad) {
76 manager()->add( ad ); 76 manager()->add( ad );
77} 77}
78void MainWindow::edit() { 78void MainWindow::edit() {
79 edit ( currentView()->currentItem() ); 79 edit ( currentView()->currentItem() );
80} 80}
81void MainWindow::edit( int uid ) { 81void MainWindow::edit( int uid ) {
82 82
83} 83}
84/* 84/*
85 * init tool bars layout and so on 85 * init tool bars layout and so on
86 */ 86 */
87void MainWindow::initUI() { 87void MainWindow::initUI() {
88 setToolBarsMovable( false ); 88 setToolBarsMovable( false );
89 89
90 m_stack = new QWidgetStack( this ); 90 m_stack = new QWidgetStack( this );
91 setCentralWidget( m_stack ); 91 setCentralWidget( m_stack );
92 92
93 m_toolBar = new QPEToolBar( this ); 93 m_toolBar = new QToolBar( this );
94 m_toolBar->setHorizontalStretchable( TRUE ); 94 m_toolBar->setHorizontalStretchable( TRUE );
95 95
96 QMenuBar* mb = new QMenuBar( m_toolBar ); 96 QMenuBar* mb = new QMenuBar( m_toolBar );
97 97
98 m_popView = new QPopupMenu( this ); 98 m_popView = new QPopupMenu( this );
99 m_popSetting = new QPopupMenu( this ); 99 m_popSetting = new QPopupMenu( this );
100 100
101 mb->insertItem( tr("View"), m_popView ); 101 mb->insertItem( tr("View"), m_popView );
102 mb->insertItem( tr("Settings" ), m_popSetting ); 102 mb->insertItem( tr("Settings" ), m_popSetting );
103 103
104 m_popTemplate = new QPopupMenu( this ); 104 m_popTemplate = new QPopupMenu( this );
105 m_popTemplate->setCheckable( TRUE ); 105 m_popTemplate->setCheckable( TRUE );
106 connect( m_popTemplate, SIGNAL(activated(int) ), 106 connect( m_popTemplate, SIGNAL(activated(int) ),
107 this, SLOT(slotNewFromTemplate(int) ) ); 107 this, SLOT(slotNewFromTemplate(int) ) );
108 m_popView->insertItem(tr("New from template"), m_popTemplate, -1, 0); 108 m_popView->insertItem(tr("New from template"), m_popTemplate, -1, 0);
109 109
110 110
111 QAction* a = new QAction( tr("New Event"), Resource::loadPixmap("new"), 111 QAction* a = new QAction( tr("New Event"), Resource::loadPixmap("new"),
112 QString::null, 0, this, 0 ); 112 QString::null, 0, this, 0 );
113 a->addTo( m_toolBar ); 113 a->addTo( m_toolBar );
114 a->addTo( m_popView ); 114 a->addTo( m_popView );
115 connect(a, SIGNAL( activated() ), this, SLOT( create() ) ); 115 connect(a, SIGNAL( activated() ), this, SLOT( create() ) );
116 116
117 a = new QAction( tr("Edit Event"), Resource::loadPixmap("edit"), 117 a = new QAction( tr("Edit Event"), Resource::loadPixmap("edit"),
diff --git a/core/pim/datebook2/mainwindow.h b/core/pim/datebook2/mainwindow.h
index 3c22637..33ef864 100644
--- a/core/pim/datebook2/mainwindow.h
+++ b/core/pim/datebook2/mainwindow.h
@@ -1,107 +1,107 @@
1#ifndef DATE_BOOK_MAIN_WINDOW_H 1#ifndef DATE_BOOK_MAIN_WINDOW_H
2#define DATE_BOOK_MAIN_WINDOW_H 2#define DATE_BOOK_MAIN_WINDOW_H
3 3
4#include <qlist.h> 4#include <qlist.h>
5 5
6#include <opie/opimmainwindow.h> 6#include <opie/opimmainwindow.h>
7 7
8#include "descriptionmanager.h" 8#include "descriptionmanager.h"
9#include "locationmanager.h" 9#include "locationmanager.h"
10#include "templatemanager.h" 10#include "templatemanager.h"
11#include "view.h" 11#include "view.h"
12 12
13class QAction; 13class QAction;
14class QWidgetStack; 14class QWidgetStack;
15class QPopupMenu; 15class QPopupMenu;
16class QPEToolBar; 16class QToolBar;
17namespace Datebook { 17namespace Datebook {
18 class BookManager; 18 class BookManager;
19 class Show; 19 class Show;
20 class Editor; 20 class Editor;
21 class MainWindow : public OPimMainWindow { 21 class MainWindow : public OPimMainWindow {
22 Q_OBJECT 22 Q_OBJECT
23 friend class Show; // to avoid QObject 23 friend class Show; // to avoid QObject
24 friend class View; // to avoid QObject 24 friend class View; // to avoid QObject
25 friend class Editor; 25 friend class Editor;
26 public: 26 public:
27 MainWindow(); 27 MainWindow();
28 ~MainWindow(); 28 ~MainWindow();
29 29
30 private slots: 30 private slots:
31 void initUI(); // init the UI 31 void initUI(); // init the UI
32 void initConfig(); // apply the config 32 void initConfig(); // apply the config
33 void initView(); // init the Views.. 33 void initView(); // init the Views..
34 void initManagers(); // init the Managers including templates, location and description 34 void initManagers(); // init the Managers including templates, location and description
35 void raiseCurrentView(); // raise the current View 35 void raiseCurrentView(); // raise the current View
36 void slotGoToNow(); // will switch the currentView to the curren date time 36 void slotGoToNow(); // will switch the currentView to the curren date time
37 void slotFind(); // find!!! 37 void slotFind(); // find!!!
38 void slotConfigure(); // configure the app 38 void slotConfigure(); // configure the app
39 void slotClockChanged(bool); // clock changed 39 void slotClockChanged(bool); // clock changed
40 void slotWeekChanged( bool ); // week changed 40 void slotWeekChanged( bool ); // week changed
41 void slotAppMessage( const QCString&, const QByteArray& ); // qApp message QPE/Application/datebook 41 void slotAppMessage( const QCString&, const QByteArray& ); // qApp message QPE/Application/datebook
42 void slotReceive( const QCString&, const QByteArray& ); // QPE/System and QPE/Datebook 42 void slotReceive( const QCString&, const QByteArray& ); // QPE/System and QPE/Datebook
43 void slotAction( QAction* ); // View changed 43 void slotAction( QAction* ); // View changed
44 void slotConfigureLocs(); // Configure the Locations 44 void slotConfigureLocs(); // Configure the Locations
45 void slotConfigureDesc(); // Configure the Desc 45 void slotConfigureDesc(); // Configure the Desc
46 void slotConfigureTemp(); 46 void slotConfigureTemp();
47 void slotNewFromTemplate(int ); // called when someone chooses the template menu 47 void slotNewFromTemplate(int ); // called when someone chooses the template menu
48 48
49 void setTemplateMenu(); // updates the templateMenu 49 void setTemplateMenu(); // updates the templateMenu
50 50
51 protected slots: 51 protected slots:
52 void populate(); 52 void populate();
53 void doSetDocument( const QString& str ); 53 void doSetDocument( const QString& str );
54 void flush(); 54 void flush();
55 void reload(); 55 void reload();
56 int create(); 56 int create();
57 bool remove( int uid ); 57 bool remove( int uid );
58 void beam( int uid ); 58 void beam( int uid );
59 void show( int uid ); 59 void show( int uid );
60 void edit( int uid ); 60 void edit( int uid );
61 void edit(); 61 void edit();
62 void add( const OPimRecord& ); 62 void add( const OPimRecord& );
63 63
64 private: 64 private:
65 QPEToolBar* toolbar(); 65 QToolBar* toolbar();
66 QPopupMenu* viewMenu(); 66 QPopupMenu* viewMenu();
67 QPopupMenu* settingsMenu(); 67 QPopupMenu* settingsMenu();
68 QPopupMenu* templateMenu(); 68 QPopupMenu* templateMenu();
69 View* currentView(); 69 View* currentView();
70 BookManager* manager(); 70 BookManager* manager();
71 TemplateManager templateManager(); 71 TemplateManager templateManager();
72 LocationManager locationManager(); 72 LocationManager locationManager();
73 DescriptionManager descriptionManager(); 73 DescriptionManager descriptionManager();
74 void setLocationManager( const LocationManager& ); 74 void setLocationManager( const LocationManager& );
75 void setDescriptionManager( const DescriptionManager& ); 75 void setDescriptionManager( const DescriptionManager& );
76 Show* eventShow(); 76 Show* eventShow();
77 Editor* editor(); 77 Editor* editor();
78 78
79 private: // friend functions for Show 79 private: // friend functions for Show
80 void hideShow(); // to hide the view 80 void hideShow(); // to hide the view
81 // off friend Show 81 // off friend Show
82 82
83 // friend of the view 83 // friend of the view
84 private: 84 private:
85 void viewPopup( int ); 85 void viewPopup( int );
86 void viewAdd( const QDate& date ); 86 void viewAdd( const QDate& date );
87 void viewAdd( const QDateTime&, const QDateTime& ); 87 void viewAdd( const QDateTime&, const QDateTime& );
88 bool viewAP()const; 88 bool viewAP()const;
89 bool viewStartMonday()const; 89 bool viewStartMonday()const;
90 // off view show 90 // off view show
91 private: 91 private:
92 QList<View> m_view; // the Views.. not autoDelete 92 QList<View> m_view; // the Views.. not autoDelete
93 QWidgetStack* m_stack; 93 QWidgetStack* m_stack;
94 QPEToolBar *m_toolBar; 94 QToolBar *m_toolBar;
95 QPopupMenu* m_popView; 95 QPopupMenu* m_popView;
96 QPopupMenu* m_popSetting; 96 QPopupMenu* m_popSetting;
97 QPopupMenu* m_popTemplate; 97 QPopupMenu* m_popTemplate;
98 BookManager* m_manager; 98 BookManager* m_manager;
99 TemplateManager m_tempMan; 99 TemplateManager m_tempMan;
100 DescriptionManager m_descMan; 100 DescriptionManager m_descMan;
101 LocationManager m_locMan; 101 LocationManager m_locMan;
102 Show* m_show; 102 Show* m_show;
103 Editor* m_edit; 103 Editor* m_edit;
104 }; 104 };
105} 105}
106 106
107#endif 107#endif