VirtualBox

Changeset 4009 in vbox for trunk


Ignore:
Timestamp:
Aug 2, 2007 3:40:37 PM (17 years ago)
Author:
vboxsync
Message:

2168: Snapshot names suggested by the GUI:

Done as requested (as in usb-filters & network-ifaces ui).

Location:
trunk/src/VBox/Frontends/VirtualBox/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSnapshotsWgt.ui

    r3355 r4009  
    272272    <include location="global" impldecl="in implementation">qtooltip.h</include>
    273273    <include location="global" impldecl="in implementation">qmetaobject.h</include>
     274    <include location="global" impldecl="in implementation">qregexp.h</include>
    274275    <include location="local" impldecl="in declaration">COMDefs.h</include>
    275276    <include location="local" impldecl="in implementation">VBoxUtils.h</include>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxSnapshotsWgt.ui.h

    r4008 r4009  
    583583    dlg.pmIcon->setPixmap (vboxGlobal().vmGuestOSTypeIcon (typeId));
    584584
    585     dlg.leName->setText (tr ("Snapshot %1").arg (mMachine.GetSnapshotCount() + 1));
     585    /* search for the max available filter index */
     586    int maxSnapShotIndex = 0;
     587    QString snapShotName = tr ("Snapshot %1");
     588    QRegExp regExp (QString ("^") + snapShotName.arg ("([0-9]+)") + QString ("$"));
     589    QListViewItemIterator iterator (listView);
     590    while (*iterator)
     591    {
     592        QString snapShot = (*iterator)->text (0);
     593        int pos = regExp.search (snapShot);
     594        if (pos != -1)
     595            maxSnapShotIndex = regExp.cap (1).toInt() > maxSnapShotIndex ?
     596                               regExp.cap (1).toInt() : maxSnapShotIndex;
     597        ++ iterator;
     598    }
     599    dlg.leName->setText (snapShotName.arg (maxSnapShotIndex + 1));
    586600
    587601    if (dlg.exec() == QDialog::Accepted)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette