Start adding actions to the mainwindow

This commit is contained in:
Luca Beltrame 2013-12-24 09:26:29 +01:00
parent 1d09d12345
commit aa5588d286
2 changed files with 27 additions and 2 deletions

View file

@ -53,7 +53,8 @@ namespace Danbooru {
// mainwindow to automatically save settings if changed: window size,
// toolbar position, icon size, etc.
setupGUI();
}
DanbooruMainWindow::~DanbooruMainWindow()
@ -62,8 +63,31 @@ namespace Danbooru {
void DanbooruMainWindow::setupActions()
{
KAction* connectAction = new KAction(
KIcon(QLatin1String("document-open-remote")),
i18n("Connect..."),
this);
KAction* fetch = new KAction(KIcon(QLatin1String("download")),
i18n("Download"), this);
connectAction->setShortcut(KStandardShortcut::open());
fetch->setShortcut(KStandardShortcut::find());
fetch->setEnabled(false);
actionCollection()->addAction(QLatin1String("connect"), connectAction);
actionCollection()->addAction(QLatin1String("fetch"), fetch);
// actionCollection()->removeAction(actionCollection()->action("help_contents"));
// KStandardAction::openNew(this, SLOT(fileNew()), actionCollection());
// KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection());
KStandardAction::quit(qApp, SLOT(close()), actionCollection());
connect(connectAction, SIGNAL(triggered(bool)), this, SLOT(connectToBoard()));
connect(fetch, SIGNAL(triggered(bool)), this, SLOT(downloadPosts()));
//
// KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
//

View file

@ -58,6 +58,7 @@ namespace Danbooru {
private:
void setupActions();
void setupConnections();
private:
DanbooruClientView *m_view;