mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-05 01:55:47 +00:00
update changelog and some translations fixes
This commit is contained in:
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>427</width>
|
||||
<height>533</height>
|
||||
<width>425</width>
|
||||
<height>531</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -125,7 +125,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>openvswitch</string>
|
||||
<string notr="true">openvswitch</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMessage>
|
||||
#include <QDir>
|
||||
#include <QLibraryInfo>
|
||||
#include <QTranslator>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
@ -138,6 +139,9 @@ int main(int argc, char *argv[])
|
||||
// reread translations according to flags
|
||||
QString language = Language::defineLanguage(args[QString("config")].toString(),
|
||||
args[QString("options")].toString());
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load(QString("qt_") + language, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
a.installTranslator(&qtTranslator);
|
||||
QTranslator translator;
|
||||
translator.load(QString(":/translations/") + language);
|
||||
a.installTranslator(&translator);
|
||||
@ -162,6 +166,6 @@ int main(int argc, char *argv[])
|
||||
// check if exists
|
||||
if (restoreExistSession())
|
||||
return 0;
|
||||
MainWindow w(0, args, &translator);
|
||||
MainWindow w(0, args, &qtTranslator, &translator);
|
||||
return a.exec();
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDesktopServices>
|
||||
#include <QLibraryInfo>
|
||||
#include <QTranslator>
|
||||
#include <QUrl>
|
||||
|
||||
@ -321,6 +322,8 @@ void MainWindow::updateConfiguration(const QMap<QString, QVariant> args)
|
||||
qApp->removeTranslator(translator);
|
||||
QString language = Language::defineLanguage(configPath,
|
||||
args[QString("options")].toString());
|
||||
qtTranslator->load(QString("qt_") + language, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
qApp->installTranslator(qtTranslator);
|
||||
translator->load(QString(":/translations/") + language);
|
||||
qApp->installTranslator(translator);
|
||||
|
||||
|
@ -47,10 +47,12 @@
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent,
|
||||
const QMap<QString, QVariant> args,
|
||||
QTranslator *qtAppTranslator,
|
||||
QTranslator *appTranslator)
|
||||
: QMainWindow(parent),
|
||||
configPath(args[QString("config")].toString()),
|
||||
debug(args[QString("debug")].toBool()),
|
||||
qtTranslator(qtAppTranslator),
|
||||
translator(appTranslator)
|
||||
{
|
||||
if (debug) qDebug() << "[MainWindow]" << "[MainWindow]" << ":" << "about" << args[QString("about")].toBool();
|
||||
@ -294,6 +296,8 @@ bool MainWindow::checkHelperStatus()
|
||||
QList<QVariant>(), true, debug);
|
||||
if (isHelperServiceActive())
|
||||
configuration[QString("CLOSE_HELPER")] = QString("false");
|
||||
|
||||
return useHelper;
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,6 +54,7 @@ class MainWindow : public QMainWindow
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = 0,
|
||||
const QMap<QString, QVariant> args = QMap<QString, QVariant>(),
|
||||
QTranslator *qtAppTranslator = 0,
|
||||
QTranslator *appTranslator = 0);
|
||||
~MainWindow();
|
||||
QStringList printInformation();
|
||||
@ -162,6 +163,7 @@ private:
|
||||
bool hiddenNetwork;
|
||||
bool isDaemon = false;
|
||||
bool useHelper = true;
|
||||
QTranslator *qtTranslator = nullptr;
|
||||
QTranslator *translator = nullptr;
|
||||
// configuration
|
||||
QMap<QString, QString> configuration;
|
||||
|
@ -52,8 +52,9 @@ void SettingsWindow::createActions()
|
||||
if (debug) qDebug() << "[SettingsWindow]" << "[createActions]";
|
||||
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked(bool)), this, SLOT(close()));
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked(bool)), this, SLOT(setDefault()));
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked(bool)), this, SLOT(closeWindow()));
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked(bool)), this, SLOT(restoreSettings()));
|
||||
connect(ui->buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked(bool)), this, SLOT(setDefault()));
|
||||
connect(ui->checkBox_enableTray, SIGNAL(stateChanged(int)), this, SLOT(setTray()));
|
||||
connect(ui->treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
|
||||
this, SLOT(changePage(QTreeWidgetItem *, QTreeWidgetItem *)));
|
||||
@ -143,12 +144,21 @@ void SettingsWindow::setTray()
|
||||
}
|
||||
|
||||
|
||||
void SettingsWindow::restoreSettings()
|
||||
{
|
||||
if (debug) qDebug() << "[SettingsWindow]" << "[restoreSettings]";
|
||||
|
||||
setSettings(getSettings());
|
||||
}
|
||||
|
||||
|
||||
void SettingsWindow::setDefault()
|
||||
{
|
||||
if (debug) qDebug() << "[SettingsWindow]" << "[setDefault]";
|
||||
|
||||
setSettings(getDefault());
|
||||
saveSettings();
|
||||
if (sender() != ui->buttonBox->button(QDialogButtonBox::Reset))
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void closeWindow();
|
||||
void restoreSettings();
|
||||
void setDefault();
|
||||
void showWindow();
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>682</width>
|
||||
<height>399</height>
|
||||
<width>680</width>
|
||||
<height>397</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -136,8 +136,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>466</width>
|
||||
<height>338</height>
|
||||
<width>464</width>
|
||||
<height>336</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
@ -211,8 +211,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>466</width>
|
||||
<height>338</height>
|
||||
<width>397</width>
|
||||
<height>322</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
@ -845,8 +845,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>466</width>
|
||||
<height>338</height>
|
||||
<width>436</width>
|
||||
<height>103</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_11">
|
||||
@ -962,7 +962,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset|QDialogButtonBox::RestoreDefaults</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Reference in New Issue
Block a user