Logo Search packages:      
Sourcecode: shutdown-qapps version File versions  Download package

gui.h

/* qshutdown, a program to shutdown the system
 * Copyright (C) 2009 2010  Christian Metscher <hakaishi@web.de>

 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */
#ifndef GUI_H
#define GUI_H

#include <QtGui>
#include "ui_gui.h"
#define SERVICE_NAME  "org.qshutdown"
#define OBJECT_NAME "/org/qshutdown"

#ifndef Q_OS_WIN32
  #include <QtDBus>
#endif

class Gui : public QWidget, public Ui::Gui
{
     Q_OBJECT // important for creating own singals and slots
 
    public:
     Gui(QWidget *parent = 0);
     ~Gui();
     void saved();
     void center();
 
    private:
     QPushButton     *minim;
     QLCDNumber      *lcd;
     QTimer          *timer;
     QTimer          *ti;
     QDateTime       datetime;
     QTime           localTime;
     QTime           futureTime;
     QTime           elapsedTime;
     QIcon           icon;
     QSystemTrayIcon *TIcon;
     QMenu           *menu;
     QAction         *shutdown_action;
     QAction         *reboot_action;
     QAction         *suspend_action;
     QAction         *hibernate_action;
     QAction         *quit_action;
     QAction         *reset_action;
     QAction         *info_action;
     QAction         *log_action;
     QMessageBox     *infoBox;
     int             i; //number of seconds left
     int             n; //to check if i==0 was skipped
     QFont           *font1;
     QFont           *font2;
     QFont           *font3;
     bool            finishedExecuted;
     bool            lockAll;

     // defining signals and slots
 
     private slots:
      void iconActivated(QSystemTrayIcon::ActivationReason reason);
      void showW();
      void starter();
      void set();
      void update();
      void Time();
      void shutdown();
      void power_action1();
      void reboot();
      void power_action2();
      void suspend();
      void power_action3();
      void hibernate();
      void power_action4();
      void mini();
      void saveWindowSize();
      void reset();
      void info();
      void finished();
     public slots:
      void showRunningProgram();
     protected:
      virtual void closeEvent(QCloseEvent* window_close);
      virtual void resizeEvent(QResizeEvent* window_resize);
};

#endif

Generated by  Doxygen 1.6.0   Back to index