Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit 923c4b6

Browse files
committed
Fix some runtime errors with this signature: @browser_main_loop. Hope this fixes all of them.
1 parent 29930a2 commit 923c4b6

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ Makefile
4242
appshell.Makefile
4343
Brackets.target.mk
4444
libcef_dll_wrapper.target.mk
45+
appshell/gtk
46+
appshell/gtk/*
47+

appshell/cefclient_gtk.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,14 @@ int main(int argc, char* argv[]) {
148148

149149
GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
150150

151+
#ifdef SHOW_TOOLBAR_UI
151152
GtkToolItem* back = gtk_tool_button_new(NULL, NULL);
152153
GtkToolItem* forward = gtk_tool_button_new(NULL, NULL);
153154
GtkToolItem* reload = gtk_tool_button_new(NULL, NULL);
154155
GtkToolItem* stop = gtk_tool_button_new(NULL, NULL);
155156

156157
GtkWidget* m_editWnd = gtk_entry_new();
158+
#endif // SHOW_TOOLBAR_UI
157159

158160
g_signal_connect(G_OBJECT(window), "delete_event",
159161
G_CALLBACK(HandleQuit), NULL);
@@ -165,9 +167,11 @@ int main(int argc, char* argv[]) {
165167
// Create the handler.
166168
g_handler = new ClientHandler();
167169
g_handler->SetMainHwnd(vbox);
170+
#ifdef SHOW_TOOLBAR_UI
168171
g_handler->SetEditHwnd(m_editWnd);
169172
g_handler->SetButtonHwnds(GTK_WIDGET(back), GTK_WIDGET(forward),
170173
GTK_WIDGET(reload), GTK_WIDGET(stop));
174+
#endif // SHOW_TOOLBAR_UI
171175

172176
// Create the browser view.
173177
CefWindowInfo window_info;
@@ -199,3 +203,4 @@ int main(int argc, char* argv[]) {
199203

200204
return 0;
201205
}
206+

appshell/client_app_gtk.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ extern char _binary_appshell_appshell_extensions_js_start;
3737

3838
CefString ClientApp::GetCurrentLanguage()
3939
{
40-
<<<<<<< HEAD
41-
//TODO proper locale in GTK
42-
printf("in GetCurrentLanguage: ");
43-
const char* locconst = pango_language_to_string( gtk_get_default_language() );
44-
//printf( "%s\n", locconst ); // for me it prints "en-us", so I have to strip everything after the "-"
45-
char loc[10] = {0};
46-
strncpy(loc, locconst, 9);
47-
for(int i=0; i<8; i++)
48-
if ( (loc[i] == '-') || (loc[i] == '_') ) { loc[i] = 0; break; }
49-
printf( "%s\n", loc ); // here it prints just "en"
50-
return CefString(loc);
51-
=======
5240
const char* locconst = pango_language_to_string( gtk_get_default_language() );
5341
//Rado: for me it prints "en-us", so I have to strip everything after the "-"
5442
char loc[10] = {0};
@@ -58,7 +46,6 @@ CefString ClientApp::GetCurrentLanguage()
5846

5947
//TODO Explore possibility of using locale as-is, without stripping
6048
return CefString(loc);
61-
>>>>>>> linux/linux
6249
}
6350

6451
std::string ClientApp::GetExtensionJSSource()

appshell/client_handler_gtk.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser,
2727
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
2828
CefRefPtr<CefFrame> frame,
2929
const CefString& url) {
30+
#ifdef SHOW_TOOLBAR_UI
3031
REQUIRE_UI_THREAD();
3132

3233
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
3334
// Set the edit window text
3435
std::string urlStr(url);
3536
gtk_entry_set_text(GTK_ENTRY(m_EditHwnd), urlStr.c_str());
3637
}
38+
#endif // SHOW_TOOLBAR_UI
3739
}
3840

3941
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
@@ -52,13 +54,16 @@ void ClientHandler::SendNotification(NotificationType type) {
5254
}
5355

5456
void ClientHandler::SetLoading(bool isLoading) {
57+
#ifdef SHOW_TOOLBAR_UI
5558
if (isLoading)
5659
gtk_widget_set_sensitive(GTK_WIDGET(m_StopHwnd), true);
5760
else
5861
gtk_widget_set_sensitive(GTK_WIDGET(m_StopHwnd), false);
62+
#endif // SHOW_TOOLBAR_UI
5963
}
6064

6165
void ClientHandler::SetNavState(bool canGoBack, bool canGoForward) {
66+
#ifdef SHOW_TOOLBAR_UI
6267
if (canGoBack)
6368
gtk_widget_set_sensitive(GTK_WIDGET(m_BackHwnd), true);
6469
else
@@ -68,6 +73,7 @@ void ClientHandler::SetNavState(bool canGoBack, bool canGoForward) {
6873
gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), true);
6974
else
7075
gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), false);
76+
#endif // SHOW_TOOLBAR_UI
7177
}
7278

7379
void ClientHandler::CloseMainWindow() {
@@ -86,3 +92,4 @@ void ClientHandler::PopupCreated(CefRefPtr<CefBrowser> browser)
8692
bool ClientHandler::CanCloseBrowser(CefRefPtr<CefBrowser> browser) {
8793
return true;
8894
}
95+

0 commit comments

Comments
 (0)