diff options
Diffstat (limited to 'src/tdebluez/trayicon.cpp')
-rw-r--r-- | src/tdebluez/trayicon.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/src/tdebluez/trayicon.cpp b/src/tdebluez/trayicon.cpp index 3f56194..9185da7 100644 --- a/src/tdebluez/trayicon.cpp +++ b/src/tdebluez/trayicon.cpp @@ -64,19 +64,19 @@ TrayIcon::TrayIcon(TDEBluetoothApp* _app) // This following commented out lines are also part of the old code // They represent features that were not migrated to Bluez5 // KBlueMon -//// kbluemonAction = new TDEAction(tr("KBlue&Mon"), +//// kbluemonAction = new TDEAction(i18n("KBlue&Mon"), //// TDEGlobal::iconLoader()->loadIcon("info", TDEIcon::Small, 16), //// TDEShortcut::null(), this, "kbluemon"); //// connect(kbluemonAction, SIGNAL(activated()), this, SLOT(slotkbluemonitor())); //// //// // KBlueLock -//// kbluelockAction = new TDEAction(tr("KBlue&Lock"), +//// kbluelockAction = new TDEAction(i18n("KBlue&Lock"), //// TDEGlobal::iconLoader()->loadIcon("kbluelock", TDEIcon::Small, 16), //// TDEShortcut::null(), this, "kbluelock"); //// connect(kbluelockAction, SIGNAL(activated()), this, SLOT(slotkbluelock())); //// //// // KBtobexclient -//// kbtobexclientAction = new TDEAction(tr("&Send File..."), +//// kbtobexclientAction = new TDEAction(i18n("&Send File..."), //// TDEGlobal::iconLoader()->loadIcon("attach", TDEIcon::Small, 16), //// TDEShortcut::null(), this, "kbtobexclient"); //// connect(kbtobexclientAction, SIGNAL(activated()), this, SLOT(slotkbtobexclient())); @@ -90,19 +90,19 @@ TrayIcon::TrayIcon(TDEBluetoothApp* _app) TQT_DBusError dbuserr; bool powered = app->adapters[it.key()]->getPowered(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getPowered failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getPowered failed: %1").arg(dbuserr.message())); TQString name = app->adapters[it.key()]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAlias failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAlias failed: %1").arg(dbuserr.message())); TQString msg; if (powered) { anyPowered = powered; - msg = tr("Power off [%1]").arg(name); + msg = i18n("Power off [%1]").arg(name); } else { - msg = tr("Power on [%1]").arg(name); + msg = i18n("Power on [%1]").arg(name); } TDEToggleAction *ad_a = new TDEToggleAction(this, name.utf8()); @@ -115,10 +115,10 @@ TrayIcon::TrayIcon(TDEBluetoothApp* _app) } // Configuration menu - configActionMenu = new TDEActionMenu(tr("&Configuration"), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), this, "config_menu"); + configActionMenu = new TDEActionMenu(i18n("&Configuration"), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), this, "config_menu"); // Help menu - helpActionMenu = new TDEActionMenu(tr("&Help"), TDEGlobal::iconLoader()->loadIcon("help", TDEIcon::Small, 16), this, "help_menu"); + helpActionMenu = new TDEActionMenu(i18n("&Help"), TDEGlobal::iconLoader()->loadIcon("help", TDEIcon::Small, 16), this, "help_menu"); // show documentation showHelpAction = KStdAction::help(this, TQT_SLOT(slotShowHelp()), actionCollection()); @@ -127,22 +127,22 @@ TrayIcon::TrayIcon(TDEBluetoothApp* _app) aboutAction = KStdAction::aboutApp(this, TQT_SLOT(slotAbout()), actionCollection()); // // Inputdevice configuration -// inputConfigAction = new TDEAction(tr("&Input Devices..."), +// inputConfigAction = new TDEAction(i18n("&Input Devices..."), // TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), // TDEShortcut::null(), this, "input_config"); // connect(inputConfigAction, SIGNAL(activated()), this, SLOT(slotInputConfig())); // Bluetooth Device configuration // from 06_rev748007.patch - deviceConfigAction = new TDEAction(tr("&Devices..."), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), TDEShortcut::null(), this, "device_config"); + deviceConfigAction = new TDEAction(i18n("&Devices..."), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), TDEShortcut::null(), this, "device_config"); connect(deviceConfigAction, SIGNAL(activated()), this, TQT_SLOT(slotDeviceConfig())); // Bluetooth Adapter configuration - adapterConfigAction = new TDEAction(tr("&Adapters..."), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), TDEShortcut::null(), this, "adapter_config"); + adapterConfigAction = new TDEAction(i18n("&Adapters..."), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), TDEShortcut::null(), this, "adapter_config"); connect(adapterConfigAction, SIGNAL(activated()), this, TQT_SLOT(slotAdapterConfig())); // // Paired device configuration -// pairedConfigAction = new TDEAction(tr("&Paired/Trusted Devices..."), +// pairedConfigAction = new TDEAction(i18n("&Paired/Trusted Devices..."), // TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), // TDEShortcut::null(), this, "paired_config"); // connect(pairedConfigAction, SIGNAL(activated()), this, SLOT(slotPairedConfig())); @@ -151,19 +151,19 @@ TrayIcon::TrayIcon(TDEBluetoothApp* _app) autostartIconAction = new TDEToggleAction(this, "autostart"); connect(autostartIconAction, SIGNAL(toggled(bool)), this, TQT_SLOT(slotIconAutostartToggled(bool))); autostartIconAction->setChecked(autostart); - autostartIconAction->setText(tr("&Auto Start")); + autostartIconAction->setText(i18n("&Auto Start")); // Agent switch agentIconAction = new TDEToggleAction(this, "tdeauthagent"); connect(agentIconAction, SIGNAL(toggled(bool)), this, TQT_SLOT(slotIconAgentToggled(bool))); agentIconAction->setChecked(agentstate); - agentIconAction->setText(tr("Auth A&gent")); + agentIconAction->setText(i18n("Auth A&gent")); // Obexsrv switch obexIconAction = new TDEToggleAction(this, "tdebtobexsrv"); connect(obexIconAction, SIGNAL(toggled(bool)), this, TQT_SLOT(slotIconObexToggled(bool))); obexIconAction->setChecked(obexserver); - obexIconAction->setText(tr("&Obex Server")); + obexIconAction->setText(i18n("&Obex Server")); slotIconAgentToggled(agentstate); slotIconObexToggled(obexserver); @@ -172,7 +172,7 @@ TrayIcon::TrayIcon(TDEBluetoothApp* _app) // showIconAction = new TDEToggleAction(this, "always_visible"); // connect(showIconAction, SIGNAL(toggled(bool)), this, SLOT(slotShowIconToggled(bool))); // showIconAction->setChecked(alwaysVisible); -// showIconAction->setText(tr("Always &Visible")); +// showIconAction->setText(i18n("Always &Visible")); // configActionMenu->insert(showIconAction); KPixmap logoPixmap = TDEGlobal::iconLoader()->loadIcon(PIXMAP_LOGO, TDEIcon::Small, 22); @@ -316,7 +316,7 @@ void TrayIcon::setupTray(bool enable) // Service configuration /* TODO: create BlueZ service UI - serviceConfigAction = new TDEAction(tr("Configure &Services..."), + serviceConfigAction = new TDEAction(i18n("Configure &Services..."), TDEGlobal::iconLoader()->loadIcon("configure", TDEIcon::Small, 16), TDEShortcut::null(), this, "service_config"); connect(serviceConfigAction, SIGNAL(activated()), this, SLOT(slotServiceConfig())); @@ -357,10 +357,10 @@ void TrayIcon::updateIcon() if (showPowerOnActionMap.isEmpty()) { setPixmap(iconNoAdapter); - updateTooltip(tr("No BT adapter")); + updateTooltip(i18n("No BT adapter")); if (!this->isHidden()) KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "AdapterDetached", tr("<b>No BT adapter available.</b><br/>(BT adapter removed)")); + "AdapterDetached", i18n("<b>No BT adapter available.</b><br/>(BT adapter removed)")); adapterConfigAction->setEnabled(false); deviceConfigAction->setEnabled(false); @@ -376,14 +376,14 @@ void TrayIcon::updateIcon() { anyPowered = app->adapters[it.key()]->getPowered(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getPowered failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getPowered failed: %1").arg(dbuserr.message())); // know if any adapter is powered if (anyPowered) { path = app->adapters[it.key()]->getPath(); name = app->adapters[it.key()]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAlias failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAlias failed: %1").arg(dbuserr.message())); break; } } @@ -396,7 +396,7 @@ void TrayIcon::updateIcon() { anyConnected = dit.data()->getConnected(dbuserr); if (dbuserr.isValid()) - tqDebug("Check for connected device failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Check for connected device failed: %1").arg(dbuserr.message())); if (anyConnected) break; } @@ -418,7 +418,7 @@ void TrayIcon::updateIcon() path = app->adapters.begin().data()->getPath(); name = app->adapters.begin().data()->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAlias failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAlias failed: %1").arg(dbuserr.message())); setPixmap(iconOff); } @@ -459,7 +459,7 @@ void TrayIcon::slotInputConfig() process << PROCESS_KINPUTWIZARD; if (!process.start(TDEProcess::DontCare)) { - KMessageBox::information(this, tr("Could not execute kinputwizard."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not execute kinputwizard."), i18n("TDEBluetooth")); } } @@ -470,7 +470,7 @@ void TrayIcon::slotkbluemonitor() if (!process.start(TDEProcess::DontCare)) { - KMessageBox::information(this, tr("Could not execute KBlueMon."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not execute KBlueMon."), i18n("TDEBluetooth")); } } @@ -481,7 +481,7 @@ void TrayIcon::slotkbluelock() if (!process.start(TDEProcess::DontCare)) { - KMessageBox::information(this, tr("Could not execute KBlueLock."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not execute KBlueLock."), i18n("TDEBluetooth")); } } @@ -493,14 +493,14 @@ void TrayIcon::slotIconObexToggled(bool state) { if (!app->startObexSrv()) { - KMessageBox::information(this, tr("Could not start OBEX server."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not start OBEX server."), i18n("TDEBluetooth")); } } else { if (!app->stopObexSrv()) { - KMessageBox::information(this, tr("Could not stop OBEX server."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not stop OBEX server."), i18n("TDEBluetooth")); } } } @@ -513,14 +513,14 @@ void TrayIcon::slotIconAgentToggled(bool state) { if (!app->startAuthAgent()) { - KMessageBox::information(this, tr("Could not start TDEBluez Authentication Agent."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not start TDEBluez Authentication Agent."), i18n("TDEBluetooth")); } } else { if (!app->stopAuthAgent()) { - KMessageBox::information(this, tr("Could not stop TDEBluez Authentication Agent."), tr("TDEBluetooth")); + KMessageBox::information(this, i18n("Could not stop TDEBluez Authentication Agent."), i18n("TDEBluetooth")); } } } @@ -550,11 +550,11 @@ void TrayIcon::slotPowerOnChanged(const TQString &adapter, bool state) TQT_DBusError dbuserr; TQString name = app->adapters[adapter]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAlias failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAlias failed: %1").arg(dbuserr.message())); TQString addr = app->adapters[adapter]->getAddress(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAddress failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAddress failed: %1").arg(dbuserr.message())); if (name.isEmpty() && addr.isEmpty()) // adapter was removed return; @@ -563,14 +563,14 @@ void TrayIcon::slotPowerOnChanged(const TQString &adapter, bool state) if (state) { KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "AdapterAvailable", tr("BT adapter <b>%1</b> is on<br/>(<b>%2</b>)").arg(name).arg(addr)); - msg = tr("Power off [%1]").arg(name); + "AdapterAvailable", i18n("BT adapter <b>%1</b> is on<br/>(<b>%2</b>)").arg(name).arg(addr)); + msg = i18n("Power off [%1]").arg(name); } else { KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "AdapterAvailable", tr("BT adapter <b>%1</b> is off<br/>(<b>%2</b>)").arg(name).arg(addr)); - msg = tr("Power on [%1]").arg(name); + "AdapterAvailable", i18n("BT adapter <b>%1</b> is off<br/>(<b>%2</b>)").arg(name).arg(addr)); + msg = i18n("Power on [%1]").arg(name); } showPowerOnActionMap[adapter]->setText(msg); @@ -584,27 +584,27 @@ void TrayIcon::slotDeviceConnectedChanged(const TQString& path, bool state) TQT_DBusError dbuserr; TQString name = app->devices[path]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Device getAlias failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Device getAlias failed: %1").arg(dbuserr.message())); TQString address = app->devices[path]->getAddress(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAddress failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAddress failed: %1").arg(dbuserr.message())); if (state) { KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "IncomingConnection", tr("Connected to <b>%1</b> (<b>%2</b>)").arg(name).arg(address)); + "IncomingConnection", i18n("Connected to <b>%1</b> (<b>%2</b>)").arg(name).arg(address)); } else { KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "IncomingConnection", tr("Disconnected from <b>%1</b> (<b>%2</b>)").arg(name).arg(address)); + "IncomingConnection", i18n("Disconnected from <b>%1</b> (<b>%2</b>)").arg(name).arg(address)); } updateIcon(); } TQString TrayIcon::localAndEnglish(const TQCString& s) { - if (TQString(s) != tr(s)) - return TQString("%1 (\"%2\")").arg(tr(s)).arg(s); + if (TQString(s) != i18n(s)) + return TQString("%1 (\"%2\")").arg(i18n(s)).arg(s); else return s; } @@ -614,8 +614,8 @@ void TrayIcon::mousePressEvent(TQMouseEvent *e) if (e->button() == TQMouseEvent::LeftButton) { // TQMessageBox::information(this, -// tr("Use right click to open the menu"), -// tr("Left click is reserved for ObexFTP browsing.\n" +// i18n("Use right click to open the menu"), +// i18n("Left click is reserved for ObexFTP browsing.\n" // "ObexFTP is subject of development.")); e->accept(); TDEProcess proc; @@ -635,10 +635,10 @@ void TrayIcon::slotQuitSelected() if (!autostartIconAction->isChecked()) { int autoStart = KMessageBox::questionYesNoCancel(0, - tr("Should TDEBluetooth still be restarted when you login?"), - tr("Automatically Start TDEBluetooth?"), - tr("Start"), - tr("Do Not Start")); + i18n("Should TDEBluetooth still be restarted when you login?"), + i18n("Automatically Start TDEBluetooth?"), + i18n("Start"), + i18n("Do Not Start")); if (autoStart == KMessageBox::Yes) app->setAutoStart(true); @@ -662,21 +662,21 @@ void TrayIcon::slotAddAdapter(const TQString& path) bool powered = app->adapters[path]->getPowered(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getPowered failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getPowered failed: %1").arg(dbuserr.message())); TQString name = app->adapters[path]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAlias failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAlias failed: %1").arg(dbuserr.message())); TQString addr = app->adapters[path]->getAddress(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getAddress failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getAddress failed: %1").arg(dbuserr.message())); TQString msg; if (powered) - msg = tr("Power off [%1]").arg(name); + msg = i18n("Power off [%1]").arg(name); else - msg = tr("Power on [%1]").arg(name); + msg = i18n("Power on [%1]").arg(name); TDEToggleAction *ad_a = new TDEToggleAction(this, name.utf8()); ad_a->setText(msg); @@ -686,7 +686,7 @@ void TrayIcon::slotAddAdapter(const TQString& path) connect(ad_a, SIGNAL(toggled(bool)), this, SLOT(slotPowerOn(bool))); KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "AdapterAttached", tr("BT adapter <b>%1</b> attached<br/>(<b>%2</b>)").arg(name).arg(addr)); + "AdapterAttached", i18n("BT adapter <b>%1</b> attached<br/>(<b>%2</b>)").arg(name).arg(addr)); if(!powered) // find out if we have some powered adapter { @@ -695,7 +695,7 @@ void TrayIcon::slotAddAdapter(const TQString& path) { powered = app->adapters[it.key()]->getPowered(dbuserr); if (dbuserr.isValid()) - tqDebug("Adapter getPowered failed: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Adapter getPowered failed: %1").arg(dbuserr.message())); // know if any adapter is powered if (powered) break; @@ -727,7 +727,7 @@ void TrayIcon::slotRemoveAdapter(const TQString& path) showPowerOnActionMap.remove(path); KNotifyClient::event(TDEApplication::kApplication()->mainWidget()->winId(), - "AdapterDetached", tr("BT adapter detached")); + "AdapterDetached", i18n("BT adapter detached")); if (showPowerOnActionMap.isEmpty()) { @@ -754,9 +754,9 @@ void TrayIcon::slotAdapterAliasChanged(const TQString &path, const TQString &ali bool powered = showPowerOnActionMap[path]->isChecked(); TQString msg; if (powered) - msg = tr("Power off [%1]").arg(alias); + msg = i18n("Power off [%1]").arg(alias); else - msg = tr("Power on [%1]").arg(alias); + msg = i18n("Power on [%1]").arg(alias); showPowerOnActionMap[path]->setText(msg); } @@ -765,7 +765,7 @@ void TrayIcon::slotDiscoverableTimeoutChanged(const TQString &path, TQ_UINT32 ti TQT_DBusError dbuserr; TQString name = app->adapters[path]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Error: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Error: %1").arg(dbuserr.message())); slotUpdateToolTip(path, name); } @@ -774,7 +774,7 @@ void TrayIcon::slotDiscoverableChanged(const TQString &path, bool state) TQT_DBusError dbuserr; TQString name = app->adapters[path]->getAlias(dbuserr); if (dbuserr.isValid()) - tqDebug("Error: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Error: %1").arg(dbuserr.message())); slotUpdateToolTip(path, name); } @@ -783,13 +783,13 @@ void TrayIcon::slotUpdateToolTip(const TQString& adapter, const TQString& name) TQT_DBusError dbuserr; TQString addr = app->adapters[adapter]->getAddress(dbuserr); if (dbuserr.isValid()) - tqDebug("Error: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Error: %1").arg(dbuserr.message())); TQString disc = (app->adapters[adapter]->getDiscoverable(dbuserr)) ? "discoverable" : "hidden"; if (dbuserr.isValid()) - tqDebug("Error: %s", dbuserr.message().local8Bit().data()); + tqDebug(i18n("Error: %1").arg(dbuserr.message())); - TQString newText = tr("Adapter: %1\nAddress: %2\nMode: %3\n").arg(name, addr, disc); + TQString newText = i18n("Adapter: %1\nAddress: %2\nMode: %3\n").arg(name, addr, disc); updateTooltip(newText); } |