Changeset - 45f7246b22b1
[Not reviewed]
snapshots
0 3 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-30 03:47:39
hy@ozderya.net
added "Close" menu item to snapshot window

Note that if `delete view` is used, segfault occurs upon clicking "Close" menu
3 files changed with 32 insertions and 3 deletions:
0 comments (0 inline, 0 general)
snapshot.cpp
Show inline comments
 
@@ -50,13 +50,13 @@ void SnapShot::show()
 
    view->activateWindow();
 
    view->raise();
 
}
 

	
 
void SnapShot::viewClosed()
 
{
 
    delete view;
 
    view->deleteLater();
 
    view = NULL;
 
}
 

	
 
void SnapShot::onDeleteTriggered()
 
{
 
    emit deleteRequested(this);
snapshotview.cpp
Show inline comments
 
@@ -8,13 +8,13 @@ SnapShotView::SnapShotView(QWidget *pare
 
    ui(new Ui::SnapShotView),
 
    renameDialog(this)
 
{
 
    _snapShot = snapShot;
 

	
 
    ui->setupUi(this);
 
    ui->menuSnapshot->addAction(snapShot->deleteAction());
 
    ui->menuSnapshot->insertAction(ui->actionClose, snapShot->deleteAction());
 
    this->setWindowTitle(snapShot->name());
 

	
 
    unsigned numOfChannels = snapShot->data.size();
 

	
 
    for (unsigned ci = 0; ci < numOfChannels; ci++)
 
    {
snapshotview.ui
Show inline comments
 
@@ -32,12 +32,13 @@
 
   <widget class="QMenu" name="menuSnapshot">
 
    <property name="title">
 
     <string>Snapshot</string>
 
    </property>
 
    <addaction name="actionRename"/>
 
    <addaction name="actionExport"/>
 
    <addaction name="actionClose"/>
 
   </widget>
 
   <widget class="QMenu" name="menuView">
 
    <property name="title">
 
     <string>View</string>
 
    </property>
 
   </widget>
 
@@ -57,18 +58,46 @@
 
    <string>Rename</string>
 
   </property>
 
   <property name="toolTip">
 
    <string>Rename this snapshot</string>
 
   </property>
 
  </action>
 
  <action name="actionClose">
 
   <property name="text">
 
    <string>Close</string>
 
   </property>
 
   <property name="toolTip">
 
    <string>Close Window</string>
 
   </property>
 
   <property name="shortcut">
 
    <string>Ctrl+W</string>
 
   </property>
 
  </action>
 
 </widget>
 
 <customwidgets>
 
  <customwidget>
 
   <class>Plot</class>
 
   <extends>QWidget</extends>
 
   <header>plot.h</header>
 
   <container>1</container>
 
  </customwidget>
 
 </customwidgets>
 
 <resources/>
 
 <connections/>
 
 <connections>
 
  <connection>
 
   <sender>actionClose</sender>
 
   <signal>triggered()</signal>
 
   <receiver>SnapShotView</receiver>
 
   <slot>close()</slot>
 
   <hints>
 
    <hint type="sourcelabel">
 
     <x>-1</x>
 
     <y>-1</y>
 
    </hint>
 
    <hint type="destinationlabel">
 
     <x>271</x>
 
     <y>224</y>
 
    </hint>
 
   </hints>
 
  </connection>
 
 </connections>
 
</ui>
0 comments (0 inline, 0 general)