forked from MoonbaseOtago/CCLoad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ccload.cpp
92 lines (76 loc) · 3.26 KB
/
ccload.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/***************************************************************************
* Copyright (C) 2012 by Paul Campbell <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "ccload.h"
#include "ccloadview.h"
//#include "settings.h"
#include <QDropEvent>
#include <QPainter>
#include <QPrinter>
#include <QStatusBar>
//#include <KConfigDialog>
//#include <KStatusBar>
//#include <KAction>
//#include <KActionCollection>
//#include <KStandardAction>
//#include <KLocale>
ccload::ccload()
: QMainWindow(),
m_view(new ccloadView(this)),
m_printer(0)
{
// accept dnd
//setAcceptDrops(true);
{
QSettings settings("MoonBase", "ccload");
restoreGeometry(settings.value("main-geometry").toByteArray());
restoreState(settings.value("main-windowState").toByteArray());
}
// tell the KXmlGuiWindow that this is indeed the main widget
setCentralWidget(m_view);
// then, setup our actions
setupActions();
// add a status bar
statusBar()->show();
// a call to KXmlGuiWindow::setupGUI() populates the GUI
// with actions, using KXMLGUI.
// It also applies the saved mainwindow settings, if any, and ask the
// mainwindow to automatically save settings if changed: window size,
// toolbar position, icon size, etc.
//setupGUI();
}
void ccload::closeEvent(QCloseEvent *event)
{
QSettings settings("MoonBase", "ccload");
settings.setValue("main-geometry", saveGeometry());
settings.setValue("main-windowState", saveState());
QMainWindow::closeEvent(event);
}
ccload::~ccload()
{
}
void ccload::setupActions()
{
//KStandardAction::openNew(this, SLOT(fileNew()), actionCollection());
//KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
// custom menu and menu item - the slot is in the class ccloadView
//KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this);
//actionCollection()->addAction( QLatin1String("switch_action"), custom );
//connect(custom, SIGNAL(triggered(bool)), m_view, SLOT(switchColors()));
}
//#include "ccload.moc"