Пример #1
0
void PreferencesDialog::InitialisePreferenceDialog( HWND hDlg )
{
	if ( NULL == _hPreferences )
	{
		_hPreferences = hDlg;
	}
	RefreshPreferences();
}
GuiActivityInventorySheet::GuiActivityInventorySheet(QWidget *parent, PomotuxDatabase& database)
    : QMainWindow(parent), ui(new Ui::GuiActivityInventorySheet)
{
    mpDatabase = &database;
    wAbout = new AboutWindow(this);

    ui->setupUi(this);

    try {
        mpAis = new ActivityInventorySheet(select<ActivityInventorySheet>(*(mpDatabase), ActivityInventorySheet::Id == 1).one());
    } catch (NotFound e) {
        mpAis = new ActivityInventorySheet(*(mpDatabase));
        mpAis->update();
    }

    this->wTTS = new TodoTodaySheetGui(this,*(this->mpDatabase));
    this->wPreferences = new PreferencesDialog (this,*(this->mpDatabase));
    this->wModifyActivity = new ModifyAnActivity(this,*(this->mpDatabase),mRow);
    this->wInsertActivity = new InsertNewActivity(this,*(this->mpDatabase));

    // connection of signal required to refresh preferences
    connect(this->wPreferences,SIGNAL(DatabaseUpdated()),this->wTTS,SLOT(RefreshPreferences()));

    // connection of signals for refreshing tables
    connect(this->wTTS,SIGNAL(DatabaseUpdated()),this,SLOT(RefreshTable()));
    connect(this,SIGNAL(DatabaseUpdated()),this->wTTS,SLOT(RefreshTable()));
    connect(this,SIGNAL(DatabaseUpdated()),this,SLOT(RefreshTable()));
    connect(this->wInsertActivity,SIGNAL(DatabaseUpdated()),this,SLOT(RefreshTable()));
    connect(this->wTTS->getInsertActivity(),SIGNAL(DatabaseUpdated()),this,SLOT(RefreshTable()));
    connect(this->wModifyActivity,SIGNAL(DatabaseUpdated()),this,SLOT(RefreshTable()));
    connect(this->wModifyActivity,SIGNAL(DatabaseUpdated()),this->wTTS,SLOT(RefreshTable()));

    // connection of menu bar actions
    connect(this->ui->actionExit,SIGNAL(triggered()),this,SLOT(close()));
    connect(this->ui->actionPreferences,SIGNAL(triggered()),this,SLOT(Preferences()));
    connect(this->ui->actionAbout,SIGNAL(triggered()),this,SLOT(About()));

    emit DatabaseUpdated();
    this->RefreshTable();
    this->ui->ais->setColumnWidth(0, 0);
    this->ui->ais->setColumnWidth(1, 440);
}
Пример #3
0
void PreferencesDialog::Show(  )
{
	RefreshPreferences();
	::ShowWindow( _hPreferences, SW_SHOW );
}