完成获取应用列表、获取内置app列表
This commit is contained in:
@ -7,16 +7,18 @@
|
||||
#include "mainwindowlayout.h"
|
||||
#include "ui_MainWindowLayout.h"
|
||||
#include "mysettingsdialog.h"
|
||||
#include "netio.h"
|
||||
#include "sqlitehelper.h"
|
||||
MainWindowLayout::MainWindowLayout(QWidget *parent) :
|
||||
QWidget(parent), ui(new Ui::MainWindowLayout) {
|
||||
ui->setupUi(this);
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
SQLiteHelper sqlite_helper;
|
||||
sqlite_helper.update_app();
|
||||
sqlite_helper.update_software();
|
||||
layout=new QVBoxLayout(this);
|
||||
mainWindowLayout = this;
|
||||
SQLiteHelper sqlite_helper;
|
||||
QList<ButtonStruct> list;
|
||||
sqlite_helper.get_software(&list);
|
||||
ConfigRequest *configRequest = new ConfigRequest;
|
||||
configResponse = new ConfigResponse;
|
||||
configRequest->sendRequest(configResponse);
|
||||
@ -54,20 +56,35 @@ void MainWindowLayout::resizeEvent(QResizeEvent *event) {
|
||||
//layout->setAlignment(Qt::AlignmentFlag::AlignHCenter);
|
||||
}
|
||||
|
||||
void MainWindowLayout::clickButton(QString text, QString url) {
|
||||
QString path = QApplication::applicationDirPath();
|
||||
path += "/app/startcalc.exe";
|
||||
path.replace("/", "\\");
|
||||
if (text== QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")) {
|
||||
WinExec(path.toStdString().c_str(), SW_SHOW);
|
||||
void MainWindowLayout::clickButton(QString op, QString func, QString url,QString path,QString initial_position) {
|
||||
QString root_path = QApplication::applicationDirPath();
|
||||
if(op=="app")
|
||||
{
|
||||
if(func=="openwechat")
|
||||
{
|
||||
emit clickButton1("openwechat", url);
|
||||
}else
|
||||
{
|
||||
path = root_path + path;
|
||||
path.replace("/", "\\");
|
||||
WinExec(path.toStdString().c_str(), SW_SHOW);
|
||||
emit clickButton1(op, url);
|
||||
}
|
||||
}
|
||||
else if (text == QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")) {
|
||||
MySettingsDialog *settings = new MySettingsDialog;
|
||||
settings->exec();
|
||||
delete settings;
|
||||
else if (op == "self") {
|
||||
if(func=="settings")
|
||||
{
|
||||
MySettingsDialog* settings = new MySettingsDialog;
|
||||
settings->exec();
|
||||
delete settings;
|
||||
}
|
||||
}
|
||||
else{
|
||||
emit clickButton1(text, url);
|
||||
else if(op=="soft"){
|
||||
ShellExecute(GetDesktopWindow(), L"open",path.toStdWString().c_str(),L"",initial_position.toStdWString().c_str(),SW_SHOW);
|
||||
emit clickButton1(op, url);
|
||||
}else
|
||||
{
|
||||
emit clickButton1(op, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user