MainWindow::MainWindow(QWidget *parent): QWidget(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint) { active_index_ = -1; edit_index_ = -1; animation_id_ = 0; stats_ = new StatsDialog(); connect(this, SIGNAL(cycleReadySignal()), stats_, SLOT(cycleReady())); if (!which("firejail")) { QMessageBox::warning(this, tr("Firejail Tools"), tr("<br/><b>Firejail</b> sandbox not found.<br/><br/><br/>")); exit(1); } applications_init(); createTrayActions(); createLocalActions(); thread_ = new PidThread(); connect(thread_, SIGNAL(cycleReady()), this, SLOT(cycleReady())); setContextMenuPolicy(Qt::ActionsContextMenu); setToolTip(tr("Double click on an icon to open an application.\n" "Drag the launcher with the left mouse button.\n" "Use the right mouse button to open a context menu.")); setWindowTitle(tr("Firejail Tools")); }
/** * 初始化窗口管理器 * 就不写注释了 函数名写的已经很明白。。 **/ si_t window_manager_init() { if(0 != terminal_init()) { EGUI_PRINT_ERROR("failed to init terminal"); return -1; } if(0 != config_init()) { EGUI_PRINT_ERROR("failed to init config"); return -1; } if(0 != event_init("/dev/input/event9", "/dev/input/event10", 1000)) { EGUI_PRINT_ERROR("failed to init event module"); return -1; } if(0 != comm_init("/tmp/server")) { EGUI_PRINT_ERROR("failed to init comm module"); return -1; } if(0 != graph_init("/dev/fb0", 0, 0, 0, 0)) { EGUI_PRINT_ERROR("failed to init graph module"); return -1; } if(0 != cursor_init("CURSOR_SHAPE_X")) { EGUI_PRINT_ERROR("failed to init cursor"); return -1; } applications_init(3, 30); return 0; }