2014-06-18 23:44:46 +00:00
# include "mainscreen.h"
# include "ui_mainscreen.h"
2014-09-22 22:17:05 +00:00
MainScreen : : MainScreen ( QWidget * parent ) : QMainWindow ( parent ) , ui ( new Ui : : MainScreen )
2014-06-18 23:44:46 +00:00
{
ui - > setupUi ( this ) ;
2014-08-31 09:33:27 +00:00
//this->setFixedSize(this->size()); //main not resizeable
2014-06-18 23:44:46 +00:00
//Login Tab
2014-09-09 08:20:58 +00:00
iconPix . load ( " :/icons/iconX.png " ) ;
2014-06-18 23:44:46 +00:00
ui - > pswdLineEdit - > setEchoMode ( ( QLineEdit : : Password ) ) ;
2014-09-09 08:20:58 +00:00
ui - > labelUsrInputStatus - > setVisible ( false ) ;
ui - > labelPswInputStatus - > setVisible ( false ) ;
ui - > labelUsrInputStatus - > setPixmap ( iconPix ) ;
ui - > labelPswInputStatus - > setPixmap ( iconPix ) ;
2014-06-18 23:44:46 +00:00
2014-09-22 02:04:38 +00:00
//StatusBar
2014-06-18 23:44:46 +00:00
ui - > statusBar - > setStyleSheet ( " QStatusBar::item { border: 0px solid black }; " ) ;
2014-09-23 04:12:45 +00:00
ui - > statusBar - > setFixedHeight ( STATUS_ICON_HEIGH ) ;
2014-09-22 02:04:38 +00:00
ui - > statusBar - > showMessage ( tr ( " Ready " ) ) ;
2014-06-18 23:44:46 +00:00
2014-09-22 22:17:05 +00:00
//GPA Tab
2014-06-18 23:44:46 +00:00
ui - > avgLCD - > setPalette ( QPalette ( QPalette : : WindowText , Qt : : blue ) ) ;
//Pointer allocating
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Allocating pointers " ;
2014-06-18 23:44:46 +00:00
this - > userLoginSetting = new user ( " " , " " ) ;
this - > courseTableMgr = new coursesTableManager ( ui - > coursesTable , userLoginSetting ) ;
2014-09-22 02:04:38 +00:00
this - > loginHandel = new loginHandler ( userLoginSetting , ui - > statusBar , ui - > loginButton ) ;
2014-09-22 22:17:05 +00:00
this - > calendar = new CalendarManager ( ui - > calendarGridLayoutMain ) ;
2014-08-31 21:27:15 +00:00
this - > data = new SaveData ( ) ;
2014-06-18 23:44:46 +00:00
//check login File
2014-08-31 21:27:15 +00:00
if ( data - > isSaved ( ) )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Loading data from file " ;
2014-08-31 21:27:15 +00:00
ui - > usrnmLineEdit - > setText ( data - > getUsername ( ) ) ;
ui - > pswdLineEdit - > setText ( data - > getPassword ( ) ) ;
2014-06-18 23:44:46 +00:00
ui - > keepLogin - > setChecked ( true ) ;
}
2014-09-08 17:07:42 +00:00
2014-09-17 22:59:42 +00:00
//language
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Checking locale " ;
2014-09-09 08:20:58 +00:00
checkLocale ( ) ;
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Ready. " ;
2014-09-08 17:07:42 +00:00
2014-06-18 23:44:46 +00:00
}
MainScreen : : ~ MainScreen ( )
{
2014-09-09 08:20:58 +00:00
delete calendar ;
delete courseTableMgr ;
2014-06-18 23:44:46 +00:00
delete userLoginSetting ;
delete loginHandel ;
2014-08-31 21:27:15 +00:00
delete data ;
2014-09-17 22:59:42 +00:00
delete ui ;
2014-06-18 23:44:46 +00:00
}
2014-09-09 08:20:58 +00:00
//EVENTS ON LOGIN TAB
2014-06-20 17:13:21 +00:00
void MainScreen : : on_loginButton_clicked ( )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-09 08:20:58 +00:00
if ( ( ui - > usrnmLineEdit - > text ( ) . isEmpty ( ) ) | | ( ui - > pswdLineEdit - > text ( ) . isEmpty ( ) ) )
2014-08-31 09:33:27 +00:00
{
2014-09-09 08:20:58 +00:00
if ( ui - > usrnmLineEdit - > text ( ) . isEmpty ( ) )
2014-08-31 09:33:27 +00:00
{
2014-09-09 08:20:58 +00:00
ui - > labelUsrInputStatus - > setVisible ( true ) ;
2014-09-22 02:04:38 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " username input is empty " ;
2014-08-31 09:33:27 +00:00
}
2014-09-09 08:20:58 +00:00
else
ui - > labelUsrInputStatus - > setVisible ( false ) ;
if ( ui - > pswdLineEdit - > text ( ) . isEmpty ( ) )
2014-08-31 09:33:27 +00:00
{
2014-09-09 08:20:58 +00:00
ui - > labelPswInputStatus - > setVisible ( true ) ;
2014-09-22 02:04:38 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " password input is empty " ;
2014-08-31 09:33:27 +00:00
}
2014-09-09 08:20:58 +00:00
else
ui - > labelPswInputStatus - > setVisible ( false ) ;
return ;
2014-08-31 09:33:27 +00:00
}
2014-09-09 08:20:58 +00:00
else
{
ui - > labelUsrInputStatus - > setVisible ( false ) ;
ui - > labelPswInputStatus - > setVisible ( false ) ;
}
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " login session start " ;
2014-09-22 02:04:38 +00:00
if ( this - > loginHandel - > login ( ui - > usrnmLineEdit - > text ( ) , ui - > pswdLineEdit - > text ( ) ) = = true )
2014-09-09 08:20:58 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " login session end with true " ;
2014-09-22 02:04:38 +00:00
ui - > pswdLineEdit - > setDisabled ( true ) ;
ui - > usrnmLineEdit - > setDisabled ( true ) ;
2014-09-22 22:17:05 +00:00
if ( ui - > keepLogin - > isChecked ( ) )
{
qDebug ( ) < < Q_FUNC_INFO < < " saving data " ;
data - > setUsername ( ui - > usrnmLineEdit - > text ( ) ) ;
data - > setPassword ( ui - > pswdLineEdit - > text ( ) ) ;
}
2014-09-09 08:20:58 +00:00
}
else
{
2014-09-23 01:15:38 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " login session end with false " ;
2014-09-22 02:04:38 +00:00
ui - > pswdLineEdit - > setDisabled ( false ) ;
ui - > usrnmLineEdit - > setDisabled ( false ) ;
}
}
void MainScreen : : on_keepLogin_clicked ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-22 02:04:38 +00:00
if ( ui - > keepLogin - > isChecked ( ) )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " saving data " ;
2014-09-22 02:04:38 +00:00
data - > setUsername ( ui - > usrnmLineEdit - > text ( ) ) ;
data - > setPassword ( ui - > pswdLineEdit - > text ( ) ) ;
2014-09-09 08:20:58 +00:00
}
2014-09-22 02:04:38 +00:00
else
data - > reset ( ) ;
2014-09-09 08:20:58 +00:00
}
2014-09-22 02:04:38 +00:00
void MainScreen : : on_usrnmLineEdit_editingFinished ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-22 02:04:38 +00:00
ui - > usrnmLineEdit - > setText ( ui - > usrnmLineEdit - > text ( ) . toLower ( ) ) ;
}
2014-09-09 08:20:58 +00:00
//EVENTS ON GPA TAB
2014-06-20 17:13:21 +00:00
void MainScreen : : on_ratesButton_clicked ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-17 01:57:44 +00:00
if ( ! checkIfValidDates ( ) )
{
2014-09-22 22:17:05 +00:00
qWarning ( ) < < Q_FUNC_INFO < < " Invalid dates! return " ;
2014-09-17 01:57:44 +00:00
QMessageBox : : critical ( this , tr ( " Error " ) , tr ( " Invalid Dates. \n Make Sure everything is correct and try again " ) ) ;
return ;
}
2014-09-17 01:08:38 +00:00
QString pageString ;
2014-06-20 02:59:33 +00:00
int status = 0 ;
if ( loginHandel - > isLoggedInFlag ( ) )
2014-06-18 23:44:46 +00:00
{
2014-09-18 00:34:49 +00:00
if ( ( status = loginHandel - > makeGradeRequest ( ui - > spinBoxCoursesFromYear - > value ( ) ,
ui - > spinBoxCoursesToYear - > value ( ) , ui - > spinBoxCoursesFromSemester - > value ( ) ,
2014-09-22 22:17:05 +00:00
ui - > spinBoxCoursesToSemester - > value ( ) ) ) = = jceLogin : : JCE_PAGE_PASSED )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " grade page is ready " ;
2014-09-17 01:08:38 +00:00
pageString = loginHandel - > getCurrentPageContect ( ) ;
2014-06-20 02:59:33 +00:00
courseTableMgr - > setCoursesList ( pageString ) ;
courseTableMgr - > insertJceCoursesIntoTable ( ) ;
}
else if ( status = = jceLogin : : JCE_NOT_CONNECTED )
{
2014-09-22 22:17:05 +00:00
qWarning ( ) < < Q_FUNC_INFO < < " not connected " ;
2014-06-20 02:59:33 +00:00
QMessageBox : : critical ( this , tr ( " Error " ) , tr ( " Not Connected " ) ) ;
2014-06-18 23:44:46 +00:00
}
2014-09-22 22:17:05 +00:00
else
{
qCritical ( ) < < Q_FUNC_INFO < < " grade get ended with " < < status ;
}
2014-06-18 23:44:46 +00:00
}
2014-08-27 10:49:15 +00:00
}
2014-09-17 01:57:44 +00:00
bool MainScreen : : checkIfValidDates ( )
{
bool flag = false ;
if ( ui - > spinBoxCoursesFromYear - > value ( ) < ui - > spinBoxCoursesToYear - > value ( ) )
{
//doesnt matter what is the semester, its valid!
flag = true ;
}
else if ( ( ui - > spinBoxCoursesFromYear - > value ( ) = = ui - > spinBoxCoursesToYear - > value ( ) ) )
{
//semester from must be equal or less than to semester
if ( ui - > spinBoxCoursesFromSemester - > value ( ) < = ui - > spinBoxCoursesToSemester - > value ( ) )
flag = true ;
}
return flag ;
}
2014-08-31 09:33:27 +00:00
void MainScreen : : on_checkBoxCoursesInfluence_toggled ( bool checked )
2014-08-27 10:49:15 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " only main courses toggeled " < < checked ;
2014-08-31 09:33:27 +00:00
this - > userLoginSetting - > setInfluenceCourseOnly ( checked ) ;
this - > courseTableMgr - > influnceCourseChanged ( checked ) ;
2014-06-18 23:44:46 +00:00
}
2014-09-17 01:57:44 +00:00
void MainScreen : : on_spinBoxCoursesFromYear_valueChanged ( int arg1 )
2014-06-18 23:44:46 +00:00
{
2014-09-17 01:57:44 +00:00
ui - > spinBoxCoursesFromYear - > setValue ( arg1 ) ;
2014-06-18 23:44:46 +00:00
}
2014-09-17 01:57:44 +00:00
void MainScreen : : on_spinBoxCoursesToYear_valueChanged ( int arg1 )
2014-06-18 23:44:46 +00:00
{
2014-09-17 01:57:44 +00:00
ui - > spinBoxCoursesToYear - > setValue ( arg1 ) ;
2014-08-31 09:33:27 +00:00
2014-06-18 23:44:46 +00:00
}
2014-09-17 01:57:44 +00:00
void MainScreen : : on_spinBoxCoursesFromSemester_valueChanged ( int arg1 )
2014-06-18 23:44:46 +00:00
{
2014-09-17 01:57:44 +00:00
ui - > spinBoxCoursesFromSemester - > setValue ( arg1 % 4 ) ;
2014-06-18 23:44:46 +00:00
}
2014-09-17 01:57:44 +00:00
void MainScreen : : on_spinBoxCoursesToSemester_valueChanged ( int arg1 )
2014-06-18 23:44:46 +00:00
{
2014-09-17 01:57:44 +00:00
ui - > spinBoxCoursesToSemester - > setValue ( arg1 % 4 ) ;
2014-06-18 23:44:46 +00:00
}
2014-08-31 09:33:27 +00:00
void MainScreen : : on_coursesTable_itemChanged ( QTableWidgetItem * item )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " item at row: " < < item - > row ( ) < < " colum: " < < item - > column ( ) < < " text: " < < item - > text ( ) ;
2014-08-31 09:33:27 +00:00
if ( this - > courseTableMgr - > changes ( item - > text ( ) , item - > row ( ) , item - > column ( ) ) )
ui - > avgLCD - > display ( courseTableMgr - > getAvg ( ) ) ;
else
2014-09-22 22:17:05 +00:00
{
qWarning ( ) < < Q_FUNC_INFO < < " missmatch data " ;
2014-09-11 03:24:52 +00:00
QMessageBox : : critical ( this , tr ( " Error " ) , tr ( " Missmatching data " ) ) ;
2014-09-22 22:17:05 +00:00
}
2014-06-18 23:44:46 +00:00
}
2014-09-09 08:20:58 +00:00
void MainScreen : : on_clearTableButton_clicked ( )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-09 08:20:58 +00:00
courseTableMgr - > clearTable ( ) ;
ui - > avgLCD - > display ( courseTableMgr - > getAvg ( ) ) ;
2014-06-18 23:44:46 +00:00
}
2014-09-09 08:20:58 +00:00
//EVENTS ON CALENDAR TAB
void MainScreen : : on_getCalendarBtn_clicked ( )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-09 08:20:58 +00:00
int status = 0 ;
if ( loginHandel - > isLoggedInFlag ( ) )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
if ( ( status = loginHandel - > makeCalendarRequest ( ui - > spinBoxYear - > value ( ) , ui - > spinBoxSemester - > value ( ) ) ) = = jceLogin : : JCE_PAGE_PASSED )
2014-09-09 08:20:58 +00:00
{
//Use it for debug. add plain text and change the object name to 'plainTextEdit' so you will get the html request
//ui->plainTextEdit->setPlainText(loginHandel->getCurrentPageContect());
calendar - > resetTable ( ) ;
2014-09-17 01:08:38 +00:00
calendar - > setCalendar ( loginHandel - > getCurrentPageContect ( ) ) ;
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " calendar is loaded " ;
2014-09-09 08:20:58 +00:00
}
2014-06-20 17:13:21 +00:00
2014-09-09 08:20:58 +00:00
else if ( status = = jceLogin : : JCE_NOT_CONNECTED )
{
2014-09-22 22:17:05 +00:00
qWarning ( ) < < Q_FUNC_INFO < < " not connected " ;
2014-09-09 08:20:58 +00:00
QMessageBox : : critical ( this , tr ( " Error " ) , tr ( " Not Connected " ) ) ;
}
2014-09-22 22:17:05 +00:00
else
qCritical ( ) < < Q_FUNC_INFO < < " calendar get ended with " < < status ;
2014-06-18 23:44:46 +00:00
}
}
2014-09-09 08:20:58 +00:00
void MainScreen : : on_exportToCVSBtn_clicked ( )
2014-06-18 23:44:46 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " in: " < < ui - > tabWidget - > currentWidget ( ) - > objectName ( ) ;
2014-09-09 08:20:58 +00:00
if ( loginHandel - > isLoggedInFlag ( ) )
2014-09-11 12:48:23 +00:00
{
2014-09-17 02:47:12 +00:00
this - > calendar - > exportCalendarCSV ( ) ;
2014-09-11 12:48:23 +00:00
}
2014-06-18 23:44:46 +00:00
}
2014-09-09 08:20:58 +00:00
//EVENTS ON MENU BAR
2014-06-18 23:44:46 +00:00
void MainScreen : : on_actionCredits_triggered ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO ;
QMessageBox : : about ( this , " About " ,
2014-09-23 02:57:35 +00:00
" <a href='http://liranbg.github.io/JceManager/'>Jce Manager</a> v1.0.0<br><br> "
2014-09-22 22:17:05 +00:00
+ tr ( " License: " ) +
" <br>GNU LESSER GENERAL PUBLIC LICENSE V2.1<br> "
+ " <br> " +
" <a href='https://github.com/liranbg/JceManager'>JceManager Repository</a> " +
" <br><br> "
2014-09-23 02:57:35 +00:00
+ tr ( " Powered By: " ) +
" <a href='https://github.com/liranbg/jceConnection'> Jce Connection</a><br><br> "
+ tr ( " Developed By " ) +
2014-09-22 22:17:05 +00:00
" :<ul> " +
" <li><a href='mailto:liranbg@gmail.com'> " + tr ( " Liran " ) + " </a></li> " +
" <li><a href='mailto:sagidayan@gmail.com'> " + tr ( " Sagi " ) + " </a></li></ul> "
) ;
2014-06-18 23:44:46 +00:00
}
void MainScreen : : on_actionExit_triggered ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO ;
2014-06-18 23:44:46 +00:00
exit ( 0 ) ;
}
2014-06-22 12:43:31 +00:00
void MainScreen : : on_actionHow_To_triggered ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO ;
2014-06-22 12:43:31 +00:00
QMessageBox : : information ( this , " How To " ,
2014-09-22 22:17:05 +00:00
" <b> "
2014-09-23 02:57:35 +00:00
+ tr ( " Help Guide " ) +
" </b><ul> "
+ tr ( " <br><li>Login: <ul><li>Type your username and password and click Login.</li><li>Once you are connected, you will see a green ball in the right buttom panel.</li></ul></li> " )
+ tr ( " <br><li>Getting GPA sheet<ul><li>Click on GPA Tab</li><li> Select your dates and click on Add</li></ul></li> " )
+ tr ( " <br><li>Average Changing<ul><li>Change one of your grade and see the average in the buttom panel changing.</li></ul></li> " )
+ tr ( " <br><li>Getting Calendar<ul><li>Click on Calendar Tab</li><li> Select your dates and click on Get Calendar</li></ul></li> " )
+ tr ( " <br><li>For exporting your calendar to a .CSV file:<ul><li>Do previous step and continue to next step</li><li> Click on Export to CSV</li><li>Select your dates and click OK</li><li>Once you're Done, go on your calendar and import your csv file</li></li> " ) +
" <br><br> "
+ tr ( " <b>For more information, please visit us at: <a href='http://liranbg.github.io/JceManager/'>Jce Manager site</a></b> " ) ) ;
2014-06-22 12:43:31 +00:00
}
2014-09-08 15:54:52 +00:00
void MainScreen : : on_actionHebrew_triggered ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO ;
2014-09-08 17:07:42 +00:00
if ( ui - > actionEnglish - > isChecked ( ) | | ui - > actionOS_Default - > isChecked ( ) )
2014-09-08 15:54:52 +00:00
{
ui - > actionEnglish - > setChecked ( false ) ;
2014-09-08 17:07:42 +00:00
ui - > actionOS_Default - > setChecked ( false ) ;
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Changed Language to hebrew " ;
2014-09-08 17:07:42 +00:00
data - > setLocal ( " he " ) ;
2014-09-11 03:24:52 +00:00
QMessageBox : : information ( this , tr ( " Settings " ) , tr ( " Your settings will take effect next time you start the program " ) , QMessageBox : : Ok ) ;
2014-09-08 15:54:52 +00:00
}
else
ui - > actionHebrew - > setChecked ( true ) ;
}
void MainScreen : : on_actionEnglish_triggered ( )
2014-09-07 19:57:01 +00:00
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO ;
2014-09-08 17:07:42 +00:00
if ( ui - > actionHebrew - > isChecked ( ) | | ui - > actionOS_Default - > isChecked ( ) )
2014-09-07 20:14:04 +00:00
{
2014-09-08 15:54:52 +00:00
ui - > actionHebrew - > setChecked ( false ) ;
2014-09-08 17:07:42 +00:00
ui - > actionOS_Default - > setChecked ( false ) ;
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Changed Language to English " ;
2014-09-08 17:07:42 +00:00
data - > setLocal ( " en " ) ;
2014-09-11 03:24:52 +00:00
QMessageBox : : information ( this , " Settings " , tr ( " Your settings will take effect next time you start the program " ) , QMessageBox : : Ok ) ;
2014-09-08 15:54:52 +00:00
}
else
ui - > actionEnglish - > setChecked ( true ) ;
2014-09-07 19:57:01 +00:00
}
2014-09-08 17:07:42 +00:00
void MainScreen : : on_actionOS_Default_triggered ( )
{
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO ;
2014-09-08 17:07:42 +00:00
if ( ui - > actionHebrew - > isChecked ( ) | | ui - > actionEnglish - > isChecked ( ) )
{
ui - > actionHebrew - > setChecked ( false ) ;
ui - > actionEnglish - > setChecked ( false ) ;
2014-09-22 22:17:05 +00:00
qDebug ( ) < < Q_FUNC_INFO < < " Changed Language to OS Default " ;
2014-09-08 17:07:42 +00:00
data - > setLocal ( " default " ) ;
2014-09-11 03:24:52 +00:00
QMessageBox : : information ( this , tr ( " Settings " ) , tr ( " Your settings will take effect next time you start the program " ) , QMessageBox : : Ok ) ;
2014-09-08 17:07:42 +00:00
}
else
ui - > actionOS_Default - > setChecked ( true ) ;
}
2014-09-09 08:20:58 +00:00
void MainScreen : : checkLocale ( )
{
if ( data - > getLocal ( ) = = " en " )
{
ui - > actionHebrew - > setChecked ( false ) ;
ui - > actionOS_Default - > setChecked ( false ) ;
ui - > actionEnglish - > setChecked ( true ) ;
} else if ( data - > getLocal ( ) = = " he " ) {
ui - > actionHebrew - > setChecked ( true ) ;
ui - > actionOS_Default - > setChecked ( false ) ;
ui - > actionEnglish - > setChecked ( false ) ;
} else {
ui - > actionHebrew - > setChecked ( false ) ;
ui - > actionOS_Default - > setChecked ( true ) ;
ui - > actionEnglish - > setChecked ( false ) ;
}
}