Rssguard now remembers fullscreen settings.

This commit is contained in:
Martin Rotter 2014-01-31 13:09:26 +01:00
parent 609a0c81b1
commit ca916c847b
5 changed files with 20 additions and 15 deletions

View File

@ -38,12 +38,12 @@ CREATE TABLE IF NOT EXISTS Feeds (
DROP TABLE IF EXISTS FeedsData;
-- !
CREATE TABLE IF NOT EXISTS FeedsData (
id INTEGER NOT NULL,
feed_id INTEGER NOT NULL,
key TEXT NOT NULL,
value TEXT,
PRIMARY KEY (id, key),
FOREIGN KEY (id) REFERENCES Feeds (id)
PRIMARY KEY (feed_id, key),
FOREIGN KEY (feed_id) REFERENCES Feeds (id)
);
-- !
DROP TABLE IF EXISTS Messages;

View File

@ -36,12 +36,12 @@ CREATE TABLE IF NOT EXISTS Feeds (
DROP TABLE IF EXISTS FeedsData;
-- !
CREATE TABLE IF NOT EXISTS FeedsData (
id INTEGER NOT NULL,
feed_id INTEGER NOT NULL,
key TEXT NOT NULL,
value TEXT,
PRIMARY KEY (id, key),
FOREIGN KEY (id) REFERENCES Feeds (id)
PRIMARY KEY (feed_id, key),
FOREIGN KEY (feed_id) REFERENCES Feeds (id)
);
-- !
DROP TABLE IF EXISTS Messages;

View File

@ -128,8 +128,8 @@ void FormMain::quit() {
qApp->quit();
}
void FormMain::switchFullscreenMode(bool turn_fullscreen_on) {
if (turn_fullscreen_on) {
void FormMain::switchFullscreenMode() {
if (!isFullScreen()) {
showFullScreen();
} else {
showNormal();
@ -256,6 +256,12 @@ void FormMain::loadSize() {
"window_position",
screen.center() - rect().center()).toPoint());
// If user exited the application while in fullsreen mode,
// then re-enable it now.
if (settings->value(APP_CFG_GUI, "start_in_fullscreen", false).toBool()) {
switchFullscreenMode();
}
// Adjust dimensions of "feeds & messages" widget.
m_ui->m_tabWidget->feedMessageViewer()->loadSize();
}
@ -265,6 +271,8 @@ void FormMain::saveSize() {
settings->setValue(APP_CFG_GUI, "window_position", pos());
settings->setValue(APP_CFG_GUI, "window_size", size());
settings->setValue(APP_CFG_GUI, "start_in_fullscreen", isFullScreen());
m_ui->m_tabWidget->feedMessageViewer()->saveSize();
}
@ -283,7 +291,7 @@ void FormMain::createConnections() {
connect(m_ui->m_actionQuit, SIGNAL(triggered()), this, SLOT(quit()));
// Menu "View" connections.
connect(m_ui->m_actionFullscreen, SIGNAL(triggered(bool)), this, SLOT(switchFullscreenMode(bool)));
connect(m_ui->m_actionFullscreen, SIGNAL(triggered()), this, SLOT(switchFullscreenMode()));
// Menu "Tools" connections.
connect(m_ui->m_actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));

View File

@ -77,7 +77,7 @@ class FormMain : public QMainWindow {
void switchVisibility();
// Turns on/off fullscreen mode
void switchFullscreenMode(bool turn_fullscreen_on);
void switchFullscreenMode();
protected slots:
// Last-minute reactors.

View File

@ -187,17 +187,14 @@
</property>
</action>
<action name="m_actionFullscreen">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Fullscreen mode</string>
<string>Switch &amp;fullscreen/normal mode</string>
</property>
<property name="toolTip">
<string>Switch fullscreen mode.</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+F</string>
<string>Ctrl+Shift+F</string>
</property>
</action>
<action name="m_actionAddBrowser">