[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-19 8:38:52
Message-ID: 1166517532.249608.21900.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 614866 by kebekus:
added "tip of day", fixed compilation issue because of API change
M +1 -1 CMakeLists.txt
A TODO
M +6 -2 autoHideTabWidget.cpp
M +5 -1 main.cpp
M +14 -2 mainWindow.cpp
M +5 -0 mainWindow.h
A tips
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/CMakeLists.txt \
#614865:614866 @@ -26,4 +26,4 @@
install( FILES UNNAMED_READER.desktop DESTINATION ${XDG_APPS_DIR} )
#install( FILES UNNAMED_READER.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES UNNAMED_READERui.rc DESTINATION ${DATA_INSTALL_DIR}/UNNAMED_READER \
)
-#install( FILES tips DESTINATION ${DATA_INSTALL_DIR}/UNNAMED_READER )
+install( FILES tips DESTINATION ${DATA_INSTALL_DIR}/UNNAMED_READER )
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/autoHideTabWidget.cpp \
#614865:614866 @@ -143,6 +143,7 @@
KMenu menu(i18n("Menu for index ", index), tabBar());
menu.addTitle(reader->humanReadableDocumentFileName());
QAction *reload = menu.addAction(SmallIconSet("reload"), i18n("Reload"));
+ reload->setShortcut(Qt::Key_F5);
QAction *detach = 0;
if (count() > 1)
detach = menu.addAction(SmallIconSet("tab_breakoff"), i18n("Detach Tab"));
@@ -158,14 +159,17 @@
readerWidget *wdg = readers.at(i);
if ((wdg == 0) || (wdg == reader))
continue;
- other->addAction(wdg->humanReadableDocumentFileName())->setData(i);
+ int j = indexOf(wdg);
+ if (j >= 0)
+ other->addAction(wdg->humanReadableDocumentFileName())->setData(j);
}
other->addSeparator();
closeAll = other->addAction(SmallIconSet("tab_remove"), i18n("Close all other \
documents")); menu.addSeparator();
}
QAction *close = menu.addAction(SmallIconSet("tab_remove"), i18n("Close \
document"));
-
+ close->setShortcut(Qt::CTRL+Qt::Key_W);
+
// Show the menu
QAction *selected = menu.exec(tabBar()->mapToGlobal(pos));
if (selected == 0)
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/main.cpp #614865:614866
@@ -25,6 +25,7 @@
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <klocale.h>
+#include <ktip.h>
#include <kurl.h>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
@@ -114,7 +115,7 @@
// Go through these services
for(int i=0; i<services.size(); ++i) {
QString service = services.at(i);
-
+
// By constructing the KApplication, this process has already
// set up a DBus service (which will not work until the event
// loop starts). We must therefore filter out all services
@@ -143,6 +144,9 @@
mainWin = new UNNAMED_READER::mainWindow();
mainWin->show();
app.processEvents();
+
+ // Show the "tip of the day"
+ KTipDialog::showTip(mainWin, "UNNAMED_READER/tips");
// Go through the list of arguments and open the associated documents
KUrl url;
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/mainWindow.cpp \
#614865:614866 @@ -167,11 +167,23 @@
action_openRecent->setWhatsThis( i18n( "<qt><strong>Click</strong> to open a file \
or <strong>Click and hold</strong> to select a recent file" ) ); \
action_openRecent->setToolTip( i18n( "<qt><strong>Click</strong> to open a file or \
<strong>Click and hold</strong> to select a recent file" ) );
- new KAction(i18n("Open &URL..."), KShortcut(), this, SLOT(openUrl()), \
actionCollection(), "openURL");
- action_reload = new KAction(i18n("Reload"), "reload", KShortcut ("F5"), this, \
SLOT(reload()), actionCollection(), "reload"); + // Open Url
+ KAction *act;
+ act = new KAction(i18n("Open &URL..."), actionCollection(), "openURL");
+ connect(act, SIGNAL(triggered()), this, SLOT(openUrl()));
+
+ // Reload
+ action_reload = new KAction(KIcon("reload"), i18n("Reload"), actionCollection(), \
"reload"); + action_reload->setShortcut(Qt::Key_F5);
+ connect(action_reload, SIGNAL(triggered()), this, SLOT(reload()));
+
+ // Close document
action_close = KStdAction::close(workspace, SLOT(deleteCurrentTab()), \
actionCollection()); KStdAction::quit(this, SLOT(quit()), actionCollection());
+ // Tip of day
+ KStdAction::tipOfDay(this, SLOT(showTip()), actionCollection());
+
// Setup the graphical user interface
setupGUI();
--- trunk/playground/graphics/UNNAMED_READER/UNNAMED_READER/mainWindow.h \
#614865:614866 @@ -29,8 +29,10 @@
#include "readerWidget.h"
#include <kmainwindow.h>
+#include <ktip.h>
#include <kurl.h>
+class KAction;
class KRecentFilesAction;
class autoHideTabWidget;
@@ -108,6 +110,9 @@
// Quits, but asks first
void quit();
+ // Shows the tip of the day
+ void showTip() {KTipDialog::showTip(this, "UNNAMED_READER/tips", true);}
+
private:
// After all GUI items are constructed, this method is used in the
// constructor to read in the settings.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic