summaryrefslogtreecommitdiffstats
path: root/client/browser/src/main.cpp
blob: 2104e652961d109099d4dd1b6c3ea66a9291a11c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <QtGui/QApplication>
#include <stdio.h>
#include "mainwindow.h"
#include <Qt/qtextcodec.h>
// Internacionalización con GNU Gettext.
#include <libintl.h>
#define TEXTDOMAIN "browser"
#define LOCALEDIR "/opt/opengnsys/lib/locale"
#define CHARSET "UTF-8"

int main(int argc, char *argv[])
{
    // Preparar internacionalización.
    setlocale (LC_ALL, "");
    bindtextdomain (TEXTDOMAIN, LOCALEDIR);
    textdomain (TEXTDOMAIN);

    if(argc<=1)
    {
        printf(gettext("Uso: %s -qws http://sitioweb.com/\n"),argv[0]);
        return -1;
    }
    // Codificación de caracteres.
    QTextCodec::setCodecForTr(QTextCodec::codecForName(CHARSET));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName(CHARSET));
    QTextCodec::setCodecForLocale(QTextCodec::codecForName(CHARSET));
 
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    return a.exec();
}