restorePage::restorePage(int conn) : Pages() { Dmsg1(dbglvl, "Construcing restorePage Instance connection %i\n", conn); m_conn = conn; QStringList titles; setupUi(this); m_name = tr("Restore Select"); pgInitialize(); QTreeWidgetItem* thisitem = mainWin->getFromHash(this); thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/restore.png"))); m_console->notify(m_conn, false); /* this should already be off */ connect(fileWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(fileDoubleClicked(QTreeWidgetItem *, int))); connect(directoryWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(directoryItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); connect(upButton, SIGNAL(pressed()), this, SLOT(upButtonPushed())); connect(markButton, SIGNAL(pressed()), this, SLOT(markButtonPushed())); connect(unmarkButton, SIGNAL(pressed()), this, SLOT(unmarkButtonPushed())); connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); fileWidget->setContextMenuPolicy(Qt::ActionsContextMenu); fileWidget->addAction(actionMark); fileWidget->addAction(actionUnMark); connect(actionMark, SIGNAL(triggered()), this, SLOT(markButtonPushed())); connect(actionUnMark, SIGNAL(triggered()), this, SLOT(unmarkButtonPushed())); setFont(m_console->get_font()); m_console->displayToPrompt(m_conn); titles << tr("Mark") << tr("File") << tr("Mode") << tr("User") << tr("Group") << tr("Size") << tr("Date"); fileWidget->setHeaderLabels(titles); get_cwd(); readSettings(); /* wait was entered from pre-restore * will exit, but will reenter in fillDirectory */ mainWin->waitExit(); fillDirectory(); dockPage(); setCurrent(); this->show(); if (mainWin->m_miscDebug) Pmsg0(000, "Leave restorePage\n"); }
/* * Setup all the combo boxes and display the dialog */ void runPage::init() { QDateTime dt; QDesktopWidget *desk = QApplication::desktop(); QRect scrn; m_name = tr("Run"); pgInitialize(); setupUi(this); /* Get screen rectangle */ scrn = desk->screenGeometry(desk->primaryScreen()); /* Position this window in the middle of the screen */ this->move((scrn.width()-this->width())/2, (scrn.height()-this->height())/2); QTreeWidgetItem* thisitem = mainWin->getFromHash(this); thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/run.png"))); m_conn = m_console->notifyOff(); m_console->beginNewCommand(m_conn); jobCombo->addItems(m_console->job_list); filesetCombo->addItems(m_console->fileset_list); levelCombo->addItems(m_console->level_list); clientCombo->addItems(m_console->client_list); poolCombo->addItems(m_console->pool_list); storageCombo->addItems(m_console->storage_list); dateTimeEdit->setDisplayFormat(mainWin->m_dtformat); dateTimeEdit->setDateTime(dt.currentDateTime()); /*printf("listing messages resources"); ***FIME *** foreach(QString mes, m_console->messages_list) { printf("%s\n", mes.toUtf8().data()); }*/ messagesCombo->addItems(m_console->messages_list); messagesCombo->setEnabled(false); job_name_change(0); connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int))); connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); // find a way to place the new window at the cursor position // or in the middle of the page // dockPage(); setCurrent(); }
/* * Setup all the combo boxes and display the dialog */ runCmdPage::runCmdPage(int conn) : Pages() { m_name = tr("Restore Run"); pgInitialize(); setupUi(this); QTreeWidgetItem* thisitem = mainWin->getFromHash(this); thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/restore.png"))); m_conn = conn; m_console->notify(conn, false); fill(); m_console->discardToPrompt(m_conn); connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); //dockPage(); setCurrent(); this->show(); }
/* * moved the constructor code here for the overload. */ void labelPage::showPage(QString &defString) { m_name = "Label"; pgInitialize(); setupUi(this); m_conn = m_console->notifyOff(); QTreeWidgetItem* thisitem = mainWin->getFromHash(this); thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png"))); storageCombo->addItems(m_console->storage_list); int index = storageCombo->findText(defString, Qt::MatchExactly); if (index != -1) { storageCombo->setCurrentIndex(index); } poolCombo->addItems(m_console->pool_list); connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); connect(automountOnButton, SIGNAL(pressed()), this, SLOT(automountOnButtonPushed())); connect(automountOffButton, SIGNAL(pressed()), this, SLOT(automountOffButtonPushed())); dockPage(); setCurrent(); this->show(); }
void USKTimePacket::on_pushButtonOK_clicked() { emit okButtonPushed(); }