76 m_objList = new ObjectList; |
77 m_objList = new ObjectList; |
77 m_objList->setSelectionMode (QListWidget::ExtendedSelection); |
78 m_objList->setSelectionMode (QListWidget::ExtendedSelection); |
78 m_objList->setAlternatingRowColors (true); |
79 m_objList->setAlternatingRowColors (true); |
79 connect (m_objList, SIGNAL (itemSelectionChanged ()), this, SLOT (slot_selectionChanged ())); |
80 connect (m_objList, SIGNAL (itemSelectionChanged ()), this, SLOT (slot_selectionChanged ())); |
80 connect (m_objList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*))); |
81 connect (m_objList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*))); |
|
82 |
|
83 m_msglog = new MessageManager; |
|
84 m_msglog->setRenderer( R() ); |
|
85 m_renderer->setMessageLog( m_msglog ); |
81 |
86 |
82 m_splitter = new QSplitter; |
87 m_splitter = new QSplitter; |
83 m_splitter->addWidget (m_renderer); |
88 m_splitter->addWidget (m_renderer); |
84 m_splitter->addWidget (m_objList); |
89 m_splitter->addWidget (m_objList); |
85 setCentralWidget (m_splitter); |
90 setCentralWidget (m_splitter); |
1064 if( dlg.clickedButton () == saveAsBtn ) |
1071 if( dlg.clickedButton () == saveAsBtn ) |
1065 save (f, true); // yay recursion! |
1072 save (f, true); // yay recursion! |
1066 } |
1073 } |
1067 } |
1074 } |
1068 |
1075 |
|
1076 void ForgeWindow::addMessage( str msg ) |
|
1077 { |
|
1078 m_msglog->addLine( msg ); |
|
1079 } |
|
1080 |
1069 // ============================================================================ |
1081 // ============================================================================ |
1070 void ObjectList::contextMenuEvent (QContextMenuEvent* ev) { |
1082 void ObjectList::contextMenuEvent (QContextMenuEvent* ev) { |
1071 g_win->spawnContextMenu (ev->globalPos ()); |
1083 g_win->spawnContextMenu (ev->globalPos ()); |
1072 } |
1084 } |
1073 |
1085 |
1090 |
1102 |
1091 // ============================================================================= |
1103 // ============================================================================= |
1092 void critical (str msg) { |
1104 void critical (str msg) { |
1093 QMessageBox::critical (g_win, QObject::tr( "Error" ), msg, |
1105 QMessageBox::critical (g_win, QObject::tr( "Error" ), msg, |
1094 (QMessageBox::Close), QMessageBox::Close); |
1106 (QMessageBox::Close), QMessageBox::Close); |
1095 } |
|
1096 |
|
1097 // ============================================================================= |
|
1098 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
|
1099 // ============================================================================= |
|
1100 // Print to message log |
|
1101 // TODO: I don't think that the message log being a widget in the window |
|
1102 // is a very good idea... maybe this should log into the renderer? Or into |
|
1103 // another dialog that can be popped up? |
|
1104 void ForgeWindow::logVA (LogType type, const char* fmtstr, va_list va) { |
|
1105 (void) type; |
|
1106 (void) fmtstr; |
|
1107 (void) va; |
|
1108 } |
1107 } |
1109 |
1108 |
1110 // ============================================================================= |
1109 // ============================================================================= |
1111 QAction* findAction (str name) { |
1110 QAction* findAction (str name) { |
1112 for (actionmeta& meta : g_actionMeta) { |
1111 for (actionmeta& meta : g_actionMeta) { |