Changeset 58607 in vbox
- Timestamp:
- Nov 6, 2015 2:40:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp
r58267 r58607 32 32 33 33 /* GUI includes: */ 34 # include "QIFileDialog.h" 35 # include "QITabWidget.h" 36 # include "UIExtraDataManager.h" 37 # include "UIIconPool.h" 38 # include "UIMessageCenter.h" 39 # include "UISpecialControls.h" 34 40 # include "UIVMLogViewer.h" 35 # include "QITabWidget.h"36 # include "UIIconPool.h"37 # include "UISpecialControls.h"38 41 # include "VBoxGlobal.h" 39 # include "UIMessageCenter.h"40 42 # include "VBoxUtils.h" 41 # include "UIExtraDataManager.h"42 43 43 44 /* COM includes: */ … … 790 791 { 791 792 /* Prepare "save as" dialog: */ 792 QFileInfo fileInfo(m_book.at(m_pViewerContainer->currentIndex()).first); 793 QDateTime dtInfo = fileInfo.lastModified(); 794 QString strDtString = dtInfo.toString("yyyy-MM-dd-hh-mm-ss"); 795 QString strDefaultFileName = QString("%1-%2.log").arg(m_machine.GetName()).arg(strDtString); 796 QString strDefaultFullName = QDir::toNativeSeparators(QDir::home().absolutePath() + "/" + strDefaultFileName); 797 QString strNewFileName = QFileDialog::getSaveFileName(this, tr("Save VirtualBox Log As"), strDefaultFullName); 798 799 /* Copy log into the file: */ 793 const QFileInfo fileInfo(m_book.at(m_pViewerContainer->currentIndex()).first); 794 /* Prepare default filename: */ 795 const QDateTime dtInfo = fileInfo.lastModified(); 796 const QString strDtString = dtInfo.toString("yyyy-MM-dd-hh-mm-ss"); 797 const QString strDefaultFileName = QString("%1-%2.log").arg(m_machine.GetName()).arg(strDtString); 798 const QString strDefaultFullName = QDir::toNativeSeparators(QDir::home().absolutePath() + "/" + strDefaultFileName); 799 /* Show "save as" dialog: */ 800 const QString strNewFileName = QIFileDialog::getSaveFileName(strDefaultFullName, 801 "", 802 this, 803 tr("Save VirtualBox Log As"), 804 0 /* selected filter */, 805 true /* resolve symlinks */, 806 true /* confirm overwrite */); 807 /* Make sure file-name is not empty: */ 800 808 if (!strNewFileName.isEmpty()) 809 { 810 /* Delete the previous file if already exists as user already confirmed: */ 811 if (QFile::exists(strNewFileName)) 812 QFile::remove(strNewFileName); 813 /* Copy log into the file: */ 801 814 QFile::copy(m_machine.QueryLogFilename(m_pViewerContainer->currentIndex()), strNewFileName); 815 } 802 816 } 803 817
Note:
See TracChangeset
for help on using the changeset viewer.

