diff options
author | deva <deva> | 2005-07-28 11:23:25 +0000 |
---|---|---|
committer | deva <deva> | 2005-07-28 11:23:25 +0000 |
commit | df6bde85bfd7206fc9dca3e84f6bd8a23056d051 (patch) | |
tree | c7e91844b2af4486c1bfa72ac273e596e01e89d6 /src/mainwindow.cc | |
parent | 7e34d01db38e0af1bfdb5a20f2f20e8567bfa0b1 (diff) |
*** empty log message ***
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 163 |
1 files changed, 41 insertions, 122 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 6e9f77b..136f5c5 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -24,100 +24,6 @@ * along with MIaV; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ - -/* - * $Id$ - */ - -/* - * $Log$ - * Revision 1.44 2005/07/27 12:47:56 deva - * CVS: ---------------------------------------------------------------------- - * - * Revision 1.43 2005/07/27 12:40:47 deva - * *** empty log message *** - * - * Revision 1.42 2005/07/25 15:56:27 deva - * *** empty log message *** - * - * Revision 1.41 2005/07/25 15:35:41 deva - * *** empty log message *** - * - * Revision 1.40 2005/07/25 14:27:14 deva - * *** empty log message *** - * - * Revision 1.39 2005/07/25 12:42:13 deva - * *** empty log message *** - * - * Revision 1.38 2005/07/23 10:22:12 deva - * *** empty log message *** - * - * Revision 1.35 2005/07/22 19:20:28 deva - * *** empty log message *** - * - * Revision 1.34 2005/06/19 11:44:14 deva - * Cleaned up a log of logging. - * Fixed server queue (shouldn't happen). - * Added user and group lookup. - * - * Revision 1.33 2005/06/16 21:28:57 deva - * Rewrote thread object - * Fixed bug in mov_encoder (pushed read_sem too many times, whihc lead to - * growing server queue) - * - * Revision 1.32 2005/06/15 08:41:49 deva - * *** empty log message *** - * - * Revision 1.31 2005/06/15 08:34:28 deva - * *** empty log message *** - * - * Revision 1.30 2005/06/15 08:28:58 deva - * Added logging to mainwindow, removed newline in log entry from file - * - * Revision 1.29 2005/06/14 12:29:40 deva - * Incorporated the use of the Info object everywhere... also using the log functionality. - * - * Revision 1.28 2005/06/02 20:45:01 deva - * - * Added clear button - * Optimized the frame handling a little (very little!). - * - * Revision 1.27 2005/05/23 19:30:36 deva - * Made some cleanup in the status bar. - * - * Revision 1.26 2005/05/16 16:00:56 deva - * Lots of stuff! - * - * Revision 1.25 2005/05/03 09:22:12 deva - * Implemented the gui part of the info object. - * - * Revision 1.24 2005/05/03 08:31:59 deva - * Removed the error object, and replaced it with a more generic info object. - * - * Revision 1.23 2005/05/02 20:34:38 deva - * Some hacked borky ugly scumm code to check for errors! :( - * - * Revision 1.22 2005/05/02 19:56:17 deva - * cpr_clicked is now blocked, if a recording session on. A messagebox explains - * how to stop before trying to change the cpr number again. - * - * Revision 1.21 2005/05/02 18:47:21 deva - * Cpr now sent to decoder. And saved prioer to editing, in order to be able - * to disable editing session and revert to old cpr. - * - * Revision 1.19 2005/05/01 12:13:50 deva - * Removed bitmap readin. - * - * Revision 1.18 2005/05/01 12:04:15 deva - * Using qbitmap for raw pixel readin. - * - * Revision 1.17 2005/05/01 11:25:56 deva - * Added code to read screenshot from frame queue, decode it to rgb and put it into a qimage. - * - * Revision 1.16 2005/05/01 09:56:26 deva - * Added Id and Log tags to all files - */ - #include <config.h> #ifdef USE_GUI @@ -175,7 +81,7 @@ MainWindow::MainWindow(QApplication *qApp, QWidget* parent, const char* name ) img_cpr = loadButtonIcon( PIXMAP_CPR ); img_clear = loadButtonIcon( PIXMAP_CLEAR ); img_snapshot = loadButtonIcon( PIXMAP_SNAPSHOT ); - // img_logo = loadButtonIcon( PIXMAP_LOGO_SMALL ); + img_logo = loadButtonIcon( PIXMAP_LOGO_SMALL, 1 ); img_dummy = loadImage( PIXMAP_DUMMY ); @@ -218,7 +124,7 @@ MainWindow::~MainWindow() info->log("MIaV is shut down."); } -QImage *MainWindow::loadButtonIcon( char *name ) +QImage *MainWindow::loadButtonIcon( char *name, int height ) { QImage scaled; @@ -227,7 +133,7 @@ QImage *MainWindow::loadButtonIcon( char *name ) img = new QImage(); img->load( name ); - int h = (int)(BUTTON_HEIGHT * unit); + int h = (int)(height * unit); int w = (int)((float)img->width() / (float)(img->height() / (float)h)); scaled = img->smoothScale(w, h); @@ -372,6 +278,14 @@ void MainWindow::createGui() g0->margin() * 2); status->addWidget(lbl_recordtime, 0, TRUE); + // About button + btn_about = new QPushButton("", this); + btn_about->setFixedHeight((int)unit); + btn_about->setPixmap(*img_logo); + QObject::connect( btn_about, SIGNAL(clicked()), this, SLOT(about_clicked()) ); + status->addWidget(btn_about, 0, TRUE); + + // Version label lbl_version = createLabel("MIaV-Grab v" VERSION, BUTTON_WIDTH, 1); lbl_version->setFixedWidth((int)(BUTTON_WIDTH * unit) + (gb->insideMargin() * 2) + @@ -382,6 +296,32 @@ void MainWindow::createGui() status->message( TXT_READY ); } + +QPushButton *MainWindow::createButton(char *caption, int width, int height) +{ + return createButton(caption, this, width, height); +} + + +QPushButton *MainWindow::createButton(char *caption, QWidget *parent, int width, int height) +{ + QPushButton *btn = new QPushButton(caption, parent); + btn->setFont( QFont( "Sans Serif", (int)(unit * height / 2), QFont::Bold ) ); + btn->setFixedHeight((int)(unit * height)); + return btn; +} + + +QLabel *MainWindow::createLabel(char *caption, int width, int height) +{ + QLabel *lbl = new QLabel(caption, this); + lbl->setFont( QFont( "Sans Serif", + (height>1)?(int)(unit * height / 2):(int)(unit * height / 3), + (height>1)?QFont::Bold:QFont::Normal ) ); + lbl->setFixedHeight((int)(unit * height)); + return lbl; +} + #include <sys/time.h> static struct timeval starttime; static int h = 0; @@ -429,29 +369,6 @@ void MainWindow::redraw_edge() (int) (GREY - (GREY * val)))); } -QPushButton *MainWindow::createButton(char *caption, int width, int height) -{ - return createButton(caption, this, width, height); -} - -QPushButton *MainWindow::createButton(char *caption, QWidget *parent, int width, int height) -{ - QPushButton *btn = new QPushButton(caption, parent); - btn->setFont( QFont( "Sans Serif", (int)(unit * height / 2), QFont::Bold ) ); - btn->setFixedHeight((int)(unit * height)); - return btn; -} - -QLabel *MainWindow::createLabel(char *caption, int width, int height) -{ - QLabel *lbl = new QLabel(caption, this); - lbl->setFont( QFont( "Sans Serif", - (height>1)?(int)(unit * height / 2):(int)(unit * height / 3), - (height>1)?QFont::Bold:QFont::Normal ) ); - lbl->setFixedHeight((int)(unit * height)); - return lbl; -} - void MainWindow::message(char *msg) { status->message(msg); @@ -472,9 +389,11 @@ void MainWindow::clear() lbl_cpr->setText(""); } -void MainWindow::live_clicked() +#include "aboutwindow.h" +void MainWindow::about_clicked() { - info->info("live_clicked"); + AboutWindow about; + about.exec(); } void MainWindow::clear_clicked() |