Пример #1
0
int KeyBoard::close()
{
    this->hide();
    this->editbox->setText("");
    emit signal_close(this->input);
    return OK;
}
Пример #2
0
void KeyBoard::slot_btn_ok()
{
    LOG_API();

    LOG_INFO("input==[%s] \n", qPrintable(input));
    this->close();
    emit signal_close(input);
}
Пример #3
0
void MenuConfig::createMenu()
{
    if(menu == NULL)
    {
        menu = new MenuBase(true);
        QObject::connect(menu, SIGNAL(signal_close()), Frame::mainEntryThread, SLOT(wakeUp()));
    }
}
Пример #4
0
static void
signal_cb(uv_signal_t *handle, int signum) {
    if (signum == SIGINT || signum == SIGQUIT) {
        char *name = signum == SIGINT ? "SIGINT" : "SIGQUIT";
        logger_log(LOG_INFO, "Received %s, scheduling shutdown...", name);

        signal_close();

        struct tundev *tun = handle->data;
        tun_stop(tun);
    }
}
Пример #5
0
//槽函数--slot_btnclick
void TitleBar::slot_btnclick()
{
    QToolButton *pBtn = (QToolButton*)(sender());
    if(pBtn==mp_btn_min)
    {
        emit signal_min();
    }

    if(pBtn==mp_btn_close)
    {
        emit signal_close();
    }
}
Пример #6
0
    TheDummyAssistant(openfluid::machine::SimulationBlob* SimBlob) :
      Gtk::Assistant(), mp_SimBlob(SimBlob), mp_TestUnitsColl(0), m_Applied(false)
    {
      set_title("Dummy assistant");
      set_default_size(400, 300);
      set_modal(true);

      Gtk::Label* Label1 = Gtk::manage(new Gtk::Label(
          "I'm a Dummy assistant for tests"));
      append_page(*Label1);
      set_page_title(*Label1, "Page 1/2");
      set_page_type(*Label1, Gtk::ASSISTANT_PAGE_INTRO);
      set_page_complete(*Label1, true);

      Gtk::Label* Label2 = Gtk::manage(new Gtk::Label());

      if (!mp_SimBlob)
      {
        Label2->set_text("Nb of units in TestUnits class: no CoreRepository\n"
          "Nothing to do");

        signal_apply().connect(sigc::mem_fun(*this, &Gtk::Assistant::hide));
      }
      else
      {
        unsigned int Size = 0;

        mp_TestUnitsColl = mp_SimBlob->getCoreRepository().getUnits("TestUnits");

        if (mp_TestUnitsColl)
          Size = mp_TestUnitsColl->getList()->size();

        Label2->set_text(Glib::ustring::compose(
            "Nb of units in TestUnits class: %1\n"
              "Clicking ok will add a Unit of class \"TestUnits\"", Size));

        signal_apply().connect(
            sigc::mem_fun(*this, &TheDummyAssistant::m_apply));
      }

      append_page(*Label2);
      set_page_title(*Label2, "Page 2/2");
      set_page_type(*Label2, Gtk::ASSISTANT_PAGE_CONFIRM);
      set_page_complete(*Label2, true);

      signal_cancel().connect(sigc::mem_fun(*this, &Gtk::Assistant::hide));
      signal_close().connect(sigc::mem_fun(*this, &Gtk::Assistant::hide));

      show_all_children();
    }
Пример #7
0
//槽函数--slot_btnclick
void TitleBar::slot_btnclick()
{
    QToolButton *pBtn = (QToolButton*)(sender());
    if(pBtn==m_pBtnMin)
    {
        emit signal_min();
    }
    if(pBtn==m_pBtnMax)
    {
        emit signal_maxrestore();
    }
    if(pBtn==m_pBtnClose)
    {
        emit signal_close();
    }
}
Пример #8
0
void admf::closeEvent(QCloseEvent *event)
{

    emit signal_close();
    event->accept();
}
Пример #9
0
void MainFrame::connectEvent()
{
    connect(this->m_pTitleBar, SIGNAL(signal_close()), this, SLOT(close()));
}
Пример #10
0
void FreeWindow::Close()
{
  signal_close(*this);
  delete this;
}
Пример #11
0
 /** When timewait timer times out */
 void timewait_timeout()
 { signal_close(); }
