From d12ded3d45c947c69254899b49219a03605fbd4a Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 9 May 2006 16:15:23 +0000 Subject: [PATCH] Language changes, fix for main menu hang --- audiomvp.cc | 2 +- command.cc | 2 - dsock.cc | 19 ++++- dsock.h | 2 + language-data.h | 201 ++++++++++++++++++++++++++++++++++++++++++++++-- region.cc | 6 +- vdr.cc | 1 + voptionsmenu.cc | 6 +- vtimeredit.cc | 20 ++--- 9 files changed, 230 insertions(+), 29 deletions(-) diff --git a/audiomvp.cc b/audiomvp.cc index 1a42351..f1bfe70 100644 --- a/audiomvp.cc +++ b/audiomvp.cc @@ -232,7 +232,7 @@ int AudioMVP::test() int b = ioctl(fdAudio, AV_SET_AUD_DISABLE_SYNC, &a); - printf("Audio sync disable = %i\n", b); // is in a DEV block + /*OK*/ printf("Audio sync disable = %i\n", b); return 1; diff --git a/command.cc b/command.cc index f77610d..38560ba 100644 --- a/command.cc +++ b/command.cc @@ -135,7 +135,6 @@ void Command::run() viewman->add(vconnect); vconnect->run(); - UCHAR button = 0; while(irun) { @@ -145,7 +144,6 @@ void Command::run() #else ReleaseMutex(masterLock); #endif - button = remote->getButtonPress(2); // FIXME why is this set to 2 and not 0? so it can quit // something happened, lock and process diff --git a/dsock.cc b/dsock.cc index 4d7d98b..36e6a8e 100644 --- a/dsock.cc +++ b/dsock.cc @@ -27,11 +27,12 @@ DatagramSocket::DatagramSocket(short port) theInstance = this; myPort = port; addrlen = sizeof(struct sockaddr); + initted = false; } DatagramSocket::~DatagramSocket() { - CLOSESOCKET(socketnum); + if (initted) shutdown(); } DatagramSocket* DatagramSocket::theInstance = 0; @@ -42,7 +43,8 @@ DatagramSocket* DatagramSocket::getInstance(void) int DatagramSocket::init() { - CLOSESOCKET(socketnum); + if (initted) return 0; + if ((socketnum = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { perror("socket"); return 0; } @@ -62,11 +64,22 @@ int DatagramSocket::init() int allowed = 1; setsockopt(socketnum, SOL_SOCKET, SO_BROADCAST, (char*)&allowed, sizeof(allowed)); + initted = true; + return 1; } +void DatagramSocket::shutdown() +{ + if (!initted) return; + CLOSESOCKET(socketnum); + initted = false; +} + unsigned char DatagramSocket::waitforMessage(unsigned char how) { + if (!initted) return 0; + /* how = 0 - block how = 1 - start new wait how = 2 - continue wait @@ -137,6 +150,8 @@ short DatagramSocket::getFromPort(void) const { return fromPort; } void DatagramSocket::send(char *ipa, short port, char *message, int length) { + if (!initted) return; + if (DSOCKDEBUG) { printf("%s:%i\tOUT %i\t", ipa, port, length); diff --git a/dsock.h b/dsock.h index 734bd05..25545e1 100644 --- a/dsock.h +++ b/dsock.h @@ -51,6 +51,7 @@ class DatagramSocket ~DatagramSocket(); static DatagramSocket* getInstance(void); int init(); + void shutdown(); unsigned char waitforMessage(unsigned char); // int =0-block =1-new wait =2-continue wait int getDataLength(void) const; char *getData(void); // returns a pointer to the data @@ -59,6 +60,7 @@ class DatagramSocket void send(char *, short, char *, int); // send wants: IP Address ddn style, port, // data, length of data private: + bool initted; ULONG getIPNumber(ULONG num); static ULONG iterate_ip; const static char DSOCKDEBUG = 0; diff --git a/language-data.h b/language-data.h index 971482f..1a0e42c 100644 --- a/language-data.h +++ b/language-data.h @@ -144,10 +144,10 @@ const I18n::tI18nPhrase I18n::Phrases[] = "4", }, { "4. Timers", - "", + "4. Timer", "", "4. Felvétel", - "", + "4. Ajastukset", "", "5", }, @@ -204,8 +204,8 @@ const I18n::tI18nPhrase I18n::Phrases[] = "[ok] = Menü", "[ok] = meny", "[ok] = menü", - "[ok] = menu", "[ok] = valikko", + "[ok] = menu", "12", }, { "%lu%% used, %iGB free", @@ -333,6 +333,78 @@ const I18n::tI18nPhrase I18n::Phrases[] = "Options", "27", }, + { "General", + "", + "", + "", + "", + "", + "27.1", + }, + { "Advanced", + "", + "", + "", + "", + "", + "27.3", + }, + { "General Options", + "", + "", + "", + "", + "", + "27.4", + }, + { "Timer Options", + "", + "", + "", + "", + "", + "27.5", + }, + { "Default start margin (minutes)", + "", + "", + "", + "", + "", + "27.51", + }, + { "Default end margin (minutes)", + "", + "", + "", + "", + "", + "27.52", + }, + { "Default priority", + "", + "", + "", + "", + "", + "27.53", + }, + { "Default lifetime", + "", + "", + "", + "", + "", + "27.54", + }, + { "Advanced Options", + "", + "", + "", + "", + "", + "27.6", + }, { "TV connection type", "TV-Anschlußart", "Typ av TV-anslutning", @@ -403,7 +475,15 @@ const I18n::tI18nPhrase I18n::Phrases[] = "VDR-Pri 0=OK !lásd. fórum!", "VDR-Pri 0=OK !Lue forumit!", "VDR-Pri 0=OK !Voir forums!", - "34a", + "34.1", + }, + { "TCP receive window size", + "", + "", + "", + "", + "", + "34.2", }, // Option choices { "Old", @@ -439,7 +519,7 @@ const I18n::tI18nPhrase I18n::Phrases[] = "38", }, { "Chop sides", - "Seiten abschneiden", + "Zuschneiden", "Ta bort på sidorna", "Szélek levágva", "Leikkaa sivut", @@ -637,7 +717,7 @@ const I18n::tI18nPhrase I18n::Phrases[] = "61.5", }, { "Guide / Back: Close", - "Back: EPG schließen", + "Back:EPG schließen", "Guide / Back: Stäng", "Guide/Back: Bezárás", "Guide / Back: Sulje", @@ -645,7 +725,7 @@ const I18n::tI18nPhrase I18n::Phrases[] = "62", }, { "Rec: Set timer", - "Rec: Aufnahme programmieren", + "Rec: Neuer Timer", "Rec: Programmera timer", "Rec: Felvétel beállítása", "Rec: Aseta ajastus", @@ -676,14 +756,119 @@ const I18n::tI18nPhrase I18n::Phrases[] = "Pas de detail du programme", "66", }, + { "Set Timer", + "", + "", + "", + "", + "", + "66.1", + }, + { "Create this timer?", + "", + "", + "", + "", + "", + "66.2", + }, + // Timers + { "Timers", + "Timer", + "", + "Felvétel", + "Ajastukset", + "", + "66.5", + }, // Edit timer { "Edit Timer", + "Timer bearbeiten", "", "", + "Muuta ajastusta", "", + "67", + }, + { "Active", "", "", - "67", + "", + "", + "", + "68", + }, + { "Channel", + "", + "", + "", + "", + "", + "69", + }, + { "Name", + "", + "", + "", + "", + "", + "70", + }, + { "Directory", + "", + "", + "", + "", + "", + "71", + }, + { "Start", + "", + "", + "", + "", + "", + "72", + }, + { "Stop", + "", + "", + "", + "", + "", + "73", + }, + { "Priority", + "", + "", + "", + "", + "", + "74", + }, + { "Lifetime", + "", + "", + "", + "", + "", + "75", + }, + { "Current", + "", + "", + "", + "", + "", + "76", + }, + { "Recording", + "", + "", + "", + "", + "", + "77", }, // End marker. { NULL } diff --git a/region.cc b/region.cc index f92326f..fbcb793 100644 --- a/region.cc +++ b/region.cc @@ -30,8 +30,8 @@ UINT Region::y2() /* Region Region::subtract(Region& other) { - printf("This: %i %i %i %i\n", x, y, w, h); - printf("Subtract this: %i %i %i %i\n", other.x, other.y, other.w, other.h); + OK printf("This: %i %i %i %i\n", x, y, w, h); + OK printf("Subtract this: %i %i %i %i\n", other.x, other.y, other.w, other.h); Region s; @@ -75,7 +75,7 @@ Region Region::subtract(Region& other) s.w = 0; s.h = 0; } - printf("Result: %i %i %i %i\n", s.x, s.y, s.w, s.h); + OK printf("Result: %i %i %i %i\n", s.x, s.y, s.w, s.h); return s; } diff --git a/vdr.cc b/vdr.cc index 5000667..4ddf1bf 100644 --- a/vdr.cc +++ b/vdr.cc @@ -93,6 +93,7 @@ void VDR::findServers(vector& servers) { if (waitType == 1) { + ds.shutdown(); ds.init(); logger->log("VDR", Log::NOTICE, "Broadcasting for server"); ds.send("255.255.255.255", 3024, message, strlen(message)); diff --git a/voptionsmenu.cc b/voptionsmenu.cc index f57ee10..0639347 100644 --- a/voptionsmenu.cc +++ b/voptionsmenu.cc @@ -45,7 +45,7 @@ VOptionsMenu::VOptionsMenu() WButton* wb; wb = new WButton(); - wb->setText("General"); + wb->setText(tr("General")); wb->setSurface(surface); wb->setSurfaceOffset(160, 60); wb->setDimensions(140, fontHeight); @@ -53,7 +53,7 @@ VOptionsMenu::VOptionsMenu() buttons.push_back(wb); wb = new WButton(); - wb->setText("Timers"); + wb->setText(tr("Timers")); wb->setSurface(surface); wb->setSurfaceOffset(160, 100); wb->setDimensions(140, fontHeight); @@ -61,7 +61,7 @@ VOptionsMenu::VOptionsMenu() buttons.push_back(wb); wb = new WButton(); - wb->setText("Advanced"); + wb->setText(tr("Advanced")); wb->setSurface(surface); wb->setSurfaceOffset(160, 140); wb->setDimensions(140, fontHeight); diff --git a/vtimeredit.cc b/vtimeredit.cc index 4c75c0d..29fe6eb 100644 --- a/vtimeredit.cc +++ b/vtimeredit.cc @@ -47,18 +47,18 @@ VTimerEdit::VTimerEdit(RecTimer* trt) int xpos = 20; int ypos = 50; - drawText("Active", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Channel", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Name", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Directory", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Active"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Channel"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Name"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Directory"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); ypos += surface->getFontHeight(); - drawText("Start", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Stop", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Priority", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Lifetime", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Start"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Stop"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Priority"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Lifetime"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); ypos += surface->getFontHeight(); - drawText("Current", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); - drawText("Recording", xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Current"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); + drawText(tr("Recording"), xpos, ypos, Colour::LIGHTTEXT); ypos += surface->getFontHeight(); // Temp -- 2.39.2