示例#1
0
 public function downloaded()
 {
     $messagebox = new QMessageBox();
     if ($this->progressBar->value != $this->progressBar->maximum) {
         $this->hide();
         $messagebox->critical(0, tr('PQCreator error'), tr('Error download PQPack! :-( Please, try later...'), tr('Quit'));
         qApp::quit();
     }
     $this->textEdit->html .= "\n" . tr('Writing in file...');
     file_put_contents($this->tempFilePath, $this->downloader->downloadedData());
     $this->textEdit->html .= "\n" . sprintf(tr('Unzip data in `%s`'), $this->destinationDir);
     $zip = new ZipArchive();
     if ($zip->open($this->tempFilePath) === TRUE) {
         if (!mkdir($this->destinationDir)) {
             $this->hide();
             $messagebox->critical(0, tr('PQCreator error'), sprintf(tr('Error creating directory `%s`!'), $this->destinationDir), tr('Quit'));
             $zip->close();
             qApp::quit();
         }
         $zip->extractTo($this->destinationDir);
         $zip->close();
         $this->textEdit->html .= "\n<b>" . tr('Done!') . '</b>';
         $this->button->enabled = true;
         $messagebox->free();
         unset($messagebox);
         qApp::beep();
         return;
     }
     $this->hide();
     $messagebox->critical(0, tr('PQCreator error'), sprintf(tr('Error unzip PQPack package `%s`!'), $this->tempFilePath), tr('Quit'));
     qApp::quit();
 }
示例#2
0
 private function getPQPackDialog()
 {
     $messagebox = new QMessageBox();
     $answer = (int) $messagebox->question(0, tr('Package not found'), sprintf(tr("PQPack package not found in `%s` directory.\r\n" . "Without PQPack package you can't compile applications.\r\n\r\n" . "Download and install it?"), $this->pqpackPath), tr('Yes'), tr('No (Quit)'));
     if ($answer == 1) {
         qApp::quit();
     } else {
         $this->downloadPQPack();
     }
     if (!file_exists($this->pqpackPath)) {
         qApp::quit();
     }
 }
示例#3
0
 public function show()
 {
     parent::show();
     $desktop = new QDesktopWidget();
     $screenNumber = $desktop->screenNumber($this);
     $this->screenGeometry = $desktop->screenGeometry($screenNumber);
     $this->logoPaw1->move($this->x, -$this->screenGeometry["height"] / 2);
     $this->logoPaw1->show();
     $this->logoPaw2->move($this->x, -$this->screenGeometry["height"] / 2);
     $this->logoPaw2->show();
     $this->logoPaw3->move($this->x, -$this->screenGeometry["height"] / 2);
     $this->logoPaw3->show();
     $this->logoPaw4->move($this->x, -$this->screenGeometry["height"] / 2);
     $this->logoPaw4->show();
     $this->logoPaw5->move($this->x, -$this->screenGeometry["height"] / 2);
     $this->logoPaw5->show();
     $this->timer->start();
     $this->labelVersion->move($this->width / 2 - $this->labelVersion->width / 2, 210);
     $this->updaterResult = $this->updater->check($this->server);
     return qApp::exec();
 }