-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add service list to gui #26
Changes from all commits
fa2fe70
597f0f4
6f267ee
b94986b
8bbc982
998316c
c7ee6eb
d4aace1
7310687
93b843b
ef210a8
0aa9d37
da023aa
35789ed
354d564
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#include "serviceview.h" | ||
|
||
#include <QDialogButtonBox> | ||
#include <QFormLayout> | ||
#include <QLabel> | ||
|
||
ServiceView::ServiceView(QDialog *parent, QIcon icon) | ||
{ | ||
m_parent = parent; | ||
m_icon = icon; | ||
} | ||
|
||
void ServiceView::displayTable(QString svcCmdOutput) | ||
{ | ||
|
||
m_dialog = new QDialog(m_parent); | ||
m_dialog->setWindowTitle(tr("Service List")); | ||
m_dialog->setWindowIcon(m_icon); | ||
m_dialog->setFixedWidth(600); | ||
m_dialog->setModal(true); | ||
QFormLayout form(m_dialog); | ||
QLabel *tableLbl = new QLabel(); | ||
tableLbl->setOpenExternalLinks(true); | ||
tableLbl->setWordWrap(true); | ||
tableLbl->setText(svcCmdOutput); | ||
Comment on lines
+38
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not required, but going forward you can pass a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good to know thanks |
||
form.addRow(tableLbl); | ||
QDialogButtonBox buttonBox(Qt::Horizontal, m_dialog); | ||
buttonBox.addButton(QString(tr("OK")), QDialogButtonBox::AcceptRole); | ||
connect(&buttonBox, &QDialogButtonBox::accepted, m_dialog, &QDialog::accept); | ||
form.addRow(&buttonBox); | ||
m_dialog->exec(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#ifndef SERVICEVIEW_H | ||
#define SERVICEVIEW_H | ||
|
||
#include <QObject> | ||
#include <QIcon> | ||
#include <QString> | ||
#include <QDialog> | ||
|
||
class ServiceView : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ServiceView(QDialog *parent, QIcon icon); | ||
|
||
void displayTable(QString); | ||
|
||
private: | ||
QDialog *m_dialog; | ||
QIcon m_icon; | ||
QDialog *m_parent; | ||
}; | ||
|
||
#endif // SERVICEVIEW_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have to be done in this PR, but we should make a variable called
isRunningOrPaused
instead of repeatedly doingisRunning || isPaused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea