umbrello: umbrello/codeimpwizard/codeimpstatuspage.h Source File

umbrello 25.04.0 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 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 = nullptr);
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 Q_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::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:219
CodeImpStatusPage::~CodeImpStatusPage
~CodeImpStatusPage()
Definition codeimpstatuspage.cpp:67
CodeImpStatusPage::m_file
QFileInfo m_file
current file
Definition codeimpstatuspage.h:44
CodeImpStatusPage::populateStatusList
void populateStatusList()
Definition codeimpstatuspage.cpp:87
CodeImpStatusPage::importNextFile
void importNextFile(bool noError=true)
Definition codeimpstatuspage.cpp:186
CodeImpStatusPage::loggerExport
void loggerExport()
Definition codeimpstatuspage.cpp:323
CodeImpStatusPage::m_savedUndoEnabled
bool m_savedUndoEnabled
saved undo enabled state
Definition codeimpstatuspage.h:42
CodeImpStatusPage::CodeImpStatusPage
CodeImpStatusPage(QWidget *parent=nullptr)
Definition codeimpstatuspage.cpp:38
CodeImpStatusPage::initializePage
void initializePage()
Definition codeimpstatuspage.cpp:77
CodeImpStatusPage::m_workDone
bool m_workDone
Definition codeimpstatuspage.h:41
CodeImpStatusPage::importCode
void importCode()
start importing
Definition codeimpstatuspage.cpp:113
CodeImpStatusPage::importCodeFile
void importCodeFile(bool noError=true)
import single file
Definition codeimpstatuspage.cpp:147
CodeImpStatusPage::isComplete
bool isComplete() const
Definition codeimpstatuspage.cpp:256
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:228
CodeImpStatusPage::updateStatus
void updateStatus(const QString &file, const QString &text)
Definition codeimpstatuspage.cpp:283
CodeImpStatusPage::messageToLog
void messageToLog(const QString &file, const QString &text)
Definition codeimpstatuspage.cpp:266
CodeImpStatusPage::importCodeFinish
void importCodeFinish()
finish importing
Definition codeimpstatuspage.cpp:193
CodeImpStatusPage::loggerClear
void loggerClear()
Definition codeimpstatuspage.cpp:314
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