added icons

changes in the project architecture
This commit is contained in:
arcan1s 2014-07-10 13:48:21 +04:00
parent 2a3011bdef
commit e81f7714f9
18 changed files with 82 additions and 25 deletions

View File

@ -1,15 +1,17 @@
Ver.1.2.0:
+ [all] added icons
+ [gui] added suppoort of macvlan
+ [gui] added ability to remove profile
+ [gui] added support of hidden wifi network
+ [gui] added contextual menu to tables
* [all] small changes in the project architecture
* [plasmoid] edited configuration interface
Ver.1.1.0 (netctl-1.7 update):
+ [gui] added frequency
+ [plasmoid] added menu title
* [gui] changed definition if profile is enabled]
* [dataengine] changed definition if profile is enabled
* [gui] changed definition if profile is enabled
Ver.1.0.6:
* [gui] fix error checking

View File

@ -19,6 +19,9 @@ option (USE_QT5 "Use Qt5 instead of Qt4" ON)
option (BUILD_GUI "Build GUI" ON)
option (BUILD_DATAENGINE "Build data engine" ON)
option (BUILD_PLASMOID "Build plasmoid" ON)
if (BUILD_PLASMOID)
set (BUILD_DATAENGINE ON)
endif ()
# flags
if (CMAKE_COMPILER_IS_GNUCXX)
@ -30,12 +33,11 @@ else ()
message (STATUS "Unknown compiler")
endif ()
add_subdirectory (icons)
if (BUILD_PLASMOID)
set (BUILD_DATAENGINE ON)
endif ()
# resources
set (PROJECT_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
add_subdirectory (${PROJECT_RESOURCE_DIR})
# components
if (BUILD_GUI)
add_subdirectory (gui)
endif ()

View File

@ -5,7 +5,7 @@ message (STATUS "Subproject ${SUBPROJECT}")
# set directories
set (SUBPROJECT_BINARY_DIR bin)
set (SUBPROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set (SUBPROJECT_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
set (SUBPROJECT_RESOURCE_DIR ${PROJECT_RESOURCE_DIR})
set (SUBPROJECT_TRANSLATION_DIR ${SUBPROJECT_RESOURCE_DIR}/translations)
# executable path
set (EXECUTABLE_OUTPUT_PATH ${SUBPROJECT_BINARY_DIR})

View File

@ -1,6 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>translations/english.qm</file>
<file>translations/russian.qm</file>
</qresource>
</RCC>

View File

@ -90,6 +90,7 @@ MainWindow::MainWindow(QWidget *parent, const bool defaultSettings, const bool d
wpaCommand = new WpaSup(this, debug, configuration);
createActions();
setIconsToButtons();
updateTabs(ui->tabWidget->currentIndex());
ui->statusBar->showMessage(QApplication::translate("MainWindow", "Ready"));
}
@ -158,7 +159,7 @@ void MainWindow::createActions()
connect(ui->actionSettings, SIGNAL(triggered(bool)), settingsWin, SLOT(showWindow()));
connect(ui->actionQuit, SIGNAL(triggered(bool)), this, SLOT(close()));
// main page events
// main tab events
connect(ui->pushButton_mainRefresh, SIGNAL(clicked(bool)), this, SLOT(updateMainTab()));
connect(ui->pushButton_mainRemove, SIGNAL(clicked(bool)), this, SLOT(mainTabRemoveProfile()));
connect(ui->pushButton_mainEnable, SIGNAL(clicked(bool)), this, SLOT(mainTabEnableProfile()));
@ -176,7 +177,7 @@ void MainWindow::createActions()
connect(ui->pushButton_profileLoad, SIGNAL(clicked(bool)), this, SLOT(profileTabLoadProfile()));
connect(generalWid->connectionType, SIGNAL(currentIndexChanged(QString)), this, SLOT(profileTabChangeState(QString)));
// wifi page events
// wifi tab events
connect(ui->pushButton_wifiRefresh, SIGNAL(clicked(bool)), this, SLOT(updateWifiTab()));
connect(ui->pushButton_wifiStart, SIGNAL(clicked(bool)), this, SLOT(wifiTabStart()));
connect(ui->tableWidget_wifi, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(wifiTabStart()));
@ -185,6 +186,32 @@ void MainWindow::createActions()
}
void MainWindow::setIconsToButtons()
{
// tab widget
ui->tabWidget->setTabIcon(0, QIcon(":icon"));
ui->tabWidget->setTabIcon(1, QIcon::fromTheme("document-new"));
ui->tabWidget->setTabIcon(2, QIcon(":wifi"));
// main tab
ui->pushButton_mainRefresh->setIcon(QIcon::fromTheme("stock-refresh"));
ui->pushButton_mainRemove->setIcon(QIcon::fromTheme("edit-delete"));
// ui->pushButton_mainEnable->setIcon(QIcon(""));
// ui->pushButton_mainRestart->setIcon(QIcon(""));
// ui->pushButton_mainStart->setIcon(QIcon(""));
// profile tab
ui->pushButton_profileClear->setIcon(QIcon::fromTheme("edit-clear"));
ui->pushButton_profileSave->setIcon(QIcon::fromTheme("document-save"));
ui->pushButton_profileLoad->setIcon(QIcon::fromTheme("document-open"));
// wifi tab
ui->pushButton_wifiRefresh->setIcon(QIcon::fromTheme("stock-refresh"));
// ui->pushButton_wifiStart->setIcon(QIcon(""));
}
// window slots
void MainWindow::updateTabs(const int tab)
{
@ -317,12 +344,17 @@ void MainWindow::mainTabContextualMenu(const QPoint &pos)
// create menu
QMenu menu(this);
QAction *refreshTable = menu.addAction(QApplication::translate("MainWindow", "Refresh"));
refreshTable->setIcon(QIcon::fromTheme("stock-refresh"));
menu.addSeparator();
QAction *startProfile = menu.addAction(QApplication::translate("MainWindow", "Start profile"));
// startProfile->setIcon(QIcon(""));
QAction *restartProfile = menu.addAction(QApplication::translate("MainWindow", "Restart profile"));
// restartProfile->setIcon(QIcon(""));
QAction *enableProfile = menu.addAction(QApplication::translate("MainWindow", "Enable profile"));
// enableProfile->setIcon(QIcon(""));
menu.addSeparator();
QAction *removeProfile = menu.addAction(QApplication::translate("MainWindow", "Remove profile"));
removeProfile->setIcon(QIcon::fromTheme("edit-delete"));
// set text
QString item = ui->tableWidget_main->item(ui->tableWidget_main->currentItem()->row(), 2)->text();
@ -961,8 +993,10 @@ void MainWindow::wifiTabContextualMenu(const QPoint &pos)
// create menu
QMenu menu(this);
QAction *refreshTable = menu.addAction(QApplication::translate("MainWindow", "Refresh"));
refreshTable->setIcon(QIcon::fromTheme("stock-refresh"));
menu.addSeparator();
QAction *startWifi = menu.addAction(QApplication::translate("MainWindow", "Start WiFi"));
// startWifi->setIcon(QIcon(""));
// set text
QString item = ui->tableWidget_wifi->item(ui->tableWidget_wifi->currentItem()->row(), 1)->text();

View File

@ -109,6 +109,7 @@ private:
bool checkExternalApps(const QString apps);
bool checkState(const QString state, const QString item);
void createActions();
void setIconsToButtons();
bool debug;
// configuration
QMap<QString, QString> configuration;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>489</width>
<height>517</height>
<width>487</width>
<height>515</height>
</rect>
</property>
<property name="windowTitle">
@ -203,8 +203,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>457</width>
<height>359</height>
<width>96</width>
<height>26</height>
</rect>
</property>
<property name="sizePolicy">
@ -371,7 +371,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>489</width>
<width>487</width>
<height>22</height>
</rect>
</property>
@ -386,6 +386,9 @@
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionSettings">
<property name="icon">
<iconset theme="configure"/>
</property>
<property name="text">
<string>Settings</string>
</property>
@ -394,6 +397,9 @@
</property>
</action>
<action name="actionQuit">
<property name="icon">
<iconset theme="exit"/>
</property>
<property name="text">
<string>Quit</string>
</property>

View File

@ -1,6 +1,8 @@
# set project name
set (SUBPROJECT plasma_applet_netctl)
message (STATUS "Subproject ${SUBPROJECT}")
# find resources
set (RESOURCES ${PROJECT_RESOURCE_DIR}/resources.qrc)
# find required libaries
find_package (KDE4 REQUIRED)
@ -23,8 +25,9 @@ file (GLOB SUBPROJECT_UI *.ui)
configure_file (${SUBPROJECT_DESKTOP_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
# make
qt4_add_resources (QRC_SOURCES ${RESOURCES})
kde4_add_ui_files (SUBPROJECT_SOURCE ${SUBPROJECT_UI})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE} ${QRC_SOURCES})
target_link_libraries (${PLUGIN_NAME} ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})
# install

View File

@ -184,14 +184,14 @@ QList<QAction*> Netctl::contextualActions()
if (status) {
contextMenu[QString("start")]->setText(i18n("Start another profile"));
contextMenu[QString("stop")]->setVisible(true);
contextMenu[QString("stop")]->setText(i18n("Stop ") + info[QString("name")]);
contextMenu[QString("stop")]->setText(i18n("Stop %1", info[QString("name")]));
contextMenu[QString("restart")]->setVisible(true);
contextMenu[QString("restart")]->setText(i18n("Restart ") + info[QString("name")]);
contextMenu[QString("restart")]->setText(i18n("Restart %1", info[QString("name")]));
contextMenu[QString("enable")]->setVisible(true);
if (info[QString("status")].contains(QString("enabled")))
contextMenu[QString("enable")]->setText(i18n("Disable ") + info[QString("name")]);
contextMenu[QString("enable")]->setText(i18n("Disable %1", info[QString("name")]));
else
contextMenu[QString("enable")]->setText(i18n("Enable ") + info[QString("name")]);
contextMenu[QString("enable")]->setText(i18n("Enable %1", info[QString("name")]));
}
else {
contextMenu[QString("start")]->setText(i18n("Start profile"));
@ -222,6 +222,7 @@ void Netctl::createActions()
menuActions.append(contextMenu[QString("title")]);
contextMenu[QString("start")] = new QAction(i18n("Start profile"), this);
// contextMenu[QString("start")]->setIcon(QIcon(""));
startProfileMenu = new QMenu(NULL);
contextMenu[QString("start")]->setMenu(startProfileMenu);
connect(startProfileMenu, SIGNAL(triggered(QAction *)), this,
@ -229,18 +230,22 @@ void Netctl::createActions()
menuActions.append(contextMenu[QString("start")]);
contextMenu[QString("stop")] = new QAction(i18n("Stop profile"), this);
// contextMenu[QString("stop")]->setIcon(QIcon(""));
connect(contextMenu[QString("stop")], SIGNAL(triggered(bool)), this, SLOT(stopProfileSlot()));
menuActions.append(contextMenu[QString("stop")]);
contextMenu[QString("restart")] = new QAction(i18n("Restart profile"), this);
// contextMenu[QString("restart")]->setIcon(QIcon(""));
connect(contextMenu[QString("restart")], SIGNAL(triggered(bool)), this, SLOT(restartProfileSlot()));
menuActions.append(contextMenu[QString("restart")]);
contextMenu[QString("enable")] = new QAction(i18n("Enable profile"), this);
// contextMenu[QString("enable")]->setIcon(QIcon(""));
connect(contextMenu[QString("enable")], SIGNAL(triggered(bool)), this, SLOT(enableProfileSlot()));
menuActions.append(contextMenu[QString("enable")]);
contextMenu[QString("wifi")] = new QAction(i18n("Show WiFi menu"), this);
contextMenu[QString("wifi")]->setIcon(QIcon(":wifi"));
connect(contextMenu[QString("wifi")], SIGNAL(triggered(bool)), this, SLOT(showWifi()));
menuActions.append(contextMenu[QString("wifi")]);
}

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,10 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<!-- gui translations -->
<file>translations/english.qm</file>
<file>translations/russian.qm</file>
<!-- icons -->
<file>icon.png</file>
<file>wifi.png</file>
</qresource>
</RCC>

BIN
sources/resources/wifi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB