umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

codeimpstatuspage.h
Go to the documentation of this file.
1 /*
2 Copyright 2011 Andi Fischer <andi.fischer@hispeed.ch>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License or (at your option) version 3 or any later version
8 accepted by the membership of KDE e.V. (or its successor approved
9 by the membership of KDE e.V.), which shall act as a proxy
10 defined in Section 14 of version 3 of the license.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef CODEIMPSTATUSPAGE_H
21 #define CODEIMPSTATUSPAGE_H
22
23 // app includes
24 #include "ui_codeimpstatuspage.h"
25 #include "classifier.h"
26
27 //kde includes
28 #include <kled.h>
29
30 // qt includes
31 #include <QFileInfo>
32 #include <QHBoxLayout>
33 #include <QSpacerItem>
34 #include <QWizardPage>
35
36 class QThread;
44 class CodeImpStatusPage : public QWizardPage, private Ui::CodeImpStatusPage
45 {
46 Q_OBJECT
47 public:
48 explicit CodeImpStatusPage(QWidget *parent = 0);
49 ~CodeImpStatusPage();
50 void initializePage();
51 bool isComplete() const;
52
53 private:
54 QList<QFileInfo> m_files;
55 bool m_workDone;
56 bool m_savedUndoEnabled;
57 int m_index;
58 QFileInfo m_file;
59 bool m_savedlistViewVisible;
60 #ifdef ENABLE_IMPORT_THREAD
61 QThread *m_thread;
62 #endif
63
64 protected slots:
65 void importCode();
66 void importCodeFile(bool noError=true);
67 void importNextFile(bool noError=true);
68 void importCodeFinish();
69 void importCodeStop();
70 void updateStatus(const QString& file, const QString& text);
71 void messageToLog(const QString& file, const QString& text);
72 void messageToApp(const QString& text);
73 void populateStatusList();
74 void loggerClear();
75 void loggerExport();
76 };
77
78 namespace CodeImport {
79
80 class LedStatus : public QWidget
81 {
82 Q_OBJECT
83 public:
84 LedStatus(int width, int height) : QWidget() {
85 setFixedSize(width, height);
86 QHBoxLayout* layout = new QHBoxLayout();
87 layout->addItem(new QSpacerItem(20, 20));
88 m_led = new KLed(QColor(124, 252, 0), KLed::Off, KLed::Sunken, KLed::Circular);
89 layout->addWidget(m_led);
90 layout->addItem(new QSpacerItem(20, 20));
91 setLayout(layout);
92 }
93 ~LedStatus() {}
94 void setColor(const QColor& color) { m_led->setColor(color); }
95 void setOn(bool isOn) { isOn ? m_led->setState(KLed::On) : m_led->setState(KLed::Off); }
96 private:
97 KLed* m_led;
98 };
99
100 } // namespace
101
102 #endif
CodeImport::LedStatus::~LedStatus
~LedStatus()
Definition: codeimpstatuspage.h:93
CodeImpStatusPage::loggerClear
void loggerClear()
Definition: codeimpstatuspage.cpp:331
CodeImport::LedStatus::setColor
void setColor(const QColor &color)
Definition: codeimpstatuspage.h:94
Ui_CodeImpStatusPage::setupUi
void setupUi(QWidget *CodeImpStatusPage)
Definition: ui_codeimpstatuspage.h:47
CodeImpStatusPage::m_savedlistViewVisible
bool m_savedlistViewVisible
indicates previous state of list view
Definition: codeimpstatuspage.h:59
CodeImpStatusPage::~CodeImpStatusPage
~CodeImpStatusPage()
Definition: codeimpstatuspage.cpp:84
CodeImport::LedStatus::m_led
KLed * m_led
Definition: codeimpstatuspage.h:97
CodeImpStatusPage::loggerExport
void loggerExport()
Definition: codeimpstatuspage.cpp:340
CodeImport::LedStatus
Definition: codeimpstatuspage.h:81
CodeImpStatusPage::m_workDone
bool m_workDone
Definition: codeimpstatuspage.h:55
UMLApp::enableUndo
void enableUndo(bool enable)
Definition: uml.cpp:2134
CodeImport::LedStatus::LedStatus
LedStatus(int width, int height)
Definition: codeimpstatuspage.h:84
CodeImpStatusPage::updateStatus
void updateStatus(const QString &file, const QString &text)
Definition: codeimpstatuspage.cpp:300
CodeImpStatusPage::messageToLog
void messageToLog(const QString &file, const QString &text)
Definition: codeimpstatuspage.cpp:283
CodeImpStatusPage::m_savedUndoEnabled
bool m_savedUndoEnabled
saved undo enabled state
Definition: codeimpstatuspage.h:56
CodeImpStatusPage::initializePage
void initializePage()
Definition: codeimpstatuspage.cpp:94
model_utils.h
CodeImpStatusPage::populateStatusList
void populateStatusList()
Definition: codeimpstatuspage.cpp:104
Ui_CodeImpStatusPage::ui_textEditLogger
QTextEdit * ui_textEditLogger
Definition: ui_codeimpstatuspage.h:42
CodeImpStatusPage::m_files
QList< QFileInfo > m_files
list of files to import
Definition: codeimpstatuspage.h:54
classimport.h
CodeImpStatusPage::importCode
void importCode()
start importing
Definition: codeimpstatuspage.cpp:130
Ui_CodeImpStatusPage::ui_pushButtonExport
QPushButton * ui_pushButtonExport
Definition: ui_codeimpstatuspage.h:45
CodeImpStatusPage::messageToApp
void messageToApp(const QString &text)
Definition: codeimpstatuspage.cpp:236
CodeImport
Definition: codeimpstatuspage.h:78
Ui_CodeImpStatusPage::ui_pushButtonStop
QPushButton * ui_pushButtonStop
Definition: ui_codeimpstatuspage.h:38
UMLApp::listView
UMLListView * listView() const
Definition: uml.cpp:1074
UMLDoc::setLoading
void setLoading(bool state=true)
Definition: umldoc.cpp:1581
UMLApp::isUndoEnabled
bool isUndoEnabled()
Definition: uml.cpp:2124
CodeImpStatusPage::CodeImpStatusPage
CodeImpStatusPage(QWidget *parent=0)
Definition: codeimpstatuspage.cpp:55
i18n
#define i18n
Definition: main.cpp:39
CodeImpStatusPage::m_file
QFileInfo m_file
current file
Definition: codeimpstatuspage.h:58
codeimpstatuspage.h
UMLDoc::writeToStatusBar
void writeToStatusBar(const QString &text)
Definition: umldoc.cpp:1208
ui_codeimpstatuspage.h
uDebug
#define uDebug()
Definition: debug_utils.h:122
CodeImpStatusPage::importNextFile
void importNextFile(bool noError=true)
Definition: codeimpstatuspage.cpp:203
Ui::CodeImpStatusPage
Definition: ui_codeimpstatuspage.h:183
MyProject\connect
connect()
Definition: namespaces-multiple.php:5
CodeImpThread
Definition: codeimpthread.h:36
CodeImportingWizard::selectedFiles
QList< QFileInfo > selectedFiles()
Definition: codeimportingwizard.cpp:92
umllistview.h
CodeImpStatusPage
Definition: codeimpstatuspage.h:45
CodeImpStatusPage::m_index
int m_index
index in m_files
Definition: codeimpstatuspage.h:57
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
CodeImport::LedStatus::setOn
void setOn(bool isOn)
Definition: codeimpstatuspage.h:95
UMLDoc
Definition: umldoc.h:75
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3136
Ui_CodeImpStatusPage::ui_tableWidgetStatus
QTableWidget * ui_tableWidgetStatus
Definition: ui_codeimpstatuspage.h:35
CodeImpStatusPage::importCodeFinish
void importCodeFinish()
finish importing
Definition: codeimpstatuspage.cpp:210
classifier.h
uError
#define uError()
Definition: debug_utils.h:123
uml.h
debug_utils.h
codeimportingwizard.h
Ui_CodeImpStatusPage::ui_tabWidget
QTabWidget * ui_tabWidget
Definition: ui_codeimpstatuspage.h:31
CodeImportingWizard
Definition: codeimportingwizard.h:35
Ui_CodeImpStatusPage::ui_pushButtonStart
QPushButton * ui_pushButtonStart
Definition: ui_codeimpstatuspage.h:37
CodeImpStatusPage::importCodeFile
void importCodeFile(bool noError=true)
import single file
Definition: codeimpstatuspage.cpp:164
Ui_CodeImpStatusPage::ui_pushButtonClear
QPushButton * ui_pushButtonClear
Definition: ui_codeimpstatuspage.h:44
codeimpthread.h
CodeImpThread::run
virtual void run()
Definition: codeimpthread.cpp:51
CodeImpStatusPage::importCodeStop
void importCodeStop()
cancel importing
Definition: codeimpstatuspage.cpp:245
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1064
umldoc.h
CodeImpStatusPage::isComplete
bool isComplete() const
Definition: codeimpstatuspage.cpp:273