diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-10-26 04:07:01 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-10-27 13:36:02 +0200 |
commit | 42673b0179d00e2b5a05fb48438577b923f00b8b (patch) | |
tree | c42ef21f0799c5e73ae1ccb6ed439d690ec9e59c /src/knetstats.h | |
parent | 0e396d6b00651d811959f8d4c7ccad9ff868a1a1 (diff) | |
download | knetstats-42673b0179d00e2b5a05fb48438577b923f00b8b.tar.gz knetstats-42673b0179d00e2b5a05fb48438577b923f00b8b.zip |
Fix structure of directories
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 06772a369f2beef80bb291ded30cbe125a24af56)
Diffstat (limited to 'src/knetstats.h')
-rw-r--r-- | src/knetstats.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/knetstats.h b/src/knetstats.h new file mode 100644 index 0000000..e5042da --- /dev/null +++ b/src/knetstats.h @@ -0,0 +1,94 @@ +/*************************************************************************** + * Copyright (C) 2004 by Hugo Parente Lima * + * hugo_pl@users.sourceforge.net * + * * + * 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef KNETSTATS_H +#define KNETSTATS_H + +#include <tqwidget.h> +#include <set> +#include <tqstring.h> +#include "configure.h" + +class KNetStatsView; +class TDEConfig; +class TDEPopupMenu; +class TDEActionCollection; + +class Interface; + + +class KNetStats : public TQWidget +{ + Q_OBJECT + + + enum { + IF_DETECTION_INTERVAL = 5000 + }; + +public: + /// Constructor + KNetStats(); + ~KNetStats(); + + TDEPopupMenu* const contextMenu() const { return mContextMenu; } + /** + * \brief Search for network interfaces parsing /proc/net/dev + * \return A StringList with the network interface names + */ + static TQStringList scanInterfaces(); + int numInterfaces() const { return mInterfaces.size(); } + + +public slots: + /// Display configure the dialog box + bool configure(); + /// Configure dialog OK button + void configOk(); + /// Configure dialog Apply button + void configApply(); + /// Configure dialog Cancel button + void configCancel(); + + /// Diaplay the about box + void about(); + /** + * Search for new interfaces + * \param count_ptr Interface count, store the number of new <strong>visible</strong> interfaces found. + */ + void detectNewInterfaces(int* count_ptr = 0); +private: + TDEPopupMenu* mContextMenu; // help menu usado por todos os tray icons + Configure* mConfigure; + TDEActionCollection* mActionCollection; + bool mBoot; + InterfaceMap mInterfaces; + + + void readOptions(); + void saveConfig(const OptionsMap& options); + void clearOptions(OptionsMap* options); + void setupUi(); + // Creates a new interface, returns true or false if the new interface is visible or not. + bool createInterface(const TQString& interface); + +}; + +#endif |