~jl2/Google-Translate-Qt-GUI

d1add176764f52b476401c9fc667dc793cc918c3 — Jeremiah LaRocco 12 years ago 5049c90
Removed unnecessary files added accidently.
4 files changed, 0 insertions(+), 383 deletions(-)

D Makefile
D gtrans.pl
D moc_gtrans.cpp
D qgtrans
D Makefile => Makefile +0 -211
@@ 1,211 0,0 @@
#############################################################################
# Makefile for building: qgtrans
# Generated by qmake (2.01a) (Qt 4.5.3) on: Thu Mar 18 18:56:43 2010
# Project:  qgtrans.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile qgtrans.pro
#############################################################################

####### Compiler, tools and options

CC            = gcc
CXX           = g++
DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.
LINK          = g++
LFLAGS        = -Wl,-O1
LIBS          = $(SUBLIBS)  -L/usr/lib -lQtGui -lQtNetwork -lQtCore -lpthread
AR            = ar cqs
RANLIB        = 
QMAKE         = /usr/bin/qmake
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
SED           = sed
COPY_FILE     = $(COPY)
COPY_DIR      = $(COPY) -r
INSTALL_FILE  = install -m 644 -p
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE      = rm -f
SYMLINK       = ln -sf
DEL_DIR       = rmdir
MOVE          = mv -f
CHK_DIR_EXISTS= test -d
MKDIR         = mkdir -p

####### Output directory

OBJECTS_DIR   = ./

####### Files

SOURCES       = gtrans.cpp \
		main.cpp moc_gtrans.cpp
OBJECTS       = gtrans.o \
		main.o \
		moc_gtrans.o
DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
		/usr/share/qt4/mkspecs/common/unix.conf \
		/usr/share/qt4/mkspecs/common/linux.conf \
		/usr/share/qt4/mkspecs/qconfig.pri \
		/usr/share/qt4/mkspecs/features/qt_functions.prf \
		/usr/share/qt4/mkspecs/features/qt_config.prf \
		/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
		/usr/share/qt4/mkspecs/features/default_pre.prf \
		/usr/share/qt4/mkspecs/features/release.prf \
		/usr/share/qt4/mkspecs/features/default_post.prf \
		/usr/share/qt4/mkspecs/features/warn_on.prf \
		/usr/share/qt4/mkspecs/features/qt.prf \
		/usr/share/qt4/mkspecs/features/unix/thread.prf \
		/usr/share/qt4/mkspecs/features/moc.prf \
		/usr/share/qt4/mkspecs/features/resources.prf \
		/usr/share/qt4/mkspecs/features/uic.prf \
		/usr/share/qt4/mkspecs/features/yacc.prf \
		/usr/share/qt4/mkspecs/features/lex.prf \
		/usr/share/qt4/mkspecs/features/include_source_dir.prf \
		qgtrans.pro
QMAKE_TARGET  = qgtrans
DESTDIR       = 
TARGET        = qgtrans

first: all
####### Implicit rules

.SUFFIXES: .o .c .cpp .cc .cxx .C

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.cc.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.C.o:
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.c.o:
	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  $(OBJECTS)  
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

Makefile: qgtrans.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
		/usr/share/qt4/mkspecs/common/unix.conf \
		/usr/share/qt4/mkspecs/common/linux.conf \
		/usr/share/qt4/mkspecs/qconfig.pri \
		/usr/share/qt4/mkspecs/features/qt_functions.prf \
		/usr/share/qt4/mkspecs/features/qt_config.prf \
		/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
		/usr/share/qt4/mkspecs/features/default_pre.prf \
		/usr/share/qt4/mkspecs/features/release.prf \
		/usr/share/qt4/mkspecs/features/default_post.prf \
		/usr/share/qt4/mkspecs/features/warn_on.prf \
		/usr/share/qt4/mkspecs/features/qt.prf \
		/usr/share/qt4/mkspecs/features/unix/thread.prf \
		/usr/share/qt4/mkspecs/features/moc.prf \
		/usr/share/qt4/mkspecs/features/resources.prf \
		/usr/share/qt4/mkspecs/features/uic.prf \
		/usr/share/qt4/mkspecs/features/yacc.prf \
		/usr/share/qt4/mkspecs/features/lex.prf \
		/usr/share/qt4/mkspecs/features/include_source_dir.prf \
		/usr/lib/libQtGui.prl \
		/usr/lib/libQtNetwork.prl \
		/usr/lib/libQtCore.prl
	$(QMAKE) -unix -o Makefile qgtrans.pro
/usr/share/qt4/mkspecs/common/g++.conf:
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
/usr/share/qt4/mkspecs/features/default_pre.prf:
/usr/share/qt4/mkspecs/features/release.prf:
/usr/share/qt4/mkspecs/features/default_post.prf:
/usr/share/qt4/mkspecs/features/warn_on.prf:
/usr/share/qt4/mkspecs/features/qt.prf:
/usr/share/qt4/mkspecs/features/unix/thread.prf:
/usr/share/qt4/mkspecs/features/moc.prf:
/usr/share/qt4/mkspecs/features/resources.prf:
/usr/share/qt4/mkspecs/features/uic.prf:
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/libQtGui.prl:
/usr/lib/libQtNetwork.prl:
/usr/lib/libQtCore.prl:
qmake:  FORCE
	@$(QMAKE) -unix -o Makefile qgtrans.pro

dist: 
	@$(CHK_DIR_EXISTS) .tmp/qgtrans1.0.0 || $(MKDIR) .tmp/qgtrans1.0.0 
	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/qgtrans1.0.0/ && $(COPY_FILE) --parents gtrans.h .tmp/qgtrans1.0.0/ && $(COPY_FILE) --parents gtrans.cpp main.cpp .tmp/qgtrans1.0.0/ && (cd `dirname .tmp/qgtrans1.0.0` && $(TAR) qgtrans1.0.0.tar qgtrans1.0.0 && $(COMPRESS) qgtrans1.0.0.tar) && $(MOVE) `dirname .tmp/qgtrans1.0.0`/qgtrans1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/qgtrans1.0.0


clean:compiler_clean 
	-$(DEL_FILE) $(OBJECTS)
	-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
	-$(DEL_FILE) $(TARGET) 
	-$(DEL_FILE) Makefile


mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all: moc_gtrans.cpp
compiler_moc_header_clean:
	-$(DEL_FILE) moc_gtrans.cpp
moc_gtrans.cpp: gtrans.h
	/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gtrans.h -o moc_gtrans.cpp

compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
	-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean 

####### Compile

gtrans.o: gtrans.cpp gtrans.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o gtrans.o gtrans.cpp

main.o: main.cpp gtrans.h
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp

moc_gtrans.o: moc_gtrans.cpp 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_gtrans.o moc_gtrans.cpp

####### Install

install:   FORCE

uninstall:   FORCE

FORCE:


D gtrans.pl => gtrans.pl +0 -96
@@ 1,96 0,0 @@
#!/usr/bin/perl

use strict;
use warnings;

require LWP::UserAgent;
use Getopt::Long qw(:config pass_through);
use URI::Escape;
use HTML::Entities;

my %languages = ('french'=>'fr', 'spanish'=>'es', 'afrikaans'=>'af', 'albanian'=>'sq',
'arabic'=>'ar', 'belarusian'=>'be', 'bulgarian'=>'bg', 'catalan'=>'ca', 'chinese'=>'zh-cn',
'croatian'=>'hr', 'czech'=>'cs', 'danish'=>'da', 'dutch'=>'nl', 'english'=>'en', 'estonian'=>'et',
'filipino'=>'tl', 'finnish'=>'fi', 'french'=>'fr', 'galician'=>'gl', 'german'=>'de', 'greek'=>'el',
'haitian creole alpha'=>'ht', 'hebrew'=>'iw', 'hindi'=>'hi', 'hungarian'=>'hu', 'icelandic'=>'is',
'indonesian'=>'id', 'irish'=>'ga', 'italian'=>'it', 'japanese'=>'ja', 'korean'=>'ko',
'latvian'=>'lv', 'lithuanian'=>'lt', 'macedonian'=>'mk', 'malay'=>'ms', 'maltese'=>'mt',
'norwegian'=>'no', 'persian'=>'fa', 'polish'=>'pl', 'portuguese'=>'pt', 'romanian'=>'ro',
'russian'=>'ru', 'serbian'=>'sr', 'slovak'=>'sk', 'slovenian'=>'sl', 'spanish'=>'es',
'swahili'=>'sw', 'swedish'=>'sv', 'thai'=>'th', 'turkish'=>'tr', 'ukrainian'=>'uk',
'vietnamese'=>'vi', 'welsh'=>'cy', 'yiddish'=>'yi', );

