mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-22 11:17:31 +01:00
support for localization for help files
This commit is contained in:
parent
95ec6f68c6
commit
3c22a8fe31
@ -1,11 +1,14 @@
|
||||
2008-08-02 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* iptAdvancedDialog.html: Added help file for the firewall
|
||||
* iptAdvancedDialog_en_US.html: Added help file for the firewall
|
||||
settings dialog for iptables firewalls
|
||||
|
||||
* Help.cpp (Help::Help): generic built-in help framework. Help
|
||||
files are created in .html format in src/res/help directory. First
|
||||
dialog to get associated help panel that can be activated by
|
||||
files are created in .html format in src/res/help directory. Help
|
||||
files can be localized, locale name is part of the file name; we
|
||||
need to create separate file for each supported language.
|
||||
|
||||
First dialog to get associated help panel that can be activated by
|
||||
clicking "Help" button is Linux 2.4/2.6 firewall host settings
|
||||
dialog.
|
||||
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QTextStream>
|
||||
#include <QLocale>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -43,9 +45,12 @@ Help::Help(QWidget *parent, const QString &help_file, const QString &title) :
|
||||
resize(500, 600);
|
||||
raise();
|
||||
|
||||
QString locale = QLocale::system().name(); //"en_US";
|
||||
|
||||
QFile f;
|
||||
QTextStream ts;
|
||||
f.setFileName(QString(respath.c_str()) + "/help/" + help_file);
|
||||
f.setFileName(QString(respath.c_str()) + "/help/" + help_file +
|
||||
"_" + locale + ".html");
|
||||
|
||||
if (f.exists())
|
||||
{
|
||||
|
||||
@ -44,7 +44,6 @@
|
||||
#include <qregexp.h>
|
||||
#include <qtextedit.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace libfwbuilder;
|
||||
|
||||
@ -232,8 +231,7 @@ void iptAdvancedDialog::editEpilog()
|
||||
|
||||
void iptAdvancedDialog::help()
|
||||
{
|
||||
Help *h = new Help(this, "iptAdvancedDialog.html",
|
||||
"Firewall platform: iptables");
|
||||
Help *h = new Help(this, "iptAdvancedDialog", "Firewall platform: iptables");
|
||||
h->show();
|
||||
}
|
||||
|
||||
|
||||
@ -184,8 +184,7 @@ void linux24AdvancedDialog::reject()
|
||||
|
||||
void linux24AdvancedDialog::help()
|
||||
{
|
||||
Help *h = new Help(this, "linux24AdvancedDialog.html",
|
||||
"Host type Linux 2.4/2.6");
|
||||
Help *h = new Help(this, "linux24AdvancedDialog", "Host type Linux 2.4/2.6");
|
||||
h->show();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user