#include <qapplication.h> #include <qimage.h> #include <qlabel.h> #include <qlineedit.h> #include <qmainwindow.h> #include <qmessagebox.h> #include <qpainter.h> #include <qscrollview.h> #include <qslider.h> #include <qsplitter.h> #include <qtoolbutton.h> #include "SquidPortrait.h" #include "SquidStaticPane.h" #include "SquidDynamicPane.h" #include "SquidDiffBlocker.h" #define SQUIDMAINWINDOW_H #include "SquidMainWindow.h" int main ( int argc, char** argv ) { QApplication myapp( argc, argv ); argc--; argv++; QImage* file1 = NULL; QImage* file2 = NULL; bool l = false; bool r = false; QString arg, right, left; while ( argc ) { arg = QString( *argv ); argc--; argv++; if ( arg == "-l" && argc && !l && !r ) { l = true; } else if ( arg == "-r" && argc && !l && !r ) { r = true; } else if ( l ) { left = arg; l = false; } else if ( r ) { right = arg; r = false; } else if ( !file1 ) { file1 = new QImage( arg ); if ( left.isEmpty() ) left = arg; } else if ( !file2 ) { file2 = new QImage( arg ); if ( right.isEmpty() ) right = arg; } else { QMessageBox::critical ( NULL, "SQUID Error", "Usage: squid [-l lname] [-r rname] file1 file2", QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); return 1; } } if ( !file1 || !file2 ) { QMessageBox::critical ( NULL, "SQUID Error", "Usage: squid [-l lname] [-r rname] file1 file2", QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); return 1; } if ( file1->isNull() || file2->isNull() ) { QMessageBox::critical ( NULL, "SQUID Error", "Couldn't load images! (Unsupported format or nonexistent files?)", QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); return 1; } SquidMainWindow* sw = new SquidMainWindow ( file1, file2, left, right ); myapp.setMainWidget( sw ); return myapp.exec(); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 2403 | Sam Stafford | Support "-l" and "-r" flags. | ||
#1 | 2401 | Sam Stafford |
Rename SID to SQUID - avoids conflicts with another program. Also lets me use cool squid icon. |
||
//guest/sam_stafford/sid/src/main.cpp | |||||
#6 | 2040 | Sam Stafford | Mammoth static build of sid and a README. | ||
#5 | 2038 | Sam Stafford |
Fix crashing resulting from invalid image files, and set a good caption on the main window. |
||
#4 | 2036 | Sam Stafford |
Uber-L33T "highlight" feature. Has to be seen to be believed. |
||
#3 | 2033 | Sam Stafford | Add a toolbar that allows you to turn panes on and off at will. | ||
#2 | 2030 | Sam Stafford |
Scrolling. It's not perfect, but I'm happy enough with it to move on with my life. |
||
#1 | 2016 | Sam Stafford |
Barely-functional Sid (about three hours worth of code). "Sid" = "Sam's Image Differ", for those who were curious. |