Start adding actions to the mainwindow
This commit is contained in:
parent
1d09d12345
commit
aa5588d286
2 changed files with 27 additions and 2 deletions
|
@ -53,7 +53,8 @@ namespace Danbooru {
|
||||||
// mainwindow to automatically save settings if changed: window size,
|
// mainwindow to automatically save settings if changed: window size,
|
||||||
// toolbar position, icon size, etc.
|
// toolbar position, icon size, etc.
|
||||||
setupGUI();
|
setupGUI();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DanbooruMainWindow::~DanbooruMainWindow()
|
DanbooruMainWindow::~DanbooruMainWindow()
|
||||||
|
@ -62,8 +63,31 @@ namespace Danbooru {
|
||||||
|
|
||||||
void DanbooruMainWindow::setupActions()
|
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::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());
|
// KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
|
||||||
//
|
//
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace Danbooru {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupActions();
|
void setupActions();
|
||||||
|
void setupConnections();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DanbooruClientView *m_view;
|
DanbooruClientView *m_view;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue