~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/fullscreen/fullscreen_part.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2003 by Roberto Raggi                                   *
 
3
 *   roberto@kdevelop.org                                                  *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 ***************************************************************************/
 
11
 
 
12
#include <kiconloader.h>
 
13
#include <klocale.h>
 
14
#include <kdevgenericfactory.h>
 
15
#include <kstdaction.h>
 
16
#include <kmainwindow.h>
 
17
#include <kmenubar.h>
 
18
 
 
19
#include <kdevcore.h>
 
20
#include <kdevmainwindow.h>
 
21
#include <kdevplugininfo.h>
 
22
 
 
23
#include "fullscreen_part.h"
 
24
 
 
25
static const KDevPluginInfo data("kdevfullscreen");
 
26
 
 
27
typedef KDevGenericFactory<FullScreenPart> FullScreenFactory;
 
28
K_EXPORT_COMPONENT_FACTORY( libkdevfullscreen, FullScreenFactory( data ) )
 
29
 
 
30
FullScreenPart::FullScreenPart(QObject *parent, const char *name, const QStringList& )
 
31
  : KDevPlugin(&data, parent, name ? name : "FullScreenPart" )
 
32
{
 
33
  setInstance(FullScreenFactory::instance());
 
34
//  const KAboutData &abdata1 = *(info());
 
35
//  kdDebug() << abdata1.appName() << endl;
 
36
  const KDevPluginInfo &_info = *info();
 
37
  const KAboutData *abdata = _info;
 
38
  kdDebug() << abdata->appName() << endl;
 
39
  setXMLFile("kdevpart_fullscreen.rc");
 
40
 
 
41
  m_bFullScreen = false;
 
42
 
 
43
  m_pFullScreen = KStdAction::fullScreen(this, SLOT(slotToggleFullScreen()), actionCollection(), mainWindow()->main());
 
44
}
 
45
 
 
46
FullScreenPart::~FullScreenPart()
 
47
{
 
48
}
 
49
 
 
50
void FullScreenPart::slotToggleFullScreen( )
 
51
{
 
52
   m_bFullScreen = !m_bFullScreen;
 
53
   if( m_bFullScreen ){
 
54
      //mw->menuBar()->hide();
 
55
      mainWindow()->main()->showFullScreen();
 
56
 
 
57
      /*m_pFullScreen->setText( i18n( "Exit Full-Screen Mode" ) );
 
58
      m_pFullScreen->setToolTip( i18n( "Exit full-screen mode" ) );
 
59
      m_pFullScreen->setIcon( "window_nofullscreen" );*/
 
60
   } else {
 
61
      //mw->menuBar()->show();
 
62
 
 
63
      mainWindow()->main()->showNormal();
 
64
 
 
65
      /*m_pFullScreen->setText( i18n( "&Full-Screen Mode" ) );
 
66
      m_pFullScreen->setToolTip(i18n("Full-screen mode"));
 
67
      m_pFullScreen->setIcon( "window_fullscreen" );*/
 
68
   }
 
69
}
 
70
 
 
71
 
 
72
#include "fullscreen_part.moc"