/** The default constructor
  *
  * \param parent The parent widget
  *
  */
RainbruRPG::Gui::QuarantineList::QuarantineList(QWidget* parent) 
  :QWidget(parent){

  setWindowTitle(tr("Quarantine"));
  setMinimumSize(500, 150);

 // The main layout
  QVBoxLayout* vb1=new QVBoxLayout();
  this->setLayout(vb1);

  // The tool bar
  QToolBar* toolBar=new QToolBar(this);
  //  toolBar->setToolButtonStyle(Qt::ToolButtonTextOnly);

  previewAct=new QAction(QIcon(":/images/preview.png"),
			 tr("Preview"), toolBar);
  approveAct=new QAction(QIcon(":/images/accept.png"),
			 tr("Approve"), toolBar);
  deleteAct=new QAction(QIcon(":/images/refuse.png"),
			tr("Delete"), toolBar);
  QAction* refreshAct=new QAction(tr("Refresh"), toolBar);

  QAction* helpAct=new QAction(tr("Help"), toolBar);

  previewAct->setEnabled(false);
  approveAct->setEnabled(false);
  deleteAct->setEnabled(false);

  toolBar->addAction(previewAct);
  toolBar->addAction(approveAct);
  toolBar->addAction(deleteAct);
  toolBar->addSeparator();
  toolBar->addAction(refreshAct);
  toolBar->addSeparator();
  toolBar->addAction(helpAct);

  vb1->addWidget(toolBar);

  labStillInTransfer=new 
    QLabel("At least one file is still in transfer, it's size and its type "
	   "could be wrong. You can click the refresh button to update "
	   "informations and look at FTP server (Ctrl+F) to see if the "
	   "transfer is finished.");
  labStillInTransfer->setVisible(false);
  labStillInTransfer->setWordWrap(true);
  vb1->addWidget(labStillInTransfer);

  // The list widget
  tree=new QTreeWidget();
  tree->setSortingEnabled(true);
  tree->setSelectionMode(QAbstractItemView::ExtendedSelection);
  QStringList header;
  header << tr("Filename") << tr("Size") << tr("Usage") << tr("Type");
  tree->setColumnCount(4);
  tree->setHeaderLabels(header);
  vb1->addWidget(tree);

  refresh();


  connect(tree, SIGNAL(itemSelectionChanged()), this,
	  SLOT(treeSelectionChanged()));

  connect(tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
	  this, SLOT(treeDoubleClicked(QTreeWidgetItem*,int)));

  connect(previewAct, SIGNAL(triggered()), this, SLOT(filePreview()));
  connect(approveAct, SIGNAL(triggered()), this, SLOT(fileAccept()));
  connect(deleteAct,  SIGNAL(triggered()), this, SLOT(fileRefused()));
  connect(refreshAct, SIGNAL(triggered()), this, SLOT(refresh()));
  connect(helpAct,    SIGNAL(triggered()), this, SLOT(showHelp()));

}
bool StateSerializationHelper::save( const QString& filename,
                                     const bool generatePreview )
{
    put_flog( LOG_INFO, "Saving session: '%s'",
              filename.toStdString().c_str( ));

    ContentWindowPtrs contentWindows = displayGroup_->getContentWindows();

    if( generatePreview )
    {
        const QSizeF& size = displayGroup_->getCoordinates().size();
        const QSize dimensions( (int)size.width(), (int)size.height( ));
        StatePreview filePreview( filename );
        filePreview.generateImage( dimensions, contentWindows );
        filePreview.saveToFile();
    }

    // serialize state
    std::ofstream ofs( filename.toStdString( ));
    if ( !ofs.good( ))
        return false;

    // brace this so destructor is called on archive before we use the stream
    {
        State state( displayGroup_ );
        boost::archive::xml_oarchive oa( ofs );
        oa << BOOST_SERIALIZATION_NVP( state );
    }
    ofs.close();

    return true;
}
Exemple #3
0
RenderWindow::RenderWindow(QWidget* parent, Qt::WindowFlags fl)
    : QMainWindow(parent, fl)
{
  setupUi(this);

  (void)statusBar();

  // signals and slots connections
  connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen()));
  connect(fileLoadFromDB, SIGNAL(activated()), this, SLOT(fileLoad()));
  connect(filePrintPreviewAction, SIGNAL(activated()), this, SLOT(filePreview()));
  connect(filePrintAction, SIGNAL(activated()), this, SLOT(filePrint()));
  connect(filePrintToPDFAction, SIGNAL(activated()), this, SLOT(filePrintToPDF()));
  connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit()));
  connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
  connect(_table, SIGNAL(itemSelectionChanged()), this, SLOT(sSelectionChanged()));
  connect(_list, SIGNAL(clicked()), this, SLOT(sList()));
}