Back to index

fet  5.18.0
fetmainform.h
Go to the documentation of this file.
00001 //
00002 //
00003 // Description: This file is part of FET
00004 //
00005 //
00006 // Author: Lalescu Liviu <Please see http://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address)>
00007 // Copyright (C) 2003 Liviu Lalescu <http://lalescu.ro/liviu/>
00008 //
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef FETMAINFORM_H
00019 #define FETMAINFORM_H
00020 
00021 #include "ui_fetmainform_template.h"
00022 
00023 #include <QMutex>
00024 #include <QThread>
00025 
00026 #include <QtGui>
00027 #include <QResizeEvent>
00028 #include <QCloseEvent>
00029 
00030 #include <QStringList>
00031 
00032 #include <QAction>
00033 
00034 class QNetworkAccessManager;
00035 class QNetworkReply;
00036 
00037 extern const QString COMPANY;
00038 extern const QString PROGRAM;
00039 
00040 const int MAX_RECENT_FILES=10;
00041 
00042 class RandomSeedDialog: public QDialog
00043 {
00044        Q_OBJECT
00045        
00046 public:
00047        QLabel* labelX;
00048        QLabel* labelY;
00049        
00050        QLabel* valuesLabelX;
00051        QLabel* valuesLabelY;
00052        
00053        QLineEdit* lineEditX;
00054        QLineEdit* lineEditY;
00055        QPushButton* helpPB;
00056        QPushButton* okPB;
00057        QPushButton* cancelPB;
00058        QGridLayout* seedLayoutX;
00059        QGridLayout* seedLayoutY;
00060        QHBoxLayout* buttonsLayout;
00061        QVBoxLayout* mainLayout;
00062 
00063        RandomSeedDialog(QWidget* parent);
00064        ~RandomSeedDialog();
00065        
00066 public slots:
00067        void help();
00068        void ok();
00069 };
00070 
00071 class FetMainForm: public QMainWindow, public Ui::FetMainForm_template
00072 {
00073        Q_OBJECT
00074        
00075 private:
00076        QSpinBox communicationSpinBox;
00077        
00078        QMenu* shortcutBasicMenu;
00079        QMenu* shortcutDataSpaceMenu;
00080        QMenu* shortcutDataAdvancedMenu;
00081        QMenu* shortcutAdvancedTimeMenu;
00082        
00083        QNetworkAccessManager* networkManager;
00084        
00085        QStringList recentFiles;
00086        
00087        QAction* recentFileActions[MAX_RECENT_FILES];
00088        QAction* recentSeparatorAction;
00089        
00090        void setEnabledIcon(QAction* action, bool enabled);
00091        
00092        void setCurrentFile(const QString& fileName);
00093        QString strippedName(const QString& fullFileName);
00094        void updateRecentFileActions();
00095 
00096 public:
00097        FetMainForm();
00098        ~FetMainForm();
00099        
00100        void closeOtherWindows();
00101        
00102        void openFile(const QString& fileName);
00103        bool fileSave();
00104        bool fileSaveAs();
00105        
00106 public slots:
00107        void enableNotPerfectMessage();
00108 
00109        void on_fileNewAction_activated();
00110        void on_fileSaveAction_activated();
00111        void on_fileSaveAsAction_activated();
00112        void on_fileExitAction_activated();
00113        void on_fileOpenAction_activated();
00114        void on_fileClearRecentFilesListAction_activated();
00115        void openRecentFile();
00116 
00117        void on_fileImportCSVActivityTagsAction_activated();
00118        void on_fileImportCSVActivitiesAction_activated();
00119        void on_fileImportCSVRoomsBuildingsAction_activated();
00120        void on_fileImportCSVSubjectsAction_activated();
00121        void on_fileImportCSVTeachersAction_activated();
00122        void on_fileImportCSVYearsGroupsSubgroupsAction_activated();
00123        void on_fileExportCSVAction_activated();
00124        
00125        void on_dataInstitutionNameAction_activated();
00126        void on_dataCommentsAction_activated();
00127        void on_dataDaysAction_activated();
00128        void on_dataHoursAction_activated();
00129        void on_dataTeachersAction_activated();
00130        void on_dataTeachersStatisticsAction_activated();
00131        void on_dataSubjectsAction_activated();
00132        void on_dataSubjectsStatisticsAction_activated();
00133        void on_dataActivityTagsAction_activated();
00134        void on_dataYearsAction_activated();
00135        void on_dataGroupsAction_activated();
00136        void on_dataSubgroupsAction_activated();
00137        void on_dataStudentsStatisticsAction_activated();
00138        void on_dataActivitiesRoomsStatisticsAction_activated();
00139        void on_dataHelpOnStatisticsAction_activated();
00140        
00141        void on_helpSettingsAction_activated();
00142        void on_settingsUseColorsAction_toggled();
00143        void on_settingsShowShortcutsOnMainWindowAction_toggled();
00144 
00146        void on_settingsConfirmActivityPlanningAction_toggled();
00147        void on_settingsConfirmSpreadActivitiesAction_toggled();
00148        void on_settingsConfirmRemoveRedundantAction_toggled();
00149        void on_settingsConfirmSaveTimetableAction_toggled();
00151        
00152        void enableActivityTagMaxHoursDailyToggled(bool checked);
00153        void enableStudentsMaxGapsPerDayToggled(bool checked);
00154        void showWarningForNotPerfectConstraintsToggled(bool checked);
00155 
00156        void enableStudentsMinHoursDailyWithAllowEmptyDaysToggled(bool checked);
00157        void showWarningForStudentsMinHoursDailyWithAllowEmptyDaysToggled(bool checked);
00158        
00159        void on_dataActivitiesAction_activated();
00160        void on_dataSubactivitiesAction_activated();
00161        void on_dataRoomsAction_activated();
00162        void on_dataBuildingsAction_activated();
00163        void on_dataAllTimeConstraintsAction_activated();
00164        void on_dataAllSpaceConstraintsAction_activated();
00165 
00166        void on_dataSpaceConstraintsRoomNotAvailableTimesAction_activated();
00167 
00168        void on_dataSpaceConstraintsBasicCompulsorySpaceAction_activated();
00169        void on_dataSpaceConstraintsActivityPreferredRoomAction_activated();
00170        void on_dataSpaceConstraintsActivityPreferredRoomsAction_activated();
00171        
00172        void on_dataSpaceConstraintsStudentsSetHomeRoomAction_activated();
00173        void on_dataSpaceConstraintsStudentsSetHomeRoomsAction_activated();
00174        void on_dataSpaceConstraintsTeacherHomeRoomAction_activated();
00175        void on_dataSpaceConstraintsTeacherHomeRoomsAction_activated();
00176 
00177        void on_dataSpaceConstraintsStudentsSetMaxBuildingChangesPerDayAction_activated();
00178        void on_dataSpaceConstraintsStudentsMaxBuildingChangesPerDayAction_activated();
00179        void on_dataSpaceConstraintsStudentsSetMaxBuildingChangesPerWeekAction_activated();
00180        void on_dataSpaceConstraintsStudentsMaxBuildingChangesPerWeekAction_activated();
00181        void on_dataSpaceConstraintsStudentsSetMinGapsBetweenBuildingChangesAction_activated();
00182        void on_dataSpaceConstraintsStudentsMinGapsBetweenBuildingChangesAction_activated();
00183 
00184        void on_dataSpaceConstraintsTeacherMaxBuildingChangesPerDayAction_activated();
00185        void on_dataSpaceConstraintsTeachersMaxBuildingChangesPerDayAction_activated();
00186        void on_dataSpaceConstraintsTeacherMaxBuildingChangesPerWeekAction_activated();
00187        void on_dataSpaceConstraintsTeachersMaxBuildingChangesPerWeekAction_activated();
00188        void on_dataSpaceConstraintsTeacherMinGapsBetweenBuildingChangesAction_activated();
00189        void on_dataSpaceConstraintsTeachersMinGapsBetweenBuildingChangesAction_activated();
00190        
00191        void on_dataSpaceConstraintsSubjectPreferredRoomAction_activated();
00192        void on_dataSpaceConstraintsSubjectPreferredRoomsAction_activated();
00193        void on_dataSpaceConstraintsSubjectActivityTagPreferredRoomAction_activated();
00194        void on_dataSpaceConstraintsSubjectActivityTagPreferredRoomsAction_activated();
00195 
00196        void on_dataSpaceConstraintsActivityTagPreferredRoomAction_activated();
00197        void on_dataSpaceConstraintsActivityTagPreferredRoomsAction_activated();
00198 
00199        void on_dataSpaceConstraintsActivitiesOccupyMaxDifferentRoomsAction_activated();
00200 
00201        void on_dataTimeConstraintsBasicCompulsoryTimeAction_activated();
00202        void on_dataTimeConstraintsBreakTimesAction_activated();
00203 
00204        void on_dataTimeConstraintsTwoActivitiesConsecutiveAction_activated();
00205        void on_dataTimeConstraintsTwoActivitiesGroupedAction_activated();
00206        void on_dataTimeConstraintsThreeActivitiesGroupedAction_activated();
00207        void on_dataTimeConstraintsTwoActivitiesOrderedAction_activated();
00208        void on_dataTimeConstraintsActivityPreferredStartingTimeAction_activated();
00209        void on_dataTimeConstraintsActivityPreferredTimeSlotsAction_activated();
00210        void on_dataTimeConstraintsActivitiesPreferredTimeSlotsAction_activated();
00211        void on_dataTimeConstraintsSubactivitiesPreferredTimeSlotsAction_activated();
00212        void on_dataTimeConstraintsActivityPreferredStartingTimesAction_activated();
00213        void on_dataTimeConstraintsActivitiesPreferredStartingTimesAction_activated();
00214        void on_dataTimeConstraintsSubactivitiesPreferredStartingTimesAction_activated();
00215        void on_dataTimeConstraintsActivitiesSameStartingTimeAction_activated();
00216        void on_dataTimeConstraintsActivitiesSameStartingHourAction_activated();
00217        void on_dataTimeConstraintsActivitiesSameStartingDayAction_activated();
00218        void on_dataTimeConstraintsActivitiesOccupyMaxTimeSlotsFromSelectionAction_activated();
00219        void on_dataTimeConstraintsActivitiesMaxSimultaneousInSelectedTimeSlotsAction_activated();
00220        void on_dataTimeConstraintsActivitiesNotOverlappingAction_activated();
00221        void on_dataTimeConstraintsMinDaysBetweenActivitiesAction_activated();
00222        void on_dataTimeConstraintsMaxDaysBetweenActivitiesAction_activated();
00223        void on_dataTimeConstraintsMinGapsBetweenActivitiesAction_activated();
00224        void on_dataTimeConstraintsActivityEndsStudentsDayAction_activated();
00225        void on_dataTimeConstraintsActivitiesEndStudentsDayAction_activated();
00226 
00227        void on_dataTimeConstraintsTeacherNotAvailableTimesAction_activated();
00228        void on_dataTimeConstraintsTeacherMaxDaysPerWeekAction_activated();
00229        void on_dataTimeConstraintsTeachersMaxDaysPerWeekAction_activated();
00230 
00231        void on_dataTimeConstraintsTeacherMinDaysPerWeekAction_activated();
00232        void on_dataTimeConstraintsTeachersMinDaysPerWeekAction_activated();
00233 
00234        void on_dataTimeConstraintsTeachersMaxHoursDailyAction_activated();
00235        void on_dataTimeConstraintsTeacherMaxHoursDailyAction_activated();
00236        void on_dataTimeConstraintsTeachersMaxHoursContinuouslyAction_activated();
00237        void on_dataTimeConstraintsTeacherMaxHoursContinuouslyAction_activated();
00238 
00239        void on_dataTimeConstraintsTeachersActivityTagMaxHoursContinuouslyAction_activated();
00240        void on_dataTimeConstraintsTeacherActivityTagMaxHoursContinuouslyAction_activated();
00241 
00242        void on_dataTimeConstraintsTeachersActivityTagMaxHoursDailyAction_activated();
00243        void on_dataTimeConstraintsTeacherActivityTagMaxHoursDailyAction_activated();
00244 
00245        void on_dataTimeConstraintsTeachersMinHoursDailyAction_activated();
00246        void on_dataTimeConstraintsTeacherMinHoursDailyAction_activated();
00247        void on_dataTimeConstraintsTeachersMaxGapsPerWeekAction_activated();
00248        void on_dataTimeConstraintsTeacherMaxGapsPerWeekAction_activated();
00249        void on_dataTimeConstraintsTeachersMaxGapsPerDayAction_activated();
00250        void on_dataTimeConstraintsTeacherMaxGapsPerDayAction_activated();
00251        
00252        void on_dataTimeConstraintsTeacherIntervalMaxDaysPerWeekAction_activated();
00253        void on_dataTimeConstraintsTeachersIntervalMaxDaysPerWeekAction_activated();
00254        void on_dataTimeConstraintsStudentsSetIntervalMaxDaysPerWeekAction_activated();
00255        void on_dataTimeConstraintsStudentsIntervalMaxDaysPerWeekAction_activated();
00256 
00257        void on_dataTimeConstraintsStudentsSetNotAvailableTimesAction_activated();
00258        void on_dataTimeConstraintsStudentsSetMaxGapsPerWeekAction_activated();
00259        void on_dataTimeConstraintsStudentsMaxGapsPerWeekAction_activated();
00260 
00261        void on_dataTimeConstraintsStudentsSetMaxGapsPerDayAction_activated();
00262        void on_dataTimeConstraintsStudentsMaxGapsPerDayAction_activated();
00263 
00264        void on_dataTimeConstraintsStudentsEarlyMaxBeginningsAtSecondHourAction_activated();
00265        void on_dataTimeConstraintsStudentsSetEarlyMaxBeginningsAtSecondHourAction_activated();
00266        void on_dataTimeConstraintsStudentsMaxHoursDailyAction_activated();
00267        void on_dataTimeConstraintsStudentsSetMaxHoursDailyAction_activated();
00268        void on_dataTimeConstraintsStudentsMaxHoursContinuouslyAction_activated();
00269        void on_dataTimeConstraintsStudentsSetMaxHoursContinuouslyAction_activated();
00270 
00271        void on_dataTimeConstraintsStudentsActivityTagMaxHoursContinuouslyAction_activated();
00272        void on_dataTimeConstraintsStudentsSetActivityTagMaxHoursContinuouslyAction_activated();
00273 
00274        void on_dataTimeConstraintsStudentsActivityTagMaxHoursDailyAction_activated();
00275        void on_dataTimeConstraintsStudentsSetActivityTagMaxHoursDailyAction_activated();
00276 
00277        void on_dataTimeConstraintsStudentsMinHoursDailyAction_activated();
00278        void on_dataTimeConstraintsStudentsSetMinHoursDailyAction_activated();
00279 
00280        void on_activityPlanningAction_activated();
00281        void on_spreadActivitiesAction_activated();
00282        void on_removeRedundantConstraintsAction_activated();
00283 
00284        //about
00285        void on_helpAboutAction_activated();
00286        //offline
00287        void on_helpFAQAction_activated();
00288        void on_helpTipsAction_activated();
00289        void on_helpInstructionsAction_activated();
00290        //online
00291        void on_helpHomepageAction_activated();
00292        void on_helpContentsAction_activated();
00293        void on_helpForumAction_activated();
00294        void on_helpAddressesAction_activated();
00295 
00296        void on_timetableGenerateAction_activated();
00297        void on_timetableViewStudentsAction_activated();
00298        void on_timetableViewTeachersAction_activated();
00299        void on_timetableViewRoomsAction_activated();
00300        void on_timetableShowConflictsAction_activated();
00301        void on_timetablePrintAction_activated();
00302        void on_timetableGenerateMultipleAction_activated();
00303 
00304        void on_timetableLockAllActivitiesAction_activated();
00305        void on_timetableUnlockAllActivitiesAction_activated();
00306        void on_timetableLockActivitiesDayAction_activated();
00307        void on_timetableUnlockActivitiesDayAction_activated();
00308        void on_timetableLockActivitiesEndStudentsDayAction_activated();
00309        void on_timetableUnlockActivitiesEndStudentsDayAction_activated();
00310 
00311        void on_timetableSaveTimetableAsAction_activated();
00312 
00313        void on_randomSeedAction_activated();
00314        
00315        void on_languageAction_activated();
00316        
00317        void on_checkForUpdatesAction_toggled();
00318        
00319        void on_timetablesDivideByDaysAction_toggled();
00320 
00321        void on_settingsRestoreDefaultsAction_activated();
00322 
00323        void on_settingsTimetableHtmlLevelAction_activated();
00324        void on_settingsPrintNotAvailableSlotsAction_toggled();
00325        void on_settingsPrintBreakSlotsAction_toggled();
00326 
00327        void on_settingsPrintActivitiesWithSameStartingTimeAction_toggled();
00328 
00329        void on_selectOutputDirAction_activated();
00330        
00331        void on_statisticsExportToDiskAction_activated();
00332        
00333        void on_shortcutAllTimeConstraintsPushButton_clicked();
00334        void on_shortcutBreakTimeConstraintsPushButton_clicked();
00335        void on_shortcutTeachersTimeConstraintsPushButton_clicked();
00336        void on_shortcutStudentsTimeConstraintsPushButton_clicked();
00337        void on_shortcutActivitiesTimeConstraintsPushButton_clicked();
00338        void on_shortcutAdvancedTimeConstraintsPushButton_clicked();
00339 
00340        void on_shortcutAllSpaceConstraintsPushButton_clicked();
00341        void on_shortcutRoomsSpaceConstraintsPushButton_clicked();
00342        void on_shortcutTeachersSpaceConstraintsPushButton_clicked();
00343        void on_shortcutStudentsSpaceConstraintsPushButton_clicked();
00344        void on_shortcutSubjectsSpaceConstraintsPushButton_clicked();
00345        void on_shortcutActivityTagsSpaceConstraintsPushButton_clicked();
00346        void on_shortcutSubjectsAndActivityTagsSpaceConstraintsPushButton_clicked();
00347        void on_shortcutActivitiesSpaceConstraintsPushButton_clicked();
00348        
00349        void on_shortcutGeneratePushButton_clicked();
00350        void on_shortcutGenerateMultiplePushButton_clicked();
00351        void on_shortcutViewTeachersPushButton_clicked();
00352        void on_shortcutViewStudentsPushButton_clicked();
00353        void on_shortcutViewRoomsPushButton_clicked();
00354        void on_shortcutShowSoftConflictsPushButton_clicked();
00355        
00356        void on_shortcutBasicPushButton_clicked();
00357        void on_shortcutSubjectsPushButton_clicked();
00358        void on_shortcutActivityTagsPushButton_clicked();
00359        void on_shortcutTeachersPushButton_clicked();
00360        void on_shortcutStudentsPushButton_clicked();
00361        void on_shortcutActivitiesPushButton_clicked();
00362        void on_shortcutSubactivitiesPushButton_clicked();
00363        void on_shortcutDataAdvancedPushButton_clicked();
00364        void on_shortcutDataSpacePushButton_clicked();
00365 
00366        void on_shortcutOpenPushButton_clicked();
00367        void on_shortcutOpenRecentPushButton_clicked();
00368        void on_shortcutNewPushButton_clicked();
00369        void on_shortcutSavePushButton_clicked();
00370        void on_shortcutSaveAsPushButton_clicked();
00371        
00372        void replyFinished(QNetworkReply* networkReply);
00373        
00374 protected:
00375        void closeEvent(QCloseEvent* event);
00376 };
00377 
00378 #endif