Subversion Repositories public

Rev

Rev 232 | Rev 246 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
88 andreas 1
/***************************************************************************
232 andreas 2
 *   Copyright (C) 2007 - 2009 by Andreas Theofilu                         *
3
 *   andreas@theosys.at                                                    *
88 andreas 4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation version 3 of the License.                *
8
 *                                                                         *
9
 *   This program is distributed in the hope that it will be useful,       *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12
 *   GNU General Public License for more details.                          *
13
 *                                                                         *
14
 *   You should have received a copy of the GNU General Public License     *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
19
 
245 andreas 20
#include <KApplication>
21
#include <KLocale>
22
#include <KAction>
23
#include <KActionCollection>
24
#include <KStandardAction>
88 andreas 25
 
26
#include "sportwatcher.h"
27
#include "sportwatcherwidget.h"
28
 
232 andreas 29
sportwatcher::sportwatcher(QWidget *parent, Qt::WindowFlags f)
245 andreas 30
	: KXmlGuiWindow(parent, f),
31
	m_view(new sportwatcherWidget(this))
88 andreas 32
{
245 andreas 33
	setXMLFile("sportwatcherui.rc");
34
	setCentralWidget(m_view);
35
	setupActions();
36
	setupGUI();
37
	m_view->Initialize();
88 andreas 38
}
39
 
40
sportwatcher::~sportwatcher()
41
{
245 andreas 42
	delete m_view;
88 andreas 43
}
44
 
245 andreas 45
void sportwatcher::setupActions()
46
{
47
	// File menu
48
	KAction* fileNewAction = new KAction(this);
49
	fileNewAction->setText(i18n("Read data ..."));
50
	fileNewAction->setIcon(KIcon("document-new"));
51
	fileNewAction->setShortcut(Qt::CTRL + Qt::Key_R);
52
	actionCollection()->addAction("fileNewAction", fileNewAction);
53
	connect(fileNewAction, SIGNAL(triggered(bool)),
54
	   m_view, SLOT(fileNew()));
55
 
56
	KAction* fileOpenAction = new KAction(this);
57
	fileOpenAction->setText(i18n("Open ..."));
58
	fileOpenAction->setIcon(KIcon("document-open"));
59
	fileOpenAction->setShortcut(Qt::CTRL + Qt::Key_O);
60
	actionCollection()->addAction("fileOpenAction", fileOpenAction);
61
	connect(fileOpenAction, SIGNAL(triggered(bool)),
62
	   m_view, SLOT(fileOpen()));
63
 
64
	KAction* fileImportAction = new KAction(this);
65
	fileImportAction->setText(i18n("Import ..."));
66
	fileImportAction->setIcon(KIcon("document-import"));
67
	fileImportAction->setShortcut(Qt::CTRL + Qt::Key_I);
68
	actionCollection()->addAction("fileImportAction", fileImportAction);
69
	connect(fileImportAction, SIGNAL(triggered(bool)),
70
	   m_view, SLOT(fileImport()));
71
 
72
	KAction* extrasSaveHRAction = new KAction(this);
73
	extrasSaveHRAction->setText(i18n("Save heart rate ..."));
74
	extrasSaveHRAction->setIcon(KIcon("document-export"));
75
	actionCollection()->addAction("extrasSaveHRAction", extrasSaveHRAction);
76
	connect(extrasSaveHRAction, SIGNAL(triggered(bool)),
77
	   m_view, SLOT(extrasSaveHR()));
78
 
79
	KAction* fileSaveAsAction = new KAction(this);
80
	fileSaveAsAction->setText(i18n("Save as ..."));
81
	fileSaveAsAction->setIcon(KIcon("document-save-as"));
82
	fileSaveAsAction->setShortcut(Qt::CTRL + Qt::Key_S);
83
	actionCollection()->addAction("fileSaveAsAction", fileSaveAsAction);
84
	connect(fileSaveAsAction, SIGNAL(triggered(bool)),
85
	   m_view, SLOT(fileSaveAs()));
86
 
87
	KAction* filePrintAction = new KAction(this);
88
	filePrintAction->setText(i18n("Print ..."));
89
	filePrintAction->setIcon(KIcon("document-print"));
90
	actionCollection()->addAction("filePrintAction", filePrintAction);
91
	connect(filePrintAction, SIGNAL(triggered(bool)),
92
	   m_view, SLOT(filePrint()));
93
 
94
	KAction* fileExitAction = new KAction(this);
95
	fileExitAction->setText(i18n("Exit ..."));
96
	fileExitAction->setIcon(KIcon("application-exit"));
97
	fileExitAction->setShortcut(Qt::CTRL + Qt::Key_E);
98
	actionCollection()->addAction("fileExitAction", fileExitAction);
99
	connect(fileExitAction, SIGNAL(triggered(bool)),
100
	   m_view, SLOT(fileExit()));
101
 
102
	// Edit menu
103
	KAction* editRenameAction = new KAction(this);
104
	editRenameAction->setText(i18n("Rename ..."));
105
	editRenameAction->setIcon(KIcon("edit-rename"));
106
	actionCollection()->addAction("editRenameAction", editRenameAction);
107
	connect(editRenameAction, SIGNAL(triggered(bool)),
108
	   m_view, SLOT(editRename()));
109
 
110
	// Settings menu
111
	KAction* setSportwatcherAction = new KAction(this);
112
	setSportwatcherAction->setText(i18n("Configure SportWatcher ..."));
113
	actionCollection()->addAction("setSportwatcherAction", setSportwatcherAction);
114
	connect(setSportwatcherAction, SIGNAL(triggered(bool)),
115
	   m_view, SLOT(extrasSettings()));
116
 
117
	KAction* setMapAction = new KAction(this);
118
	setMapAction->setText(i18n("Configure Map ..."));
119
	actionCollection()->addAction("setMapAction", setMapAction);
120
	connect(setMapAction, SIGNAL(triggered(bool)),
121
	   m_view, SLOT(extrasWMSSettings()));
122
 
123
}
124
 
88 andreas 125
#include "sportwatcher.moc"