Пример #12
0
GenericAssistant::GenericAssistant
(
	std::string assistantTitle,
	std::vector<std::string> assistantLabels,
	std::vector<std::string> assistantPlaceholders,
	bool assistantModalMode
)
{
	set_title(assistantTitle);
	set_default_size (323, 200);
	set_modal(assistantModalMode);
	
	container = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL,(2*assistantLabels.size())-1));
	
	for (unsigned int i=0;i<assistantLabels.size();i++) 
	{
		
		Gtk::Box * b = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL,3));
		Gtk::Label * l = manage(new Gtk::Label(assistantLabels.at(i)));
		b->add(*l);
		Gtk::AspectFrame * af = manage(new Gtk::AspectFrame());
		b->add(*af);
		// entry and placeholder....
		Gtk::Entry * e = manage(new Gtk::Entry());
		e->set_placeholder_text(assistantPlaceholders.at(i).c_str());
		b->add(*e);
		// record the entry's content
		Entry.push_back(e);
		// show_children
		b->show_all_children();
		// add
		container->add(*b);
		if (assistantLabels.size()-1 != i) 
		{
			Gtk::AspectFrame * af = manage(new Gtk::AspectFrame());
			container->add(*af);	
		} 
	}
	container->show_all_children();
	// set assistant pages and config it
	append_page(*container);
	set_page_complete(*container, true);	
	set_page_type(*container, Gtk::ASSISTANT_PAGE_CONFIRM);
	show_all_children();
	// close or cancel the assistant
	signal_cancel().connect
	(
		sigc::mem_fun
		(
			*this,
			&GenericAssistant::on_assistant_cancel
		)
	);
	signal_close().connect
	(
		sigc::mem_fun
		(
			*this,
			&GenericAssistant::on_assistant_close
		)
	);

}
Пример #13
0
MF::MF(QSplashScreen *psplash, QWidget *parent) : QMainWindow(parent),settings("NNCSM","Journal")


