2019-03-19 05:59:24 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file GuiLyXFiles.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Jürgen Spitzmüller
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GUILYXFILES_H
|
|
|
|
#define GUILYXFILES_H
|
|
|
|
|
|
|
|
#include "GuiDialog.h"
|
|
|
|
#include "FancyLineEdit.h"
|
|
|
|
#include "ui_LyXFilesUi.h"
|
|
|
|
|
2019-03-21 09:28:16 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2019-03-19 05:59:24 +00:00
|
|
|
class QListWidgetItem;
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
class Format;
|
|
|
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class GuiLyXFiles : public GuiDialog, public Ui::LyXFilesUi
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
GuiLyXFiles(GuiView & lv);
|
2019-03-22 13:11:46 +00:00
|
|
|
/// A way to pass params to the dialog directly
|
|
|
|
void passParams(std::string const & data);
|
|
|
|
/// A way to pass params to the dialog directly
|
|
|
|
void selectItem(QString const item);
|
|
|
|
Q_SIGNALS:
|
|
|
|
void fileSelected(QString const file);
|
2019-03-19 05:59:24 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void changed_adaptor();
|
|
|
|
void on_fileTypeCO_activated(int);
|
2019-03-19 16:55:19 +00:00
|
|
|
void on_languageCO_activated(int);
|
2019-03-19 05:59:24 +00:00
|
|
|
void on_filesLW_itemDoubleClicked(QTreeWidgetItem *, int);
|
2019-03-21 08:13:09 +00:00
|
|
|
void on_filesLW_itemClicked(QTreeWidgetItem *, int);
|
2019-03-19 05:59:24 +00:00
|
|
|
void on_browsePB_pressed();
|
|
|
|
void slotButtonBox(QAbstractButton *);
|
|
|
|
void filterLabels();
|
|
|
|
void resetFilter();
|
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
bool isValid();
|
|
|
|
/// Apply from dialog
|
|
|
|
void applyView();
|
|
|
|
/// Update the dialog
|
|
|
|
void updateContents();
|
|
|
|
|
|
|
|
///
|
|
|
|
bool initialiseParams(std::string const & data);
|
|
|
|
///
|
2019-03-19 15:58:23 +00:00
|
|
|
void paramsToDialog();
|
2019-03-19 05:59:24 +00:00
|
|
|
///
|
|
|
|
void clearParams() {}
|
|
|
|
///
|
|
|
|
void dispatchParams();
|
|
|
|
///
|
|
|
|
bool isBufferDependent() const { return false; }
|
|
|
|
///
|
2019-03-19 12:29:32 +00:00
|
|
|
FuncCode getLfun() const;
|
|
|
|
///
|
|
|
|
QString const getSuffix();
|
|
|
|
///
|
2019-03-19 15:58:23 +00:00
|
|
|
bool translateName() const;
|
|
|
|
///
|
2019-03-21 18:23:33 +00:00
|
|
|
QMap<QString, QString> getFiles();
|
2019-03-21 08:13:09 +00:00
|
|
|
/// Get the full file path in the selected localization
|
2019-03-21 13:18:03 +00:00
|
|
|
QString const getRealPath(QString relpath = QString());
|
2019-03-21 12:40:11 +00:00
|
|
|
///
|
|
|
|
void setLanguage();
|
2019-03-19 05:59:24 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// contains the search box
|
|
|
|
FancyLineEdit * filter_;
|
|
|
|
///
|
|
|
|
QString type_;
|
|
|
|
///
|
|
|
|
QString file_;
|
2019-03-21 08:13:09 +00:00
|
|
|
/// All languages (code, guiname)
|
|
|
|
QMap<QString, QString> all_languages_;
|
|
|
|
/// Languages available for files (code. guiname)
|
|
|
|
QMap<QString, QString> available_languages_;
|
2019-03-19 16:55:19 +00:00
|
|
|
///
|
2019-03-21 08:13:09 +00:00
|
|
|
typedef QMap<QString, QMap<QString, QString>> localizationsMap;
|
|
|
|
///
|
|
|
|
localizationsMap localizations_;
|
|
|
|
/// Possible GUI language representations
|
|
|
|
std::vector<std::string> guilangs_;
|
|
|
|
/// The real GUI lang as stored in available_languages_
|
|
|
|
QString guilang_;
|
|
|
|
/// The last used language
|
|
|
|
QString savelang_;
|
2019-03-19 05:59:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // GUILYXFILES_H
|