umbrello: umbrello/codeimpwizard/codeimpstatuspage.h Source File

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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

codeimpstatuspage.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2011 Andi Fischer <andi.fischer@hispeed.ch>
3
4 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
5*/
6#ifndef CODEIMPSTATUSPAGE_H
7#define CODEIMPSTATUSPAGE_H
8
9// app includes
10#include "ui_codeimpstatuspage.h"
11#include "classifier.h"
12
13//kde includes
14#include <kled.h>
15
16// qt includes
17#include <QFileInfo>
18#include <QHBoxLayout>
19#include <QSpacerItem>
20#include <QWizardPage>
21
22class QThread;
30 class CodeImpStatusPage : public QWizardPage, private Ui::CodeImpStatusPage
31{
32 Q_OBJECT
33public:
34 explicit CodeImpStatusPage(QWidget *parent = 0);
35 ~CodeImpStatusPage();
36 void initializePage();
37 bool isComplete() const;
38
39private:
40 QList<QFileInfo> m_files;
41 bool m_workDone;
42 bool m_savedUndoEnabled;
43 int m_index;
44 QFileInfo m_file;
45 bool m_savedlistViewVisible;
46#ifdef ENABLE_IMPORT_THREAD
47 QThread *m_thread;
48#endif
49
50protected slots:
51 void importCode();
52 void importCodeFile(bool noError=true);
53 void importNextFile(bool noError=true);
54 void importCodeFinish();
55 void importCodeStop();
56 void updateStatus(const QString& file, const QString& text);
57 void messageToLog(const QString& file, const QString& text);
58 void messageToApp(const QString& text);
59 void populateStatusList();
60 void loggerClear();
61 void loggerExport();
62};
63
64 namespace CodeImport {
65
66 class LedStatus : public QWidget
67 {
68 Q_OBJECT
69 public:
70 LedStatus(int width, int height) : QWidget() {
71 setFixedSize(width, height);
72 QHBoxLayout* layout = new QHBoxLayout();
73 layout->addItem(new QSpacerItem(20, 20));
74 m_led = new KLed(QColor(124, 252, 0), KLed::Off, KLed::Sunken, KLed::Circular);
75 layout->addWidget(m_led);
76 layout->addItem(new QSpacerItem(20, 20));
77 setLayout(layout);
78 }
79 ~LedStatus() {}
80 void setColor(const QColor& color) { m_led->setColor(color); }
81 void setOn(bool isOn) { isOn ? m_led->setState(KLed::On) : m_led->setState(KLed::Off); }
82 private:
83 KLed* m_led;
84};
85
86} // namespace
87
88#endif
CodeImpStatusPage
Definition: codeimpstatuspage.h:31
CodeImpStatusPage::m_files
QList< QFileInfo > m_files
list of files to import
Definition: codeimpstatuspage.h:40
CodeImpStatusPage::messageToApp
void messageToApp(const QString &text)
Definition: codeimpstatuspage.cpp:224
CodeImpStatusPage::~CodeImpStatusPage
~CodeImpStatusPage()
Definition: codeimpstatuspage.cpp:72
CodeImpStatusPage::m_file
QFileInfo m_file
current file
Definition: codeimpstatuspage.h:44
CodeImpStatusPage::populateStatusList
void populateStatusList()
Definition: codeimpstatuspage.cpp:92
CodeImpStatusPage::importNextFile
void importNextFile(bool noError=true)
Definition: codeimpstatuspage.cpp:191
CodeImpStatusPage::loggerExport
void loggerExport()
Definition: codeimpstatuspage.cpp:328
CodeImpStatusPage::m_savedUndoEnabled
bool m_savedUndoEnabled
saved undo enabled state
Definition: codeimpstatuspage.h:42
CodeImpStatusPage::initializePage
void initializePage()
Definition: codeimpstatuspage.cpp:82
CodeImpStatusPage::m_workDone
bool m_workDone
Definition: codeimpstatuspage.h:41
CodeImpStatusPage::importCode
void importCode()
start importing
Definition: codeimpstatuspage.cpp:118
CodeImpStatusPage::importCodeFile
void importCodeFile(bool noError=true)
import single file
Definition: codeimpstatuspage.cpp:152
CodeImpStatusPage::isComplete
bool isComplete() const
Definition: codeimpstatuspage.cpp:261
CodeImpStatusPage::m_savedlistViewVisible
bool m_savedlistViewVisible
indicates previous state of list view
Definition: codeimpstatuspage.h:45
CodeImpStatusPage::m_index
int m_index
index in m_files
Definition: codeimpstatuspage.h:43
CodeImpStatusPage::importCodeStop
void importCodeStop()
cancel importing
Definition: codeimpstatuspage.cpp:233
CodeImpStatusPage::updateStatus
void updateStatus(const QString &file, const QString &text)
Definition: codeimpstatuspage.cpp:288
CodeImpStatusPage::messageToLog
void messageToLog(const QString &file, const QString &text)
Definition: codeimpstatuspage.cpp:271
CodeImpStatusPage::importCodeFinish
void importCodeFinish()
finish importing
Definition: codeimpstatuspage.cpp:198
CodeImpStatusPage::loggerClear
void loggerClear()
Definition: codeimpstatuspage.cpp:319
CodeImport::LedStatus
Definition: codeimpstatuspage.h:67
CodeImport::LedStatus::~LedStatus
~LedStatus()
Definition: codeimpstatuspage.h:79
CodeImport::LedStatus::LedStatus
LedStatus(int width, int height)
Definition: codeimpstatuspage.h:70
CodeImport::LedStatus::setOn
void setOn(bool isOn)
Definition: codeimpstatuspage.h:81
CodeImport::LedStatus::m_led
KLed * m_led
Definition: codeimpstatuspage.h:83
CodeImport::LedStatus::setColor
void setColor(const QColor &color)
Definition: codeimpstatuspage.h:80
classifier.h
CodeImport
Definition: codeimpstatuspage.h:64