Subversion Repositories public

Rev

Rev 232 | Rev 246 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 232 Rev 245
Line 15... Line 15...
15
 *   along with this program; if not, write to the                         *
15
 *   along with this program; if not, write to the                         *
16
 *   Free Software Foundation, Inc.,                                       *
16
 *   Free Software Foundation, Inc.,                                       *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
17
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 ***************************************************************************/
18
 ***************************************************************************/
19
 
19
 
20
 
-
 
21
#include <kmainwindow.h>
20
#include <KApplication>
22
#include <klocale.h>
21
#include <KLocale>
-
 
22
#include <KAction>
-
 
23
#include <KActionCollection>
-
 
24
#include <KStandardAction>
23
 
25
 
24
#include "sportwatcher.h"
26
#include "sportwatcher.h"
25
#include "sportwatcherwidget.h"
27
#include "sportwatcherwidget.h"
26
 
28
 
27
sportwatcher::sportwatcher(QWidget *parent, Qt::WindowFlags f)
29
sportwatcher::sportwatcher(QWidget *parent, Qt::WindowFlags f)
28
	: KMainWindow(parent, f)
30
	: KXmlGuiWindow(parent, f),
-
 
31
	m_view(new sportwatcherWidget(this))
29
{
32
{
30
    setCentralWidget( new sportwatcherWidget( this ) );
33
	setXMLFile("sportwatcherui.rc");
-
 
34
	setCentralWidget(m_view);
-
 
35
	setupActions();
-
 
36
	setupGUI();
-
 
37
	m_view->Initialize();
31
}
38
}
32
 
39
 
33
sportwatcher::~sportwatcher()
40
sportwatcher::~sportwatcher()
34
{
41
{
-
 
42
	delete m_view;
-
 
43
}
-
 
44
 
-
 
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
 
35
}
123
}
36
 
124
 
37
#include "sportwatcher.moc"
125
#include "sportwatcher.moc"