00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ONMAINWINDOW_H
00021 #define ONMAINWINDOW_H
00022
00023
00024 #include <QMainWindow>
00025 #include <QList>
00026 #include <QPushButton>
00027 #include <QPixmap>
00028 #include "LDAPSession.h"
00029
00034 class QLineEdit;
00035 class QFrame;
00036 class QVBoxLayout;
00037 class QHBoxLayout;
00038 class QScrollArea;
00039 class UserButton;
00040 class SessionButton;
00041 class QLabel;
00042 class QProcess;
00043 class QFile;
00044 class SVGFrame;
00045 class SessionButton;
00046 class QAction;
00047
00048 struct user
00049 {
00050 int uin;
00051 QString uid;
00052 QString name;
00053 QPixmap foto;
00054 static bool lessThen (user u1,user u2){return u1.uid < u2.uid;}
00055 };
00056
00057
00058 struct serv
00059 {
00060 QString name;
00061 int sess;
00062 bool operator < (struct serv it){return (it.sess < sess);}
00063 };
00064
00065
00066 class ONMainWindow : public QMainWindow
00067 {
00068 Q_OBJECT
00069 public:
00070 ONMainWindow(QWidget *parent = 0);
00071 ~ONMainWindow();
00072 QString iconsPath(QString fname);
00073 const QList<SessionButton*> * getSessionsList(){return &sessions;}
00074
00075
00076 private:
00077 SVGFrame* fr;
00078 SVGFrame *bgFrame;
00079 QLineEdit* uname;
00080 QLineEdit* pass;
00081 QFrame* uframe;
00082 SVGFrame *passForm;
00083 QLabel* u;
00084 QLabel* fotoLabel;
00085 QLabel* nameLabel;
00086 QLabel* passPrompt;
00087 QPushButton* ok;
00088 QPushButton* cancel;
00089 QString resolution;
00090
00091 QString kdeIconsPath;
00092 QScrollArea* users;
00093 QVBoxLayout* userl;
00094 QHBoxLayout* mainL;
00095 QList<UserButton*> names;
00096 QList<SessionButton*> sessions;
00097 UserButton* lastUser;
00098 QString prevText;
00099 QString onserver;
00100 QString id;
00101 QString sndport;
00102 QString qpass;
00103 bool direct;
00104 QString sessionStatus;
00105 QString sessionRes;
00106 QHBoxLayout* username;
00107 QList <user> userList;
00108 QString nick;
00109 QString nfsPort;
00110 QString mntPort;
00111 QProcess* ssh;
00112 QProcess* soundServer;
00113 LDAPSession* ld;
00114 bool useLdap;
00115 bool showToolBar;
00116 QString ldapServer;
00117 int ldapPort;
00118 QString ldapDn;
00119 QString sessionCmd;
00120 QString netSound;
00121 QAction *act_edit;
00122 QAction *act_new;
00123 QString lastFreeServer;
00124 SVGFrame* ln;
00125 bool startSound;
00126 int firstUid;
00127 int lastUid;
00128 void loadSettings();
00129 void showPass(UserButton* user);
00130 void stopExport();
00131 void clean();
00132 void createTmpXconf(QString);
00133 void saveSettings();
00134 void nxrun(QString);
00135 void startDirect(QFile&);
00136 int numOfSessions(QString);
00137 SessionButton* createBut(const QString& id);
00138 void placeButtons();
00139 QString getFreeServer(QString server=QString());
00140 QString getKdeIconsPath();
00141 QString findTheme(QString theme);
00142 void findSession();
00143 bool initLdapSession();
00144
00145 protected:
00146 virtual void closeEvent(QCloseEvent* event);
00147
00148 private slots:
00149 void displayUsers();
00150 void slot_showWidgets();
00151 void slot_resize(const QSize sz);
00152
00153
00154
00155
00156 void slotUnameChanged(const QString& text);
00157
00158
00159
00160 void readUsers();
00161 void slotSelectedFromList(UserButton* user);
00162 void slotUnameEntered();
00163 void slotClosePass();
00164 void slot_readSessions();
00165 void slot_manage();
00166 void displayToolBar(bool);
00167
00168 public slots:
00169 void slot_config();
00170 void slotNewSession();
00171 void slotDeleteButton(SessionButton * bt);
00172 void slot_edit(SessionButton*);
00173 };
00174
00175 #endif