OfficeAssistant_Win10/OfficeAssistant_msvc/applicationmanager.h

89 lines
2.0 KiB
C
Raw Permalink Normal View History

2023-08-18 19:09:55 +08:00
#pragma once
2023-08-13 12:16:22 +08:00
#include <QWidget>
#include "sqlitehelper.h"
#include "buttonstruct.h"
#include <QVBoxLayout>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QSvgWidget>
#include <QPushButton>
#include "minibutton.h"
#include <QLabel>
#include "qminiblink.h"
#include "ui_applicationmanager.h"
#include <QTabBar>
#include <QCheckBox>
2023-08-18 19:09:55 +08:00
#include "config.h"
2023-08-13 12:16:22 +08:00
class ApplicationManagerPage;
struct Record2
{
/*QLabel *name;
QLabel *orig_name;
QLabel *dev;
QLabel *use_time;*/
2023-08-18 19:09:55 +08:00
QLabel* icon;
2023-08-13 12:16:22 +08:00
MiniButton* settings;
MiniButton * open;
2023-08-15 11:17:09 +08:00
QString op;
QString func;
QString name;
2023-08-13 12:16:22 +08:00
QString orig_name;
QString exe_file;
QCheckBox *check_box;
2023-08-18 19:09:55 +08:00
bool is_locked;
2023-08-13 12:16:22 +08:00
int sort;
QString url;
2023-08-18 19:09:55 +08:00
bool categories[CATEGORIES_NUM];
2023-08-13 12:16:22 +08:00
};
struct Title
{
QLabel* name;
QLabel* orig_name;
QLabel* dev;
QLabel* use_time;
QLabel* op;
};
class ApplicationManager : public QWidget
{
Q_OBJECT
signals:
2023-09-09 16:11:02 +08:00
void clickButton(QString orig_name, QString op, QString func, QString url, QString path, QString initial_position);
2023-08-13 12:16:22 +08:00
void refresh();
2023-08-18 19:09:55 +08:00
void refresh_tab();
2023-08-13 12:16:22 +08:00
public:
2023-08-21 15:10:19 +08:00
QList<MiniButton*> buttons;
2023-08-13 12:16:22 +08:00
ApplicationManager(QWidget *parent = nullptr);
~ApplicationManager();
2023-08-15 11:17:09 +08:00
QWidget* parent;
2023-08-13 12:16:22 +08:00
private:
QHash<QHBoxLayout*,ApplicationManagerPage*> pages;
QVBoxLayout* layout;
QTabBar *tab_bar;
QMap<int, ApplicationManagerPage*> map;
2023-08-18 19:09:55 +08:00
QMap<int,int> map2;
2023-08-13 12:16:22 +08:00
QHBoxLayout* layout_top;
QHBoxLayout* layout_bottom;
QMiniBlink* miniblink;
QList<Record> softwares;
QList<ButtonStruct> button_structs;
ApplicationManagerPage* application_manager_page_all;
Ui::ApplicationManagerClass ui;
2023-08-18 19:09:55 +08:00
QHBoxLayout* layout_top_left;
QHBoxLayout* layout_top_right;
2023-08-13 12:16:22 +08:00
SQLiteHelper sqlite_helper;
QVBoxLayout *layout_bottom_top;
QTableWidget *table;
Title title;
public slots:
void onclick1(QString op, QString func, QString path, QString url);
void onclick2(QString orig_name, QString op);
void tabChange(int index);
2023-08-15 20:12:36 +08:00
void onNumChange();
2023-08-13 12:16:22 +08:00
};