(remove symlinks)
This commit is contained in:
arcan1s
2014-08-20 22:16:06 +04:00
parent 35d740b778
commit 16662f697b
48 changed files with 74 additions and 66 deletions

View File

@ -1,7 +1,9 @@
# set files
file (GLOB SOURCES *.cpp)
file (GLOB HEADERS *.h)
file (GLOB FORMS *.ui)
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
${PROJECT_TRDPARTY_DIR}/language/*.cpp)
file (GLOB_RECURSE HEADERS *.h ${PROJECT_TRDPARTY_DIR}/task/*.h
${PROJECT_TRDPARTY_DIR}/language/*.h)
file (GLOB_RECURSE FORMS *.ui ${PROJECT_TRDPARTY_DIR}/about/*.ui)
file (GLOB LANGUAGES ${SUBPROJECT_TRANSLATION_DIR}/*.ts)
set (RESOURCES ${SUBPROJECT_RESOURCE_DIR}/resources.qrc)
@ -11,7 +13,8 @@ include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../${PROJECT_LIBRARY}/includ
${CMAKE_CURRENT_BINARY_DIR}/../
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR})
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_TRDPARTY_DIR})
link_directories (${PROJECT_LIBRARY}/src/lib)
if (USE_QT5)

View File

@ -1,218 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>About</class>
<widget class="QWidget" name="About">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>359</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_About">
<attribute name="title">
<string>About</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QScrollArea" name="scrollArea_about">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_about">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>284</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_name">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_version">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_description">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignJustify|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_links">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="spacer_about">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_ackn">
<attribute name="title">
<string>Acknowledgement</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QScrollArea" name="scrollArea_ackn">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_ackn">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>284</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_translators">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_trdparty">
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<spacer name="spacer_ackn">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>229</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QLabel" name="label_license">
<property name="text">
<string/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -22,7 +22,8 @@
#include <QDialogButtonBox>
#include <QPushButton>
#include "pdebug.h"
#include <pdebug/pdebug.h>
#include "version.h"

View File

@ -21,7 +21,7 @@
#include <QDBusMessage>
#include <QDebug>
#include "pdebug.h"
#include <pdebug/pdebug.h>
QList<netctlProfileInfo> parseOutputNetctl(const QList<QVariant> raw,

View File

@ -22,7 +22,7 @@
#include <QSpacerItem>
#include <QDebug>
#include "pdebug.h"
#include <pdebug/pdebug.h>
ErrorWindow::ErrorWindow(QWidget *parent, const bool debugCmd)

View File

@ -1,115 +0,0 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include "language.h"
#include <QFile>
#include <QLocale>
Language::Language()
{
}
QString Language::checkLanguage(const QString language, const QString defaultLanguage)
{
QStringList availableLanguages = getAvailableLanguages();
for (int i=0; i<availableLanguages.count(); i++)
if (language == availableLanguages[i])
return availableLanguages[i];
for (int i=0; i<availableLanguages.count(); i++)
if (language.contains(availableLanguages[i] + QChar('_')))
return availableLanguages[i];
return defaultLanguage;
}
QString Language::defineLanguage(const QString configPath, const QString options)
{
QMap<QString, QString> optionsDict = parseOptions(options);
if (optionsDict.contains(QString("LANGUAGE")))
if (getAvailableLanguages().contains(optionsDict[QString("LANGUAGE")]))
return optionsDict[QString("LANGUAGE")];
QString language;
language = defineLanguageFromFile(configPath);
if (language.isEmpty())
language = defineLanguageFromLocale();
language = checkLanguage(language, QString("en"));
return language;
}
QString Language::defineLanguageFromFile(const QString configPath)
{
QMap<QString, QString> settings;
if (configPath.isEmpty())
return QString("");
QFile configFile(configPath);
QString fileStr;
if (!configFile.open(QIODevice::ReadOnly))
return QString("");
while (true) {
fileStr = QString(configFile.readLine()).trimmed();
if ((fileStr.isEmpty()) && (!configFile.atEnd())) continue;
if ((fileStr[0] == QChar('#')) && (!configFile.atEnd())) continue;
if ((fileStr[0] == QChar(';')) && (!configFile.atEnd())) continue;
if (fileStr.contains(QChar('=')))
settings[fileStr.split(QChar('='))[0]] = fileStr.split(QChar('='))[1];
if (configFile.atEnd()) break;
}
configFile.close();
if (settings.contains(QString("LANGUAGE")))
return settings[QString("LANGUAGE")];
else
return QString("");
}
QString Language::defineLanguageFromLocale()
{
return QLocale::system().name();
}
QStringList Language::getAvailableLanguages()
{
QStringList languages;
languages.append(QString("en"));
languages.append(QString("ru"));
return languages;
}
QMap<QString, QString> Language::parseOptions(const QString options)
{
QMap<QString, QString> optionsDict;
for (int i=0; i<options.split(QChar(',')).count(); i++) {
if (options.split(QChar(','))[i].split(QChar('=')).count() < 2)
continue;
optionsDict[options.split(QChar(','))[i].split(QChar('='))[0]] =
options.split(QChar(','))[i].split(QChar('='))[1];
}
return optionsDict;
}

View File

@ -1,43 +0,0 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef LANGUAGE_H
#define LANGUAGE_H
#include <QStringList>
class Language : public QObject
{
Q_OBJECT
public:
explicit Language();
static QString checkLanguage(const QString language,
const QString defaultLanguage = QString("en"));
static QString defineLanguage(const QString configPath,
const QString options = QString("OPTIONS"));
static QString defineLanguageFromFile(const QString configPath);
static QString defineLanguageFromLocale();
static QStringList getAvailableLanguages();
private:
static QMap<QString, QString> parseOptions(const QString options);
};
#endif /* LANGUAGE_H */

View File

@ -25,7 +25,8 @@
#include <iostream>
#include <unistd.h>
#include "language.h"
#include <language/language.h>
#include "mainwindow.h"
#include "messages.h"
#include "version.h"

View File

@ -24,6 +24,8 @@
#include <QFileInfo>
#include <QUrl>
#include <pdebug/pdebug.h>
#include "bridgewidget.h"
#include "dbusoperation.h"
#include "errorwindow.h"
@ -33,7 +35,6 @@
#include "macvlanwidget.h"
#include "mobilewidget.h"
#include "passwdwidget.h"
#include "pdebug.h"
#include "pppoewidget.h"
#include "tunnelwidget.h"
#include "tuntapwidget.h"

View File

@ -24,15 +24,16 @@
#include <QTranslator>
#include <QUrl>
#include <language/language.h>
#include <pdebug/pdebug.h>
#include <task/taskadds.h>
#include "aboutwindow.h"
#include "dbusoperation.h"
#include "errorwindow.h"
#include "language.h"
#include "netctlautowindow.h"
#include "passwdwidget.h"
#include "pdebug.h"
#include "settingswindow.h"
#include "taskadds.h"
#include "trayicon.h"
#include "version.h"

View File

@ -22,6 +22,9 @@
#include <QDBusMessage>
#include <QDebug>
#include <pdebug/pdebug.h>
#include <task/taskadds.h>
#include "aboutwindow.h"
#include "bridgewidget.h"
#include "dbusoperation.h"
@ -34,10 +37,8 @@
#include "netctlautowindow.h"
#include "netctlguiadaptor.h"
#include "passwdwidget.h"
#include "pdebug.h"
#include "pppoewidget.h"
#include "settingswindow.h"
#include "taskadds.h"
#include "trayicon.h"
#include "tunnelwidget.h"
#include "tuntapwidget.h"

View File

@ -21,9 +21,9 @@
#include <QDebug>
#include <netctlgui/netctlgui.h>
#include <pdebug/pdebug.h>
#include "dbusoperation.h"
#include "pdebug.h"
#include "version.h"

View File

@ -1 +0,0 @@
../../3rdparty/pdebug/pdebug.h

View File

@ -23,9 +23,10 @@
#include <QFileDialog>
#include <QTextStream>
#include "language.h"
#include <language/language.h>
#include <pdebug/pdebug.h>
#include "mainwindow.h"
#include "pdebug.h"
SettingsWindow::SettingsWindow(QWidget *parent, const bool debugCmd, const QString configFile)

View File

@ -1 +0,0 @@
../../3rdparty/task/task.h

View File

@ -1 +0,0 @@
../../3rdparty/task/taskadds.cpp

View File

@ -1 +0,0 @@
../../3rdparty/task/taskadds.h

View File

@ -21,8 +21,9 @@
#include <QMenu>
#include <QMessageBox>
#include <pdebug/pdebug.h>
#include "mainwindow.h"
#include "pdebug.h"
TrayIcon::TrayIcon(QObject *parent, const bool debugCmd)