From: konrad Date: Sun, 16 Sep 2007 15:55:28 +0000 (+0000) Subject: some more i18n X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=26c5098fc07b5d7b7324e6d71b93b0beffc8ee4b;p=web%2Fkonrad%2Fsmoke.git some more i18n make language changeable at runtime add icon some draft window layout for overview git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@28 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- diff --git a/src/code39.h b/src/code39.h index afa05f7..fcf0888 100644 --- a/src/code39.h +++ b/src/code39.h @@ -13,4 +13,7 @@ #include #include -QPixmap code39(QString); \ No newline at end of file +/**Takes a string and converts it into a code-39 bar code. +Code-39 allows letters (case-insensitive), digits, spaces and the special chars "-.$/+%". +The bar code pixmap will be 1 pixel high and 16 pixels wide for each character (plus start/stop character and checksum character) - it needs to be scaled up to fit the intended size.*/ +QPixmap code39(QString); diff --git a/src/files.qrc b/src/files.qrc new file mode 100644 index 0000000..93605ce --- /dev/null +++ b/src/files.qrc @@ -0,0 +1,6 @@ + + + + icon.png + + diff --git a/src/icon.png b/src/icon.png new file mode 100644 index 0000000..a5b3bbf Binary files /dev/null and b/src/icon.png differ diff --git a/src/icon.xcf b/src/icon.xcf new file mode 100644 index 0000000..9c6afac Binary files /dev/null and b/src/icon.xcf differ diff --git a/src/main.cpp b/src/main.cpp index 455e1b9..3cb590e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,10 +18,40 @@ #include #include #include +#include #include "keygen.h" #include "mainwindow.h" #include "hmac.h" +#include "main.h" + +QString choseLanguage(bool warn) +{ + QString lang=QSettings().value("lang","--").toString(); + if(lang=="--"){ + lang=QLocale::system().name(); + } + int cur=0; + QStringList langs; + langs<<"C - default"; + QStringList files=QDir(QApplication::applicationDirPath()).entryList(QStringList()<<"smoke_*.qm", QDir::Files, QDir::Name); + for(int i=0;i, (C) 2007 +// +// Copyright: See README/COPYING files that come with this distribution +// +// + +QString choseLanguage(bool warn=true); + diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f320b51..71bf17a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -14,6 +14,7 @@ #include "keygen.h" #include "webrequest.h" #include "overview.h" +#include "main.h" #include #include @@ -44,6 +45,7 @@ MMainWindow::MMainWindow() m->addSeparator(); m->addAction(tr("&Close Window"),this,SLOT(close())); m=mb->addMenu(tr("&Configure")); + m->addAction(tr("&Language..."),this,SLOT(changeLang())); //create central widget QWidget *loginwidget; @@ -77,7 +79,7 @@ MMainWindow::MMainWindow() gl->addWidget(lab=new QLabel(tr("Proxy Password:")),++lctr,0); lab->setAlignment(Qt::AlignRight); gl->addWidget(proxypass=new QLineEdit,lctr,1); - password->setEchoMode(QLineEdit::Password); + proxypass->setEchoMode(QLineEdit::Password); connect(useproxy,SIGNAL(toggled(bool)),proxyuser,SLOT(setEnabled(bool))); connect(useproxy,SIGNAL(toggled(bool)),proxypass,SLOT(setEnabled(bool))); QFrame*frm; @@ -210,3 +212,8 @@ void MMainWindow::startLogin() setEnabled(true); } + +void MMainWindow::changeLang() +{ + choseLanguage(); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index f4091ea..3560096 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -45,6 +45,8 @@ class MMainWindow:public QMainWindow void saveProfile(); void newProfile(); void startLogin(); + //settings + void changeLang(); }; #endif diff --git a/src/overview.cpp b/src/overview.cpp index dd76f16..30490f0 100644 --- a/src/overview.cpp +++ b/src/overview.cpp @@ -19,6 +19,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include MOverview::MOverview(MWebRequest*mw,QString pk) { @@ -30,17 +36,75 @@ MOverview::MOverview(MWebRequest*mw,QString pk) QMenuBar*mb=menuBar(); QMenu*m=mb->addMenu(tr("&Session")); m->addAction(tr("&Re-Login"),this,SLOT(relogin())); + m->addAction(tr("&Offline mode"))->setEnabled(false); m->addSeparator(); m->addAction(tr("&Close Session"),this,SLOT(close())); m=mb->addMenu(tr("&Event")); + m->addAction(tr("&Show details...")); + m->addAction(tr("&New Event...")); + m->addAction(tr("&Cancel Event...")); + m=mb->addMenu(tr("&Customer")); + m->addAction(tr("&Show all customers")); + + m=mb->addMenu(tr("C&art")); + m->addAction(tr("Add &Ticket")); + m->addAction(tr("Add &Voucher")); + m->addAction(tr("&Remove Item")); + m->addAction(tr("&Abort Shopping")); + m->addSeparator(); + m->addAction(tr("&Show all orders")); + m=mb->addMenu(tr("C&onfigure")); + //tabs setCentralWidget(tab=new QTabWidget); - tab->addTab(new QWidget,tr("Events")); - tab->addTab(new QWidget,tr("Customers")); - tab->addTab(new QWidget,tr("Order")); + tab->addTab(eventtab=new QWidget,tr("Events")); + QVBoxLayout*vl;QHBoxLayout*hl; + eventtab->setLayout(hl=new QHBoxLayout); + hl->addWidget(new QTableView,10); + hl->addSpacing(5); + hl->addLayout(vl=new QVBoxLayout,0); + vl->addWidget(new QPushButton(tr("New Event...")),0); + vl->addWidget(new QPushButton(tr("Details...")),0); + vl->addSpacing(15); + vl->addWidget(new QPushButton(tr("Order Ticket...")),0); + vl->addStretch(10); + + tab->addTab(carttab=new QWidget,tr("Shopping Cart")); + carttab->setLayout(vl=new QVBoxLayout); + vl->addLayout(hl=new QHBoxLayout); + QVBoxLayout*vl2; + hl->addLayout(vl2=new QVBoxLayout,1); + vl2->addWidget(new QTableView,10); + QHBoxLayout*hl2; + vl2->addLayout(hl2=new QHBoxLayout,0); + hl2->addStretch(10); + hl2->addWidget(new QPushButton(tr("Add Ticket")),0); + hl2->addWidget(new QPushButton(tr("Add Voucher")),0); + hl2->addWidget(new QPushButton(tr("Remove Item")),0); + QFrame*frm; + hl->addWidget(frm=new QFrame,0); + frm->setFrameShape(QFrame::VLine); + hl->addLayout(vl2=new QVBoxLayout,1); + vl2->addWidget(new QPushButton(tr("Customer:")),0); + vl2->addWidget(new QLabel("...blah\nPerson\nsomewhere")); + vl2->addWidget(frm=new QFrame,0); + frm->setFrameShape(QFrame::HLine); + vl2->addSpacing(10); + vl2->addWidget(new QLabel(tr("Delivery Address:")),0); + vl2->addWidget(new QTextEdit); + vl2->addSpacing(10); + vl2->addWidget(new QLabel(tr("Comments:")),0); + vl2->addWidget(new QTextEdit); + vl2->addStretch(10); + vl->addWidget(frm=new QFrame,0); + frm->setFrameShape(QFrame::HLine); + vl->addLayout(hl=new QHBoxLayout,0); + hl->addStretch(10); + hl->addWidget(new QPushButton(tr("Save Order"))); + hl->addWidget(new QPushButton(tr("Clear"))); //status bar statusBar()->setSizeGripEnabled(true); diff --git a/src/overview.h b/src/overview.h index d5ba10a..732d547 100644 --- a/src/overview.h +++ b/src/overview.h @@ -27,8 +27,10 @@ class MOverview:public QMainWindow MOverview(MWebRequest*,QString); ~MOverview(); protected: + /**handle closing the window: close the session too*/ void closeEvent(QCloseEvent*); private slots: + /**try to log in again*/ void relogin(); private: //my session object @@ -37,6 +39,7 @@ class MOverview:public QMainWindow QString profilekey; //widgets QTabWidget*tab; + QWidget*eventtab,*carttab; }; #endif diff --git a/src/smoke.pro b/src/smoke.pro index 41fef86..a31eaf7 100644 --- a/src/smoke.pro +++ b/src/smoke.pro @@ -29,6 +29,11 @@ HEADERS = \ webrequest.h \ overview.h +RESOURCES += files.qrc + TRANSLATIONS = \ smoke_de.ts \ - smoke_de_SAX.ts \ No newline at end of file + smoke_de_SAX.ts + + +#include(zip/zip.pri) diff --git a/src/smoke_de.ts b/src/smoke_de.ts index 2e07296..6f2dfb9 100644 --- a/src/smoke_de.ts +++ b/src/smoke_de.ts @@ -33,161 +33,271 @@ At least %1 Bits of random are required. MMainWindow - + Profile: - + Alternate Hostname: - + Server URL: - + Proxy: - + Username: - + Password: - + New Profile - + Please enter a profile name. It must be non-empty and must not be used yet: - + Proxy Username: - + Proxy Password: - + Warning - + Unable to log in. Error: %1 - + &File - + &New Profile... - + &Save Profile - + &Close Window - + &Configure - + new Profile - + save Profile - + Login + + + &Language... + + MOverview - + &Session - + &Re-Login - + &Close Session - + &Event - + &Customer - + C&onfigure - + Events - - Customers + + Warning - - Order + + I was unable to renew the login at the server, the error was: %1 - - Warning + + &Offline mode - - I was unable to renew the login at the server, the error was: %1 + + &Show details... + + + + + &New Event... + + + + + &Cancel Event... + + + + + &Show all customers + + + + + C&art + + + + + Add &Ticket + + + + + Add &Voucher + + + + + &Remove Item + + + + + &Abort Shopping + + + + + &Show all orders + + + + + New Event... + + + + + Details... + + + + + Order Ticket... + + + + + Shopping Cart + + + + + Add Ticket + + + + + Add Voucher + + + + + Remove Item + + + + + Customer: + + + + + Delivery Address: + + + + + Comments: + + + + + Save Order + + + + + Clear @@ -252,27 +362,27 @@ At least %1 Bits of random are required. initkey - + Warning - + Magic Smoke needs a host key. You have to generate one before you can use the program. - + Enter Host Name - + Host name: - + Magic Smoke needs a host name. You have to configure one before you can use the program. @@ -280,20 +390,43 @@ At least %1 Bits of random are required. initprofile - + default initial profile - + Create Initial Profile - + You need a profile to work with Magic Smoke. Magic Smoke will now create one for you. Please enter the name you wish to give this profile. + + lang + + + Information + + + + + The changed language setting will only be active after restarting the application. + + + + + Chose Language + + + + + Language: + + + diff --git a/src/smoke_de_SAX.ts b/src/smoke_de_SAX.ts index 390e188..4b506e7 100644 --- a/src/smoke_de_SAX.ts +++ b/src/smoke_de_SAX.ts @@ -34,163 +34,273 @@ At least %1 Bits of random are required. MMainWindow - + Profile: Brofiel: - + Alternate Hostname: Andror Reschnername: - + Server URL: URL vom diggen Reschnor: - + Proxy: Web-Broggsie: - + Username: Nudsorname: - + Password: Gans doll geheimer Gohd: - + New Profile Neues Brofiel - + Please enter a profile name. It must be non-empty and must not be used yet: Bidde gäben'se 'nen Namen für das neue Brofiel ein. Der darf noch ni' benudsd sein und leer darf'or och nedd sein: - + Proxy Username: Nudsername für'n Broggsie: - + Proxy Password: Geheimer Gohd für'n Broggsie: - + Warning Dumm gelaufen - + Unable to log in. Error: %1 Isch gann nisch off'n gross'n Reschner. Der will nisch weil: %1 - + &File &Dadai - + &New Profile... &Neues Brofiel - + &Save Profile Brofiel &schbeichorn - + &Close Window Fänsdor &zumach'n - + &Configure &Gonfiguriern - + new Profile Neues Brofiel - + save Profile Brofiel schbeichorn - + Login Droff offn' Reschnor + + + &Language... + &Schbrache... + MOverview - + &Session &Sidsung - + &Re-Login &Noch'ma einloggn - + &Close Session Sidsung &Zumachn - + &Event &Veranschdaldung - + &Customer &Gunde - + C&onfigure G&onfiguriern - + Events Veranschdaldungen - - Customers - Gunden - - - - Order - Beschdellung - - - + Warning Dumm gelaufen - + I was unable to renew the login at the server, the error was: %1 Isch gann de' Verbindung off'n gross'n Reschner nisch erneuern. Der will nisch weil: %1 + + + &Offline mode + &Ohne Neds und Dobbelden Boden + + + + &Show details... + &Dedails anzeigen... + + + + &New Event... + &Neue Veranschdaldung... + + + + &Cancel Event... + Veranschdaldung &absach'n... + + + + &Show all customers + &Alle Gunden anzeigen + + + + C&art + Eing&aufswagen + + + + Add &Ticket + Ein&driddsgarde hinzufüchen + + + + Add &Voucher + &Gudschein hinzufüchen + + + + &Remove Item + Doch &ni' nehm' + + + + &Abort Shopping + &Eingauf Abbrechen + + + + &Show all orders + &Alle Beschdellungen anzeichen + + + + New Event... + Neue Veranschdaldung... + + + + Details... + Dedails anzeichen... + + + + Order Ticket... + Eindriddsgarde beschdellen... + + + + Shopping Cart + Eingaufswagen + + + + Add Ticket + Eindriddsgarde hinzufüchen + + + + Add Voucher + Gudschein hinzufüchen + + + + Remove Item + Doch ni' nehm' + + + + Customer: + Gunde: + + + + Delivery Address: + Adresse wo's Zeuch hin soll: + + + + Comments: + Wischdiches Gelaber und Gerede: + + + + Save Order + Beschdellung abschbeichern + + + + Clear + Wechwerfen und von vorne! + MWebRequest @@ -253,27 +363,27 @@ At least %1 Bits of random are required. initkey - + Warning Dumm gelaufen - + Magic Smoke needs a host key. You have to generate one before you can use the program. Mädschig Schmohg brauchd 'nen Schlüssel. Desweschen isser beleidschd. Beim nächsden Schdard mussde ihn einen mach'n lass'n. - + Enter Host Name Gombjudername eingäbn - + Host name: Gombjudername: - + Magic Smoke needs a host name. You have to configure one before you can use the program. Mädschig Schmohg brauchd 'nen Namen für diesen Gombjuder. Desweschen isser beleidschd. Beim nächsden Schdard mussde ihn eingäben. @@ -281,20 +391,43 @@ At least %1 Bits of random are required. initprofile - + default initial profile Schdandardbrofiel - + Create Initial Profile Erschdes Brofiel anlechen - + You need a profile to work with Magic Smoke. Magic Smoke will now create one for you. Please enter the name you wish to give this profile. Gugge, Du brauchsd sowas wie'n Brofiel. Mädschig Schmohg iss nedd und machd eens für Disch. Desderweschen brauchsde jedsd nur noch n Namen dafür eindibben. + + lang + + + Information + Informadschion + + + + The changed language setting will only be active after restarting the application. + De Ändorung von dor Schbrache wird ersd wirgsam, wenn'de das Brogramm neu geschdarded hasd. S' is draurisch, aber wahr. + + + + Chose Language + Schbrache Aussuch'n + + + + Language: + Schbrache: + +