QLayout *ZDLInterface::getButtonPane(){ QHBoxLayout *box = new QHBoxLayout(); QPushButton *btnExit = new QPushButton("Exit", this); btnZDL = new QPushButton("ZDL", this); QPushButton *btnMSet = new QPushButton("Multi Settings", this); btnEpr = new QPushButton(this); QPushButton *btnLaunch = new QPushButton("Launch", this); QMenu *context = new QMenu(btnZDL); QMenu *actions = new QMenu("Actions",context); QAction *showCommandline = actions->addAction("Show Command Line"); QAction *clearAllPWadsAction = actions->addAction("Clear PWAD list"); QAction *clearAllFieldsAction = actions->addAction("Clear all fields"); clearAllFieldsAction->setShortcut(QKeySequence::New); QAction *clearEverythingAction = actions->addAction("Clear everything"); actions->addSeparator(); #if !defined(NO_IMPORT) QAction *actImportCurrentConfig = actions->addAction("Import current config"); #endif QAction *clearCurrentGlobalConfig = actions->addAction("Clear current global config"); clearCurrentGlobalConfig->setEnabled(false); //QAction *newDMFlagger = actions->addAction("New DMFlag picker"); context->addMenu(actions); context->addSeparator(); QAction *loadZdlFileAction = context->addAction("Load .zdl"); loadZdlFileAction->setShortcut(QKeySequence::Open); QAction *saveZdlFileAction = context->addAction("Save .zdl"); saveZdlFileAction->setShortcut(QKeySequence::Save); context->addSeparator(); QAction *loadAction = context->addAction("Load .ini"); QAction *saveAction = context->addAction("Save .ini"); context->addSeparator(); QAction *aboutAction = context->addAction("About"); aboutAction->setShortcut(QKeySequence::HelpContents); connect(loadAction, SIGNAL(triggered()), this, SLOT(loadConfigFile())); connect(saveAction, SIGNAL(triggered()), this, SLOT(saveConfigFile())); connect(loadZdlFileAction, SIGNAL(triggered()), this, SLOT(loadZdlFile())); connect(saveZdlFileAction, SIGNAL(triggered()), this, SLOT(saveZdlFile())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClick())); #if !defined(NO_IMPORT) connect(actImportCurrentConfig, SIGNAL(triggered()), this, SLOT(importCurrentConfig())); #endif connect(clearAllPWadsAction, SIGNAL(triggered()), this, SLOT(clearAllPWads())); connect(clearAllFieldsAction, SIGNAL(triggered()), this, SLOT(clearAllFields())); connect(clearEverythingAction, SIGNAL(triggered()), this, SLOT(clearEverything())); connect(showCommandline, SIGNAL(triggered()),this,SLOT(showCommandline())); //connect(newDMFlagger, SIGNAL(triggered()),this,SLOT(showNewDMFlagger())); connect(btnExit, SIGNAL(clicked()), this, SLOT(exitzdl())); btnZDL->setMenu(context); int minBtnWidth = 50; btnExit->setMinimumWidth(minBtnWidth-15); btnZDL->setMinimumWidth(minBtnWidth-15); btnMSet->setMinimumWidth(minBtnWidth+30); btnEpr->setMinimumWidth(20); btnLaunch->setMinimumWidth(minBtnWidth); connect(btnLaunch, SIGNAL( clicked() ), this, SLOT(launch())); setContentsMargins(0,0,0,0); layout()->setContentsMargins(0,0,0,0); box->setSpacing(2); box->addWidget(btnExit); box->addWidget(btnZDL); box->addWidget(btnMSet); box->addWidget(btnEpr); box->addWidget(btnLaunch); box->setSpacing(1); connect(btnEpr, SIGNAL(clicked()), this, SLOT(mclick())); connect(btnMSet, SIGNAL(clicked()), this, SLOT(ampclick())); return box; }
okz::Ressource::~Ressource() { clearEverything(); }