{
//load settings


 setupUi(this);
 plf = new LF;
 pdst = new dSt(this);


    settings.beginGroup("/Settings");
         Path = settings.value("/Path","./").toString();
            splash =  settings.value("/Splash",true).toBool();
            font.fromString(settings.value("/Font",font.toString()).toString());
     settings.endGroup();
     main_tblv->setFont(font);
     change_tblv->setFont(font);
     pdst->set_Pash(&Path);
     pdst->set_splash(&splash);
if(splash) psplash->show();
ldb = QSqlDatabase::database();

ldb.setDatabaseName(Path + "/db.sqlite");
if(!ldb.open())
{
    this->close();
}
QTime time;
time.start();
for(int i = 0; i < 100;)
{
    if (time.elapsed() > 40)
    {
        time.start();
        ++i;
    }
    psplash->showMessage(tr("Loading modules:") + QString::number(i) + "%",
                               Qt::AlignCenter | Qt::AlignBottom  , Qt::white);
}
//Login

psplash->finish(plf);

plf->show();
//Login End


    this->move(QApplication::desktop()->availableGeometry().center() - this->rect().center());

    sqtmodel.setTable("main");
    sqtmodel.select();

    sqtmodel.setHeaderData(1,Qt::Horizontal,QObject::tr("id"));
    sqtmodel.setHeaderData(2,Qt::Horizontal,QObject::tr("Date"));
    sqtmodel.setHeaderData(3,Qt::Horizontal,QObject::tr("Reg_Num"));
    sqtmodel.setHeaderData(4,Qt::Horizontal,QObject::tr("Obozn_Tu"));
    sqtmodel.setHeaderData(5,Qt::Horizontal,QObject::tr("Naim_Tu"));
    sqtmodel.setHeaderData(6,Qt::Horizontal,QObject::tr("Razrab_Tu"));
    sqtmodel.setHeaderData(8,Qt::Horizontal,QObject::tr("Prim"));


    main_tblv->setModel(&sqtmodel); // model for main

    sqqmodel.setTable("change");
    sqqmodel.setHeaderData(1,Qt::Horizontal,QObject::tr("date"));
    sqqmodel.setHeaderData(2,Qt::Horizontal,QObject::tr("number"));


    change_tblv->setModel(&sqqmodel); // model for changes
//proxy model for search
     prxmod.setSourceModel(&sqtmodel); //model fo search
     prxmod.setFilterKeyColumn(-1); //search for all 0 for 1
//delete unuse row
    main_tblv->hideColumn(0);
    main_tblv->hideColumn(7);
    main_tblv->hideColumn(9);

    change_tblv->hideColumn(0);
    change_tblv->hideColumn(3);
    change_tblv->hideColumn(4);
    change_tblv->hideColumn(5);
//end.
     main_tblv->setModel(&prxmod); //install proxy model

     main_tblv->resizeRowsToContents();
     main_tblv->resizeColumnsToContents();

// form

padduser = new admf();
pmAdd = new mAdd();
pchf = new addChForm();

//conections
////////////////////////////////////adm form
QObject::connect(padduser,SIGNAL(signal_close()),this,SLOT(close())); // call destructor
//end adm form

//////////////////////////////////login form
QObject::connect(plf,SIGNAL(signal_admin()),padduser,SLOT(show())); // if admin login show user add form
QObject::connect(plf,SIGNAL(signal_user()),this,SLOT(show())); // if user login show main form
QObject::connect(plf,SIGNAL(signal_close()),this,SLOT(close())); //call destruktor
//end login form

////////////////////////////////add main form
QObject::connect(pmAdd,SIGNAL(signal_hidForm()),this,SLOT(slot_en_main())); // enable form refresh main_tblv
//end add main form


//////////////////////////////add ch form
QObject::connect(pchf,SIGNAL(signal_hidForm()),this,SLOT(slot_en_main())); // enable main form
//end add ch form

//////////////////////////////main form

QObject::connect(main_tblv,SIGNAL(clicked(const QModelIndex&)),this,SLOT(slot_change_case(const QModelIndex&))); // case change
//search
QObject::connect(bSearch,SIGNAL(clicked()),this,SLOT(slot_search())); // search
//add main
QObject::connect(b_add,SIGNAL(clicked()),this,SLOT(slot_add())); // Call slot that transmits a signal form to be added.
QObject::connect(this,SIGNAL(signal_clicked_add()),pmAdd,SLOT(slot_add())); //method call form to add
//edit main
QObject::connect(b_edit,SIGNAL(clicked()),this,SLOT(slot_edit_main()));  // edit button
QObject::connect(this,SIGNAL(signal_clicked_edit(const QModelIndex&)),pmAdd,SLOT(slot_changes(const QModelIndex&))); // method call from to change
// del main
QObject::connect(b_delete,SIGNAL(clicked()),this,SLOT(slot_delete())); //delete button call slot for emit signals
QObject::connect(this,SIGNAL(signal_clicked_delete(const QModelIndex&)),this,SLOT(slot_delete_main(const QModelIndex&))); // remove row from main_tblv
//add ch
QObject::connect(b_addChange,SIGNAL(clicked()),this,SLOT(slot_ch_add()));// generate signal for add ch
QObject::connect(this,SIGNAL(signal_clicked_ch_add(const QModelIndex&)),pchf,SLOT(slot_add(const QModelIndex&))); //add change
// edit ch
QObject::connect(b_editChanges,SIGNAL(clicked()),this,SLOT(slot_ch_changes())); //generate signal for ed ch
QObject::connect(this,SIGNAL(signal_clicked_ch_chenges(const QModelIndex&)),pchf,SLOT(slot_edit(const QModelIndex&))); // call edit changes
//del ch
QObject::connect(b_deleteChanges,SIGNAL(clicked()),this,SLOT(slot_ch_delete())); //generate signal for delete ch
QObject::connect(this,SIGNAL(signal_clicked_ch_delete(const QModelIndex&)),this,SLOT(slot_delete_change(const QModelIndex&))); //delete ch
//end main form

//connect menu
QObject::connect(actionQuit,SIGNAL(triggered()),this,SLOT(close())); // quit
QObject::connect(action_Font,SIGNAL(triggered()),this,SLOT(slot_set_font())); // Set Font
QObject::connect(action_Main_Settings,SIGNAL(triggered()),this,SLOT(slot_settings()));  //settings
QObject::connect(action_About_Developer,SIGNAL(triggered()),this,SLOT(slot_about())); //about
QObject::connect(action_About_QT,SIGNAL(triggered()),this,SLOT(slot_aboutQt())); //aboutQt
QObject::connect(action_Help,SIGNAL(triggered()),this,SLOT(slot_help())); // about programm
//end connect menu
/////////////////////////connection for save settings

}