GUI: Remove Language-menu.
We now have language selection in Settings-dialog.
This commit is contained in:
parent
29d6b443fa
commit
85a700b496
|
@ -113,11 +113,6 @@
|
|||
<addaction name="mActionViewLog"/>
|
||||
<addaction name="mActionViewStats"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="mMenuLanguage">
|
||||
<property name="title">
|
||||
<string>&Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QMenu" name="mMenuHelp">
|
||||
<property name="title">
|
||||
<string>&Help</string>
|
||||
|
@ -148,7 +143,6 @@
|
|||
<addaction name="mMenuEdit"/>
|
||||
<addaction name="mMenuView"/>
|
||||
<addaction name="mMenuCheck"/>
|
||||
<addaction name="mMenuLanguage"/>
|
||||
<addaction name="mMenuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mToolBarMain">
|
||||
|
|
|
@ -98,7 +98,6 @@ MainWindow::MainWindow() :
|
|||
|
||||
connect(mUI.mActionHelpContents, SIGNAL(triggered()), this, SLOT(OpenHelpContents()));
|
||||
|
||||
CreateLanguageMenuItems();
|
||||
LoadSettings();
|
||||
|
||||
mThread->Initialize(mUI.mResults);
|
||||
|
@ -128,39 +127,6 @@ MainWindow::~MainWindow()
|
|||
delete mProject;
|
||||
}
|
||||
|
||||
void MainWindow::CreateLanguageMenuItems()
|
||||
{
|
||||
QStringList languages = mTranslation->GetNames();
|
||||
|
||||
for (int i = 0; i < languages.size(); i++)
|
||||
{
|
||||
//Create an action for each language
|
||||
//Language name is pre translated
|
||||
QAction *temp = new QAction(languages[i], this);
|
||||
|
||||
temp->setCheckable(true);
|
||||
|
||||
//Add the action to menu
|
||||
mUI.mMenuLanguage->addAction(temp);
|
||||
|
||||
//Add action to the group
|
||||
mLanguages->addAction(temp);
|
||||
|
||||
//Check it if it's the value stored to settings
|
||||
if (i == mSettings->value(SETTINGS_LANGUAGE, 0).toInt())
|
||||
{
|
||||
temp->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
temp->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
connect(mLanguages, SIGNAL(triggered(QAction *)),
|
||||
this, SLOT(MapLanguage(QAction *)));
|
||||
}
|
||||
|
||||
void MainWindow::LoadSettings()
|
||||
{
|
||||
if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool())
|
||||
|
@ -715,19 +681,6 @@ void MainWindow::SetLanguage(int index)
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::MapLanguage(QAction *action)
|
||||
{
|
||||
//Find the action that has the language that user clicked
|
||||
QList<QAction *> actions = mLanguages->actions();
|
||||
for (int i = 0; i < actions.size(); i++)
|
||||
{
|
||||
if (actions[i] == action)
|
||||
{
|
||||
SetLanguage(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::AboutToShowViewMenu()
|
||||
{
|
||||
mUI.mActionToolBarMain->setChecked(mUI.mToolBarMain->isVisible());
|
||||
|
|
|
@ -212,12 +212,6 @@ protected slots:
|
|||
*/
|
||||
void ResultsAdded();
|
||||
|
||||
/**
|
||||
* @brief Slot for changing the program's language
|
||||
*
|
||||
*/
|
||||
void MapLanguage(QAction *);
|
||||
|
||||
/**
|
||||
* @brief Slot for showing/hiding standard toolbar
|
||||
*/
|
||||
|
@ -259,12 +253,6 @@ protected slots:
|
|||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* @brief Create menu items to change language
|
||||
*
|
||||
*/
|
||||
void CreateLanguageMenuItems();
|
||||
|
||||
/**
|
||||
* @brief Set current language
|
||||
* @param index Index of the language to set
|
||||
|
|
Loading…
Reference in New Issue