Compare commits

..

2 Commits

3 changed files with 128 additions and 99 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.4 -->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkTextBuffer" id="entryTextBuffer"/>
@ -78,6 +78,93 @@
<property name="width_request">720</property>
<property name="height_request">405</property>
<property name="can_focus">False</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">MDiary</property>
<property name="subtitle">No workspace opened.</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="popover">popoverWorkspace</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Choose Workspace</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="buttonNew">
<property name="label" translatable="yes">New Entry</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="buttonDecrypt">
<property name="label" translatable="yes">Decrypt GPG</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">imageDecrypt</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkPaned" id="mainPane">
<property name="visible">True</property>
@ -409,93 +496,6 @@
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">MDiary</property>
<property name="subtitle">No workspace opened.</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="popover">popoverWorkspace</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Choose Workspace</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">pan-down-symbolic</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="buttonDecrypt">
<property name="label" translatable="yes">Decrypt GPG</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">imageDecrypt</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="buttonNew">
<property name="label" translatable="yes">New Entry</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
</object>
<object class="GtkPopover" id="popoverDate">
<property name="can_focus">False</property>
@ -514,6 +514,19 @@
<property name="can_focus">False</property>
<property name="window_position">center</property>
<property name="destroy_with_parent">True</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">Preferences</property>
<property name="has_subtitle">False</property>
<property name="show_close_button">True</property>
<property name="decoration_layout">close:</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -627,18 +640,18 @@
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title">Preferences</property>
<property name="has_subtitle">False</property>
<property name="show_close_button">True</property>
<property name="decoration_layout">close:</property>
<child>
<placeholder/>
<object class="GtkButton" id="buttonOpenWorkspaceFolder">
<property name="label" translatable="yes">Open Workspace in File Browser</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>

View File

@ -527,6 +527,13 @@ static void mainWindow_settings_buttonCustomNewFileDateFormat_clicked(GtkComboBo
}
}
static void mainWindow_settings_buttonOpenWorkspaceFolder_clicked(GtkComboBox *widget, gpointer user_data)
{
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
mainWindow_openExternalEditor(mainWindow->currentWorkspaceUrl);
}
const gchar *newDateFormats[] = {"%d.%m.%Y %H:%M",
"%Y-%m-%d %H:%M",
NULL};
@ -605,6 +612,11 @@ static void mainWindow_configure_settings_dialog(struct mainWindow *mainWindow)
(GCallback) mainWindow_settings_buttonCustomNewFileDateFormat_clicked,
mainWindow);
g_signal_connect(mainWindow->settingsDialog.buttonOpenWorkspaceFolder,
"clicked",
(GCallback) mainWindow_settings_buttonOpenWorkspaceFolder_clicked,
mainWindow);
g_signal_connect(mainWindow->settingsDialog.settingsDialog,
"delete-event",
(GCallback) mainWindow_settings_delete_event,
@ -664,6 +676,7 @@ struct mainWindow *mainWindow_new()
mainWindow->settingsDialog.stackNewDateFormat = GTK_WIDGET(gtk_builder_get_object(builder, "stackNewDateFormat"));
mainWindow->settingsDialog.entryNewDateFormat = GTK_WIDGET(gtk_builder_get_object(builder, "entryNewDateFormat"));
mainWindow->settingsDialog.buttonCustomNewFileDateFormat = GTK_WIDGET(gtk_builder_get_object(builder, "buttonCustomNewFileDateFormat"));
mainWindow->settingsDialog.buttonOpenWorkspaceFolder = GTK_WIDGET(gtk_builder_get_object(builder, "buttonOpenWorkspaceFolder"));
mainWindow->filterSettings.time_start = 0;
mainWindow->filterSettings.time_end = -1;
@ -711,6 +724,8 @@ void mainWindow_set_meta_information(struct mainWindow *mainWindow,
mainWindow->time_latest = time_latest;
mainWindow->filterSettings.hide_all = hide_all;
gtk_widget_set_sensitive(mainWindow->mainPane, !hide_all);
gtk_widget_set_sensitive(mainWindow->settingsDialog.buttonOpenWorkspaceFolder,
!hide_all);
mainWindow_clearSearch(NULL, mainWindow);
}

View File

@ -93,6 +93,7 @@ struct mainWindow {
GtkWidget *stackNewDateFormat;
GtkWidget *comboNewDateFormat;
GtkWidget *buttonCustomNewFileDateFormat;
GtkWidget *buttonOpenWorkspaceFolder;
GtkWidget *entryNewDateFormat;
} settingsDialog;
};