void CreateGroupGUI::on_buttonBox_accepted()
{
    //retrieve the group details
    QString fullName = ui->fullNameInput->text();

    QString description = ui->descriptionInput->document()->toPlainText();

    //copy image to the server
    QString serverPath = AccountController::PATH + "picturesDir/" + fullName + "GroupPic";
    QFile::copy(photoPath, serverPath);

    Group* currentGroup = accountController->getUser()->controlGroup()->createNewGroup(fullName, serverPath, description);

    //add group members
    QModelIndexList memberList = ui->friendList->selectionModel()->selectedIndexes();
    for (int i = 0; i < memberList.size(); i++) {
        QString memberUsername = memberList.at(i).data().toString();
        currentGroup->addMember(memberUsername);
    }

    //refresh and clear fields
    clearAllFields();
    updateFriendList();

    groupGUI->switchGroupViews(GroupGUI::GroupGUIType::ShowAllGroups);
}
Exemple #2
0
void  Singledata::newData()
{

     ID = -1;
     clearAllFields();

}
bool Settings::read()
{
   SimXMLDocument *document = new SimXMLDocument();
   document->registerObject();

   bool success = true;
   if(document->loadFile(mFile.c_str()))
   {
      clearAllFields();

      // set our base element
      if(document->pushFirstChildElement(getName()))
      {
         setModStaticFields(false);
         readLayer(document);
         setModStaticFields(true);
      }
      else
         success = false;
   }
   else
      success = false;

   document->deleteObject();

   return success;
}
Exemple #4
0
void Singledata::fillEntries(int i)
{
     load(i);
     printlog("fill Entries for " + toString(i) );
     clearAllFields();
     Gtk::TreeIter _newIter ;
     iter = _newIter ;

     typedef map<string,dataEntry>::const_iterator iM ;
     dataEntries = oEntries.Entries;

     for(iM i = dataEntries.begin(); i != dataEntries.end(); i++) {
          _entry = i->second ;
          printlog( "_entry " +  _entry.get_nameOfEntry() + " verify_type = " + _entry.get_verifyTypeOfEntry() +" type = " + _entry.get_typeOfEntry() ) ;
          // cout << "entry Value = " <<  firstRecord.row_string[_entry.get_nameOfSql()] << endl ;
          if(_entry.get_verifyTypeOfEntry() == "string") {
               string _Value = firstRecord.row_string[_entry.get_nameOfSql()];

               if(_Value == "NONE") _Value = "";
               //cout << "stringValue = " << _Value << endl ;
               glx.setText(_entry,_Value);

          }
         
          else if (_entry.get_verifyTypeOfEntry() == "int") {
               int _Value = firstRecord.row_int[_entry.get_nameOfSql()];
               //cout << "intValue = " << _Value << endl ;
              
               
                    glx.setText(_entry,_Value);
               
          }
          else if (_entry.get_verifyTypeOfEntry() == "float") {
               float _Value = firstRecord.row_float[_entry.get_nameOfSql()];
               //cout << "floatValue = " << _Value << endl ;
              
               
               glx.setText(_entry,toString(_Value) );
               
          }
          else if (_entry.get_verifyTypeOfEntry() == "datetime") {
               string _Value = firstRecord.row_string[_entry.get_nameOfSql()];
               //cout << "datetime Value = " << _Value << endl ;
              
               
                    glx.setText(_entry,_Value);
               
          }


     }
     // printlog("now fill other and extra entries");
     fillOtherEntries();
     fillExtraEntries();
}
CreateGroupGUI::CreateGroupGUI(AccountController *inputAccountController, GroupGUI* groupGUI, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::CreateGroupGUI)
{
    // set up the pointers
    ui->setupUi(this);
    this->groupGUI = groupGUI;
    this->accountController = inputAccountController;

    // refresh the view
    clearAllFields();
    updateFriendList();
}
void CreateGroupGUI::on_buttonBox_rejected()
{
    clearAllFields();
    updateFriendList();
    groupGUI->switchGroupViews(GroupGUI::GroupGUIType::ShowAllGroups);
}
Exemple #7
0
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;
}
Exemple #8
0
void MainWindow::importDoxy()
{   
   while (true) {

      QString fname = QFileDialog::getOpenFileName(this, tr("Open Doxygen project file"), m_settings.pathPrior);

      if (fname.isEmpty()) {
         csError(tr("File Open"), tr("No file name was provided"));
         break;
      }

      QFile file(fname);
      if (! file.open(QIODevice::ReadOnly)) {
         csError(tr("Error Opening: ") + fname, tr("Unable to open: ") + file.error());
         break;
      }

      QFileInfo fi(file);
      QString importPath = fi.absolutePath() + QDir::separator() + fi.baseName() + ".json";

      // read file
      QByteArray data;

      data = file.readAll();
      file.close();

      // strip comments
      int posBeg;
      int posEnd;

      while (true) {
         posBeg = data.indexOf("#");

         if (posBeg == -1) {
            break;
         }

         posEnd = data.indexOf("\n",posBeg);
         data.remove(posBeg, posEnd-posBeg);
      }

      // verify a few fields to ensure this is an old project file
      if (! data.contains("PROJECT_NAME") || ! data.contains("OUTPUT_DIRECTORY"))  {
         csError(tr("Convert Project File"), tr("Doxygen project file is missing required information, Convert aborted"));
         break;
      }

      // ** save as new project file
      fname = QFileDialog::getSaveFileName(this, tr("Save as DoxyPress project file"), importPath,
                                           tr("Json Files (*.json)"));

      if (fname.isEmpty()) {
         csError(tr("Convert Project File"), tr("No DoxyPress file name was provided, Convert aborted"));
         break;

      } else {
         QMessageBox quest;
         quest.setWindowTitle(tr("Convert Doxygen Project"));
         quest.setWindowIcon(QIcon("://resources/doxypress.png"));

         quest.setText( tr("If a layout or css file was specified in your project file, please refer to the DoxyPress documentation "
                           "regarding 'Converting to DoxyPress' for additional information. Continue?"));

         quest.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
         quest.setDefaultButton(QMessageBox::No);

         int retval = quest.exec();

         if (retval == QMessageBox::Yes) {            
            m_curFile = fname;
            m_settings.pathPrior = this->pathName(fname);

            clearAllFields();
            convertDoxy(data);

            saveDoxy_Internal();

            json_Write(PATH_PRIOR);

            if (! m_rf_List.contains(m_curFile)) {
               rf_Update();
            }
         }

      }

      // all done, everything is fine
      break;
   }
}