Switched some defaults & added Web browser menu.

This commit is contained in:
Martin Rotter 2016-06-21 07:20:47 +02:00
parent 1b48758a25
commit cb3c4885c9
6 changed files with 56 additions and 28 deletions

View File

@ -8,7 +8,8 @@ Added:
Changed:
▪ Minimal Qt version bumped to 5.7.0 - this will lead to some betere features in the future.
▪ Updated miscellaneous libraries - MariadDB, openSSL.
▪ Updated miscellaneous libraries - MariadDB, openSSL (Windows only).
▪ Main menu is by default hidden, tab bar is now always visible. Main menu is now accessible via left/top corner iconified button. Users can of course tweak settings in Tools -> Options -> User interface.
Removed:
▪ All skins except default are removed because it is difficult for me to maintain all of them. Any user can pickup removed skin from repository, tweak it (it is easy) and send it to me and I will include it with next version of RSS Guard.

View File

@ -385,6 +385,11 @@ void FormMain::setupIcons() {
m_ui->m_actionAddFeedIntoSelectedAccount->setIcon(icon_theme_factory->fromTheme(QSL("application-rss+xml")));
m_ui->m_actionAddCategoryIntoSelectedAccount->setIcon(icon_theme_factory->fromTheme(QSL("folder")));
// Tabs & web browser.
m_ui->m_actionTabNewWebBrowser->setIcon(icon_theme_factory->fromTheme(QSL("tab-new")));
m_ui->m_actionTabsCloseAll->setIcon(icon_theme_factory->fromTheme(QSL("window-close")));
m_ui->m_actionTabsCloseAllExceptCurrent->setIcon(icon_theme_factory->fromTheme(QSL("window-close")));
// Setup icons on TabWidget too.
m_ui->m_tabWidget->setupIcons();
}
@ -475,6 +480,11 @@ void FormMain::createConnections() {
connect(m_ui->m_actionReportBugBitBucket, SIGNAL(triggered()), this, SLOT(reportABugOnBitBucket()));
connect(m_ui->m_actionDonate, SIGNAL(triggered()), this, SLOT(donate()));
connect(m_ui->m_actionDisplayWiki, SIGNAL(triggered()), this, SLOT(showWiki()));
// Tab widget connections.
connect(m_ui->m_actionTabsCloseAllExceptCurrent, &QAction::triggered, m_ui->m_tabWidget, &TabWidget::closeAllTabsExceptCurrent);
connect(m_ui->m_actionTabsCloseAll, &QAction::triggered, m_ui->m_tabWidget, &TabWidget::closeAllTabs);
connect(m_ui->m_actionTabNewWebBrowser, &QAction::triggered, m_ui->m_tabWidget, &TabWidget::addEmptyBrowser);
}
void FormMain::backupDatabaseSettings() {

View File

@ -160,12 +160,21 @@
<addaction name="m_actionServiceEdit"/>
<addaction name="m_actionServiceDelete"/>
</widget>
<widget class="QMenu" name="m_menuWebBrowserTabs">
<property name="title">
<string>Web browser &amp;&amp; tabs</string>
</property>
<addaction name="m_actionTabNewWebBrowser"/>
<addaction name="m_actionTabsCloseAll"/>
<addaction name="m_actionTabsCloseAllExceptCurrent"/>
</widget>
<addaction name="m_menuFile"/>
<addaction name="m_menuView"/>
<addaction name="m_menuAccounts"/>
<addaction name="m_menuFeeds"/>
<addaction name="m_menuMessages"/>
<addaction name="m_menuRecycleBin"/>
<addaction name="m_menuWebBrowserTabs"/>
<addaction name="m_menuTools"/>
<addaction name="m_menuHelp"/>
</widget>
@ -697,6 +706,21 @@
<string notr="true"/>
</property>
</action>
<action name="m_actionTabNewWebBrowser">
<property name="text">
<string>New tab</string>
</property>
</action>
<action name="m_actionTabsCloseAll">
<property name="text">
<string>Close all tabs</string>
</property>
</action>
<action name="m_actionTabsCloseAllExceptCurrent">
<property name="text">
<string>Close all tabs except current</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

View File

@ -58,9 +58,11 @@ void TabWidget::openMainMenu() {
m_menuMain = new QMenu(tr("Main menu"), this);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuFile);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuView);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuAccounts);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuFeeds);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuMessages);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuTools);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuWebBrowserTabs);
m_menuMain->addMenu(qApp->mainForm()->m_ui->m_menuHelp);
}
@ -175,35 +177,24 @@ bool TabWidget::closeCurrentTab() {
void TabWidget::closeAllTabsExceptCurrent() {
// Close tabs after active tab.
int index_of_active = currentIndex();
int total_count = count();
int iterative_index = 0;
while (total_count-- > 0) {
if (iterative_index < index_of_active) {
// Deleting tab on the left from the active one.
if (closeTab(iterative_index)) {
// We successfully deleted that LEFT tab.
for (int i = count() - 1; i >= 0; i--) {
if (i != index_of_active) {
if (i < index_of_active) {
index_of_active--;
}
else {
// We reached "non-closable" tab, go forward.
iterative_index++;
}
}
else if (iterative_index > index_of_active) {
// Deleting tab on the right from the active one.
if (!closeTab(iterative_index)) {
// We reached "non-closable" tab, go forward.
iterative_index++;
}
}
else {
// We iterate through active tab now, no deleting;
iterative_index++;
closeTab(i);
}
}
}
void TabWidget::closeAllTabs() {
for (int i = count() - 1; i >= 0; i--) {
closeTab(i);
}
}
int TabWidget::addNewspaperView(RootItem *root, const QList<Message> &messages) {
WebBrowser *prev = new WebBrowser(this);
int index = addTab(prev, qApp->icons()->fromTheme(QSL("text-x-script")), tr("Newspaper view"), TabBar::Closable);

View File

@ -103,15 +103,17 @@ class TabWidget : public QTabWidget {
bool closeTab(int index);
bool closeCurrentTab();
// Closes all "closable" tabs except the active tab.
void closeAllTabsExceptCurrent();
void closeAllTabs();
// Opens main menu.
void openMainMenu();
// Displays download manager.
void showDownloadManager();
// Closes all "closable" tabs except the active tab.
void closeAllTabsExceptCurrent();
int addNewspaperView(RootItem *root, const QList<Message> &messages);
// Adds new WebBrowser tab to global TabWidget.

View File

@ -95,7 +95,7 @@ DKEY GUI::MainWindowStartsMaximized = "window_is_maximized";
DVALUE(bool) GUI::MainWindowStartsMaximizedDef = false;
DKEY GUI::MainMenuVisible = "main_menu_visible";
DVALUE(bool) GUI::MainMenuVisibleDef = true;
DVALUE(bool) GUI::MainMenuVisibleDef = false;
DKEY GUI::ToolbarsVisible = "enable_toolbars";
DVALUE(bool) GUI::ToolbarsVisibleDef = true;
@ -125,7 +125,7 @@ DKEY GUI::TabNewDoubleClick = "tab_new_double_button";
DVALUE(bool) GUI::TabNewDoubleClickDef = true;
DKEY GUI::HideTabBarIfOnlyOneTab = "hide_tabbar_one_tab";
DVALUE(bool) GUI::HideTabBarIfOnlyOneTabDef = true;
DVALUE(bool) GUI::HideTabBarIfOnlyOneTabDef = false;
DKEY GUI::MessagesToolbarDefaultButtons = "messages_toolbar";
DVALUE(char*) GUI::MessagesToolbarDefaultButtonsDef = "m_actionMarkSelectedMessagesAsRead,m_actionMarkSelectedMessagesAsUnread,m_actionSwitchImportanceOfSelectedMessages,separator,highlighter,spacer,search";