UserWidget::UserWidget(QWidget* parent) : QTabWidget(parent), ui(new Ui::UserWidget){ ui->setupUi(this); updatingfavs = false; if(parent!=0){ parent->setMouseTracking(true); } this->setMouseTracking(true); sysapps = LSession::handle()->applicationMenu()->currentAppHash(); //get the raw info //Connect the signals/slots connect(ui->tool_desktopsettings, SIGNAL(clicked()), this, SLOT(openDeskSettings()) ); connect(ui->tool_config_screensaver, SIGNAL(clicked()), this, SLOT(openScreenSaverConfig()) ); connect(ui->tool_config_screensettings, SIGNAL(clicked()), this, SLOT(openScreenConfig()) ); connect(ui->tool_fav_apps, SIGNAL(clicked()), this, SLOT(FavChanged()) ); connect(ui->tool_fav_files, SIGNAL(clicked()), this, SLOT(FavChanged()) ); connect(ui->tool_fav_dirs, SIGNAL(clicked()), this, SLOT(FavChanged()) ); connect(ui->combo_app_cats, SIGNAL(currentIndexChanged(int)), this, SLOT(updateApps()) ); connect(ui->tool_home_gohome, SIGNAL(clicked()), this, SLOT(slotGoHome()) ); connect(ui->tool_home_browse, SIGNAL(clicked()), this, SLOT(slotOpenDir()) ); connect(ui->tool_home_search, SIGNAL(clicked()), this, SLOT(slotOpenSearch()) ); connect(ui->tool_config_about, SIGNAL(clicked()), this, SLOT(openLuminaInfo()) ); //Setup the special buttons connect(ui->tool_app_store, SIGNAL(clicked()), this, SLOT(openStore()) ); connect(ui->tool_controlpanel, SIGNAL(clicked()), this, SLOT(openControlPanel()) ); connect(ui->tool_qtconfig, SIGNAL(clicked()), this, SLOT(openQtConfig()) ); lastUpdate = QDateTime(); //make sure it refreshes connect(LSession::handle()->applicationMenu(), SIGNAL(AppMenuUpdated()), this, SLOT(UpdateMenu()) ); connect(QApplication::instance(), SIGNAL(DesktopFilesChanged()), this, SLOT(updateFavItems()) ); QTimer::singleShot(10,this, SLOT(UpdateAll())); //make sure to load this once after initialization }
StartMenu::StartMenu(QWidget *parent) : QWidget(parent), ui(new Ui::StartMenu){ ui->setupUi(this); //load the designer file sysapps = LSession::handle()->applicationMenu()->currentAppHash(); connect(LSession::handle()->applicationMenu(), SIGNAL(AppMenuUpdated()), this, SLOT(UpdateApps()) ); UpdateAll(); QTimer::singleShot(10, this,SLOT(UpdateApps())); QTimer::singleShot(10, this, SLOT(UpdateFavs())); }
StartMenu::StartMenu(QWidget *parent) : QWidget(parent), ui(new Ui::StartMenu){ ui->setupUi(this); //load the designer file this->setMouseTracking(true); searchTimer = new QTimer(this); searchTimer->setInterval(300); //~1/3 second searchTimer->setSingleShot(true); connect(searchTimer, SIGNAL(timeout()), this, SLOT(startSearch()) ); sysapps = LSession::handle()->applicationMenu()->currentAppHash(); connect(LSession::handle()->applicationMenu(), SIGNAL(AppMenuUpdated()), this, SLOT(UpdateApps()) ); //Need to load the last used setting of the application list QString state = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/systemstart/showcategories", "partial").toString(); if(state=="partial"){ui->check_apps_showcats->setCheckState(Qt::PartiallyChecked); } else if(state=="true"){ ui->check_apps_showcats->setCheckState(Qt::Checked); } else{ ui->check_apps_showcats->setCheckState(Qt::Unchecked); } connect(ui->check_apps_showcats, SIGNAL(stateChanged(int)), this, SLOT(catViewChanged()) ); UpdateAll(); QTimer::singleShot(10, this,SLOT(UpdateApps())); QTimer::singleShot(10, this, SLOT(UpdateFavs())); }