[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/graphics/UNNAMED_READER/UNNAMED_READER
From: Stefan Kebekus <kebekus () kde ! org>
Date: 2006-12-21 7:04:40
Message-ID: 1166684680.541463.6656.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 615329 by kebekus:
started to write stubs for fullscreen and presentation modi
M +4 -0 UNNAMED_READERui.rc
M +2 -2 autoHideTabWidget.cpp
M +44 -2 mainWindow.cpp
M +8 -0 mainWindow.h
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/UNNAMED_READERui.rc \
#615328:615329 @@ -5,6 +5,10 @@
<Action name="openURL" append="open_merge" />
<Action name="reload" append="open_merge" />
</Menu>
+ <Menu name="view"><text>&View</text>
+ <Action name="fullscreen" />
+ <Action name="presentation" />
+ </Menu>
</MenuBar>
<ToolBar noMerge="1" name="mainToolBar" >
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/autoHideTabWidget.cpp \
#615328:615329 @@ -32,7 +32,7 @@
namespace UNNAMED_READER {
-#define UNNAMED_READER_DEBUG 1 // 0=no messages, 1=debug messages
+#define UNNAMED_READER_DEBUG 0 // 0=no messages, 1=debug messages
autoHideTabWidget::autoHideTabWidget(QWidget *parent)
@@ -164,7 +164,7 @@
other->addAction(wdg->humanReadableDocumentFileName())->setData(j);
}
other->addSeparator();
- closeAll = other->addAction(SmallIconSet("tab_remove"), i18n("Close all other \
documents")); + closeAll = other->addAction(SmallIconSet("tab_remove_other"), \
i18n("Close all other documents")); menu.addSeparator();
}
QAction *close = menu.addAction(SmallIconSet("tab_remove"), i18n("Close \
document"));
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/mainWindow.cpp \
#615328:615329 @@ -93,6 +93,8 @@
action_close->setEnabled(workspace->count() > 0);
action_reload->setEnabled(workspace->currentReader() != 0);
+ action_fullScreen->setEnabled(workspace->currentReader() != 0);
+ action_presentation->setEnabled(workspace->currentReader() != 0);
}
@@ -112,18 +114,44 @@
{
kDebug(UNNAMED_READER_DEBUG, shell) << "mainWindow::quit()" << endl;
- /*
QList<readerWidget *> readers = findChildren<readerWidget \
*>("UNNAMED_READER::readerWidget"); for(int i=0; i<readers.count(); ++i) {
readerWidget *reader = readers.at(i);
if ((reader == 0) || (reader->askToClose() == false))
return;
}
- */
close();
}
+void mainWindow::showFullScreen()
+{
+ kDebug(UNNAMED_READER_DEBUG, shell) << "mainWindow::showFullScreen()" << endl;
+
+ readerWidget *reader = workspace->currentReader();
+ if (reader == 0) {
+ kError(shell) << "mainWindow::showFullScreen() called when no reader available" \
<< endl; + return;
+ }
+
+ reader->showFullScreen();
+}
+
+
+void mainWindow::showPresentation()
+{
+ kDebug(UNNAMED_READER_DEBUG, shell) << "mainWindow::showPresentation()" << endl;
+
+ readerWidget *reader = workspace->currentReader();
+ if (reader == 0) {
+ kError(shell) << "mainWindow::showPresentation() called when no reader \
available" << endl; + return;
+ }
+
+ reader->showPresentation();
+}
+
+
void mainWindow::readSettings()
{
kDebug(UNNAMED_READER_DEBUG, shell) << "mainWindow::readSettings()" << endl;
@@ -159,6 +187,7 @@
KStdAction::open(this, SLOT(open()), actionCollection());
+ // *** FILE MENU ***
// Open recent files
action_openRecent = KStdAction::openRecent(this, SLOT(openUrl(KUrl)), \
actionCollection()); \
action_openRecent->setToolBarMode(KRecentFilesAction::MenuMode); // Make a menu, not \
a combobox @@ -181,9 +210,22 @@
action_close = KStdAction::close(workspace, SLOT(deleteCurrentTab()), \
actionCollection()); KStdAction::quit(this, SLOT(quit()), actionCollection());
+ // *** VIEW MENU ***
+ // FullScreen mode
+ action_fullScreen = new KAction(KIcon("window_fullscreen"), i18n("Full Screen"), \
actionCollection(), "fullscreen"); + \
action_fullScreen->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_F); + \
connect(action_fullScreen, SIGNAL(triggered()), this, SLOT(showFullScreen())); +
+ // Presentation mode
+ action_presentation = new KAction(KIcon("kpresenter_kpr"), i18n("Start \
&Presentation"), actionCollection(), "presentation"); + \
action_presentation->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_P); + \
connect(action_presentation, SIGNAL(triggered()), this, SLOT(showPresentation())); +
+ // *** HELP MENU ***
// Tip of day
KStdAction::tipOfDay(this, SLOT(showTip()), actionCollection());
+
// Setup the graphical user interface
setupGUI();
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/mainWindow.h \
#615328:615329 @@ -112,7 +112,13 @@
// Shows the tip of the day
void showTip() {KTipDialog::showTip(this, "UNNAMED_READER/tips", true);}
+
+ // Shows the current document in full screen mode
+ void showFullScreen();
+ // Shows the current document in full screen mode
+ void showPresentation();
+
private:
// After all GUI items are constructed, this method is used in the
// constructor to read in the settings.
@@ -131,6 +137,8 @@
KRecentFilesAction *action_openRecent; // open recent files
KAction *action_reload;
KAction *action_close;
+ KAction *action_fullScreen;
+ KAction *action_presentation;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic