@ -1,4 +1,3 @@
// Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
// Copyright (C) 2011 Emanuel Costea <cemycc@gmail.com>
@ -16,32 +15,31 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// Project system includes
// Plugin includes
# include "translation_manager_main_window.h"
# include "translation_manager_constants.h"
# include "ftp_selection.h"
// Core includes
# include "../core/icore.h"
# include "../core/core_constants.h"
# include "../core/menu_manager.h"
# include "../../extension_system/iplugin_spec.h"
// Qt includes
# include <Qt Gui/QWidget >
# include <Qt Gui/QMessageBox >
# include <Qt Core/QFileInfo >
# include <Qt Core/QEvent >
# include <QtCore/QSettings>
# include <QtGui/QErrorMessage>
# include <QtCore/QSignalMapper>
# include <QtCore/QResource>
# include <QtGui/QMessageBox>
# include <QtGui/QErrorMessage>
# include <QtGui/QTableWidget>
# include <QtGui/QTableWidgetItem>
# include <QtGui/QMdiSubWindow>
# include <QtGui/QFileDialog>
# include <QtCore/QResource>
# include <QtGui/QMenuBar>
# include <QtCore/QFileInfo>
# include <QtCore/QEvent>
# include <QtGui/QCloseEvent>
// Plugin includes
# include "translation_manager_main_window.h"
# include "translation_manager_constants.h"
# include "ftp_selection.h"
namespace TranslationManager
{
@ -53,7 +51,7 @@ CMainWindow::CMainWindow(QWidget *parent)
_ui . mdiArea - > closeAllSubWindows ( ) ;
windowMapper = new QSignalMapper ( this ) ;
connect ( windowMapper , SIGNAL ( mapped ( QWidget * ) ) , this , SLOT ( setActiveSubWindow ( QWidget * ) ) ) ;
connect ( windowMapper , SIGNAL ( mapped ( QWidget * ) ) , this , SLOT ( setActiveSubWindow ( QWidget * ) ) ) ;
initialize_settings [ " georges " ] = false ;
initialize_settings [ " ligo " ] = false ;
@ -83,45 +81,51 @@ void CMainWindow::createToolbar()
QMenu * wordsExtractionMenu = new QMenu ( " &Words extraction... " ) ;
wordsExtractionMenu - > setIcon ( QIcon ( Core : : Constants : : ICON_SETTINGS ) ) ;
_ui . toolBar - > addAction ( wordsExtractionMenu - > menuAction ( ) ) ;
// extract bot names
QAction * extractBotNamesAct = wordsExtractionMenu - > addAction ( " &Extract bot names... " ) ;
extractBotNamesAct - > setStatusTip ( tr ( " Extract bot names from primitives. " ) ) ;
connect ( extractBotNamesAct , SIGNAL ( triggered ( ) ) , this , SLOT ( extractBotNames ( ) ) ) ;
// Words extraction
// -----------------------------
// signal mapper for extraction words
QSignalMapper * wordsExtractionMapper = new QSignalMapper ( this ) ;
connect ( wordsExtractionMapper , SIGNAL ( mapped ( QString ) ) , this , SLOT ( extractWords ( QString ) ) ) ;
// extract item words
QAction * extractItemWordsAct = wordsExtractionMenu - > addAction ( " &Extract item words... " ) ;
extractItemWordsAct - > setStatusTip ( tr ( " Extract item words " ) ) ;
connect ( extractItemWordsAct , SIGNAL ( triggered ( ) ) , wordsExtractionMapper , SLOT ( map ( ) ) ) ;
wordsExtractionMapper - > setMapping ( extractItemWordsAct , QString ( Constants : : WK_ITEM ) ) ;
// extract creature words
QAction * extractCreatureWordsAct = wordsExtractionMenu - > addAction ( " &Extract creature words... " ) ;
QAction * extractCreatureWordsAct = wordsExtractionMenu - > addAction ( tr ( " &Extract creature words... " ) ) ;
extractCreatureWordsAct - > setStatusTip ( tr ( " Extract creature words " ) ) ;
connect ( extractCreatureWordsAct , SIGNAL ( triggered ( ) ) , wordsExtractionMapper , SLOT ( map ( ) ) ) ;
wordsExtractionMapper - > setMapping ( extractCreatureWordsAct , QString ( Constants : : WK_CREATURE ) ) ;
// extract sbrick words
QAction * extractSbrickWordsAct = wordsExtractionMenu - > addAction ( " &Extract sbrick words... " ) ;
extractSbrickWordsAct - > setStatusTip ( tr ( " Extract sbrick words " ) ) ;
connect ( extractSbrickWordsAct , SIGNAL ( triggered ( ) ) , wordsExtractionMapper , SLOT ( map ( ) ) ) ;
wordsExtractionMapper - > setMapping ( extractSbrickWordsAct , QString ( Constants : : WK_SBRICK ) ) ;
// extract sphrase words
QAction * extractSphraseWordsAct = wordsExtractionMenu - > addAction ( " &Extract sphrase words... " ) ;
extractSphraseWordsAct - > setStatusTip ( tr ( " Extract sphrase words " ) ) ;
connect ( extractSphraseWordsAct , SIGNAL ( triggered ( ) ) , wordsExtractionMapper , SLOT ( map ( ) ) ) ;
wordsExtractionMapper - > setMapping ( extractSphraseWordsAct , QString ( Constants : : WK_SPHRASE ) ) ;
// extract place and region names
QAction * extractPlaceNamesAct = wordsExtractionMenu - > addAction ( " &Extract place names... " ) ;
extractPlaceNamesAct - > setStatusTip ( tr ( " Extract place names from primitives " ) ) ;
connect ( extractPlaceNamesAct , SIGNAL ( triggered ( ) ) , wordsExtractionMapper , SLOT ( map ( ) ) ) ;
wordsExtractionMapper - > setMapping ( extractPlaceNamesAct , QString ( Constants : : WK_PLACE ) ) ;
// Merge options
// -----------------------------
QAction * mergeSingleFileAct = wordsExtractionMenu - > addAction ( " &Merge worksheet file... " ) ;
mergeSingleFileAct - > setStatusTip ( tr ( " Merge worksheet file from local or remote directory " ) ) ;
connect ( mergeSingleFileAct , SIGNAL ( triggered ( ) ) , this , SLOT ( mergeSingleFile ( ) ) ) ;
// Windows menu
Core : : ICore * core = Core : : ICore : : instance ( ) ;
Core : : MenuManager * menuManager = core - > menuManager ( ) ;
@ -130,12 +134,11 @@ void CMainWindow::createToolbar()
connect ( windowMenu , SIGNAL ( aboutToShow ( ) ) , this , SLOT ( updateWindowsList ( ) ) ) ;
// Undo, Redo actions
// -----------------------------
QAction * undoAction = menuManager - > action ( Core : : Constants : : UNDO ) ;
QAction * undoAction = menuManager - > action ( Core : : Constants : : UNDO ) ;
if ( undoAction ! = 0 )
_ui . toolBar - > addAction ( undoAction ) ;
QAction * redoAction = menuManager - > action ( Core : : Constants : : REDO ) ;
QAction * redoAction = menuManager - > action ( Core : : Constants : : REDO ) ;
if ( redoAction ! = 0 )
_ui . toolBar - > addAction ( redoAction ) ;
}
@ -152,19 +155,18 @@ void CMainWindow::updateToolbar(QMdiSubWindow *window)
QAction * deleteRowAct = new QAction ( tr ( " Delete row " ) , this ) ;
connect ( deleteRowAct , SIGNAL ( triggered ( ) ) , window , SLOT ( deleteRow ( ) ) ) ;
windowMenu - > addAction ( deleteRowAct ) ;
}
}
// Set the active subwindow
void CMainWindow : : setActiveSubWindow ( QWidget * window )
void CMainWindow : : setActiveSubWindow ( QWidget * window )
{
if ( ! window )
{
return ;
}
QMdiSubWindow * cwindow = qobject_cast < QMdiSubWindow * > ( window ) ;
_ui . mdiArea - > setActiveSubWindow ( cwindow ) ;
QMdiSubWindow * mdiWindow = qobject_cast < QMdiSubWindow * > ( window ) ;
if ( mdiWindow ! = 0 )
_ui . mdiArea - > setActiveSubWindow ( mdiWindow ) ;
}
// Functions for updating the windows list
@ -174,7 +176,7 @@ void CMainWindow::updateWindowsList()
{
windowMenu - > clear ( ) ;
QMdiSubWindow * current_window = _ui . mdiArea - > activeSubWindow ( ) ;
QList < QMdiSubWindow * > subWindows = _ui . mdiArea - > subWindowList ( ) ;
QList < QMdiSubWindow * > subWindows = _ui . mdiArea - > subWindowList ( ) ;
updateToolbar ( current_window ) ;
@ -182,9 +184,12 @@ void CMainWindow::updateWindowsList()
{
QString window_file = QFileInfo ( subWindows . at ( i ) - > windowFilePath ( ) ) . fileName ( ) ;
QString action_text ;
if ( i < 9 ) {
if ( i < 9 )
{
action_text = QString ( " &%1 %2 " ) . arg ( i + 1 ) . arg ( window_file ) ;
} else {
}
else
{
action_text = QString ( " %1 %2 " ) . arg ( i + 1 ) . arg ( window_file ) ;
}
QAction * action = new QAction ( action_text , this ) ;
@ -194,7 +199,9 @@ void CMainWindow::updateWindowsList()
windowMenu - > addAction ( action ) ;
windowMapper - > setMapping ( action , subWindows . at ( i ) ) ;
}
} else {
}
else
{
windowMenu - > clear ( ) ;
}
}
@ -206,7 +213,7 @@ void CMainWindow::open()
settings - > beginGroup ( " translationmanager " ) ;
QString lastOpenLocation = settings - > value ( " lastOpenLocation " ) . toString ( ) ;
QString file_name = QFileDialog : : getOpenFileName ( this , tr ( " Open translation file " ) , lastOpenLocation , tr ( " Translation files (*txt) " ) ) ;
QFileInfo * file_info = new QFileInfo ( file_name ) ;
QFileInfo * file_info = new QFileInfo ( file_name ) ;
settings - > setValue ( " lastOpenLocation " , file_info - > absolutePath ( ) ) ;
settings - > endGroup ( ) ;
@ -218,9 +225,8 @@ void CMainWindow::open()
editor - > activateWindow ( ) ;
return ;
}
# ifndef QT_NO_CURSOR
QApplication : : setOverrideCursor ( Qt : : WaitCursor ) ;
# endif
// sheet editor
if ( isWorksheetEditor ( file_name ) )
{
@ -237,17 +243,14 @@ void CMainWindow::open()
new_window - > open ( file_name ) ;
new_window - > activateWindow ( ) ;
}
# ifndef QT_NO_CURSOR
QApplication : : restoreOverrideCursor ( ) ;
# endif
}
}
// Open a work file. You can set the directory for work file in the settings dialog
void CMainWindow : : openWorkFile ( QString file )
{
QFileInfo * file_path = new QFileInfo ( QString ( " %1/%2 " ) . arg ( work_path ) . arg ( file ) ) ;
QFileInfo * file_path = new QFileInfo ( QString ( " %1/%2 " ) . arg ( work_path ) . arg ( file ) ) ;
if ( file_path - > exists ( ) )
{
if ( isWorksheetEditor ( file_path - > filePath ( ) ) )
@ -256,31 +259,26 @@ void CMainWindow::openWorkFile(QString file)
new_window - > open ( file_path - > filePath ( ) ) ;
new_window - > activateWindow ( ) ;
}
} else {
}
else
{
QErrorMessage error ;
error . showMessage ( QString ( " The %1 file don't exists. " ) . arg ( file_path - > fileName ( ) ) ) ;
error . showMessage ( tr( " The %1 file don't exists. " ) . arg ( file_path - > fileName ( ) ) ) ;
error . exec ( ) ;
}
}
// Save signal
void CMainWindow : : save ( )
{
if ( _ui . mdiArea - > subWindowList ( ) . size ( ) > 0 )
{
CEditor * current_window = qobject_cast < CEditor * > ( _ui . mdiArea - > currentSubWindow ( ) ) ;
# ifndef QT_NO_CURSOR
CEditor * current_window = qobject_cast < CEditor * > ( _ui . mdiArea - > currentSubWindow ( ) ) ;
QApplication : : setOverrideCursor ( Qt : : WaitCursor ) ;
# endif
current_window - > save ( ) ;
# ifndef QT_NO_CURSOR
QApplication : : restoreOverrideCursor ( ) ;
# endif
}
}
// Save as signal
void CMainWindow : : saveAs ( )
{
QString file_name ;
@ -288,17 +286,12 @@ void CMainWindow::saveAs()
{
file_name = QFileDialog : : getSaveFileName ( this ) ;
}
if ( ! file_name . isEmpty ( ) )
{
CEditor * current_window = qobject_cast < CEditor * > ( _ui . mdiArea - > currentSubWindow ( ) ) ;
# ifndef QT_NO_CURSOR
CEditor * current_window = qobject_cast < CEditor * > ( _ui . mdiArea - > currentSubWindow ( ) ) ;
QApplication : : setOverrideCursor ( Qt : : WaitCursor ) ;
# endif
current_window - > saveAs ( file_name ) ;
# ifndef QT_NO_CURSOR
QApplication : : restoreOverrideCursor ( ) ;
# endif
}
}
@ -307,8 +300,8 @@ void CMainWindow::initializeSettings(bool georges = false)
{
if ( georges = = true & & initialize_settings [ " georges " ] = = false )
{
CPath: : addSearchPath ( level_design_path . toStdString ( ) + " /DFN " , true , false ) ;
CPath : : addSearchPath ( level_design_path . toStdString ( ) + " /Game_elem/Creature " , true , false ) ;
NLMISC: : CPath: : addSearchPath ( level_design_path . toStdString ( ) + " /DFN " , true , false ) ;
NLMISC : : CPath : : addSearchPath ( level_design_path . toStdString ( ) + " /Game_elem/Creature " , true , false ) ;
initialize_settings [ " georges " ] = true ;
}
@ -329,7 +322,6 @@ void CMainWindow::initializeSettings(bool georges = false)
nlerror ( " Can't found path to world_editor_classes.xml " ) ;
}
}
}
// Extracting words
@ -337,19 +329,22 @@ void CMainWindow::extractWords(QString typeq)
{
if ( verifySettings ( ) = = true )
{
CEditorWorksheet * editor_window = getEditorByWorksheetType ( typeq ) ;
CEditorWorksheet * editor_window = getEditorByWorksheetType ( typeq ) ;
if ( editor_window ! = NULL )
{
editor_window - > activateWindow ( ) ;
QString file_path = editor_window - > windowFilePath ( ) ;
} else {
}
else
{
openWorkFile ( typeq ) ;
editor_window = getEditorByWorksheetType ( typeq ) ;
if ( editor_window ! = NULL )
{
editor_window - > activateWindow ( ) ;
QString file_path = editor_window - > windowFilePath ( ) ;
} else return ;
}
else return ;
}
QString column_name ;
@ -358,48 +353,54 @@ void CMainWindow::extractWords(QString typeq)
// Primitives extraction
CRegionPrimWordListBuilder builderP ;
bool isSheet = false ;
if ( typeq . toAscii ( ) = = Constants : : WK_ITEM ) {
if ( typeq . toAscii ( ) = = Constants : : WK_ITEM )
{
column_name = " item ID " ;
builderS . SheetExt = " sitem " ;
builderS . SheetPath = level_design_path . append ( " /game_element/sitem " ) . toStdString ( ) ;
isSheet = true ;
} else if ( typeq . toAscii ( ) = = Constants : : WK_CREATURE ) {
}
else if ( typeq . toAscii ( ) = = Constants : : WK_CREATURE )
{
column_name = " creature ID " ;
builderS . SheetExt = " creature " ;
builderS . SheetPath = level_design_path . append ( " /Game_elem/Creature/fauna " ) . toStdString ( ) ;
isSheet = true ;
} else if ( typeq . toAscii ( ) = = Constants : : WK_SBRICK ) {
}
else if ( typeq . toAscii ( ) = = Constants : : WK_SBRICK )
{
column_name = " sbrick ID " ;
builderS . SheetExt = " sbrick " ;
builderS . SheetPath = level_design_path . append ( " /game_element/sbrick " ) . toStdString ( ) ;
isSheet = true ;
} else if ( typeq . toAscii ( ) = = Constants : : WK_SPHRASE ) {
}
else if ( typeq . toAscii ( ) = = Constants : : WK_SPHRASE )
{
column_name = " sphrase ID " ;
builderS . SheetExt = " sphrase " ;
builderS . SheetPath = level_design_path . append ( " /game_element/sphrase " ) . toStdString ( ) ;
isSheet = true ;
} else if ( typeq . toAscii ( ) = = Constants : : WK_PLACE ) {
}
else if ( typeq . toAscii ( ) = = Constants : : WK_PLACE )
{
column_name = " placeId " ;
builderP . PrimPath = primitives_path . toStdString ( ) ;
builderP . PrimFilter . push_back ( " region_*.primitive " ) ;
builderP . PrimFilter . push_back ( " indoors_*.primitive " ) ;
isSheet = false ;
}
# ifndef QT_NO_CURSOR
QApplication : : setOverrideCursor ( Qt : : WaitCursor ) ;
# endif
if ( isSheet )
{
editor_window - > extractWords ( editor_window - > windowFilePath ( ) , column_name , builderS ) ;
} else {
}
else
{
initializeSettings ( false ) ;
editor_window - > extractWords ( editor_window - > windowFilePath ( ) , column_name , builderP ) ;
}
# ifndef QT_NO_CURSOR
QApplication : : restoreOverrideCursor ( ) ;
# endif
}
}
// Extract bot names from primitives
@ -407,44 +408,44 @@ void CMainWindow::extractBotNames()
{
if ( verifySettings ( ) = = true )
{
CEditorWorksheet * editor_window = getEditorByWorksheetType ( NULL ) ;
CEditorWorksheet * editor_window = getEditorByWorksheetType ( NULL ) ;
if ( editor_window ! = NULL )
{
editor_window - > activateWindow ( ) ;
QString file_path = editor_window - > windowFilePath ( ) ;
} else {
}
else
{
openWorkFile ( Constants : : WK_BOTNAMES ) ;
editor_window = getEditorByWorksheetType ( NULL ) ;
if ( editor_window ! = NULL )
{
editor_window - > activateWindow ( ) ;
QString file_path = editor_window - > windowFilePath ( ) ;
} else return ;
}
# ifndef QT_NO_CURSOR
else return ;
}
QApplication : : setOverrideCursor ( Qt : : WaitCursor ) ;
# endif
initializeSettings ( true ) ;
editor_window - > extractBotNames ( convertQStringList ( filters ) , level_design_path . toStdString ( ) , ligoConfig ) ;
# ifndef QT_NO_CURSOR
QApplication : : restoreOverrideCursor ( ) ;
# endif
}
}
// Merge the content for 2 worksheet files
void CMainWindow : : mergeSingleFile ( )
{
CEditor * editor_window = qobject_cast < CEditor * > ( _ui . mdiArea - > currentSubWindow ( ) ) ;
CEditor * editor_window = qobject_cast < CEditor * > ( _ui . mdiArea - > currentSubWindow ( ) ) ;
CSourceDialog * dialog = new CSourceDialog ( this ) ;
CFtpSelection * ftp_dialog ;
map < QListWidgetItem * , int > methods ;
CFtpSelection * ftp_dialog ;
map < QListWidgetItem * , int > methods ;
QString file_name ;
if ( _ui . mdiArea - > subWindowList ( ) . size ( ) = = 0 )
{
QErrorMessage error ;
error . showMessage ( QS tring ( " Open a work file in editor for merge operation. " ) ) ;
error . showMessage ( tr( " Open a work file in editor for merge operation. " ) ) ;
error . exec ( ) ;
return ;
}
@ -452,16 +453,16 @@ void CMainWindow::mergeSingleFile()
if ( editor_window - > eType ( ) ! = Constants : : ED_SHEET ) // Sheet Editor
{
QErrorMessage error ;
error . showMessage ( QS tring ( " Please open or activate the window with a sheet file. " ) ) ;
error . showMessage ( tr( " Please open or activate the window with a sheet file. " ) ) ;
error . exec ( ) ;
return ;
}
// create items
QListWidgetItem * local_item = new QListWidgetItem ( ) ;
QListWidgetItem * local_item = new QListWidgetItem ( ) ;
local_item - > setText ( " Local directory " ) ;
methods [ local_item ] = 0 ;
QListWidgetItem * ftp_item = new QListWidgetItem ( ) ;
QListWidgetItem * ftp_item = new QListWidgetItem ( ) ;
ftp_item - > setText ( " From a FTP server " ) ;
methods [ ftp_item ] = 1 ;
@ -475,7 +476,7 @@ void CMainWindow::mergeSingleFile()
}
else if ( dialog - > selected_item = = ftp_item ) // Ftp directory
{
CFtpSelection * ftp_dialog = new CFtpSelection ( this ) ;
CFtpSelection * ftp_dialog = new CFtpSelection ( this ) ;
ftp_dialog - > show ( ) ;
if ( ftp_dialog - > exec ( ) & & ftp_dialog - > status = = true )
@ -491,26 +492,30 @@ void CMainWindow::mergeSingleFile()
return ;
editor_window - > activateWindow ( ) ;
CEditorWorksheet * current_window = qobject_cast < CEditorWorksheet * > ( editor_window ) ;
CEditorWorksheet * current_window = qobject_cast < CEditorWorksheet * > ( editor_window ) ;
if ( current_window - > windowFilePath ( ) = = file_name )
return ;
if ( current_window - > compareWorksheetFile ( file_name ) )
{
current_window - > mergeWorksheetFile ( file_name ) ;
} else {
}
else
{
QErrorMessage error ;
error . showMessage ( tr ( " The file: %1 has different columns from the current file in editor. " ) . arg ( file_name ) ) ;
error . exec ( ) ;
}
if ( dialog - > selected_item = = ftp_item )
{
/*
// TODO: uninit ftp_dialog?????
if ( ! ftp_dialog - > file - > remove ( ) )
{
QErrorMessage error ;
error . showMessage ( tr ( " Please remove the file from ftp server manually. The file is located on the same directory with OVQT application. " ) ) ;
error . exec ( ) ;
}
*/
}
}
@ -544,9 +549,7 @@ bool CMainWindow::verifySettings()
error_settings . exec ( ) ;
count_errors = true ;
}
return ! count_errors ;
}
bool CCoreListener : : closeMainWindow ( ) const
@ -554,12 +557,13 @@ bool CCoreListener::closeMainWindow() const
bool okToClose = true ;
Q_FOREACH ( QMdiSubWindow * subWindow , m_MainWindow - > _ui . mdiArea - > subWindowList ( ) )
{
CEditor * currentEditor = qobject_cast < CEditor * > ( subWindow ) ;
CEditor * currentEditor = qobject_cast < CEditor * > ( subWindow ) ;
if ( subWindow - > isWindowModified ( ) )
{
QMessageBox msgBox ;
msgBox . setIcon ( QMessageBox : : Question ) ;
msgBox . setText ( tr ( " The document has been modified ( %1 ). " ) . arg ( currentEditor - > windowFilePath ( ) ) ) ;
msgBox . setInformativeText ( " Do you want to save your changes? " ) ;
msgBox . setInformativeText ( tr ( " Do you want to save your changes? " ) ) ;
msgBox . setStandardButtons ( QMessageBox : : Save | QMessageBox : : Discard | QMessageBox : : Cancel ) ;
msgBox . setDefaultButton ( QMessageBox : : Save ) ;
int ret = msgBox . exec ( ) ;
@ -594,16 +598,19 @@ CEditorWorksheet *CMainWindow::getEditorByWorksheetType(const QString &type)
{
Q_FOREACH ( QMdiSubWindow * subWindow , _ui . mdiArea - > subWindowList ( ) )
{
CEditor * currentEditor = qobject_cast < CEditor * > ( subWindow ) ;
CEditor * currentEditor = qobject_cast < CEditor * > ( subWindow ) ;
if ( currentEditor - > eType ( ) = = Constants : : ED_SHEET )
{
CEditorWorksheet * editor = qobject_cast < CEditorWorksheet * > ( currentEditor ) ;
if ( type ! = NULL ) {
if ( type ! = NULL )
{
if ( editor - > isSheetTable ( type ) )
{
return editor ;
}
} else {
}
else
{
if ( editor - > isBotNamesTable ( ) )
{
return editor ;
@ -614,8 +621,7 @@ CEditorWorksheet *CMainWindow::getEditorByWorksheetType(const QString &type)
return NULL ;
}
list < string > CMainWindow : : convertQStringList ( QStringList listq )
std : : list < std : : string > CMainWindow : : convertQStringList ( QStringList listq )
{
std : : list < std : : string > stdlist ;
@ -623,7 +629,6 @@ list<string> CMainWindow::convertQStringList(QStringList listq)
{
stdlist . push_back ( text . toStdString ( ) ) ;
}
return stdlist ;
}
@ -635,19 +640,13 @@ bool CMainWindow::isWorksheetEditor(QString filename)
if ( wk_file . ColCount > 1 )
return true ;
}
return false ;
}
bool CMainWindow : : isPhraseEditor ( QString filename )
{
vector < STRING_MANAGER : : TPhrase > phrases ;
if ( readPhraseFile ( filename . toStdString ( ) , phrases , false ) )
{
return true ;
} else {
return false ;
}
return readPhraseFile ( filename . toStdString ( ) , phrases , false ) ;
}
} /* namespace TranslationManager */