Exemple #1
0
MainWindow::MainWindow(QWidget* parent) :
    QMainWindow(parent),
    ui_(new Ui::MainWindow),
    data_file_name_(DATA_FILE_PATH),
    password_(QString()),
    money_(Money())
{
    ui_->setupUi(this);

    connect(ui_->ActionChangePass, SIGNAL(triggered()), this, SLOT(changePassword()));
    connect(ui_->ActionSave,       SIGNAL(triggered()), this, SLOT(saveData()));
    connect(ui_->ActionExit,       SIGNAL(triggered()), this, SLOT(requestExit()));
    connect(ui_->ActionUpdate,     SIGNAL(triggered()), this, SLOT(updateState()));
    connect(ui_->AddEventButton,   SIGNAL(clicked()),   this, SLOT(addEvent()));
    connect(ui_->AddFriendButton,  SIGNAL(clicked()),   this, SLOT(addFriend()));
    connect(ui_->DelEventsButton,  SIGNAL(clicked()),   this, SLOT(delEvents()));
    connect(ui_->DelFriendsButton, SIGNAL(clicked()),   this, SLOT(delFriends()));

    // financial events
    connect(ui_->CurRubNalEdit,    SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->CurEurNalEdit,    SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->CurUsdNalEdit,    SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->CurRubElecEdit,   SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->CurEurElecEdit,   SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->CurUsdElecEdit,   SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->OldRubNalEdit,    SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->OldEurNalEdit,    SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->OldUsdNalEdit,    SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->OldRubElecEdit,   SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->OldEurElecEdit,   SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));
    connect(ui_->OldUsdElecEdit,   SIGNAL(textChanged(QString)), this, SLOT(changeMoneyDiff()));

    loadData();
    updateState();
}
Exemple #2
0
void Scheduler::killTask(Task& task) {

	if (task.isMarkedForKill())
		return;

	task.markForKill();

	// all open events must be disabled
	delEvents(task);

	// then the task is scheduled to be deleted
//	killTaskList.push_back(&task);

	// until the task is completely deleted, this is a zombie
}