summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index d11e4e1..4ee252f 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -244,62 +244,64 @@ void PMainWindow::initT( const char* name, T** ptr, int id) {
if ( *ptr ) {
(*ptr)->disconnect(this, SLOT(slotReturn()));
(*ptr)->setDestructiveClose();
m_stack->removeWidget( *ptr );
}
*ptr = new T(m_cfg, m_stack, name );
m_stack->addWidget( *ptr, id );
connect(*ptr, SIGNAL(sig_return()),
this,SLOT(slotReturn()));
}
void PMainWindow::initInfo() {
initT<imageinfo>( "Image Info", &m_info, ImageInfo );
connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&)));
}
void PMainWindow::initDisp() {
initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay );
if (m_disp) {
// if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) {
//m_disp->setMinimumSize(QApplication::desktop()->size()/2);
// }
- m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType);
+ m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType,m_hBright);
m_disp->setAutoScale(!m_aUnscaled->isOn());
m_disp->setAutoRotate(m_aAutoRotate->isOn());
m_disp->setShowZoomer(m_aZoomer->isOn());
m_disp->setBackgroundColor(white);
connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&)));
connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext()));
connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev()));
connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen()));
connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView()));
connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer()));
connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale()));
connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate()));
connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int)));
+ connect(m_IncBrightness,SIGNAL(activated()),m_disp,SLOT(slotIncBrightness()));
+ connect(m_DecBrightness,SIGNAL(activated()),m_disp,SLOT(slotDecBrightness()));
slotFullScreenToggled(m_aFullScreen->isOn());
}
}
void PMainWindow::slotToggleFullScreen()
{
bool current = !m_aFullScreen->isOn();
m_aFullScreen->setOn(current);
}
void PMainWindow::slotFullScreenButton(bool current)
{
if (autoSave) {
m_cfg->writeEntry("fullscreen",current);
}
if (!m_disp) return;
if (m_disp->isVisible()) {
setupViewWindow(current, true);
}
}
void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
{
if (!m_disp) {
@@ -359,48 +361,49 @@ void PMainWindow::slotShowInfo( const QString& inf ) {
initInfo();
}
m_info->setPath( inf );
if (m_SmallWindow) {
m_aNext->removeFrom(toolBar);
m_aPrevious->removeFrom(toolBar);
fsButton->hide();
}
m_aNext->setEnabled(false);
m_aPrevious->setEnabled(false);
m_aDirUp->setEnabled(false);
m_aShowInfo->setEnabled(false);
m_aViewfile->setEnabled(true);
m_aStartSlide->setEnabled(false);
m_stack->raiseWidget( ImageInfo );
}
void PMainWindow::slotDisplay( const QString& inf ) {
bool nwindow = false;
if ( !m_disp ) {
nwindow = true;
initDisp();
m_disp->setIntensity(m_Intensity);
m_setCurrentBrightness->setEnabled(true);
+ m_hBright->setEnabled(true);
}
m_disp->setImage( inf );
if (m_SmallWindow) {
if (m_gPrevNext->isEnabled()==false) {
m_gPrevNext->addTo(toolBar);
fsButton->hide();
}
}
m_gPrevNext->setEnabled(true);
m_aDirUp->setEnabled(false);
m_aShowInfo->setEnabled(true);
m_aViewfile->setEnabled(false);
m_aStartSlide->setEnabled(false);
if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) {
slotFullScreenToggled(m_aFullScreen->isOn());
}
if (m_disp->fullScreen()) {
if (!m_disp->isVisible()) {
m_disp->showFullScreen();
qwsDisplay()->requestFocus( m_disp->winId(), TRUE);
}
} else {
m_stack->raiseWidget( ImageDisplay );
@@ -622,57 +625,62 @@ void PMainWindow::setupActions()
m_aZoomer = new QAction( tr( "Show zoomer window when unscaled" ), Resource::loadIconSet( "mag" ), 0, 0, this, 0, true );
m_aZoomer->setToggleAction(true);
if (autoSave) {
m_aZoomer->setOn(m_cfg->readBoolEntry("zoomeron",true));
} else {
m_aZoomer->setOn (true);
}
connect(m_aZoomer,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool)));
m_gDisplayType->insert(m_aAutoRotate);
m_gDisplayType->insert(m_aUnscaled);
m_gDisplayType->insert(m_aZoomer);
m_hGroup = new QActionGroup(this,"actioncollection",false);
m_hGroup->insert(m_aFullScreen);
if (!m_SmallWindow) {
m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true);
m_aForceSmall->setToggleAction(true);
connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool)));
} else {
m_aForceSmall = 0;
}
m_setCurrentBrightness = new QAction(tr("Display brightness..."), 0, 0, this, 0, false);
connect(m_setCurrentBrightness,SIGNAL(activated()),this,SLOT(setupBrightness()));
+ m_IncBrightness = new QAction(tr("Increase brightness by 5"),Resource::loadIconSet( "up" ),0, 0, this, 0, false);
+ m_DecBrightness = new QAction(tr("Decrease brightness by 5"),Resource::loadIconSet( "down" ),0, 0, this, 0, false);
+ m_hBright = new QActionGroup(this,"actioncollection",false),
+ m_hBright->insert(m_IncBrightness);
+ m_hBright->insert(m_DecBrightness);
}
void PMainWindow::setupBrightness()
{
if (!m_disp) {
return;
}
int lb = m_disp->Intensity();
- if (Valuebox(0,-255,255,lb,lb)) {
+ if (Valuebox(0,-100,100,lb,lb)) {
m_disp->setIntensity(lb,true);
}
}
void PMainWindow::setupToolbar()
{
toolBar = new QToolBar( this );
addToolBar(toolBar);
toolBar->setHorizontalStretchable( true );
setToolBarsMovable( false );
m_aDirUp->addTo( toolBar );
fsButton = new PFileSystem( toolBar );
connect( fsButton, SIGNAL( changeDir( const QString& ) ),
m_view, SLOT(slotChangeDir( const QString& ) ) );
connect( this, SIGNAL( changeDir( const QString& ) ),
m_view, SLOT(slotChangeDir( const QString& ) ) );
if (m_aBeam) {
m_aBeam->addTo( toolBar );
}
m_aShowInfo->addTo(toolBar);
m_aTrash->addTo(toolBar);
// m_aSetup->addTo(toolBar);
@@ -703,48 +711,52 @@ void PMainWindow::setupMenu()
m_aDirUp->addTo( fileMenu );
fsMenu = new QPopupMenu(fileMenu);
fileMenu->insertItem(Resource::loadIconSet( "cardmon/pcmcia" ),tr("Select filesystem"),fsMenu);
connect( fsMenu, SIGNAL( activated( int ) ), this, SLOT(slotSelectDir( int ) ) );
dirChanged();
if ( m_aBeam ) {
fileMenu->insertSeparator();
m_aBeam->addTo( fileMenu );
}
fileMenu->insertSeparator();
m_aTrash->addTo(fileMenu);
listviewMenu = new QPopupMenu(dispMenu);
dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu);
m_gListViewMode->addTo(listviewMenu);
dispMenu->insertSeparator();
m_aFullScreen->addTo(dispMenu);
m_gDisplayType->addTo(dispMenu);
dispMenu->insertSeparator();
m_gPrevNext->addTo(dispMenu);
m_setCurrentBrightness->addTo(dispMenu);
m_setCurrentBrightness->setEnabled(false);
+ dispMenu->insertSeparator();
+ m_hBright->addTo(dispMenu);
+ m_hBright->setEnabled(false);
+
if (m_aForceSmall) {
dispMenu->insertSeparator();
m_aForceSmall->addTo(dispMenu);
}
m_aSetup->addTo(settingsMenu);
m_aHideToolbar->addTo(settingsMenu);
}
void PMainWindow::listviewselected(QAction*which)
{
if (!which || which->isOn()==false) return;
int val = 1;
if (which==m_aDirName) {
val = 3;
} else if (which==m_aDirShort) {
val = 2;
} else if (which==m_aDirLong) {
val = 1;
}
emit changeListMode(val);
}