Changeset - ad8324c4db4c
[Not reviewed]
snapshots
0 3 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-09-20 06:28:23
hy@ozderya.net
add snapshots to menu
3 files changed with 36 insertions and 1 deletions:
0 comments (0 inline, 0 general)
mainwindow.cpp
Show inline comments
 
@@ -743,6 +743,24 @@ void MainWindow::takeSnapShot()
 
    }
 
    snapshots.append(snapShot);
 

	
 
    updateSnapShotMenu();
 

	
 
    auto sv = new SnapShotView(this, snapShot);
 
    sv->show();
 
}
 

	
 
void MainWindow::updateSnapShotMenu()
 
{
 
    ui->menuSnapShots->clear();
 
    ui->menuSnapShots->addAction(ui->actionSnapShot);
 
    if (snapshots.size())
 
    {
 
        ui->menuSnapShots->addSeparator();
 
        for (auto ss : snapshots)
 
        {
 
            ui->menuSnapShots->addAction(ss->name);
 
        }
 
        ui->menuSnapShots->addSeparator();
 
        ui->menuSnapShots->addAction(ui->actionClearSnapShots);
 
    }
 
}
mainwindow.h
Show inline comments
 
@@ -103,6 +103,8 @@ private:
 
    // snapshots
 
    QList<SnapShot*> snapshots;
 

	
 
    void updateSnapShotMenu();
 

	
 
    // demo
 
    QTimer demoTimer;
 
    int demoCount;
mainwindow.ui
Show inline comments
 
@@ -488,8 +488,15 @@
 
    <addaction name="actionUnzoom"/>
 
    <addaction name="actionDarkBackground"/>
 
   </widget>
 
   <widget class="QMenu" name="menuSnapShots">
 
    <property name="title">
 
     <string>SnapShots</string>
 
    </property>
 
    <addaction name="actionSnapShot"/>
 
   </widget>
 
   <addaction name="menuFile"/>
 
   <addaction name="menuView"/>
 
   <addaction name="menuSnapShots"/>
 
   <addaction name="menuHelp"/>
 
  </widget>
 
  <widget class="QToolBar" name="mainToolBar">
 
@@ -607,7 +614,7 @@
 
  </action>
 
  <action name="actionSnapShot">
 
   <property name="text">
 
    <string>SnapShot</string>
 
    <string>Take Snapshot</string>
 
   </property>
 
   <property name="toolTip">
 
    <string>Take a snapshot of the current plot (F5)</string>
 
@@ -616,6 +623,14 @@
 
    <string>F5</string>
 
   </property>
 
  </action>
 
  <action name="actionClearSnapShots">
 
   <property name="text">
 
    <string>Clear SnapShots</string>
 
   </property>
 
   <property name="toolTip">
 
    <string>Delete all snapshots</string>
 
   </property>
 
  </action>
 
 </widget>
 
 <layoutdefault spacing="6" margin="11"/>
 
 <customwidgets>
0 comments (0 inline, 0 general)