-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
172 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#include "FastAppWoker.h" | ||
|
||
FastAppWorker::FastAppWorker(QObject *parent) | ||
:QObject(parent) | ||
,m_dialog(new MDialog()) | ||
,m_dialogWidget(new QWidget()) | ||
,m_tabSwitchButton(new MTabSwitchButton()) | ||
,m_appIcon(new QLabel()) | ||
,m_appNameEdit(new MLineEdit()) | ||
,m_appDescribtionEdit(new MLineEdit()) | ||
,m_appWidget(new QWidget()) | ||
,m_appPathEdit(new MLineEdit()) | ||
,m_appArgsEdit(new MLineEdit()) | ||
,m_cmdWidget(new QWidget()) | ||
,m_cmdEdit(new MLineEdit()) | ||
,m_dbusWidget(new QWidget()) | ||
,m_stackedWidget(new QStackedWidget()) | ||
{ | ||
m_tabSwitchButton->addItem("启动应用"); | ||
m_tabSwitchButton->addItem("执行命令"); | ||
m_tabSwitchButton->addItem("运行Dbus"); | ||
|
||
m_appNameEdit->setTipText("快捷应用名称"); | ||
m_appDescribtionEdit->setTipText("描述"); | ||
m_appPathEdit->setTipText("可执行文件路径"); | ||
m_appArgsEdit->setTipText("启动参数"); | ||
m_cmdEdit->setTipText("执行命令"); | ||
|
||
auto *mainLayout = new QVBoxLayout(m_dialogWidget); | ||
|
||
auto *appLayout = new QVBoxLayout(m_appWidget); | ||
auto *cmdLayout = new QVBoxLayout(m_cmdWidget); | ||
auto *dbusLayout = new QVBoxLayout(m_dbusWidget); | ||
|
||
auto *tabHLayout = new QHBoxLayout(); | ||
tabHLayout->setAlignment(Qt::AlignHCenter); | ||
tabHLayout->setSpacing(0); | ||
tabHLayout->setMargin(0); | ||
tabHLayout->addWidget(m_tabSwitchButton); | ||
|
||
mainLayout->setAlignment(Qt::AlignTop | Qt::AlignHCenter); | ||
mainLayout->setSpacing(0); | ||
mainLayout->setMargin(0); | ||
|
||
appLayout->setAlignment(Qt::AlignTop | Qt::AlignHCenter); | ||
appLayout->setSpacing(0); | ||
appLayout->setMargin(0); | ||
|
||
cmdLayout->setAlignment(Qt::AlignTop | Qt::AlignHCenter); | ||
cmdLayout->setSpacing(0); | ||
cmdLayout->setMargin(0); | ||
|
||
dbusLayout->setAlignment(Qt::AlignTop | Qt::AlignHCenter); | ||
dbusLayout->setSpacing(0); | ||
dbusLayout->setMargin(0); | ||
|
||
appLayout->addWidget(m_appPathEdit); | ||
appLayout->addWidget(m_appArgsEdit); | ||
|
||
cmdLayout->addWidget(m_cmdEdit); | ||
|
||
dbusLayout->addWidget(new QLabel("开发中...")); | ||
|
||
m_stackedWidget->addWidget(m_appWidget); | ||
m_stackedWidget->addWidget(m_cmdWidget); | ||
m_stackedWidget->addWidget(m_dbusWidget); | ||
|
||
mainLayout->addLayout(tabHLayout);; | ||
mainLayout->addWidget(m_appIcon); | ||
mainLayout->addWidget(m_appNameEdit); | ||
mainLayout->addWidget(m_appDescribtionEdit); | ||
mainLayout->addWidget(m_stackedWidget); | ||
|
||
m_dialog->addWidget(m_dialogWidget); | ||
|
||
connect(m_tabSwitchButton, QOverload<int>::of(&MTabSwitchButton::currentIndexChanged), m_stackedWidget, &QStackedWidget::setCurrentIndex); | ||
} | ||
|
||
void FastAppWorker::showDialog() | ||
{ | ||
m_dialog->exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef FASTAPPWOKER_H | ||
#define FASTAPPWOKER_H | ||
|
||
#include <QObject> | ||
#include <dtkwidget_global.h> | ||
#include <QStackedWidget> | ||
#include "customComponents/MDialog.h" | ||
#include "customComponents/MLineEdit.h" | ||
#include "customComponents/MTabSwitchButton.h" | ||
|
||
DWIDGET_USE_NAMESPACE | ||
|
||
enum SettingType {DBUS, APP}; | ||
|
||
struct SettingInfo { | ||
SettingType type; | ||
|
||
QString headIconPath; | ||
QString headTitleName; | ||
|
||
QString appPath; | ||
QStringList args; | ||
|
||
QString dbusInterface; | ||
}; | ||
|
||
class FastAppWorker : public QObject{ | ||
Q_OBJECT | ||
public: | ||
explicit FastAppWorker(QObject *parent = nullptr); | ||
void editFastAppInfo(int id); | ||
void addFastAppInfo(int id); | ||
void showDialog(); | ||
private: | ||
MDialog *m_dialog = nullptr; | ||
|
||
QWidget *m_dialogWidget = nullptr; | ||
MTabSwitchButton *m_tabSwitchButton = nullptr; | ||
|
||
QLabel *m_appIcon = nullptr; | ||
MLineEdit *m_appNameEdit = nullptr; | ||
MLineEdit *m_appDescribtionEdit = nullptr; | ||
|
||
QWidget *m_appWidget = nullptr; | ||
MLineEdit *m_appPathEdit = nullptr; | ||
MLineEdit *m_appArgsEdit = nullptr; | ||
|
||
QWidget *m_cmdWidget = nullptr; | ||
MLineEdit *m_cmdEdit = nullptr; | ||
|
||
QWidget *m_dbusWidget = nullptr; | ||
|
||
QStackedWidget *m_stackedWidget = nullptr; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters