Skip to content

Commit

Permalink
initial support of quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
arcan1s committed Apr 28, 2015
1 parent 7ae90bf commit fd8f212
Show file tree
Hide file tree
Showing 46 changed files with 3,149 additions and 703 deletions.
2 changes: 1 addition & 1 deletion sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set (PROJECT_CONTACT "esalexeev@gmail.com")
set (PROJECT_LICENSE "GPLv3")
set (PROJECT_VERSION_MAJOR 2)
set (PROJECT_VERSION_MINOR 2)
set (PROJECT_VERSION_PATCH 1)
set (PROJECT_VERSION_PATCH 2)
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})

string (TIMESTAMP CURRENT_DATE "%Y-%m-%d %H:%M" UTC)
Expand Down
2 changes: 1 addition & 1 deletion sources/awesome-widget-kf5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ configure_file (metadata.desktop ${CMAKE_CURRENT_SOURCE_DIR}/package/metadata.de
find_package (ECM 0.0.12 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

find_package (Qt5 REQUIRED COMPONENTS Core Network Qml)
find_package (Qt5 REQUIRED COMPONENTS Core Network Qml Xml)
find_package (KF5 REQUIRED COMPONENTS I18n Notifications Plasma)

include (KDEInstallDirs)
Expand Down
17 changes: 17 additions & 0 deletions sources/awesome-widget-kf5/package/contents/ui/dataengine.qml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,23 @@ Item {
}
}

Row {
height: implicitHeight
width: parent.width
QtControls.Label {
height: parent.height
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter
text: i18n("Quotes monitor")
}
QtControls.Button {
width: parent.width * 3 / 5
text: i18n("Edit tickers")
onClicked: AWKeys.editItem("extquotes")
}
}

Row {
height: implicitHeight
width: parent.width
Expand Down
9 changes: 6 additions & 3 deletions sources/awesome-widget-kf5/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
set (PLUGIN_NAME awplugin)

add_definitions (${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS})
add_definitions (${Qt5Core_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5Xml_DEFINITIONS})
set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5Qml_INCLUDE_DIRS})
${Qt5Qml_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS})
set (Qt_LIBRARIES ${Qt5Core_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Qml_LIBRARIES})
${Qt5Qml_LIBRARIES}
${Qt5Xml_LIBRARIES})
set (Kf5_INCLUDE ${I18n_INCLUDE_DIR}
${Notifications_INCLUDE_DIR})
set (Kf5_LIBRARIES KF5::I18n
Expand All @@ -28,6 +30,7 @@ file (GLOB SUBPROJECT_UI *.ui)
# task source is required by extscripts
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
${PROJECT_TRDPARTY_DIR}/fontdialog/*.cpp
../../extsysmon/extquotes.cpp
../../extsysmon/extscript.cpp
../../extsysmon/extupgrade.cpp)
set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h)
Expand Down
206 changes: 168 additions & 38 deletions sources/awesome-widget-kf5/plugin/awkeys.cpp

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions sources/awesome-widget-kf5/plugin/awkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


class AWToolTip;
class ExtQuotes;
class ExtScript;
class ExtUpgrade;
class GraphicalItem;
Expand All @@ -41,6 +42,7 @@ class AWKeys : public QObject
enum RequestedItem {
Nothing,
RequestedGraphicalItem,
RequestedExtQuotes,
RequestedExtScript,
RequestedExtUpgrade
};
Expand Down Expand Up @@ -78,6 +80,7 @@ class AWKeys : public QObject
private slots:
void editItemButtonPressed(QAbstractButton *button);
void copyBar(const QString original);
void copyQuotes(const QString original);
void copyScript(const QString original);
void copyUpgrade(const QString original);

Expand All @@ -91,6 +94,7 @@ private slots:
QStringList findGraphicalItems(const QString pattern);
QStringList findKeys(const QString pattern);
// get methods
QList<ExtQuotes *> getExtQuotes();
QList<ExtScript *> getExtScripts();
QList<ExtUpgrade *> getExtUpgrade();
QList<GraphicalItem *> getGraphicalItems();
Expand All @@ -110,6 +114,7 @@ private slots:
bool enablePopup = false;
bool ready = false;
QList<GraphicalItem *> graphicalItems;
QList<ExtQuotes *> extQuotes;
QList<ExtScript *> extScripts;
QList<ExtUpgrade *> extUpgrade;
QStringList foundBars, foundKeys, keys;
Expand Down
17 changes: 9 additions & 8 deletions sources/extsysmon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (BUILD_KDE4)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
set (KDE_INCLUDE ${KDE4_INCLUDES})
else ()
find_package (Qt5 REQUIRED COMPONENTS DBus Network Widgets)
find_package (Qt5 REQUIRED COMPONENTS DBus Network Widgets Xml)
find_package (ECM 0.0.11 REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package (KF5 REQUIRED COMPONENTS Plasma Service WindowSystem)
Expand All @@ -21,11 +21,9 @@ else ()
include (KDECompilerSettings)

add_definitions (${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS}
${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS})
set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS})
${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS})
set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS})
set (KDE_INCLUDE ${Plasma_INCLUDE_DIR})
endif ()

Expand All @@ -43,6 +41,7 @@ file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp)
set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h)
file (GLOB SUBPROJECT_UI *.ui)
file (GLOB SUBPROJECT_CONF *.conf)
set (SUBPROJECT_QUOTES ${CMAKE_CURRENT_SOURCE_DIR}/quotes)
set (SUBPROJECT_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/scripts)
set (SUBPROJECT_UPGRADE ${CMAKE_CURRENT_SOURCE_DIR}/upgrade)

Expand All @@ -54,13 +53,14 @@ if (BUILD_KDE4)
qt4_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER})
kde4_add_ui_files (SUBPROJECT_SOURCE ${SUBPROJECT_UI})
kde4_add_plugin (${PLUGIN_NAME} ${SUBPROJECT_SOURCE} ${TASK_MOC_SOURCE})
target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTNETWORK_LIBRARY})
target_link_libraries (${PLUGIN_NAME} ${KDE4_KDECORE_LIBS} ${KDE4_PLASMA_LIBS}
${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY})
else ()
qt5_wrap_cpp (TASK_MOC_SOURCE ${TASK_HEADER})
qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
add_library (${PLUGIN_NAME} MODULE ${SUBPROJECT_SOURCE} ${SUBPROJECT_UI_HEADER} ${TASK_MOC_SOURCE})
target_link_libraries (${PLUGIN_NAME} ${Plasma_LIBRARIES} KF5::WindowSystem
${Qt5DBus_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES})
${Qt5DBus_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Xml_LIBRARIES})
kcoreaddons_desktop_to_json (${PLUGIN_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP})
endif ()

Expand All @@ -72,5 +72,6 @@ else ()
endif ()
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_DESKTOP} DESTINATION ${SERVICES_INSTALL_DIR})
install (FILES ${SUBPROJECT_CONF} DESTINATION ${CONFIG_INSTALL_DIR})
install (DIRECTORY ${SUBPROJECT_QUOTES} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
install (DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
install (DIRECTORY ${SUBPROJECT_UPGRADE} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
Loading

0 comments on commit fd8f212

Please sign in to comment.