sub usage {
    my $usage_str = <<END;

Valid command line arguments are:

   $0  [--to <language>] [--from <language>] text...

Optional arguments controlling translation languages:

   --to     Sets the language to translate to
            The default value is English (en)

   --from   Sets the language to translate from
            The default value is French (fr)

Languages can be specified by name (i.e. French) or by their abbreviation (i.e. fr).

Valid languages are:

END
    print $usage_str;
    my $curLine = '';
    
    for my $key (sort keys %languages) {
        $curLine = sprintf('%s %20s %7s  ', $curLine, $key, '('.$languages{$key}.')');
        if (length($curLine)>100) {
            print "$curLine\n";
            $curLine = '';
        }
    }
    print "$curLine\n";
}

sub main {
    my $help;
    my $to = 'en';
    my $from = 'fr';
    
    GetOptions('help!'=>\$help,
               'to=s'=>\$to,
               'from=s'=>\$from);

    if ($help || $#ARGV==-1) {
        usage;
        exit(0);
    }

    if ($languages{lc $from}) {
        $from = $languages{lc $from};
    }
    if ($languages{lc $to}) {
        $to = $languages{lc $to};
    }

    my @words = @ARGV;
    map uri_escape, @words;
    my $url = "http://translate.google.com/translate_t?langpair=$from|$to&text=" . join('+', @words);

    my $ua = LWP::UserAgent->new;
    $ua->agent('');

    my $res = $ua->get($url);
    if ($res->is_success) {
        if ($res->content =~ /<textarea name=utrans wrap=SOFT dir="ltr" id=suggestion style="width:80%;margin:5px 0;overflow:auto">(.*?)<\/textarea>/) {
            my $translated = decode_entities($1);
            print "$translated\n";
        }
    }
    else {
        die $res->status_line;
    }
}

main;

D moc_gtrans.cpp => moc_gtrans.cpp +0 -76
@@ 1,76 0,0 @@
/****************************************************************************
** Meta object code from reading C++ file 'gtrans.h'
**
** Created: Thu Mar 18 18:56:47 2010
**      by: The Qt Meta Object Compiler version 61 (Qt 4.5.3)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "gtrans.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'gtrans.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 61
#error "This file was generated using the moc from 4.5.3. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_GTrans[] = {

 // content:
       2,       // revision
       0,       // classname
       0,    0, // classinfo
       2,   12, // methods
       0,    0, // properties
       0,    0, // enums/sets
       0,    0, // constructors

 // slots: signature, parameters, type, tag, flags
       8,    7,    7,    7, 0x0a,
      24,   18,    7,    7, 0x0a,

       0        // eod
};

static const char qt_meta_stringdata_GTrans[] = {
    "GTrans\0\0doTrans()\0reply\0"
    "finishedSlot(QNetworkReply*)\0"
};

const QMetaObject GTrans::staticMetaObject = {
    { &QWidget::staticMetaObject, qt_meta_stringdata_GTrans,
      qt_meta_data_GTrans, 0 }
};

const QMetaObject *GTrans::metaObject() const
{
    return &staticMetaObject;
}

void *GTrans::qt_metacast(const char *_clname)
{
    if (!_clname) return 0;
    if (!strcmp(_clname, qt_meta_stringdata_GTrans))
        return static_cast<void*>(const_cast< GTrans*>(this));
    return QWidget::qt_metacast(_clname);
}

int GTrans::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: doTrans(); break;
        case 1: finishedSlot((*reinterpret_cast< QNetworkReply*(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
QT_END_MOC_NAMESPACE

D qgtrans => qgtrans +0 -0