[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [tupi/devel] src: Refactoring GUI. Help tab has been replaced for a dialog (shortcut -> F1)
From: Gustav Gonzalez <info () maefloresta ! com>
Date: 2014-12-31 17:21:14
Message-ID: E1Y6MxO-0008Jr-TE () scm ! kde ! org
[Download RAW message or body]
Git commit 8a6454d9479ac7d69c9f1a35ce5bf8ed5ee6aa03 by Gustav Gonzalez.
Committed on 31/12/2014 at 17:19.
Pushed by gustavgonzalez into branch 'devel'.
Refactoring GUI. Help tab has been replaced for a dialog (shortcut -> F1)
M +5 -2 src/components/help/help.pro
M +20 -15 src/components/help/tuphelpbrowser.cpp
M +7 -3 src/components/help/tuphelpbrowser.h
C +26 -35 src/components/help/tuphelpdialog.cpp [from: \
src/components/help/tuphelpwidget.h - 069% similarity] C +11 -32 \
src/components/help/tuphelpdialog.h [from: src/components/help/tuphelpbrowser.h - \
077% similarity] M +30 -19 src/components/help/tuphelpwidget.cpp
M +8 -6 src/components/help/tuphelpwidget.h
M +29 -17 src/components/paintarea/tupdocumentview.cpp
M +0 -6 src/shell/shell.pro
M +69 -135 src/shell/tupmainwindow.cpp
M +18 -8 src/shell/tupmainwindow.h
M +9 -165 src/shell/tupmainwindow_gui.cpp
http://commits.kde.org/tupi/8a6454d9479ac7d69c9f1a35ce5bf8ed5ee6aa03
diff --git a/src/components/help/help.pro b/src/components/help/help.pro
index 1050fa3..6c5089d 100755
--- a/src/components/help/help.pro
+++ b/src/components/help/help.pro
@@ -12,9 +12,12 @@ macx {
}
HEADERS += tuphelpwidget.h \
- tuphelpbrowser.h
+ tuphelpbrowser.h \
+ tuphelpdialog.h
+
SOURCES += tuphelpwidget.cpp \
- tuphelpbrowser.cpp
+ tuphelpbrowser.cpp \
+ tuphelpdialog.cpp
*:!macx{
CONFIG += dll warn_on
diff --git a/src/components/help/tuphelpbrowser.cpp \
b/src/components/help/tuphelpbrowser.cpp index 21d5e22..7f2582d 100644
--- a/src/components/help/tuphelpbrowser.cpp
+++ b/src/components/help/tuphelpbrowser.cpp
@@ -37,18 +37,20 @@
// Help Browser
-TupHelpBrowser::TupHelpBrowser(QWidget *parent) : QWidget(parent)
+struct TupHelpBrowser::Private
{
- setWindowTitle(tr("Help"));
- setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"help_mode.png"))); + QTextBrowser *browser;
+};
+
+TupHelpBrowser::TupHelpBrowser(const QString &path, QWidget *parent) : \
QWidget(parent), k(new Private) +{
+ k->browser = new QTextBrowser(this);
+ k->browser->setOpenExternalLinks(true);
QHBoxLayout *layout = new QHBoxLayout(this);
- layout->setMargin(15);
- m_separator = new QSplitter(this);
- layout->addWidget(m_separator);
+ layout->addWidget(k->browser);
- m_pageArea = new QTextBrowser(m_separator);
- m_pageArea->setOpenExternalLinks(true);
+ setSource(path);
}
TupHelpBrowser::~TupHelpBrowser()
@@ -62,18 +64,18 @@ void TupHelpBrowser::setSource(const QString &filePath)
locale = "en";
QStringList path;
-
+
#ifdef Q_OS_WIN32
QString resources = SHARE_DIR + "help" + QDir::separator();
#else
- QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + \
QDir::separator();
-#endif
- // QString resources = SHARE_DIR + "data" + QDir::separator() + "help" + \
QDir::separator(); + QString resources = SHARE_DIR + "data" + QDir::separator() + \
"help" + QDir::separator(); +#endif
+
path << resources + "css";
path << resources + "images";
- m_pageArea->setSearchPaths(path);
+ k->browser->setSearchPaths(path);
- m_pageArea->setSource(QUrl::fromLocalFile(filePath));
+ k->browser->setSource(QUrl::fromLocalFile(filePath));
}
// SQA: These methods are just temporary for developing reasons
@@ -84,10 +86,13 @@ void TupHelpBrowser::keyPressEvent(QKeyEvent *event) {
if (event->modifiers() == Qt::ControlModifier)
reload();
break;
+ case (Qt::Key_Escape):
+ emit closeDialog();
+ break;
}
}
void TupHelpBrowser::reload()
{
- m_pageArea->reload();
+ k->browser->reload();
}
diff --git a/src/components/help/tuphelpbrowser.h \
b/src/components/help/tuphelpbrowser.h index f310d1d..17c6e50 100644
--- a/src/components/help/tuphelpbrowser.h
+++ b/src/components/help/tuphelpbrowser.h
@@ -58,7 +58,7 @@ class TUPI_EXPORT TupHelpBrowser : public QWidget
Q_OBJECT
public:
- TupHelpBrowser(QWidget *parent);
+ TupHelpBrowser(const QString &path, QWidget *parent = 0);
~TupHelpBrowser();
public slots:
@@ -67,10 +67,14 @@ class TUPI_EXPORT TupHelpBrowser : public QWidget
protected:
void keyPressEvent(QKeyEvent *event);
+ signals:
+ void closeDialog();
+
private:
void reload();
- QSplitter *m_separator;
- QTextBrowser *m_pageArea;
+
+ struct Private;
+ Private *const k;
};
#endif
diff --git a/src/components/help/tuphelpwidget.h \
b/src/components/help/tuphelpdialog.cpp similarity index 69%
copy from src/components/help/tuphelpwidget.h
copy to src/components/help/tuphelpdialog.cpp
index 10e5f81..afba7fe 100644
--- a/src/components/help/tuphelpwidget.h
+++ b/src/components/help/tuphelpdialog.cpp
@@ -6,7 +6,7 @@
* *
* Developers: *
* 2010: *
- * Gustavo Gonzalez / xtingray *
+ * Gustavo Gonzalez *
* *
* KTooN's versions: *
* *
@@ -33,45 +33,36 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
-#ifndef TUPHELPWIDGET_H
-#define TUPHELPWIDGET_H
+#include "tuphelpdialog.h"
-#include "tglobal.h"
-#include "tupmodulewidgetbase.h"
-
-#include <QWidget>
-#include <QMap>
-#include <QTreeWidget>
-#include <QDir>
-#include <QLocale>
-#include <QBoxLayout>
-#include <QHeaderView>
+TupHelpDialog::TupHelpDialog(const QString &path, QWidget *parent) : QDialog(parent)
+{
+ setModal(true);
+ setWindowTitle(tr("Help Content"));
+ setWindowIcon(QIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"help_mode.png")));
-// class KHelpWidgetManager;
+ #ifdef Q_OS_WIN32
+ QString helpPath = SHARE_DIR + "help" + QDir::separator();
+ #else
+ QString helpPath = SHARE_DIR + "data" + QDir::separator() + "help" + \
QDir::separator(); + #endif
-/**
- * @author David Alejandro Cuadrado Cabrera
-*/
+ TupHelpBrowser *helpBrowser = new TupHelpBrowser(path, this);
+ TupHelpWidget *helpMenu = new TupHelpWidget(helpPath);
-class TUPI_EXPORT TupHelpWidget : public TupModuleWidgetBase
-{
- Q_OBJECT
+ QSplitter *splitter = new QSplitter(this);
+ splitter->addWidget(helpBrowser);
+ splitter->addWidget(helpMenu);
- public:
- TupHelpWidget(const QString &path, QWidget *parent = 0);
- ~TupHelpWidget();
- QString helpPath() const;
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ layout->addWidget(splitter);
- private slots:
- void tryToLoadPage(QTreeWidgetItem *, QTreeWidgetItem *);
- void loadPage(const QString &path);
+ connect(helpMenu, SIGNAL(pageLoaded(const QString &)), helpBrowser, \
SLOT(setSource(const QString &))); + connect(helpMenu, SIGNAL(closeDialog()), \
this, SLOT(close()));
- signals:
- void pageLoaded(const QString &content);
+ connect(helpBrowser, SIGNAL(closeDialog()), this, SLOT(close()));
+}
- private:
- QDir *m_helpPath;
- QMap<QTreeWidgetItem *, QString> m_files;
-};
-
-#endif
+TupHelpDialog::~TupHelpDialog()
+{
+}
diff --git a/src/components/help/tuphelpbrowser.h \
b/src/components/help/tuphelpdialog.h similarity index 77%
copy from src/components/help/tuphelpbrowser.h
copy to src/components/help/tuphelpdialog.h
index f310d1d..089adf3 100644
--- a/src/components/help/tuphelpbrowser.h
+++ b/src/components/help/tuphelpdialog.h
@@ -6,7 +6,7 @@
* *
* Developers: *
* 2010: *
- * Gustavo Gonzalez / xtingray *
+ * Gustavo Gonzalez *
* *
* KTooN's versions: *
* *
@@ -33,44 +33,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
-#ifndef TUPHELPBROWSER_H
-#define TUPHELPBROWSER_H
+#ifndef TUPHELPDIALOG_H
+#define TUPHELPDIALOG_H
-#include "tglobal.h"
-#include "tapplicationproperties.h"
+#include "tuphelpbrowser.h"
+#include "tuphelpwidget.h"
-#include <QWidget>
-#include <QSplitter>
-#include <QTextBrowser>
-#include <QTextDocument>
-#include <QKeyEvent>
-#include <QBoxLayout>
-#include <QIcon>
-#include <QMouseEvent>
-#include <QDir>
+#include <QDialog>
+#include <QHBoxLayout>
-/**
- * @author David Cuadrado
-*/
-
-class TUPI_EXPORT TupHelpBrowser : public QWidget
+class TupHelpDialog : public QDialog
{
Q_OBJECT
public:
- TupHelpBrowser(QWidget *parent);
- ~TupHelpBrowser();
-
- public slots:
- void setSource(const QString &filePath);
-
- protected:
- void keyPressEvent(QKeyEvent *event);
-
- private:
- void reload();
- QSplitter *m_separator;
- QTextBrowser *m_pageArea;
+ TupHelpDialog(const QString &path, QWidget *parent=0);
+ ~TupHelpDialog();
};
#endif
+
diff --git a/src/components/help/tuphelpwidget.cpp \
b/src/components/help/tuphelpwidget.cpp index 98341a1..b9e3db1 100644
--- a/src/components/help/tuphelpwidget.cpp
+++ b/src/components/help/tuphelpwidget.cpp
@@ -35,23 +35,26 @@
#include "tuphelpwidget.h"
-TupHelpWidget::TupHelpWidget(const QString &path, QWidget *parent) : \
TupModuleWidgetBase(parent) +struct TupHelpWidget::Private
{
- setWindowTitle(tr("Help"));
- setWindowIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "help.png"));
+ QDir *helpPath;
+ QMap<QTreeWidgetItem *, QString> files;
+};
+TupHelpWidget::TupHelpWidget(const QString &path, QWidget *parent) : \
QWidget(parent), k(new Private) +{
QString lang = QString(QLocale::system().name()).left(2);
if (lang.length() > 0) {
- m_helpPath = new QDir(path + lang);
- if (!m_helpPath->exists())
- m_helpPath = new QDir(path + "en");
+ k->helpPath = new QDir(path + lang);
+ if (!k->helpPath->exists())
+ k->helpPath = new QDir(path + "en");
} else {
- m_helpPath = new QDir(path + "en");
+ k->helpPath = new QDir(path + "en");
}
#ifdef K_DEBUG
- QString msg = "TupHelpWidget() - Loading help files from -> " + \
m_helpPath->path(); + QString msg = "TupHelpWidget() - Loading help files from \
-> " + k->helpPath->path(); #ifdef Q_OS_WIN32
qWarning() << msg;
#else
@@ -63,13 +66,11 @@ TupHelpWidget::TupHelpWidget(const QString &path, QWidget \
*parent) : TupModuleWi contentsListView->setHeaderLabels(QStringList() << tr(""));
contentsListView->header()->hide();
- //connect(contentsListView, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this,
- // SLOT(tryToLoadPage(QTreeWidgetItem *, int)));
-
- addChild(contentsListView);
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ layout->addWidget(contentsListView);
QDomDocument document;
- QFile file(m_helpPath->path() + QDir::separator() + "help.xml");
+ QFile file(k->helpPath->path() + QDir::separator() + "help.xml");
QTreeWidgetItem *first = new QTreeWidgetItem;
@@ -85,7 +86,7 @@ TupHelpWidget::TupHelpWidget(const QString &path, QWidget *parent) \
: TupModuleWi if (element.tagName() == "Section") {
QTreeWidgetItem *item = new \
QTreeWidgetItem(contentsListView); item->setText(0, element.attribute("title"));
- m_files.insert(item, element.attribute("file"));
+ k->files.insert(item, element.attribute("file"));
if (element.attribute("file").compare("cover.html") == 0)
first = item;
@@ -97,7 +98,7 @@ TupHelpWidget::TupHelpWidget(const QString &path, QWidget *parent) \
: TupModuleWi
if (element2.tagName() == "SubSection") {
QTreeWidgetItem *subitem = new \
QTreeWidgetItem(item);
subitem->setText(0, \
element2.attribute("title"));
- m_files.insert(subitem, \
element2.attribute("file")); + \
k->files.insert(subitem, element2.attribute("file")); }
}
subSection = subSection.nextSibling();
@@ -135,6 +136,8 @@ TupHelpWidget::TupHelpWidget(const QString &path, QWidget \
*parent) : TupModuleWi
connect(contentsListView, SIGNAL(currentItemChanged(QTreeWidgetItem *, \
QTreeWidgetItem *)), this,
SLOT(tryToLoadPage(QTreeWidgetItem *, QTreeWidgetItem \
*))); +
+ setMaximumWidth(300);
}
TupHelpWidget::~TupHelpWidget()
@@ -146,9 +149,9 @@ void TupHelpWidget::tryToLoadPage(QTreeWidgetItem *item, \
QTreeWidgetItem *previe Q_UNUSED(preview);
if (item) {
- QString fileName = m_files[item];
+ QString fileName = k->files[item];
if (! fileName.isNull())
- loadPage(m_helpPath->path() + QDir::separator() + fileName);
+ loadPage(k->helpPath->path() + QDir::separator() + fileName);
}
}
@@ -157,7 +160,15 @@ void TupHelpWidget::loadPage(const QString &filePath)
emit pageLoaded(filePath);
}
-QString TupHelpWidget::helpPath () const
+QString TupHelpWidget::helpPath() const
{
- return m_helpPath->path();
+ return k->helpPath->path();
+}
+
+void TupHelpWidget::keyPressEvent(QKeyEvent *event) {
+ switch (event->key()) {
+ case (Qt::Key_Escape):
+ emit closeDialog();
+ break;
+ }
}
diff --git a/src/components/help/tuphelpwidget.h \
b/src/components/help/tuphelpwidget.h index 10e5f81..bb93ff8 100644
--- a/src/components/help/tuphelpwidget.h
+++ b/src/components/help/tuphelpwidget.h
@@ -37,7 +37,6 @@
#define TUPHELPWIDGET_H
#include "tglobal.h"
-#include "tupmodulewidgetbase.h"
#include <QWidget>
#include <QMap>
@@ -46,14 +45,13 @@
#include <QLocale>
#include <QBoxLayout>
#include <QHeaderView>
-
-// class KHelpWidgetManager;
+#include <QDomDocument>
/**
* @author David Alejandro Cuadrado Cabrera
*/
-class TUPI_EXPORT TupHelpWidget : public TupModuleWidgetBase
+class TUPI_EXPORT TupHelpWidget : public QWidget
{
Q_OBJECT
@@ -68,10 +66,14 @@ class TUPI_EXPORT TupHelpWidget : public TupModuleWidgetBase
signals:
void pageLoaded(const QString &content);
+ void closeDialog();
+
+ protected:
+ void keyPressEvent(QKeyEvent *event);
private:
- QDir *m_helpPath;
- QMap<QTreeWidgetItem *, QString> m_files;
+ struct Private;
+ Private *const k;
};
#endif
diff --git a/src/components/paintarea/tupdocumentview.cpp \
b/src/components/paintarea/tupdocumentview.cpp index 1b317a6..86008ca 100644
--- a/src/components/paintarea/tupdocumentview.cpp
+++ b/src/components/paintarea/tupdocumentview.cpp
@@ -74,6 +74,7 @@ struct TupDocumentView::Private
QMenu *shapesMenu;
QMenu *motionMenu;
+ QMenu *miscMenu;
QMenu *filterMenu;
QMenu *toolsMenu;
@@ -417,14 +418,14 @@ void TupDocumentView::setupDrawActions()
new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "onion.png"), \
tr("Onion Skin Factor"), QKeySequence(tr("Ctrl+Shift+S")),
this, SLOT(setDefaultOnionFactor()), k->actionManager, \
"onionfactor");
- new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"export_frame.png"), tr("Export Current Frame As Image"), QKeySequence(tr("@")), + \
new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "export_frame.png"), \
tr("Export Frame As Image"), QKeySequence(tr("@")),
this, SLOT(exportImage()), k->actionManager, "export_image");
TCONFIG->beginGroup("Network");
QString server = TCONFIG->value("Server").toString();
if (k->isNetworked && server.compare("tupitu.be") == 0) {
- new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"import_project.png"), tr("Export Current Frame To Gallery"), QKeySequence(tr("@")), \
+ new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"import_project.png"), tr("Export Frame To Gallery"), \
QKeySequence(tr("@")),
this, SLOT(postImage()), k->actionManager, "post_image");
}
@@ -460,8 +461,12 @@ void TupDocumentView::createLateralToolBar()
// Motion Tween menu
k->motionMenu = new QMenu(tr("Tweening"), k->toolbar);
- k->motionMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"tweening.png")); + k->motionMenu->setIcon(QPixmap(THEME_DIR + "icons" + \
QDir::separator() + "position_tween.png"));
connect(k->motionMenu, SIGNAL(triggered(QAction *)), this, \
SLOT(selectToolFromMenu(QAction*))); +
+ // Misc Tools menu
+ k->miscMenu = new QMenu(tr("Misc Tools"), k->toolbar);
+ k->miscMenu->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"export_frame.png")); }
void TupDocumentView::loadPlugins()
@@ -667,6 +672,25 @@ void TupDocumentView::loadPlugins()
for (int i = 0; i < tweenTools.size(); ++i)
k->motionMenu->addAction(tweenTools.at(i));
+ k->miscMenu->addAction(k->actionManager->find("export_image"));
+
+ TCONFIG->beginGroup("Network");
+ QString server = TCONFIG->value("Server").toString();
+
+ if (k->isNetworked && server.compare("tupitu.be") == 0)
+ k->miscMenu->addAction(k->actionManager->find("post_image"));
+
+ k->miscMenu->addAction(k->actionManager->find("storyboard"));
+
+ #ifdef Q_OS_WIN32
+ if (QSysInfo::windowsVersion() != QSysInfo::WV_XP)
+ k->miscMenu->addAction(k->actionManager->find("camera"));
+ #else
+ k->miscMenu->addAction(k->actionManager->find("camera"));
+ #endif
+
+ k->miscMenu->addAction(k->actionManager->find("papagayo"));
+
foreach (QObject *plugin, TupPluginManager::instance()->filters()) {
AFilterInterface *filterInterface = qobject_cast<AFilterInterface \
*>(plugin); QStringList::iterator it;
@@ -705,6 +729,8 @@ void TupDocumentView::loadPlugins()
k->toolbar->addAction(k->shiftAction);
k->toolbar->addSeparator();
k->toolbar->addAction(k->motionMenu->menuAction());
+ k->toolbar->addSeparator();
+ k->toolbar->addAction(k->miscMenu->menuAction());
brushTools.clear();
tweenTools.clear();
@@ -1118,20 +1144,6 @@ void TupDocumentView::createToolBar()
k->barGrid->addWidget(k->onionFactorSpin);
- k->barGrid->addAction(k->actionManager->find("export_image"));
-
- TCONFIG->beginGroup("Network");
- QString server = TCONFIG->value("Server").toString();
-
- if (k->isNetworked && server.compare("tupitu.be") == 0)
- k->barGrid->addAction(k->actionManager->find("post_image"));
-
- k->barGrid->addAction(k->actionManager->find("storyboard"));
-
- k->barGrid->addAction(k->actionManager->find("camera"));
-
- k->barGrid->addAction(k->actionManager->find("papagayo"));
-
addToolBarBreak();
QLabel *dirLabel = new QLabel(tr("Direction") + ": ");
diff --git a/src/shell/shell.pro b/src/shell/shell.pro
index 5d4a237..74c1eaa 100755
--- a/src/shell/shell.pro
+++ b/src/shell/shell.pro
@@ -69,9 +69,6 @@ unix:!mac {
HEADERS += tupmainwindow.h \
tupstatusbar.h \
tupnewproject.h \
- # tupsplash.h \
- # tupcrashhandler.h \
- # tupcrashwidget.h \
tupapplication.h \
tuplocalprojectmanagerhandler.h
@@ -79,9 +76,6 @@ SOURCES += main.cpp \
tupmainwindow.cpp \
tupstatusbar.cpp \
tupnewproject.cpp \
- # tupsplash.cpp \
- # tupcrashhandler.cpp \
- # tupcrashwidget.cpp \
tupapplication.cpp \
tupmainwindow_gui.cpp \
tuplocalprojectmanagerhandler.cpp
diff --git a/src/shell/tupmainwindow.cpp b/src/shell/tupmainwindow.cpp
index 83e7a95..b8cf639 100644
--- a/src/shell/tupmainwindow.cpp
+++ b/src/shell/tupmainwindow.cpp
@@ -120,7 +120,7 @@ TupMainWindow::TupMainWindow(int parameters) : \
TabbedMainWindow(), m_projectMana // Calling out the events/actions manager
m_actionManager = new TActionManager(this);
- setupActions();
+ // setupActions();
// Setting up all the GUI...
createGUI(); // This method is called from the tupmainwindow_gui class
@@ -337,31 +337,6 @@ void TupMainWindow::setWorkSpace(const QStringList &users)
connect(animationTab, SIGNAL(updateFPS(int)), cameraWidget, \
SLOT(setStatusFPS(int)));
- helpTab = new TupHelpBrowser(this);
-
- QString lang = (QLocale::system().name()).left(2);
- if (lang.length() < 2)
- lang = "en";
-
- QString cover = QString() + "help" + QDir::separator() + lang + \
QDir::separator() + "cover.html";
- #ifdef Q_OS_WIN32
- QString helpPath = SHARE_DIR + cover;
- #else
- QString helpPath = SHARE_DIR + "data" + QDir::separator() + cover;
- #endif
- QFile file(helpPath);
- if (!file.exists()) {
- #ifdef Q_OS_WIN32
- helpPath = SHARE_DIR + "help" + QDir::separator() + "en" + \
QDir::separator() + "cover.html";
- helpPath.replace("/","\\");
- #else
- helpPath = SHARE_DIR + "data" + QDir::separator() + "help" + \
QDir::separator() + "en" + QDir::separator() + "cover.html";
- #endif
- }
-
- helpTab->setSource(helpPath);
- addWidget(helpTab);
-
QString twitterPath = QDir::homePath() + QDir::separator() + "." + \
QCoreApplication::applicationName() + QDir::separator() + "twitter.html";
#ifdef Q_OS_WIN32
@@ -415,9 +390,6 @@ void TupMainWindow::setWorkSpace(const QStringList &users)
TOsd::self()->display(tr("Information"), tr("Project <b>%1</b> \
opened!").arg(m_projectManager->project()->projectName()));
m_exposureSheet->setScene(0);
-
- // connect(m_projectManager, SIGNAL(projectHasChanged(bool)), this, \
SLOT(updatePlayer(bool)));
- // connect(animationTab, SIGNAL(projectHasChanged()), this, \
SLOT(updatePlayer())); }
connect(this, SIGNAL(tabHasChanged(int)), this, SLOT(updateTabContext(int)));
@@ -544,32 +516,16 @@ void TupMainWindow::resetUI()
#endif
#endif
- // disconnect(animationTab, SIGNAL(projectHasChanged()), this, \
SLOT(updatePlayer()));
- // disconnect(m_projectManager, SIGNAL(projectHasChanged(bool)), this, \
SLOT(updatePlayer(bool)));
-
setCurrentTab(0);
- // if (colorView->isExpanded())
- colorView->expandDock(false);
-
- // if (penView->isExpanded())
- penView->expandDock(false);
-
- // if (libraryView->isExpanded())
- libraryView->expandDock(false);
-
- //if (helpView->isExpanded())
- helpView->expandDock(false);
-
- //if (scenesView->isExpanded())
- scenesView->expandDock(false);
-
- //if (timeView->isExpanded())
- timeView->expandDock(false);
+ colorView->expandDock(false);
+ penView->expandDock(false);
+ libraryView->expandDock(false);
+ scenesView->expandDock(false);
+ timeView->expandDock(false);
#if defined(QT_GUI_LIB) && defined(K_DEBUG) && !defined(Q_OS_WIN32)
- //if (debugView->isExpanded())
- debugView->expandDock(false);
+ debugView->expandDock(false);
#endif
setUpdatesEnabled(false);
@@ -579,44 +535,31 @@ void TupMainWindow::resetUI()
animationTab->closeArea();
if (lastTab == 0) {
-
if (internetOn)
removeWidget(newsTab, true);
- removeWidget(helpTab, true);
removeWidget(playerTab, true);
removeWidget(animationTab, true);
-
} else {
- if (lastTab == 1) {
-
- if (internetOn)
- removeWidget(newsTab, true);
-
- removeWidget(helpTab, true);
- removeWidget(animationTab, true);
- removeWidget(playerTab, true);
-
- } else if (lastTab == 2) {
-
- removeWidget(animationTab, true);
- removeWidget(playerTab, true);
-
- if (internetOn)
- removeWidget(newsTab, true);
-
- removeWidget(helpTab, true);
-
- } else if (lastTab == 3) {
-
- removeWidget(animationTab, true);
- removeWidget(playerTab, true);
- removeWidget(helpTab, true);
-
- if (internetOn)
- removeWidget(newsTab, true);
-
- }
+ if (lastTab == 1) {
+ if (internetOn)
+ removeWidget(newsTab, true);
+
+ removeWidget(animationTab, true);
+ removeWidget(playerTab, true);
+ } else if (lastTab == 2) {
+ removeWidget(animationTab, true);
+ removeWidget(playerTab, true);
+
+ if (internetOn)
+ removeWidget(newsTab, true);
+ } else if (lastTab == 3) {
+ removeWidget(animationTab, true);
+ removeWidget(playerTab, true);
+
+ if (internetOn)
+ removeWidget(newsTab, true);
+ }
}
if (internetOn) {
@@ -624,9 +567,6 @@ void TupMainWindow::resetUI()
newsTab = 0;
}
- delete helpTab;
- helpTab = 0;
-
delete playerTab;
playerTab = 0;
@@ -907,6 +847,43 @@ void TupMainWindow::preferences()
/**
* @if english
+ * This method opens the help dialog.
+ * @endif
+ * @if spanish
+ * Este metodo abre el dialogo de ayuda.
+ * @endif
+*/
+
+void TupMainWindow::showHelp()
+{
+ QString lang = (QLocale::system().name()).left(2);
+ if (lang.length() < 2)
+ lang = "en";
+
+ QString cover = QString() + "help" + QDir::separator() + lang + \
QDir::separator() + "cover.html"; +
+#ifdef Q_OS_WIN32
+ QString helpPath = SHARE_DIR + cover;
+#else
+ QString helpPath = SHARE_DIR + "data" + QDir::separator() + cover;
+#endif
+
+ QFile file(helpPath);
+ if (!file.exists()) {
+ #ifdef Q_OS_WIN32
+ helpPath = SHARE_DIR + "help" + QDir::separator() + "en" + \
QDir::separator() + "cover.html"; + helpPath.replace("/","\\");
+ #else
+ helpPath = SHARE_DIR + "data" + QDir::separator() + "help" + \
QDir::separator() + "en" + QDir::separator() + "cover.html"; + #endif
+ }
+
+ TupHelpDialog *dialog = new TupHelpDialog(helpPath, this);
+ dialog->showMaximized();
+}
+
+/**
+ * @if english
* This method opens the "About Tupi" dialog.
* @endif
* @if spanish
@@ -1017,7 +994,7 @@ void TupMainWindow::connectWidgetToManager(QWidget *widget)
connect(m_projectManager, SIGNAL(responsed(TupProjectResponse*)), widget,
SLOT(handleProjectResponse(TupProjectResponse *)));
- // PENDING TO CHECK
+ // SQA: Pending for revision
//connect(widget, SIGNAL(postPage(QWidget *)), this, SLOT(addPage(QWidget *)));
}
@@ -1061,22 +1038,6 @@ void TupMainWindow::connectWidgetToLocalManager(QWidget \
*widget) }
/**
- * @if english
- * This method display a help page.
- * @endif
- * @if spanish
- * Este metodo despliega una pagina de ayuda.
- * @endif
-*/
-
-//void TupMainWindow::showHelpPage(const QString &title, const QString &filePath)
-
-void TupMainWindow::showHelpPage(const QString &filePath)
-{
- helpTab->setSource(filePath);
-}
-
-/**
* @if english
* This method is in charge of the function "Save as" for Tupi projects.
* @endif
@@ -1141,7 +1102,6 @@ void TupMainWindow::saveAs()
setWindowTitle(tr("Tupi: Open 2D Magic") + " - " + projectName + " [ " + \
tr("by") + " " + author + " ]"); }
- // save();
saveProject();
}
@@ -1290,21 +1250,16 @@ void TupMainWindow::createCommand(const TupPaintAreaEvent \
*event) TupPaintAreaCommand *command = animationTab->createCommand(event);
if (command) {
- // tFatal() << "TupMainWindow::createCommand() - Paint command is valid!";
m_projectManager->undoHistory()->push(command);
- // if (event->action() == 2) {
if (event->action() == TupPaintAreaEvent::ChangeColorPen) {
- // tFatal() << "TupMainWindow::createCommand() - event action == \
ChangeColorPen";
m_penWidget->setPenColor(qvariant_cast<QColor>(event->data()));
} else if (event->action() == TupPaintAreaEvent::ChangeBrush) {
// tFatal() << "TupMainWindow::createCommand() - event action == \
ChangeBrush";
// tFatal() << "TupMainWindow::createCommand() - action: " << \
event->action();
// m_penWidget->setBrush(qvariant_cast<QBrush>(event->data()));
}
- } else {
- // tFatal() << "TupMainWindow::createCommand() - Paint command is NULL!";
- }
+ }
}
void TupMainWindow::updatePenColor(const QColor &color)
@@ -1338,8 +1293,6 @@ void TupMainWindow::updateCurrentTab(int index)
// SQA: Check/Test the content of this method
if (index == 1) { // Player mode
- if (lastTab == 2)
- helpView->expandDock(false);
lastTab = 1;
updatePlayer();
cameraWidget->updateFirstFrame();
@@ -1349,35 +1302,23 @@ void TupMainWindow::updateCurrentTab(int index)
if (lastTab == 1)
cameraWidget->doStop();
- if (scenesView->isExpanded()) {
- helpView->expandDock(false);
+ if (scenesView->isExpanded())
scenesView->expandDock(true);
- }
if (contextMode == TupProject::FRAMES_EDITION) {
- if (exposureView->isExpanded()) {
- helpView->expandDock(false);
+ if (exposureView->isExpanded())
exposureView->expandDock(true);
- }
} else {
exposureView->expandDock(false);
exposureView->enableButton(false);
}
- if (lastTab == 2)
- helpView->expandDock(false);
-
animationTab->updatePaintArea();
lastTab = 0;
} else {
- if (index == 2) { // Help mode
- helpView->expandDock(true);
- lastTab = 2;
- } else if (index == 3) { // News mode
- helpView->expandDock(false);
- lastTab = 3;
- }
+ if (index == 3)
+ lastTab = 3;
}
}
}
@@ -1486,13 +1427,6 @@ void TupMainWindow::netProjectSaved()
QApplication::restoreOverrideCursor();
}
-/*
-void TupMainWindow::postVideo(const QString &title, const QString &topics, const \
QString &description, int fps, const QList<int> sceneIndexes)
-{
- netProjectManager->sendVideoRequest(title, topics, description, fps, \
sceneIndexes);
-}
-*/
-
void TupMainWindow::updatePlayer(bool removeAction)
{
#ifdef K_DEBUG
diff --git a/src/shell/tupmainwindow.h b/src/shell/tupmainwindow.h
index 49dc76e..582655b 100644
--- a/src/shell/tupmainwindow.h
+++ b/src/shell/tupmainwindow.h
@@ -40,6 +40,7 @@
#include "tupdocumentview.h"
#include "tupanimationspace.h"
#include "tuppreferences.h"
+#include "tuphelpdialog.h"
// modules
#include "tupexposuresheet.h"
@@ -100,6 +101,7 @@ class TupMainWindow : public TabbedMainWindow
public:
+/*
enum Perspective {
Animation = 0x01,
Player = 0x02,
@@ -107,6 +109,14 @@ class TupMainWindow : public TabbedMainWindow
News = 0x08,
All = Animation | Player | Help | News
};
+*/
+
+ enum Perspective {
+ Animation = 0x01,
+ Player = 0x02,
+ News = 0x04,
+ All = Animation | Player | News
+ };
enum RequestType {
None = 0,
@@ -127,7 +137,7 @@ class TupMainWindow : public TabbedMainWindow
void setupFileActions();
void setupSettingsActions();
// void setupWindowActions();
- void setupInsertActions();
+ // void setupInsertActions();
/**
* Sets up the actions in the toolbar
@@ -140,7 +150,7 @@ class TupMainWindow : public TabbedMainWindow
void setupMenu();
void setupHelpActions();
- void setupActions();
+ // void setupActions();
void setMenuItemsContext(bool flag);
void connectWidgetToManager(QWidget *widget);
@@ -192,13 +202,13 @@ class TupMainWindow : public TabbedMainWindow
void saveAs();
- void showHelpPage(const QString &document);
- void showWidgetPage();
+ // void showHelpPage(const QString &document);
+ // void showWidgetPage();
void showAnimationMenu(const QPoint &p);
void changePerspective(QAction *a);
- void setHelpPerspective();
+ // void setHelpPerspective();
void addPage(QWidget *widget);
void updateCurrentTab(int index);
@@ -213,6 +223,7 @@ class TupMainWindow : public TabbedMainWindow
private slots:
void preferences();
+ void showHelp();
void aboutTupi();
void showTipDialog();
void importPalettes();
@@ -222,7 +233,6 @@ class TupMainWindow : public TabbedMainWindow
void callSave();
void expandExposureView(TupProject::Mode contextMode);
void expandColorView();
- // void postVideo(const QString &title, const QString &topics, const \
QString &description, int fps, const QList<int> sceneIndexes); void \
resetMousePointer(); void updateUsersOnLine(const QString &login, int state);
void importPapagayoLipSync();
@@ -236,7 +246,7 @@ class TupMainWindow : public TabbedMainWindow
private:
TupDocumentView *animationTab;
TupAnimationspace *playerTab;
- TupHelpBrowser *helpTab;
+ // TupHelpBrowser *helpTab;
TupTwitterWidget *newsTab;
TupStatusBar *m_statusBar;
TActionManager *m_actionManager;
@@ -266,7 +276,7 @@ class TupMainWindow : public TabbedMainWindow
#if defined(QT_GUI_LIB) && defined(K_DEBUG) && defined(Q_OS_UNIX)
TupDebugWidget *m_debug;
#endif
- TupHelpWidget *m_helper;
+ // TupHelpWidget *m_helper;
TupLibraryWidget *m_libraryWidget;
TupColorPalette *m_colorPalette;
TupPenWidget *m_penWidget;
diff --git a/src/shell/tupmainwindow_gui.cpp b/src/shell/tupmainwindow_gui.cpp
index 832c506..5358d27 100644
--- a/src/shell/tupmainwindow_gui.cpp
+++ b/src/shell/tupmainwindow_gui.cpp
@@ -128,26 +128,6 @@ void TupMainWindow::createGUI()
connectWidgetToManager(m_exposureSheet);
connectWidgetToLocalManager(m_exposureSheet);
- // Adding the help widget to the right side of the interface
-
-#ifdef Q_OS_WIN32
- QString helpPath = SHARE_DIR + "help" + QDir::separator();
-#else
- QString helpPath = SHARE_DIR + "data" + QDir::separator() + "help" + \
QDir::separator();
-#endif
- m_helper = new TupHelpWidget(helpPath);
- helpView = addToolView(m_helper, Qt::RightDockWidgetArea, All, "Help", \
QKeySequence(tr("Shift+H")));
- m_actionManager->insert(helpView->toggleViewAction(), "show_help");
- addToPerspective(helpView->toggleViewAction(), All);
-
- TViewButton *helpButton = helpView->button();
-
- connect(helpButton, SIGNAL(helpIsOpen()), this,
- SLOT(setHelpPerspective()));
-
- connect(m_helper, SIGNAL(pageLoaded(const QString &)), this,
- SLOT(showHelpPage(const QString &)));
-
// Adding the time line widget to the bottom side of the interface
m_timeLine = new TupTimeLine(m_projectManager->project());
timeView = addToolView(m_timeLine, Qt::BottomDockWidgetArea, Animation, "Time \
Line", QKeySequence(tr("Shift+T"))); @@ -238,7 +218,7 @@ void \
TupMainWindow::setupMenu() \
m_insertMenu->addAction(m_actionManager->find("importBitmapArray")); \
m_insertMenu->addAction(m_actionManager->find("importSvg")); \
m_insertMenu->addAction(m_actionManager->find("importSvgArray"));
- //m_insertMenu->addAction(m_actionManager->find("importAudioFile"));
+ // m_insertMenu->addAction(m_actionManager->find("importAudioFile"));
m_insertMenu->addSeparator();
m_insertMenu->addAction(m_actionManager->find("importGimpPalettes"));
@@ -247,7 +227,6 @@ void TupMainWindow::setupMenu()
m_insertMenu->addAction(m_actionManager->find("importPapagayoLipSync"));
// Setting up the window menu
- // setupWindowActions();
m_windowMenu = menuBar()->addMenu(tr("&Window"));
// Adding Options show debug, palette, pen, library, timeline, scenes, exposure, \
help @@ -257,7 +236,6 @@ void TupMainWindow::setupMenu()
m_windowMenu->addAction(m_actionManager->find("show_timeline"));
m_windowMenu->addAction(m_actionManager->find("show_scenes"));
m_windowMenu->addAction(m_actionManager->find("show_exposure"));
- m_windowMenu->addAction(m_actionManager->find("show_help"));
#if defined(QT_GUI_LIB) && defined(K_DEBUG) && defined(Q_OS_UNIX)
m_windowMenu->addAction(m_actionManager->find("show_debug"));
@@ -286,19 +264,11 @@ void TupMainWindow::setupMenu()
animationPerspective->setData(Player);
group->addAction(animationPerspective);
- // Adding Option Help
- QAction *helpPerspective = new QAction(tr("Help"), this);
- helpPerspective->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"help_mode.png"));
- helpPerspective->setIconVisibleInMenu(true);
- helpPerspective->setShortcut(QKeySequence("Ctrl+3"));
- helpPerspective->setData(Help);
- group->addAction(helpPerspective);
-
// Adding Option News
QAction *newsPerspective = new QAction(tr("News"), this);
newsPerspective->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + \
"news_mode.png")); newsPerspective->setIconVisibleInMenu(true);
- newsPerspective->setShortcut(QKeySequence("Ctrl+4"));
+ newsPerspective->setShortcut(QKeySequence("Ctrl+3"));
newsPerspective->setData(News);
group->addAction(newsPerspective);
@@ -310,6 +280,7 @@ void TupMainWindow::setupMenu()
setupHelpActions();
m_helpMenu = new QMenu(tr("&Help"), this);
menuBar()->addMenu(m_helpMenu);
+ m_helpMenu->addAction(m_actionManager->find("help"));
m_helpMenu->addAction(m_actionManager->find("tip_of_day"));
m_helpMenu->addSeparator();
m_helpMenu->addAction(m_actionManager->find("about_tupi"));
@@ -330,20 +301,6 @@ void TupMainWindow::setMenuItemsContext(bool flag)
m_viewMenu->setEnabled(flag);
}
-void TupMainWindow::setupActions()
-{
-/*
- TAction *next = new TAction(QPixmap(), tr( "Back Frame" ), \
QKeySequence(Qt::Key_PageUp), this,
- SLOT(selectBackFrame()), m_actionManager, "BackFrame");
- next->setShortcutContext ( Qt::ApplicationShortcut );
- TAction *back = new TAction( QPixmap(), tr( "Next Frame" ), \
QKeySequence(Qt::Key_PageDown), this,
- SLOT(selectNextFrame()), m_actionManager, "Next Frame");
- back->setShortcutContext ( Qt::ApplicationShortcut );
- addAction(back);
- addAction(next);
-*/
-}
-
/**
* @if english
* This method defines the actions for the options in the menu File
@@ -381,22 +338,13 @@ void TupMainWindow::setupFileActions()
m_actionManager->insert(save, "saveproject", "file");
save->setStatusTip(tr("Save current project in current location"));
- // TAction *saveAs = new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() \
+ "save_as.png"), tr("Save project &As..."),
- // QKeySequence(tr("Ctrl+Shift+S")), \
m_actionManager);
-
TAction *saveAs = new TAction(QPixmap(THEME_DIR + "icons/save_as.png"), tr("Save \
project &As..."),
QKeySequence(tr("Ctrl+Shift+S")), this, SLOT(saveAs()), m_actionManager);
-
- // connect(saveAs, SIGNAL(triggered()), this, SLOT(saveAs()));
saveAs->setStatusTip(tr("Open dialog box to save current project in any \
location")); m_actionManager->insert(saveAs, "saveprojectas", "file");
- // TAction *close = new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() \
+ "close.png"), tr("Cl&ose project"),
- // QKeySequence(tr("Ctrl+W")), m_actionManager);
-
TAction *close = new TAction(QPixmap(THEME_DIR + "icons/close.png"), tr("Cl&ose \
project"), QKeySequence(tr("Ctrl+W")), this, SLOT(closeProject()), m_actionManager);
- // connect(close, SIGNAL(triggered()), this, SLOT(closeProject()));
close->setStatusTip(tr("Close active project"));
m_actionManager->insert(close, "closeproject", "file");
@@ -439,12 +387,6 @@ void TupMainWindow::setupFileActions()
void TupMainWindow::setupSettingsActions()
{
- /*
- TAction *wizard = new TAction(tr("Launch configuration wizard..."), \
QKeySequence(),
- qobject_cast<TupApplication*>(qApp), \
SLOT(firstRun()), m_actionManager, "wizard");
- wizard->setStatusTip(tr("Launch first configuration wizard"));
- */
-
TAction *preferences = new TAction(QPixmap(THEME_DIR + "icons" + \
QDir::separator() + "properties.png"), tr("Pr&eferences..."),
QKeySequence(tr("Ctrl+P")), this, SLOT( \
preferences()), m_actionManager, "preferences");
@@ -462,51 +404,12 @@ void TupMainWindow::setupSettingsActions()
void TupMainWindow::setupHelpActions()
{
+ new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "help_mode.png"), \
tr("Help Content"), QKeySequence(tr("F1")), + this, SLOT(showHelp()), \
m_actionManager, "help"); + new TAction(QPixmap(THEME_DIR + "icons" + \
QDir::separator() + "today_tip.png"), tr("Tip of the day"), \
QKeySequence(tr("Ctrl+T")), + this, SLOT(showTipDialog()), \
m_actionManager, "tip_of_day");
new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "about.png"), \
tr("About Tupi"), QKeySequence(tr("Ctrl+K")), this, SLOT(aboutTupi()), \
m_actionManager, "about_tupi");
- new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "today_tip.png"), \
tr("Tip of the day"), QKeySequence(tr("Ctrl+T")),
- this, SLOT(showTipDialog()), m_actionManager, "tip_of_day");
-}
-
-/**
- * @if english
- * This method defines the actions for the options in the menu Window
- * @endif
- * @if spanish
- * Este metodo define las acciones para las opciones del menu Ventana
- * @endif
-
-void TupMainWindow::setupWindowActions()
-{
- // Temporary commented code - SQA required
- #if defined(QT_GUI_LIB) && defined(K_DEBUG) && defined(Q_OS_UNIX)
- new TAction(QPixmap(), tr("Show Debug Dialog"), QKeySequence(), \
TDebug::browser(), SLOT(show()), m_actionManager,
- "show debug");
- #endif
-}
-*/
-
-/**
- * @if english
- * This method defines the actions for the options in the menu Insert
- * @endif
- * @if spanish
- * Este metodo define las acciones para las opciones del menu Insertar
- * @endif
-*/
-
-void TupMainWindow::setupInsertActions()
-{
-/*
- new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "scene.png"), \
tr("Insert scene"), QKeySequence(), m_scenes,
- SLOT(emitRequestInsertScene()), m_actionManager, "InsertScene");
-
- new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "layer.png"), \
tr("Insert layer"), QKeySequence(), m_exposureSheet,
- SLOT(createLayer()), m_actionManager, "InsertLayer");
-
- new TAction(QPixmap(THEME_DIR + "icons" + QDir::separator() + "frame.png"), \
tr("Insert frame"), QKeySequence(), m_projectManager,
- SLOT(createFrame()), m_actionManager, "InsertFrame");
-*/
}
/**
@@ -576,55 +479,6 @@ void TupMainWindow::updateOpenRecentMenu(QMenu *menu, \
QStringList recents) m_recentProjectsMenu->setEnabled(true);
}
-void TupMainWindow::showWidgetPage()
-{
-/*
- TAction *action = qobject_cast<TAction *>(sender());
-
- if (action) {
- QWidget *widget = 0;
- DiDockWidget::Position position;
- QString actionText = "";
-
- if (action == m_actionManager->find("show_timeline") ) {
- widget = m_timeLine;
- position = DiDockWidget::Bottom;
- actionText = "time line widget";
- } else if ( action == m_actionManager->find("show_exposure") ) {
- widget = m_exposureSheet;
- position = DiDockWidget::Right;
- actionText = "exposure widget";
- } else if ( action == m_actionManager->find("show_library") ) {
- widget = m_libraryWidget;
- position = DiDockWidget::Left;
- actionText = "library widget";
- } else if ( action == m_actionManager->find("show_scenes") ) {
- widget = m_scenes;
- position = DiDockWidget::Right;
- actionText = "scenes widget";
- } else if ( action == m_actionManager->find("show_help") ) {
- widget = m_helper;
- position = DiDockWidget::Right;
- actionText = "help widget";
- } else if ( action == m_actionManager->find("show_palette") ) {
- widget = m_colorPalette;
- position = DiDockWidget::Left;
- actionText = "color palette widget";
- }
-
- if (widget) {
- if (widget->isVisible()) {
- toolWindow( position)->centralWidget()->setExpanded(false);
- action->setText("Show "+actionText);
- } else {
- toolWindow( position)->centralWidget()->raiseWidget(widget);
- action->setText("Hide "+actionText);
- }
- }
- }
-*/
-}
-
/**
* @if english
* This method changes the perspective view according the events
@@ -641,22 +495,14 @@ void TupMainWindow::changePerspective(QAction *action)
// Animation or Player perspective
if (perspective == Animation || perspective == Player) {
setCurrentTab(perspective - 1);
- } else {
- if (perspective == Help) { // Help perspective
+ } else {
+ if (perspective == News) // News perspective
setCurrentTab(2);
- } else if (perspective == News) { // News perspective
- setCurrentTab(3);
- }
}
action->setChecked(true);
}
-void TupMainWindow::setHelpPerspective()
-{
- setCurrentTab(2);
-}
-
void TupMainWindow::setUndoRedoActions()
{
// Setting undo/redo actions
@@ -664,13 +510,11 @@ void TupMainWindow::setUndoRedoActions()
undo->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "undo.png"));
undo->setIconVisibleInMenu(true);
undo->setShortcut(QKeySequence(tr("Ctrl+Z")));
- //undo->setShortcut(QKeySequence(QKeySequence::Undo));
QAction *redo = m_projectManager->undoHistory()->createRedoAction(this, \
tr("Redo"));
redo->setIcon(QPixmap(THEME_DIR + "icons" + QDir::separator() + "redo.png"));
redo->setIconVisibleInMenu(true);
redo->setShortcut(QKeySequence(tr("Ctrl+Y")));
- //redo->setShortcut(QKeySequence(QKeySequence::Redo));
kApp->insertGlobalAction(undo, "undo");
kApp->insertGlobalAction(redo, "redo");
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic