Commit d4ba941e authored by Jan Grulich's avatar Jan Grulich
Browse files

Merge branch 'frameworks' of git://anongit.kde.org/plasma-nm into frameworks

parents af4c5a8b e9e6dc4a
......@@ -30,10 +30,12 @@
#include "vpnuiplugin.h"
#include <networkmodelitem.h>
#include <QUrl>
#include <QStandardPaths>
#include <KActionCollection>
#include <KLocale>
#include <KGlobal>
#include <KGlobalSettings>
#include <KIcon>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -42,15 +44,12 @@
#include <KStandardAction>
#include <KAction>
#include <KXMLGUIFactory>
#include <KMenu>
#include <KAcceleratorManager>
#include <KConfig>
#include <KConfigGroup>
#include <KWallet/Wallet>
#include <KStandardDirs>
#include <KFileDialog>
#include <KShell>
#include <QUrl>
#include <KFilterProxySearchLine>
#include <NetworkManagerQt/Settings>
......@@ -409,7 +408,7 @@ void ConnectionEditor::slotItemDoubleClicked(const QModelIndex &index)
void ConnectionEditor::importSecretsFromPlainTextFiles()
{
const QString secretsDirectory = KStandardDirs::locateLocal("data", "networkmanagement/secrets/");
const QString secretsDirectory = QStandardPaths::locate(QStandardPaths::DataLocation, "networkmanagement/secrets/", QStandardPaths::LocateDirectory);
QDir dir(secretsDirectory);
if (dir.exists() && !dir.entryList(QDir::Files).isEmpty()) {
QMap<QString, QMap<QString, QString > > resultingMap;
......@@ -558,7 +557,7 @@ void ConnectionEditor::exportVpn()
return;
}
const QUrl url = QUrl::fromLocalFile(KGlobalSettings::documentPath() + QDir::separator() + vpnPlugin->suggestedFileName(connSettings));
const QUrl url = QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + QDir::separator() + vpnPlugin->suggestedFileName(connSettings));
const QString filename = KFileDialog::getSaveFileName(url, vpnPlugin->supportedFileExtensions(), this, i18n("Export VPN Connection"));
if (!filename.isEmpty()) {
if (!vpnPlugin->exportConnectionSettings(connSettings, filename)) {
......
......@@ -60,8 +60,8 @@ int main(int argc, char *argv[])
app.setApplicationVersion(PLASMA_NM_VERSION_STRING);
#warning "Translations for kde-nm-connection-editor disabled"
//KGlobal::insertCatalog("libplasmanetworkmanagement-editor"); // setting widgets
//KGlobal::insertCatalog("plasma_applet_org.kde.plasma.networkmanagement"); // mobile wizard, UiUtils, ...
KGlobal::locale()->insertCatalog("libplasmanetworkmanagement-editor"); // setting widgets
KGlobal::locale()->insertCatalog("plasma_applet_org.kde.plasma.networkmanagement"); // mobile wizard, UiUtils, ...
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if(args->count()) {
......
......@@ -29,7 +29,6 @@
#include <QUuid>
#include <QDebug>
#include <KStandardDirs>
#include <KLocalizedString>
#include <KMessageBox>
......
......@@ -27,6 +27,7 @@
#include <QLabel>
#include <QGraphicsLinearLayout>
#include <KLocale>
#include <KGlobalSettings>
#include <NetworkManagerQt/Manager>
......@@ -220,9 +221,9 @@ void TrafficMonitor::updateTraffic()
_r = m_rx.toDouble();
_t = m_tx.toDouble();
r = KGlobal::locale()->formatByteSize(_r*1024);
r = KLocale::global()->formatByteSize(_r*1024);
r.append("/s");
t = KGlobal::locale()->formatByteSize(_t*1024);
t = KLocale::global()->formatByteSize(_t*1024);
t.append("/s");
}
......@@ -240,10 +241,10 @@ void TrafficMonitor::updateTraffic()
temp = QString("<qt><table align=\"left\" border=\"0\"><tr>");
temp += QString("<td width=\"20pt\" bgcolor=\"%1\">&nbsp;&nbsp;").arg(m_rxColor.name());
temp += QString("</td><td width=\"50%\">");
temp += QString(format).arg(i18n("Received"), KGlobal::locale()->formatByteSize(m_rxTotal*1000, 2));
temp += QString(format).arg(i18n("Received"), KLocale::global()->formatByteSize(m_rxTotal*1000, 2));
temp += QString("&nbsp;&nbsp;</td></tr><tr><td width=\"20pt\" bgcolor=\"%1\">&nbsp;&nbsp;").arg(m_txColor.name());
temp += QString("</td><td width=\"50%\">");
temp += QString(format).arg(i18n("Transmitted"), KGlobal::locale()->formatByteSize(m_txTotal*1000, 2));
temp += QString(format).arg(i18n("Transmitted"), KLocale::global()->formatByteSize(m_txTotal*1000, 2));
temp += QString("</td></tr></table></qt>");
m_traffic->setText(temp);
}
......@@ -22,10 +22,9 @@
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <KLocale>
#include <KGlobal>
const QString MobileProviders::ProvidersFile = "/usr/share/mobile-broadband-provider-info/serviceproviders.xml";
......@@ -35,10 +34,10 @@ bool localeAwareCompare(const QString & one, const QString & two) {
MobileProviders::MobileProviders()
{
const QStringList allCountries = KGlobal::locale()->allCountriesList();
const QStringList allCountries = KLocale::global()->allCountriesList();
foreach (const QString & cc, allCountries) {
//qDebug() << "Inserting" << cc.toUpper() << KGlobal::locale()->countryCodeToName(cc);
mCountries.insert(cc.toUpper(), KGlobal::locale()->countryCodeToName(cc));
//qDebug() << "Inserting" << cc.toUpper() << KLocale::global()->countryCodeToName(cc);
mCountries.insert(cc.toUpper(), KLocale::global()->countryCodeToName(cc));
}
mError = Success;
......@@ -86,7 +85,7 @@ QStringList MobileProviders::getCountryList() const
QString MobileProviders::countryFromLocale() const
{
return KGlobal::locale()->country().toUpper();
return KLocale::global()->country().toUpper();
}
QStringList MobileProviders::getProvidersList(QString country, NetworkManager::ConnectionSettings::ConnectionType type)
......@@ -304,7 +303,7 @@ QVariantMap MobileProviders::getCdmaInfo(const QString & provider)
QString MobileProviders::getNameByLocale(const QMap<QString, QString> & localizedNames) const
{
QString name;
const QStringList locales = KGlobal::locale()->languageList();
const QStringList locales = KLocale::global()->languageList();
foreach(const QString & locale, locales) {
QString language, country, modifier, charset;
KLocale::splitLocale(locale, language, country, modifier, charset);
......
......@@ -28,7 +28,7 @@
#include <NetworkManagerQt/VpnSetting>
#include <NetworkManagerQt/ConnectionSettings>
#include <NetworkManagerQt/generic-types.h>
#include <NetworkManagerQt/generictypes.h>
#include <kdemacros.h>
......
......@@ -34,7 +34,6 @@
#include <NetworkManagerQt/WirelessDevice>
#include <NetworkManagerQt/WirelessSetting>
#include <KGlobal>
#include <KLocale>
#include <KLocalizedString>
......@@ -151,7 +150,7 @@ void NetworkModelItem::setDeviceState(const NetworkManager::Device::State state)
QString NetworkModelItem::download() const
{
double download = m_download.toDouble();
return KGlobal::locale()->formatByteSize(download*1024) + "/s";
return KLocale::global()->formatByteSize(download*1024) + "/s";
}
bool NetworkModelItem::duplicate() const
......@@ -373,7 +372,7 @@ QString NetworkModelItem::uni() const
QString NetworkModelItem::upload() const
{
double upload = m_upload.toDouble();
return KGlobal::locale()->formatByteSize(upload*1024) + "/s";
return KLocale::global()->formatByteSize(upload*1024) + "/s";
}
QString NetworkModelItem::uuid() const
......
......@@ -18,17 +18,18 @@
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "l2tp.h"
#include <KPluginFactory>
#include <KLocale>
#include "nm-l2tp-service.h"
#include <NetworkManagerQt/VpnSetting>
#include "nm-l2tp-service.h"
#include "l2tp.h"
#include "l2tpwidget.h"
#include "l2tpauth.h"
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_l2tpui"
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(L2tpUiPluginFactory, "plasmanetworkmanagement_l2tpui.json", registerPlugin<L2tpUiPlugin>();)
L2tpUiPlugin::L2tpUiPlugin(QObject * parent, const QVariantList &):
......@@ -76,4 +77,4 @@ bool L2tpUiPlugin::exportConnectionSettings(const NetworkManager::ConnectionSett
return false;
}
#include "l2tp.moc"
\ No newline at end of file
#include "l2tp.moc"
......@@ -26,16 +26,17 @@
#include "openconnectwidget.h"
#include "openconnectauth.h"
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_openconnectui"
#include <KLocalizedString>
K_PLUGIN_FACTORY(OpenconnectUiPluginFactory, registerPlugin<OpenconnectUiPlugin>();)
OpenconnectUiPlugin::OpenconnectUiPlugin(QObject * parent, const QVariantList &) : VpnUiPlugin(parent)
{
}
OpenconnectUiPlugin::~OpenconnectUiPlugin()
{
}
SettingWidget * OpenconnectUiPlugin::widget(const NetworkManager::VpnSetting::Ptr &setting, QWidget * parent)
......
......@@ -25,6 +25,8 @@
#include "openswanwidget.h"
#include "openswanauth.h"
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_openswanui"
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(OpenswanUiPluginFactory, "plasmanetworkmanagement_openswanui.json", registerPlugin<OpenswanUiPlugin>(); )
......@@ -77,4 +79,4 @@ bool OpenswanUiPlugin::exportConnectionSettings(const NetworkManager::Connection
return false;
}
#include "openswan.moc"
\ No newline at end of file
#include "openswan.moc"
......@@ -35,6 +35,9 @@
#include "nm-openvpn-service.h"
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_openvpnui"
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(OpenVpnUiPluginFactory, "plasmanetworkmanagement_openvpnui.json", registerPlugin<OpenVpnUiPlugin>();)
#define AUTH_TAG "auth"
......
......@@ -23,11 +23,12 @@
#include "nm-openvpn-service.h"
#include "settingwidget.h"
#include <QStandardPaths>
#include <QUrl>
#include <KLocalizedString>
#include <KProcess>
#include <KStandardDirs>
#include <KAcceleratorManager>
#include <QUrl>
class OpenVpnAdvancedWidget::Private {
public:
......@@ -69,7 +70,7 @@ OpenVpnAdvancedWidget::OpenVpnAdvancedWidget(const NetworkManager::VpnSetting::P
connect(m_ui->cmbProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyTypeChanged(int)));
// start openVPN process and get its cipher list
const QString openVpnBinary = KStandardDirs::findExe("openvpn", "/sbin:/usr/sbin");
const QString openVpnBinary = QStandardPaths::findExecutable("openvpn", QStringList() << "/sbin" << "/usr/sbin");
const QStringList args(QLatin1String("--show-ciphers"));
d->openvpnProcess = new KProcess(this);
d->openvpnProcess->setOutputChannelMode(KProcess::OnlyStdoutChannel);
......
......@@ -26,7 +26,6 @@
#include <QDebug>
#include <KProcess>
#include <KStandardDirs>
#include <KUrlRequester>
#include <KLineEdit>
#include <QUrl>
......
......@@ -26,6 +26,9 @@
#include "pptpwidget.h"
#include "pptpauth.h"
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_pptpui"
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(PptpUiPluginFactory, "plasmanetworkmanagement_pptpui.json", registerPlugin<PptpUiPlugin>();)
PptpUiPlugin::PptpUiPlugin(QObject * parent, const QVariantList &) : VpnUiPlugin(parent)
......
......@@ -26,6 +26,9 @@
#include <KPluginFactory>
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_strongswanui"
#include <KLocalizedString>
K_PLUGIN_FACTORY_WITH_JSON(StrongswanUiPluginFactory, "plasmanetworkmanagement_strongswanui.json", registerPlugin<StrongswanUiPlugin>();)
StrongswanUiPlugin::StrongswanUiPlugin(QObject * parent, const QVariantList &)
......
......@@ -23,9 +23,11 @@
#include "vpnc.h"
#include <QStandardPaths>
#include <QFile>
#include <KPluginFactory>
#include <KSharedConfig>
#include <KStandardDirs>
#include <KMessageBox>
#include <KLocalizedString>
#include <QDebug>
......@@ -38,6 +40,9 @@
#include "vpncwidget.h"
#include "vpncauth.h"
#define TRANSLATION_DOMAIN "plasmanetworkmanagement_vpncui"
#include <KLocalizedString>
VpncUiPluginPrivate::VpncUiPluginPrivate()
{
decryptedPasswd.clear();
......@@ -144,7 +149,7 @@ NMVariantMapMap VpncUiPlugin::importConnectionSettings(const QString &fileName)
KConfigGroup cg(config, "main"); // Keys&Values are stored under [main]
if (cg.exists()) {
// Setup cisco-decrypt binary to decrypt the passwords
const QString ciscoDecryptBinary = KStandardDirs::findExe("cisco-decrypt", QString::fromLocal8Bit(qgetenv("PATH")) + ":/usr/lib/vpnc");
const QString ciscoDecryptBinary = QStandardPaths::findExecutable("cisco-decrypt", QStringList() << QFile::decodeName(qgetenv("PATH")) << "/usr/lib/vpnc");
if (ciscoDecryptBinary.isEmpty()) {
mErrorMessage = i18n("Needed executable cisco-decrypt could not be found.");
return result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment