Thu, 01 Aug 2013 03:26:47 +0300
cleanup
src/configDialog.cpp | file | annotate | diff | comparison | revisions | |
src/gldraw.cpp | file | annotate | diff | comparison | revisions | |
src/gui.cpp | file | annotate | diff | comparison | revisions | |
src/history.cpp | file | annotate | diff | comparison | revisions |
--- a/src/configDialog.cpp Thu Aug 01 02:49:42 2013 +0300 +++ b/src/configDialog.cpp Thu Aug 01 03:26:47 2013 +0300 @@ -49,12 +49,6 @@ #define act(N) extern_cfg (keyseq, key_##N); #include "actions.h" -#define INIT_CHECKBOX(BOX, CFG) \ - BOX->setCheckState (CFG ? Qt::Checked : Qt::Unchecked); - -#define APPLY_CHECKBOX(BTN, CFG) \ - CFG = BTN->checkState() == Qt::Checked; - // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= @@ -62,33 +56,32 @@ ui = new Ui_ConfigUI; ui->setupUi( this ); - initMainTab (); - initShortcutsTab (); - initQuickColorTab (); - initGridTab (); - initExtProgTab (); + initMainTab(); + initShortcutsTab(); + initQuickColorTab(); + initGridTab(); + initExtProgTab(); } // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -ConfigDialog::~ConfigDialog() -{ +ConfigDialog::~ConfigDialog() { delete ui; } // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -void ConfigDialog::initMainTab () { +void ConfigDialog::initMainTab() { // Init color stuff setButtonBackground (ui->backgroundColorButton, gl_bgcolor); - connect (ui->backgroundColorButton, SIGNAL (clicked ()), - this, SLOT (slot_setGLBackground ())); + connect (ui->backgroundColorButton, SIGNAL (clicked()), + this, SLOT (slot_setGLBackground())); setButtonBackground (ui->mainColorButton, gl_maincolor.value); - connect (ui->mainColorButton, SIGNAL (clicked ()), - this, SLOT (slot_setGLForeground ())); + connect (ui->mainColorButton, SIGNAL (clicked()), + this, SLOT (slot_setGLForeground())); ui->mainColorAlpha->setValue( gl_maincolor_alpha * 10.0f ); @@ -105,7 +98,7 @@ // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -void ConfigDialog::initShortcutsTab () { +void ConfigDialog::initShortcutsTab() { ulong i = 0; #define act(N) addShortcut (key_##N, ACTION(N), i);
--- a/src/gldraw.cpp Thu Aug 01 02:49:42 2013 +0300 +++ b/src/gldraw.cpp Thu Aug 01 03:26:47 2013 +0300 @@ -92,24 +92,27 @@ // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -GLRenderer::GLRenderer (QWidget* parent) : QGLWidget (parent) { - m_picking = m_rangepick = false; - m_camera = (GL::Camera) gl_camera.value; - m_drawToolTip = false; - m_editMode = Select; - m_rectdraw = false; - m_panning = false; - setFile (null); +GLRenderer::GLRenderer (QWidget* parent) : + QGLWidget (parent), + m_picking( false ), + m_rangepick( false ), + m_camera( (GL::Camera) gl_camera.value ), + m_drawToolTip( false ), + m_editMode( Select ), + m_rectdraw( false ), + m_panning( false ), + m_file( null ), + m_toolTipTimer( new QTimer( this )), + m_thickBorderPen( QPen( QColor( 0, 0, 0, 208 ), 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin )), + m_thinBorderPen( m_thickBorderPen ), + m_msglog( null ) +{ setDrawOnly (false); resetAngles(); - setMessageLog( null ); - m_toolTipTimer = new QTimer (this); m_toolTipTimer->setSingleShot (true); connect (m_toolTipTimer, SIGNAL (timeout()), this, SLOT (slot_toolTipTimer())); - m_thickBorderPen = QPen (QColor (0, 0, 0, 208), 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); - m_thinBorderPen = m_thickBorderPen; m_thinBorderPen.setWidth (1); // Init camera icons
--- a/src/gui.cpp Thu Aug 01 02:49:42 2013 +0300 +++ b/src/gui.cpp Thu Aug 01 03:26:47 2013 +0300 @@ -71,11 +71,15 @@ // ============================================================================= // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ============================================================================= -ForgeWindow::ForgeWindow() { +ForgeWindow::ForgeWindow() : + m_renderer( new GLRenderer ), + ui( new Ui_LDForgeUI ), + m_primLoaderBar( new QProgressBar ), + m_primLoaderWidget( new QWidget ), + m_msglog( new MessageManager ), + m_quickColors( quickColorsFromConfig() ) +{ g_win = this; - m_renderer = new GLRenderer; - - ui = new Ui_LDForgeUI; ui->setupUi (this); // Stuff the renderer into its frame @@ -86,17 +90,13 @@ connect (ui->objectList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*))); connect (ui->fileList, SIGNAL (currentItemChanged (QListWidgetItem*, QListWidgetItem*)), this, SLOT (changeCurrentFile())); - // Init message log manager - m_msglog = new MessageManager; + // Init message log manager= m_msglog->setRenderer (R()); - m_renderer->setMessageLog (m_msglog); - m_quickColors = quickColorsFromConfig(); + m_renderer->setMessageLog (m_msglog);= slot_selectionChanged(); setStatusBar (new QStatusBar); // Init primitive loader task stuff - m_primLoaderBar = new QProgressBar; - m_primLoaderWidget = new QWidget; QHBoxLayout* primLoaderLayout = new QHBoxLayout (m_primLoaderWidget); primLoaderLayout->addWidget (new QLabel ("Loading primitives:")); primLoaderLayout->addWidget (m_primLoaderBar);
--- a/src/history.cpp Thu Aug 01 02:49:42 2013 +0300 +++ b/src/history.cpp Thu Aug 01 03:26:47 2013 +0300 @@ -25,10 +25,9 @@ bool g_fullRefresh = false; -History::History() { - setOpened (false); - setPos (-1); -} +History::History() : + m_opened( false ), + m_pos( -1 ) {} void History::undo() { if (m_changesets.size() == 0 || pos() == -1)