7 aQt programming Introduction Qt is a cross

  • Slides: 49
Download presentation
7 a)Qt programming. Introduction • Qt is a cross platform development framework written in

7 a)Qt programming. Introduction • Qt is a cross platform development framework written in C++. • Qt is built from modules. • All modules have a common scheme and are built from the same API design ideas. Sakthivel Velusamy AP/CSE 1

Contd… • Qt extends C++ with macros and introspection. • The Purpose of Qt

Contd… • Qt extends C++ with macros and introspection. • The Purpose of Qt – Cross platform applications built from one source – Builds native applications with native look and feel – Easy to (re)use API, high developer productivity, openess, fun to use. • Example : Hello World Sakthivel Velusamy AP/CSE 2

Contd… Sakthivel Velusamy AP/CSE 3

Contd… Sakthivel Velusamy AP/CSE 3

Contd… • The Qobject – QObject is the base class of almost all Qt

Contd… • The Qobject – QObject is the base class of almost all Qt classes and all widgets – It contains many of the mechanisms that make up Qt • • Events signals and slots Properties memory management • QObject is the base class to most Qt classes. Sakthivel Velusamy AP/CSE 4

Contd… • Examples of exceptions are: • Classes that need to be lightweight such

Contd… • Examples of exceptions are: • Classes that need to be lightweight such as graphical primitives • Data containers (QString, QList, QChar, etc) • Classes that needs to be copyable, as Qobjects cannot be copied Sakthivel Velusamy AP/CSE 5

Meta. Data • Qt implements introspection in C++ • Every QObject has a meta

Meta. Data • Qt implements introspection in C++ • Every QObject has a meta object • The meta object knows about – class name (QObject: : class. Name) – inheritance (QObject: : inherits) – Properties – signals and slots – general information (QObject: : class. Info) Sakthivel Velusamy AP/CSE 6

Contd… • The meta data is gathered at compile time by the meta object

Contd… • The meta data is gathered at compile time by the meta object compiler, moc. Sakthivel Velusamy AP/CSE 7

Contd… • The moc harvests data from your headers. Sakthivel Velusamy AP/CSE 8

Contd… • The moc harvests data from your headers. Sakthivel Velusamy AP/CSE 8

Contd… Sakthivel Velusamy AP/CSE 9

Contd… Sakthivel Velusamy AP/CSE 9

Signals and Slots vs Callbacks • A callback is a pointer to a function

Signals and Slots vs Callbacks • A callback is a pointer to a function that is called when an event occurs, any function can be assigned to a callback – No type-safety – Always works as a direct call • Signals and Slots are more dynamic – A more generic mechanism – Easier to interconnect two existing classes – Less knowledge shared between involved classes Sakthivel Velusamy AP/CSE 10

What is a slot? • A slot is defined in one of the slots

What is a slot? • A slot is defined in one of the slots sections • A slot can return values, but not through connections • Any number of signals can be connected to a slot • It is implemented as an ordinary method • It can be called as an ordinary method Sakthivel Velusamy AP/CSE 11

What is a signal? • A signal is defined in the signals section •

What is a signal? • A signal is defined in the signals section • • A signal always returns void A signal must not be implemented – The moc provides an implementation A signal can be connected to any number of slots Usually results in a direct call, but can be passed as events between threads, or even over sockets (using 3 rd party classes) The slots are activated in arbitrary order A signal is emitted using the emit keyword • • Sakthivel Velusamy AP/CSE 12

Making the connection • QObject: : connect( src, SIGNAL( signature ), dest, SLOT( signature

Making the connection • QObject: : connect( src, SIGNAL( signature ), dest, SLOT( signature ) ); • Qt can ignore arguments, but not create values from nothing Sakthivel Velusamy AP/CSE 13

Contd… Sakthivel Velusamy AP/CSE 14

Contd… Sakthivel Velusamy AP/CSE 14

8 b)Programming GUI applications with Software Localization Tools -Topics • • Localization Tools What

8 b)Programming GUI applications with Software Localization Tools -Topics • • Localization Tools What do localization tools do? How to select the localization tool? Localization Vs Translation Localization tools (examples) Comparing Tools Used in Software Localization

Localization "localization involves taking a product and making it linguistically and culturally appropriate to

Localization "localization involves taking a product and making it linguistically and culturally appropriate to the target locale where it will be used and sold". Esselink (2000: 3) • What does that mean? – linguistic content is culturally appropriate – graphical elements are culturally appropriate, too – units of measurement are appropriate & consistent • Is it a new industry? – relatively: less than 20 years old • What is being localized? – software – documentation – websites – advertising material etc

Localization … involves taking a product and making it linguistically and culturally appropriate to

Localization … involves taking a product and making it linguistically and culturally appropriate to the target locale (country/region and language) where it will be used and sold. (LISA) … means the linguistic and cultural adaptation of digital content to the requirements of a foreign market (Schäler 2005) … is the adaptation of products or services to the cultural, legal, linguistic, and technical requirements of a specific locale. (Lionbridge)

Localization Tools Localization tools group a number of important localizing functions together for ease

Localization Tools Localization tools group a number of important localizing functions together for ease of use: • Provide resource editing without the use of a software IDE • Integrate resource editing with translation memory and terminology manager functions. • Provide protection to software elements that should not be changed • support workflow functions integrating with localization project management (review, sign-off) The focus is on supporting resource editing of rc, res, and binary (dll, exe) resources. Some tools (Catalyst) will support web page and help file localization as well.

Localization Tools In general, localization tools are highly specialized applications for the Localization (L

Localization Tools In general, localization tools are highly specialized applications for the Localization (L 10 N) of software. The main source and target formats: resource files (RC) or binary files such as EXE or DLL usually do not contain long translatable text strings surrounded by non-translatable code. Localization tools have to extract these short strings properly, provide a convenient graphical user interface (GUI) for the translation of the strings and save the translations correctly back into the surrounding code. In this process, special attention has to be paid to controls embedded in the translatable text like ampersands (&) and shortcuts (e. g. Alt+D), which have to be translated both unique and easy memorable. Another specialty of software localization is that translated strings should be about the same size as the original text. This is because the translated text needs to fit into the appropriate spaces of dialog windows.

Localization Tools (Cont’d) If a size-equivalent translation is not possible, resizing procedures for the

Localization Tools (Cont’d) If a size-equivalent translation is not possible, resizing procedures for the dialog boxes have to be offered. Real complex translation memories are usually unnecessary for short text strings. A bi- or multilingual terminology base or glossary is usually sufficient. In contrary, software documentation files (Windows Help format HLP, HTML Help format CHM, Web pages HTML or Adobe Acrobat PDF) contain much more translatable text in much longer text strings. These files are usually better handled by a translation memory (TM) software, which memorizes already used phrases, typically segmented by full-stops, and enable their recycling. TM software usually implements some fuzzy match algorithm to identify the degree of concordance between a new and an already translated segment and allows their insertion into and editing in the authoring environment.

What do localization tools do? • Work with a wide range of file formats,

What do localization tools do? • Work with a wide range of file formats, separating localizable content from formatting info or code • Allow non-IT gurus to set up and manage localization projects • Enable creation of projects with as many source files as necessary • Ensure confidentiality of source and target products • Reduce the workload of computer programmers • Provide statistics useful for quotes • Work with exact/fuzzy matches (like TM tools) • Are capable of exchanging information with TM tools (dictionaries, translation memories, source segments)

Selection of Localization tools Client Requirements: Which deliverables are required by the publisher what

Selection of Localization tools Client Requirements: Which deliverables are required by the publisher what is the format of existing translation memories? If the Publisher is to supply the localization vendor which translation memories. Supported Languages: Each tool supports different feature sets and language sets. Make sure all target languages for current and possible future projects are supported by the tools chosen. Source file format: Each tool has different filter sets and parsers for supported files formats. Ensure that the source file format used in the project is supported. Support: How much support will be required for the translators using the tool? Will it be possible to support them fully? Costs: How many product license are needed? Are they available, and if not how much will the additional licenses cost? Alignment: If previous translations do exist, but no translation memories, the translated files need to be aligned in order to create a translation memory. Network Support: Does the tool allow translation memories to be shared over network? Which network protocols are supported? Customization: Does the tool contain features that enable the users to customize standard filter quickly or create filters for custom file formats?

Translation Memory and Localization is usually done with a translation memory. The decision to

Translation Memory and Localization is usually done with a translation memory. The decision to use a translation memory has to be made on the basis of volume and repeatability. Do you have an expectation of continued commissions from the same client, and of stable domain and text type. A translation memory may be made available to you from the localization vendor. Localization Tool (translator) Trados STAR Transit SDLX Translation Manager Wordfast A translation memory is a data bank in which a source text and the corresponding target text are recorded in the form of translation units. This memory - the basis of CAT software - makes it possible to find passages that have already been translated automatically, or to find modified passages that it then submits to the translator for updating. For translation memory to work the units have to be aligned.

Translation Memory and Localization Translation memories are useful in software localization because of the

Translation Memory and Localization Translation memories are useful in software localization because of the short life span of versions / web sites. There are often multiple short-lived versions with significant amounts of reusable materials. new version uses 70% same text translation memory 30% change Version 2 latest version uses 80% same text as previous 20% change Version 3 Version 1 REUSABILITY Initial translation with TM tool 9/25/2021 24

Localization Tools • • • Alchemy CATALYST: Alchemy CATALYST is an integrated translation environment

Localization Tools • • • Alchemy CATALYST: Alchemy CATALYST is an integrated translation environment with powerful project management features. PASSOLO: PASSOLO optimizes the complete software localization process. It ensures easy compilation, exchange and processing of translation data. RC-Win. Trans: Full featured translation environment to localize the Graphic User Interface (GUI) of Microsoft Windows software. TRADOS: TRADOS has been developing open platforms for multilingual content management and is well positioned as the Global Market Leader in Translation Technology. STAR Transit & Term. Star: A Comprehensive Infrastructure for the Globalization of Product Information.

6 a)Introduction and Installation of Apache Server

6 a)Introduction and Installation of Apache Server

Introduction to Apache • Apache is a web server package that works under Linux

Introduction to Apache • Apache is a web server package that works under Linux as well as under other operating systems • The name Apache comes from the concept of extensive patching of existing code • The primary advantage of Apache is that it is generally free or available at modest costs

Installing Apache From a CD-ROM • If your CD-ROM has Apache and you want

Installing Apache From a CD-ROM • If your CD-ROM has Apache and you want to use RPM to install the package, issue this command – rpm –i apache_1_3_4. rpm (substitute the full name of the Apache package)

Installing Apache From a Download • Place the downloaded files in a location that

Installing Apache From a Download • Place the downloaded files in a location that will be dedicated to the Apache files, such as /usr/apache • Uncompress the files using either gzip or tar and compress • You must edit the configuration file – You can find more information about this in the Readme file

Installing Apache… (con’t) • Uncomment all the Modules in the configuration file except –

Installing Apache… (con’t) • Uncomment all the Modules in the configuration file except – cern_meta_module – msql_auth_module – dld_module • Choose either db_auth_module or dbm_auth_module; they should not be used together

Installing Apache… (con’t) • Create the configuration file for Linux by issuing the command

Installing Apache… (con’t) • Create the configuration file for Linux by issuing the command – Configure • Compile Apache by issuing the make command – The most common error message encountered concerns the socket. h library, most likely because TCP/IP is not installed

Installing Apache… (con’t) • The result of the compilation will be a binary file

Installing Apache… (con’t) • The result of the compilation will be a binary file called httpd • Copy this file into /bin or /usr/bin, where it will reside in the path

Setting Up the Website • Create the home directory for the website, we will

Setting Up the Website • Create the home directory for the website, we will use /usr/www/ganesan • Create 3 subdirectories under the site directory – conf – htdocs – logs

Setting Up the Website (con’t) • You will find a subdirectory called conf under

Setting Up the Website (con’t) • You will find a subdirectory called conf under the directory where you installed Apache – Copy 3 files (srm. conf-didst, access. conf-dist, http. conf-dist) from this directory into /usr/www/ganesan/conf – If you cannot find the 3 files, use the find command to find them

Setting Up the Website (con’t) • Rename the 3 files you just copied to

Setting Up the Website (con’t) • Rename the 3 files you just copied to drop the “-dist” portion of the name • Edit the httpd. conf file to specify – the port number on which your web server responds – the user running the httpd daemon, etc… • Specify the server name – Server. Name ganesan. com

Setting Up the Website (con’t) • Add a line that specifies the root directory

Setting Up the Website (con’t) • Add a line that specifies the root directory for your website – Document. Root /usr/www/ganesan/htdocs • Edit the srm. conf file to set up the web home directory and any special internal command usage • Edit the access. conf file to set a basic set of access permissions

Setting Up the Website (con’t) • In the htdocs directory create an HTML file

Setting Up the Website (con’t) • In the htdocs directory create an HTML file for the server to read when it starts – This can be any HTML file – The filename should be default. html • Start the httpd daemon – httpd –f /usr/www/ganesan/conf

Setting Up the Website (con’t) • Test the web server by starting a browser

Setting Up the Website (con’t) • Test the web server by starting a browser and specify the URL http: //127. 0. 0. 1/ • If the system is working properly, you will see a screen with a list of files in the htdocs directory

Server Configuration • Make sure the Server. Type directive is set to “standalone” •

Server Configuration • Make sure the Server. Type directive is set to “standalone” • Check the Port device to make sure it is set to the TCP/IP port to which your Apache server listens • Set the User directive to either the user ID (UID) or the user name used for all web visitors

Server Configuration (con’t) • Set the Group directive to either the group ID (GID)

Server Configuration (con’t) • Set the Group directive to either the group ID (GID) or the group name assigned to all web users • Modify the Server. Admin directive to include the email address of the administrator • Set the Server. Root directive to the absolute path to the directory where all Apache resource and configuration files are stored – /usr/apache/conf or /etc/httpd

Server Configuration (con’t) • Set the Server. Name directive to the fully qualified domain

Server Configuration (con’t) • Set the Server. Name directive to the fully qualified domain name of your server

Starting and Stopping Apache • If you are running Apache as a standalone server,

Starting and Stopping Apache • If you are running Apache as a standalone server, you need to start and stop Apache manually – Start with httpd –d rootdir –f configs – To stop Apache use ps to detect the httpd daemon’s PID and use the kill command to terminate the process

A Note on Starting and Stopping Apache • Later versions of Apache include a

A Note on Starting and Stopping Apache • Later versions of Apache include a script that does the start and stop tasks for you

Virtual Hosts • A virtual host is a web server that resides on one

Virtual Hosts • A virtual host is a web server that resides on one domain but acts as if it was on another. For example, suppose you control ganesan. com and cis 454. com. Instead of setting up 2 servers, you can set up a single machine that serves both domains. • Virtual hosting saves on machinery and allows for a lot of flexibility in setting up web servers

Setting Up Virtual Hosting • If your network uses a name server for DNS,

Setting Up Virtual Hosting • If your network uses a name server for DNS, modify it so that the domain name points to your web server for each domain you’ll host • Use the ifconfig command to set up the IP address for each domain on your server – ifconfig eth 0: 1 xxx

Setting Up Virtual Hosting (con’t) • Add the route to the network configuration using

Setting Up Virtual Hosting (con’t) • Add the route to the network configuration using the route command – route add –host xxx dev eth 0: 1 • Edit the Apache httpd. conf file to set up virtual hosting – <Virtual. Host www. cis 454. com> Document. Root /usr/www/cis 454/htdocs Transfer. Log /usr/www/cis 454/logs/access Error. Log /usr/www/cis 454/logs/errors </Virtual. Host>

Setting Up Virtual Hosting (con’t) • The previous step defines the virtual host for

Setting Up Virtual Hosting (con’t) • The previous step defines the virtual host for cis 454. com and specifies its Document. Root, since each virtual host will have different web directories • If more than one virtual host is defined, the entries are to be repeated for each

A Final Note • There are many more configuration options possible with Apache, but

A Final Note • There are many more configuration options possible with Apache, but they are usually used for commercial sites that require authentication or special handling characteristics

Key Terms • • • Apache conf Server Name Virtual Hosting ifconfig

Key Terms • • • Apache conf Server Name Virtual Hosting ifconfig