main_windows.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Daniel Rocher                                   *
00003  *   daniel.rocher@adella.org                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 
00022 #ifndef MAIN_WINDOWS_H
00023 #define MAIN_WINDOWS_H
00024 
00025 #include <QMainWindow>
00026 #include <QApplication>
00027 #include <QSystemTrayIcon>
00028 
00029 #include "ui_form_smbstatus.h"
00030 
00031 #include "clientsocket.h"
00032 #include "login_windows.h"
00033 #include "configure_windows.h"
00034 #include "log.h"
00035 
00036 extern void debugQt(const QString & message);
00037 
00038 extern bool autoconnect;
00039 extern QString version_qtsmbstatus;
00040 extern QString date_qtsmbstatus;
00041 extern QString mail_qtsmbstatus;
00042 extern QString auteur_qtsmbstatus;
00043 extern QString web_qtsmbstatus;
00044 extern bool debug_qtsmbstatus;
00045 
00046 class MyApplication : public QApplication
00047 {
00048         Q_OBJECT
00049 public:
00050         MyApplication (int & argc, char ** argv );
00051         virtual void commitData(QSessionManager& manager);
00052 signals:
00053         void quitMyApp();
00054 };
00055 
00056 class main_windows : public QMainWindow, public Ui::form_smbstatus  {
00057    Q_OBJECT
00058 public:
00059         main_windows(QWidget *parent=0);
00060         virtual ~main_windows();
00061 public slots:
00062         void beforeQuit();
00063 signals:
00064         void refreshviewlog(const type_message &);
00065 private slots: // Private slots
00066         virtual void helpAbout();
00067         virtual void helpAboutQt();
00068         virtual void ConfigureSlot();
00069         virtual void MachineSearchSlot();
00070         virtual void UserSearchSlot();
00071         virtual void ShareSearchSlot();
00072         virtual void FileSearchSlot();
00073         virtual void AllSearchSlot();
00074         virtual void NextSlot();
00075         virtual void Slot_connect();
00076         virtual void socketconnected();
00077         virtual void socketclosed();
00078         virtual void SignalErrorAuth();
00079         void on_action_View_log_triggered ();
00080         void trayicon_activated(QSystemTrayIcon::ActivationReason reason);
00081         void restore_minimize();
00082         void configuration_changed();
00084         void InfoSMB();
00085 private: // Private attributes
00086         bool connected;
00087         ClientSocket * clientsocket;
00088         Q3ListViewItem * FindItem;
00090         enum T_Item{T_All,T_Machine,T_User,T_Share,T_File};
00092         enum T_Direction {to_first,to_preview,to_next};
00093         QString currentSearchStr;
00094         T_Item currentSearchItem;
00095         QAction * configure_action;
00096         QAction * restore_action;
00097         QAction * connect_action;
00098         QAction * viewlog_action;
00099         QSystemTrayIcon * trayicon;
00100         bool firstTime;
00101         LogForm * logform;
00102 protected:
00103         virtual void closeEvent(QCloseEvent *e);
00104 private: // Private methods
00105         void writeHistoryFile();
00106         void readHistoryFile();
00107         void comboBox_valid();
00108         void open_dialog_for_login();
00109         void search(T_Item typeOfSearch,const QString & str,T_Direction direction=to_first);
00110         void selectItem(Q3ListViewItem *item);
00111         QString getSearchStr(const QString & msg);
00112         Q3ListViewItem * nextItem(Q3ListViewItem * item);
00113         void restoreWindowSize();
00114         void saveWindowSize();
00115 
00116 };
00117 
00118 #endif

Generated on Fri Nov 2 21:44:58 2007 for qtsmbstatus.kdevelop by  doxygen 1.5.3