From 2b5b314cfd27f4e5b123b5c7d5aa7282d41efce1 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 10 Sep 2012 10:28:16 -0500 Subject: [PATCH] Fix movie loading --- .../hi16-action-nm_stage01_connecting.mng | Bin 8283 -> 8270 bytes .../hi16-action-nm_stage02_connecting.mng | Bin 7835 -> 7822 bytes .../hi16-action-nm_stage02_connecting_vpn.mng | Bin 9339 -> 9326 bytes .../hi16-action-nm_stage03_connecting.mng | Bin 7466 -> 7453 bytes .../hi16-action-nm_stage03_connecting_vpn.mng | Bin 9049 -> 9036 bytes .../hi32-action-nm_stage01_connecting.mng | Bin 20419 -> 20406 bytes .../hi32-action-nm_stage02_connecting.mng | Bin 19731 -> 19718 bytes .../hi32-action-nm_stage02_connecting_vpn.mng | Bin 25564 -> 25551 bytes .../hi32-action-nm_stage03_connecting.mng | Bin 18480 -> 18467 bytes .../hi32-action-nm_stage03_connecting_vpn.mng | Bin 24380 -> 24367 bytes .../hi48-action-nm_stage01_connecting.mng | Bin 36612 -> 36599 bytes .../hi48-action-nm_stage02_connecting.mng | Bin 35740 -> 35727 bytes .../hi48-action-nm_stage02_connecting_vpn.mng | Bin 47711 -> 47698 bytes .../hi48-action-nm_stage03_connecting.mng | Bin 33314 -> 33301 bytes .../hi48-action-nm_stage03_connecting_vpn.mng | Bin 45432 -> 45419 bytes .../hi64-action-nm_stage01_connecting.mng | Bin 55712 -> 55699 bytes .../hi64-action-nm_stage02_connecting.mng | Bin 54386 -> 54373 bytes .../hi64-action-nm_stage02_connecting_vpn.mng | Bin 74238 -> 74225 bytes .../hi64-action-nm_stage03_connecting.mng | Bin 50471 -> 50458 bytes .../hi64-action-nm_stage03_connecting_vpn.mng | Bin 70470 -> 70457 bytes tdenetworkmanager/pics/updatemovies.sh | 40 +- tdenetworkmanager/src/CMakeLists.txt | 2 +- ...nection_setting_wireless_security_widget.h | 5 +- ...man-connection_setting_wireless_widget.cpp | 2 + tdenetworkmanager/src/devicetraycomponent.cpp | 9 +- tdenetworkmanager/src/devicetraycomponent.h | 4 + .../src/tdenetman-device_tray.cpp | 379 ------------------ tdenetworkmanager/src/tdenetman-device_tray.h | 88 ---- .../src/tdenetman-wireless_manager.h | 1 - 29 files changed, 38 insertions(+), 492 deletions(-) delete mode 100644 tdenetworkmanager/src/tdenetman-device_tray.cpp delete mode 100644 tdenetworkmanager/src/tdenetman-device_tray.h diff --git a/tdenetworkmanager/pics/hi16-action-nm_stage01_connecting.mng b/tdenetworkmanager/pics/hi16-action-nm_stage01_connecting.mng index 2605a8897a33c4427cd7c88ebc4b6b79083f9050..6414aa46ff4679f9a99033e4be3bb6b756f26041 100644 GIT binary patch delta 31 kcmccZaL!>uJ0CLx69X7<{X4yP?dCw{(@dLlncv9(0G|R1k^lez delta 50 xcmX@-aNA)*J0Bwh69X7<{j$rQFqvOiW^)4bG$t-aw;)Gf=DWgDH=ttgWB^;y4i^9b diff --git a/tdenetworkmanager/pics/hi16-action-nm_stage02_connecting.mng b/tdenetworkmanager/pics/hi16-action-nm_stage02_connecting.mng index 8e25a71912bf66156d0f11b238c67cae4fdd041a..270e9466eb0561b4076cfa7541806683a1e4cde2 100644 GIT binary patch delta 38 rcmbPj+h;qWosXG;i2)3_{+-^tcJh4znT;DaFio!KmfYOVEFuj6IoFJ0CLx69X7<{X4yP?c|BPG8;E`GEKg~D!Dm<`IIC8<=PC_ delta 49 zcmbPhwaRKjJ0Bwh69X7<{j$rQF!=zh%*KtKOk9j^L5{x6cZH>HfP^*&GoO+K09#@X A`Tzg` diff --git a/tdenetworkmanager/pics/hi16-action-nm_stage03_connecting_vpn.mng b/tdenetworkmanager/pics/hi16-action-nm_stage03_connecting_vpn.mng index 6c6ebd4c233c6abf9607d1b1da0422be658b231f..07b37a39727651085313169b4701d5989ec5e6d7 100644 GIT binary patch delta 38 rcmccVcE)W&J0CLx69X7<{X4yP?d1JpG8;E?Gf(apme~A|xk4TQ^pOn+ delta 49 zcmX@(cGGP_J0Bwh69X7<{j$rQFu7h>dgBHjW-dmzAV**3yTVd8Kth|ZFjvR}0ASn> AzyJUM diff --git a/tdenetworkmanager/pics/hi32-action-nm_stage01_connecting.mng b/tdenetworkmanager/pics/hi32-action-nm_stage01_connecting.mng index d0979e72658c5bb762fe56996c65238b0fa2e450..75a27cdcdbfe427d7da2657ae133fabf5f3eea8d 100644 GIT binary patch delta 37 ocmX>+pK;rK#tH3w%nVEnV8He7^xn0TKPt*>&SGD~1|%Xq0Okt}eET#Rl(j=s!yg{5u)`K2BJ7gP+N diff --git a/tdenetworkmanager/pics/hi32-action-nm_stage02_connecting.mng b/tdenetworkmanager/pics/hi32-action-nm_stage02_connecting.mng index c05519eea42b2f6c0b0f64b25b304ff21d5492c1..4effbdbcb8394b2038cc651f34124aa0eaad7c7d 100644 GIT binary patch delta 40 tcmbO{i?MAMt^fvg4h{eS delta 51 zcmZph#W;Bus8=Kj<7~O&#eVOkHOWoLP$o|Oz05=^C A;s5{u diff --git a/tdenetworkmanager/pics/hi32-action-nm_stage03_connecting_vpn.mng b/tdenetworkmanager/pics/hi32-action-nm_stage03_connecting_vpn.mng index 0469b431f16753c2d8fd175d145f3c1c3e6edd87..4eaaa579b31ff777911923519c48d0b2a078df59 100644 GIT binary patch delta 40 tcmdn9k8%Az#tH3w%nVEnV8He7^xn0TKibG_+*r>sdA_#f<}l7@p#U9N4%q+z delta 51 zcmZ3#k8#gF#tH3wj0{W+V8HduE_cG@er=hJ8|yi^7~O&#eVOkHOWgnoZT94R7775B Cf)HW= diff --git a/tdenetworkmanager/pics/hi48-action-nm_stage01_connecting.mng b/tdenetworkmanager/pics/hi48-action-nm_stage01_connecting.mng index f0b8332ceb9fb45053c18cbffa223e2c284ede5c..eca51d7fbbbb12fbdecbb33bdd2a7dcce81621e5 100644 GIT binary patch delta 40 tcmZpf$Mk(J(}Z?DW(Fn(FyQ)kdhgoFAG4)5Zg|2yc|o(}=3P8qO#mO?50C%= delta 44 vcmex9m#JkQ(}Z?DMg}GZFyQ)SmpfteM4tcLT#Rl(j=s!yg{5u)`Dsl6COZwv diff --git a/tdenetworkmanager/pics/hi48-action-nm_stage02_connecting.mng b/tdenetworkmanager/pics/hi48-action-nm_stage02_connecting.mng index e616d5c45bdded7de463ac1aedfc6267efd6517a..1260afff1cac67ec6da43d3bfdef0d3122cd8e6d 100644 GIT binary patch delta 40 tcmbO;ovD91(}Z?DW(Fn(FyQ)kdhgoF0a7v>H}2<|obMyKc^WTU9RU724NL$4 delta 51 zcmeC5&NOE_(}Z?DMg}GZFyQ)Smpfr{ypPPrjr)1H7~O&#eVOkHOWgnoZSLe{s{;Ui Cv=4~@ diff --git a/tdenetworkmanager/pics/hi48-action-nm_stage02_connecting_vpn.mng b/tdenetworkmanager/pics/hi48-action-nm_stage02_connecting_vpn.mng index fc6f635813efc2486a0aabac297ae869aebc0e79..fd50353a310466d158f6cec94426f0f2ddf3fd44 100644 GIT binary patch delta 40 tcmccrh3V24rU~tQ%nVEnV8He7^xn0TwaaBTZoDTjS+87j^H#xCD*!WZ55fQd delta 51 zcmccgh3WnmrU~tQj0{W+V8HduE_cFYxpJ9}8}A8lF}ejg`ZC`Ymbw8F+Pp$=)d~Q- CdJ(Yz diff --git a/tdenetworkmanager/pics/hi48-action-nm_stage03_connecting.mng b/tdenetworkmanager/pics/hi48-action-nm_stage03_connecting.mng index e5f32d21bea0183bc9d1fe973a54000054942c1d..0f1964fdb8bf5ebdb376d9b9b4196a1e2a9bbf65 100644 GIT binary patch delta 40 tcmZ3~!ZfvoX+k?6GXoO?7;ybNy?5>8MhTgX8&7dh7O;`rypX4{6af2&4R`~X C*b;mI diff --git a/tdenetworkmanager/pics/hi64-action-nm_stage01_connecting.mng b/tdenetworkmanager/pics/hi64-action-nm_stage01_connecting.mng index 77bae451ee75aebd1bcb7a1799cca4bdfc7d9d45..4bd4608d1f3bf3d176d37915a8741c63a76bed61 100644 GIT binary patch delta 37 pcmZ3mnR)VN<_Yb5%nVEnV8He7^xn0T^F3uYKNr#z0unoq0RZAj4S)au delta 52 zcmbQdnR&rx<_Yb5j0{W+V8HduE_cG@ixXuw-x3lK;$n0Qa`a`sD=c*bDz@_&0H#e6 A9smFU diff --git a/tdenetworkmanager/pics/hi64-action-nm_stage02_connecting.mng b/tdenetworkmanager/pics/hi64-action-nm_stage02_connecting.mng index 0732be6239e73334fa5517e9a6e9bbd70da39b47..addba201a271817ad2856b9048a78ab6c412ca74 100644 GIT binary patch delta 40 tcmeygg8AtR<_Yb5%nVEnV8He7^xn0T`9x$kZVVQle4$u!vzCa*0RR`+4i*3a delta 47 zcmaF5g89=5<_Yb5j0{W+V8HduE_cFYMiH5f8-s{A%nVEnV8He7^xn0TbuUYA+`un2+2FE7^AoA{Aj0{W+V8HduE_cFYh0D?#H}FewF}ejg`ZC`Ymbw8FYQ8SD{kjyR G6gvR81!giEH(nN;tS~`h^Gcz*O#lX>4u=2$ delta 47 zcmbQ$#k{;|SjBY`WzRY)prEY9)6q>mS074)R A@&Et; diff --git a/tdenetworkmanager/pics/hi64-action-nm_stage03_connecting_vpn.mng b/tdenetworkmanager/pics/hi64-action-nm_stage03_connecting_vpn.mng index 881745b6a4cd8079d3074ee3932637ee98642677..d208ab3a574718aab6033ebb299183b2db3bd411 100644 GIT binary patch delta 40 ucmX@MjAiFCmI>{A%nVEnV8He7^xn0T`=?58+%QFAa>66Y%~_InegXg<$`BI( delta 47 zcmdnFjOExemI>{Aj0{W+V8HduE_cFYM@hAfyE`Sg7~O&#eVOkHOWoM)DEZ?j08al8 AZvX%Q diff --git a/tdenetworkmanager/pics/updatemovies.sh b/tdenetworkmanager/pics/updatemovies.sh index 3bd7d39..3078714 100755 --- a/tdenetworkmanager/pics/updatemovies.sh +++ b/tdenetworkmanager/pics/updatemovies.sh @@ -1,22 +1,22 @@ #!/bin/bash -convert -dispose Background hi22-action-nm_stage01_connecting.mng -resize 16x16 hi16-action-nm_stage01_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting.mng -resize 16x16 hi16-action-nm_stage02_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting_vpn.mng -resize 16x16 hi16-action-nm_stage02_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage03_connecting.mng -resize 16x16 hi16-action-nm_stage03_connecting.mng -convert -dispose Background hi22-action-nm_stage03_connecting_vpn.mng -resize 16x16 hi16-action-nm_stage03_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage01_connecting.mng -resize 32x32 hi32-action-nm_stage01_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting.mng -resize 32x32 hi32-action-nm_stage02_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting_vpn.mng -resize 32x32 hi32-action-nm_stage02_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage03_connecting.mng -resize 32x32 hi32-action-nm_stage03_connecting.mng -convert -dispose Background hi22-action-nm_stage03_connecting_vpn.mng -resize 32x32 hi32-action-nm_stage03_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage01_connecting.mng -resize 48x48 hi48-action-nm_stage01_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting.mng -resize 48x48 hi48-action-nm_stage02_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting_vpn.mng -resize 48x48 hi48-action-nm_stage02_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage03_connecting.mng -resize 48x48 hi48-action-nm_stage03_connecting.mng -convert -dispose Background hi22-action-nm_stage03_connecting_vpn.mng -resize 48x48 hi48-action-nm_stage03_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage01_connecting.mng -resize 64x64 hi64-action-nm_stage01_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting.mng -resize 64x64 hi64-action-nm_stage02_connecting.mng -convert -dispose Background hi22-action-nm_stage02_connecting_vpn.mng -resize 64x64 hi64-action-nm_stage02_connecting_vpn.mng -convert -dispose Background hi22-action-nm_stage03_connecting.mng -resize 64x64 hi64-action-nm_stage03_connecting.mng -convert -dispose Background hi22-action-nm_stage03_connecting_vpn.mng -resize 64x64 hi64-action-nm_stage03_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage01_connecting.mng -resize 16x16 hi16-action-nm_stage01_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting.mng -resize 16x16 hi16-action-nm_stage02_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting_vpn.mng -resize 16x16 hi16-action-nm_stage02_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting.mng -resize 16x16 hi16-action-nm_stage03_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting_vpn.mng -resize 16x16 hi16-action-nm_stage03_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage01_connecting.mng -resize 32x32 hi32-action-nm_stage01_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting.mng -resize 32x32 hi32-action-nm_stage02_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting_vpn.mng -resize 32x32 hi32-action-nm_stage02_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting.mng -resize 32x32 hi32-action-nm_stage03_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting_vpn.mng -resize 32x32 hi32-action-nm_stage03_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage01_connecting.mng -resize 48x48 hi48-action-nm_stage01_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting.mng -resize 48x48 hi48-action-nm_stage02_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting_vpn.mng -resize 48x48 hi48-action-nm_stage02_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting.mng -resize 48x48 hi48-action-nm_stage03_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting_vpn.mng -resize 48x48 hi48-action-nm_stage03_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage01_connecting.mng -resize 64x64 hi64-action-nm_stage01_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting.mng -resize 64x64 hi64-action-nm_stage02_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage02_connecting_vpn.mng -resize 64x64 hi64-action-nm_stage02_connecting_vpn.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting.mng -resize 64x64 hi64-action-nm_stage03_connecting.mng +convert -dispose Previous -delay 10 hi22-action-nm_stage03_connecting_vpn.mng -resize 64x64 hi64-action-nm_stage03_connecting_vpn.mng diff --git a/tdenetworkmanager/src/CMakeLists.txt b/tdenetworkmanager/src/CMakeLists.txt index ac862e2..3d82ad4 100644 --- a/tdenetworkmanager/src/CMakeLists.txt +++ b/tdenetworkmanager/src/CMakeLists.txt @@ -51,7 +51,7 @@ tde_add_tdeinit_executable( tdenetworkmanager AUTOMOC connection_editor.ui vpnauthentication.ui main.cpp tdenetman.cpp tdenetman-tray.cpp #tdenetman-vpn_plugin.cpp - tdenetman-cellular_device_tray.cpp tdenetman-device_tray.cpp + tdenetman-cellular_device_tray.cpp #tdenetman-device_tray.cpp tdenetman-wired_device_tray.cpp tdenetman-wireless_device_tray.cpp tdenetman-wireless_menuitem.cpp tdenetman-menuitem.cpp tdenetman-menu_subhead.cpp diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h index 8f5a857..1c2e6ef 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_security_widget.h @@ -25,7 +25,10 @@ #ifndef KNETWORKMANAGER_CONNECTION_SETTING_WIRELESS_SECURITY_WIDGET_H #define KNETWORKMANAGER_CONNECTION_SETTING_WIRELESS_SECURITY_WIDGET_H -/* ui autogenerated headers */ +// tqt headers +#include + +// ui autogenerated headers #include "connection_setting_wireless_security.h" #include "connection_setting_wireless_security_eap.h" #include "connection_setting_wireless_security_phase2.h" diff --git a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp index 80f4f5b..536b4ef 100644 --- a/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp +++ b/tdenetworkmanager/src/configwidgets/tdenetman-connection_setting_wireless_widget.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include diff --git a/tdenetworkmanager/src/devicetraycomponent.cpp b/tdenetworkmanager/src/devicetraycomponent.cpp index ede0e9f..5c4cdb4 100644 --- a/tdenetworkmanager/src/devicetraycomponent.cpp +++ b/tdenetworkmanager/src/devicetraycomponent.cpp @@ -64,7 +64,7 @@ TQString DeviceTrayComponent::tooltipForConnState(TDENetworkConnectionStatus::TD } DeviceTrayComponent::DeviceTrayComponent(TQString device, KSystemTray * parent, const char * name ) - : TrayComponent(parent, name), m_device(device) + : TrayComponent(parent, name), m_tray(dynamic_cast(parent)), m_device(device) { TDEHardwareDevices* hwdevices = KGlobal::hardwareDevices(); @@ -154,7 +154,12 @@ TQMovie DeviceTrayComponent::movieForState(TDENetworkConnectionStatus::TDENetwor if (movieForConnState(state) != "") { TQString moviePath = movieForConnState(state); if (moviePath != "") { - return TQMovie(KGlobal::iconLoader()->moviePath(moviePath, KIcon::Panel)); + if (m_tray) { + return TQMovie(KGlobal::iconLoader()->moviePath(moviePath, KIcon::Panel, m_tray->width())); + } + else { + return TQMovie(KGlobal::iconLoader()->moviePath(moviePath, KIcon::Panel)); + } } else { return TQMovie(); diff --git a/tdenetworkmanager/src/devicetraycomponent.h b/tdenetworkmanager/src/devicetraycomponent.h index 316790c..3ee4a13 100644 --- a/tdenetworkmanager/src/devicetraycomponent.h +++ b/tdenetworkmanager/src/devicetraycomponent.h @@ -29,6 +29,7 @@ along with this program. If not, see . #include #include +#include "tdenetman-tray.h" #include "traycomponent.h" class TDENetworkDevice; @@ -68,6 +69,9 @@ class DeviceTrayComponent : public TrayComponent TQString movieForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state); TQString tooltipForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state); + protected: + Tray* m_tray; + private: TQString m_device; TQMap m_movies; diff --git a/tdenetworkmanager/src/tdenetman-device_tray.cpp b/tdenetworkmanager/src/tdenetman-device_tray.cpp deleted file mode 100644 index 6b2d3aa..0000000 --- a/tdenetworkmanager/src/tdenetman-device_tray.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/*************************************************************************** - * - * tdenetman-device_tray.cpp - A NetworkManager frontend for TDE - * - * Copyright (C) 2005, 2006 Novell, Inc. - * - * Author: Helmut Schaa , - * - * This program 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 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - **************************************************************************/ - -class WirelessDialog; - -// TQt includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// TDE includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// TDENM includes -#include "tdenetman-device_tray.h" -#include "tdenetman-menu_subhead.h" -#include "tdenetman-connection_settings_dialog.h" - -using namespace ConnectionSettings; - -class DeviceTrayPrivate -{ - public: - - DeviceTrayPrivate() - : dev(NULL) - { - tooltips[TDENetworkConnectionStatus::Invalid] = i18n("Unknown"); - tooltips[TDENetworkConnectionStatus::LinkUnavailable] = i18n("Down"); - tooltips[TDENetworkConnectionStatus::UnManaged] = i18n("Unmanaged"); - tooltips[TDENetworkConnectionStatus::Disconnected] = i18n("Disconnected"); - tooltips[TDENetworkConnectionStatus::EstablishingLink] = i18n("Preparing"); - tooltips[TDENetworkConnectionStatus::ConfiguringProtocols] = i18n("Configuration"); - tooltips[TDENetworkConnectionStatus::NeedAuthorization] = i18n("Awaiting authentication"); - tooltips[TDENetworkConnectionStatus::VerifyingProtocols] = i18n("IP configuration"); - tooltips[TDENetworkConnectionStatus::Connected] = i18n("Activated"); - tooltips[TDENetworkConnectionStatus::Failed] = i18n("Failed"); - } - - ~DeviceTrayPrivate() {} - - TDENetworkDevice* dev; - TQMap movies; - TQMap pixmaps; - TQMap tooltips; - - TQPixmap pixmapForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state); - TQMovie movieForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state); - TQString tooltipForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state); -}; - -TQPixmap DeviceTrayPrivate::pixmapForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) { - TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000; - while (flag != 0) { - if (state & flag) { - if (pixmaps.contains(flag)) { - return pixmaps[flag]; - } - } - flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)((TQ_UINT32)flag >> 1); - } - return TQPixmap(); -} - -TQMovie DeviceTrayPrivate::movieForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) { - TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000; - while (flag != 0) { - if (state & flag) { - if (movies.contains(flag)) { - return movies[flag]; - } - } - flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)((TQ_UINT32)flag >> 1); - } - return TQMovie(); -} - -TQString DeviceTrayPrivate::tooltipForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) { - TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)0x80000000; - while (flag != 0) { - if (state & flag) { - if (tooltips.contains(flag)) { - return tooltips[flag]; - } - } - flag = (TDENetworkConnectionStatus::TDENetworkConnectionStatus)((TQ_UINT32)flag >> 1); - } - return TQString::null; -} - -TDENetworkDevice* DeviceTray::getDevice() const -{ - return d->dev; -} - -TQString DeviceTray::getTooltipText() -{ - - TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager(); - TDENetworkConnectionStatus::TDENetworkConnectionStatus state = deviceConnMan->deviceInformation().statusFlags; - TQString tooltip = TQString(); - - if (!d->tooltipForConnState(state).isEmpty()) { - tooltip += i18n("State: %1").arg(d->tooltipForConnState(state)); - } - - return tooltip; -} - -void DeviceTray::enterEvent (TQEvent* /*e*/) -{ - // show tooltip - TQToolTip::remove (this); - TQString tooltip = getTooltipText(); - - if (!tooltip.isEmpty()) { - TQToolTip::add (this, tooltip); - } -} - - -void DeviceTray::setPixmap(const TQPixmap& pixmap) -{ - /* - int oldPixmapWidth = pixmap.size().width(); - int oldPixmapHeight = pixmap.size().height(); - - // we want to show the interface name - TQString iface = d->dev->getInterface(); - - // grab a font - TQFont iface_font = KGlobalSettings::generalFont(); -// iface_font.setBold(true); - - // resize the font to fit the icon's size - float fontSize = iface_font.pointSizeFloat(); - TQFontMetrics qfm(iface_font); - int height = qfm.height(); - int width = qfm.width(iface); - float factor = 1.0f; - float factor2 = 1.0f; - - if (height > (oldPixmapHeight / 2.0f)) - factor = float(oldPixmapHeight / 2.0f) / float(height); - - if (width > (oldPixmapWidth / 1.1f)) - factor2 = float(oldPixmapWidth / 1.1f) / float(width); - - fontSize *= (factor2 < factor) ? factor2 : factor; - - iface_font.setPointSizeFloat( fontSize); - - // draw the text to a bitmap and put is as an overlay on top of the pixmap - TQPixmap iface_pixmap(oldPixmapWidth, oldPixmapHeight); - iface_pixmap.fill(TQt::white); - TQPainter p(&iface_pixmap); - p.setFont(iface_font); - p.setPen(TQt::blue); - p.drawText(iface_pixmap.rect(), TQt::AlignHCenter | TQt::AlignBottom, iface); - iface_pixmap.setMask(iface_pixmap.createHeuristicMask()); - TQImage iface_image = iface_pixmap.convertToImage(); - - TQImage pixmap_with_overlay = pixmap.convertToImage(); - KIconEffect::overlay(pixmap_with_overlay, iface_image); - - TQPixmap new_pixmap; - new_pixmap.convertFromImage(pixmap_with_overlay); - // call base-class setPixmap - KSystemTray::setPixmap(new_pixmap); -*/ - KSystemTray::setPixmap(pixmap); -} - -void DeviceTray::contextMenuAboutToShow (KPopupMenu* menu) -{ - menu->clear(); - - // insert title - menu->insertTitle (SmallIcon ("tdenetworkmanager", TQIconSet::Automatic), "TDENetworkManager", -1, -1); - - // let the specific device_tray add its items - addMenuItems(menu); - - // quit - menu->insertSeparator (); - KAction* quitAction = actionCollection ()->action (KStdAction::name (KStdAction::Quit)); - if (quitAction) { - quitAction->plug (menu); - } -} - -void DeviceTray::resizeEvent ( TQResizeEvent * ) -{ - // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes - loadIcons(); - updateTrayIcon(m_currentIconState); -} - -void DeviceTray::setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state, TQMovie movie) -{ - d->movies[state] = movie; - slotUpdateDeviceState(); -} - -void DeviceTray::setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state, TQPixmap pixmap) -{ - d->pixmaps[state] = pixmap; - slotUpdateDeviceState(); -} - -void DeviceTray::updateTrayIcon(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) -{ - // stop the old movie to avoid unnecessary wakups - if (movie()) { - movie()->pause(); - } - - if (!d->movieForConnState(state).isNull()) { - if (m_currentIconState != state) { - // Clear the icon pixmap as the movie may be a different size - TQPixmap nullPixmap; - setPixmap(nullPixmap); - } - - // animation desired - int frame = -1; - if (movie()) { - frame = movie()->frameNumber(); - } - - // set the movie - setMovie(d->movieForConnState(state)); - - // start at the same frame as the movie before - if (frame > 0) - movie()->step(frame); - - // start the animation - movie()->unpause(); - } - else if (!d->pixmapForConnState(state).isNull()) { - setPixmap(d->pixmapForConnState(state)); - } - else { - setPixmap(loadSizedIcon("TDENetworkManager", width())); - } - - m_currentIconState = state; -} - -void DeviceTray::updateActions(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) -{ - // allow device deactivation only when device is activated - KAction* deactivate = actionCollection()->action("deactivate_device"); - if (deactivate) - deactivate->setEnabled( (state & TDENetworkConnectionStatus::Connected || - state & TDENetworkConnectionStatus::VerifyingProtocols || - state & TDENetworkConnectionStatus::EstablishingLink || - state & TDENetworkConnectionStatus::ConfiguringProtocols || - state & TDENetworkConnectionStatus::NeedAuthorization) ); -} - -void DeviceTray::updateActiveConnection(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) -{ - if (!(state & TDENetworkConnectionStatus::Connected)) { - return; - } -} - -void DeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) -{ - updateTrayIcon(state); - updateActions(state); - updateActiveConnection(state); -} - -void DeviceTray::slotUpdateDeviceState() -{ - TDENetworkConnectionManager* deviceConnMan = d->dev->connectionManager(); - slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags); -} - -void DeviceTray::loadIcons() { - d->pixmaps[TDENetworkConnectionStatus::Invalid] = loadSizedIcon("nm_no_connection", width()); - d->pixmaps[TDENetworkConnectionStatus::UnManaged] = loadSizedIcon("nm_no_connection", width()); - d->pixmaps[TDENetworkConnectionStatus::LinkUnavailable] = loadSizedIcon("nm_no_connection", width()); - d->pixmaps[TDENetworkConnectionStatus::Disconnected] = loadSizedIcon("nm_no_connection", width()); - - d->movies[TDENetworkConnectionStatus::EstablishingLink] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage01_connecting", KIcon::Panel)); - d->movies[TDENetworkConnectionStatus::EstablishingLink].pause(); - - d->movies[TDENetworkConnectionStatus::ConfiguringProtocols] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage02_connecting", KIcon::Panel)); - d->movies[TDENetworkConnectionStatus::ConfiguringProtocols].pause(); - - d->movies[TDENetworkConnectionStatus::VerifyingProtocols] = TQMovie( KGlobal::iconLoader()->moviePath("nm_stage03_connecting", KIcon::Panel)); - d->movies[TDENetworkConnectionStatus::VerifyingProtocols].pause(); - - d->movies[TDENetworkConnectionStatus::NeedAuthorization] = d->movies[TDENetworkConnectionStatus::ConfiguringProtocols]; - d->movies[TDENetworkConnectionStatus::NeedAuthorization].pause(); - - d->pixmaps[TDENetworkConnectionStatus::Connected] = loadSizedIcon("ok", width()); - - d->pixmaps[TDENetworkConnectionStatus::Failed] = loadSizedIcon("nm_no_connection", width()); -} - -DeviceTray::DeviceTray (TDENetworkDevice* dev) : KSystemTray () -{ - d = new DeviceTrayPrivate(); - d->dev = dev; - - m_currentIconState = TDENetworkConnectionStatus::Invalid; - loadIcons(); - - // get notified when the device state changes - connect(dev, TQT_SIGNAL(StateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus))); - - setMouseTracking (true); - - // defer the initial call to slotUpdateDeviceState as it will crash tdenm when called directly from here - // virtual method calls are not allowed in constructor - TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateDeviceState())); - - // Actions used for plugging into the menu - new KAction (i18n ("Deactivate connection..."), - SmallIcon ("no", TQIconSet::Automatic), 0, - dev, TQT_SLOT (slotDeactivate()), actionCollection (), "deactivate_device"); -} - -DeviceTray::~DeviceTray () -{ - delete d; -} - - -#include "tdenetman-device_tray.moc" diff --git a/tdenetworkmanager/src/tdenetman-device_tray.h b/tdenetworkmanager/src/tdenetman-device_tray.h deleted file mode 100644 index 809174b..0000000 --- a/tdenetworkmanager/src/tdenetman-device_tray.h +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * - * tdenetman-device_tray.h - A NetworkManager frontend for TDE - * - * Copyright (C) 2005, 2006 Novell, Inc. - * - * Author: Helmut Schaa , - * - * This program 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 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - **************************************************************************/ - -#ifndef KNETWORKMANAGER_DEVICE_TRAY_H -#define KNETWORKMANAGER_DEVICE_TRAY_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "tdenetman.h" - -class DeviceTrayPrivate; - -class DeviceTray : public KSystemTray -{ - Q_OBJECT - - - public: - DeviceTray (TDENetworkDevice*); - ~DeviceTray (); - - void contextMenuAboutToShow (KPopupMenu* menu); - virtual void addMenuItems(KPopupMenu* menu) = 0; - TDENetworkDevice* getDevice() const; - - protected: - void setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQMovie); - void setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQPixmap); - void resizeEvent ( TQResizeEvent * ); - - virtual TQString getTooltipText(); - - public slots: - void setPixmap(const TQPixmap &); - void slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus); - void slotUpdateDeviceState(); - - private: - void updateTrayIcon(TDENetworkConnectionStatus::TDENetworkConnectionStatus); - void updateActions(TDENetworkConnectionStatus::TDENetworkConnectionStatus); - void updateActiveConnection(TDENetworkConnectionStatus::TDENetworkConnectionStatus); - void enterEvent (TQEvent*); - void loadIcons(); - - DeviceTrayPrivate* d; - TDENetworkConnectionStatus::TDENetworkConnectionStatus m_currentIconState; -}; - -#endif /* KNETWORKMANAGER_DEVICE_TRAY_H */ diff --git a/tdenetworkmanager/src/tdenetman-wireless_manager.h b/tdenetworkmanager/src/tdenetman-wireless_manager.h index 3eacd6c..8baf68e 100644 --- a/tdenetworkmanager/src/tdenetman-wireless_manager.h +++ b/tdenetworkmanager/src/tdenetman-wireless_manager.h @@ -31,7 +31,6 @@ // TDENM includes #include "tdenetman.h" -#include "tdenetman-device_tray.h" #include "tdenetman-wireless_network.h" namespace ConnectionSettings