改了几个bug,提交
This commit is contained in:
@ -24,7 +24,7 @@ ApplicationManager::ApplicationManager(QWidget *parent)
|
||||
layout_top->setMargin(5);
|
||||
layout_bottom = new QHBoxLayout(this);
|
||||
QList<Categrory> categrories;
|
||||
sqlite_helper.get_category(categrories,false);
|
||||
sqlite_helper.get_category(categrories,false,true);
|
||||
sqlite_helper.get_buttons(button_structs);
|
||||
for (auto button_struct : button_structs)
|
||||
{
|
||||
@ -45,13 +45,13 @@ ApplicationManager::ApplicationManager(QWidget *parent)
|
||||
//ui.tabWidget->setMovable(false);
|
||||
//ui.tabWidget->setDocumentMode(false);
|
||||
//ui.tabWidget->setCurrentIndex(0);
|
||||
|
||||
tab_bar = new QTabBar(this);
|
||||
tab_bar->addTab(QString::fromLocal8Bit("ȫ<EFBFBD><EFBFBD>"));
|
||||
layout_bottom_top = new QVBoxLayout;
|
||||
|
||||
for(int i=2;i<=8;i++)
|
||||
for(int i=1;i<=8;i++)
|
||||
{
|
||||
tab_bar->addTab(categrories[i - 2].name);
|
||||
tab_bar->addTab(categrories[i - 1].name + "(" + QString::number(categrories[i - 1].total) + ")");
|
||||
}
|
||||
layout_bottom_top->addWidget(tab_bar, 1);
|
||||
application_manager_page_all = new ApplicationManagerPage(ALL, this, this);
|
||||
@ -66,6 +66,7 @@ ApplicationManager::ApplicationManager(QWidget *parent)
|
||||
application_manager_page->setHidden(true);
|
||||
map.insert(i, application_manager_page);
|
||||
}
|
||||
connect(this,&ApplicationManager::refresh,this,&ApplicationManager::onNumChange);
|
||||
tab_bar->setCurrentIndex(0);
|
||||
connect(tab_bar, &QTabBar::currentChanged, this, &ApplicationManager::tabChange);
|
||||
QString style = "QTabBar::tab{height:80;width:150; border:2px} QTabBar::tab:hover{ border:2px;height:80;width:150;color:";
|
||||
@ -210,6 +211,7 @@ void ApplicationManager::onclick1(QString op, QString func, QString path, QStrin
|
||||
{
|
||||
QMessageBox::critical(this, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD>ֻ<EFBFBD>ȫ<EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>"));
|
||||
}
|
||||
emit refresh();
|
||||
}else if(func=="app_category")
|
||||
{
|
||||
AddCategory add_category;
|
||||
@ -225,6 +227,8 @@ void ApplicationManager::onclick1(QString op, QString func, QString path, QStrin
|
||||
{
|
||||
QMessageBox::critical(this, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>"));
|
||||
}
|
||||
emit refresh();
|
||||
|
||||
}
|
||||
}
|
||||
}else if(op=="soft")
|
||||
@ -251,7 +255,7 @@ void ApplicationManager::onclick2(QString orig_name, QString op)
|
||||
}
|
||||
else {
|
||||
emit changeUrl(application_manager_page_all->rows[orig_name].url);
|
||||
WinExec(application_manager_page_all->rows[orig_name].exe_file.toStdString().c_str(), SW_SHOW);
|
||||
WinExec((QApplication::applicationDirPath()+application_manager_page_all->rows[orig_name].exe_file).toStdString().c_str(), SW_SHOW);
|
||||
}
|
||||
}
|
||||
else if (op == "settings")
|
||||
@ -265,10 +269,16 @@ void ApplicationManager::onclick2(QString orig_name, QString op)
|
||||
{
|
||||
QMessageBox::critical(this, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), QString::fromLocal8Bit("<EFBFBD>༭ʧ<EFBFBD><EFBFBD>"));
|
||||
}
|
||||
emit refresh();
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
emit application_manager_page_all->onclick3(application_manager_page_all->rows[orig_name].op, application_manager_page_all->rows[orig_name].func,application_manager_page_all->rows[orig_name].exe_file,application_manager_page_all->rows[orig_name].url);
|
||||
emit application_manager_page_all->onclick3(application_manager_page_all->rows[orig_name].op,
|
||||
application_manager_page_all->rows[orig_name].func,
|
||||
application_manager_page_all->rows[orig_name].url,
|
||||
application_manager_page_all->rows[orig_name].exe_file
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,3 +291,11 @@ void ApplicationManager::tabChange(int index)
|
||||
}
|
||||
map[index + 1]->setHidden(false);
|
||||
}
|
||||
|
||||
void ApplicationManager::onNumChange() {
|
||||
QList<Categrory> categrories;
|
||||
sqlite_helper.get_category(categrories, false, true);
|
||||
for (int i = 0; i < categrories.size(); i++) {
|
||||
tab_bar->setTabText(i, categrories[i].name + "(" + QString::number(categrories[i].total) + ")");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user