VBoxVMLogViewer.ui.h revision 82626d957e5a000348cb8b411f0bea763adc1057
/**
*
* VBox frontends: Qt GUI ("VirtualBox"):
* "Virtual Log Viewer" dialog UI include (Qt Designer)
*/
/*
* Copyright (C) 2006 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
{
const char *aName)
, mButtonClose (0)
, mSearchName (0), mSearchString (0)
, mButtonPrev (0), mButtonNext (0)
, mCaseSensitive (0)
{
mButtonClose->setAutoRaise (true);
"delete_dis_16px.png"));
QSizePolicy::Fixed);
mButtonPrev->setEnabled (false);
mButtonPrev->setAutoRaise (true);
mButtonPrev->setUsesTextLabel (true);
"list_moveup_disabled_16px.png"));
mButtonNext->setEnabled (false);
mButtonNext->setAutoRaise (true);
mButtonNext->setUsesTextLabel (true);
"list_movedown_disabled_16px.png"));
mWarningIcon->hide();
{
}
mWarningString->hide();
}
void languageChange()
{
tr ("Search for the previous occurrence of the string"));
tr ("Search for the next occurrence of the string"));
tr ("Check this box to perform Case Sensitive search"));
}
void findNext()
{
search (true);
}
void findBack()
{
search (false);
}
{
if (aSearchString.length())
search (true, true);
else
}
{
if (browser->hasSelectedText())
bool found = false;
{
mCaseSensitive->isChecked()) :
mCaseSensitive->isChecked());
if (res != -1)
{
found = true;
break;
}
}
if (!found)
}
{
{
{
/* processing the return keypress for the mSearchString
* widget as the search next string action */
if (aObject == mSearchString &&
{
findNext();
return true;
}
{
if (e->state() == 0)
findNext();
else if (e->state() == ShiftButton)
findBack();
return true;
}
/* processing ctrl-f key combination as the shortcut to
* move to the search field */
{
return true;
}
break;
}
default:
break;
}
return false;
}
{
}
{
focusNextPrevChild (true);
}
void toggleWarning (bool aHide)
{
}
};
{
{
/* creating new log viewer if there is no one existing */
/* read new machine data for this log viewer */
}
}
void VBoxVMLogViewer::init()
{
/* prepare dialog to first run */
mFirstRun = true;
/* dialog initially is not polished */
mIsPolished = false;
/* search the default button */
/* setup a dialog icon */
/* statusbar initially disabled */
/* setup size grip */
/* logs list creation */
/* search panel creation */
"VBoxLogSearchPanel");
mSearchPanel->hide();
/* fix the tab order to ensure the dialog keys are always the last */
/* applying language settings */
}
void VBoxVMLogViewer::destroy()
{
}
{
/* saving related machine */
/* reading log files */
refresh();
/* loading language constants */
}
{
return mMachine;
}
void VBoxVMLogViewer::languageChangeImp()
{
/* setup a dialog caption */
/* translate a search panel */
if (mSearchPanel)
}
{
/* this mechanism is used for searching the default dialog button
* and similar the same mechanism in Qt::QDialog inner source */
QPushButton *button = 0;
++ it;
return button;
}
{
{
/* auto-default button focus-in processor used to move the "default"
* button property into the currently focused button */
{
{
if (mDefaultButton)
}
break;
}
/* auto-default button focus-out processor used to remove the "default"
* button property from the previously focused button */
{
{
if (mDefaultButton)
}
break;
}
default:
break;
}
}
{
{
case QEvent::LanguageChange:
{
break;
}
default:
break;
}
return result;
}
{
{
{
/* processing the return keypress for the auto-default button */
case Key_Enter:
case Key_Return:
{
if (currentDefault)
break;
}
/* processing the escape keypress as the close dialog action */
case Key_Escape:
{
break;
}
}
}
{
mSearchPanel->show();
}
else
}
{
/* one may think that QWidget::polish() is the right place to do things
* below, but apparently, by the time when QWidget::polish() is called,
* the widget style & layout are not fully done, at least the minimum
* size hint is not properly calculated. Since this is sometimes necessary,
* we provide our own "polish" implementation. */
if (mIsPolished)
return;
mIsPolished = true;
}
{
/* adjust the size-grip location for the current resize event */
}
void VBoxVMLogViewer::refresh()
{
/* clearing old data if any */
{
}
bool isAnyLogPresent = false;
/* entering log files folder */
if (logFilesDir.exists())
{
/* reading log files folder */
}
/* create an empty log page if there are no logs at all */
if (!isAnyLogPresent)
{
"button to rescan the log folder <nobr><b>%1</b></nobr>.</p>")
.arg (logFilesPath));
/* we don't want it to remain white */
}
/* restore previous tab-widget margin which was reseted when
* the tab widget's children was removed */
/* show the first tab widget's page after the refresh */
if (mFirstRun)
{
/* resize the whole log-viewer to fit 80 symbols in text-browser for
* the first time started */
5 + 4 /* left text margin + QTabWidget frame width */ +
mFirstRun = false;
}
}
{
/* prepare log file */
return;
/* read log file and write it into the log page */
}
{
return logViewer;
}
{
}
void VBoxVMLogViewer::save()
{
/* prepare "save as" dialog */
"/" + defaultFileName);
/* save new log into the file */
if (!newFileName.isEmpty())
{
/* reread log data */
return;
/* save log data into the new file */
}
}
#include "VBoxVMLogViewer.ui.moc"