some polishing
This commit is contained in:
parent
e6d21804ef
commit
bdcb7f670a
14 changed files with 203 additions and 212 deletions
|
@ -75,32 +75,6 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="shutdownButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>600</x>
|
||||
<y>390</y>
|
||||
<width>33</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="rebootButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>600</x>
|
||||
<y>436</y>
|
||||
<width>33</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="timeLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
|
@ -351,7 +325,7 @@
|
|||
<rect>
|
||||
<x>10</x>
|
||||
<y>390</y>
|
||||
<width>581</width>
|
||||
<width>620</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
|
@ -34,6 +34,11 @@
|
|||
#include "linboimage.h"
|
||||
#include "linbodiskpartition.h"
|
||||
|
||||
/**
|
||||
* @brief The LinboBackend class is used to execute Linbo commands (control linbo_cmd) very comfortable.
|
||||
*
|
||||
* The LinboBackend class offeres some easy to use functions to manage all Linbo functionality
|
||||
*/
|
||||
class LinboBackend : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -3,12 +3,10 @@ DEPENDPATH += .
|
|||
INCLUDEPATH += .
|
||||
CFLAGS += -DQWS -static
|
||||
QT += \
|
||||
qt3support \
|
||||
widgets \
|
||||
widgets \
|
||||
widgets \
|
||||
widgets \
|
||||
#qt3support \
|
||||
gui \
|
||||
svg
|
||||
|
||||
QMAKE_POST_LINK=strip $(TARGET)
|
||||
|
||||
# deployment
|
||||
|
|
|
@ -45,7 +45,7 @@ QString LinboLogger::logTypeToString(LinboLogType logType) {
|
|||
void LinboLogger::log(QString logText, LinboLogType logType) {
|
||||
if(logText.isEmpty() || logText == "")
|
||||
return;
|
||||
qDebug() << qPrintable("[" + this->logTypeToString(logType) + "]") << logText;
|
||||
qDebug() << qPrintable("[" + this->logTypeToString(logType) + "] " + logText);
|
||||
|
||||
LinboLog latestLog {logText, logType, QDateTime::currentDateTime()};
|
||||
this->logHistory.append(latestLog);
|
||||
|
|
|
@ -109,6 +109,8 @@ void linboConsoleImpl::readFromStderr()
|
|||
|
||||
void linboConsoleImpl::processFinished( int retval,
|
||||
QProcess::ExitStatus status) {
|
||||
Q_UNUSED(retval)
|
||||
Q_UNUSED(status)
|
||||
// nothing to do
|
||||
static_cast<linboGUIImpl*>(myMainApp)->restoreButtonsState();
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@ void linboCounterImpl::setCommand(const QStringList& arglist)
|
|||
|
||||
void linboCounterImpl::processFinished( int retval,
|
||||
QProcess::ExitStatus status) {
|
||||
Q_UNUSED(retval)
|
||||
Q_UNUSED(status)
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
|
|||
logfilepath = QString("/tmp/linbo.log");
|
||||
|
||||
// connect our shutdown and reboot buttons
|
||||
connect( shutdownButton, SIGNAL(clicked()), this, SLOT(shutdown()) );
|
||||
/*connect( shutdownButton, SIGNAL(clicked()), this, SLOT(shutdown()) );
|
||||
connect( rebootButton, SIGNAL(clicked()), this, SLOT(reboot()) );
|
||||
|
||||
// set and scale up our icons
|
||||
|
@ -314,7 +314,7 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
|
|||
|
||||
shutdownButton->setIconSet( QIcon(":/icons/system-shutdown-32x32.png" ) );
|
||||
shutdownButton->setIconSize(QSize(32,32));
|
||||
QToolTip::add( shutdownButton, QString("Schaltet den Rechner aus.") );
|
||||
QToolTip::add( shutdownButton, QString("Schaltet den Rechner aus.") );*/
|
||||
|
||||
hdlogowidget->setPixmap( QPixmap(":/icons/drive-harddisk-64x64.png" ) );
|
||||
// hdlogowidget->setIconSize(QSize(64,64));
|
||||
|
@ -409,17 +409,17 @@ linboGUIImpl::linboGUIImpl(QWidget* parent) : QDialog(parent)
|
|||
|
||||
// since some tabs can be hidden, we have to maintain this counter
|
||||
int nextPosForTabInsert = 0;
|
||||
int horizontalOffset = 0;
|
||||
//int horizontalOffset = 0;
|
||||
// this is for separating the elements
|
||||
int innerVerticalOffset = 32;
|
||||
//int innerVerticalOffset = 32;
|
||||
|
||||
for( unsigned int i = 0; i < elements.size(); i++ ) {
|
||||
// this determines our vertical offset
|
||||
if( i % 2 == 1 ) {
|
||||
// an odd element is moved to the right
|
||||
horizontalOffset = 300;
|
||||
//horizontalOffset = 300;
|
||||
} else {
|
||||
horizontalOffset = 0;
|
||||
//horizontalOffset = 0;
|
||||
}
|
||||
|
||||
int n = elements[i].find_current_image();
|
||||
|
|
|
@ -287,9 +287,9 @@ void linboImageSelectorImpl::postcmd() {
|
|||
upload = false;
|
||||
|
||||
if ( this->checkShutdown->isChecked() ) {
|
||||
system("busybox poweroff");
|
||||
QProcess::execute("busybox poweroff");
|
||||
} else if ( this->checkReboot->isChecked() ) {
|
||||
system("busybox reboot");
|
||||
QProcess::execute("busybox reboot");
|
||||
}
|
||||
this->close();
|
||||
}
|
||||
|
|
|
@ -111,9 +111,9 @@ void linboImageUploadImpl::postcmd() {
|
|||
}
|
||||
|
||||
if ( this->checkShutdown->isChecked() ) {
|
||||
system("busybox poweroff");
|
||||
QProcess::execute("busybox poweroff");
|
||||
} else if ( this->checkReboot->isChecked() ) {
|
||||
system("busybox reboot");
|
||||
QProcess::execute("busybox reboot");
|
||||
}
|
||||
|
||||
this->close();
|
||||
|
|
|
@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|||
linboLogConsole::linboLogConsole( QWidget* parent,
|
||||
const char* name )
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
Q_UNUSED(name)
|
||||
consolefontcolorstdout = QColor( QString("white") );
|
||||
consolefontcolorstderr = QColor( QString("red") );
|
||||
Console = 0;
|
||||
|
|
|
@ -85,6 +85,8 @@ void linboMsgImpl::readFromStderr()
|
|||
|
||||
void linboMsgImpl::processFinished( int retval,
|
||||
QProcess::ExitStatus status) {
|
||||
Q_UNUSED(retval)
|
||||
Q_UNUSED(status)
|
||||
// let user read the process results
|
||||
this->close();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ void linboPasswordBoxImpl::precmd() {
|
|||
|
||||
void linboPasswordBoxImpl::postcmd() {
|
||||
|
||||
this->hide();
|
||||
app = static_cast<linboGUIImpl*>( myMainApp );
|
||||
|
||||
if( app ) {
|
||||
|
@ -145,12 +144,17 @@ void linboPasswordBoxImpl::postcmd() {
|
|||
myCounter->show();
|
||||
myCounter->raise();
|
||||
myCounter->move( QPoint( 5, 5 ) );
|
||||
|
||||
this->close();
|
||||
}
|
||||
}
|
||||
else {
|
||||
this->passwordLabel->setText("Falsches Passwort!");
|
||||
this->passwordLabel->setStyleSheet("QLabel { color : red; }");
|
||||
}
|
||||
}
|
||||
|
||||
passwordInput->clear();
|
||||
this->close();
|
||||
}
|
||||
|
||||
void linboPasswordBoxImpl::setCommand(const QStringList& arglist)
|
||||
|
|
|
@ -90,6 +90,8 @@ void linboProgressImpl::processTimer() {
|
|||
|
||||
void linboProgressImpl::processFinished( int retval,
|
||||
QProcess::ExitStatus status) {
|
||||
Q_UNUSED(retval)
|
||||
Q_UNUSED(status)
|
||||
myTimer->stop();
|
||||
this->close();
|
||||
}
|
||||
|
|
Reference in a new issue